← back to Bertha
chore(alshi-dash,kalshi-dash): update 4 files (.js) [+258/-176] Files changed: D kalshi-dash/dist/assets/index-C4YFWfm7.js M kalshi-dash/dist/index.html M kalshi-dash/src/pages/Dashboard.jsx ?? kalshi-dash/dist/assets/index-_K_ynK5-.js
bb378cfb84a6c698d7c3363426d834fa2dda3564 · 2026-03-02 18:34:00 +0000 · DW Commit Agent
Files touched
D kalshi-dash/dist/assets/index-C4YFWfm7.jsA kalshi-dash/dist/assets/index-_K_ynK5-.jsM kalshi-dash/dist/index.htmlM kalshi-dash/src/pages/Dashboard.jsx
Diff
commit bb378cfb84a6c698d7c3363426d834fa2dda3564
Author: DW Commit Agent <commit-agent@dw-agents.com>
Date: Mon Mar 2 18:34:00 2026 +0000
chore(alshi-dash,kalshi-dash): update 4 files (.js) [+258/-176]
Files changed:
D kalshi-dash/dist/assets/index-C4YFWfm7.js
M kalshi-dash/dist/index.html
M kalshi-dash/src/pages/Dashboard.jsx
?? kalshi-dash/dist/assets/index-_K_ynK5-.js
---
kalshi-dash/dist/assets/index-C4YFWfm7.js | 157 ------------------------------
kalshi-dash/dist/assets/index-_K_ynK5-.js | 157 ++++++++++++++++++++++++++++++
kalshi-dash/dist/index.html | 2 +-
kalshi-dash/src/pages/Dashboard.jsx | 118 ++++++++++++++++++----
4 files changed, 258 insertions(+), 176 deletions(-)
diff --git a/kalshi-dash/dist/assets/index-C4YFWfm7.js b/kalshi-dash/dist/assets/index-C4YFWfm7.js
deleted file mode 100644
index 563ff3c..0000000
--- a/kalshi-dash/dist/assets/index-C4YFWfm7.js
+++ /dev/null
@@ -1,157 +0,0 @@
-function tN(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(n,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>n[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var kl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function de(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dj={exports:{}},td={},Rj={exports:{}},ae={};/**
- * @license React
- * react.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var sl=Symbol.for("react.element"),rN=Symbol.for("react.portal"),nN=Symbol.for("react.fragment"),aN=Symbol.for("react.strict_mode"),iN=Symbol.for("react.profiler"),oN=Symbol.for("react.provider"),sN=Symbol.for("react.context"),lN=Symbol.for("react.forward_ref"),cN=Symbol.for("react.suspense"),uN=Symbol.for("react.memo"),dN=Symbol.for("react.lazy"),tg=Symbol.iterator;function fN(e){return e===null||typeof e!="object"?null:(e=tg&&e[tg]||e["@@iterator"],typeof e=="function"?e:null)}var Bj={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Fj=Object.assign,zj={};function Zi(e,t,r){this.props=e,this.context=t,this.refs=zj,this.updater=r||Bj}Zi.prototype.isReactComponent={};Zi.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Zi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Wj(){}Wj.prototype=Zi.prototype;function Hm(e,t,r){this.props=e,this.context=t,this.refs=zj,this.updater=r||Bj}var Km=Hm.prototype=new Wj;Km.constructor=Hm;Fj(Km,Zi.prototype);Km.isPureReactComponent=!0;var rg=Array.isArray,Uj=Object.prototype.hasOwnProperty,Vm={current:null},Hj={key:!0,ref:!0,__self:!0,__source:!0};function Kj(e,t,r){var n,a={},i=null,s=null;if(t!=null)for(n in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)Uj.call(t,n)&&!Hj.hasOwnProperty(n)&&(a[n]=t[n]);var l=arguments.length-2;if(l===1)a.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];a.children=c}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)a[n]===void 0&&(a[n]=l[n]);return{$$typeof:sl,type:e,key:i,ref:s,props:a,_owner:Vm.current}}function hN(e,t){return{$$typeof:sl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Gm(e){return typeof e=="object"&&e!==null&&e.$$typeof===sl}function pN(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var ng=/\/+/g;function ff(e,t){return typeof e=="object"&&e!==null&&e.key!=null?pN(""+e.key):t.toString(36)}function uc(e,t,r,n,a){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case sl:case rN:s=!0}}if(s)return s=e,a=a(s),e=n===""?"."+ff(s,0):n,rg(a)?(r="",e!=null&&(r=e.replace(ng,"$&/")+"/"),uc(a,t,r,"",function(u){return u})):a!=null&&(Gm(a)&&(a=hN(a,r+(!a.key||s&&s.key===a.key?"":(""+a.key).replace(ng,"$&/")+"/")+e)),t.push(a)),1;if(s=0,n=n===""?".":n+":",rg(e))for(var l=0;l<e.length;l++){i=e[l];var c=n+ff(i,l);s+=uc(i,t,r,c,a)}else if(c=fN(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=n+ff(i,l++),s+=uc(i,t,r,c,a);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function Ol(e,t,r){if(e==null)return e;var n=[],a=0;return uc(e,n,"","",function(i){return t.call(r,i,a++)}),n}function mN(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var jt={current:null},dc={transition:null},vN={ReactCurrentDispatcher:jt,ReactCurrentBatchConfig:dc,ReactCurrentOwner:Vm};function Vj(){throw Error("act(...) is not supported in production builds of React.")}ae.Children={map:Ol,forEach:function(e,t,r){Ol(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Ol(e,function(){t++}),t},toArray:function(e){return Ol(e,function(t){return t})||[]},only:function(e){if(!Gm(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ae.Component=Zi;ae.Fragment=nN;ae.Profiler=iN;ae.PureComponent=Hm;ae.StrictMode=aN;ae.Suspense=cN;ae.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vN;ae.act=Vj;ae.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=Fj({},e.props),a=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=Vm.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)Uj.call(t,c)&&!Hj.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];n.children=l}return{$$typeof:sl,type:e.type,key:a,ref:i,props:n,_owner:s}};ae.createContext=function(e){return e={$$typeof:sN,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:oN,_context:e},e.Consumer=e};ae.createElement=Kj;ae.createFactory=function(e){var t=Kj.bind(null,e);return t.type=e,t};ae.createRef=function(){return{current:null}};ae.forwardRef=function(e){return{$$typeof:lN,render:e}};ae.isValidElement=Gm;ae.lazy=function(e){return{$$typeof:dN,_payload:{_status:-1,_result:e},_init:mN}};ae.memo=function(e,t){return{$$typeof:uN,type:e,compare:t===void 0?null:t}};ae.startTransition=function(e){var t=dc.transition;dc.transition={};try{e()}finally{dc.transition=t}};ae.unstable_act=Vj;ae.useCallback=function(e,t){return jt.current.useCallback(e,t)};ae.useContext=function(e){return jt.current.useContext(e)};ae.useDebugValue=function(){};ae.useDeferredValue=function(e){return jt.current.useDeferredValue(e)};ae.useEffect=function(e,t){return jt.current.useEffect(e,t)};ae.useId=function(){return jt.current.useId()};ae.useImperativeHandle=function(e,t,r){return jt.current.useImperativeHandle(e,t,r)};ae.useInsertionEffect=function(e,t){return jt.current.useInsertionEffect(e,t)};ae.useLayoutEffect=function(e,t){return jt.current.useLayoutEffect(e,t)};ae.useMemo=function(e,t){return jt.current.useMemo(e,t)};ae.useReducer=function(e,t,r){return jt.current.useReducer(e,t,r)};ae.useRef=function(e){return jt.current.useRef(e)};ae.useState=function(e){return jt.current.useState(e)};ae.useSyncExternalStore=function(e,t,r){return jt.current.useSyncExternalStore(e,t,r)};ae.useTransition=function(){return jt.current.useTransition()};ae.version="18.3.1";Rj.exports=ae;var P=Rj.exports;const $=de(P),yN=tN({__proto__:null,default:$},[P]);/**
- * @license React
- * react-jsx-runtime.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var gN=P,xN=Symbol.for("react.element"),bN=Symbol.for("react.fragment"),jN=Object.prototype.hasOwnProperty,wN=gN.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,SN={key:!0,ref:!0,__self:!0,__source:!0};function Gj(e,t,r){var n,a={},i=null,s=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(n in t)jN.call(t,n)&&!SN.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)a[n]===void 0&&(a[n]=t[n]);return{$$typeof:xN,type:e,key:i,ref:s,props:a,_owner:wN.current}}td.Fragment=bN;td.jsx=Gj;td.jsxs=Gj;Dj.exports=td;var o=Dj.exports,gh={},Yj={exports:{}},zt={},qj={exports:{}},Xj={};/**
- * @license React
- * scheduler.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */(function(e){function t(I,R){var F=I.length;I.push(R);e:for(;0<F;){var K=F-1>>>1,z=I[K];if(0<a(z,R))I[K]=R,I[F]=z,F=K;else break e}}function r(I){return I.length===0?null:I[0]}function n(I){if(I.length===0)return null;var R=I[0],F=I.pop();if(F!==R){I[0]=F;e:for(var K=0,z=I.length,q=z>>>1;K<q;){var ie=2*(K+1)-1,he=I[ie],ge=ie+1,Qe=I[ge];if(0>a(he,F))ge<z&&0>a(Qe,he)?(I[K]=Qe,I[ge]=F,K=ge):(I[K]=he,I[ie]=F,K=ie);else if(ge<z&&0>a(Qe,F))I[K]=Qe,I[ge]=F,K=ge;else break e}}return R}function a(I,R){var F=I.sortIndex-R.sortIndex;return F!==0?F:I.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var c=[],u=[],f=1,d=null,h=3,p=!1,g=!1,y=!1,b=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(I){for(var R=r(u);R!==null;){if(R.callback===null)n(u);else if(R.startTime<=I)n(u),R.sortIndex=R.expirationTime,t(c,R);else break;R=r(u)}}function S(I){if(y=!1,x(I),!g)if(r(c)!==null)g=!0,C(j);else{var R=r(u);R!==null&&M(S,R.startTime-I)}}function j(I,R){g=!1,y&&(y=!1,v(O),O=-1),p=!0;var F=h;try{for(x(R),d=r(c);d!==null&&(!(d.expirationTime>R)||I&&!E());){var K=d.callback;if(typeof K=="function"){d.callback=null,h=d.priorityLevel;var z=K(d.expirationTime<=R);R=e.unstable_now(),typeof z=="function"?d.callback=z:d===r(c)&&n(c),x(R)}else n(c);d=r(c)}if(d!==null)var q=!0;else{var ie=r(u);ie!==null&&M(S,ie.startTime-R),q=!1}return q}finally{d=null,h=F,p=!1}}var w=!1,_=null,O=-1,N=5,k=-1;function E(){return!(e.unstable_now()-k<N)}function T(){if(_!==null){var I=e.unstable_now();k=I;var R=!0;try{R=_(!0,I)}finally{R?D():(w=!1,_=null)}}else w=!1}var D;if(typeof m=="function")D=function(){m(T)};else if(typeof MessageChannel<"u"){var A=new MessageChannel,L=A.port2;A.port1.onmessage=T,D=function(){L.postMessage(null)}}else D=function(){b(T,0)};function C(I){_=I,w||(w=!0,D())}function M(I,R){O=b(function(){I(e.unstable_now())},R)}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(I){I.callback=null},e.unstable_continueExecution=function(){g||p||(g=!0,C(j))},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(I){switch(h){case 1:case 2:case 3:var R=3;break;default:R=h}var F=h;h=R;try{return I()}finally{h=F}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(I,R){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var F=h;h=I;try{return R()}finally{h=F}},e.unstable_scheduleCallback=function(I,R,F){var K=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?K+F:K):F=K,I){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=F+z,I={id:f++,callback:R,priorityLevel:I,startTime:F,expirationTime:z,sortIndex:-1},F>K?(I.sortIndex=F,t(u,I),r(c)===null&&I===r(u)&&(y?(v(O),O=-1):y=!0,M(S,F-K))):(I.sortIndex=z,t(c,I),g||p||(g=!0,C(j))),I},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(I){var R=h;return function(){var F=h;h=R;try{return I.apply(this,arguments)}finally{h=F}}}})(Xj);qj.exports=Xj;var _N=qj.exports;/**
- * @license React
- * react-dom.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var kN=P,Ft=_N;function H(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Qj=new Set,os={};function Na(e,t){xi(e,t),xi(e+"Capture",t)}function xi(e,t){for(os[e]=t,e=0;e<t.length;e++)Qj.add(t[e])}var qr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xh=Object.prototype.hasOwnProperty,ON=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ag={},ig={};function NN(e){return xh.call(ig,e)?!0:xh.call(ag,e)?!1:ON.test(e)?ig[e]=!0:(ag[e]=!0,!1)}function PN(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function AN(e,t,r,n){if(t===null||typeof t>"u"||PN(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function wt(e,t,r,n,a,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var ut={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ut[e]=new wt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ut[t]=new wt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ut[e]=new wt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ut[e]=new wt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ut[e]=new wt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ut[e]=new wt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ut[e]=new wt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ut[e]=new wt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ut[e]=new wt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ym=/[\-:]([a-z])/g;function qm(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ym,qm);ut[t]=new wt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ym,qm);ut[t]=new wt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ym,qm);ut[t]=new wt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ut[e]=new wt(e,1,!1,e.toLowerCase(),null,!1,!1)});ut.xlinkHref=new wt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ut[e]=new wt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Xm(e,t,r,n){var a=ut.hasOwnProperty(t)?ut[t]:null;(a!==null?a.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(AN(t,r,a,n)&&(r=null),n||a===null?NN(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):a.mustUseProperty?e[a.propertyName]=r===null?a.type===3?!1:"":r:(t=a.attributeName,n=a.attributeNamespace,r===null?e.removeAttribute(t):(a=a.type,r=a===3||a===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var nn=kN.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Nl=Symbol.for("react.element"),Ka=Symbol.for("react.portal"),Va=Symbol.for("react.fragment"),Qm=Symbol.for("react.strict_mode"),bh=Symbol.for("react.profiler"),Jj=Symbol.for("react.provider"),Zj=Symbol.for("react.context"),Jm=Symbol.for("react.forward_ref"),jh=Symbol.for("react.suspense"),wh=Symbol.for("react.suspense_list"),Zm=Symbol.for("react.memo"),fn=Symbol.for("react.lazy"),ew=Symbol.for("react.offscreen"),og=Symbol.iterator;function go(e){return e===null||typeof e!="object"?null:(e=og&&e[og]||e["@@iterator"],typeof e=="function"?e:null)}var $e=Object.assign,hf;function Ro(e){if(hf===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);hf=t&&t[1]||""}return`
-`+hf+e}var pf=!1;function mf(e,t){if(!e||pf)return"";pf=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var n=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){n=u}e.call(t.prototype)}else{try{throw Error()}catch(u){n=u}e()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var a=u.stack.split(`
-`),i=n.stack.split(`
-`),s=a.length-1,l=i.length-1;1<=s&&0<=l&&a[s]!==i[l];)l--;for(;1<=s&&0<=l;s--,l--)if(a[s]!==i[l]){if(s!==1||l!==1)do if(s--,l--,0>l||a[s]!==i[l]){var c=`
-`+a[s].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=s&&0<=l);break}}}finally{pf=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Ro(e):""}function CN(e){switch(e.tag){case 5:return Ro(e.type);case 16:return Ro("Lazy");case 13:return Ro("Suspense");case 19:return Ro("SuspenseList");case 0:case 2:case 15:return e=mf(e.type,!1),e;case 11:return e=mf(e.type.render,!1),e;case 1:return e=mf(e.type,!0),e;default:return""}}function Sh(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Va:return"Fragment";case Ka:return"Portal";case bh:return"Profiler";case Qm:return"StrictMode";case jh:return"Suspense";case wh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Zj:return(e.displayName||"Context")+".Consumer";case Jj:return(e._context.displayName||"Context")+".Provider";case Jm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Zm:return t=e.displayName||null,t!==null?t:Sh(e.type)||"Memo";case fn:t=e._payload,e=e._init;try{return Sh(e(t))}catch{}}return null}function EN(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Sh(t);case 8:return t===Qm?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Mn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function tw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function $N(e){var t=tw(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(s){n=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Pl(e){e._valueTracker||(e._valueTracker=$N(e))}function rw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=tw(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function kc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function _h(e,t){var r=t.checked;return $e({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function sg(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Mn(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function nw(e,t){t=t.checked,t!=null&&Xm(e,"checked",t,!1)}function kh(e,t){nw(e,t);var r=Mn(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Oh(e,t.type,r):t.hasOwnProperty("defaultValue")&&Oh(e,t.type,Mn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function lg(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Oh(e,t,r){(t!=="number"||kc(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Bo=Array.isArray;function li(e,t,r,n){if(e=e.options,t){t={};for(var a=0;a<r.length;a++)t["$"+r[a]]=!0;for(r=0;r<e.length;r++)a=t.hasOwnProperty("$"+e[r].value),e[r].selected!==a&&(e[r].selected=a),a&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Mn(r),t=null,a=0;a<e.length;a++){if(e[a].value===r){e[a].selected=!0,n&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function Nh(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(H(91));return $e({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function cg(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(H(92));if(Bo(r)){if(1<r.length)throw Error(H(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Mn(r)}}function aw(e,t){var r=Mn(t.value),n=Mn(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function ug(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function iw(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ph(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?iw(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Al,ow=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,a){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Al=Al||document.createElement("div"),Al.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Al.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ss(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ko={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},TN=["Webkit","ms","Moz","O"];Object.keys(Ko).forEach(function(e){TN.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ko[t]=Ko[e]})});function sw(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ko.hasOwnProperty(e)&&Ko[e]?(""+t).trim():t+"px"}function lw(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,a=sw(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,a):e[r]=a}}var MN=$e({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ah(e,t){if(t){if(MN[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function Ch(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Eh=null;function ev(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $h=null,ci=null,ui=null;function dg(e){if(e=ul(e)){if(typeof $h!="function")throw Error(H(280));var t=e.stateNode;t&&(t=od(t),$h(e.stateNode,e.type,t))}}function cw(e){ci?ui?ui.push(e):ui=[e]:ci=e}function uw(){if(ci){var e=ci,t=ui;if(ui=ci=null,dg(e),t)for(e=0;e<t.length;e++)dg(t[e])}}function dw(e,t){return e(t)}function fw(){}var vf=!1;function hw(e,t,r){if(vf)return e(t,r);vf=!0;try{return dw(e,t,r)}finally{vf=!1,(ci!==null||ui!==null)&&(fw(),uw())}}function ls(e,t){var r=e.stateNode;if(r===null)return null;var n=od(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(H(231,t,typeof r));return r}var Th=!1;if(qr)try{var xo={};Object.defineProperty(xo,"passive",{get:function(){Th=!0}}),window.addEventListener("test",xo,xo),window.removeEventListener("test",xo,xo)}catch{Th=!1}function IN(e,t,r,n,a,i,s,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(f){this.onError(f)}}var Vo=!1,Oc=null,Nc=!1,Mh=null,LN={onError:function(e){Vo=!0,Oc=e}};function DN(e,t,r,n,a,i,s,l,c){Vo=!1,Oc=null,IN.apply(LN,arguments)}function RN(e,t,r,n,a,i,s,l,c){if(DN.apply(this,arguments),Vo){if(Vo){var u=Oc;Vo=!1,Oc=null}else throw Error(H(198));Nc||(Nc=!0,Mh=u)}}function Pa(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function pw(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function fg(e){if(Pa(e)!==e)throw Error(H(188))}function BN(e){var t=e.alternate;if(!t){if(t=Pa(e),t===null)throw Error(H(188));return t!==e?null:e}for(var r=e,n=t;;){var a=r.return;if(a===null)break;var i=a.alternate;if(i===null){if(n=a.return,n!==null){r=n;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===r)return fg(a),e;if(i===n)return fg(a),t;i=i.sibling}throw Error(H(188))}if(r.return!==n.return)r=a,n=i;else{for(var s=!1,l=a.child;l;){if(l===r){s=!0,r=a,n=i;break}if(l===n){s=!0,n=a,r=i;break}l=l.sibling}if(!s){for(l=i.child;l;){if(l===r){s=!0,r=i,n=a;break}if(l===n){s=!0,n=i,r=a;break}l=l.sibling}if(!s)throw Error(H(189))}}if(r.alternate!==n)throw Error(H(190))}if(r.tag!==3)throw Error(H(188));return r.stateNode.current===r?e:t}function mw(e){return e=BN(e),e!==null?vw(e):null}function vw(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=vw(e);if(t!==null)return t;e=e.sibling}return null}var yw=Ft.unstable_scheduleCallback,hg=Ft.unstable_cancelCallback,FN=Ft.unstable_shouldYield,zN=Ft.unstable_requestPaint,Le=Ft.unstable_now,WN=Ft.unstable_getCurrentPriorityLevel,tv=Ft.unstable_ImmediatePriority,gw=Ft.unstable_UserBlockingPriority,Pc=Ft.unstable_NormalPriority,UN=Ft.unstable_LowPriority,xw=Ft.unstable_IdlePriority,rd=null,Nr=null;function HN(e){if(Nr&&typeof Nr.onCommitFiberRoot=="function")try{Nr.onCommitFiberRoot(rd,e,void 0,(e.current.flags&128)===128)}catch{}}var pr=Math.clz32?Math.clz32:GN,KN=Math.log,VN=Math.LN2;function GN(e){return e>>>=0,e===0?32:31-(KN(e)/VN|0)|0}var Cl=64,El=4194304;function Fo(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ac(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,a=e.suspendedLanes,i=e.pingedLanes,s=r&268435455;if(s!==0){var l=s&~a;l!==0?n=Fo(l):(i&=s,i!==0&&(n=Fo(i)))}else s=r&~a,s!==0?n=Fo(s):i!==0&&(n=Fo(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&a)&&(a=n&-n,i=t&-t,a>=i||a===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-pr(t),a=1<<r,n|=e[r],t&=~a;return n}function YN(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function qN(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-pr(i),l=1<<s,c=a[s];c===-1?(!(l&r)||l&n)&&(a[s]=YN(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function Ih(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function bw(){var e=Cl;return Cl<<=1,!(Cl&4194240)&&(Cl=64),e}function yf(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function ll(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-pr(t),e[t]=r}function XN(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var a=31-pr(r),i=1<<a;t[a]=0,n[a]=-1,e[a]=-1,r&=~i}}function rv(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-pr(r),a=1<<n;a&t|e[n]&t&&(e[n]|=t),r&=~a}}var ue=0;function jw(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var ww,nv,Sw,_w,kw,Lh=!1,$l=[],_n=null,kn=null,On=null,cs=new Map,us=new Map,mn=[],QN="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function pg(e,t){switch(e){case"focusin":case"focusout":_n=null;break;case"dragenter":case"dragleave":kn=null;break;case"mouseover":case"mouseout":On=null;break;case"pointerover":case"pointerout":cs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":us.delete(t.pointerId)}}function bo(e,t,r,n,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[a]},t!==null&&(t=ul(t),t!==null&&nv(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function JN(e,t,r,n,a){switch(t){case"focusin":return _n=bo(_n,e,t,r,n,a),!0;case"dragenter":return kn=bo(kn,e,t,r,n,a),!0;case"mouseover":return On=bo(On,e,t,r,n,a),!0;case"pointerover":var i=a.pointerId;return cs.set(i,bo(cs.get(i)||null,e,t,r,n,a)),!0;case"gotpointercapture":return i=a.pointerId,us.set(i,bo(us.get(i)||null,e,t,r,n,a)),!0}return!1}function Ow(e){var t=ra(e.target);if(t!==null){var r=Pa(t);if(r!==null){if(t=r.tag,t===13){if(t=pw(r),t!==null){e.blockedOn=t,kw(e.priority,function(){Sw(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function fc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Dh(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);Eh=n,r.target.dispatchEvent(n),Eh=null}else return t=ul(r),t!==null&&nv(t),e.blockedOn=r,!1;t.shift()}return!0}function mg(e,t,r){fc(e)&&r.delete(t)}function ZN(){Lh=!1,_n!==null&&fc(_n)&&(_n=null),kn!==null&&fc(kn)&&(kn=null),On!==null&&fc(On)&&(On=null),cs.forEach(mg),us.forEach(mg)}function jo(e,t){e.blockedOn===t&&(e.blockedOn=null,Lh||(Lh=!0,Ft.unstable_scheduleCallback(Ft.unstable_NormalPriority,ZN)))}function ds(e){function t(a){return jo(a,e)}if(0<$l.length){jo($l[0],e);for(var r=1;r<$l.length;r++){var n=$l[r];n.blockedOn===e&&(n.blockedOn=null)}}for(_n!==null&&jo(_n,e),kn!==null&&jo(kn,e),On!==null&&jo(On,e),cs.forEach(t),us.forEach(t),r=0;r<mn.length;r++)n=mn[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<mn.length&&(r=mn[0],r.blockedOn===null);)Ow(r),r.blockedOn===null&&mn.shift()}var di=nn.ReactCurrentBatchConfig,Cc=!0;function eP(e,t,r,n){var a=ue,i=di.transition;di.transition=null;try{ue=1,av(e,t,r,n)}finally{ue=a,di.transition=i}}function tP(e,t,r,n){var a=ue,i=di.transition;di.transition=null;try{ue=4,av(e,t,r,n)}finally{ue=a,di.transition=i}}function av(e,t,r,n){if(Cc){var a=Dh(e,t,r,n);if(a===null)Nf(e,t,n,Ec,r),pg(e,n);else if(JN(a,e,t,r,n))n.stopPropagation();else if(pg(e,n),t&4&&-1<QN.indexOf(e)){for(;a!==null;){var i=ul(a);if(i!==null&&ww(i),i=Dh(e,t,r,n),i===null&&Nf(e,t,n,Ec,r),i===a)break;a=i}a!==null&&n.stopPropagation()}else Nf(e,t,n,null,r)}}var Ec=null;function Dh(e,t,r,n){if(Ec=null,e=ev(n),e=ra(e),e!==null)if(t=Pa(e),t===null)e=null;else if(r=t.tag,r===13){if(e=pw(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ec=e,null}function Nw(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(WN()){case tv:return 1;case gw:return 4;case Pc:case UN:return 16;case xw:return 536870912;default:return 16}default:return 16}}var gn=null,iv=null,hc=null;function Pw(){if(hc)return hc;var e,t=iv,r=t.length,n,a="value"in gn?gn.value:gn.textContent,i=a.length;for(e=0;e<r&&t[e]===a[e];e++);var s=r-e;for(n=1;n<=s&&t[r-n]===a[i-n];n++);return hc=a.slice(e,1<n?1-n:void 0)}function pc(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Tl(){return!0}function vg(){return!1}function Wt(e){function t(r,n,a,i,s){this._reactName=r,this._targetInst=a,this.type=n,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Tl:vg,this.isPropagationStopped=vg,this}return $e(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Tl)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Tl)},persist:function(){},isPersistent:Tl}),t}var eo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ov=Wt(eo),cl=$e({},eo,{view:0,detail:0}),rP=Wt(cl),gf,xf,wo,nd=$e({},cl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:sv,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==wo&&(wo&&e.type==="mousemove"?(gf=e.screenX-wo.screenX,xf=e.screenY-wo.screenY):xf=gf=0,wo=e),gf)},movementY:function(e){return"movementY"in e?e.movementY:xf}}),yg=Wt(nd),nP=$e({},nd,{dataTransfer:0}),aP=Wt(nP),iP=$e({},cl,{relatedTarget:0}),bf=Wt(iP),oP=$e({},eo,{animationName:0,elapsedTime:0,pseudoElement:0}),sP=Wt(oP),lP=$e({},eo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),cP=Wt(lP),uP=$e({},eo,{data:0}),gg=Wt(uP),dP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fP={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},hP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function pP(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=hP[e])?!!t[e]:!1}function sv(){return pP}var mP=$e({},cl,{key:function(e){if(e.key){var t=dP[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=pc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?fP[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:sv,charCode:function(e){return e.type==="keypress"?pc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?pc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),vP=Wt(mP),yP=$e({},nd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xg=Wt(yP),gP=$e({},cl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:sv}),xP=Wt(gP),bP=$e({},eo,{propertyName:0,elapsedTime:0,pseudoElement:0}),jP=Wt(bP),wP=$e({},nd,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),SP=Wt(wP),_P=[9,13,27,32],lv=qr&&"CompositionEvent"in window,Go=null;qr&&"documentMode"in document&&(Go=document.documentMode);var kP=qr&&"TextEvent"in window&&!Go,Aw=qr&&(!lv||Go&&8<Go&&11>=Go),bg=" ",jg=!1;function Cw(e,t){switch(e){case"keyup":return _P.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ew(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ga=!1;function OP(e,t){switch(e){case"compositionend":return Ew(t);case"keypress":return t.which!==32?null:(jg=!0,bg);case"textInput":return e=t.data,e===bg&&jg?null:e;default:return null}}function NP(e,t){if(Ga)return e==="compositionend"||!lv&&Cw(e,t)?(e=Pw(),hc=iv=gn=null,Ga=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Aw&&t.locale!=="ko"?null:t.data;default:return null}}var PP={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function wg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!PP[e.type]:t==="textarea"}function $w(e,t,r,n){cw(n),t=$c(t,"onChange"),0<t.length&&(r=new ov("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Yo=null,fs=null;function AP(e){Uw(e,0)}function ad(e){var t=Xa(e);if(rw(t))return e}function CP(e,t){if(e==="change")return t}var Tw=!1;if(qr){var jf;if(qr){var wf="oninput"in document;if(!wf){var Sg=document.createElement("div");Sg.setAttribute("oninput","return;"),wf=typeof Sg.oninput=="function"}jf=wf}else jf=!1;Tw=jf&&(!document.documentMode||9<document.documentMode)}function _g(){Yo&&(Yo.detachEvent("onpropertychange",Mw),fs=Yo=null)}function Mw(e){if(e.propertyName==="value"&&ad(fs)){var t=[];$w(t,fs,e,ev(e)),hw(AP,t)}}function EP(e,t,r){e==="focusin"?(_g(),Yo=t,fs=r,Yo.attachEvent("onpropertychange",Mw)):e==="focusout"&&_g()}function $P(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ad(fs)}function TP(e,t){if(e==="click")return ad(t)}function MP(e,t){if(e==="input"||e==="change")return ad(t)}function IP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yr=typeof Object.is=="function"?Object.is:IP;function hs(e,t){if(yr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var a=r[n];if(!xh.call(t,a)||!yr(e[a],t[a]))return!1}return!0}function kg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Og(e,t){var r=kg(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=kg(r)}}function Iw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Iw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Lw(){for(var e=window,t=kc();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=kc(e.document)}return t}function cv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function LP(e){var t=Lw(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Iw(r.ownerDocument.documentElement,r)){if(n!==null&&cv(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=r.textContent.length,i=Math.min(n.start,a);n=n.end===void 0?i:Math.min(n.end,a),!e.extend&&i>n&&(a=n,n=i,i=a),a=Og(r,i);var s=Og(r,n);a&&s&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var DP=qr&&"documentMode"in document&&11>=document.documentMode,Ya=null,Rh=null,qo=null,Bh=!1;function Ng(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Bh||Ya==null||Ya!==kc(n)||(n=Ya,"selectionStart"in n&&cv(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),qo&&hs(qo,n)||(qo=n,n=$c(Rh,"onSelect"),0<n.length&&(t=new ov("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Ya)))}function Ml(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var qa={animationend:Ml("Animation","AnimationEnd"),animationiteration:Ml("Animation","AnimationIteration"),animationstart:Ml("Animation","AnimationStart"),transitionend:Ml("Transition","TransitionEnd")},Sf={},Dw={};qr&&(Dw=document.createElement("div").style,"AnimationEvent"in window||(delete qa.animationend.animation,delete qa.animationiteration.animation,delete qa.animationstart.animation),"TransitionEvent"in window||delete qa.transitionend.transition);function id(e){if(Sf[e])return Sf[e];if(!qa[e])return e;var t=qa[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Dw)return Sf[e]=t[r];return e}var Rw=id("animationend"),Bw=id("animationiteration"),Fw=id("animationstart"),zw=id("transitionend"),Ww=new Map,Pg="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ln(e,t){Ww.set(e,t),Na(t,[e])}for(var _f=0;_f<Pg.length;_f++){var kf=Pg[_f],RP=kf.toLowerCase(),BP=kf[0].toUpperCase()+kf.slice(1);Ln(RP,"on"+BP)}Ln(Rw,"onAnimationEnd");Ln(Bw,"onAnimationIteration");Ln(Fw,"onAnimationStart");Ln("dblclick","onDoubleClick");Ln("focusin","onFocus");Ln("focusout","onBlur");Ln(zw,"onTransitionEnd");xi("onMouseEnter",["mouseout","mouseover"]);xi("onMouseLeave",["mouseout","mouseover"]);xi("onPointerEnter",["pointerout","pointerover"]);xi("onPointerLeave",["pointerout","pointerover"]);Na("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Na("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Na("onBeforeInput",["compositionend","keypress","textInput","paste"]);Na("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Na("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Na("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var zo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),FP=new Set("cancel close invalid load scroll toggle".split(" ").concat(zo));function Ag(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,RN(n,t,void 0,e),e.currentTarget=null}function Uw(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],a=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var s=n.length-1;0<=s;s--){var l=n[s],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&a.isPropagationStopped())break e;Ag(a,l,u),i=c}else for(s=0;s<n.length;s++){if(l=n[s],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&a.isPropagationStopped())break e;Ag(a,l,u),i=c}}}if(Nc)throw e=Mh,Nc=!1,Mh=null,e}function we(e,t){var r=t[Hh];r===void 0&&(r=t[Hh]=new Set);var n=e+"__bubble";r.has(n)||(Hw(t,e,2,!1),r.add(n))}function Of(e,t,r){var n=0;t&&(n|=4),Hw(r,e,n,t)}var Il="_reactListening"+Math.random().toString(36).slice(2);function ps(e){if(!e[Il]){e[Il]=!0,Qj.forEach(function(r){r!=="selectionchange"&&(FP.has(r)||Of(r,!1,e),Of(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Il]||(t[Il]=!0,Of("selectionchange",!1,t))}}function Hw(e,t,r,n){switch(Nw(t)){case 1:var a=eP;break;case 4:a=tP;break;default:a=av}r=a.bind(null,t,r,e),a=void 0,!Th||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),n?a!==void 0?e.addEventListener(t,r,{capture:!0,passive:a}):e.addEventListener(t,r,!0):a!==void 0?e.addEventListener(t,r,{passive:a}):e.addEventListener(t,r,!1)}function Nf(e,t,r,n,a){var i=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var s=n.tag;if(s===3||s===4){var l=n.stateNode.containerInfo;if(l===a||l.nodeType===8&&l.parentNode===a)break;if(s===4)for(s=n.return;s!==null;){var c=s.tag;if((c===3||c===4)&&(c=s.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;s=s.return}for(;l!==null;){if(s=ra(l),s===null)return;if(c=s.tag,c===5||c===6){n=i=s;continue e}l=l.parentNode}}n=n.return}hw(function(){var u=i,f=ev(r),d=[];e:{var h=Ww.get(e);if(h!==void 0){var p=ov,g=e;switch(e){case"keypress":if(pc(r)===0)break e;case"keydown":case"keyup":p=vP;break;case"focusin":g="focus",p=bf;break;case"focusout":g="blur",p=bf;break;case"beforeblur":case"afterblur":p=bf;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=yg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=aP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=xP;break;case Rw:case Bw:case Fw:p=sP;break;case zw:p=jP;break;case"scroll":p=rP;break;case"wheel":p=SP;break;case"copy":case"cut":case"paste":p=cP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=xg}var y=(t&4)!==0,b=!y&&e==="scroll",v=y?h!==null?h+"Capture":null:h;y=[];for(var m=u,x;m!==null;){x=m;var S=x.stateNode;if(x.tag===5&&S!==null&&(x=S,v!==null&&(S=ls(m,v),S!=null&&y.push(ms(m,S,x)))),b)break;m=m.return}0<y.length&&(h=new p(h,g,null,r,f),d.push({event:h,listeners:y}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&r!==Eh&&(g=r.relatedTarget||r.fromElement)&&(ra(g)||g[Xr]))break e;if((p||h)&&(h=f.window===f?f:(h=f.ownerDocument)?h.defaultView||h.parentWindow:window,p?(g=r.relatedTarget||r.toElement,p=u,g=g?ra(g):null,g!==null&&(b=Pa(g),g!==b||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=u),p!==g)){if(y=yg,S="onMouseLeave",v="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(y=xg,S="onPointerLeave",v="onPointerEnter",m="pointer"),b=p==null?h:Xa(p),x=g==null?h:Xa(g),h=new y(S,m+"leave",p,r,f),h.target=b,h.relatedTarget=x,S=null,ra(f)===u&&(y=new y(v,m+"enter",g,r,f),y.target=x,y.relatedTarget=b,S=y),b=S,p&&g)t:{for(y=p,v=g,m=0,x=y;x;x=La(x))m++;for(x=0,S=v;S;S=La(S))x++;for(;0<m-x;)y=La(y),m--;for(;0<x-m;)v=La(v),x--;for(;m--;){if(y===v||v!==null&&y===v.alternate)break t;y=La(y),v=La(v)}y=null}else y=null;p!==null&&Cg(d,h,p,y,!1),g!==null&&b!==null&&Cg(d,b,g,y,!0)}}e:{if(h=u?Xa(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var j=CP;else if(wg(h))if(Tw)j=MP;else{j=$P;var w=EP}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(j=TP);if(j&&(j=j(e,u))){$w(d,j,r,f);break e}w&&w(e,h,u),e==="focusout"&&(w=h._wrapperState)&&w.controlled&&h.type==="number"&&Oh(h,"number",h.value)}switch(w=u?Xa(u):window,e){case"focusin":(wg(w)||w.contentEditable==="true")&&(Ya=w,Rh=u,qo=null);break;case"focusout":qo=Rh=Ya=null;break;case"mousedown":Bh=!0;break;case"contextmenu":case"mouseup":case"dragend":Bh=!1,Ng(d,r,f);break;case"selectionchange":if(DP)break;case"keydown":case"keyup":Ng(d,r,f)}var _;if(lv)e:{switch(e){case"compositionstart":var O="onCompositionStart";break e;case"compositionend":O="onCompositionEnd";break e;case"compositionupdate":O="onCompositionUpdate";break e}O=void 0}else Ga?Cw(e,r)&&(O="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(O="onCompositionStart");O&&(Aw&&r.locale!=="ko"&&(Ga||O!=="onCompositionStart"?O==="onCompositionEnd"&&Ga&&(_=Pw()):(gn=f,iv="value"in gn?gn.value:gn.textContent,Ga=!0)),w=$c(u,O),0<w.length&&(O=new gg(O,e,null,r,f),d.push({event:O,listeners:w}),_?O.data=_:(_=Ew(r),_!==null&&(O.data=_)))),(_=kP?OP(e,r):NP(e,r))&&(u=$c(u,"onBeforeInput"),0<u.length&&(f=new gg("onBeforeInput","beforeinput",null,r,f),d.push({event:f,listeners:u}),f.data=_))}Uw(d,t)})}function ms(e,t,r){return{instance:e,listener:t,currentTarget:r}}function $c(e,t){for(var r=t+"Capture",n=[];e!==null;){var a=e,i=a.stateNode;a.tag===5&&i!==null&&(a=i,i=ls(e,r),i!=null&&n.unshift(ms(e,i,a)),i=ls(e,t),i!=null&&n.push(ms(e,i,a))),e=e.return}return n}function La(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Cg(e,t,r,n,a){for(var i=t._reactName,s=[];r!==null&&r!==n;){var l=r,c=l.alternate,u=l.stateNode;if(c!==null&&c===n)break;l.tag===5&&u!==null&&(l=u,a?(c=ls(r,i),c!=null&&s.unshift(ms(r,c,l))):a||(c=ls(r,i),c!=null&&s.push(ms(r,c,l)))),r=r.return}s.length!==0&&e.push({event:t,listeners:s})}var zP=/\r\n?/g,WP=/\u0000|\uFFFD/g;function Eg(e){return(typeof e=="string"?e:""+e).replace(zP,`
-`).replace(WP,"")}function Ll(e,t,r){if(t=Eg(t),Eg(e)!==t&&r)throw Error(H(425))}function Tc(){}var Fh=null,zh=null;function Wh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Uh=typeof setTimeout=="function"?setTimeout:void 0,UP=typeof clearTimeout=="function"?clearTimeout:void 0,$g=typeof Promise=="function"?Promise:void 0,HP=typeof queueMicrotask=="function"?queueMicrotask:typeof $g<"u"?function(e){return $g.resolve(null).then(e).catch(KP)}:Uh;function KP(e){setTimeout(function(){throw e})}function Pf(e,t){var r=t,n=0;do{var a=r.nextSibling;if(e.removeChild(r),a&&a.nodeType===8)if(r=a.data,r==="/$"){if(n===0){e.removeChild(a),ds(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=a}while(r);ds(t)}function Nn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Tg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var to=Math.random().toString(36).slice(2),_r="__reactFiber$"+to,vs="__reactProps$"+to,Xr="__reactContainer$"+to,Hh="__reactEvents$"+to,VP="__reactListeners$"+to,GP="__reactHandles$"+to;function ra(e){var t=e[_r];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Xr]||r[_r]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Tg(e);e!==null;){if(r=e[_r])return r;e=Tg(e)}return t}e=r,r=e.parentNode}return null}function ul(e){return e=e[_r]||e[Xr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Xa(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(H(33))}function od(e){return e[vs]||null}var Kh=[],Qa=-1;function Dn(e){return{current:e}}function ke(e){0>Qa||(e.current=Kh[Qa],Kh[Qa]=null,Qa--)}function je(e,t){Qa++,Kh[Qa]=e.current,e.current=t}var In={},vt=Dn(In),Pt=Dn(!1),va=In;function bi(e,t){var r=e.type.contextTypes;if(!r)return In;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in r)a[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function At(e){return e=e.childContextTypes,e!=null}function Mc(){ke(Pt),ke(vt)}function Mg(e,t,r){if(vt.current!==In)throw Error(H(168));je(vt,t),je(Pt,r)}function Kw(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var a in n)if(!(a in t))throw Error(H(108,EN(e)||"Unknown",a));return $e({},r,n)}function Ic(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||In,va=vt.current,je(vt,e),je(Pt,Pt.current),!0}function Ig(e,t,r){var n=e.stateNode;if(!n)throw Error(H(169));r?(e=Kw(e,t,va),n.__reactInternalMemoizedMergedChildContext=e,ke(Pt),ke(vt),je(vt,e)):ke(Pt),je(Pt,r)}var Fr=null,sd=!1,Af=!1;function Vw(e){Fr===null?Fr=[e]:Fr.push(e)}function YP(e){sd=!0,Vw(e)}function Rn(){if(!Af&&Fr!==null){Af=!0;var e=0,t=ue;try{var r=Fr;for(ue=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Fr=null,sd=!1}catch(a){throw Fr!==null&&(Fr=Fr.slice(e+1)),yw(tv,Rn),a}finally{ue=t,Af=!1}}return null}var Ja=[],Za=0,Lc=null,Dc=0,Vt=[],Gt=0,ya=null,zr=1,Wr="";function Xn(e,t){Ja[Za++]=Dc,Ja[Za++]=Lc,Lc=e,Dc=t}function Gw(e,t,r){Vt[Gt++]=zr,Vt[Gt++]=Wr,Vt[Gt++]=ya,ya=e;var n=zr;e=Wr;var a=32-pr(n)-1;n&=~(1<<a),r+=1;var i=32-pr(t)+a;if(30<i){var s=a-a%5;i=(n&(1<<s)-1).toString(32),n>>=s,a-=s,zr=1<<32-pr(t)+a|r<<a|n,Wr=i+e}else zr=1<<i|r<<a|n,Wr=e}function uv(e){e.return!==null&&(Xn(e,1),Gw(e,1,0))}function dv(e){for(;e===Lc;)Lc=Ja[--Za],Ja[Za]=null,Dc=Ja[--Za],Ja[Za]=null;for(;e===ya;)ya=Vt[--Gt],Vt[Gt]=null,Wr=Vt[--Gt],Vt[Gt]=null,zr=Vt[--Gt],Vt[Gt]=null}var Dt=null,Lt=null,Ne=!1,fr=null;function Yw(e,t){var r=qt(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Lg(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Dt=e,Lt=Nn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Dt=e,Lt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=ya!==null?{id:zr,overflow:Wr}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=qt(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Dt=e,Lt=null,!0):!1;default:return!1}}function Vh(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Gh(e){if(Ne){var t=Lt;if(t){var r=t;if(!Lg(e,t)){if(Vh(e))throw Error(H(418));t=Nn(r.nextSibling);var n=Dt;t&&Lg(e,t)?Yw(n,r):(e.flags=e.flags&-4097|2,Ne=!1,Dt=e)}}else{if(Vh(e))throw Error(H(418));e.flags=e.flags&-4097|2,Ne=!1,Dt=e}}}function Dg(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Dt=e}function Dl(e){if(e!==Dt)return!1;if(!Ne)return Dg(e),Ne=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Wh(e.type,e.memoizedProps)),t&&(t=Lt)){if(Vh(e))throw qw(),Error(H(418));for(;t;)Yw(e,t),t=Nn(t.nextSibling)}if(Dg(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(H(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Lt=Nn(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Lt=null}}else Lt=Dt?Nn(e.stateNode.nextSibling):null;return!0}function qw(){for(var e=Lt;e;)e=Nn(e.nextSibling)}function ji(){Lt=Dt=null,Ne=!1}function fv(e){fr===null?fr=[e]:fr.push(e)}var qP=nn.ReactCurrentBatchConfig;function So(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(H(309));var n=r.stateNode}if(!n)throw Error(H(147,e));var a=n,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var l=a.refs;s===null?delete l[i]:l[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(H(284));if(!r._owner)throw Error(H(290,e))}return e}function Rl(e,t){throw e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Rg(e){var t=e._init;return t(e._payload)}function Xw(e){function t(v,m){if(e){var x=v.deletions;x===null?(v.deletions=[m],v.flags|=16):x.push(m)}}function r(v,m){if(!e)return null;for(;m!==null;)t(v,m),m=m.sibling;return null}function n(v,m){for(v=new Map;m!==null;)m.key!==null?v.set(m.key,m):v.set(m.index,m),m=m.sibling;return v}function a(v,m){return v=En(v,m),v.index=0,v.sibling=null,v}function i(v,m,x){return v.index=x,e?(x=v.alternate,x!==null?(x=x.index,x<m?(v.flags|=2,m):x):(v.flags|=2,m)):(v.flags|=1048576,m)}function s(v){return e&&v.alternate===null&&(v.flags|=2),v}function l(v,m,x,S){return m===null||m.tag!==6?(m=Lf(x,v.mode,S),m.return=v,m):(m=a(m,x),m.return=v,m)}function c(v,m,x,S){var j=x.type;return j===Va?f(v,m,x.props.children,S,x.key):m!==null&&(m.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===fn&&Rg(j)===m.type)?(S=a(m,x.props),S.ref=So(v,m,x),S.return=v,S):(S=jc(x.type,x.key,x.props,null,v.mode,S),S.ref=So(v,m,x),S.return=v,S)}function u(v,m,x,S){return m===null||m.tag!==4||m.stateNode.containerInfo!==x.containerInfo||m.stateNode.implementation!==x.implementation?(m=Df(x,v.mode,S),m.return=v,m):(m=a(m,x.children||[]),m.return=v,m)}function f(v,m,x,S,j){return m===null||m.tag!==7?(m=fa(x,v.mode,S,j),m.return=v,m):(m=a(m,x),m.return=v,m)}function d(v,m,x){if(typeof m=="string"&&m!==""||typeof m=="number")return m=Lf(""+m,v.mode,x),m.return=v,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Nl:return x=jc(m.type,m.key,m.props,null,v.mode,x),x.ref=So(v,null,m),x.return=v,x;case Ka:return m=Df(m,v.mode,x),m.return=v,m;case fn:var S=m._init;return d(v,S(m._payload),x)}if(Bo(m)||go(m))return m=fa(m,v.mode,x,null),m.return=v,m;Rl(v,m)}return null}function h(v,m,x,S){var j=m!==null?m.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return j!==null?null:l(v,m,""+x,S);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Nl:return x.key===j?c(v,m,x,S):null;case Ka:return x.key===j?u(v,m,x,S):null;case fn:return j=x._init,h(v,m,j(x._payload),S)}if(Bo(x)||go(x))return j!==null?null:f(v,m,x,S,null);Rl(v,x)}return null}function p(v,m,x,S,j){if(typeof S=="string"&&S!==""||typeof S=="number")return v=v.get(x)||null,l(m,v,""+S,j);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Nl:return v=v.get(S.key===null?x:S.key)||null,c(m,v,S,j);case Ka:return v=v.get(S.key===null?x:S.key)||null,u(m,v,S,j);case fn:var w=S._init;return p(v,m,x,w(S._payload),j)}if(Bo(S)||go(S))return v=v.get(x)||null,f(m,v,S,j,null);Rl(m,S)}return null}function g(v,m,x,S){for(var j=null,w=null,_=m,O=m=0,N=null;_!==null&&O<x.length;O++){_.index>O?(N=_,_=null):N=_.sibling;var k=h(v,_,x[O],S);if(k===null){_===null&&(_=N);break}e&&_&&k.alternate===null&&t(v,_),m=i(k,m,O),w===null?j=k:w.sibling=k,w=k,_=N}if(O===x.length)return r(v,_),Ne&&Xn(v,O),j;if(_===null){for(;O<x.length;O++)_=d(v,x[O],S),_!==null&&(m=i(_,m,O),w===null?j=_:w.sibling=_,w=_);return Ne&&Xn(v,O),j}for(_=n(v,_);O<x.length;O++)N=p(_,v,O,x[O],S),N!==null&&(e&&N.alternate!==null&&_.delete(N.key===null?O:N.key),m=i(N,m,O),w===null?j=N:w.sibling=N,w=N);return e&&_.forEach(function(E){return t(v,E)}),Ne&&Xn(v,O),j}function y(v,m,x,S){var j=go(x);if(typeof j!="function")throw Error(H(150));if(x=j.call(x),x==null)throw Error(H(151));for(var w=j=null,_=m,O=m=0,N=null,k=x.next();_!==null&&!k.done;O++,k=x.next()){_.index>O?(N=_,_=null):N=_.sibling;var E=h(v,_,k.value,S);if(E===null){_===null&&(_=N);break}e&&_&&E.alternate===null&&t(v,_),m=i(E,m,O),w===null?j=E:w.sibling=E,w=E,_=N}if(k.done)return r(v,_),Ne&&Xn(v,O),j;if(_===null){for(;!k.done;O++,k=x.next())k=d(v,k.value,S),k!==null&&(m=i(k,m,O),w===null?j=k:w.sibling=k,w=k);return Ne&&Xn(v,O),j}for(_=n(v,_);!k.done;O++,k=x.next())k=p(_,v,O,k.value,S),k!==null&&(e&&k.alternate!==null&&_.delete(k.key===null?O:k.key),m=i(k,m,O),w===null?j=k:w.sibling=k,w=k);return e&&_.forEach(function(T){return t(v,T)}),Ne&&Xn(v,O),j}function b(v,m,x,S){if(typeof x=="object"&&x!==null&&x.type===Va&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Nl:e:{for(var j=x.key,w=m;w!==null;){if(w.key===j){if(j=x.type,j===Va){if(w.tag===7){r(v,w.sibling),m=a(w,x.props.children),m.return=v,v=m;break e}}else if(w.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===fn&&Rg(j)===w.type){r(v,w.sibling),m=a(w,x.props),m.ref=So(v,w,x),m.return=v,v=m;break e}r(v,w);break}else t(v,w);w=w.sibling}x.type===Va?(m=fa(x.props.children,v.mode,S,x.key),m.return=v,v=m):(S=jc(x.type,x.key,x.props,null,v.mode,S),S.ref=So(v,m,x),S.return=v,v=S)}return s(v);case Ka:e:{for(w=x.key;m!==null;){if(m.key===w)if(m.tag===4&&m.stateNode.containerInfo===x.containerInfo&&m.stateNode.implementation===x.implementation){r(v,m.sibling),m=a(m,x.children||[]),m.return=v,v=m;break e}else{r(v,m);break}else t(v,m);m=m.sibling}m=Df(x,v.mode,S),m.return=v,v=m}return s(v);case fn:return w=x._init,b(v,m,w(x._payload),S)}if(Bo(x))return g(v,m,x,S);if(go(x))return y(v,m,x,S);Rl(v,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,m!==null&&m.tag===6?(r(v,m.sibling),m=a(m,x),m.return=v,v=m):(r(v,m),m=Lf(x,v.mode,S),m.return=v,v=m),s(v)):r(v,m)}return b}var wi=Xw(!0),Qw=Xw(!1),Rc=Dn(null),Bc=null,ei=null,hv=null;function pv(){hv=ei=Bc=null}function mv(e){var t=Rc.current;ke(Rc),e._currentValue=t}function Yh(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function fi(e,t){Bc=e,hv=ei=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ot=!0),e.firstContext=null)}function Jt(e){var t=e._currentValue;if(hv!==e)if(e={context:e,memoizedValue:t,next:null},ei===null){if(Bc===null)throw Error(H(308));ei=e,Bc.dependencies={lanes:0,firstContext:e}}else ei=ei.next=e;return t}var na=null;function vv(e){na===null?na=[e]:na.push(e)}function Jw(e,t,r,n){var a=t.interleaved;return a===null?(r.next=r,vv(t)):(r.next=a.next,a.next=r),t.interleaved=r,Qr(e,n)}function Qr(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var hn=!1;function yv(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Zw(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Vr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Pn(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,se&2){var a=n.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),n.pending=t,Qr(e,r)}return a=n.interleaved,a===null?(t.next=t,vv(n)):(t.next=a.next,a.next=t),n.interleaved=t,Qr(e,r)}function mc(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,rv(e,r)}}function Bg(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var a=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var s={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?a=i=s:i=i.next=s,r=r.next}while(r!==null);i===null?a=i=t:i=i.next=t}else a=i=t;r={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Fc(e,t,r,n){var a=e.updateQueue;hn=!1;var i=a.firstBaseUpdate,s=a.lastBaseUpdate,l=a.shared.pending;if(l!==null){a.shared.pending=null;var c=l,u=c.next;c.next=null,s===null?i=u:s.next=u,s=c;var f=e.alternate;f!==null&&(f=f.updateQueue,l=f.lastBaseUpdate,l!==s&&(l===null?f.firstBaseUpdate=u:l.next=u,f.lastBaseUpdate=c))}if(i!==null){var d=a.baseState;s=0,f=u=c=null,l=i;do{var h=l.lane,p=l.eventTime;if((n&h)===h){f!==null&&(f=f.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,y=l;switch(h=t,p=r,y.tag){case 1:if(g=y.payload,typeof g=="function"){d=g.call(p,d,h);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=y.payload,h=typeof g=="function"?g.call(p,d,h):g,h==null)break e;d=$e({},d,h);break e;case 2:hn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=a.effects,h===null?a.effects=[l]:h.push(l))}else p={eventTime:p,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},f===null?(u=f=p,c=d):f=f.next=p,s|=h;if(l=l.next,l===null){if(l=a.shared.pending,l===null)break;h=l,l=h.next,h.next=null,a.lastBaseUpdate=h,a.shared.pending=null}}while(!0);if(f===null&&(c=d),a.baseState=c,a.firstBaseUpdate=u,a.lastBaseUpdate=f,t=a.shared.interleaved,t!==null){a=t;do s|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);xa|=s,e.lanes=s,e.memoizedState=d}}function Fg(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],a=n.callback;if(a!==null){if(n.callback=null,n=r,typeof a!="function")throw Error(H(191,a));a.call(n)}}}var dl={},Pr=Dn(dl),ys=Dn(dl),gs=Dn(dl);function aa(e){if(e===dl)throw Error(H(174));return e}function gv(e,t){switch(je(gs,t),je(ys,e),je(Pr,dl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ph(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ph(t,e)}ke(Pr),je(Pr,t)}function Si(){ke(Pr),ke(ys),ke(gs)}function e2(e){aa(gs.current);var t=aa(Pr.current),r=Ph(t,e.type);t!==r&&(je(ys,e),je(Pr,r))}function xv(e){ys.current===e&&(ke(Pr),ke(ys))}var Ce=Dn(0);function zc(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Cf=[];function bv(){for(var e=0;e<Cf.length;e++)Cf[e]._workInProgressVersionPrimary=null;Cf.length=0}var vc=nn.ReactCurrentDispatcher,Ef=nn.ReactCurrentBatchConfig,ga=0,Ee=null,Ve=null,et=null,Wc=!1,Xo=!1,xs=0,XP=0;function dt(){throw Error(H(321))}function jv(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!yr(e[r],t[r]))return!1;return!0}function wv(e,t,r,n,a,i){if(ga=i,Ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,vc.current=e===null||e.memoizedState===null?eA:tA,e=r(n,a),Xo){i=0;do{if(Xo=!1,xs=0,25<=i)throw Error(H(301));i+=1,et=Ve=null,t.updateQueue=null,vc.current=rA,e=r(n,a)}while(Xo)}if(vc.current=Uc,t=Ve!==null&&Ve.next!==null,ga=0,et=Ve=Ee=null,Wc=!1,t)throw Error(H(300));return e}function Sv(){var e=xs!==0;return xs=0,e}function Sr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return et===null?Ee.memoizedState=et=e:et=et.next=e,et}function Zt(){if(Ve===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=et===null?Ee.memoizedState:et.next;if(t!==null)et=t,Ve=e;else{if(e===null)throw Error(H(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},et===null?Ee.memoizedState=et=e:et=et.next=e}return et}function bs(e,t){return typeof t=="function"?t(e):t}function $f(e){var t=Zt(),r=t.queue;if(r===null)throw Error(H(311));r.lastRenderedReducer=e;var n=Ve,a=n.baseQueue,i=r.pending;if(i!==null){if(a!==null){var s=a.next;a.next=i.next,i.next=s}n.baseQueue=a=i,r.pending=null}if(a!==null){i=a.next,n=n.baseState;var l=s=null,c=null,u=i;do{var f=u.lane;if((ga&f)===f)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:e(n,u.action);else{var d={lane:f,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=d,s=n):c=c.next=d,Ee.lanes|=f,xa|=f}u=u.next}while(u!==null&&u!==i);c===null?s=n:c.next=l,yr(n,t.memoizedState)||(Ot=!0),t.memoizedState=n,t.baseState=s,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){a=e;do i=a.lane,Ee.lanes|=i,xa|=i,a=a.next;while(a!==e)}else a===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Tf(e){var t=Zt(),r=t.queue;if(r===null)throw Error(H(311));r.lastRenderedReducer=e;var n=r.dispatch,a=r.pending,i=t.memoizedState;if(a!==null){r.pending=null;var s=a=a.next;do i=e(i,s.action),s=s.next;while(s!==a);yr(i,t.memoizedState)||(Ot=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),r.lastRenderedState=i}return[i,n]}function t2(){}function r2(e,t){var r=Ee,n=Zt(),a=t(),i=!yr(n.memoizedState,a);if(i&&(n.memoizedState=a,Ot=!0),n=n.queue,_v(i2.bind(null,r,n,e),[e]),n.getSnapshot!==t||i||et!==null&&et.memoizedState.tag&1){if(r.flags|=2048,js(9,a2.bind(null,r,n,a,t),void 0,null),nt===null)throw Error(H(349));ga&30||n2(r,t,a)}return a}function n2(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Ee.updateQueue,t===null?(t={lastEffect:null,stores:null},Ee.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function a2(e,t,r,n){t.value=r,t.getSnapshot=n,o2(t)&&s2(e)}function i2(e,t,r){return r(function(){o2(t)&&s2(e)})}function o2(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!yr(e,r)}catch{return!0}}function s2(e){var t=Qr(e,1);t!==null&&mr(t,e,1,-1)}function zg(e){var t=Sr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bs,lastRenderedState:e},t.queue=e,e=e.dispatch=ZP.bind(null,Ee,e),[t.memoizedState,e]}function js(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Ee.updateQueue,t===null?(t={lastEffect:null,stores:null},Ee.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function l2(){return Zt().memoizedState}function yc(e,t,r,n){var a=Sr();Ee.flags|=e,a.memoizedState=js(1|t,r,void 0,n===void 0?null:n)}function ld(e,t,r,n){var a=Zt();n=n===void 0?null:n;var i=void 0;if(Ve!==null){var s=Ve.memoizedState;if(i=s.destroy,n!==null&&jv(n,s.deps)){a.memoizedState=js(t,r,i,n);return}}Ee.flags|=e,a.memoizedState=js(1|t,r,i,n)}function Wg(e,t){return yc(8390656,8,e,t)}function _v(e,t){return ld(2048,8,e,t)}function c2(e,t){return ld(4,2,e,t)}function u2(e,t){return ld(4,4,e,t)}function d2(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function f2(e,t,r){return r=r!=null?r.concat([e]):null,ld(4,4,d2.bind(null,t,e),r)}function kv(){}function h2(e,t){var r=Zt();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&jv(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function p2(e,t){var r=Zt();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&jv(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function m2(e,t,r){return ga&21?(yr(r,t)||(r=bw(),Ee.lanes|=r,xa|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ot=!0),e.memoizedState=r)}function QP(e,t){var r=ue;ue=r!==0&&4>r?r:4,e(!0);var n=Ef.transition;Ef.transition={};try{e(!1),t()}finally{ue=r,Ef.transition=n}}function v2(){return Zt().memoizedState}function JP(e,t,r){var n=Cn(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},y2(e))g2(t,r);else if(r=Jw(e,t,r,n),r!==null){var a=bt();mr(r,e,n,a),x2(r,t,n)}}function ZP(e,t,r){var n=Cn(e),a={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(y2(e))g2(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,l=i(s,r);if(a.hasEagerState=!0,a.eagerState=l,yr(l,s)){var c=t.interleaved;c===null?(a.next=a,vv(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}r=Jw(e,t,a,n),r!==null&&(a=bt(),mr(r,e,n,a),x2(r,t,n))}}function y2(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function g2(e,t){Xo=Wc=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function x2(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,rv(e,r)}}var Uc={readContext:Jt,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useInsertionEffect:dt,useLayoutEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useMutableSource:dt,useSyncExternalStore:dt,useId:dt,unstable_isNewReconciler:!1},eA={readContext:Jt,useCallback:function(e,t){return Sr().memoizedState=[e,t===void 0?null:t],e},useContext:Jt,useEffect:Wg,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,yc(4194308,4,d2.bind(null,t,e),r)},useLayoutEffect:function(e,t){return yc(4194308,4,e,t)},useInsertionEffect:function(e,t){return yc(4,2,e,t)},useMemo:function(e,t){var r=Sr();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Sr();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=JP.bind(null,Ee,e),[n.memoizedState,e]},useRef:function(e){var t=Sr();return e={current:e},t.memoizedState=e},useState:zg,useDebugValue:kv,useDeferredValue:function(e){return Sr().memoizedState=e},useTransition:function(){var e=zg(!1),t=e[0];return e=QP.bind(null,e[1]),Sr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ee,a=Sr();if(Ne){if(r===void 0)throw Error(H(407));r=r()}else{if(r=t(),nt===null)throw Error(H(349));ga&30||n2(n,t,r)}a.memoizedState=r;var i={value:r,getSnapshot:t};return a.queue=i,Wg(i2.bind(null,n,i,e),[e]),n.flags|=2048,js(9,a2.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=Sr(),t=nt.identifierPrefix;if(Ne){var r=Wr,n=zr;r=(n&~(1<<32-pr(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=xs++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=XP++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},tA={readContext:Jt,useCallback:h2,useContext:Jt,useEffect:_v,useImperativeHandle:f2,useInsertionEffect:c2,useLayoutEffect:u2,useMemo:p2,useReducer:$f,useRef:l2,useState:function(){return $f(bs)},useDebugValue:kv,useDeferredValue:function(e){var t=Zt();return m2(t,Ve.memoizedState,e)},useTransition:function(){var e=$f(bs)[0],t=Zt().memoizedState;return[e,t]},useMutableSource:t2,useSyncExternalStore:r2,useId:v2,unstable_isNewReconciler:!1},rA={readContext:Jt,useCallback:h2,useContext:Jt,useEffect:_v,useImperativeHandle:f2,useInsertionEffect:c2,useLayoutEffect:u2,useMemo:p2,useReducer:Tf,useRef:l2,useState:function(){return Tf(bs)},useDebugValue:kv,useDeferredValue:function(e){var t=Zt();return Ve===null?t.memoizedState=e:m2(t,Ve.memoizedState,e)},useTransition:function(){var e=Tf(bs)[0],t=Zt().memoizedState;return[e,t]},useMutableSource:t2,useSyncExternalStore:r2,useId:v2,unstable_isNewReconciler:!1};function cr(e,t){if(e&&e.defaultProps){t=$e({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function qh(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:$e({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var cd={isMounted:function(e){return(e=e._reactInternals)?Pa(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=bt(),a=Cn(e),i=Vr(n,a);i.payload=t,r!=null&&(i.callback=r),t=Pn(e,i,a),t!==null&&(mr(t,e,a,n),mc(t,e,a))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=bt(),a=Cn(e),i=Vr(n,a);i.tag=1,i.payload=t,r!=null&&(i.callback=r),t=Pn(e,i,a),t!==null&&(mr(t,e,a,n),mc(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=bt(),n=Cn(e),a=Vr(r,n);a.tag=2,t!=null&&(a.callback=t),t=Pn(e,a,n),t!==null&&(mr(t,e,n,r),mc(t,e,n))}};function Ug(e,t,r,n,a,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,s):t.prototype&&t.prototype.isPureReactComponent?!hs(r,n)||!hs(a,i):!0}function b2(e,t,r){var n=!1,a=In,i=t.contextType;return typeof i=="object"&&i!==null?i=Jt(i):(a=At(t)?va:vt.current,n=t.contextTypes,i=(n=n!=null)?bi(e,a):In),t=new t(r,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=cd,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=i),t}function Hg(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&cd.enqueueReplaceState(t,t.state,null)}function Xh(e,t,r,n){var a=e.stateNode;a.props=r,a.state=e.memoizedState,a.refs={},yv(e);var i=t.contextType;typeof i=="object"&&i!==null?a.context=Jt(i):(i=At(t)?va:vt.current,a.context=bi(e,i)),a.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(qh(e,t,i,r),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&cd.enqueueReplaceState(a,a.state,null),Fc(e,r,a,n),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function _i(e,t){try{var r="",n=t;do r+=CN(n),n=n.return;while(n);var a=r}catch(i){a=`
-Error generating stack: `+i.message+`
-`+i.stack}return{value:e,source:t,stack:a,digest:null}}function Mf(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Qh(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var nA=typeof WeakMap=="function"?WeakMap:Map;function j2(e,t,r){r=Vr(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Kc||(Kc=!0,sp=n),Qh(e,t)},r}function w2(e,t,r){r=Vr(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var a=t.value;r.payload=function(){return n(a)},r.callback=function(){Qh(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){Qh(e,t),typeof n!="function"&&(An===null?An=new Set([this]):An.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),r}function Kg(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new nA;var a=new Set;n.set(t,a)}else a=n.get(t),a===void 0&&(a=new Set,n.set(t,a));a.has(r)||(a.add(r),e=yA.bind(null,e,t,r),t.then(e,e))}function Vg(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Gg(e,t,r,n,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Vr(-1,1),t.tag=2,Pn(r,t,1))),r.lanes|=1),e)}var aA=nn.ReactCurrentOwner,Ot=!1;function yt(e,t,r,n){t.child=e===null?Qw(t,null,r,n):wi(t,e.child,r,n)}function Yg(e,t,r,n,a){r=r.render;var i=t.ref;return fi(t,a),n=wv(e,t,r,n,i,a),r=Sv(),e!==null&&!Ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Jr(e,t,a)):(Ne&&r&&uv(t),t.flags|=1,yt(e,t,n,a),t.child)}function qg(e,t,r,n,a){if(e===null){var i=r.type;return typeof i=="function"&&!Tv(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=i,S2(e,t,i,n,a)):(e=jc(r.type,null,n,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&a)){var s=i.memoizedProps;if(r=r.compare,r=r!==null?r:hs,r(s,n)&&e.ref===t.ref)return Jr(e,t,a)}return t.flags|=1,e=En(i,n),e.ref=t.ref,e.return=t,t.child=e}function S2(e,t,r,n,a){if(e!==null){var i=e.memoizedProps;if(hs(i,n)&&e.ref===t.ref)if(Ot=!1,t.pendingProps=n=i,(e.lanes&a)!==0)e.flags&131072&&(Ot=!0);else return t.lanes=e.lanes,Jr(e,t,a)}return Jh(e,t,r,n,a)}function _2(e,t,r){var n=t.pendingProps,a=n.children,i=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},je(ri,Tt),Tt|=r;else{if(!(r&1073741824))return e=i!==null?i.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,je(ri,Tt),Tt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,je(ri,Tt),Tt|=n}else i!==null?(n=i.baseLanes|r,t.memoizedState=null):n=r,je(ri,Tt),Tt|=n;return yt(e,t,a,r),t.child}function k2(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Jh(e,t,r,n,a){var i=At(r)?va:vt.current;return i=bi(t,i),fi(t,a),r=wv(e,t,r,n,i,a),n=Sv(),e!==null&&!Ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Jr(e,t,a)):(Ne&&n&&uv(t),t.flags|=1,yt(e,t,r,a),t.child)}function Xg(e,t,r,n,a){if(At(r)){var i=!0;Ic(t)}else i=!1;if(fi(t,a),t.stateNode===null)gc(e,t),b2(t,r,n),Xh(t,r,n,a),n=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var c=s.context,u=r.contextType;typeof u=="object"&&u!==null?u=Jt(u):(u=At(r)?va:vt.current,u=bi(t,u));var f=r.getDerivedStateFromProps,d=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==n||c!==u)&&Hg(t,s,n,u),hn=!1;var h=t.memoizedState;s.state=h,Fc(t,n,s,a),c=t.memoizedState,l!==n||h!==c||Pt.current||hn?(typeof f=="function"&&(qh(t,r,f,n),c=t.memoizedState),(l=hn||Ug(t,r,l,n,h,c,u))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),s.props=n,s.state=c,s.context=u,n=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{s=t.stateNode,Zw(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:cr(t.type,l),s.props=u,d=t.pendingProps,h=s.context,c=r.contextType,typeof c=="object"&&c!==null?c=Jt(c):(c=At(r)?va:vt.current,c=bi(t,c));var p=r.getDerivedStateFromProps;(f=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==d||h!==c)&&Hg(t,s,n,c),hn=!1,h=t.memoizedState,s.state=h,Fc(t,n,s,a);var g=t.memoizedState;l!==d||h!==g||Pt.current||hn?(typeof p=="function"&&(qh(t,r,p,n),g=t.memoizedState),(u=hn||Ug(t,r,u,n,h,g,c)||!1)?(f||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(n,g,c),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(n,g,c)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=g),s.props=n,s.state=g,s.context=c,n=u):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return Zh(e,t,r,n,i,a)}function Zh(e,t,r,n,a,i){k2(e,t);var s=(t.flags&128)!==0;if(!n&&!s)return a&&Ig(t,r,!1),Jr(e,t,i);n=t.stateNode,aA.current=t;var l=s&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&s?(t.child=wi(t,e.child,null,i),t.child=wi(t,null,l,i)):yt(e,t,l,i),t.memoizedState=n.state,a&&Ig(t,r,!0),t.child}function O2(e){var t=e.stateNode;t.pendingContext?Mg(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Mg(e,t.context,!1),gv(e,t.containerInfo)}function Qg(e,t,r,n,a){return ji(),fv(a),t.flags|=256,yt(e,t,r,n),t.child}var ep={dehydrated:null,treeContext:null,retryLane:0};function tp(e){return{baseLanes:e,cachePool:null,transitions:null}}function N2(e,t,r){var n=t.pendingProps,a=Ce.current,i=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(a&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),je(Ce,a&1),e===null)return Gh(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=n.children,e=n.fallback,i?(n=t.mode,i=t.child,s={mode:"hidden",children:s},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=fd(s,n,0,null),e=fa(e,n,r,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=tp(r),t.memoizedState=ep,e):Ov(t,s));if(a=e.memoizedState,a!==null&&(l=a.dehydrated,l!==null))return iA(e,t,s,n,l,a,r);if(i){i=n.fallback,s=t.mode,a=e.child,l=a.sibling;var c={mode:"hidden",children:n.children};return!(s&1)&&t.child!==a?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=En(a,c),n.subtreeFlags=a.subtreeFlags&14680064),l!==null?i=En(l,i):(i=fa(i,s,r,null),i.flags|=2),i.return=t,n.return=t,n.sibling=i,t.child=n,n=i,i=t.child,s=e.child.memoizedState,s=s===null?tp(r):{baseLanes:s.baseLanes|r,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~r,t.memoizedState=ep,n}return i=e.child,e=i.sibling,n=En(i,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function Ov(e,t){return t=fd({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Bl(e,t,r,n){return n!==null&&fv(n),wi(t,e.child,null,r),e=Ov(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function iA(e,t,r,n,a,i,s){if(r)return t.flags&256?(t.flags&=-257,n=Mf(Error(H(422))),Bl(e,t,s,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=n.fallback,a=t.mode,n=fd({mode:"visible",children:n.children},a,0,null),i=fa(i,a,s,null),i.flags|=2,n.return=t,i.return=t,n.sibling=i,t.child=n,t.mode&1&&wi(t,e.child,null,s),t.child.memoizedState=tp(s),t.memoizedState=ep,i);if(!(t.mode&1))return Bl(e,t,s,null);if(a.data==="$!"){if(n=a.nextSibling&&a.nextSibling.dataset,n)var l=n.dgst;return n=l,i=Error(H(419)),n=Mf(i,n,void 0),Bl(e,t,s,n)}if(l=(s&e.childLanes)!==0,Ot||l){if(n=nt,n!==null){switch(s&-s){case 4:a=2;break;case 16:a=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(n.suspendedLanes|s)?0:a,a!==0&&a!==i.retryLane&&(i.retryLane=a,Qr(e,a),mr(n,e,a,-1))}return $v(),n=Mf(Error(H(421))),Bl(e,t,s,n)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=gA.bind(null,e),a._reactRetry=t,null):(e=i.treeContext,Lt=Nn(a.nextSibling),Dt=t,Ne=!0,fr=null,e!==null&&(Vt[Gt++]=zr,Vt[Gt++]=Wr,Vt[Gt++]=ya,zr=e.id,Wr=e.overflow,ya=t),t=Ov(t,n.children),t.flags|=4096,t)}function Jg(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Yh(e.return,t,r)}function If(e,t,r,n,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=a)}function P2(e,t,r){var n=t.pendingProps,a=n.revealOrder,i=n.tail;if(yt(e,t,n.children,r),n=Ce.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Jg(e,r,t);else if(e.tag===19)Jg(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(je(Ce,n),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(r=t.child,a=null;r!==null;)e=r.alternate,e!==null&&zc(e)===null&&(a=r),r=r.sibling;r=a,r===null?(a=t.child,t.child=null):(a=r.sibling,r.sibling=null),If(t,!1,a,r,i);break;case"backwards":for(r=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&zc(e)===null){t.child=a;break}e=a.sibling,a.sibling=r,r=a,a=e}If(t,!0,r,null,i);break;case"together":If(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function gc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Jr(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),xa|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(H(153));if(t.child!==null){for(e=t.child,r=En(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=En(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function oA(e,t,r){switch(t.tag){case 3:O2(t),ji();break;case 5:e2(t);break;case 1:At(t.type)&&Ic(t);break;case 4:gv(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,a=t.memoizedProps.value;je(Rc,n._currentValue),n._currentValue=a;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(je(Ce,Ce.current&1),t.flags|=128,null):r&t.child.childLanes?N2(e,t,r):(je(Ce,Ce.current&1),e=Jr(e,t,r),e!==null?e.sibling:null);je(Ce,Ce.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return P2(e,t,r);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),je(Ce,Ce.current),n)break;return null;case 22:case 23:return t.lanes=0,_2(e,t,r)}return Jr(e,t,r)}var A2,rp,C2,E2;A2=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};rp=function(){};C2=function(e,t,r,n){var a=e.memoizedProps;if(a!==n){e=t.stateNode,aa(Pr.current);var i=null;switch(r){case"input":a=_h(e,a),n=_h(e,n),i=[];break;case"select":a=$e({},a,{value:void 0}),n=$e({},n,{value:void 0}),i=[];break;case"textarea":a=Nh(e,a),n=Nh(e,n),i=[];break;default:typeof a.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Tc)}Ah(r,n);var s;r=null;for(u in a)if(!n.hasOwnProperty(u)&&a.hasOwnProperty(u)&&a[u]!=null)if(u==="style"){var l=a[u];for(s in l)l.hasOwnProperty(s)&&(r||(r={}),r[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(os.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in n){var c=n[u];if(l=a!=null?a[u]:void 0,n.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(s in l)!l.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(r||(r={}),r[s]="");for(s in c)c.hasOwnProperty(s)&&l[s]!==c[s]&&(r||(r={}),r[s]=c[s])}else r||(i||(i=[]),i.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(os.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&we("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}r&&(i=i||[]).push("style",r);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};E2=function(e,t,r,n){r!==n&&(t.flags|=4)};function _o(e,t){if(!Ne)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function ft(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var a=e.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags&14680064,n|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags,n|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function sA(e,t,r){var n=t.pendingProps;switch(dv(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ft(t),null;case 1:return At(t.type)&&Mc(),ft(t),null;case 3:return n=t.stateNode,Si(),ke(Pt),ke(vt),bv(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Dl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,fr!==null&&(up(fr),fr=null))),rp(e,t),ft(t),null;case 5:xv(t);var a=aa(gs.current);if(r=t.type,e!==null&&t.stateNode!=null)C2(e,t,r,n,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(H(166));return ft(t),null}if(e=aa(Pr.current),Dl(t)){n=t.stateNode,r=t.type;var i=t.memoizedProps;switch(n[_r]=t,n[vs]=i,e=(t.mode&1)!==0,r){case"dialog":we("cancel",n),we("close",n);break;case"iframe":case"object":case"embed":we("load",n);break;case"video":case"audio":for(a=0;a<zo.length;a++)we(zo[a],n);break;case"source":we("error",n);break;case"img":case"image":case"link":we("error",n),we("load",n);break;case"details":we("toggle",n);break;case"input":sg(n,i),we("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},we("invalid",n);break;case"textarea":cg(n,i),we("invalid",n)}Ah(r,i),a=null;for(var s in i)if(i.hasOwnProperty(s)){var l=i[s];s==="children"?typeof l=="string"?n.textContent!==l&&(i.suppressHydrationWarning!==!0&&Ll(n.textContent,l,e),a=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Ll(n.textContent,l,e),a=["children",""+l]):os.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&we("scroll",n)}switch(r){case"input":Pl(n),lg(n,i,!0);break;case"textarea":Pl(n),ug(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=Tc)}n=a,t.updateQueue=n,n!==null&&(t.flags|=4)}else{s=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=iw(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=s.createElement(r,{is:n.is}):(e=s.createElement(r),r==="select"&&(s=e,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):e=s.createElementNS(e,r),e[_r]=t,e[vs]=n,A2(e,t,!1,!1),t.stateNode=e;e:{switch(s=Ch(r,n),r){case"dialog":we("cancel",e),we("close",e),a=n;break;case"iframe":case"object":case"embed":we("load",e),a=n;break;case"video":case"audio":for(a=0;a<zo.length;a++)we(zo[a],e);a=n;break;case"source":we("error",e),a=n;break;case"img":case"image":case"link":we("error",e),we("load",e),a=n;break;case"details":we("toggle",e),a=n;break;case"input":sg(e,n),a=_h(e,n),we("invalid",e);break;case"option":a=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},a=$e({},n,{value:void 0}),we("invalid",e);break;case"textarea":cg(e,n),a=Nh(e,n),we("invalid",e);break;default:a=n}Ah(r,a),l=a;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?lw(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&ow(e,c)):i==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&ss(e,c):typeof c=="number"&&ss(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(os.hasOwnProperty(i)?c!=null&&i==="onScroll"&&we("scroll",e):c!=null&&Xm(e,i,c,s))}switch(r){case"input":Pl(e),lg(e,n,!1);break;case"textarea":Pl(e),ug(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Mn(n.value));break;case"select":e.multiple=!!n.multiple,i=n.value,i!=null?li(e,!!n.multiple,i,!1):n.defaultValue!=null&&li(e,!!n.multiple,n.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=Tc)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ft(t),null;case 6:if(e&&t.stateNode!=null)E2(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(H(166));if(r=aa(gs.current),aa(Pr.current),Dl(t)){if(n=t.stateNode,r=t.memoizedProps,n[_r]=t,(i=n.nodeValue!==r)&&(e=Dt,e!==null))switch(e.tag){case 3:Ll(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ll(n.nodeValue,r,(e.mode&1)!==0)}i&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[_r]=t,t.stateNode=n}return ft(t),null;case 13:if(ke(Ce),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ne&&Lt!==null&&t.mode&1&&!(t.flags&128))qw(),ji(),t.flags|=98560,i=!1;else if(i=Dl(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(H(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(H(317));i[_r]=t}else ji(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ft(t),i=!1}else fr!==null&&(up(fr),fr=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||Ce.current&1?Ye===0&&(Ye=3):$v())),t.updateQueue!==null&&(t.flags|=4),ft(t),null);case 4:return Si(),rp(e,t),e===null&&ps(t.stateNode.containerInfo),ft(t),null;case 10:return mv(t.type._context),ft(t),null;case 17:return At(t.type)&&Mc(),ft(t),null;case 19:if(ke(Ce),i=t.memoizedState,i===null)return ft(t),null;if(n=(t.flags&128)!==0,s=i.rendering,s===null)if(n)_o(i,!1);else{if(Ye!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=zc(e),s!==null){for(t.flags|=128,_o(i,!1),n=s.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)i=r,e=n,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return je(Ce,Ce.current&1|2),t.child}e=e.sibling}i.tail!==null&&Le()>ki&&(t.flags|=128,n=!0,_o(i,!1),t.lanes=4194304)}else{if(!n)if(e=zc(s),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),_o(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Ne)return ft(t),null}else 2*Le()-i.renderingStartTime>ki&&r!==1073741824&&(t.flags|=128,n=!0,_o(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(r=i.last,r!==null?r.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Le(),t.sibling=null,r=Ce.current,je(Ce,n?r&1|2:r&1),t):(ft(t),null);case 22:case 23:return Ev(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Tt&1073741824&&(ft(t),t.subtreeFlags&6&&(t.flags|=8192)):ft(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function lA(e,t){switch(dv(t),t.tag){case 1:return At(t.type)&&Mc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Si(),ke(Pt),ke(vt),bv(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return xv(t),null;case 13:if(ke(Ce),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));ji()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ke(Ce),null;case 4:return Si(),null;case 10:return mv(t.type._context),null;case 22:case 23:return Ev(),null;case 24:return null;default:return null}}var Fl=!1,pt=!1,cA=typeof WeakSet=="function"?WeakSet:Set,G=null;function ti(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Me(e,t,n)}else r.current=null}function np(e,t,r){try{r()}catch(n){Me(e,t,n)}}var Zg=!1;function uA(e,t){if(Fh=Cc,e=Lw(),cv(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var a=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var s=0,l=-1,c=-1,u=0,f=0,d=e,h=null;t:for(;;){for(var p;d!==r||a!==0&&d.nodeType!==3||(l=s+a),d!==i||n!==0&&d.nodeType!==3||(c=s+n),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)h=d,d=p;for(;;){if(d===e)break t;if(h===r&&++u===a&&(l=s),h===i&&++f===n&&(c=s),(p=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=p}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(zh={focusedElem:e,selectionRange:r},Cc=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var y=g.memoizedProps,b=g.memoizedState,v=t.stateNode,m=v.getSnapshotBeforeUpdate(t.elementType===t.type?y:cr(t.type,y),b);v.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(S){Me(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return g=Zg,Zg=!1,g}function Qo(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var a=n=n.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&np(t,r,i)}a=a.next}while(a!==n)}}function ud(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function ap(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function $2(e){var t=e.alternate;t!==null&&(e.alternate=null,$2(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[_r],delete t[vs],delete t[Hh],delete t[VP],delete t[GP])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function T2(e){return e.tag===5||e.tag===3||e.tag===4}function e0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||T2(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ip(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Tc));else if(n!==4&&(e=e.child,e!==null))for(ip(e,t,r),e=e.sibling;e!==null;)ip(e,t,r),e=e.sibling}function op(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(op(e,t,r),e=e.sibling;e!==null;)op(e,t,r),e=e.sibling}var st=null,ur=!1;function cn(e,t,r){for(r=r.child;r!==null;)M2(e,t,r),r=r.sibling}function M2(e,t,r){if(Nr&&typeof Nr.onCommitFiberUnmount=="function")try{Nr.onCommitFiberUnmount(rd,r)}catch{}switch(r.tag){case 5:pt||ti(r,t);case 6:var n=st,a=ur;st=null,cn(e,t,r),st=n,ur=a,st!==null&&(ur?(e=st,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):st.removeChild(r.stateNode));break;case 18:st!==null&&(ur?(e=st,r=r.stateNode,e.nodeType===8?Pf(e.parentNode,r):e.nodeType===1&&Pf(e,r),ds(e)):Pf(st,r.stateNode));break;case 4:n=st,a=ur,st=r.stateNode.containerInfo,ur=!0,cn(e,t,r),st=n,ur=a;break;case 0:case 11:case 14:case 15:if(!pt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){a=n=n.next;do{var i=a,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&np(r,t,s),a=a.next}while(a!==n)}cn(e,t,r);break;case 1:if(!pt&&(ti(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){Me(r,t,l)}cn(e,t,r);break;case 21:cn(e,t,r);break;case 22:r.mode&1?(pt=(n=pt)||r.memoizedState!==null,cn(e,t,r),pt=n):cn(e,t,r);break;default:cn(e,t,r)}}function t0(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new cA),t.forEach(function(n){var a=xA.bind(null,e,n);r.has(n)||(r.add(n),n.then(a,a))})}}function sr(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var a=r[n];try{var i=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:st=l.stateNode,ur=!1;break e;case 3:st=l.stateNode.containerInfo,ur=!0;break e;case 4:st=l.stateNode.containerInfo,ur=!0;break e}l=l.return}if(st===null)throw Error(H(160));M2(i,s,a),st=null,ur=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(u){Me(a,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)I2(t,e),t=t.sibling}function I2(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(sr(t,e),wr(e),n&4){try{Qo(3,e,e.return),ud(3,e)}catch(y){Me(e,e.return,y)}try{Qo(5,e,e.return)}catch(y){Me(e,e.return,y)}}break;case 1:sr(t,e),wr(e),n&512&&r!==null&&ti(r,r.return);break;case 5:if(sr(t,e),wr(e),n&512&&r!==null&&ti(r,r.return),e.flags&32){var a=e.stateNode;try{ss(a,"")}catch(y){Me(e,e.return,y)}}if(n&4&&(a=e.stateNode,a!=null)){var i=e.memoizedProps,s=r!==null?r.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&nw(a,i),Ch(l,s);var u=Ch(l,i);for(s=0;s<c.length;s+=2){var f=c[s],d=c[s+1];f==="style"?lw(a,d):f==="dangerouslySetInnerHTML"?ow(a,d):f==="children"?ss(a,d):Xm(a,f,d,u)}switch(l){case"input":kh(a,i);break;case"textarea":aw(a,i);break;case"select":var h=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?li(a,!!i.multiple,p,!1):h!==!!i.multiple&&(i.defaultValue!=null?li(a,!!i.multiple,i.defaultValue,!0):li(a,!!i.multiple,i.multiple?[]:"",!1))}a[vs]=i}catch(y){Me(e,e.return,y)}}break;case 6:if(sr(t,e),wr(e),n&4){if(e.stateNode===null)throw Error(H(162));a=e.stateNode,i=e.memoizedProps;try{a.nodeValue=i}catch(y){Me(e,e.return,y)}}break;case 3:if(sr(t,e),wr(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{ds(t.containerInfo)}catch(y){Me(e,e.return,y)}break;case 4:sr(t,e),wr(e);break;case 13:sr(t,e),wr(e),a=e.child,a.flags&8192&&(i=a.memoizedState!==null,a.stateNode.isHidden=i,!i||a.alternate!==null&&a.alternate.memoizedState!==null||(Av=Le())),n&4&&t0(e);break;case 22:if(f=r!==null&&r.memoizedState!==null,e.mode&1?(pt=(u=pt)||f,sr(t,e),pt=u):sr(t,e),wr(e),n&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!f&&e.mode&1)for(G=e,f=e.child;f!==null;){for(d=G=f;G!==null;){switch(h=G,p=h.child,h.tag){case 0:case 11:case 14:case 15:Qo(4,h,h.return);break;case 1:ti(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){n=h,r=h.return;try{t=n,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(y){Me(n,r,y)}}break;case 5:ti(h,h.return);break;case 22:if(h.memoizedState!==null){n0(d);continue}}p!==null?(p.return=h,G=p):n0(d)}f=f.sibling}e:for(f=null,d=e;;){if(d.tag===5){if(f===null){f=d;try{a=d.stateNode,u?(i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=d.stateNode,c=d.memoizedProps.style,s=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=sw("display",s))}catch(y){Me(e,e.return,y)}}}else if(d.tag===6){if(f===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(y){Me(e,e.return,y)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;f===d&&(f=null),d=d.return}f===d&&(f=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:sr(t,e),wr(e),n&4&&t0(e);break;case 21:break;default:sr(t,e),wr(e)}}function wr(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(T2(r)){var n=r;break e}r=r.return}throw Error(H(160))}switch(n.tag){case 5:var a=n.stateNode;n.flags&32&&(ss(a,""),n.flags&=-33);var i=e0(e);op(e,i,a);break;case 3:case 4:var s=n.stateNode.containerInfo,l=e0(e);ip(e,l,s);break;default:throw Error(H(161))}}catch(c){Me(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function dA(e,t,r){G=e,L2(e)}function L2(e,t,r){for(var n=(e.mode&1)!==0;G!==null;){var a=G,i=a.child;if(a.tag===22&&n){var s=a.memoizedState!==null||Fl;if(!s){var l=a.alternate,c=l!==null&&l.memoizedState!==null||pt;l=Fl;var u=pt;if(Fl=s,(pt=c)&&!u)for(G=a;G!==null;)s=G,c=s.child,s.tag===22&&s.memoizedState!==null?a0(a):c!==null?(c.return=s,G=c):a0(a);for(;i!==null;)G=i,L2(i),i=i.sibling;G=a,Fl=l,pt=u}r0(e)}else a.subtreeFlags&8772&&i!==null?(i.return=a,G=i):r0(e)}}function r0(e){for(;G!==null;){var t=G;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:pt||ud(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!pt)if(r===null)n.componentDidMount();else{var a=t.elementType===t.type?r.memoizedProps:cr(t.type,r.memoizedProps);n.componentDidUpdate(a,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Fg(t,i,n);break;case 3:var s=t.updateQueue;if(s!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Fg(t,s,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var f=u.memoizedState;if(f!==null){var d=f.dehydrated;d!==null&&ds(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}pt||t.flags&512&&ap(t)}catch(h){Me(t,t.return,h)}}if(t===e){G=null;break}if(r=t.sibling,r!==null){r.return=t.return,G=r;break}G=t.return}}function n0(e){for(;G!==null;){var t=G;if(t===e){G=null;break}var r=t.sibling;if(r!==null){r.return=t.return,G=r;break}G=t.return}}function a0(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{ud(4,t)}catch(c){Me(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var a=t.return;try{n.componentDidMount()}catch(c){Me(t,a,c)}}var i=t.return;try{ap(t)}catch(c){Me(t,i,c)}break;case 5:var s=t.return;try{ap(t)}catch(c){Me(t,s,c)}}}catch(c){Me(t,t.return,c)}if(t===e){G=null;break}var l=t.sibling;if(l!==null){l.return=t.return,G=l;break}G=t.return}}var fA=Math.ceil,Hc=nn.ReactCurrentDispatcher,Nv=nn.ReactCurrentOwner,Qt=nn.ReactCurrentBatchConfig,se=0,nt=null,Re=null,ct=0,Tt=0,ri=Dn(0),Ye=0,ws=null,xa=0,dd=0,Pv=0,Jo=null,kt=null,Av=0,ki=1/0,Rr=null,Kc=!1,sp=null,An=null,zl=!1,xn=null,Vc=0,Zo=0,lp=null,xc=-1,bc=0;function bt(){return se&6?Le():xc!==-1?xc:xc=Le()}function Cn(e){return e.mode&1?se&2&&ct!==0?ct&-ct:qP.transition!==null?(bc===0&&(bc=bw()),bc):(e=ue,e!==0||(e=window.event,e=e===void 0?16:Nw(e.type)),e):1}function mr(e,t,r,n){if(50<Zo)throw Zo=0,lp=null,Error(H(185));ll(e,r,n),(!(se&2)||e!==nt)&&(e===nt&&(!(se&2)&&(dd|=r),Ye===4&&vn(e,ct)),Ct(e,n),r===1&&se===0&&!(t.mode&1)&&(ki=Le()+500,sd&&Rn()))}function Ct(e,t){var r=e.callbackNode;qN(e,t);var n=Ac(e,e===nt?ct:0);if(n===0)r!==null&&hg(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&hg(r),t===1)e.tag===0?YP(i0.bind(null,e)):Vw(i0.bind(null,e)),HP(function(){!(se&6)&&Rn()}),r=null;else{switch(jw(n)){case 1:r=tv;break;case 4:r=gw;break;case 16:r=Pc;break;case 536870912:r=xw;break;default:r=Pc}r=H2(r,D2.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function D2(e,t){if(xc=-1,bc=0,se&6)throw Error(H(327));var r=e.callbackNode;if(hi()&&e.callbackNode!==r)return null;var n=Ac(e,e===nt?ct:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Gc(e,n);else{t=n;var a=se;se|=2;var i=B2();(nt!==e||ct!==t)&&(Rr=null,ki=Le()+500,da(e,t));do try{mA();break}catch(l){R2(e,l)}while(!0);pv(),Hc.current=i,se=a,Re!==null?t=0:(nt=null,ct=0,t=Ye)}if(t!==0){if(t===2&&(a=Ih(e),a!==0&&(n=a,t=cp(e,a))),t===1)throw r=ws,da(e,0),vn(e,n),Ct(e,Le()),r;if(t===6)vn(e,n);else{if(a=e.current.alternate,!(n&30)&&!hA(a)&&(t=Gc(e,n),t===2&&(i=Ih(e),i!==0&&(n=i,t=cp(e,i))),t===1))throw r=ws,da(e,0),vn(e,n),Ct(e,Le()),r;switch(e.finishedWork=a,e.finishedLanes=n,t){case 0:case 1:throw Error(H(345));case 2:Qn(e,kt,Rr);break;case 3:if(vn(e,n),(n&130023424)===n&&(t=Av+500-Le(),10<t)){if(Ac(e,0)!==0)break;if(a=e.suspendedLanes,(a&n)!==n){bt(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Uh(Qn.bind(null,e,kt,Rr),t);break}Qn(e,kt,Rr);break;case 4:if(vn(e,n),(n&4194240)===n)break;for(t=e.eventTimes,a=-1;0<n;){var s=31-pr(n);i=1<<s,s=t[s],s>a&&(a=s),n&=~i}if(n=a,n=Le()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*fA(n/1960))-n,10<n){e.timeoutHandle=Uh(Qn.bind(null,e,kt,Rr),n);break}Qn(e,kt,Rr);break;case 5:Qn(e,kt,Rr);break;default:throw Error(H(329))}}}return Ct(e,Le()),e.callbackNode===r?D2.bind(null,e):null}function cp(e,t){var r=Jo;return e.current.memoizedState.isDehydrated&&(da(e,t).flags|=256),e=Gc(e,t),e!==2&&(t=kt,kt=r,t!==null&&up(t)),e}function up(e){kt===null?kt=e:kt.push.apply(kt,e)}function hA(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var a=r[n],i=a.getSnapshot;a=a.value;try{if(!yr(i(),a))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function vn(e,t){for(t&=~Pv,t&=~dd,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-pr(t),n=1<<r;e[r]=-1,t&=~n}}function i0(e){if(se&6)throw Error(H(327));hi();var t=Ac(e,0);if(!(t&1))return Ct(e,Le()),null;var r=Gc(e,t);if(e.tag!==0&&r===2){var n=Ih(e);n!==0&&(t=n,r=cp(e,n))}if(r===1)throw r=ws,da(e,0),vn(e,t),Ct(e,Le()),r;if(r===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Qn(e,kt,Rr),Ct(e,Le()),null}function Cv(e,t){var r=se;se|=1;try{return e(t)}finally{se=r,se===0&&(ki=Le()+500,sd&&Rn())}}function ba(e){xn!==null&&xn.tag===0&&!(se&6)&&hi();var t=se;se|=1;var r=Qt.transition,n=ue;try{if(Qt.transition=null,ue=1,e)return e()}finally{ue=n,Qt.transition=r,se=t,!(se&6)&&Rn()}}function Ev(){Tt=ri.current,ke(ri)}function da(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,UP(r)),Re!==null)for(r=Re.return;r!==null;){var n=r;switch(dv(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Mc();break;case 3:Si(),ke(Pt),ke(vt),bv();break;case 5:xv(n);break;case 4:Si();break;case 13:ke(Ce);break;case 19:ke(Ce);break;case 10:mv(n.type._context);break;case 22:case 23:Ev()}r=r.return}if(nt=e,Re=e=En(e.current,null),ct=Tt=t,Ye=0,ws=null,Pv=dd=xa=0,kt=Jo=null,na!==null){for(t=0;t<na.length;t++)if(r=na[t],n=r.interleaved,n!==null){r.interleaved=null;var a=n.next,i=r.pending;if(i!==null){var s=i.next;i.next=a,n.next=s}r.pending=n}na=null}return e}function R2(e,t){do{var r=Re;try{if(pv(),vc.current=Uc,Wc){for(var n=Ee.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}Wc=!1}if(ga=0,et=Ve=Ee=null,Xo=!1,xs=0,Nv.current=null,r===null||r.return===null){Ye=1,ws=t,Re=null;break}e:{var i=e,s=r.return,l=r,c=t;if(t=ct,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,f=l,d=f.tag;if(!(f.mode&1)&&(d===0||d===11||d===15)){var h=f.alternate;h?(f.updateQueue=h.updateQueue,f.memoizedState=h.memoizedState,f.lanes=h.lanes):(f.updateQueue=null,f.memoizedState=null)}var p=Vg(s);if(p!==null){p.flags&=-257,Gg(p,s,l,i,t),p.mode&1&&Kg(i,u,t),t=p,c=u;var g=t.updateQueue;if(g===null){var y=new Set;y.add(c),t.updateQueue=y}else g.add(c);break e}else{if(!(t&1)){Kg(i,u,t),$v();break e}c=Error(H(426))}}else if(Ne&&l.mode&1){var b=Vg(s);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Gg(b,s,l,i,t),fv(_i(c,l));break e}}i=c=_i(c,l),Ye!==4&&(Ye=2),Jo===null?Jo=[i]:Jo.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var v=j2(i,c,t);Bg(i,v);break e;case 1:l=c;var m=i.type,x=i.stateNode;if(!(i.flags&128)&&(typeof m.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(An===null||!An.has(x)))){i.flags|=65536,t&=-t,i.lanes|=t;var S=w2(i,l,t);Bg(i,S);break e}}i=i.return}while(i!==null)}z2(r)}catch(j){t=j,Re===r&&r!==null&&(Re=r=r.return);continue}break}while(!0)}function B2(){var e=Hc.current;return Hc.current=Uc,e===null?Uc:e}function $v(){(Ye===0||Ye===3||Ye===2)&&(Ye=4),nt===null||!(xa&268435455)&&!(dd&268435455)||vn(nt,ct)}function Gc(e,t){var r=se;se|=2;var n=B2();(nt!==e||ct!==t)&&(Rr=null,da(e,t));do try{pA();break}catch(a){R2(e,a)}while(!0);if(pv(),se=r,Hc.current=n,Re!==null)throw Error(H(261));return nt=null,ct=0,Ye}function pA(){for(;Re!==null;)F2(Re)}function mA(){for(;Re!==null&&!FN();)F2(Re)}function F2(e){var t=U2(e.alternate,e,Tt);e.memoizedProps=e.pendingProps,t===null?z2(e):Re=t,Nv.current=null}function z2(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=lA(r,t),r!==null){r.flags&=32767,Re=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ye=6,Re=null;return}}else if(r=sA(r,t,Tt),r!==null){Re=r;return}if(t=t.sibling,t!==null){Re=t;return}Re=t=e}while(t!==null);Ye===0&&(Ye=5)}function Qn(e,t,r){var n=ue,a=Qt.transition;try{Qt.transition=null,ue=1,vA(e,t,r,n)}finally{Qt.transition=a,ue=n}return null}function vA(e,t,r,n){do hi();while(xn!==null);if(se&6)throw Error(H(327));r=e.finishedWork;var a=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(H(177));e.callbackNode=null,e.callbackPriority=0;var i=r.lanes|r.childLanes;if(XN(e,i),e===nt&&(Re=nt=null,ct=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||zl||(zl=!0,H2(Pc,function(){return hi(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=Qt.transition,Qt.transition=null;var s=ue;ue=1;var l=se;se|=4,Nv.current=null,uA(e,r),I2(r,e),LP(zh),Cc=!!Fh,zh=Fh=null,e.current=r,dA(r),zN(),se=l,ue=s,Qt.transition=i}else e.current=r;if(zl&&(zl=!1,xn=e,Vc=a),i=e.pendingLanes,i===0&&(An=null),HN(r.stateNode),Ct(e,Le()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)a=t[r],n(a.value,{componentStack:a.stack,digest:a.digest});if(Kc)throw Kc=!1,e=sp,sp=null,e;return Vc&1&&e.tag!==0&&hi(),i=e.pendingLanes,i&1?e===lp?Zo++:(Zo=0,lp=e):Zo=0,Rn(),null}function hi(){if(xn!==null){var e=jw(Vc),t=Qt.transition,r=ue;try{if(Qt.transition=null,ue=16>e?16:e,xn===null)var n=!1;else{if(e=xn,xn=null,Vc=0,se&6)throw Error(H(331));var a=se;for(se|=4,G=e.current;G!==null;){var i=G,s=i.child;if(G.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(G=u;G!==null;){var f=G;switch(f.tag){case 0:case 11:case 15:Qo(8,f,i)}var d=f.child;if(d!==null)d.return=f,G=d;else for(;G!==null;){f=G;var h=f.sibling,p=f.return;if($2(f),f===u){G=null;break}if(h!==null){h.return=p,G=h;break}G=p}}}var g=i.alternate;if(g!==null){var y=g.child;if(y!==null){g.child=null;do{var b=y.sibling;y.sibling=null,y=b}while(y!==null)}}G=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,G=s;else e:for(;G!==null;){if(i=G,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Qo(9,i,i.return)}var v=i.sibling;if(v!==null){v.return=i.return,G=v;break e}G=i.return}}var m=e.current;for(G=m;G!==null;){s=G;var x=s.child;if(s.subtreeFlags&2064&&x!==null)x.return=s,G=x;else e:for(s=m;G!==null;){if(l=G,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:ud(9,l)}}catch(j){Me(l,l.return,j)}if(l===s){G=null;break e}var S=l.sibling;if(S!==null){S.return=l.return,G=S;break e}G=l.return}}if(se=a,Rn(),Nr&&typeof Nr.onPostCommitFiberRoot=="function")try{Nr.onPostCommitFiberRoot(rd,e)}catch{}n=!0}return n}finally{ue=r,Qt.transition=t}}return!1}function o0(e,t,r){t=_i(r,t),t=j2(e,t,1),e=Pn(e,t,1),t=bt(),e!==null&&(ll(e,1,t),Ct(e,t))}function Me(e,t,r){if(e.tag===3)o0(e,e,r);else for(;t!==null;){if(t.tag===3){o0(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(An===null||!An.has(n))){e=_i(r,e),e=w2(t,e,1),t=Pn(t,e,1),e=bt(),t!==null&&(ll(t,1,e),Ct(t,e));break}}t=t.return}}function yA(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=bt(),e.pingedLanes|=e.suspendedLanes&r,nt===e&&(ct&r)===r&&(Ye===4||Ye===3&&(ct&130023424)===ct&&500>Le()-Av?da(e,0):Pv|=r),Ct(e,t)}function W2(e,t){t===0&&(e.mode&1?(t=El,El<<=1,!(El&130023424)&&(El=4194304)):t=1);var r=bt();e=Qr(e,t),e!==null&&(ll(e,t,r),Ct(e,r))}function gA(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),W2(e,r)}function xA(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(H(314))}n!==null&&n.delete(t),W2(e,r)}var U2;U2=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Pt.current)Ot=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Ot=!1,oA(e,t,r);Ot=!!(e.flags&131072)}else Ot=!1,Ne&&t.flags&1048576&&Gw(t,Dc,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;gc(e,t),e=t.pendingProps;var a=bi(t,vt.current);fi(t,r),a=wv(null,t,n,e,a,r);var i=Sv();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,At(n)?(i=!0,Ic(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,yv(t),a.updater=cd,t.stateNode=a,a._reactInternals=t,Xh(t,n,e,r),t=Zh(null,t,n,!0,i,r)):(t.tag=0,Ne&&i&&uv(t),yt(null,t,a,r),t=t.child),t;case 16:n=t.elementType;e:{switch(gc(e,t),e=t.pendingProps,a=n._init,n=a(n._payload),t.type=n,a=t.tag=jA(n),e=cr(n,e),a){case 0:t=Jh(null,t,n,e,r);break e;case 1:t=Xg(null,t,n,e,r);break e;case 11:t=Yg(null,t,n,e,r);break e;case 14:t=qg(null,t,n,cr(n.type,e),r);break e}throw Error(H(306,n,""))}return t;case 0:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:cr(n,a),Jh(e,t,n,a,r);case 1:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:cr(n,a),Xg(e,t,n,a,r);case 3:e:{if(O2(t),e===null)throw Error(H(387));n=t.pendingProps,i=t.memoizedState,a=i.element,Zw(e,t),Fc(t,n,null,r);var s=t.memoizedState;if(n=s.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){a=_i(Error(H(423)),t),t=Qg(e,t,n,r,a);break e}else if(n!==a){a=_i(Error(H(424)),t),t=Qg(e,t,n,r,a);break e}else for(Lt=Nn(t.stateNode.containerInfo.firstChild),Dt=t,Ne=!0,fr=null,r=Qw(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ji(),n===a){t=Jr(e,t,r);break e}yt(e,t,n,r)}t=t.child}return t;case 5:return e2(t),e===null&&Gh(t),n=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,s=a.children,Wh(n,a)?s=null:i!==null&&Wh(n,i)&&(t.flags|=32),k2(e,t),yt(e,t,s,r),t.child;case 6:return e===null&&Gh(t),null;case 13:return N2(e,t,r);case 4:return gv(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=wi(t,null,n,r):yt(e,t,n,r),t.child;case 11:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:cr(n,a),Yg(e,t,n,a,r);case 7:return yt(e,t,t.pendingProps,r),t.child;case 8:return yt(e,t,t.pendingProps.children,r),t.child;case 12:return yt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,a=t.pendingProps,i=t.memoizedProps,s=a.value,je(Rc,n._currentValue),n._currentValue=s,i!==null)if(yr(i.value,s)){if(i.children===a.children&&!Pt.current){t=Jr(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){s=i.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(i.tag===1){c=Vr(-1,r&-r),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?c.next=c:(c.next=f.next,f.next=c),u.pending=c}}i.lanes|=r,c=i.alternate,c!==null&&(c.lanes|=r),Yh(i.return,r,t),l.lanes|=r;break}c=c.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(H(341));s.lanes|=r,l=s.alternate,l!==null&&(l.lanes|=r),Yh(s,r,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}yt(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,n=t.pendingProps.children,fi(t,r),a=Jt(a),n=n(a),t.flags|=1,yt(e,t,n,r),t.child;case 14:return n=t.type,a=cr(n,t.pendingProps),a=cr(n.type,a),qg(e,t,n,a,r);case 15:return S2(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:cr(n,a),gc(e,t),t.tag=1,At(n)?(e=!0,Ic(t)):e=!1,fi(t,r),b2(t,n,a),Xh(t,n,a,r),Zh(null,t,n,!0,e,r);case 19:return P2(e,t,r);case 22:return _2(e,t,r)}throw Error(H(156,t.tag))};function H2(e,t){return yw(e,t)}function bA(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qt(e,t,r,n){return new bA(e,t,r,n)}function Tv(e){return e=e.prototype,!(!e||!e.isReactComponent)}function jA(e){if(typeof e=="function")return Tv(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Jm)return 11;if(e===Zm)return 14}return 2}function En(e,t){var r=e.alternate;return r===null?(r=qt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function jc(e,t,r,n,a,i){var s=2;if(n=e,typeof e=="function")Tv(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Va:return fa(r.children,a,i,t);case Qm:s=8,a|=8;break;case bh:return e=qt(12,r,t,a|2),e.elementType=bh,e.lanes=i,e;case jh:return e=qt(13,r,t,a),e.elementType=jh,e.lanes=i,e;case wh:return e=qt(19,r,t,a),e.elementType=wh,e.lanes=i,e;case ew:return fd(r,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Jj:s=10;break e;case Zj:s=9;break e;case Jm:s=11;break e;case Zm:s=14;break e;case fn:s=16,n=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=qt(s,r,t,a),t.elementType=e,t.type=n,t.lanes=i,t}function fa(e,t,r,n){return e=qt(7,e,n,t),e.lanes=r,e}function fd(e,t,r,n){return e=qt(22,e,n,t),e.elementType=ew,e.lanes=r,e.stateNode={isHidden:!1},e}function Lf(e,t,r){return e=qt(6,e,null,t),e.lanes=r,e}function Df(e,t,r){return t=qt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function wA(e,t,r,n,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=yf(0),this.expirationTimes=yf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yf(0),this.identifierPrefix=n,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function Mv(e,t,r,n,a,i,s,l,c){return e=new wA(e,t,r,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=qt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},yv(i),e}function SA(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ka,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function K2(e){if(!e)return In;e=e._reactInternals;e:{if(Pa(e)!==e||e.tag!==1)throw Error(H(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(At(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(H(171))}if(e.tag===1){var r=e.type;if(At(r))return Kw(e,r,t)}return t}function V2(e,t,r,n,a,i,s,l,c){return e=Mv(r,n,!0,e,a,i,s,l,c),e.context=K2(null),r=e.current,n=bt(),a=Cn(r),i=Vr(n,a),i.callback=t??null,Pn(r,i,a),e.current.lanes=a,ll(e,a,n),Ct(e,n),e}function hd(e,t,r,n){var a=t.current,i=bt(),s=Cn(a);return r=K2(r),t.context===null?t.context=r:t.pendingContext=r,t=Vr(i,s),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Pn(a,t,s),e!==null&&(mr(e,a,s,i),mc(e,a,s)),s}function Yc(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function s0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Iv(e,t){s0(e,t),(e=e.alternate)&&s0(e,t)}function _A(){return null}var G2=typeof reportError=="function"?reportError:function(e){console.error(e)};function Lv(e){this._internalRoot=e}pd.prototype.render=Lv.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));hd(e,t,null,null)};pd.prototype.unmount=Lv.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ba(function(){hd(null,e,null,null)}),t[Xr]=null}};function pd(e){this._internalRoot=e}pd.prototype.unstable_scheduleHydration=function(e){if(e){var t=_w();e={blockedOn:null,target:e,priority:t};for(var r=0;r<mn.length&&t!==0&&t<mn[r].priority;r++);mn.splice(r,0,e),r===0&&Ow(e)}};function Dv(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function md(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function l0(){}function kA(e,t,r,n,a){if(a){if(typeof n=="function"){var i=n;n=function(){var u=Yc(s);i.call(u)}}var s=V2(t,n,e,0,null,!1,!1,"",l0);return e._reactRootContainer=s,e[Xr]=s.current,ps(e.nodeType===8?e.parentNode:e),ba(),s}for(;a=e.lastChild;)e.removeChild(a);if(typeof n=="function"){var l=n;n=function(){var u=Yc(c);l.call(u)}}var c=Mv(e,0,!1,null,null,!1,!1,"",l0);return e._reactRootContainer=c,e[Xr]=c.current,ps(e.nodeType===8?e.parentNode:e),ba(function(){hd(t,c,r,n)}),c}function vd(e,t,r,n,a){var i=r._reactRootContainer;if(i){var s=i;if(typeof a=="function"){var l=a;a=function(){var c=Yc(s);l.call(c)}}hd(t,s,e,a)}else s=kA(r,t,e,a,n);return Yc(s)}ww=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Fo(t.pendingLanes);r!==0&&(rv(t,r|1),Ct(t,Le()),!(se&6)&&(ki=Le()+500,Rn()))}break;case 13:ba(function(){var n=Qr(e,1);if(n!==null){var a=bt();mr(n,e,1,a)}}),Iv(e,1)}};nv=function(e){if(e.tag===13){var t=Qr(e,134217728);if(t!==null){var r=bt();mr(t,e,134217728,r)}Iv(e,134217728)}};Sw=function(e){if(e.tag===13){var t=Cn(e),r=Qr(e,t);if(r!==null){var n=bt();mr(r,e,t,n)}Iv(e,t)}};_w=function(){return ue};kw=function(e,t){var r=ue;try{return ue=e,t()}finally{ue=r}};$h=function(e,t,r){switch(t){case"input":if(kh(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var a=od(n);if(!a)throw Error(H(90));rw(n),kh(n,a)}}}break;case"textarea":aw(e,r);break;case"select":t=r.value,t!=null&&li(e,!!r.multiple,t,!1)}};dw=Cv;fw=ba;var OA={usingClientEntryPoint:!1,Events:[ul,Xa,od,cw,uw,Cv]},ko={findFiberByHostInstance:ra,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},NA={bundleType:ko.bundleType,version:ko.version,rendererPackageName:ko.rendererPackageName,rendererConfig:ko.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:nn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=mw(e),e===null?null:e.stateNode},findFiberByHostInstance:ko.findFiberByHostInstance||_A,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Wl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wl.isDisabled&&Wl.supportsFiber)try{rd=Wl.inject(NA),Nr=Wl}catch{}}zt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=OA;zt.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Dv(t))throw Error(H(200));return SA(e,t,null,r)};zt.createRoot=function(e,t){if(!Dv(e))throw Error(H(299));var r=!1,n="",a=G2;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=Mv(e,1,!1,null,null,r,!1,n,a),e[Xr]=t.current,ps(e.nodeType===8?e.parentNode:e),new Lv(t)};zt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(H(188)):(e=Object.keys(e).join(","),Error(H(268,e)));return e=mw(t),e=e===null?null:e.stateNode,e};zt.flushSync=function(e){return ba(e)};zt.hydrate=function(e,t,r){if(!md(t))throw Error(H(200));return vd(null,e,t,!0,r)};zt.hydrateRoot=function(e,t,r){if(!Dv(e))throw Error(H(405));var n=r!=null&&r.hydratedSources||null,a=!1,i="",s=G2;if(r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(s=r.onRecoverableError)),t=V2(t,null,e,1,r??null,a,!1,i,s),e[Xr]=t.current,ps(e),n)for(e=0;e<n.length;e++)r=n[e],a=r._getVersion,a=a(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,a]:t.mutableSourceEagerHydrationData.push(r,a);return new pd(t)};zt.render=function(e,t,r){if(!md(t))throw Error(H(200));return vd(null,e,t,!1,r)};zt.unmountComponentAtNode=function(e){if(!md(e))throw Error(H(40));return e._reactRootContainer?(ba(function(){vd(null,null,e,!1,function(){e._reactRootContainer=null,e[Xr]=null})}),!0):!1};zt.unstable_batchedUpdates=Cv;zt.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!md(r))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return vd(e,t,r,!1,n)};zt.version="18.3.1-next-f1338f8080-20240426";function Y2(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Y2)}catch(e){console.error(e)}}Y2(),Yj.exports=zt;var PA=Yj.exports,c0=PA;gh.createRoot=c0.createRoot,gh.hydrateRoot=c0.hydrateRoot;/**
- * @remix-run/router v1.23.2
- *
- * Copyright (c) Remix Software Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE.md file in the root directory of this source tree.
- *
- * @license MIT
- */function Ss(){return Ss=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ss.apply(this,arguments)}var bn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(bn||(bn={}));const u0="popstate";function AA(e){e===void 0&&(e={});function t(n,a){let{pathname:i,search:s,hash:l}=n.location;return dp("",{pathname:i,search:s,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:qc(a)}return EA(t,r,null,e)}function Fe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Rv(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function CA(){return Math.random().toString(36).substr(2,8)}function d0(e,t){return{usr:e.state,key:e.key,idx:t}}function dp(e,t,r,n){return r===void 0&&(r=null),Ss({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ro(t):t,{state:r,key:t&&t.key||n||CA()})}function qc(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function ro(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function EA(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:i=!1}=n,s=a.history,l=bn.Pop,c=null,u=f();u==null&&(u=0,s.replaceState(Ss({},s.state,{idx:u}),""));function f(){return(s.state||{idx:null}).idx}function d(){l=bn.Pop;let b=f(),v=b==null?null:b-u;u=b,c&&c({action:l,location:y.location,delta:v})}function h(b,v){l=bn.Push;let m=dp(y.location,b,v);u=f()+1;let x=d0(m,u),S=y.createHref(m);try{s.pushState(x,"",S)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;a.location.assign(S)}i&&c&&c({action:l,location:y.location,delta:1})}function p(b,v){l=bn.Replace;let m=dp(y.location,b,v);u=f();let x=d0(m,u),S=y.createHref(m);s.replaceState(x,"",S),i&&c&&c({action:l,location:y.location,delta:0})}function g(b){let v=a.location.origin!=="null"?a.location.origin:a.location.href,m=typeof b=="string"?b:qc(b);return m=m.replace(/ $/,"%20"),Fe(v,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,v)}let y={get action(){return l},get location(){return e(a,s)},listen(b){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(u0,d),c=b,()=>{a.removeEventListener(u0,d),c=null}},createHref(b){return t(a,b)},createURL:g,encodeLocation(b){let v=g(b);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:p,go(b){return s.go(b)}};return y}var f0;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(f0||(f0={}));function $A(e,t,r){return r===void 0&&(r="/"),TA(e,t,r)}function TA(e,t,r,n){let a=typeof t=="string"?ro(t):t,i=Bv(a.pathname||"/",r);if(i==null)return null;let s=q2(e);MA(s);let l=null;for(let c=0;l==null&&c<s.length;++c){let u=VA(i);l=UA(s[c],u)}return l}function q2(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(i,s,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};c.relativePath.startsWith("/")&&(Fe(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let u=$n([n,c.relativePath]),f=r.concat(c);i.children&&i.children.length>0&&(Fe(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),q2(i.children,t,f,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:zA(u,i.index),routesMeta:f})};return e.forEach((i,s)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))a(i,s);else for(let c of X2(i.path))a(i,s,c)}),t}function X2(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let s=X2(n.join("/")),l=[];return l.push(...s.map(c=>c===""?i:[i,c].join("/"))),a&&l.push(...s),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function MA(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:WA(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const IA=/^:[\w-]+$/,LA=3,DA=2,RA=1,BA=10,FA=-2,h0=e=>e==="*";function zA(e,t){let r=e.split("/"),n=r.length;return r.some(h0)&&(n+=FA),t&&(n+=DA),r.filter(a=>!h0(a)).reduce((a,i)=>a+(IA.test(i)?LA:i===""?RA:BA),n)}function WA(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function UA(e,t,r){let{routesMeta:n}=e,a={},i="/",s=[];for(let l=0;l<n.length;++l){let c=n[l],u=l===n.length-1,f=i==="/"?t:t.slice(i.length)||"/",d=HA({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},f),h=c.route;if(!d)return null;Object.assign(a,d.params),s.push({params:a,pathname:$n([i,d.pathname]),pathnameBase:QA($n([i,d.pathnameBase])),route:h}),d.pathnameBase!=="/"&&(i=$n([i,d.pathnameBase]))}return s}function HA(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=KA(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let i=a[0],s=i.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((u,f,d)=>{let{paramName:h,isOptional:p}=f;if(h==="*"){let y=l[d]||"";s=i.slice(0,i.length-y.length).replace(/(.)\/+$/,"$1")}const g=l[d];return p&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:s,pattern:e}}function KA(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Rv(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function VA(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Rv(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Bv(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const GA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,YA=e=>GA.test(e);function qA(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?ro(e):e,i;if(r)if(YA(r))i=r;else{if(r.includes("//")){let s=r;r=r.replace(/\/\/+/g,"/"),Rv(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+r))}r.startsWith("/")?i=p0(r.substring(1),"/"):i=p0(r,t)}else i=t;return{pathname:i,search:JA(n),hash:ZA(a)}}function p0(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Rf(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function XA(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Q2(e,t){let r=XA(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function J2(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=ro(e):(a=Ss({},e),Fe(!a.pathname||!a.pathname.includes("?"),Rf("?","pathname","search",a)),Fe(!a.pathname||!a.pathname.includes("#"),Rf("#","pathname","hash",a)),Fe(!a.search||!a.search.includes("#"),Rf("#","search","hash",a)));let i=e===""||a.pathname==="",s=i?"/":a.pathname,l;if(s==null)l=r;else{let d=t.length-1;if(!n&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),d-=1;a.pathname=h.join("/")}l=d>=0?t[d]:"/"}let c=qA(a,l),u=s&&s!=="/"&&s.endsWith("/"),f=(i||s===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||f)&&(c.pathname+="/"),c}const $n=e=>e.join("/").replace(/\/\/+/g,"/"),QA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),JA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ZA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function eC(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Z2=["post","put","patch","delete"];new Set(Z2);const tC=["get",...Z2];new Set(tC);/**
- * React Router v6.30.3
- *
- * Copyright (c) Remix Software Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE.md file in the root directory of this source tree.
- *
- * @license MIT
- */function _s(){return _s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_s.apply(this,arguments)}const Fv=P.createContext(null),rC=P.createContext(null),Aa=P.createContext(null),yd=P.createContext(null),Bn=P.createContext({outlet:null,matches:[],isDataRoute:!1}),eS=P.createContext(null);function nC(e,t){let{relative:r}=t===void 0?{}:t;fl()||Fe(!1);let{basename:n,navigator:a}=P.useContext(Aa),{hash:i,pathname:s,search:l}=rS(e,{relative:r}),c=s;return n!=="/"&&(c=s==="/"?n:$n([n,s])),a.createHref({pathname:c,search:l,hash:i})}function fl(){return P.useContext(yd)!=null}function hl(){return fl()||Fe(!1),P.useContext(yd).location}function tS(e){P.useContext(Aa).static||P.useLayoutEffect(e)}function gd(){let{isDataRoute:e}=P.useContext(Bn);return e?gC():aC()}function aC(){fl()||Fe(!1);let e=P.useContext(Fv),{basename:t,future:r,navigator:n}=P.useContext(Aa),{matches:a}=P.useContext(Bn),{pathname:i}=hl(),s=JSON.stringify(Q2(a,r.v7_relativeSplatPath)),l=P.useRef(!1);return tS(()=>{l.current=!0}),P.useCallback(function(u,f){if(f===void 0&&(f={}),!l.current)return;if(typeof u=="number"){n.go(u);return}let d=J2(u,JSON.parse(s),i,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:$n([t,d.pathname])),(f.replace?n.replace:n.push)(d,f.state,f)},[t,n,s,i,e])}const iC=P.createContext(null);function oC(e){let t=P.useContext(Bn).outlet;return t&&P.createElement(iC.Provider,{value:e},t)}function rS(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=P.useContext(Aa),{matches:a}=P.useContext(Bn),{pathname:i}=hl(),s=JSON.stringify(Q2(a,n.v7_relativeSplatPath));return P.useMemo(()=>J2(e,JSON.parse(s),i,r==="path"),[e,s,i,r])}function sC(e,t){return lC(e,t)}function lC(e,t,r,n){fl()||Fe(!1);let{navigator:a}=P.useContext(Aa),{matches:i}=P.useContext(Bn),s=i[i.length-1],l=s?s.params:{};s&&s.pathname;let c=s?s.pathnameBase:"/";s&&s.route;let u=hl(),f;if(t){var d;let b=typeof t=="string"?ro(t):t;c==="/"||(d=b.pathname)!=null&&d.startsWith(c)||Fe(!1),f=b}else f=u;let h=f.pathname||"/",p=h;if(c!=="/"){let b=c.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(b.length).join("/")}let g=$A(e,{pathname:p}),y=hC(g&&g.map(b=>Object.assign({},b,{params:Object.assign({},l,b.params),pathname:$n([c,a.encodeLocation?a.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?c:$n([c,a.encodeLocation?a.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),i,r,n);return t&&y?P.createElement(yd.Provider,{value:{location:_s({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:bn.Pop}},y):y}function cC(){let e=yC(),t=eC(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return P.createElement(P.Fragment,null,P.createElement("h2",null,"Unexpected Application Error!"),P.createElement("h3",{style:{fontStyle:"italic"}},t),r?P.createElement("pre",{style:a},r):null,null)}const uC=P.createElement(cC,null);class dC extends P.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?P.createElement(Bn.Provider,{value:this.props.routeContext},P.createElement(eS.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function fC(e){let{routeContext:t,match:r,children:n}=e,a=P.useContext(Fv);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),P.createElement(Bn.Provider,{value:t},n)}function hC(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var i;if(!r)return null;if(r.errors)e=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let s=e,l=(a=r)==null?void 0:a.errors;if(l!=null){let f=s.findIndex(d=>d.route.id&&(l==null?void 0:l[d.route.id])!==void 0);f>=0||Fe(!1),s=s.slice(0,Math.min(s.length,f+1))}let c=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let f=0;f<s.length;f++){let d=s[f];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=f),d.route.id){let{loaderData:h,errors:p}=r,g=d.route.loader&&h[d.route.id]===void 0&&(!p||p[d.route.id]===void 0);if(d.route.lazy||g){c=!0,u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((f,d,h)=>{let p,g=!1,y=null,b=null;r&&(p=l&&d.route.id?l[d.route.id]:void 0,y=d.route.errorElement||uC,c&&(u<0&&h===0?(xC("route-fallback"),g=!0,b=null):u===h&&(g=!0,b=d.route.hydrateFallbackElement||null)));let v=t.concat(s.slice(0,h+1)),m=()=>{let x;return p?x=y:g?x=b:d.route.Component?x=P.createElement(d.route.Component,null):d.route.element?x=d.route.element:x=f,P.createElement(fC,{match:d,routeContext:{outlet:f,matches:v,isDataRoute:r!=null},children:x})};return r&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?P.createElement(dC,{location:r.location,revalidation:r.revalidation,component:y,error:p,children:m(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):m()},null)}var nS=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(nS||{}),aS=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(aS||{});function pC(e){let t=P.useContext(Fv);return t||Fe(!1),t}function mC(e){let t=P.useContext(rC);return t||Fe(!1),t}function vC(e){let t=P.useContext(Bn);return t||Fe(!1),t}function iS(e){let t=vC(),r=t.matches[t.matches.length-1];return r.route.id||Fe(!1),r.route.id}function yC(){var e;let t=P.useContext(eS),r=mC(),n=iS();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function gC(){let{router:e}=pC(nS.UseNavigateStable),t=iS(aS.UseNavigateStable),r=P.useRef(!1);return tS(()=>{r.current=!0}),P.useCallback(function(a,i){i===void 0&&(i={}),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,_s({fromRouteId:t},i)))},[e,t])}const m0={};function xC(e,t,r){m0[e]||(m0[e]=!0)}function bC(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function jC(e){return oC(e.context)}function it(e){Fe(!1)}function wC(e){let{basename:t="/",children:r=null,location:n,navigationType:a=bn.Pop,navigator:i,static:s=!1,future:l}=e;fl()&&Fe(!1);let c=t.replace(/^\/*/,"/"),u=P.useMemo(()=>({basename:c,navigator:i,static:s,future:_s({v7_relativeSplatPath:!1},l)}),[c,l,i,s]);typeof n=="string"&&(n=ro(n));let{pathname:f="/",search:d="",hash:h="",state:p=null,key:g="default"}=n,y=P.useMemo(()=>{let b=Bv(f,c);return b==null?null:{location:{pathname:b,search:d,hash:h,state:p,key:g},navigationType:a}},[c,f,d,h,p,g,a]);return y==null?null:P.createElement(Aa.Provider,{value:u},P.createElement(yd.Provider,{children:r,value:y}))}function SC(e){let{children:t,location:r}=e;return sC(fp(t),r)}new Promise(()=>{});function fp(e,t){t===void 0&&(t=[]);let r=[];return P.Children.forEach(e,(n,a)=>{if(!P.isValidElement(n))return;let i=[...t,a];if(n.type===P.Fragment){r.push.apply(r,fp(n.props.children,i));return}n.type!==it&&Fe(!1),!n.props.index||!n.props.children||Fe(!1);let s={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(s.children=fp(n.props.children,i)),r.push(s)}),r}/**
- * React Router DOM v6.30.3
- *
- * Copyright (c) Remix Software Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE.md file in the root directory of this source tree.
- *
- * @license MIT
- */function hp(){return hp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hp.apply(this,arguments)}function _C(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function kC(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function OC(e,t){return e.button===0&&(!t||t==="_self")&&!kC(e)}const NC=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],PC="6";try{window.__reactRouterVersion=PC}catch{}const AC="startTransition",v0=yN[AC];function CC(e){let{basename:t,children:r,future:n,window:a}=e,i=P.useRef();i.current==null&&(i.current=AA({window:a,v5Compat:!0}));let s=i.current,[l,c]=P.useState({action:s.action,location:s.location}),{v7_startTransition:u}=n||{},f=P.useCallback(d=>{u&&v0?v0(()=>c(d)):c(d)},[c,u]);return P.useLayoutEffect(()=>s.listen(f),[s,f]),P.useEffect(()=>bC(n),[n]),P.createElement(wC,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}const EC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",$C=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wc=P.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:i,replace:s,state:l,target:c,to:u,preventScrollReset:f,viewTransition:d}=t,h=_C(t,NC),{basename:p}=P.useContext(Aa),g,y=!1;if(typeof u=="string"&&$C.test(u)&&(g=u,EC))try{let x=new URL(window.location.href),S=u.startsWith("//")?new URL(x.protocol+u):new URL(u),j=Bv(S.pathname,p);S.origin===x.origin&&j!=null?u=j+S.search+S.hash:y=!0}catch{}let b=nC(u,{relative:a}),v=TC(u,{replace:s,state:l,target:c,preventScrollReset:f,relative:a,viewTransition:d});function m(x){n&&n(x),x.defaultPrevented||v(x)}return P.createElement("a",hp({},h,{href:g||b,onClick:y||i?n:m,ref:r,target:c}))});var y0;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(y0||(y0={}));var g0;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(g0||(g0={}));function TC(e,t){let{target:r,replace:n,state:a,preventScrollReset:i,relative:s,viewTransition:l}=t===void 0?{}:t,c=gd(),u=hl(),f=rS(e,{relative:s});return P.useCallback(d=>{if(OC(d,r)){d.preventDefault();let h=n!==void 0?n:qc(u)===qc(f);c(e,{replace:h,state:a,preventScrollReset:i,relative:s,viewTransition:l})}},[u,c,f,n,a,r,e,i,s,l])}const MC="/api";async function Oe(e,t={}){const r=await fetch(`${MC}${e}`,{...t,credentials:"same-origin",headers:{"Content-Type":"application/json",...t.headers}});return r.status===401&&!e.startsWith("/auth/")?(window.location.href="/login",{}):r.json()}async function me(e,t){return Oe(e,{method:"POST",body:JSON.stringify(t)})}async function zv(){try{return(await Oe("/auth/session")).authenticated===!0}catch{return!1}}async function IC(e,t){return(await me("/auth/login",{username:e,password:t})).success===!0}async function LC(e){return await me("/auth/google",{credential:e})}async function DC(){try{return await Oe("/auth/google-config")}catch{return{configured:!1}}}async function RC(){await me("/auth/logout",{}),window.location.href="/login"}const BC=`
-@keyframes floatDot {
- 0%, 100% { transform: translateY(0px) scale(1); opacity: 0.18; }
- 50% { transform: translateY(-18px) scale(1.1); opacity: 0.35; }
-}
-.login-dot {
- position: absolute;
- border-radius: 50%;
- background: var(--cyan);
- animation: floatDot linear infinite;
- pointer-events: none;
-}
-`,FC=Array.from({length:22},(e,t)=>({size:2+Math.random()*4,top:Math.random()*100,left:Math.random()*100,duration:4+Math.random()*6,delay:-(Math.random()*8)}));function zC(){const[e,t]=P.useState(""),[r,n]=P.useState(""),[a,i]=P.useState(!1),[s,l]=P.useState(""),[c,u]=P.useState(!1),[f,d]=P.useState(!0),[h,p]=P.useState(!1),[g,y]=P.useState(null),b=P.useRef(null),v=gd();P.useEffect(()=>{zv().then(w=>{w?v("/"):d(!1)}),DC().then(w=>{w.configured&&w.client_id&&(y(w.client_id),m(w.client_id))})},[]);function m(w){if(document.getElementById("google-gsi")){x(w);return}const _=document.createElement("script");_.id="google-gsi",_.src="https://accounts.google.com/gsi/client",_.async=!0,_.defer=!0,_.onload=()=>x(w),document.head.appendChild(_)}function x(w){var _,O;(O=(_=window.google)==null?void 0:_.accounts)!=null&&O.id&&(window.google.accounts.id.initialize({client_id:w,callback:S,auto_select:!1}),p(!0))}P.useEffect(()=>{var w,_;h&&b.current&&((_=(w=window.google)==null?void 0:w.accounts)!=null&&_.id)&&window.google.accounts.id.renderButton(b.current,{type:"standard",theme:"filled_black",size:"large",text:"signin_with",shape:"pill",width:360})},[h]);async function S(w){l(""),u(!0);try{const _=await LC(w.credential);_.success?v("/"):l(_.error||"Google login failed")}catch{l("Connection error")}u(!1)}async function j(w){w.preventDefault(),l(""),u(!0);try{await IC(e,r)?v("/"):l("Invalid credentials")}catch{l("Connection error")}u(!1)}return f?o.jsx("div",{className:"flex items-center justify-center min-h-screen",style:{background:"var(--bg)"},children:o.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})}):o.jsxs("div",{className:"min-h-screen flex items-center justify-center p-4",style:{background:"var(--bg)",position:"relative",overflow:"hidden"},children:[o.jsx("style",{children:BC}),FC.map((w,_)=>o.jsx("span",{className:"login-dot",style:{width:w.size,height:w.size,top:`${w.top}%`,left:`${w.left}%`,animationDuration:`${w.duration}s`,animationDelay:`${w.delay}s`}},_)),o.jsx("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:600,height:600,borderRadius:"50%",background:"radial-gradient(ellipse, rgba(0,240,255,0.04) 0%, transparent 70%)",pointerEvents:"none"}}),o.jsxs("div",{className:"card-glow fade-in w-full",style:{maxWidth:400,position:"relative",zIndex:1},children:[o.jsxs("div",{className:"flex flex-col items-center mb-7",children:[o.jsx("div",{style:{width:72,height:72,borderRadius:18,background:"linear-gradient(135deg, var(--orange), #C45A08)",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:16,boxShadow:"0 4px 24px rgba(247,147,26,0.35)"},children:o.jsx("span",{style:{color:"#0E0E10",fontWeight:900,fontSize:32,fontFamily:"var(--font-heading)",lineHeight:1},children:"K"})}),o.jsx("h1",{className:"kalshi-gradient heading",style:{fontSize:26,fontWeight:800,letterSpacing:"-0.02em",marginBottom:6},children:"KEN TRADER"}),o.jsx("p",{style:{fontSize:13,color:"var(--text-muted)",marginBottom:4},children:"Event Contracts Trading Platform"}),o.jsx("span",{className:"badge bg-green",style:{fontSize:10},children:"CFTC-Regulated DCM"})]}),s&&o.jsxs("div",{className:"fade-in",style:{display:"flex",alignItems:"center",gap:8,background:"var(--red-dim)",border:"1px solid rgba(255,92,92,0.25)",borderRadius:8,padding:"10px 12px",marginBottom:16,color:"var(--red)",fontSize:13},children:[o.jsx("svg",{style:{width:15,height:15,flexShrink:0},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),s]}),g&&o.jsxs("div",{style:{marginBottom:4},children:[o.jsx("div",{ref:b,style:{display:"flex",justifyContent:"center",marginBottom:16}}),o.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",marginBottom:20},children:[o.jsx("div",{style:{flex:1,height:1,background:"var(--border)"}}),o.jsx("span",{style:{padding:"0 12px",fontSize:11,color:"var(--text-muted)",background:"var(--surface)",whiteSpace:"nowrap"},children:"or sign in with password"}),o.jsx("div",{style:{flex:1,height:1,background:"var(--border)"}})]})]}),o.jsxs("form",{onSubmit:j,children:[o.jsxs("div",{style:{marginBottom:14},children:[o.jsx("label",{style:{display:"block",fontSize:11,fontWeight:600,color:"var(--text-dim)",marginBottom:6,textTransform:"uppercase",letterSpacing:"0.06em"},children:"Username"}),o.jsx("input",{type:"text",value:e,onChange:w=>t(w.target.value),required:!0,autoComplete:"username",placeholder:"admin",className:"input"})]}),o.jsxs("div",{style:{marginBottom:20},children:[o.jsx("label",{style:{display:"block",fontSize:11,fontWeight:600,color:"var(--text-dim)",marginBottom:6,textTransform:"uppercase",letterSpacing:"0.06em"},children:"Password"}),o.jsxs("div",{style:{position:"relative"},children:[o.jsx("input",{type:a?"text":"password",value:r,onChange:w=>n(w.target.value),required:!0,autoComplete:"current-password",placeholder:"Enter password",className:"input",style:{paddingRight:"2.5rem"}}),o.jsx("button",{type:"button",onClick:()=>i(!a),style:{position:"absolute",right:12,top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",color:"var(--text-muted)",padding:0,display:"flex"},children:o.jsx("svg",{style:{width:16,height:16},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:a?"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.878 9.878L3 3m6.878 6.879L21 21":"M15 12a3 3 0 11-6 0 3 3 0 016 0z M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})})})]})]}),o.jsxs("button",{type:"submit",disabled:c,className:"btn btn-p btn-lg",style:{width:"100%",opacity:c?.6:1},children:[c&&o.jsx("span",{className:"w-4 h-4 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"#0E0E10",borderTopColor:"transparent"}}),c?"Signing in...":"Sign In"]})]}),o.jsx("p",{style:{textAlign:"center",marginTop:20,fontSize:10,color:"var(--text-muted)",letterSpacing:"0.02em"},children:"Ken operates as a CFTC-regulated Designated Contract Market"})]})]})}const x0=[{sym:"POTUS-2028",price:"52c",chg:"+3.1%",up:!0},{sym:"FED-RATE-CUT",price:"78c",chg:"-1.2%",up:!1},{sym:"BTC-100K",price:"34c",chg:"+5.8%",up:!0},{sym:"NVIDIA-BEAT",price:"91c",chg:"+0.4%",up:!0},{sym:"SP-5500",price:"67c",chg:"-2.3%",up:!1},{sym:"INFLATION-4PCT",price:"21c",chg:"+1.7%",up:!0},{sym:"RECESSION-2025",price:"18c",chg:"-0.9%",up:!1},{sym:"ETH-5K",price:"45c",chg:"+2.2%",up:!0},{sym:"APPLE-3T",price:"83c",chg:"+0.6%",up:!0},{sym:"FED-HOLD-JUN",price:"62c",chg:"-1.5%",up:!1},{sym:"JOBS-200K",price:"55c",chg:"+0.8%",up:!0},{sym:"OIL-90",price:"29c",chg:"-3.1%",up:!1},{sym:"OPENAI-IPO",price:"41c",chg:"+4.4%",up:!0},{sym:"GOLD-3K",price:"71c",chg:"+1.9%",up:!0},{sym:"TESLA-SPLIT",price:"37c",chg:"-0.7%",up:!1},{sym:"CPI-3PCT",price:"48c",chg:"+2.6%",up:!0},{sym:"TRUMP-TARIFF",price:"86c",chg:"+0.3%",up:!0},{sym:"VIX-SPIKE",price:"16c",chg:"-4.2%",up:!1},{sym:"SPACEX-LAUNCH",price:"94c",chg:"+0.1%",up:!0},{sym:"SENATE-FLIP",price:"33c",chg:"+3.7%",up:!0}];function WC(){return o.jsx("span",{style:{display:"inline-block",width:3,height:3,borderRadius:"50%",background:"var(--cyan)",opacity:.4,margin:"0 14px",verticalAlign:"middle",flexShrink:0}})}function UC({sym:e,price:t,chg:r,up:n}){return o.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,whiteSpace:"nowrap",fontFamily:"var(--font-mono)",fontSize:"0.68rem"},children:[o.jsx("span",{style:{color:"var(--text-dim)",fontWeight:600,letterSpacing:"0.04em"},children:e}),o.jsx("span",{style:{color:"var(--text)",fontWeight:700},children:t}),o.jsx("span",{style:{color:n?"var(--green)":"var(--red)",fontWeight:700,fontSize:"0.62rem"},children:r})]})}function HC(){const e=P.useMemo(()=>[...x0,...x0],[]);return o.jsxs("div",{style:{width:"100%",overflow:"hidden",background:"var(--surface)",borderBottom:"1px solid var(--border)",borderTop:"1px solid var(--border)",height:32,display:"flex",alignItems:"center",position:"relative"},"aria-label":"Live market ticker",role:"marquee",children:[o.jsx("div",{style:{position:"absolute",left:0,top:0,bottom:0,width:48,background:"linear-gradient(90deg, var(--surface), transparent)",zIndex:2,pointerEvents:"none"}}),o.jsx("div",{style:{position:"absolute",right:0,top:0,bottom:0,width:48,background:"linear-gradient(270deg, var(--surface), transparent)",zIndex:2,pointerEvents:"none"}}),o.jsx("div",{style:{display:"inline-flex",alignItems:"center",animation:"ticker 60s linear infinite",willChange:"transform",paddingLeft:24},children:e.map((t,r)=>o.jsxs($.Fragment,{children:[o.jsx(UC,{...t}),o.jsx(WC,{})]},r))})]})}const KC=[{to:"/",label:"Dashboard",d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"},{to:"/markets",label:"Markets",d:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"},{to:"/signals",label:"Signals",d:"M13 10V3L4 14h7v7l9-11h-7z"},{to:"/intelligence",label:"Intel Feed",d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z"},{to:"/trading",label:"Trading",d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},{to:"/positions",label:"Positions",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"},{to:"/orders",label:"Orders",d:"M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"},{to:"/heatmap",label:"Heatmap",d:"M4 5a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H5a1 1 0 01-1-1V5zm10 0a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1V5zM4 15a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H5a1 1 0 01-1-1v-4zm10 0a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z"},{to:"/orbit",label:"Orbit",d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"},{to:"/pulse",label:"Pulse",d:"M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},{to:"/weather",label:"Weather",d:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"},{to:"/risk",label:"Portfauxlios",d:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"},{to:"/settings",label:"Settings",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z"}];function VC({active:e,warn:t}){const r=t?"var(--orange)":e?"var(--green)":"var(--red)";return o.jsx("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:r,flexShrink:0,boxShadow:`0 0 4px ${r}`}})}function GC(){const e=hl(),t=gd(),[r,n]=P.useState(null),[a,i]=P.useState(!1),[s,l]=P.useState(!1);if(P.useEffect(()=>{zv().then(u=>{if(!u){t("/login");return}l(!0);const f=()=>Oe("/health").then(n).catch(()=>{});f();const d=setInterval(f,15e3);return()=>clearInterval(d)})},[]),!s)return o.jsx("div",{className:"flex items-center justify-center min-h-screen",style:{background:"var(--bg)"},children:o.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})});const c=a?64:220;return o.jsxs("div",{className:"flex min-h-screen",style:{background:"var(--bg)"},children:[o.jsx("div",{className:"scan-overlay","aria-hidden":"true"}),o.jsxs("aside",{className:"sidebar-mesh",style:{width:c,minWidth:c,borderRight:"1px solid var(--border)",display:"flex",flexDirection:"column",transition:"width 200ms ease, min-width 200ms ease",overflow:"hidden",position:"sticky",top:0,height:"100vh"},children:[o.jsxs("div",{style:{padding:a?"16px 12px":"16px 18px",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",gap:12,minHeight:64,flexShrink:0},children:[o.jsx("div",{className:"logo-animated",style:{width:34,height:34,borderRadius:8,background:"linear-gradient(135deg, var(--orange), #E5690D)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,boxShadow:"0 2px 10px rgba(247,147,26,0.3)"},children:o.jsx("span",{style:{color:"#0E0E10",fontWeight:900,fontSize:16,fontFamily:"var(--font-heading)"},children:"K"})}),!a&&o.jsx("span",{className:"kalshi-gradient heading",style:{fontSize:13,fontWeight:700,letterSpacing:"0.06em",whiteSpace:"nowrap",filter:"drop-shadow(0 0 8px rgba(0,240,255,0.3))"},children:"KEN TRADER"})]}),o.jsx("nav",{style:{flex:1,padding:"10px 8px",overflowY:"auto",overflowX:"hidden"},children:KC.map((u,f)=>{const d=e.pathname===u.to||u.to!=="/"&&e.pathname.startsWith(u.to),h=u.to==="/settings";return o.jsxs($.Fragment,{children:[h&&o.jsx("div",{style:{margin:"8px 4px",height:1,background:"linear-gradient(90deg, transparent, var(--border), transparent)"}}),o.jsxs(wc,{to:u.to,title:a?u.label:void 0,style:{display:"flex",alignItems:"center",gap:a?0:10,padding:a?"9px 0":"9px 10px",justifyContent:a?"center":"flex-start",borderRadius:8,marginBottom:2,textDecoration:"none",fontSize:13,fontWeight:d?600:400,color:d?"var(--cyan)":"var(--text-dim)",background:d?"rgba(0,240,255,0.08)":"transparent",borderLeft:d?"3px solid var(--cyan)":"3px solid transparent",boxShadow:d?"inset 0 0 16px rgba(0,240,255,0.06), inset 3px 0 8px rgba(0,240,255,0.1)":void 0,textShadow:d?"0 0 8px rgba(0,240,255,0.4)":void 0,transition:"all 150ms ease",whiteSpace:"nowrap",overflow:"hidden"},onMouseEnter:p=>{d||(p.currentTarget.style.color="var(--text)",p.currentTarget.style.background="rgba(0,240,255,0.04)",p.currentTarget.style.borderLeftColor="rgba(0,240,255,0.3)")},onMouseLeave:p=>{d||(p.currentTarget.style.color="var(--text-dim)",p.currentTarget.style.background="transparent",p.currentTarget.style.borderLeftColor="transparent")},children:[o.jsx("svg",{style:{width:17,height:17,flexShrink:0,opacity:d?1:.7},fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:u.d})}),!a&&o.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis"},children:u.label})]})]},u.to)})}),o.jsxs("div",{style:{borderTop:"1px solid var(--border)",padding:a?"12px 8px":"12px 14px",flexShrink:0},children:[!a&&r&&o.jsx("div",{style:{marginBottom:10,display:"flex",flexDirection:"column",gap:6},children:[{label:"Env",value:(r.env||"demo").toUpperCase(),warn:r.env==="demo",active:r.env==="prod"},{label:"API",value:r.kalshi_connected?"CONNECTED":"OFF",active:r.kalshi_connected},{label:"DB",value:r.db_connected?"OK":"DOWN",active:r.db_connected},{label:"Safe Mode",value:r.safe_mode?"ON":"OFF",warn:r.safe_mode,active:!r.safe_mode}].map(u=>o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o.jsx("span",{style:{fontSize:10,color:"var(--text-muted)",fontFamily:"var(--font-body)"},children:u.label}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5},children:[o.jsx(VC,{active:u.active,warn:u.warn}),o.jsx("span",{style:{fontSize:10,fontFamily:"var(--font-mono)",fontWeight:600,color:u.warn?"var(--orange)":u.active?"var(--green)":"var(--red)"},children:u.value})]})]},u.label))}),o.jsxs("div",{style:{display:"flex",gap:6,alignItems:"center"},children:[o.jsx("button",{onClick:()=>i(!a),title:a?"Expand sidebar":"Collapse sidebar",style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",padding:"7px 0",background:"transparent",border:"1px solid var(--border)",borderRadius:7,cursor:"pointer",color:"var(--text-muted)",transition:"all 150ms ease"},onMouseEnter:u=>{u.currentTarget.style.borderColor="var(--cyan)",u.currentTarget.style.color="var(--cyan)"},onMouseLeave:u=>{u.currentTarget.style.borderColor="var(--border)",u.currentTarget.style.color="var(--text-muted)"},children:o.jsx("svg",{style:{width:14,height:14,transition:"transform 200ms ease",transform:a?"rotate(180deg)":"none"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M11 19l-7-7 7-7m8 14l-7-7 7-7"})})}),!a&&o.jsx("button",{onClick:RC,style:{padding:"7px 10px",background:"transparent",border:"1px solid var(--border)",borderRadius:7,cursor:"pointer",color:"var(--text-muted)",fontSize:11,fontFamily:"var(--font-body)",fontWeight:500,transition:"all 150ms ease",whiteSpace:"nowrap"},onMouseEnter:u=>{u.currentTarget.style.borderColor="var(--red)",u.currentTarget.style.color="var(--red)"},onMouseLeave:u=>{u.currentTarget.style.borderColor="var(--border)",u.currentTarget.style.color="var(--text-muted)"},children:"Logout"})]})]})]}),o.jsxs("main",{style:{flex:1,overflowY:"auto",overflowX:"hidden",display:"flex",flexDirection:"column"},children:[o.jsx(HC,{}),o.jsxs("div",{className:"market-status-bar",children:[o.jsx("span",{style:{color:"var(--cyan)",fontWeight:700,letterSpacing:"0.06em"},children:"KEN TRADER"}),o.jsx("span",{style:{color:"var(--border-light)"},children:"|"}),o.jsxs("span",{children:["KALSHI"," ",o.jsx("span",{style:{color:r!=null&&r.kalshi_connected?"var(--green)":"var(--red)",fontWeight:700},children:r!=null&&r.kalshi_connected?"LIVE":"OFFLINE"})]}),o.jsx("span",{style:{color:"var(--border-light)"},children:"|"}),o.jsxs("span",{children:["DB"," ",o.jsx("span",{style:{color:r!=null&&r.db_connected?"var(--green)":"var(--red)",fontWeight:700},children:r!=null&&r.db_connected?"OK":"DOWN"})]}),o.jsx("span",{style:{color:"var(--border-light)"},children:"|"}),o.jsxs("span",{children:["ENV"," ",o.jsx("span",{style:{color:(r==null?void 0:r.env)==="prod"?"var(--green)":"var(--orange)",fontWeight:700},children:((r==null?void 0:r.env)||"DEMO").toUpperCase()})]}),(r==null?void 0:r.safe_mode)&&o.jsxs(o.Fragment,{children:[o.jsx("span",{style:{color:"var(--border-light)"},children:"|"}),o.jsx("span",{style:{color:"var(--orange)",fontWeight:700},children:"SAFE MODE ON"})]}),o.jsxs("span",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:12},children:[o.jsxs("span",{style:{color:"var(--border-light)"},children:[new Date().toLocaleTimeString("en-US",{timeZone:"America/Los_Angeles",hour:"2-digit",minute:"2-digit",second:"2-digit"})," PT"]}),o.jsxs("button",{className:"notification-bell","aria-label":"Alerts (7 unread)",title:"7 unread alerts",style:{background:"none",border:"none",display:"flex",alignItems:"center"},children:[o.jsx("svg",{fill:"none",stroke:"currentColor",strokeWidth:"1.8",viewBox:"0 0 24 24","aria-hidden":"true",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})}),o.jsx("span",{className:"notification-count","aria-label":"7 alerts",children:"7"})]})]})]}),o.jsx("div",{style:{maxWidth:1600,margin:"0 auto",padding:"24px 28px",flex:1,width:"100%"},children:o.jsx(jC,{})})]})]})}const YC=[{title:"Event Contracts",desc:"Betting on weather like a person who never learned to just look outside. CFTC-regulated, at least.",icon:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"},{title:"Weather Intelligence",desc:"We schlepp forecast data from the government so you don't have to read the almanac yourself.",icon:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"},{title:"Automated Execution",desc:"The machine places your bets so your hands stay clean. Safe mode included, because I worry.",icon:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"}],qC=["Hook up to Ken (demo first, like a sensible person)","Snoop around the weather contracts","Schlep in the NWS settlement data","Let the computer do the math you were too lazy to learn","Set some limits so you don't lose your shirt","Place the bets (on paper first, God willing)"];function XC({next:e}){return o.jsxs("div",{className:"space-y-8",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("h1",{className:"text-4xl font-bold kalshi-gradient mb-3",children:"Oy, Look Who Finally Showed Up"}),o.jsx("p",{className:"text-gray-400 text-lg",children:"So you want to bet on the weather? Your mother would be so proud."})]}),o.jsx("div",{className:"grid grid-cols-3 gap-4",children:YC.map(t=>o.jsxs("div",{className:"card text-center",children:[o.jsx("div",{className:"w-10 h-10 rounded-lg bg-amber-500/10 flex items-center justify-center mx-auto mb-3",children:o.jsx("svg",{className:"w-5 h-5 text-amber-400",fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:t.icon})})}),o.jsx("h3",{className:"font-semibold text-sm mb-1",children:t.title}),o.jsx("p",{className:"text-xs text-gray-500 leading-relaxed",children:t.desc})]},t.title))}),o.jsxs("div",{className:"card",children:[o.jsx("h3",{className:"font-semibold text-sm mb-3",children:"Listen, this is how it works"}),o.jsx("div",{className:"grid grid-cols-2 gap-2",children:qC.map((t,r)=>o.jsxs("div",{className:"flex items-center gap-3 py-1.5",children:[o.jsx("span",{className:"w-6 h-6 rounded-full bg-amber-500/15 text-amber-400 flex items-center justify-center text-xs font-bold flex-shrink-0",children:r+1}),o.jsx("span",{className:"text-sm text-gray-300",children:t})]},r))})]}),o.jsx("div",{className:"card bg-green-500/5 border-green-500/20",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("svg",{className:"w-5 h-5 text-green-400 mt-0.5 flex-shrink-0",fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-green-400",children:"At least it's legal, thank God"}),o.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Ken is a real CFTC-regulated exchange, not some offshore mishegoss. You'll need an account with API access. Go make one already, I'll wait."})]})]})}),o.jsx("div",{className:"flex justify-center",children:o.jsx("button",{onClick:e,className:"btn btn-p px-8 py-3 text-base font-bold rounded-xl",children:"Nu, Let's Go Already"})})]})}function QC({data:e,update:t,next:r,back:n}){var b,v,m;const[a,i]=P.useState(((b=e.keys)==null?void 0:b.api_key)||""),[s,l]=P.useState(((v=e.keys)==null?void 0:v.private_key)||""),[c,u]=P.useState(((m=e.keys)==null?void 0:m.env)||"demo"),[f,d]=P.useState(!1),[h,p]=P.useState(null);async function g(){d(!0),p(null);try{const x=await me("/kalshi",{action:"save_keys",api_key:a,private_key:s,env:c});x.success?(t({keys:{api_key:a,private_key:"***",env:c}}),r()):p(x.error||"Failed to save")}catch{p("Connection error")}d(!1)}function y(){t({keys:null,skippedConnect:!0}),r()}return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Give Me the Keys"}),o.jsx("p",{className:"text-gray-400 text-sm",children:"Your API credentials, darling. I don't have all day."})]}),o.jsxs("div",{className:"card space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-xs text-gray-400 mb-1.5 font-medium",children:"Which playground are we using?"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("button",{onClick:()=>u("demo"),className:`flex-1 py-2 rounded-lg text-sm font-medium transition ${c==="demo"?"bg-yellow-500/15 text-yellow-400 border border-yellow-500/30":"bg-gray-800/50 text-gray-500 border border-gray-700"}`,children:"Demo (Smart)"}),o.jsx("button",{onClick:()=>u("prod"),className:`flex-1 py-2 rounded-lg text-sm font-medium transition ${c==="prod"?"bg-green-500/15 text-green-400 border border-green-500/30":"bg-gray-800/50 text-gray-500 border border-gray-700"}`,children:"Production (Brave)"})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-xs text-gray-400 mb-1.5 font-medium",children:"API Key ID (the one they gave you)"}),o.jsx("input",{type:"text",value:a,onChange:x=>i(x.target.value),placeholder:"Paste it here, bubeleh",className:"w-full px-3 py-2 bg-gray-800/50 border border-gray-700 rounded-lg text-sm focus:border-amber-500 focus:outline-none font-mono"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-xs text-gray-400 mb-1.5 font-medium",children:"Private Key (the whole megillah, PEM format)"}),o.jsx("textarea",{value:s,onChange:x=>l(x.target.value),placeholder:`-----BEGIN RSA PRIVATE KEY-----
-...
------END RSA PRIVATE KEY-----`,rows:6,className:"w-full px-3 py-2 bg-gray-800/50 border border-gray-700 rounded-lg text-sm focus:border-amber-500 focus:outline-none font-mono text-xs leading-relaxed"}),o.jsx("p",{className:"text-[10px] text-gray-600 mt-1",children:"Don't worry, I keep it locked up tighter than your grandmother's jewelry box"})]}),h&&o.jsx("p",{className:"text-red-400 text-xs",children:h})]}),o.jsxs("div",{className:"card bg-gray-800/30",children:[o.jsx("h3",{className:"text-sm font-medium mb-2",children:"What, you don't have keys yet? Oy vey."}),o.jsxs("ol",{className:"text-xs text-gray-400 space-y-1.5 list-decimal list-inside",children:[o.jsxs("li",{children:["Go log into ",o.jsx("span",{className:"text-amber-400 font-mono",children:"ken.com"})," like a mensch"]}),o.jsx("li",{children:"Find Settings → API Keys (it's not that hard, look around)"}),o.jsxs("li",{children:['Click "Create API Key" and ',o.jsx("strong",{children:"download that private key file immediately"})]}),o.jsx("li",{children:"Copy the Key ID and paste the PEM contents up there. Simple."})]}),o.jsx("p",{className:"text-[10px] text-red-400 mt-2",children:"Listen to me — that private key file? You can only download it ONCE. Lose it and you start over. Don't say I didn't warn you."})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("button",{onClick:n,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("button",{onClick:y,className:"text-sm text-gray-500 hover:text-gray-300",children:"Skip (play pretend)"}),o.jsx("button",{onClick:g,disabled:f||!a||!s,className:"btn btn-p",children:f?"Saving, patience...":"Save & Continue"})]})]})]})}function JC({data:e,update:t,next:r,back:n}){const[a,i]=P.useState(null),[s,l]=P.useState(null),[c,u]=P.useState(!0),[f,d]=P.useState(!1);P.useEffect(()=>{h()},[]);async function h(){u(!0);try{const b=await me("/kalshi",{action:"test_connection"});i(b),b.success&&e.keys&&!e.skippedConnect&&p()}catch{i({error:!0})}u(!1)}async function p(){d(!0);try{const b=await me("/kalshi",{action:"get_balance"});l(b),b.success&&t({connectionOk:!0})}catch{l({error:!0})}d(!1)}const g=e.skippedConnect,y=({title:b,loading:v,result:m,skippedMsg:x})=>o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[x?o.jsx("div",{className:"w-5 h-5 rounded-full bg-yellow-500 flex items-center justify-center",children:o.jsx("span",{className:"text-white text-xs font-bold",children:"—"})}):v?o.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-amber-500 border-t-transparent rounded-full"}):m!=null&&m.success?o.jsx("div",{className:"w-5 h-5 rounded-full bg-green-500 flex items-center justify-center",children:o.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",strokeWidth:"3",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}):m!=null&&m.error?o.jsx("div",{className:"w-5 h-5 rounded-full bg-red-500 flex items-center justify-center",children:o.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",strokeWidth:"3",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}):o.jsx("div",{className:"w-5 h-5 rounded-full bg-gray-600"}),o.jsx("h3",{className:"font-semibold text-sm",children:b})]}),x?o.jsx("p",{className:"text-xs text-yellow-400",children:x}):m!=null&&m.success?o.jsxs("div",{className:"space-y-1 text-xs text-gray-400",children:[m.exchange_status&&o.jsxs("p",{children:["Exchange: ",o.jsx("span",{className:"text-green-400 font-mono",children:m.exchange_status})]}),m.balance!==void 0&&o.jsxs("p",{children:["Balance: ",o.jsxs("span",{className:"text-green-400 font-mono",children:["$",(m.balance/100).toFixed(2)]})]}),m.env&&o.jsxs("p",{children:["Env: ",o.jsx("span",{className:"text-amber-400 font-mono",children:m.env.toUpperCase()})]})]}):m!=null&&m.error?o.jsx("p",{className:"text-xs text-red-400",children:typeof m.error=="string"?m.error:"Connection failed"}):null]});return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Let's See If This Thing Works"}),o.jsx("p",{className:"text-gray-400 text-sm",children:"I'm checking your wiring. Hold your horses."})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsx(y,{title:"Is Ken Even Open?",loading:c,result:a}),o.jsx(y,{title:"Do They Know Who You Are?",loading:f,result:s,skippedMsg:g?"You skipped this — playing pretend, remember?":e.keys?null:"No keys, no entry. What did you expect?"})]}),!c&&!f&&o.jsx("div",{className:"flex justify-center",children:o.jsx("button",{onClick:h,className:"text-xs text-gray-500 hover:text-gray-300",children:"Try again, maybe this time it'll listen"})}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("button",{onClick:n,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),o.jsx("button",{onClick:r,className:"btn btn-p",children:"Continue"})]})]})}function ZC({data:e,update:t,next:r,back:n}){var h,p;const[a,i]=P.useState(!0),[s,l]=P.useState(null),[c,u]=P.useState(null);P.useEffect(()=>{f()},[]);async function f(){var g;i(!0),u(null);try{const y=await me("/kalshi",{action:"get_events",params:{status:"open",limit:50}});l(y);const b=((g=y.events)==null?void 0:g.length)||0;t({marketsLoaded:b})}catch{u("Failed to load markets")}i(!1)}const d=((s==null?void 0:s.events)||[]).filter(g=>(g.category||"").toLowerCase().includes("climate")||(g.category||"").toLowerCase().includes("weather")||(g.title||"").toLowerCase().includes("temperature")||(g.title||"").toLowerCase().includes("rain")||(g.title||"").toLowerCase().includes("snow")||(g.title||"").toLowerCase().includes("precipitation"));return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Let's See What They're Selling"}),o.jsx("p",{className:"text-gray-400 text-sm",children:"I'm snooping through the markets. You're welcome."})]}),o.jsx("div",{className:"card",children:a?o.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-4",children:[o.jsx("div",{className:"animate-spin w-10 h-10 border-3 border-amber-500 border-t-transparent rounded-full"}),o.jsx("p",{className:"text-sm text-gray-400",children:"Schlepping markets from Ken... patience is a virtue"})]}):c?o.jsxs("div",{className:"text-center py-8",children:[o.jsx("p",{className:"text-red-400 text-sm mb-3",children:c}),o.jsx("button",{onClick:f,className:"btn btn-s text-sm",children:"Retry"})]}):o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("p",{className:"stat-v text-amber-400",children:((h=s==null?void 0:s.events)==null?void 0:h.length)||0}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Things to Bet On"})]}),o.jsxs("div",{className:"text-center",children:[o.jsx("p",{className:"stat-v text-blue-400",children:d.length}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Weather Bets (Our Thing)"})]}),o.jsxs("div",{className:"text-center",children:[o.jsx("p",{className:"stat-v text-green-400",children:((p=s==null?void 0:s.markets)==null?void 0:p.length)||"—"}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Individual Contracts"})]})]}),d.length>0&&o.jsxs("div",{className:"border-t border-gray-800 pt-3",children:[o.jsx("p",{className:"text-xs text-gray-500 mb-2 uppercase font-medium",children:"Weather Bets I Found For You"}),o.jsx("div",{className:"space-y-1.5 max-h-48 overflow-y-auto",children:d.slice(0,12).map((g,y)=>o.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-500 flex-shrink-0"}),o.jsx("span",{className:"text-gray-300 truncate",children:g.title}),o.jsx("span",{className:"text-gray-600 ml-auto font-mono text-[10px]",children:g.event_ticker})]},y))})]}),d.length===0&&o.jsx("p",{className:"text-center text-gray-500 text-sm py-4",children:"No weather bets right now. What, the weather took a day off? Other markets are there at least."})]})}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("button",{onClick:n,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),o.jsx("button",{onClick:r,disabled:a,className:"btn btn-p",children:a?"Loading...":"Continue"})]})]})}function eE({data:e,update:t,next:r,back:n}){var d;const[a,i]=P.useState(!0),[s,l]=P.useState(null),[c,u]=P.useState(null);P.useEffect(()=>{f()},[]);async function f(){i(!0),u(null);try{const h=await me("/weather",{action:"fetch_all"});l(h),t({weatherFetched:!0})}catch{u("Failed to fetch weather data")}i(!1)}return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Checking the Weather, Darling"}),o.jsx("p",{className:"text-gray-400 text-sm",children:"I'm schlepping in the government weather reports. In my day we just looked outside."})]}),o.jsx("div",{className:"card",children:a?o.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-4",children:[o.jsx("div",{className:"animate-spin w-10 h-10 border-3 border-blue-500 border-t-transparent rounded-full"}),o.jsx("p",{className:"text-sm text-gray-400",children:"Fetching from the National Weather Service... they take their sweet time"})]}):c?o.jsxs("div",{className:"text-center py-8",children:[o.jsx("p",{className:"text-red-400 text-sm mb-3",children:c}),o.jsx("button",{onClick:f,className:"btn btn-s text-sm",children:"Retry"})]}):o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-center gap-3 py-4",children:[o.jsx("div",{className:"w-12 h-12 rounded-full bg-green-500/10 flex items-center justify-center",children:o.jsx("svg",{className:"w-6 h-6 text-green-400",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),o.jsxs("div",{children:[o.jsx("p",{className:"font-semibold text-green-400",children:"Got the Weather, Finally"}),o.jsx("p",{className:"text-xs text-gray-400",children:"All the fancy government data, right here in your tuchas seat"})]})]}),o.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[o.jsxs("div",{className:"text-center p-3 bg-gray-800/30 rounded-lg",children:[o.jsx("p",{className:"stat-v text-blue-400",children:(s==null?void 0:s.stations)||"—"}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Stations"})]}),o.jsxs("div",{className:"text-center p-3 bg-gray-800/30 rounded-lg",children:[o.jsx("p",{className:"stat-v text-amber-400",children:(s==null?void 0:s.data_points)||"—"}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Data Points"})]}),o.jsxs("div",{className:"text-center p-3 bg-gray-800/30 rounded-lg",children:[o.jsx("p",{className:"stat-v text-green-400",children:((d=s==null?void 0:s.metrics)==null?void 0:d.length)||"—"}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Metrics"})]})]})]})}),o.jsxs("div",{className:"card bg-gray-800/30",children:[o.jsx("p",{className:"text-xs text-gray-500 mb-1 font-medium",children:"How They Settle (Pay Attention)"}),o.jsxs("p",{className:"text-xs text-gray-400",children:["Ken settles on the ",o.jsx("span",{className:"text-amber-400",children:"final NWS Daily Climate Report"}),". A trace of rain? That's zero. Missing data? Also zero. And listen — the first report is the last word. They don't go back and change it, even if the weatherman was wrong. Such is life."]})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("button",{onClick:n,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),o.jsx("button",{onClick:r,disabled:a,className:"btn btn-p",children:a?"Fetching...":"Continue"})]})]})}function tE({data:e,update:t,next:r,back:n}){const[a,i]=P.useState(!0),[s,l]=P.useState(null),[c,u]=P.useState(null);P.useEffect(()=>{f()},[]);async function f(){i(!0),u(null);try{const p=await me("/kalshi",{action:"run_predictions"});l(p),t({predictionsRun:!0})}catch{u("Failed to generate predictions")}i(!1)}const d=(s==null?void 0:s.predictions)||[],h=d.filter(p=>(p.edge_bps||0)>0);return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("h2",{className:"text-2xl font-bold mb-2",children:"The Machine Is Thinking"}),o.jsx("p",{className:"text-gray-400 text-sm",children:"Running the numbers so you don't have to use that head of yours"})]}),o.jsx("div",{className:"card",children:a?o.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-4",children:[o.jsx("div",{className:"animate-spin w-10 h-10 border-3 border-green-500 border-t-transparent rounded-full"}),o.jsx("p",{className:"text-sm text-gray-400",children:"Crunching numbers... in my day we did this with an abacus"})]}):c?o.jsxs("div",{className:"text-center py-8",children:[o.jsx("p",{className:"text-red-400 text-sm mb-3",children:c}),o.jsx("button",{onClick:f,className:"btn btn-s text-sm",children:"Retry"})]}):o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("p",{className:"stat-v text-amber-400",children:d.length}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Opinions"})]}),o.jsxs("div",{className:"text-center",children:[o.jsx("p",{className:"stat-v text-green-400",children:h.length}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Worth a Look"})]}),o.jsxs("div",{className:"text-center",children:[o.jsxs("p",{className:"stat-v text-blue-400",children:[(s==null?void 0:s.avg_edge_bps)||0,"bps"]}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Your Edge (God Willing)"})]})]}),d.length>0&&o.jsx("div",{className:"border-t border-gray-800 pt-3",children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Contract"}),o.jsx("th",{children:"Side"}),o.jsx("th",{children:"Price"}),o.jsx("th",{children:"Edge"}),o.jsx("th",{children:"Signal"})]})}),o.jsx("tbody",{children:d.slice(0,6).map((p,g)=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-[180px]",children:o.jsx("span",{className:"truncate block text-xs",children:p.ticker||p.market})}),o.jsx("td",{children:o.jsx("span",{className:`badge ${p.side==="yes"?"bg-green":"bg-red"}`,children:(p.side||"yes").toUpperCase()})}),o.jsxs("td",{className:"font-mono text-sm",children:[p.price_cents||"—","c"]}),o.jsxs("td",{className:`font-mono text-sm ${(p.edge_bps||0)>0?"text-green-400":"text-gray-500"}`,children:[p.edge_bps||0,"bps"]}),o.jsx("td",{children:o.jsx("span",{className:`badge ${(p.edge_bps||0)>0?"bg-green":"bg-yellow"}`,children:(p.edge_bps||0)>0?"BUY":"HOLD"})})]},g))})]})})]})}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("button",{onClick:n,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),o.jsx("button",{onClick:r,disabled:a,className:"btn btn-p",children:a?"Processing...":"Continue"})]})]})}const b0=[{name:"Conservative",maxContracts:5,maxDollars:25,dailyLoss:10,color:"blue",desc:"Like your bubbe taught you — small bets, tight grip on the purse strings."},{name:"Moderate",maxContracts:20,maxDollars:100,dailyLoss:50,color:"amber",desc:"Not too much, not too little. Like Goldilocks, but with money.",recommended:!0},{name:"Aggressive",maxContracts:50,maxDollars:500,dailyLoss:200,color:"red",desc:"What are you, a big shot? Don't come crying to me when it goes sideways."}];function rE({data:e,update:t,next:r,back:n}){const[a,i]=P.useState(e.riskProfile||"Moderate"),[s,l]=P.useState(!1);async function c(){l(!0);const u=b0.find(f=>f.name===a);try{await me("/risk",{action:"update_config",max_contracts_per_market:u.maxContracts,max_dollars_at_risk:u.maxDollars,daily_loss_cap:u.dailyLoss,risk_profile:u.name}),t({riskProfile:a}),r()}catch{}l(!1)}return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("h2",{className:"text-2xl font-bold mb-2",children:"How Much Are You Willing to Lose?"}),o.jsx("p",{className:"text-gray-400 text-sm",children:'Pick one. And no, "all of it" is not an option.'})]}),o.jsx("div",{className:"grid grid-cols-3 gap-4",children:b0.map(u=>{const d={blue:{ring:"#3b82f6",text:"text-blue-400"},amber:{ring:"#f59e0b",text:"text-amber-400"},red:{ring:"#ef4444",text:"text-red-400"}}[u.color];return o.jsxs("button",{onClick:()=>i(u.name),className:"card text-left transition-all relative",style:a===u.name?{boxShadow:`0 0 0 2px ${d.ring}`}:{},children:[u.recommended&&o.jsx("span",{className:"absolute -top-2 right-3 text-[9px] font-bold uppercase px-2 py-0.5 rounded-full bg-amber-500 text-black",children:"Recommended"}),o.jsx("h3",{className:`font-bold text-lg mb-1 ${d.text}`,children:u.name}),o.jsx("p",{className:"text-xs text-gray-500 mb-3",children:u.desc}),o.jsxs("div",{className:"space-y-1.5 text-xs",children:[o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{className:"text-gray-500",children:"Max Contracts"}),o.jsx("span",{className:"font-mono text-gray-300",children:u.maxContracts})]}),o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{className:"text-gray-500",children:"Max $ at Risk"}),o.jsxs("span",{className:"font-mono text-gray-300",children:["$",u.maxDollars]})]}),o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{className:"text-gray-500",children:"Daily Loss Cap"}),o.jsxs("span",{className:"font-mono text-gray-300",children:["$",u.dailyLoss]})]})]})]},u.name)})}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("button",{onClick:n,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),o.jsx("button",{onClick:c,disabled:s,className:"btn btn-p",children:s?"Saving...":"Save & Continue"})]})]})}const Bf=[{key:"keys",label:"Gave me the API keys (good)",check:e=>!!e.keys},{key:"conn",label:"Connection actually works (miracle)",check:e=>!!e.connectionOk},{key:"markets",label:"Found some markets to bet on",check:e=>e.marketsLoaded>0},{key:"weather",label:"Got the weather data (finally)",check:e=>!!e.weatherFetched},{key:"preds",label:"The machine made its predictions",check:e=>!!e.predictionsRun},{key:"risk",label:"Set some limits (smart)",check:e=>!!e.riskProfile}];function nE({data:e,complete:t,back:r}){const[n,a]=P.useState(!0),[i,s]=P.useState(!1),l=Bf.filter(f=>f.check(e)).length,c=e.skippedConnect;async function u(){s(!0),await t()}return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Alright, Mazel Tov"}),o.jsx("p",{className:"text-gray-400 text-sm",children:"Let's see if you actually did everything right. I have my doubts."})]}),o.jsxs("div",{className:"card",children:[o.jsx("h3",{className:"font-semibold text-sm mb-3",children:"Your Report Card"}),o.jsx("div",{className:"space-y-2",children:Bf.map(f=>{const d=f.check(e),h=f.key==="keys"&&c;return o.jsxs("div",{className:"flex items-center gap-3",children:[d?o.jsx("div",{className:"w-5 h-5 rounded-full bg-green-500 flex items-center justify-center flex-shrink-0",children:o.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",strokeWidth:"3",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}):h?o.jsx("div",{className:"w-5 h-5 rounded-full bg-yellow-500 flex items-center justify-center flex-shrink-0",children:o.jsx("span",{className:"text-white text-[10px] font-bold",children:"—"})}):o.jsx("div",{className:"w-5 h-5 rounded-full bg-gray-700 flex-shrink-0"}),o.jsxs("span",{className:`text-sm ${d?"text-gray-200":h?"text-yellow-400":"text-gray-500"}`,children:[f.label,h?" (skipped)":""]})]},f.key)})}),o.jsxs("p",{className:"text-xs text-gray-500 mt-3 pt-3 border-t border-gray-800",children:[l,"/",Bf.length," steps completed"]})]}),o.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[o.jsxs("div",{className:"card text-center",children:[o.jsx("p",{className:"stat-v text-amber-400",children:e.marketsLoaded||0}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Markets"})]}),o.jsxs("div",{className:"card text-center",children:[o.jsx("p",{className:"stat-v text-blue-400",children:e.riskProfile||"—"}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Risk Profile"})]}),o.jsxs("div",{className:"card text-center",children:[o.jsx("p",{className:"stat-v text-green-400",children:e.keys?(e.keys.env||"demo").toUpperCase():"PAPER"}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Mode"})]})]}),o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"font-semibold text-sm",children:"Safe Mode (I Recommend It)"}),o.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:n?"Paper trading — playing pretend, like a sensible person":"Live orders! With real money! Oy gevalt."})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:`text-xs font-medium ${n?"text-yellow-400":"text-gray-500"}`,children:"Safe"}),o.jsx("button",{onClick:()=>a(!n),disabled:!e.keys,className:`w-11 h-6 rounded-full transition-colors relative ${n?"bg-yellow-500/30":"bg-green-500/30"} ${e.keys?"":"opacity-50 cursor-not-allowed"}`,children:o.jsx("div",{className:`w-4 h-4 rounded-full absolute top-1 transition-all ${n?"left-1 bg-yellow-400":"left-6 bg-green-400"}`})}),o.jsx("span",{className:`text-xs font-medium ${n?"text-gray-500":"text-green-400"}`,children:"Live"})]})]}),!n&&o.jsx("div",{className:"mt-3 p-2 bg-red-500/10 border border-red-500/20 rounded-lg",children:o.jsx("p",{className:"text-xs text-red-400",children:"Live mode means real money, bubeleh. Real. Money. Don't say I didn't warn you. Make sure you've got funds and your limits are set, or so help me."})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("button",{onClick:r,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),o.jsx("button",{onClick:u,disabled:i,className:"btn btn-p text-lg px-8 py-3 rounded-xl font-bold",children:i?"Starting up, hold your horses...":"Go Make Some Gelt Already"})]})]})}const Ul=[{label:"Shalom",icon:"1"},{label:"Keys",icon:"2"},{label:"Test It",icon:"3"},{label:"Snoop",icon:"4"},{label:"Weather",icon:"5"},{label:"Predict",icon:"6"},{label:"Limits",icon:"7"},{label:"Mazel Tov",icon:"8"}],aE=[XC,QC,JC,ZC,eE,tE,rE,nE];function iE(){const e=gd(),[t,r]=P.useState(!1),[n,a]=P.useState(0),[i,s]=P.useState({keys:null,connectionOk:!1,marketsLoaded:0,weatherFetched:!1,predictionsRun:!1,riskProfile:null});P.useEffect(()=>{zv().then(p=>{if(!p){e("/login");return}r(!0),Oe("/setup").then(g=>{if(g.setup_complete){e("/");return}g.setup_progress&&(a(g.setup_progress.step||0),s(y=>({...y,...g.setup_progress.data})))}).catch(()=>{})})},[]),P.useEffect(()=>{t&&n>0&&me("/setup",{action:"save_progress",progress:{step:n,data:i}}).catch(()=>{})},[n]);function l(){n<Ul.length-1&&a(p=>p+1)}function c(){n>0&&a(p=>p-1)}function u(p){p<=n&&a(p)}function f(p){s(g=>({...g,...p}))}async function d(){await me("/setup",{action:"complete",progress:{step:Ul.length-1,data:i}}),e("/")}if(!t)return o.jsx("div",{className:"flex items-center justify-center min-h-screen",children:o.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full"})});const h=aE[n];return o.jsxs("div",{className:"min-h-screen flex flex-col",style:{background:"var(--bg)"},children:[o.jsxs("div",{className:"flex items-center gap-3 px-6 py-4 border-b border-gray-800",children:[o.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"linear-gradient(135deg,#f59e0b,#f97316)"},children:o.jsx("span",{className:"text-black font-bold text-sm",children:"K"})}),o.jsx("span",{className:"font-bold text-sm kalshi-gradient",children:"KEN SETUP — SIT, WE'LL TALK"})]}),o.jsx("div",{className:"px-6 py-5",children:o.jsx("div",{className:"max-w-3xl mx-auto flex items-center",children:Ul.map((p,g)=>o.jsxs($.Fragment,{children:[o.jsxs("button",{onClick:()=>u(g),disabled:g>n,className:"flex flex-col items-center gap-1.5 group",style:{minWidth:56},children:[o.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center text-xs font-bold transition-all ${g<n?"bg-green-500 text-white":g===n?"bg-amber-500 text-black":"bg-gray-800 text-gray-500"} ${g<=n?"cursor-pointer":"cursor-default"}`,style:g===n?{animation:"pg 2s infinite"}:{},children:g<n?o.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):p.icon}),o.jsx("span",{className:`text-[10px] font-medium ${g<n?"text-green-400":g===n?"text-amber-400":"text-gray-600"}`,children:p.label})]}),g<Ul.length-1&&o.jsx("div",{className:`h-0.5 flex-1 transition-colors ${g<n?"bg-green-500":"bg-gray-800"}`})]},g))})}),o.jsx("div",{className:"flex-1 flex items-start justify-center px-6 pb-10",children:o.jsx("div",{className:"w-full max-w-2xl",children:o.jsx(h,{data:i,update:f,next:l,back:c,complete:d,step:n})},n)})]})}function oS(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=oS(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function ee(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=oS(e))&&(n&&(n+=" "),n+=t);return n}var oE=Array.isArray,Et=oE,sE=typeof kl=="object"&&kl&&kl.Object===Object&&kl,sS=sE,lE=sS,cE=typeof self=="object"&&self&&self.Object===Object&&self,uE=lE||cE||Function("return this")(),Tr=uE,dE=Tr,fE=dE.Symbol,pl=fE,j0=pl,lS=Object.prototype,hE=lS.hasOwnProperty,pE=lS.toString,Oo=j0?j0.toStringTag:void 0;function mE(e){var t=hE.call(e,Oo),r=e[Oo];try{e[Oo]=void 0;var n=!0}catch{}var a=pE.call(e);return n&&(t?e[Oo]=r:delete e[Oo]),a}var vE=mE,yE=Object.prototype,gE=yE.toString;function xE(e){return gE.call(e)}var bE=xE,w0=pl,jE=vE,wE=bE,SE="[object Null]",_E="[object Undefined]",S0=w0?w0.toStringTag:void 0;function kE(e){return e==null?e===void 0?_E:SE:S0&&S0 in Object(e)?jE(e):wE(e)}var an=kE;function OE(e){return e!=null&&typeof e=="object"}var on=OE,NE=an,PE=on,AE="[object Symbol]";function CE(e){return typeof e=="symbol"||PE(e)&&NE(e)==AE}var no=CE,EE=Et,$E=no,TE=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ME=/^\w*$/;function IE(e,t){if(EE(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||$E(e)?!0:ME.test(e)||!TE.test(e)||t!=null&&e in Object(t)}var Wv=IE;function LE(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Fn=LE;const ao=de(Fn);var DE=an,RE=Fn,BE="[object AsyncFunction]",FE="[object Function]",zE="[object GeneratorFunction]",WE="[object Proxy]";function UE(e){if(!RE(e))return!1;var t=DE(e);return t==FE||t==zE||t==BE||t==WE}var Uv=UE;const Q=de(Uv);var HE=Tr,KE=HE["__core-js_shared__"],VE=KE,Ff=VE,_0=function(){var e=/[^.]+$/.exec(Ff&&Ff.keys&&Ff.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function GE(e){return!!_0&&_0 in e}var YE=GE,qE=Function.prototype,XE=qE.toString;function QE(e){if(e!=null){try{return XE.call(e)}catch{}try{return e+""}catch{}}return""}var cS=QE,JE=Uv,ZE=YE,e$=Fn,t$=cS,r$=/[\\^$.*+?()[\]{}|]/g,n$=/^\[object .+?Constructor\]$/,a$=Function.prototype,i$=Object.prototype,o$=a$.toString,s$=i$.hasOwnProperty,l$=RegExp("^"+o$.call(s$).replace(r$,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function c$(e){if(!e$(e)||ZE(e))return!1;var t=JE(e)?l$:n$;return t.test(t$(e))}var u$=c$;function d$(e,t){return e==null?void 0:e[t]}var f$=d$,h$=u$,p$=f$;function m$(e,t){var r=p$(e,t);return h$(r)?r:void 0}var Ca=m$,v$=Ca,y$=v$(Object,"create"),xd=y$,k0=xd;function g$(){this.__data__=k0?k0(null):{},this.size=0}var x$=g$;function b$(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var j$=b$,w$=xd,S$="__lodash_hash_undefined__",_$=Object.prototype,k$=_$.hasOwnProperty;function O$(e){var t=this.__data__;if(w$){var r=t[e];return r===S$?void 0:r}return k$.call(t,e)?t[e]:void 0}var N$=O$,P$=xd,A$=Object.prototype,C$=A$.hasOwnProperty;function E$(e){var t=this.__data__;return P$?t[e]!==void 0:C$.call(t,e)}var $$=E$,T$=xd,M$="__lodash_hash_undefined__";function I$(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=T$&&t===void 0?M$:t,this}var L$=I$,D$=x$,R$=j$,B$=N$,F$=$$,z$=L$;function io(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}io.prototype.clear=D$;io.prototype.delete=R$;io.prototype.get=B$;io.prototype.has=F$;io.prototype.set=z$;var W$=io;function U$(){this.__data__=[],this.size=0}var H$=U$;function K$(e,t){return e===t||e!==e&&t!==t}var Hv=K$,V$=Hv;function G$(e,t){for(var r=e.length;r--;)if(V$(e[r][0],t))return r;return-1}var bd=G$,Y$=bd,q$=Array.prototype,X$=q$.splice;function Q$(e){var t=this.__data__,r=Y$(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():X$.call(t,r,1),--this.size,!0}var J$=Q$,Z$=bd;function eT(e){var t=this.__data__,r=Z$(t,e);return r<0?void 0:t[r][1]}var tT=eT,rT=bd;function nT(e){return rT(this.__data__,e)>-1}var aT=nT,iT=bd;function oT(e,t){var r=this.__data__,n=iT(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var sT=oT,lT=H$,cT=J$,uT=tT,dT=aT,fT=sT;function oo(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}oo.prototype.clear=lT;oo.prototype.delete=cT;oo.prototype.get=uT;oo.prototype.has=dT;oo.prototype.set=fT;var jd=oo,hT=Ca,pT=Tr,mT=hT(pT,"Map"),Kv=mT,O0=W$,vT=jd,yT=Kv;function gT(){this.size=0,this.__data__={hash:new O0,map:new(yT||vT),string:new O0}}var xT=gT;function bT(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var jT=bT,wT=jT;function ST(e,t){var r=e.__data__;return wT(t)?r[typeof t=="string"?"string":"hash"]:r.map}var wd=ST,_T=wd;function kT(e){var t=_T(this,e).delete(e);return this.size-=t?1:0,t}var OT=kT,NT=wd;function PT(e){return NT(this,e).get(e)}var AT=PT,CT=wd;function ET(e){return CT(this,e).has(e)}var $T=ET,TT=wd;function MT(e,t){var r=TT(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var IT=MT,LT=xT,DT=OT,RT=AT,BT=$T,FT=IT;function so(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}so.prototype.clear=LT;so.prototype.delete=DT;so.prototype.get=RT;so.prototype.has=BT;so.prototype.set=FT;var Vv=so,uS=Vv,zT="Expected a function";function Gv(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(zT);var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var s=e.apply(this,n);return r.cache=i.set(a,s)||i,s};return r.cache=new(Gv.Cache||uS),r}Gv.Cache=uS;var dS=Gv;const WT=de(dS);var UT=dS,HT=500;function KT(e){var t=UT(e,function(n){return r.size===HT&&r.clear(),n}),r=t.cache;return t}var VT=KT,GT=VT,YT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qT=/\\(\\)?/g,XT=GT(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(YT,function(r,n,a,i){t.push(a?i.replace(qT,"$1"):n||r)}),t}),QT=XT;function JT(e,t){for(var r=-1,n=e==null?0:e.length,a=Array(n);++r<n;)a[r]=t(e[r],r,e);return a}var Yv=JT,N0=pl,ZT=Yv,e3=Et,t3=no,P0=N0?N0.prototype:void 0,A0=P0?P0.toString:void 0;function fS(e){if(typeof e=="string")return e;if(e3(e))return ZT(e,fS)+"";if(t3(e))return A0?A0.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var r3=fS,n3=r3;function a3(e){return e==null?"":n3(e)}var hS=a3,i3=Et,o3=Wv,s3=QT,l3=hS;function c3(e,t){return i3(e)?e:o3(e,t)?[e]:s3(l3(e))}var pS=c3,u3=no;function d3(e){if(typeof e=="string"||u3(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var Sd=d3,f3=pS,h3=Sd;function p3(e,t){t=f3(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[h3(t[r++])];return r&&r==n?e:void 0}var qv=p3,m3=qv;function v3(e,t,r){var n=e==null?void 0:m3(e,t);return n===void 0?r:n}var mS=v3;const Rt=de(mS);function y3(e){return e==null}var g3=y3;const te=de(g3);var x3=an,b3=Et,j3=on,w3="[object String]";function S3(e){return typeof e=="string"||!b3(e)&&j3(e)&&x3(e)==w3}var _3=S3;const ja=de(_3);var vS={exports:{}},fe={};/**
- * @license React
- * react-is.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var Xv=Symbol.for("react.element"),Qv=Symbol.for("react.portal"),_d=Symbol.for("react.fragment"),kd=Symbol.for("react.strict_mode"),Od=Symbol.for("react.profiler"),Nd=Symbol.for("react.provider"),Pd=Symbol.for("react.context"),k3=Symbol.for("react.server_context"),Ad=Symbol.for("react.forward_ref"),Cd=Symbol.for("react.suspense"),Ed=Symbol.for("react.suspense_list"),$d=Symbol.for("react.memo"),Td=Symbol.for("react.lazy"),O3=Symbol.for("react.offscreen"),yS;yS=Symbol.for("react.module.reference");function nr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Xv:switch(e=e.type,e){case _d:case Od:case kd:case Cd:case Ed:return e;default:switch(e=e&&e.$$typeof,e){case k3:case Pd:case Ad:case Td:case $d:case Nd:return e;default:return t}}case Qv:return t}}}fe.ContextConsumer=Pd;fe.ContextProvider=Nd;fe.Element=Xv;fe.ForwardRef=Ad;fe.Fragment=_d;fe.Lazy=Td;fe.Memo=$d;fe.Portal=Qv;fe.Profiler=Od;fe.StrictMode=kd;fe.Suspense=Cd;fe.SuspenseList=Ed;fe.isAsyncMode=function(){return!1};fe.isConcurrentMode=function(){return!1};fe.isContextConsumer=function(e){return nr(e)===Pd};fe.isContextProvider=function(e){return nr(e)===Nd};fe.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Xv};fe.isForwardRef=function(e){return nr(e)===Ad};fe.isFragment=function(e){return nr(e)===_d};fe.isLazy=function(e){return nr(e)===Td};fe.isMemo=function(e){return nr(e)===$d};fe.isPortal=function(e){return nr(e)===Qv};fe.isProfiler=function(e){return nr(e)===Od};fe.isStrictMode=function(e){return nr(e)===kd};fe.isSuspense=function(e){return nr(e)===Cd};fe.isSuspenseList=function(e){return nr(e)===Ed};fe.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===_d||e===Od||e===kd||e===Cd||e===Ed||e===O3||typeof e=="object"&&e!==null&&(e.$$typeof===Td||e.$$typeof===$d||e.$$typeof===Nd||e.$$typeof===Pd||e.$$typeof===Ad||e.$$typeof===yS||e.getModuleId!==void 0)};fe.typeOf=nr;vS.exports=fe;var N3=vS.exports,P3=an,A3=on,C3="[object Number]";function E3(e){return typeof e=="number"||A3(e)&&P3(e)==C3}var gS=E3;const $3=de(gS);var T3=gS;function M3(e){return T3(e)&&e!=+e}var I3=M3;const lo=de(I3);var rt=function(t){return t===0?0:t>0?1:-1},ia=function(t){return ja(t)&&t.indexOf("%")===t.length-1},U=function(t){return $3(t)&&!lo(t)},L3=function(t){return te(t)},qe=function(t){return U(t)||ja(t)},D3=0,co=function(t){var r=++D3;return"".concat(t||"").concat(r)},gt=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!U(t)&&!ja(t))return n;var i;if(ia(t)){var s=t.indexOf("%");i=r*parseFloat(t.slice(0,s))/100}else i=+t;return lo(i)&&(i=n),a&&i>r&&(i=r),i},yn=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},R3=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},a=0;a<r;a++)if(!n[t[a]])n[t[a]]=!0;else return!0;return!1},lt=function(t,r){return U(t)&&U(r)?function(n){return t+n*(r-t)}:function(){return r}};function Xc(e,t,r){return!e||!e.length?null:e.find(function(n){return n&&(typeof t=="function"?t(n):Rt(n,t))===r})}var B3=function(t,r){return U(t)&&U(r)?t-r:ja(t)&&ja(r)?t.localeCompare(r):t instanceof Date&&r instanceof Date?t.getTime()-r.getTime():String(t).localeCompare(String(r))};function pi(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}function pp(e){"@babel/helpers - typeof";return pp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pp(e)}var F3=["viewBox","children"],z3=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],C0=["points","pathLength"],zf={svg:F3,polygon:C0,polyline:C0},Jv=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],Qc=function(t,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var n=t;if(P.isValidElement(t)&&(n=t.props),!ao(n))return null;var a={};return Object.keys(n).forEach(function(i){Jv.includes(i)&&(a[i]=r||function(s){return n[i](n,s)})}),a},W3=function(t,r,n){return function(a){return t(r,n,a),null}},Zr=function(t,r,n){if(!ao(t)||pp(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(i){var s=t[i];Jv.includes(i)&&typeof s=="function"&&(a||(a={}),a[i]=W3(s,r,n))}),a},U3=["children"],H3=["children"];function E0(e,t){if(e==null)return{};var r=K3(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function K3(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function mp(e){"@babel/helpers - typeof";return mp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mp(e)}var $0={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Gr=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},T0=null,Wf=null,Zv=function e(t){if(t===T0&&Array.isArray(Wf))return Wf;var r=[];return P.Children.forEach(t,function(n){te(n)||(N3.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),Wf=r,T0=t,r};function Bt(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(a){return Gr(a)}):n=[Gr(t)],Zv(e).forEach(function(a){var i=Rt(a,"type.displayName")||Rt(a,"type.name");n.indexOf(i)!==-1&&r.push(a)}),r}function Mt(e,t){var r=Bt(e,t);return r&&r[0]}var M0=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,a=r.height;return!(!U(n)||n<=0||!U(a)||a<=0)},V3=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],G3=function(t){return t&&t.type&&ja(t.type)&&V3.indexOf(t.type)>=0},Y3=function(t){return t&&mp(t)==="object"&&"clipDot"in t},q3=function(t,r,n,a){var i,s=(i=zf==null?void 0:zf[a])!==null&&i!==void 0?i:[];return r.startsWith("data-")||!Q(t)&&(a&&s.includes(r)||z3.includes(r))||n&&Jv.includes(r)},X=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(P.isValidElement(t)&&(a=t.props),!ao(a))return null;var i={};return Object.keys(a).forEach(function(s){var l;q3((l=a)===null||l===void 0?void 0:l[s],s,r,n)&&(i[s]=a[s])}),i},vp=function e(t,r){if(t===r)return!0;var n=P.Children.count(t);if(n!==P.Children.count(r))return!1;if(n===0)return!0;if(n===1)return I0(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var a=0;a<n;a++){var i=t[a],s=r[a];if(Array.isArray(i)||Array.isArray(s)){if(!e(i,s))return!1}else if(!I0(i,s))return!1}return!0},I0=function(t,r){if(te(t)&&te(r))return!0;if(!te(t)&&!te(r)){var n=t.props||{},a=n.children,i=E0(n,U3),s=r.props||{},l=s.children,c=E0(s,H3);return a&&l?pi(i,c)&&vp(a,l):!a&&!l?pi(i,c):!1}return!1},L0=function(t,r){var n=[],a={};return Zv(t).forEach(function(i,s){if(G3(i))n.push(i);else if(i){var l=Gr(i.type),c=r[l]||{},u=c.handler,f=c.once;if(u&&(!f||!a[l])){var d=u(i,l,s);n.push(d),a[l]=!0}}}),n},X3=function(t){var r=t&&t.type;return r&&$0[r]?$0[r]:null},Q3=function(t,r){return Zv(r).indexOf(t)},J3=["children","width","height","viewBox","className","style","title","desc"];function yp(){return yp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yp.apply(this,arguments)}function Z3(e,t){if(e==null)return{};var r=e5(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function e5(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function gp(e){var t=e.children,r=e.width,n=e.height,a=e.viewBox,i=e.className,s=e.style,l=e.title,c=e.desc,u=Z3(e,J3),f=a||{width:r,height:n,x:0,y:0},d=ee("recharts-surface",i);return $.createElement("svg",yp({},X(u,!0,"svg"),{className:d,width:r,height:n,style:s,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),$.createElement("title",null,l),$.createElement("desc",null,c),t)}var t5=["children","className"];function xp(){return xp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xp.apply(this,arguments)}function r5(e,t){if(e==null)return{};var r=n5(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function n5(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var ne=$.forwardRef(function(e,t){var r=e.children,n=e.className,a=r5(e,t5),i=ee("recharts-layer",n);return $.createElement("g",xp({className:i},X(a,!0),{ref:t}),r)}),vr=function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i]};function a5(e,t,r){var n=-1,a=e.length;t<0&&(t=-t>a?0:a+t),r=r>a?a:r,r<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(a);++n<a;)i[n]=e[n+t];return i}var i5=a5,o5=i5;function s5(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:o5(e,t,r)}var l5=s5,c5="\\ud800-\\udfff",u5="\\u0300-\\u036f",d5="\\ufe20-\\ufe2f",f5="\\u20d0-\\u20ff",h5=u5+d5+f5,p5="\\ufe0e\\ufe0f",m5="\\u200d",v5=RegExp("["+m5+c5+h5+p5+"]");function y5(e){return v5.test(e)}var xS=y5;function g5(e){return e.split("")}var x5=g5,bS="\\ud800-\\udfff",b5="\\u0300-\\u036f",j5="\\ufe20-\\ufe2f",w5="\\u20d0-\\u20ff",S5=b5+j5+w5,_5="\\ufe0e\\ufe0f",k5="["+bS+"]",bp="["+S5+"]",jp="\\ud83c[\\udffb-\\udfff]",O5="(?:"+bp+"|"+jp+")",jS="[^"+bS+"]",wS="(?:\\ud83c[\\udde6-\\uddff]){2}",SS="[\\ud800-\\udbff][\\udc00-\\udfff]",N5="\\u200d",_S=O5+"?",kS="["+_5+"]?",P5="(?:"+N5+"(?:"+[jS,wS,SS].join("|")+")"+kS+_S+")*",A5=kS+_S+P5,C5="(?:"+[jS+bp+"?",bp,wS,SS,k5].join("|")+")",E5=RegExp(jp+"(?="+jp+")|"+C5+A5,"g");function $5(e){return e.match(E5)||[]}var T5=$5,M5=x5,I5=xS,L5=T5;function D5(e){return I5(e)?L5(e):M5(e)}var R5=D5,B5=l5,F5=xS,z5=R5,W5=hS;function U5(e){return function(t){t=W5(t);var r=F5(t)?z5(t):void 0,n=r?r[0]:t.charAt(0),a=r?B5(r,1).join(""):t.slice(1);return n[e]()+a}}var H5=U5,K5=H5,V5=K5("toUpperCase"),G5=V5;const Md=de(G5);function be(e){return function(){return e}}const OS=Math.cos,Jc=Math.sin,br=Math.sqrt,Zc=Math.PI,Id=2*Zc,wp=Math.PI,Sp=2*wp,Jn=1e-6,Y5=Sp-Jn;function NS(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function q5(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return NS;const r=10**t;return function(n){this._+=n[0];for(let a=1,i=n.length;a<i;++a)this._+=Math.round(arguments[a]*r)/r+n[a]}}class X5{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?NS:q5(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,a){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+a}`}bezierCurveTo(t,r,n,a,i,s){this._append`C${+t},${+r},${+n},${+a},${this._x1=+i},${this._y1=+s}`}arcTo(t,r,n,a,i){if(t=+t,r=+r,n=+n,a=+a,i=+i,i<0)throw new Error(`negative radius: ${i}`);let s=this._x1,l=this._y1,c=n-t,u=a-r,f=s-t,d=l-r,h=f*f+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(h>Jn)if(!(Math.abs(d*c-u*f)>Jn)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-s,g=a-l,y=c*c+u*u,b=p*p+g*g,v=Math.sqrt(y),m=Math.sqrt(h),x=i*Math.tan((wp-Math.acos((y+h-b)/(2*v*m)))/2),S=x/m,j=x/v;Math.abs(S-1)>Jn&&this._append`L${t+S*f},${r+S*d}`,this._append`A${i},${i},0,0,${+(d*p>f*g)},${this._x1=t+j*c},${this._y1=r+j*u}`}}arc(t,r,n,a,i,s){if(t=+t,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(a),c=n*Math.sin(a),u=t+l,f=r+c,d=1^s,h=s?a-i:i-a;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>Jn||Math.abs(this._y1-f)>Jn)&&this._append`L${u},${f}`,n&&(h<0&&(h=h%Sp+Sp),h>Y5?this._append`A${n},${n},0,1,${d},${t-l},${r-c}A${n},${n},0,1,${d},${this._x1=u},${this._y1=f}`:h>Jn&&this._append`A${n},${n},0,${+(h>=wp)},${d},${this._x1=t+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(t,r,n,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}}function ey(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new X5(t)}function ty(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function PS(e){this._context=e}PS.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 Ld(e){return new PS(e)}function AS(e){return e[0]}function CS(e){return e[1]}function ES(e,t){var r=be(!0),n=null,a=Ld,i=null,s=ey(l);e=typeof e=="function"?e:e===void 0?AS:be(e),t=typeof t=="function"?t:t===void 0?CS:be(t);function l(c){var u,f=(c=ty(c)).length,d,h=!1,p;for(n==null&&(i=a(p=s())),u=0;u<=f;++u)!(u<f&&r(d=c[u],u,c))===h&&((h=!h)?i.lineStart():i.lineEnd()),h&&i.point(+e(d,u,c),+t(d,u,c));if(p)return i=null,p+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:be(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:be(+c),l):t},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:be(!!c),l):r},l.curve=function(c){return arguments.length?(a=c,n!=null&&(i=a(n)),l):a},l.context=function(c){return arguments.length?(c==null?n=i=null:i=a(n=c),l):n},l}function Hl(e,t,r){var n=null,a=be(!0),i=null,s=Ld,l=null,c=ey(u);e=typeof e=="function"?e:e===void 0?AS:be(+e),t=typeof t=="function"?t:be(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?CS:be(+r);function u(d){var h,p,g,y=(d=ty(d)).length,b,v=!1,m,x=new Array(y),S=new Array(y);for(i==null&&(l=s(m=c())),h=0;h<=y;++h){if(!(h<y&&a(b=d[h],h,d))===v)if(v=!v)p=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),g=h-1;g>=p;--g)l.point(x[g],S[g]);l.lineEnd(),l.areaEnd()}v&&(x[h]=+e(b,h,d),S[h]=+t(b,h,d),l.point(n?+n(b,h,d):x[h],r?+r(b,h,d):S[h]))}if(m)return l=null,m+""||null}function f(){return ES().defined(a).curve(s).context(i)}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:be(+d),n=null,u):e},u.x0=function(d){return arguments.length?(e=typeof d=="function"?d:be(+d),u):e},u.x1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:be(+d),u):n},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:be(+d),r=null,u):t},u.y0=function(d){return arguments.length?(t=typeof d=="function"?d:be(+d),u):t},u.y1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:be(+d),u):r},u.lineX0=u.lineY0=function(){return f().x(e).y(t)},u.lineY1=function(){return f().x(e).y(r)},u.lineX1=function(){return f().x(n).y(t)},u.defined=function(d){return arguments.length?(a=typeof d=="function"?d:be(!!d),u):a},u.curve=function(d){return arguments.length?(s=d,i!=null&&(l=s(i)),u):s},u.context=function(d){return arguments.length?(d==null?i=l=null:l=s(i=d),u):i},u}class $S{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Q5(e){return new $S(e,!0)}function J5(e){return new $S(e,!1)}const ry={draw(e,t){const r=br(t/Zc);e.moveTo(r,0),e.arc(0,0,r,0,Id)}},Z5={draw(e,t){const r=br(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},TS=br(1/3),e4=TS*2,t4={draw(e,t){const r=br(t/e4),n=r*TS;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},r4={draw(e,t){const r=br(t),n=-r/2;e.rect(n,n,r,r)}},n4=.8908130915292852,MS=Jc(Zc/10)/Jc(7*Zc/10),a4=Jc(Id/10)*MS,i4=-OS(Id/10)*MS,o4={draw(e,t){const r=br(t*n4),n=a4*r,a=i4*r;e.moveTo(0,-r),e.lineTo(n,a);for(let i=1;i<5;++i){const s=Id*i/5,l=OS(s),c=Jc(s);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*a,c*n+l*a)}e.closePath()}},Uf=br(3),s4={draw(e,t){const r=-br(t/(Uf*3));e.moveTo(0,r*2),e.lineTo(-Uf*r,-r),e.lineTo(Uf*r,-r),e.closePath()}},Ut=-.5,Ht=br(3)/2,_p=1/br(12),l4=(_p/2+1)*3,c4={draw(e,t){const r=br(t/l4),n=r/2,a=r*_p,i=n,s=r*_p+r,l=-i,c=s;e.moveTo(n,a),e.lineTo(i,s),e.lineTo(l,c),e.lineTo(Ut*n-Ht*a,Ht*n+Ut*a),e.lineTo(Ut*i-Ht*s,Ht*i+Ut*s),e.lineTo(Ut*l-Ht*c,Ht*l+Ut*c),e.lineTo(Ut*n+Ht*a,Ut*a-Ht*n),e.lineTo(Ut*i+Ht*s,Ut*s-Ht*i),e.lineTo(Ut*l+Ht*c,Ut*c-Ht*l),e.closePath()}};function u4(e,t){let r=null,n=ey(a);e=typeof e=="function"?e:be(e||ry),t=typeof t=="function"?t:be(t===void 0?64:+t);function a(){let i;if(r||(r=i=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:be(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:be(+i),a):t},a.context=function(i){return arguments.length?(r=i??null,a):r},a}function eu(){}function tu(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function IS(e){this._context=e}IS.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:tu(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:tu(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function d4(e){return new IS(e)}function LS(e){this._context=e}LS.prototype={areaStart:eu,areaEnd:eu,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:tu(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function f4(e){return new LS(e)}function DS(e){this._context=e}DS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:tu(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function h4(e){return new DS(e)}function RS(e){this._context=e}RS.prototype={areaStart:eu,areaEnd:eu,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 p4(e){return new RS(e)}function D0(e){return e<0?-1:1}function R0(e,t,r){var n=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(n||a<0&&-0),s=(r-e._y1)/(a||n<0&&-0),l=(i*a+s*n)/(n+a);return(D0(i)+D0(s))*Math.min(Math.abs(i),Math.abs(s),.5*Math.abs(l))||0}function B0(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Hf(e,t,r){var n=e._x0,a=e._y0,i=e._x1,s=e._y1,l=(i-n)/3;e._context.bezierCurveTo(n+l,a+l*t,i-l,s-l*r,i,s)}function ru(e){this._context=e}ru.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:Hf(this,this._t0,B0(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Hf(this,B0(this,r=R0(this,e,t)),r);break;default:Hf(this,this._t0,r=R0(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function BS(e){this._context=new FS(e)}(BS.prototype=Object.create(ru.prototype)).point=function(e,t){ru.prototype.point.call(this,t,e)};function FS(e){this._context=e}FS.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,a,i){this._context.bezierCurveTo(t,e,n,r,i,a)}};function m4(e){return new ru(e)}function v4(e){return new BS(e)}function zS(e){this._context=e}zS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=F0(e),a=F0(t),i=0,s=1;s<r;++i,++s)this._context.bezierCurveTo(n[0][i],a[0][i],n[1][i],a[1][i],e[s],t[s]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function F0(e){var t,r=e.length-1,n,a=new Array(r),i=new Array(r),s=new Array(r);for(a[0]=0,i[0]=2,s[0]=e[0]+2*e[1],t=1;t<r-1;++t)a[t]=1,i[t]=4,s[t]=4*e[t]+2*e[t+1];for(a[r-1]=2,i[r-1]=7,s[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=a[t]/i[t-1],i[t]-=n,s[t]-=n*s[t-1];for(a[r-1]=s[r-1]/i[r-1],t=r-2;t>=0;--t)a[t]=(s[t]-a[t+1])/i[t];for(i[r-1]=(e[r]+a[r-1])/2,t=0;t<r-1;++t)i[t]=2*e[t+1]-a[t+1];return[a,i]}function y4(e){return new zS(e)}function Dd(e,t){this._context=e,this._t=t}Dd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function g4(e){return new Dd(e,.5)}function x4(e){return new Dd(e,0)}function b4(e){return new Dd(e,1)}function Oi(e,t){if((s=e.length)>1)for(var r=1,n,a,i=e[t[0]],s,l=i.length;r<s;++r)for(a=i,i=e[t[r]],n=0;n<l;++n)i[n][1]+=i[n][0]=isNaN(a[n][1])?a[n][0]:a[n][1]}function kp(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function j4(e,t){return e[t]}function w4(e){const t=[];return t.key=e,t}function S4(){var e=be([]),t=kp,r=Oi,n=j4;function a(i){var s=Array.from(e.apply(this,arguments),w4),l,c=s.length,u=-1,f;for(const d of i)for(l=0,++u;l<c;++l)(s[l][u]=[0,+n(d,s[l].key,u,i)]).data=d;for(l=0,f=ty(t(s));l<c;++l)s[f[l]].index=l;return r(s,f),s}return a.keys=function(i){return arguments.length?(e=typeof i=="function"?i:be(Array.from(i)),a):e},a.value=function(i){return arguments.length?(n=typeof i=="function"?i:be(+i),a):n},a.order=function(i){return arguments.length?(t=i==null?kp:typeof i=="function"?i:be(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(r=i??Oi,a):r},a}function _4(e,t){if((n=e.length)>0){for(var r,n,a=0,i=e[0].length,s;a<i;++a){for(s=r=0;r<n;++r)s+=e[r][a][1]||0;if(s)for(r=0;r<n;++r)e[r][a][1]/=s}Oi(e,t)}}function k4(e,t){if((a=e.length)>0){for(var r=0,n=e[t[0]],a,i=n.length;r<i;++r){for(var s=0,l=0;s<a;++s)l+=e[s][r][1]||0;n[r][1]+=n[r][0]=-l/2}Oi(e,t)}}function O4(e,t){if(!(!((s=e.length)>0)||!((i=(a=e[t[0]]).length)>0))){for(var r=0,n=1,a,i,s;n<i;++n){for(var l=0,c=0,u=0;l<s;++l){for(var f=e[t[l]],d=f[n][1]||0,h=f[n-1][1]||0,p=(d-h)/2,g=0;g<l;++g){var y=e[t[g]],b=y[n][1]||0,v=y[n-1][1]||0;p+=b-v}c+=d,u+=p*d}a[n-1][1]+=a[n-1][0]=r,c&&(r-=u/c)}a[n-1][1]+=a[n-1][0]=r,Oi(e,t)}}function ks(e){"@babel/helpers - typeof";return ks=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ks(e)}var N4=["type","size","sizeType"];function Op(){return Op=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Op.apply(this,arguments)}function z0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function W0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?z0(Object(r),!0).forEach(function(n){P4(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):z0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function P4(e,t,r){return t=A4(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function A4(e){var t=C4(e,"string");return ks(t)=="symbol"?t:t+""}function C4(e,t){if(ks(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ks(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function E4(e,t){if(e==null)return{};var r=$4(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $4(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var WS={symbolCircle:ry,symbolCross:Z5,symbolDiamond:t4,symbolSquare:r4,symbolStar:o4,symbolTriangle:s4,symbolWye:c4},T4=Math.PI/180,M4=function(t){var r="symbol".concat(Md(t));return WS[r]||ry},I4=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*T4;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},L4=function(t,r){WS["symbol".concat(Md(t))]=r},ny=function(t){var r=t.type,n=r===void 0?"circle":r,a=t.size,i=a===void 0?64:a,s=t.sizeType,l=s===void 0?"area":s,c=E4(t,N4),u=W0(W0({},c),{},{type:n,size:i,sizeType:l}),f=function(){var b=M4(n),v=u4().type(b).size(I4(i,l,n));return v()},d=u.className,h=u.cx,p=u.cy,g=X(u,!0);return h===+h&&p===+p&&i===+i?$.createElement("path",Op({},g,{className:ee("recharts-symbols",d),transform:"translate(".concat(h,", ").concat(p,")"),d:f()})):null};ny.registerSymbol=L4;function Ni(e){"@babel/helpers - typeof";return Ni=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ni(e)}function Np(){return Np=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Np.apply(this,arguments)}function U0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function D4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?U0(Object(r),!0).forEach(function(n){Os(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function R4(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function B4(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,HS(n.key),n)}}function F4(e,t,r){return t&&B4(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function z4(e,t,r){return t=nu(t),W4(e,US()?Reflect.construct(t,r||[],nu(e).constructor):t.apply(e,r))}function W4(e,t){if(t&&(Ni(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return U4(e)}function U4(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function US(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(US=function(){return!!e})()}function nu(e){return nu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},nu(e)}function H4(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pp(e,t)}function Pp(e,t){return Pp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Pp(e,t)}function Os(e,t,r){return t=HS(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function HS(e){var t=K4(e,"string");return Ni(t)=="symbol"?t:t+""}function K4(e,t){if(Ni(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ni(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Kt=32,ay=function(e){function t(){return R4(this,t),z4(this,t,arguments)}return H4(t,e),F4(t,[{key:"renderIcon",value:function(n){var a=this.props.inactiveColor,i=Kt/2,s=Kt/6,l=Kt/3,c=n.inactive?a:n.color;if(n.type==="plainline")return $.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:i,x2:Kt,y2:i,className:"recharts-legend-icon"});if(n.type==="line")return $.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(i,"h").concat(l,`
- A`).concat(s,",").concat(s,",0,1,1,").concat(2*l,",").concat(i,`
- H`).concat(Kt,"M").concat(2*l,",").concat(i,`
- A`).concat(s,",").concat(s,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(n.type==="rect")return $.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Kt/8,"h").concat(Kt,"v").concat(Kt*3/4,"h").concat(-Kt,"z"),className:"recharts-legend-icon"});if($.isValidElement(n.legendIcon)){var u=D4({},n);return delete u.legendIcon,$.cloneElement(n.legendIcon,u)}return $.createElement(ny,{fill:c,cx:i,cy:i,size:Kt,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,a=this.props,i=a.payload,s=a.iconSize,l=a.layout,c=a.formatter,u=a.inactiveColor,f={x:0,y:0,width:Kt,height:Kt},d={display:l==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(p,g){var y=p.formatter||c,b=ee(Os(Os({"recharts-legend-item":!0},"legend-item-".concat(g),!0),"inactive",p.inactive));if(p.type==="none")return null;var v=Q(p.value)?null:p.value;vr(!Q(p.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var m=p.inactive?u:p.color;return $.createElement("li",Np({className:b,style:d,key:"legend-item-".concat(g)},Zr(n.props,p,g)),$.createElement(gp,{width:s,height:s,viewBox:f,style:h},n.renderIcon(p)),$.createElement("span",{className:"recharts-legend-item-text",style:{color:m}},y?y(v,p,g):v))})}},{key:"render",value:function(){var n=this.props,a=n.payload,i=n.layout,s=n.align;if(!a||!a.length)return null;var l={padding:0,margin:0,textAlign:i==="horizontal"?s:"left"};return $.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(P.PureComponent);Os(ay,"displayName","Legend");Os(ay,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var V4=jd;function G4(){this.__data__=new V4,this.size=0}var Y4=G4;function q4(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var X4=q4;function Q4(e){return this.__data__.get(e)}var J4=Q4;function Z4(e){return this.__data__.has(e)}var eM=Z4,tM=jd,rM=Kv,nM=Vv,aM=200;function iM(e,t){var r=this.__data__;if(r instanceof tM){var n=r.__data__;if(!rM||n.length<aM-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new nM(n)}return r.set(e,t),this.size=r.size,this}var oM=iM,sM=jd,lM=Y4,cM=X4,uM=J4,dM=eM,fM=oM;function uo(e){var t=this.__data__=new sM(e);this.size=t.size}uo.prototype.clear=lM;uo.prototype.delete=cM;uo.prototype.get=uM;uo.prototype.has=dM;uo.prototype.set=fM;var KS=uo,hM="__lodash_hash_undefined__";function pM(e){return this.__data__.set(e,hM),this}var mM=pM;function vM(e){return this.__data__.has(e)}var yM=vM,gM=Vv,xM=mM,bM=yM;function au(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new gM;++t<r;)this.add(e[t])}au.prototype.add=au.prototype.push=xM;au.prototype.has=bM;var VS=au;function jM(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var GS=jM;function wM(e,t){return e.has(t)}var YS=wM,SM=VS,_M=GS,kM=YS,OM=1,NM=2;function PM(e,t,r,n,a,i){var s=r&OM,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var u=i.get(e),f=i.get(t);if(u&&f)return u==t&&f==e;var d=-1,h=!0,p=r&NM?new SM:void 0;for(i.set(e,t),i.set(t,e);++d<l;){var g=e[d],y=t[d];if(n)var b=s?n(y,g,d,t,e,i):n(g,y,d,e,t,i);if(b!==void 0){if(b)continue;h=!1;break}if(p){if(!_M(t,function(v,m){if(!kM(p,m)&&(g===v||a(g,v,r,n,i)))return p.push(m)})){h=!1;break}}else if(!(g===y||a(g,y,r,n,i))){h=!1;break}}return i.delete(e),i.delete(t),h}var qS=PM,AM=Tr,CM=AM.Uint8Array,EM=CM;function $M(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}var TM=$M;function MM(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var iy=MM,H0=pl,K0=EM,IM=Hv,LM=qS,DM=TM,RM=iy,BM=1,FM=2,zM="[object Boolean]",WM="[object Date]",UM="[object Error]",HM="[object Map]",KM="[object Number]",VM="[object RegExp]",GM="[object Set]",YM="[object String]",qM="[object Symbol]",XM="[object ArrayBuffer]",QM="[object DataView]",V0=H0?H0.prototype:void 0,Kf=V0?V0.valueOf:void 0;function JM(e,t,r,n,a,i,s){switch(r){case QM:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case XM:return!(e.byteLength!=t.byteLength||!i(new K0(e),new K0(t)));case zM:case WM:case KM:return IM(+e,+t);case UM:return e.name==t.name&&e.message==t.message;case VM:case YM:return e==t+"";case HM:var l=DM;case GM:var c=n&BM;if(l||(l=RM),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;n|=FM,s.set(e,t);var f=LM(l(e),l(t),n,a,i,s);return s.delete(e),f;case qM:if(Kf)return Kf.call(e)==Kf.call(t)}return!1}var ZM=JM;function eI(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}var XS=eI,tI=XS,rI=Et;function nI(e,t,r){var n=t(e);return rI(e)?n:tI(n,r(e))}var aI=nI;function iI(e,t){for(var r=-1,n=e==null?0:e.length,a=0,i=[];++r<n;){var s=e[r];t(s,r,e)&&(i[a++]=s)}return i}var oI=iI;function sI(){return[]}var lI=sI,cI=oI,uI=lI,dI=Object.prototype,fI=dI.propertyIsEnumerable,G0=Object.getOwnPropertySymbols,hI=G0?function(e){return e==null?[]:(e=Object(e),cI(G0(e),function(t){return fI.call(e,t)}))}:uI,pI=hI;function mI(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var vI=mI,yI=an,gI=on,xI="[object Arguments]";function bI(e){return gI(e)&&yI(e)==xI}var jI=bI,Y0=jI,wI=on,QS=Object.prototype,SI=QS.hasOwnProperty,_I=QS.propertyIsEnumerable,kI=Y0(function(){return arguments}())?Y0:function(e){return wI(e)&&SI.call(e,"callee")&&!_I.call(e,"callee")},oy=kI,iu={exports:{}};function OI(){return!1}var NI=OI;iu.exports;(function(e,t){var r=Tr,n=NI,a=t&&!t.nodeType&&t,i=a&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===a,l=s?r.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||n;e.exports=u})(iu,iu.exports);var JS=iu.exports,PI=9007199254740991,AI=/^(?:0|[1-9]\d*)$/;function CI(e,t){var r=typeof e;return t=t??PI,!!t&&(r=="number"||r!="symbol"&&AI.test(e))&&e>-1&&e%1==0&&e<t}var sy=CI,EI=9007199254740991;function $I(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=EI}var ly=$I,TI=an,MI=ly,II=on,LI="[object Arguments]",DI="[object Array]",RI="[object Boolean]",BI="[object Date]",FI="[object Error]",zI="[object Function]",WI="[object Map]",UI="[object Number]",HI="[object Object]",KI="[object RegExp]",VI="[object Set]",GI="[object String]",YI="[object WeakMap]",qI="[object ArrayBuffer]",XI="[object DataView]",QI="[object Float32Array]",JI="[object Float64Array]",ZI="[object Int8Array]",eL="[object Int16Array]",tL="[object Int32Array]",rL="[object Uint8Array]",nL="[object Uint8ClampedArray]",aL="[object Uint16Array]",iL="[object Uint32Array]",Se={};Se[QI]=Se[JI]=Se[ZI]=Se[eL]=Se[tL]=Se[rL]=Se[nL]=Se[aL]=Se[iL]=!0;Se[LI]=Se[DI]=Se[qI]=Se[RI]=Se[XI]=Se[BI]=Se[FI]=Se[zI]=Se[WI]=Se[UI]=Se[HI]=Se[KI]=Se[VI]=Se[GI]=Se[YI]=!1;function oL(e){return II(e)&&MI(e.length)&&!!Se[TI(e)]}var sL=oL;function lL(e){return function(t){return e(t)}}var ZS=lL,ou={exports:{}};ou.exports;(function(e,t){var r=sS,n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i&&r.process,l=function(){try{var c=a&&a.require&&a.require("util").types;return c||s&&s.binding&&s.binding("util")}catch{}}();e.exports=l})(ou,ou.exports);var cL=ou.exports,uL=sL,dL=ZS,q0=cL,X0=q0&&q0.isTypedArray,fL=X0?dL(X0):uL,e_=fL,hL=vI,pL=oy,mL=Et,vL=JS,yL=sy,gL=e_,xL=Object.prototype,bL=xL.hasOwnProperty;function jL(e,t){var r=mL(e),n=!r&&pL(e),a=!r&&!n&&vL(e),i=!r&&!n&&!a&&gL(e),s=r||n||a||i,l=s?hL(e.length,String):[],c=l.length;for(var u in e)(t||bL.call(e,u))&&!(s&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||yL(u,c)))&&l.push(u);return l}var wL=jL,SL=Object.prototype;function _L(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||SL;return e===r}var kL=_L;function OL(e,t){return function(r){return e(t(r))}}var t_=OL,NL=t_,PL=NL(Object.keys,Object),AL=PL,CL=kL,EL=AL,$L=Object.prototype,TL=$L.hasOwnProperty;function ML(e){if(!CL(e))return EL(e);var t=[];for(var r in Object(e))TL.call(e,r)&&r!="constructor"&&t.push(r);return t}var IL=ML,LL=Uv,DL=ly;function RL(e){return e!=null&&DL(e.length)&&!LL(e)}var ml=RL,BL=wL,FL=IL,zL=ml;function WL(e){return zL(e)?BL(e):FL(e)}var Rd=WL,UL=aI,HL=pI,KL=Rd;function VL(e){return UL(e,KL,HL)}var GL=VL,Q0=GL,YL=1,qL=Object.prototype,XL=qL.hasOwnProperty;function QL(e,t,r,n,a,i){var s=r&YL,l=Q0(e),c=l.length,u=Q0(t),f=u.length;if(c!=f&&!s)return!1;for(var d=c;d--;){var h=l[d];if(!(s?h in t:XL.call(t,h)))return!1}var p=i.get(e),g=i.get(t);if(p&&g)return p==t&&g==e;var y=!0;i.set(e,t),i.set(t,e);for(var b=s;++d<c;){h=l[d];var v=e[h],m=t[h];if(n)var x=s?n(m,v,h,t,e,i):n(v,m,h,e,t,i);if(!(x===void 0?v===m||a(v,m,r,n,i):x)){y=!1;break}b||(b=h=="constructor")}if(y&&!b){var S=e.constructor,j=t.constructor;S!=j&&"constructor"in e&&"constructor"in t&&!(typeof S=="function"&&S instanceof S&&typeof j=="function"&&j instanceof j)&&(y=!1)}return i.delete(e),i.delete(t),y}var JL=QL,ZL=Ca,e6=Tr,t6=ZL(e6,"DataView"),r6=t6,n6=Ca,a6=Tr,i6=n6(a6,"Promise"),o6=i6,s6=Ca,l6=Tr,c6=s6(l6,"Set"),r_=c6,u6=Ca,d6=Tr,f6=u6(d6,"WeakMap"),h6=f6,Ap=r6,Cp=Kv,Ep=o6,$p=r_,Tp=h6,n_=an,fo=cS,J0="[object Map]",p6="[object Object]",Z0="[object Promise]",ex="[object Set]",tx="[object WeakMap]",rx="[object DataView]",m6=fo(Ap),v6=fo(Cp),y6=fo(Ep),g6=fo($p),x6=fo(Tp),Zn=n_;(Ap&&Zn(new Ap(new ArrayBuffer(1)))!=rx||Cp&&Zn(new Cp)!=J0||Ep&&Zn(Ep.resolve())!=Z0||$p&&Zn(new $p)!=ex||Tp&&Zn(new Tp)!=tx)&&(Zn=function(e){var t=n_(e),r=t==p6?e.constructor:void 0,n=r?fo(r):"";if(n)switch(n){case m6:return rx;case v6:return J0;case y6:return Z0;case g6:return ex;case x6:return tx}return t});var b6=Zn,Vf=KS,j6=qS,w6=ZM,S6=JL,nx=b6,ax=Et,ix=JS,_6=e_,k6=1,ox="[object Arguments]",sx="[object Array]",Kl="[object Object]",O6=Object.prototype,lx=O6.hasOwnProperty;function N6(e,t,r,n,a,i){var s=ax(e),l=ax(t),c=s?sx:nx(e),u=l?sx:nx(t);c=c==ox?Kl:c,u=u==ox?Kl:u;var f=c==Kl,d=u==Kl,h=c==u;if(h&&ix(e)){if(!ix(t))return!1;s=!0,f=!1}if(h&&!f)return i||(i=new Vf),s||_6(e)?j6(e,t,r,n,a,i):w6(e,t,c,r,n,a,i);if(!(r&k6)){var p=f&&lx.call(e,"__wrapped__"),g=d&&lx.call(t,"__wrapped__");if(p||g){var y=p?e.value():e,b=g?t.value():t;return i||(i=new Vf),a(y,b,r,n,i)}}return h?(i||(i=new Vf),S6(e,t,r,n,a,i)):!1}var P6=N6,A6=P6,cx=on;function a_(e,t,r,n,a){return e===t?!0:e==null||t==null||!cx(e)&&!cx(t)?e!==e&&t!==t:A6(e,t,r,n,a_,a)}var cy=a_,C6=KS,E6=cy,$6=1,T6=2;function M6(e,t,r,n){var a=r.length,i=a,s=!n;if(e==null)return!i;for(e=Object(e);a--;){var l=r[a];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++a<i;){l=r[a];var c=l[0],u=e[c],f=l[1];if(s&&l[2]){if(u===void 0&&!(c in e))return!1}else{var d=new C6;if(n)var h=n(u,f,c,e,t,d);if(!(h===void 0?E6(f,u,$6|T6,n,d):h))return!1}}return!0}var I6=M6,L6=Fn;function D6(e){return e===e&&!L6(e)}var i_=D6,R6=i_,B6=Rd;function F6(e){for(var t=B6(e),r=t.length;r--;){var n=t[r],a=e[n];t[r]=[n,a,R6(a)]}return t}var z6=F6;function W6(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var o_=W6,U6=I6,H6=z6,K6=o_;function V6(e){var t=H6(e);return t.length==1&&t[0][2]?K6(t[0][0],t[0][1]):function(r){return r===e||U6(r,e,t)}}var G6=V6;function Y6(e,t){return e!=null&&t in Object(e)}var q6=Y6,X6=pS,Q6=oy,J6=Et,Z6=sy,e8=ly,t8=Sd;function r8(e,t,r){t=X6(t,e);for(var n=-1,a=t.length,i=!1;++n<a;){var s=t8(t[n]);if(!(i=e!=null&&r(e,s)))break;e=e[s]}return i||++n!=a?i:(a=e==null?0:e.length,!!a&&e8(a)&&Z6(s,a)&&(J6(e)||Q6(e)))}var n8=r8,a8=q6,i8=n8;function o8(e,t){return e!=null&&i8(e,t,a8)}var s8=o8,l8=cy,c8=mS,u8=s8,d8=Wv,f8=i_,h8=o_,p8=Sd,m8=1,v8=2;function y8(e,t){return d8(e)&&f8(t)?h8(p8(e),t):function(r){var n=c8(r,e);return n===void 0&&n===t?u8(r,e):l8(t,n,m8|v8)}}var g8=y8;function x8(e){return e}var ho=x8;function b8(e){return function(t){return t==null?void 0:t[e]}}var j8=b8,w8=qv;function S8(e){return function(t){return w8(t,e)}}var _8=S8,k8=j8,O8=_8,N8=Wv,P8=Sd;function A8(e){return N8(e)?k8(P8(e)):O8(e)}var C8=A8,E8=G6,$8=g8,T8=ho,M8=Et,I8=C8;function L8(e){return typeof e=="function"?e:e==null?T8:typeof e=="object"?M8(e)?$8(e[0],e[1]):E8(e):I8(e)}var Mr=L8;function D8(e,t,r,n){for(var a=e.length,i=r+(n?1:-1);n?i--:++i<a;)if(t(e[i],i,e))return i;return-1}var s_=D8;function R8(e){return e!==e}var B8=R8;function F8(e,t,r){for(var n=r-1,a=e.length;++n<a;)if(e[n]===t)return n;return-1}var z8=F8,W8=s_,U8=B8,H8=z8;function K8(e,t,r){return t===t?H8(e,t,r):W8(e,U8,r)}var V8=K8,G8=V8;function Y8(e,t){var r=e==null?0:e.length;return!!r&&G8(e,t,0)>-1}var q8=Y8;function X8(e,t,r){for(var n=-1,a=e==null?0:e.length;++n<a;)if(r(t,e[n]))return!0;return!1}var Q8=X8;function J8(){}var Z8=J8,Gf=r_,eD=Z8,tD=iy,rD=1/0,nD=Gf&&1/tD(new Gf([,-0]))[1]==rD?function(e){return new Gf(e)}:eD,aD=nD,iD=VS,oD=q8,sD=Q8,lD=YS,cD=aD,uD=iy,dD=200;function fD(e,t,r){var n=-1,a=oD,i=e.length,s=!0,l=[],c=l;if(r)s=!1,a=sD;else if(i>=dD){var u=t?null:cD(e);if(u)return uD(u);s=!1,a=lD,c=new iD}else c=t?[]:l;e:for(;++n<i;){var f=e[n],d=t?t(f):f;if(f=r||f!==0?f:0,s&&d===d){for(var h=c.length;h--;)if(c[h]===d)continue e;t&&c.push(d),l.push(f)}else a(c,d,r)||(c!==l&&c.push(d),l.push(f))}return l}var hD=fD,pD=Mr,mD=hD;function vD(e,t){return e&&e.length?mD(e,pD(t)):[]}var yD=vD;const ux=de(yD);function l_(e,t,r){return t===!0?ux(e,r):Q(t)?ux(e,t):e}function Pi(e){"@babel/helpers - typeof";return Pi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pi(e)}var gD=["ref"];function dx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Lr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?dx(Object(r),!0).forEach(function(n){Bd(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dx(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fx(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u_(n.key),n)}}function bD(e,t,r){return t&&fx(e.prototype,t),r&&fx(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function jD(e,t,r){return t=su(t),wD(e,c_()?Reflect.construct(t,r||[],su(e).constructor):t.apply(e,r))}function wD(e,t){if(t&&(Pi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return SD(e)}function SD(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(c_=function(){return!!e})()}function su(e){return su=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},su(e)}function _D(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mp(e,t)}function Mp(e,t){return Mp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Mp(e,t)}function Bd(e,t,r){return t=u_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u_(e){var t=kD(e,"string");return Pi(t)=="symbol"?t:t+""}function kD(e,t){if(Pi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Pi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function OD(e,t){if(e==null)return{};var r=ND(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ND(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function PD(e){return e.value}function AD(e,t){if($.isValidElement(e))return $.cloneElement(e,t);if(typeof e=="function")return $.createElement(e,t);t.ref;var r=OD(t,gD);return $.createElement(ay,r)}var hx=1,mi=function(e){function t(){var r;xD(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=jD(this,t,[].concat(a)),Bd(r,"lastBoundingBox",{width:-1,height:-1}),r}return _D(t,e),bD(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();return n.height=this.wrapperNode.offsetHeight,n.width=this.wrapperNode.offsetWidth,n}return null}},{key:"updateBBox",value:function(){var n=this.props.onBBoxUpdate,a=this.getBBox();a?(Math.abs(a.width-this.lastBoundingBox.width)>hx||Math.abs(a.height-this.lastBoundingBox.height)>hx)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,n&&n(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Lr({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var a=this.props,i=a.layout,s=a.align,l=a.verticalAlign,c=a.margin,u=a.chartWidth,f=a.chartHeight,d,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(s==="center"&&i==="vertical"){var p=this.getBBoxSnapshot();d={left:((u||0)-p.width)/2}}else d=s==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(l==="middle"){var g=this.getBBoxSnapshot();h={top:((f||0)-g.height)/2}}else h=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Lr(Lr({},d),h)}},{key:"render",value:function(){var n=this,a=this.props,i=a.content,s=a.width,l=a.height,c=a.wrapperStyle,u=a.payloadUniqBy,f=a.payload,d=Lr(Lr({position:"absolute",width:s||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return $.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(p){n.wrapperNode=p}},AD(i,Lr(Lr({},this.props),{},{payload:l_(f,u,PD)})))}}],[{key:"getWithHeight",value:function(n,a){var i=Lr(Lr({},this.defaultProps),n.props),s=i.layout;return s==="vertical"&&U(n.props.height)?{height:n.props.height}:s==="horizontal"?{width:n.props.width||a}:null}}])}(P.PureComponent);Bd(mi,"displayName","Legend");Bd(mi,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var px=pl,CD=oy,ED=Et,mx=px?px.isConcatSpreadable:void 0;function $D(e){return ED(e)||CD(e)||!!(mx&&e&&e[mx])}var TD=$D,MD=XS,ID=TD;function d_(e,t,r,n,a){var i=-1,s=e.length;for(r||(r=ID),a||(a=[]);++i<s;){var l=e[i];t>0&&r(l)?t>1?d_(l,t-1,r,n,a):MD(a,l):n||(a[a.length]=l)}return a}var f_=d_;function LD(e){return function(t,r,n){for(var a=-1,i=Object(t),s=n(t),l=s.length;l--;){var c=s[e?l:++a];if(r(i[c],c,i)===!1)break}return t}}var DD=LD,RD=DD,BD=RD(),FD=BD,zD=FD,WD=Rd;function UD(e,t){return e&&zD(e,t,WD)}var h_=UD,HD=ml;function KD(e,t){return function(r,n){if(r==null)return r;if(!HD(r))return e(r,n);for(var a=r.length,i=t?a:-1,s=Object(r);(t?i--:++i<a)&&n(s[i],i,s)!==!1;);return r}}var VD=KD,GD=h_,YD=VD,qD=YD(GD),uy=qD,XD=uy,QD=ml;function JD(e,t){var r=-1,n=QD(e)?Array(e.length):[];return XD(e,function(a,i,s){n[++r]=t(a,i,s)}),n}var p_=JD;function ZD(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}var eR=ZD,vx=no;function tR(e,t){if(e!==t){var r=e!==void 0,n=e===null,a=e===e,i=vx(e),s=t!==void 0,l=t===null,c=t===t,u=vx(t);if(!l&&!u&&!i&&e>t||i&&s&&c&&!l&&!u||n&&s&&c||!r&&c||!a)return 1;if(!n&&!i&&!u&&e<t||u&&r&&a&&!n&&!i||l&&r&&a||!s&&a||!c)return-1}return 0}var rR=tR,nR=rR;function aR(e,t,r){for(var n=-1,a=e.criteria,i=t.criteria,s=a.length,l=r.length;++n<s;){var c=nR(a[n],i[n]);if(c){if(n>=l)return c;var u=r[n];return c*(u=="desc"?-1:1)}}return e.index-t.index}var iR=aR,Yf=Yv,oR=qv,sR=Mr,lR=p_,cR=eR,uR=ZS,dR=iR,fR=ho,hR=Et;function pR(e,t,r){t.length?t=Yf(t,function(i){return hR(i)?function(s){return oR(s,i.length===1?i[0]:i)}:i}):t=[fR];var n=-1;t=Yf(t,uR(sR));var a=lR(e,function(i,s,l){var c=Yf(t,function(u){return u(i)});return{criteria:c,index:++n,value:i}});return cR(a,function(i,s){return dR(i,s,r)})}var mR=pR;function vR(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var yR=vR,gR=yR,yx=Math.max;function xR(e,t,r){return t=yx(t===void 0?e.length-1:t,0),function(){for(var n=arguments,a=-1,i=yx(n.length-t,0),s=Array(i);++a<i;)s[a]=n[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=n[a];return l[t]=r(s),gR(e,this,l)}}var bR=xR;function jR(e){return function(){return e}}var wR=jR,SR=Ca,_R=function(){try{var e=SR(Object,"defineProperty");return e({},"",{}),e}catch{}}(),m_=_R,kR=wR,gx=m_,OR=ho,NR=gx?function(e,t){return gx(e,"toString",{configurable:!0,enumerable:!1,value:kR(t),writable:!0})}:OR,PR=NR,AR=800,CR=16,ER=Date.now;function $R(e){var t=0,r=0;return function(){var n=ER(),a=CR-(n-r);if(r=n,a>0){if(++t>=AR)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var TR=$R,MR=PR,IR=TR,LR=IR(MR),DR=LR,RR=ho,BR=bR,FR=DR;function zR(e,t){return FR(BR(e,t,RR),e+"")}var WR=zR,UR=Hv,HR=ml,KR=sy,VR=Fn;function GR(e,t,r){if(!VR(r))return!1;var n=typeof t;return(n=="number"?HR(r)&&KR(t,r.length):n=="string"&&t in r)?UR(r[t],e):!1}var Fd=GR,YR=f_,qR=mR,XR=WR,xx=Fd,QR=XR(function(e,t){if(e==null)return[];var r=t.length;return r>1&&xx(e,t[0],t[1])?t=[]:r>2&&xx(t[0],t[1],t[2])&&(t=[t[0]]),qR(e,YR(t,1),[])}),JR=QR;const dy=de(JR);function Ns(e){"@babel/helpers - typeof";return Ns=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ns(e)}function Ip(){return Ip=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ip.apply(this,arguments)}function ZR(e,t){return nB(e)||rB(e,t)||tB(e,t)||eB()}function eB(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tB(e,t){if(e){if(typeof e=="string")return bx(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return bx(e,t)}}function bx(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function rB(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function nB(e){if(Array.isArray(e))return e}function jx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function qf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?jx(Object(r),!0).forEach(function(n){aB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jx(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function aB(e,t,r){return t=iB(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iB(e){var t=oB(e,"string");return Ns(t)=="symbol"?t:t+""}function oB(e,t){if(Ns(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ns(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sB(e){return Array.isArray(e)&&qe(e[0])&&qe(e[1])?e.join(" ~ "):e}var lB=function(t){var r=t.separator,n=r===void 0?" : ":r,a=t.contentStyle,i=a===void 0?{}:a,s=t.itemStyle,l=s===void 0?{}:s,c=t.labelStyle,u=c===void 0?{}:c,f=t.payload,d=t.formatter,h=t.itemSorter,p=t.wrapperClassName,g=t.labelClassName,y=t.label,b=t.labelFormatter,v=t.accessibilityLayer,m=v===void 0?!1:v,x=function(){if(f&&f.length){var T={padding:0,margin:0},D=(h?dy(f,h):f).map(function(A,L){if(A.type==="none")return null;var C=qf({display:"block",paddingTop:4,paddingBottom:4,color:A.color||"#000"},l),M=A.formatter||d||sB,I=A.value,R=A.name,F=I,K=R;if(M&&F!=null&&K!=null){var z=M(I,R,A,L,f);if(Array.isArray(z)){var q=ZR(z,2);F=q[0],K=q[1]}else F=z}return $.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(L),style:C},qe(K)?$.createElement("span",{className:"recharts-tooltip-item-name"},K):null,qe(K)?$.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,$.createElement("span",{className:"recharts-tooltip-item-value"},F),$.createElement("span",{className:"recharts-tooltip-item-unit"},A.unit||""))});return $.createElement("ul",{className:"recharts-tooltip-item-list",style:T},D)}return null},S=qf({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),j=qf({margin:0},u),w=!te(y),_=w?y:"",O=ee("recharts-default-tooltip",p),N=ee("recharts-tooltip-label",g);w&&b&&f!==void 0&&f!==null&&(_=b(y,f));var k=m?{role:"status","aria-live":"assertive"}:{};return $.createElement("div",Ip({className:O,style:S},k),$.createElement("p",{className:N,style:j},$.isValidElement(_)?_:"".concat(_)),x())};function Ps(e){"@babel/helpers - typeof";return Ps=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ps(e)}function Vl(e,t,r){return t=cB(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cB(e){var t=uB(e,"string");return Ps(t)=="symbol"?t:t+""}function uB(e,t){if(Ps(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ps(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var No="recharts-tooltip-wrapper",dB={visibility:"hidden"};function fB(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return ee(No,Vl(Vl(Vl(Vl({},"".concat(No,"-right"),U(r)&&t&&U(t.x)&&r>=t.x),"".concat(No,"-left"),U(r)&&t&&U(t.x)&&r<t.x),"".concat(No,"-bottom"),U(n)&&t&&U(t.y)&&n>=t.y),"".concat(No,"-top"),U(n)&&t&&U(t.y)&&n<t.y))}function wx(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.key,a=e.offsetTopLeft,i=e.position,s=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(i&&U(i[n]))return i[n];var f=r[n]-l-a,d=r[n]+a;if(t[n])return s[n]?f:d;if(s[n]){var h=f,p=c[n];return h<p?Math.max(d,c[n]):Math.max(f,c[n])}var g=d+l,y=c[n]+u;return g>y?Math.max(f,c[n]):Math.max(d,c[n])}function hB(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function pB(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,a=e.position,i=e.reverseDirection,s=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,f,d;return s.height>0&&s.width>0&&r?(f=wx({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:s.width,viewBox:c,viewBoxDimension:c.width}),d=wx({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:s.height,viewBox:c,viewBoxDimension:c.height}),u=hB({translateX:f,translateY:d,useTranslate3d:l})):u=dB,{cssProperties:u,cssClasses:fB({translateX:f,translateY:d,coordinate:r})}}function Ai(e){"@babel/helpers - typeof";return Ai=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ai(e)}function Sx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function _x(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Sx(Object(r),!0).forEach(function(n){Dp(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Sx(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function mB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vB(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,y_(n.key),n)}}function yB(e,t,r){return t&&vB(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function gB(e,t,r){return t=lu(t),xB(e,v_()?Reflect.construct(t,r||[],lu(e).constructor):t.apply(e,r))}function xB(e,t){if(t&&(Ai(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bB(e)}function bB(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(v_=function(){return!!e})()}function lu(e){return lu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},lu(e)}function jB(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lp(e,t)}function Lp(e,t){return Lp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Lp(e,t)}function Dp(e,t,r){return t=y_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y_(e){var t=wB(e,"string");return Ai(t)=="symbol"?t:t+""}function wB(e,t){if(Ai(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ai(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var kx=1,SB=function(e){function t(){var r;mB(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=gB(this,t,[].concat(a)),Dp(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),Dp(r,"handleKeyDown",function(s){if(s.key==="Escape"){var l,c,u,f;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=r.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(f=r.props.coordinate)===null||f===void 0?void 0:f.y)!==null&&u!==void 0?u:0}})}}),r}return jB(t,e),yB(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>kx||Math.abs(n.height-this.state.lastBoundingBox.height)>kx)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,a=this.props,i=a.active,s=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.children,f=a.coordinate,d=a.hasPayload,h=a.isAnimationActive,p=a.offset,g=a.position,y=a.reverseDirection,b=a.useTranslate3d,v=a.viewBox,m=a.wrapperStyle,x=pB({allowEscapeViewBox:s,coordinate:f,offsetTopLeft:p,position:g,reverseDirection:y,tooltipBox:this.state.lastBoundingBox,useTranslate3d:b,viewBox:v}),S=x.cssClasses,j=x.cssProperties,w=_x(_x({transition:h&&i?"transform ".concat(l,"ms ").concat(c):void 0},j),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&d?"visible":"hidden",position:"absolute",top:0,left:0},m);return $.createElement("div",{tabIndex:-1,className:S,style:w,ref:function(O){n.wrapperNode=O}},u)}}])}(P.PureComponent),_B=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},zn={isSsr:_B()};function Ci(e){"@babel/helpers - typeof";return Ci=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ci(e)}function Ox(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Nx(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ox(Object(r),!0).forEach(function(n){fy(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ox(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function kB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OB(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,x_(n.key),n)}}function NB(e,t,r){return t&&OB(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function PB(e,t,r){return t=cu(t),AB(e,g_()?Reflect.construct(t,r||[],cu(e).constructor):t.apply(e,r))}function AB(e,t){if(t&&(Ci(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return CB(e)}function CB(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(g_=function(){return!!e})()}function cu(e){return cu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},cu(e)}function EB(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Rp(e,t)}function Rp(e,t){return Rp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Rp(e,t)}function fy(e,t,r){return t=x_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function x_(e){var t=$B(e,"string");return Ci(t)=="symbol"?t:t+""}function $B(e,t){if(Ci(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ci(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function TB(e){return e.dataKey}function MB(e,t){return $.isValidElement(e)?$.cloneElement(e,t):typeof e=="function"?$.createElement(e,t):$.createElement(lB,t)}var Ge=function(e){function t(){return kB(this,t),PB(this,t,arguments)}return EB(t,e),NB(t,[{key:"render",value:function(){var n=this,a=this.props,i=a.active,s=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.content,f=a.coordinate,d=a.filterNull,h=a.isAnimationActive,p=a.offset,g=a.payload,y=a.payloadUniqBy,b=a.position,v=a.reverseDirection,m=a.useTranslate3d,x=a.viewBox,S=a.wrapperStyle,j=g??[];d&&j.length&&(j=l_(g.filter(function(_){return _.value!=null&&(_.hide!==!0||n.props.includeHidden)}),y,TB));var w=j.length>0;return $.createElement(SB,{allowEscapeViewBox:s,animationDuration:l,animationEasing:c,isAnimationActive:h,active:i,coordinate:f,hasPayload:w,offset:p,position:b,reverseDirection:v,useTranslate3d:m,viewBox:x,wrapperStyle:S},MB(u,Nx(Nx({},this.props),{},{payload:j})))}}])}(P.PureComponent);fy(Ge,"displayName","Tooltip");fy(Ge,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!zn.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var IB=Tr,LB=function(){return IB.Date.now()},DB=LB,RB=/\s/;function BB(e){for(var t=e.length;t--&&RB.test(e.charAt(t)););return t}var FB=BB,zB=FB,WB=/^\s+/;function UB(e){return e&&e.slice(0,zB(e)+1).replace(WB,"")}var HB=UB,KB=HB,Px=Fn,VB=no,Ax=NaN,GB=/^[-+]0x[0-9a-f]+$/i,YB=/^0b[01]+$/i,qB=/^0o[0-7]+$/i,XB=parseInt;function QB(e){if(typeof e=="number")return e;if(VB(e))return Ax;if(Px(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Px(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=KB(e);var r=YB.test(e);return r||qB.test(e)?XB(e.slice(2),r?2:8):GB.test(e)?Ax:+e}var b_=QB,JB=Fn,Xf=DB,Cx=b_,ZB="Expected a function",eF=Math.max,tF=Math.min;function rF(e,t,r){var n,a,i,s,l,c,u=0,f=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(ZB);t=Cx(t)||0,JB(r)&&(f=!!r.leading,d="maxWait"in r,i=d?eF(Cx(r.maxWait)||0,t):i,h="trailing"in r?!!r.trailing:h);function p(w){var _=n,O=a;return n=a=void 0,u=w,s=e.apply(O,_),s}function g(w){return u=w,l=setTimeout(v,t),f?p(w):s}function y(w){var _=w-c,O=w-u,N=t-_;return d?tF(N,i-O):N}function b(w){var _=w-c,O=w-u;return c===void 0||_>=t||_<0||d&&O>=i}function v(){var w=Xf();if(b(w))return m(w);l=setTimeout(v,y(w))}function m(w){return l=void 0,h&&n?p(w):(n=a=void 0,s)}function x(){l!==void 0&&clearTimeout(l),u=0,n=c=a=l=void 0}function S(){return l===void 0?s:m(Xf())}function j(){var w=Xf(),_=b(w);if(n=arguments,a=this,c=w,_){if(l===void 0)return g(c);if(d)return clearTimeout(l),l=setTimeout(v,t),p(c)}return l===void 0&&(l=setTimeout(v,t)),s}return j.cancel=x,j.flush=S,j}var nF=rF,aF=nF,iF=Fn,oF="Expected a function";function sF(e,t,r){var n=!0,a=!0;if(typeof e!="function")throw new TypeError(oF);return iF(r)&&(n="leading"in r?!!r.leading:n,a="trailing"in r?!!r.trailing:a),aF(e,t,{leading:n,maxWait:t,trailing:a})}var lF=sF;const j_=de(lF);function As(e){"@babel/helpers - typeof";return As=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},As(e)}function Ex(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Gl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ex(Object(r),!0).forEach(function(n){cF(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ex(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cF(e,t,r){return t=uF(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uF(e){var t=dF(e,"string");return As(t)=="symbol"?t:t+""}function dF(e,t){if(As(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(As(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fF(e,t){return vF(e)||mF(e,t)||pF(e,t)||hF()}function hF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pF(e,t){if(e){if(typeof e=="string")return $x(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $x(e,t)}}function $x(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function mF(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function vF(e){if(Array.isArray(e))return e}var er=P.forwardRef(function(e,t){var r=e.aspect,n=e.initialDimension,a=n===void 0?{width:-1,height:-1}:n,i=e.width,s=i===void 0?"100%":i,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,f=u===void 0?0:u,d=e.minHeight,h=e.maxHeight,p=e.children,g=e.debounce,y=g===void 0?0:g,b=e.id,v=e.className,m=e.onResize,x=e.style,S=x===void 0?{}:x,j=P.useRef(null),w=P.useRef();w.current=m,P.useImperativeHandle(t,function(){return Object.defineProperty(j.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),j.current},configurable:!0})});var _=P.useState({containerWidth:a.width,containerHeight:a.height}),O=fF(_,2),N=O[0],k=O[1],E=P.useCallback(function(D,A){k(function(L){var C=Math.round(D),M=Math.round(A);return L.containerWidth===C&&L.containerHeight===M?L:{containerWidth:C,containerHeight:M}})},[]);P.useEffect(function(){var D=function(R){var F,K=R[0].contentRect,z=K.width,q=K.height;E(z,q),(F=w.current)===null||F===void 0||F.call(w,z,q)};y>0&&(D=j_(D,y,{trailing:!0,leading:!1}));var A=new ResizeObserver(D),L=j.current.getBoundingClientRect(),C=L.width,M=L.height;return E(C,M),A.observe(j.current),function(){A.disconnect()}},[E,y]);var T=P.useMemo(function(){var D=N.containerWidth,A=N.containerHeight;if(D<0||A<0)return null;vr(ia(s)||ia(c),`The width(%s) and height(%s) are both fixed numbers,
- maybe you don't need to use a ResponsiveContainer.`,s,c),vr(!r||r>0,"The aspect(%s) must be greater than zero.",r);var L=ia(s)?D:s,C=ia(c)?A:c;r&&r>0&&(L?C=L/r:C&&(L=C*r),h&&C>h&&(C=h)),vr(L>0||C>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.`,L,C,s,c,f,d,r);var M=!Array.isArray(p)&&Gr(p.type).endsWith("Chart");return $.Children.map(p,function(I){return $.isValidElement(I)?P.cloneElement(I,Gl({width:L,height:C},M?{style:Gl({height:"100%",width:"100%",maxHeight:C,maxWidth:L},I.props.style)}:{})):I})},[r,p,c,h,d,f,N,s]);return $.createElement("div",{id:b?"".concat(b):void 0,className:ee("recharts-responsive-container",v),style:Gl(Gl({},S),{},{width:s,height:c,minWidth:f,minHeight:d,maxHeight:h}),ref:j},T)}),gr=function(t){return null};gr.displayName="Cell";function Cs(e){"@babel/helpers - typeof";return Cs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cs(e)}function Tx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Bp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Tx(Object(r),!0).forEach(function(n){yF(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tx(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function yF(e,t,r){return t=gF(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gF(e){var t=xF(e,"string");return Cs(t)=="symbol"?t:t+""}function xF(e,t){if(Cs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Cs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Da={widthCache:{},cacheCount:0},bF=2e3,jF={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Mx="recharts_measurement_span";function wF(e){var t=Bp({},e);return Object.keys(t).forEach(function(r){t[r]||delete t[r]}),t}var es=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||zn.isSsr)return{width:0,height:0};var n=wF(r),a=JSON.stringify({text:t,copyStyle:n});if(Da.widthCache[a])return Da.widthCache[a];try{var i=document.getElementById(Mx);i||(i=document.createElement("span"),i.setAttribute("id",Mx),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var s=Bp(Bp({},jF),n);Object.assign(i.style,s),i.textContent="".concat(t);var l=i.getBoundingClientRect(),c={width:l.width,height:l.height};return Da.widthCache[a]=c,++Da.cacheCount>bF&&(Da.cacheCount=0,Da.widthCache={}),c}catch{return{width:0,height:0}}},SF=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Es(e){"@babel/helpers - typeof";return Es=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Es(e)}function uu(e,t){return NF(e)||OF(e,t)||kF(e,t)||_F()}function _F(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kF(e,t){if(e){if(typeof e=="string")return Ix(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ix(e,t)}}function Ix(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function OF(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function NF(e){if(Array.isArray(e))return e}function PF(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lx(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,CF(n.key),n)}}function AF(e,t,r){return t&&Lx(e.prototype,t),r&&Lx(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function CF(e){var t=EF(e,"string");return Es(t)=="symbol"?t:t+""}function EF(e,t){if(Es(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Es(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Dx=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Rx=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,$F=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,TF=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,w_={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},MF=Object.keys(w_),ni="NaN";function IF(e,t){return e*w_[t]}var Yl=function(){function e(t,r){PF(this,e),this.num=t,this.unit=r,this.num=t,this.unit=r,Number.isNaN(t)&&(this.unit=""),r!==""&&!$F.test(r)&&(this.num=NaN,this.unit=""),MF.includes(r)&&(this.num=IF(t,r),this.unit="px")}return AF(e,[{key:"add",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num+r.num,this.unit)}},{key:"subtract",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num-r.num,this.unit)}},{key:"multiply",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num*r.num,this.unit||r.unit)}},{key:"divide",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num/r.num,this.unit||r.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(r){var n,a=(n=TF.exec(r))!==null&&n!==void 0?n:[],i=uu(a,3),s=i[1],l=i[2];return new e(parseFloat(s),l??"")}}])}();function S_(e){if(e.includes(ni))return ni;for(var t=e;t.includes("*")||t.includes("/");){var r,n=(r=Dx.exec(t))!==null&&r!==void 0?r:[],a=uu(n,4),i=a[1],s=a[2],l=a[3],c=Yl.parse(i??""),u=Yl.parse(l??""),f=s==="*"?c.multiply(u):c.divide(u);if(f.isNaN())return ni;t=t.replace(Dx,f.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,h=(d=Rx.exec(t))!==null&&d!==void 0?d:[],p=uu(h,4),g=p[1],y=p[2],b=p[3],v=Yl.parse(g??""),m=Yl.parse(b??""),x=y==="+"?v.add(m):v.subtract(m);if(x.isNaN())return ni;t=t.replace(Rx,x.toString())}return t}var Bx=/\(([^()]*)\)/;function LF(e){for(var t=e;t.includes("(");){var r=Bx.exec(t),n=uu(r,2),a=n[1];t=t.replace(Bx,S_(a))}return t}function DF(e){var t=e.replace(/\s+/g,"");return t=LF(t),t=S_(t),t}function RF(e){try{return DF(e)}catch{return ni}}function Qf(e){var t=RF(e.slice(5,-1));return t===ni?"":t}var BF=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],FF=["dx","dy","angle","className","breakAll"];function Fp(){return Fp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fp.apply(this,arguments)}function Fx(e,t){if(e==null)return{};var r=zF(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zF(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function zx(e,t){return KF(e)||HF(e,t)||UF(e,t)||WF()}function WF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UF(e,t){if(e){if(typeof e=="string")return Wx(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Wx(e,t)}}function Wx(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function HF(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function KF(e){if(Array.isArray(e))return e}var __=/[ \f\n\r\t\v\u2028\u2029]+/,k_=function(t){var r=t.children,n=t.breakAll,a=t.style;try{var i=[];te(r)||(n?i=r.toString().split(""):i=r.toString().split(__));var s=i.map(function(c){return{word:c,width:es(c,a).width}}),l=n?0:es(" ",a).width;return{wordsWithComputedWidth:s,spaceWidth:l}}catch{return null}},VF=function(t,r,n,a,i){var s=t.maxLines,l=t.children,c=t.style,u=t.breakAll,f=U(s),d=l,h=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return L.reduce(function(C,M){var I=M.word,R=M.width,F=C[C.length-1];if(F&&(a==null||i||F.width+R+n<Number(a)))F.words.push(I),F.width+=R+n;else{var K={words:[I],width:R};C.push(K)}return C},[])},p=h(r),g=function(L){return L.reduce(function(C,M){return C.width>M.width?C:M})};if(!f)return p;for(var y="…",b=function(L){var C=d.slice(0,L),M=k_({breakAll:u,style:c,children:C+y}).wordsWithComputedWidth,I=h(M),R=I.length>s||g(I).width>Number(a);return[R,I]},v=0,m=d.length-1,x=0,S;v<=m&&x<=d.length-1;){var j=Math.floor((v+m)/2),w=j-1,_=b(w),O=zx(_,2),N=O[0],k=O[1],E=b(j),T=zx(E,1),D=T[0];if(!N&&!D&&(v=j+1),N&&D&&(m=j-1),!N&&D){S=k;break}x++}return S||p},Ux=function(t){var r=te(t)?[]:t.toString().split(__);return[{words:r}]},GF=function(t){var r=t.width,n=t.scaleToFit,a=t.children,i=t.style,s=t.breakAll,l=t.maxLines;if((r||n)&&!zn.isSsr){var c,u,f=k_({breakAll:s,children:a,style:i});if(f){var d=f.wordsWithComputedWidth,h=f.spaceWidth;c=d,u=h}else return Ux(a);return VF({breakAll:s,children:a,maxLines:l,style:i},c,u,r,n)}return Ux(a)},Hx="#808080",wa=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,s=t.lineHeight,l=s===void 0?"1em":s,c=t.capHeight,u=c===void 0?"0.71em":c,f=t.scaleToFit,d=f===void 0?!1:f,h=t.textAnchor,p=h===void 0?"start":h,g=t.verticalAnchor,y=g===void 0?"end":g,b=t.fill,v=b===void 0?Hx:b,m=Fx(t,BF),x=P.useMemo(function(){return GF({breakAll:m.breakAll,children:m.children,maxLines:m.maxLines,scaleToFit:d,style:m.style,width:m.width})},[m.breakAll,m.children,m.maxLines,d,m.style,m.width]),S=m.dx,j=m.dy,w=m.angle,_=m.className,O=m.breakAll,N=Fx(m,FF);if(!qe(n)||!qe(i))return null;var k=n+(U(S)?S:0),E=i+(U(j)?j:0),T;switch(y){case"start":T=Qf("calc(".concat(u,")"));break;case"middle":T=Qf("calc(".concat((x.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:T=Qf("calc(".concat(x.length-1," * -").concat(l,")"));break}var D=[];if(d){var A=x[0].width,L=m.width;D.push("scale(".concat((U(L)?L/A:1)/A,")"))}return w&&D.push("rotate(".concat(w,", ").concat(k,", ").concat(E,")")),D.length&&(N.transform=D.join(" ")),$.createElement("text",Fp({},X(N,!0),{x:k,y:E,className:ee("recharts-text",_),textAnchor:p,fill:v.includes("url")?Hx:v}),x.map(function(C,M){var I=C.words.join(O?"":" ");return $.createElement("tspan",{x:k,dy:M===0?T:l,key:"".concat(I,"-").concat(M)},I)}))};function Tn(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function YF(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function hy(e){let t,r,n;e.length!==2?(t=Tn,r=(l,c)=>Tn(e(l),c),n=(l,c)=>e(l)-c):(t=e===Tn||e===YF?e:qF,r=e,n=e);function a(l,c,u=0,f=l.length){if(u<f){if(t(c,c)!==0)return f;do{const d=u+f>>>1;r(l[d],c)<0?u=d+1:f=d}while(u<f)}return u}function i(l,c,u=0,f=l.length){if(u<f){if(t(c,c)!==0)return f;do{const d=u+f>>>1;r(l[d],c)<=0?u=d+1:f=d}while(u<f)}return u}function s(l,c,u=0,f=l.length){const d=a(l,c,u,f-1);return d>u&&n(l[d-1],c)>-n(l[d],c)?d-1:d}return{left:a,center:s,right:i}}function qF(){return 0}function O_(e){return e===null?NaN:+e}function*XF(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const QF=hy(Tn),vl=QF.right;hy(O_).center;class Kx extends Map{constructor(t,r=e9){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,a]of t)this.set(n,a)}get(t){return super.get(Vx(this,t))}has(t){return super.has(Vx(this,t))}set(t,r){return super.set(JF(this,t),r)}delete(t){return super.delete(ZF(this,t))}}function Vx({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function JF({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function ZF({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function e9(e){return e!==null&&typeof e=="object"?e.valueOf():e}function t9(e=Tn){if(e===Tn)return N_;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function N_(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const r9=Math.sqrt(50),n9=Math.sqrt(10),a9=Math.sqrt(2);function du(e,t,r){const n=(t-e)/Math.max(0,r),a=Math.floor(Math.log10(n)),i=n/Math.pow(10,a),s=i>=r9?10:i>=n9?5:i>=a9?2:1;let l,c,u;return a<0?(u=Math.pow(10,-a)/s,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,a)*s,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=r&&r<2?du(e,t,r*2):[l,c,u]}function zp(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[a,i,s]=n?du(t,e,r):du(e,t,r);if(!(i>=a))return[];const l=i-a+1,c=new Array(l);if(n)if(s<0)for(let u=0;u<l;++u)c[u]=(i-u)/-s;else for(let u=0;u<l;++u)c[u]=(i-u)*s;else if(s<0)for(let u=0;u<l;++u)c[u]=(a+u)/-s;else for(let u=0;u<l;++u)c[u]=(a+u)*s;return c}function Wp(e,t,r){return t=+t,e=+e,r=+r,du(e,t,r)[2]}function Up(e,t,r){t=+t,e=+e,r=+r;const n=t<e,a=n?Wp(t,e,r):Wp(e,t,r);return(n?-1:1)*(a<0?1/-a:a)}function Gx(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function Yx(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function P_(e,t,r=0,n=1/0,a){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(a=a===void 0?N_:t9(a);n>r;){if(n-r>600){const c=n-r+1,u=t-r+1,f=Math.log(c),d=.5*Math.exp(2*f/3),h=.5*Math.sqrt(f*d*(c-d)/c)*(u-c/2<0?-1:1),p=Math.max(r,Math.floor(t-u*d/c+h)),g=Math.min(n,Math.floor(t+(c-u)*d/c+h));P_(e,t,p,g,a)}const i=e[t];let s=r,l=n;for(Po(e,r,t),a(e[n],i)>0&&Po(e,r,n);s<l;){for(Po(e,s,l),++s,--l;a(e[s],i)<0;)++s;for(;a(e[l],i)>0;)--l}a(e[r],i)===0?Po(e,r,l):(++l,Po(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function Po(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function i9(e,t,r){if(e=Float64Array.from(XF(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Yx(e);if(t>=1)return Gx(e);var n,a=(n-1)*t,i=Math.floor(a),s=Gx(P_(e,i).subarray(0,i+1)),l=Yx(e.subarray(i+1));return s+(l-s)*(a-i)}}function o9(e,t,r=O_){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,a=(n-1)*t,i=Math.floor(a),s=+r(e[i],i,e),l=+r(e[i+1],i+1,e);return s+(l-s)*(a-i)}}function s9(e,t,r){e=+e,t=+t,r=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+r;for(var n=-1,a=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(a);++n<a;)i[n]=e+n*r;return i}function ar(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function sn(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const Hp=Symbol("implicit");function py(){var e=new Kx,t=[],r=[],n=Hp;function a(i){let s=e.get(i);if(s===void 0){if(n!==Hp)return n;e.set(i,s=t.push(i)-1)}return r[s%r.length]}return a.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new Kx;for(const s of i)e.has(s)||e.set(s,t.push(s)-1);return a},a.range=function(i){return arguments.length?(r=Array.from(i),a):r.slice()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return py(t,r).unknown(n)},ar.apply(a,arguments),a}function $s(){var e=py().unknown(void 0),t=e.domain,r=e.range,n=0,a=1,i,s,l=!1,c=0,u=0,f=.5;delete e.unknown;function d(){var h=t().length,p=a<n,g=p?a:n,y=p?n:a;i=(y-g)/Math.max(1,h-c+u*2),l&&(i=Math.floor(i)),g+=(y-g-i*(h-c))*f,s=i*(1-c),l&&(g=Math.round(g),s=Math.round(s));var b=s9(h).map(function(v){return g+i*v});return r(p?b.reverse():b)}return e.domain=function(h){return arguments.length?(t(h),d()):t()},e.range=function(h){return arguments.length?([n,a]=h,n=+n,a=+a,d()):[n,a]},e.rangeRound=function(h){return[n,a]=h,n=+n,a=+a,l=!0,d()},e.bandwidth=function(){return s},e.step=function(){return i},e.round=function(h){return arguments.length?(l=!!h,d()):l},e.padding=function(h){return arguments.length?(c=Math.min(1,u=+h),d()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),d()):c},e.paddingOuter=function(h){return arguments.length?(u=+h,d()):u},e.align=function(h){return arguments.length?(f=Math.max(0,Math.min(1,h)),d()):f},e.copy=function(){return $s(t(),[n,a]).round(l).paddingInner(c).paddingOuter(u).align(f)},ar.apply(d(),arguments)}function A_(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return A_(t())},e}function ts(){return A_($s.apply(null,arguments).paddingInner(1))}function my(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function C_(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function yl(){}var Ts=.7,fu=1/Ts,vi="\\s*([+-]?\\d+)\\s*",Ms="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ar="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",l9=/^#([0-9a-f]{3,8})$/,c9=new RegExp(`^rgb\\(${vi},${vi},${vi}\\)$`),u9=new RegExp(`^rgb\\(${Ar},${Ar},${Ar}\\)$`),d9=new RegExp(`^rgba\\(${vi},${vi},${vi},${Ms}\\)$`),f9=new RegExp(`^rgba\\(${Ar},${Ar},${Ar},${Ms}\\)$`),h9=new RegExp(`^hsl\\(${Ms},${Ar},${Ar}\\)$`),p9=new RegExp(`^hsla\\(${Ms},${Ar},${Ar},${Ms}\\)$`),qx={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};my(yl,Is,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Xx,formatHex:Xx,formatHex8:m9,formatHsl:v9,formatRgb:Qx,toString:Qx});function Xx(){return this.rgb().formatHex()}function m9(){return this.rgb().formatHex8()}function v9(){return E_(this).formatHsl()}function Qx(){return this.rgb().formatRgb()}function Is(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=l9.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Jx(t):r===3?new Nt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?ql(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?ql(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=c9.exec(e))?new Nt(t[1],t[2],t[3],1):(t=u9.exec(e))?new Nt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=d9.exec(e))?ql(t[1],t[2],t[3],t[4]):(t=f9.exec(e))?ql(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=h9.exec(e))?tb(t[1],t[2]/100,t[3]/100,1):(t=p9.exec(e))?tb(t[1],t[2]/100,t[3]/100,t[4]):qx.hasOwnProperty(e)?Jx(qx[e]):e==="transparent"?new Nt(NaN,NaN,NaN,0):null}function Jx(e){return new Nt(e>>16&255,e>>8&255,e&255,1)}function ql(e,t,r,n){return n<=0&&(e=t=r=NaN),new Nt(e,t,r,n)}function y9(e){return e instanceof yl||(e=Is(e)),e?(e=e.rgb(),new Nt(e.r,e.g,e.b,e.opacity)):new Nt}function Kp(e,t,r,n){return arguments.length===1?y9(e):new Nt(e,t,r,n??1)}function Nt(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}my(Nt,Kp,C_(yl,{brighter(e){return e=e==null?fu:Math.pow(fu,e),new Nt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ts:Math.pow(Ts,e),new Nt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Nt(ha(this.r),ha(this.g),ha(this.b),hu(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:Zx,formatHex:Zx,formatHex8:g9,formatRgb:eb,toString:eb}));function Zx(){return`#${oa(this.r)}${oa(this.g)}${oa(this.b)}`}function g9(){return`#${oa(this.r)}${oa(this.g)}${oa(this.b)}${oa((isNaN(this.opacity)?1:this.opacity)*255)}`}function eb(){const e=hu(this.opacity);return`${e===1?"rgb(":"rgba("}${ha(this.r)}, ${ha(this.g)}, ${ha(this.b)}${e===1?")":`, ${e})`}`}function hu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ha(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function oa(e){return e=ha(e),(e<16?"0":"")+e.toString(16)}function tb(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new hr(e,t,r,n)}function E_(e){if(e instanceof hr)return new hr(e.h,e.s,e.l,e.opacity);if(e instanceof yl||(e=Is(e)),!e)return new hr;if(e instanceof hr)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),i=Math.max(t,r,n),s=NaN,l=i-a,c=(i+a)/2;return l?(t===i?s=(r-n)/l+(r<n)*6:r===i?s=(n-t)/l+2:s=(t-r)/l+4,l/=c<.5?i+a:2-i-a,s*=60):l=c>0&&c<1?0:s,new hr(s,l,c,e.opacity)}function x9(e,t,r,n){return arguments.length===1?E_(e):new hr(e,t,r,n??1)}function hr(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}my(hr,x9,C_(yl,{brighter(e){return e=e==null?fu:Math.pow(fu,e),new hr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ts:Math.pow(Ts,e),new hr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,a=2*r-n;return new Nt(Jf(e>=240?e-240:e+120,a,n),Jf(e,a,n),Jf(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new hr(rb(this.h),Xl(this.s),Xl(this.l),hu(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=hu(this.opacity);return`${e===1?"hsl(":"hsla("}${rb(this.h)}, ${Xl(this.s)*100}%, ${Xl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function rb(e){return e=(e||0)%360,e<0?e+360:e}function Xl(e){return Math.max(0,Math.min(1,e||0))}function Jf(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const vy=e=>()=>e;function b9(e,t){return function(r){return e+r*t}}function j9(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function w9(e){return(e=+e)==1?$_:function(t,r){return r-t?j9(t,r,e):vy(isNaN(t)?r:t)}}function $_(e,t){var r=t-e;return r?b9(e,r):vy(isNaN(e)?t:e)}const nb=function e(t){var r=w9(t);function n(a,i){var s=r((a=Kp(a)).r,(i=Kp(i)).r),l=r(a.g,i.g),c=r(a.b,i.b),u=$_(a.opacity,i.opacity);return function(f){return a.r=s(f),a.g=l(f),a.b=c(f),a.opacity=u(f),a+""}}return n.gamma=e,n}(1);function S9(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),a;return function(i){for(a=0;a<r;++a)n[a]=e[a]*(1-i)+t[a]*i;return n}}function _9(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function k9(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,a=new Array(n),i=new Array(r),s;for(s=0;s<n;++s)a[s]=po(e[s],t[s]);for(;s<r;++s)i[s]=t[s];return function(l){for(s=0;s<n;++s)i[s]=a[s](l);return i}}function O9(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function pu(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function N9(e,t){var r={},n={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?r[a]=po(e[a],t[a]):n[a]=t[a];return function(i){for(a in r)n[a]=r[a](i);return n}}var Vp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Zf=new RegExp(Vp.source,"g");function P9(e){return function(){return e}}function A9(e){return function(t){return e(t)+""}}function C9(e,t){var r=Vp.lastIndex=Zf.lastIndex=0,n,a,i,s=-1,l=[],c=[];for(e=e+"",t=t+"";(n=Vp.exec(e))&&(a=Zf.exec(t));)(i=a.index)>r&&(i=t.slice(r,i),l[s]?l[s]+=i:l[++s]=i),(n=n[0])===(a=a[0])?l[s]?l[s]+=a:l[++s]=a:(l[++s]=null,c.push({i:s,x:pu(n,a)})),r=Zf.lastIndex;return r<t.length&&(i=t.slice(r),l[s]?l[s]+=i:l[++s]=i),l.length<2?c[0]?A9(c[0].x):P9(t):(t=c.length,function(u){for(var f=0,d;f<t;++f)l[(d=c[f]).i]=d.x(u);return l.join("")})}function po(e,t){var r=typeof t,n;return t==null||r==="boolean"?vy(t):(r==="number"?pu:r==="string"?(n=Is(t))?(t=n,nb):C9:t instanceof Is?nb:t instanceof Date?O9:_9(t)?S9:Array.isArray(t)?k9:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?N9:pu)(e,t)}function yy(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function E9(e,t){t===void 0&&(t=e,e=po);for(var r=0,n=t.length-1,a=t[0],i=new Array(n<0?0:n);r<n;)i[r]=e(a,a=t[++r]);return function(s){var l=Math.max(0,Math.min(n-1,Math.floor(s*=n)));return i[l](s-l)}}function $9(e){return function(){return e}}function mu(e){return+e}var ab=[0,1];function xt(e){return e}function Gp(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:$9(isNaN(t)?NaN:.5)}function T9(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function M9(e,t,r){var n=e[0],a=e[1],i=t[0],s=t[1];return a<n?(n=Gp(a,n),i=r(s,i)):(n=Gp(n,a),i=r(i,s)),function(l){return i(n(l))}}function I9(e,t,r){var n=Math.min(e.length,t.length)-1,a=new Array(n),i=new Array(n),s=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<n;)a[s]=Gp(e[s],e[s+1]),i[s]=r(t[s],t[s+1]);return function(l){var c=vl(e,l,1,n)-1;return i[c](a[c](l))}}function gl(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function zd(){var e=ab,t=ab,r=po,n,a,i,s=xt,l,c,u;function f(){var h=Math.min(e.length,t.length);return s!==xt&&(s=T9(e[0],e[h-1])),l=h>2?I9:M9,c=u=null,d}function d(h){return h==null||isNaN(h=+h)?i:(c||(c=l(e.map(n),t,r)))(n(s(h)))}return d.invert=function(h){return s(a((u||(u=l(t,e.map(n),pu)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,mu),f()):e.slice()},d.range=function(h){return arguments.length?(t=Array.from(h),f()):t.slice()},d.rangeRound=function(h){return t=Array.from(h),r=yy,f()},d.clamp=function(h){return arguments.length?(s=h?!0:xt,f()):s!==xt},d.interpolate=function(h){return arguments.length?(r=h,f()):r},d.unknown=function(h){return arguments.length?(i=h,d):i},function(h,p){return n=h,a=p,f()}}function gy(){return zd()(xt,xt)}function L9(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function vu(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Ei(e){return e=vu(Math.abs(e)),e?e[1]:NaN}function D9(e,t){return function(r,n){for(var a=r.length,i=[],s=0,l=e[0],c=0;a>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),i.push(r.substring(a-=l,a+l)),!((c+=l+1)>n));)l=e[s=(s+1)%e.length];return i.reverse().join(t)}}function R9(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var B9=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ls(e){if(!(t=B9.exec(e)))throw new Error("invalid format: "+e);var t;return new xy({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]})}Ls.prototype=xy.prototype;function xy(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+""}xy.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 F9(e){e:for(var t=e.length,r=1,n=-1,a;r<t;++r)switch(e[r]){case".":n=a=r;break;case"0":n===0&&(n=r),a=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(a+1):e}var yu;function z9(e,t){var r=vu(e,t);if(!r)return yu=void 0,e.toPrecision(t);var n=r[0],a=r[1],i=a-(yu=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,s=n.length;return i===s?n:i>s?n+new Array(i-s+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+vu(e,Math.max(0,t+i-1))[0]}function ib(e,t){var r=vu(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const ob={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:L9,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)=>ib(e*100,t),r:ib,s:z9,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function sb(e){return e}var lb=Array.prototype.map,cb=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function W9(e){var t=e.grouping===void 0||e.thousands===void 0?sb:D9(lb.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?sb:R9(lb.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(d,h){d=Ls(d);var p=d.fill,g=d.align,y=d.sign,b=d.symbol,v=d.zero,m=d.width,x=d.comma,S=d.precision,j=d.trim,w=d.type;w==="n"?(x=!0,w="g"):ob[w]||(S===void 0&&(S=12),j=!0,w="g"),(v||p==="0"&&g==="=")&&(v=!0,p="0",g="=");var _=(h&&h.prefix!==void 0?h.prefix:"")+(b==="$"?r:b==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():""),O=(b==="$"?n:/[%p]/.test(w)?s:"")+(h&&h.suffix!==void 0?h.suffix:""),N=ob[w],k=/[defgprs%]/.test(w);S=S===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function E(T){var D=_,A=O,L,C,M;if(w==="c")A=N(T)+A,T="";else{T=+T;var I=T<0||1/T<0;if(T=isNaN(T)?c:N(Math.abs(T),S),j&&(T=F9(T)),I&&+T==0&&y!=="+"&&(I=!1),D=(I?y==="("?y:l:y==="-"||y==="("?"":y)+D,A=(w==="s"&&!isNaN(T)&&yu!==void 0?cb[8+yu/3]:"")+A+(I&&y==="("?")":""),k){for(L=-1,C=T.length;++L<C;)if(M=T.charCodeAt(L),48>M||M>57){A=(M===46?a+T.slice(L+1):T.slice(L))+A,T=T.slice(0,L);break}}}x&&!v&&(T=t(T,1/0));var R=D.length+T.length+A.length,F=R<m?new Array(m-R+1).join(p):"";switch(x&&v&&(T=t(F+T,F.length?m-A.length:1/0),F=""),g){case"<":T=D+T+A+F;break;case"=":T=D+F+T+A;break;case"^":T=F.slice(0,R=F.length>>1)+D+T+A+F.slice(R);break;default:T=F+D+T+A;break}return i(T)}return E.toString=function(){return d+""},E}function f(d,h){var p=Math.max(-8,Math.min(8,Math.floor(Ei(h)/3)))*3,g=Math.pow(10,-p),y=u((d=Ls(d),d.type="f",d),{suffix:cb[8+p/3]});return function(b){return y(g*b)}}return{format:u,formatPrefix:f}}var Ql,by,T_;U9({thousands:",",grouping:[3],currency:["$",""]});function U9(e){return Ql=W9(e),by=Ql.format,T_=Ql.formatPrefix,Ql}function H9(e){return Math.max(0,-Ei(Math.abs(e)))}function K9(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ei(t)/3)))*3-Ei(Math.abs(e)))}function V9(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ei(t)-Ei(e))+1}function M_(e,t,r,n){var a=Up(e,t,r),i;switch(n=Ls(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=K9(a,s))&&(n.precision=i),T_(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=V9(a,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=H9(a))&&(n.precision=i-(n.type==="%")*2);break}}return by(n)}function Wn(e){var t=e.domain;return e.ticks=function(r){var n=t();return zp(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var a=t();return M_(a[0],a[a.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),a=0,i=n.length-1,s=n[a],l=n[i],c,u,f=10;for(l<s&&(u=s,s=l,l=u,u=a,a=i,i=u);f-- >0;){if(u=Wp(s,l,r),u===c)return n[a]=s,n[i]=l,t(n);if(u>0)s=Math.floor(s/u)*u,l=Math.ceil(l/u)*u;else if(u<0)s=Math.ceil(s*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function gu(){var e=gy();return e.copy=function(){return gl(e,gu())},ar.apply(e,arguments),Wn(e)}function I_(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,mu),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return I_(e).unknown(t)},e=arguments.length?Array.from(e,mu):[0,1],Wn(r)}function L_(e,t){e=e.slice();var r=0,n=e.length-1,a=e[r],i=e[n],s;return i<a&&(s=r,r=n,n=s,s=a,a=i,i=s),e[r]=t.floor(a),e[n]=t.ceil(i),e}function ub(e){return Math.log(e)}function db(e){return Math.exp(e)}function G9(e){return-Math.log(-e)}function Y9(e){return-Math.exp(-e)}function q9(e){return isFinite(e)?+("1e"+e):e<0?0:e}function X9(e){return e===10?q9:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Q9(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 fb(e){return(t,r)=>-e(-t,r)}function jy(e){const t=e(ub,db),r=t.domain;let n=10,a,i;function s(){return a=Q9(n),i=X9(n),r()[0]<0?(a=fb(a),i=fb(i),e(G9,Y9)):e(ub,db),t}return t.base=function(l){return arguments.length?(n=+l,s()):n},t.domain=function(l){return arguments.length?(r(l),s()):r()},t.ticks=l=>{const c=r();let u=c[0],f=c[c.length-1];const d=f<u;d&&([u,f]=[f,u]);let h=a(u),p=a(f),g,y;const b=l==null?10:+l;let v=[];if(!(n%1)&&p-h<b){if(h=Math.floor(h),p=Math.ceil(p),u>0){for(;h<=p;++h)for(g=1;g<n;++g)if(y=h<0?g/i(-h):g*i(h),!(y<u)){if(y>f)break;v.push(y)}}else for(;h<=p;++h)for(g=n-1;g>=1;--g)if(y=h>0?g/i(-h):g*i(h),!(y<u)){if(y>f)break;v.push(y)}v.length*2<b&&(v=zp(u,f,b))}else v=zp(h,p,Math.min(p-h,b)).map(i);return d?v.reverse():v},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=Ls(c)).precision==null&&(c.trim=!0),c=by(c)),l===1/0)return c;const u=Math.max(1,n*l/t.ticks().length);return f=>{let d=f/i(Math.round(a(f)));return d*n<n-.5&&(d*=n),d<=u?c(f):""}},t.nice=()=>r(L_(r(),{floor:l=>i(Math.floor(a(l))),ceil:l=>i(Math.ceil(a(l)))})),t}function D_(){const e=jy(zd()).domain([1,10]);return e.copy=()=>gl(e,D_()).base(e.base()),ar.apply(e,arguments),e}function hb(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function pb(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function wy(e){var t=1,r=e(hb(t),pb(t));return r.constant=function(n){return arguments.length?e(hb(t=+n),pb(t)):t},Wn(r)}function R_(){var e=wy(zd());return e.copy=function(){return gl(e,R_()).constant(e.constant())},ar.apply(e,arguments)}function mb(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function J9(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Z9(e){return e<0?-e*e:e*e}function Sy(e){var t=e(xt,xt),r=1;function n(){return r===1?e(xt,xt):r===.5?e(J9,Z9):e(mb(r),mb(1/r))}return t.exponent=function(a){return arguments.length?(r=+a,n()):r},Wn(t)}function _y(){var e=Sy(zd());return e.copy=function(){return gl(e,_y()).exponent(e.exponent())},ar.apply(e,arguments),e}function e7(){return _y.apply(null,arguments).exponent(.5)}function vb(e){return Math.sign(e)*e*e}function t7(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function B_(){var e=gy(),t=[0,1],r=!1,n;function a(i){var s=t7(e(i));return isNaN(s)?n:r?Math.round(s):s}return a.invert=function(i){return e.invert(vb(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,mu)).map(vb)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(r=!!i,a):r},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return B_(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},ar.apply(a,arguments),Wn(a)}function F_(){var e=[],t=[],r=[],n;function a(){var s=0,l=Math.max(1,t.length);for(r=new Array(l-1);++s<l;)r[s-1]=o9(e,s/l);return i}function i(s){return s==null||isNaN(s=+s)?n:t[vl(r,s)]}return i.invertExtent=function(s){var l=t.indexOf(s);return l<0?[NaN,NaN]:[l>0?r[l-1]:e[0],l<r.length?r[l]:e[e.length-1]]},i.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let l of s)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Tn),a()},i.range=function(s){return arguments.length?(t=Array.from(s),a()):t.slice()},i.unknown=function(s){return arguments.length?(n=s,i):n},i.quantiles=function(){return r.slice()},i.copy=function(){return F_().domain(e).range(t).unknown(n)},ar.apply(i,arguments)}function z_(){var e=0,t=1,r=1,n=[.5],a=[0,1],i;function s(c){return c!=null&&c<=c?a[vl(n,c,0,r)]:i}function l(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*t-(c-r)*e)/(r+1);return s}return s.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},s.range=function(c){return arguments.length?(r=(a=Array.from(c)).length-1,l()):a.slice()},s.invertExtent=function(c){var u=a.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,n[0]]:u>=r?[n[r-1],t]:[n[u-1],n[u]]},s.unknown=function(c){return arguments.length&&(i=c),s},s.thresholds=function(){return n.slice()},s.copy=function(){return z_().domain([e,t]).range(a).unknown(i)},ar.apply(Wn(s),arguments)}function W_(){var e=[.5],t=[0,1],r,n=1;function a(i){return i!=null&&i<=i?t[vl(e,i,0,n)]:r}return a.domain=function(i){return arguments.length?(e=Array.from(i),n=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),n=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var s=t.indexOf(i);return[e[s-1],e[s]]},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return W_().domain(e).range(t).unknown(r)},ar.apply(a,arguments)}const eh=new Date,th=new Date;function Xe(e,t,r,n){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const s=a(i),l=a.ceil(i);return i-s<l-i?s:l},a.offset=(i,s)=>(t(i=new Date(+i),s==null?1:Math.floor(s)),i),a.range=(i,s,l)=>{const c=[];if(i=a.ceil(i),l=l==null?1:Math.floor(l),!(i<s)||!(l>0))return c;let u;do c.push(u=new Date(+i)),t(i,l),e(i);while(u<i&&i<s);return c},a.filter=i=>Xe(s=>{if(s>=s)for(;e(s),!i(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;t(s,-1),!i(s););else for(;--l>=0;)for(;t(s,1),!i(s););}),r&&(a.count=(i,s)=>(eh.setTime(+i),th.setTime(+s),e(eh),e(th),Math.floor(r(eh,th))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(n?s=>n(s)%i===0:s=>a.count(0,s)%i===0):a)),a}const xu=Xe(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);xu.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Xe(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):xu);xu.range;const Ur=1e3,Xt=Ur*60,Hr=Xt*60,en=Hr*24,ky=en*7,yb=en*30,rh=en*365,sa=Xe(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ur)},(e,t)=>(t-e)/Ur,e=>e.getUTCSeconds());sa.range;const Oy=Xe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ur)},(e,t)=>{e.setTime(+e+t*Xt)},(e,t)=>(t-e)/Xt,e=>e.getMinutes());Oy.range;const Ny=Xe(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Xt)},(e,t)=>(t-e)/Xt,e=>e.getUTCMinutes());Ny.range;const Py=Xe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ur-e.getMinutes()*Xt)},(e,t)=>{e.setTime(+e+t*Hr)},(e,t)=>(t-e)/Hr,e=>e.getHours());Py.range;const Ay=Xe(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Hr)},(e,t)=>(t-e)/Hr,e=>e.getUTCHours());Ay.range;const xl=Xe(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Xt)/en,e=>e.getDate()-1);xl.range;const Wd=Xe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/en,e=>e.getUTCDate()-1);Wd.range;const U_=Xe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/en,e=>Math.floor(e/en));U_.range;function Ea(e){return Xe(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Xt)/ky)}const Ud=Ea(0),bu=Ea(1),r7=Ea(2),n7=Ea(3),$i=Ea(4),a7=Ea(5),i7=Ea(6);Ud.range;bu.range;r7.range;n7.range;$i.range;a7.range;i7.range;function $a(e){return Xe(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/ky)}const Hd=$a(0),ju=$a(1),o7=$a(2),s7=$a(3),Ti=$a(4),l7=$a(5),c7=$a(6);Hd.range;ju.range;o7.range;s7.range;Ti.range;l7.range;c7.range;const Cy=Xe(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());Cy.range;const Ey=Xe(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());Ey.range;const tn=Xe(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());tn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Xe(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});tn.range;const rn=Xe(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());rn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Xe(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});rn.range;function H_(e,t,r,n,a,i){const s=[[sa,1,Ur],[sa,5,5*Ur],[sa,15,15*Ur],[sa,30,30*Ur],[i,1,Xt],[i,5,5*Xt],[i,15,15*Xt],[i,30,30*Xt],[a,1,Hr],[a,3,3*Hr],[a,6,6*Hr],[a,12,12*Hr],[n,1,en],[n,2,2*en],[r,1,ky],[t,1,yb],[t,3,3*yb],[e,1,rh]];function l(u,f,d){const h=f<u;h&&([u,f]=[f,u]);const p=d&&typeof d.range=="function"?d:c(u,f,d),g=p?p.range(u,+f+1):[];return h?g.reverse():g}function c(u,f,d){const h=Math.abs(f-u)/d,p=hy(([,,b])=>b).right(s,h);if(p===s.length)return e.every(Up(u/rh,f/rh,d));if(p===0)return xu.every(Math.max(Up(u,f,d),1));const[g,y]=s[h/s[p-1][2]<s[p][2]/h?p-1:p];return g.every(y)}return[l,c]}const[u7,d7]=H_(rn,Ey,Hd,U_,Ay,Ny),[f7,h7]=H_(tn,Cy,Ud,xl,Py,Oy);function nh(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function ah(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Ao(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function p7(e){var t=e.dateTime,r=e.date,n=e.time,a=e.periods,i=e.days,s=e.shortDays,l=e.months,c=e.shortMonths,u=Co(a),f=Eo(a),d=Co(i),h=Eo(i),p=Co(s),g=Eo(s),y=Co(l),b=Eo(l),v=Co(c),m=Eo(c),x={a:M,A:I,b:R,B:F,c:null,d:Sb,e:Sb,f:D7,g:G7,G:q7,H:M7,I:I7,j:L7,L:K_,m:R7,M:B7,p:K,q:z,Q:Ob,s:Nb,S:F7,u:z7,U:W7,V:U7,w:H7,W:K7,x:null,X:null,y:V7,Y:Y7,Z:X7,"%":kb},S={a:q,A:ie,b:he,B:ge,c:null,d:_b,e:_b,f:ez,g:uz,G:fz,H:Q7,I:J7,j:Z7,L:G_,m:tz,M:rz,p:Qe,q:Ae,Q:Ob,s:Nb,S:nz,u:az,U:iz,V:oz,w:sz,W:lz,x:null,X:null,y:cz,Y:dz,Z:hz,"%":kb},j={a:k,A:E,b:T,B:D,c:A,d:jb,e:jb,f:C7,g:bb,G:xb,H:wb,I:wb,j:O7,L:A7,m:k7,M:N7,p:N,q:_7,Q:$7,s:T7,S:P7,u:x7,U:b7,V:j7,w:g7,W:w7,x:L,X:C,y:bb,Y:xb,Z:S7,"%":E7};x.x=w(r,x),x.X=w(n,x),x.c=w(t,x),S.x=w(r,S),S.X=w(n,S),S.c=w(t,S);function w(V,Z){return function(re){var W=[],Te=-1,oe=0,We=V.length,Ue,St,ln;for(re instanceof Date||(re=new Date(+re));++Te<We;)V.charCodeAt(Te)===37&&(W.push(V.slice(oe,Te)),(St=gb[Ue=V.charAt(++Te)])!=null?Ue=V.charAt(++Te):St=Ue==="e"?" ":"0",(ln=Z[Ue])&&(Ue=ln(re,St)),W.push(Ue),oe=Te+1);return W.push(V.slice(oe,Te)),W.join("")}}function _(V,Z){return function(re){var W=Ao(1900,void 0,1),Te=O(W,V,re+="",0),oe,We;if(Te!=re.length)return null;if("Q"in W)return new Date(W.Q);if("s"in W)return new Date(W.s*1e3+("L"in W?W.L:0));if(Z&&!("Z"in W)&&(W.Z=0),"p"in W&&(W.H=W.H%12+W.p*12),W.m===void 0&&(W.m="q"in W?W.q:0),"V"in W){if(W.V<1||W.V>53)return null;"w"in W||(W.w=1),"Z"in W?(oe=ah(Ao(W.y,0,1)),We=oe.getUTCDay(),oe=We>4||We===0?ju.ceil(oe):ju(oe),oe=Wd.offset(oe,(W.V-1)*7),W.y=oe.getUTCFullYear(),W.m=oe.getUTCMonth(),W.d=oe.getUTCDate()+(W.w+6)%7):(oe=nh(Ao(W.y,0,1)),We=oe.getDay(),oe=We>4||We===0?bu.ceil(oe):bu(oe),oe=xl.offset(oe,(W.V-1)*7),W.y=oe.getFullYear(),W.m=oe.getMonth(),W.d=oe.getDate()+(W.w+6)%7)}else("W"in W||"U"in W)&&("w"in W||(W.w="u"in W?W.u%7:"W"in W?1:0),We="Z"in W?ah(Ao(W.y,0,1)).getUTCDay():nh(Ao(W.y,0,1)).getDay(),W.m=0,W.d="W"in W?(W.w+6)%7+W.W*7-(We+5)%7:W.w+W.U*7-(We+6)%7);return"Z"in W?(W.H+=W.Z/100|0,W.M+=W.Z%100,ah(W)):nh(W)}}function O(V,Z,re,W){for(var Te=0,oe=Z.length,We=re.length,Ue,St;Te<oe;){if(W>=We)return-1;if(Ue=Z.charCodeAt(Te++),Ue===37){if(Ue=Z.charAt(Te++),St=j[Ue in gb?Z.charAt(Te++):Ue],!St||(W=St(V,re,W))<0)return-1}else if(Ue!=re.charCodeAt(W++))return-1}return W}function N(V,Z,re){var W=u.exec(Z.slice(re));return W?(V.p=f.get(W[0].toLowerCase()),re+W[0].length):-1}function k(V,Z,re){var W=p.exec(Z.slice(re));return W?(V.w=g.get(W[0].toLowerCase()),re+W[0].length):-1}function E(V,Z,re){var W=d.exec(Z.slice(re));return W?(V.w=h.get(W[0].toLowerCase()),re+W[0].length):-1}function T(V,Z,re){var W=v.exec(Z.slice(re));return W?(V.m=m.get(W[0].toLowerCase()),re+W[0].length):-1}function D(V,Z,re){var W=y.exec(Z.slice(re));return W?(V.m=b.get(W[0].toLowerCase()),re+W[0].length):-1}function A(V,Z,re){return O(V,t,Z,re)}function L(V,Z,re){return O(V,r,Z,re)}function C(V,Z,re){return O(V,n,Z,re)}function M(V){return s[V.getDay()]}function I(V){return i[V.getDay()]}function R(V){return c[V.getMonth()]}function F(V){return l[V.getMonth()]}function K(V){return a[+(V.getHours()>=12)]}function z(V){return 1+~~(V.getMonth()/3)}function q(V){return s[V.getUTCDay()]}function ie(V){return i[V.getUTCDay()]}function he(V){return c[V.getUTCMonth()]}function ge(V){return l[V.getUTCMonth()]}function Qe(V){return a[+(V.getUTCHours()>=12)]}function Ae(V){return 1+~~(V.getUTCMonth()/3)}return{format:function(V){var Z=w(V+="",x);return Z.toString=function(){return V},Z},parse:function(V){var Z=_(V+="",!1);return Z.toString=function(){return V},Z},utcFormat:function(V){var Z=w(V+="",S);return Z.toString=function(){return V},Z},utcParse:function(V){var Z=_(V+="",!0);return Z.toString=function(){return V},Z}}}var gb={"-":"",_:" ",0:"0"},at=/^\s*\d+/,m7=/^%/,v7=/[\\^$*+?|[\]().{}]/g;function le(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",i=a.length;return n+(i<r?new Array(r-i+1).join(t)+a:a)}function y7(e){return e.replace(v7,"\\$&")}function Co(e){return new RegExp("^(?:"+e.map(y7).join("|")+")","i")}function Eo(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function g7(e,t,r){var n=at.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function x7(e,t,r){var n=at.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function b7(e,t,r){var n=at.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function j7(e,t,r){var n=at.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function w7(e,t,r){var n=at.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function xb(e,t,r){var n=at.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function bb(e,t,r){var n=at.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function S7(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function _7(e,t,r){var n=at.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function k7(e,t,r){var n=at.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function jb(e,t,r){var n=at.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function O7(e,t,r){var n=at.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function wb(e,t,r){var n=at.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function N7(e,t,r){var n=at.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function P7(e,t,r){var n=at.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function A7(e,t,r){var n=at.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function C7(e,t,r){var n=at.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function E7(e,t,r){var n=m7.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function $7(e,t,r){var n=at.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function T7(e,t,r){var n=at.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function Sb(e,t){return le(e.getDate(),t,2)}function M7(e,t){return le(e.getHours(),t,2)}function I7(e,t){return le(e.getHours()%12||12,t,2)}function L7(e,t){return le(1+xl.count(tn(e),e),t,3)}function K_(e,t){return le(e.getMilliseconds(),t,3)}function D7(e,t){return K_(e,t)+"000"}function R7(e,t){return le(e.getMonth()+1,t,2)}function B7(e,t){return le(e.getMinutes(),t,2)}function F7(e,t){return le(e.getSeconds(),t,2)}function z7(e){var t=e.getDay();return t===0?7:t}function W7(e,t){return le(Ud.count(tn(e)-1,e),t,2)}function V_(e){var t=e.getDay();return t>=4||t===0?$i(e):$i.ceil(e)}function U7(e,t){return e=V_(e),le($i.count(tn(e),e)+(tn(e).getDay()===4),t,2)}function H7(e){return e.getDay()}function K7(e,t){return le(bu.count(tn(e)-1,e),t,2)}function V7(e,t){return le(e.getFullYear()%100,t,2)}function G7(e,t){return e=V_(e),le(e.getFullYear()%100,t,2)}function Y7(e,t){return le(e.getFullYear()%1e4,t,4)}function q7(e,t){var r=e.getDay();return e=r>=4||r===0?$i(e):$i.ceil(e),le(e.getFullYear()%1e4,t,4)}function X7(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+le(t/60|0,"0",2)+le(t%60,"0",2)}function _b(e,t){return le(e.getUTCDate(),t,2)}function Q7(e,t){return le(e.getUTCHours(),t,2)}function J7(e,t){return le(e.getUTCHours()%12||12,t,2)}function Z7(e,t){return le(1+Wd.count(rn(e),e),t,3)}function G_(e,t){return le(e.getUTCMilliseconds(),t,3)}function ez(e,t){return G_(e,t)+"000"}function tz(e,t){return le(e.getUTCMonth()+1,t,2)}function rz(e,t){return le(e.getUTCMinutes(),t,2)}function nz(e,t){return le(e.getUTCSeconds(),t,2)}function az(e){var t=e.getUTCDay();return t===0?7:t}function iz(e,t){return le(Hd.count(rn(e)-1,e),t,2)}function Y_(e){var t=e.getUTCDay();return t>=4||t===0?Ti(e):Ti.ceil(e)}function oz(e,t){return e=Y_(e),le(Ti.count(rn(e),e)+(rn(e).getUTCDay()===4),t,2)}function sz(e){return e.getUTCDay()}function lz(e,t){return le(ju.count(rn(e)-1,e),t,2)}function cz(e,t){return le(e.getUTCFullYear()%100,t,2)}function uz(e,t){return e=Y_(e),le(e.getUTCFullYear()%100,t,2)}function dz(e,t){return le(e.getUTCFullYear()%1e4,t,4)}function fz(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Ti(e):Ti.ceil(e),le(e.getUTCFullYear()%1e4,t,4)}function hz(){return"+0000"}function kb(){return"%"}function Ob(e){return+e}function Nb(e){return Math.floor(+e/1e3)}var Ra,q_,X_;pz({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 pz(e){return Ra=p7(e),q_=Ra.format,Ra.parse,X_=Ra.utcFormat,Ra.utcParse,Ra}function mz(e){return new Date(e)}function vz(e){return e instanceof Date?+e:+new Date(+e)}function $y(e,t,r,n,a,i,s,l,c,u){var f=gy(),d=f.invert,h=f.domain,p=u(".%L"),g=u(":%S"),y=u("%I:%M"),b=u("%I %p"),v=u("%a %d"),m=u("%b %d"),x=u("%B"),S=u("%Y");function j(w){return(c(w)<w?p:l(w)<w?g:s(w)<w?y:i(w)<w?b:n(w)<w?a(w)<w?v:m:r(w)<w?x:S)(w)}return f.invert=function(w){return new Date(d(w))},f.domain=function(w){return arguments.length?h(Array.from(w,vz)):h().map(mz)},f.ticks=function(w){var _=h();return e(_[0],_[_.length-1],w??10)},f.tickFormat=function(w,_){return _==null?j:u(_)},f.nice=function(w){var _=h();return(!w||typeof w.range!="function")&&(w=t(_[0],_[_.length-1],w??10)),w?h(L_(_,w)):f},f.copy=function(){return gl(f,$y(e,t,r,n,a,i,s,l,c,u))},f}function yz(){return ar.apply($y(f7,h7,tn,Cy,Ud,xl,Py,Oy,sa,q_).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function gz(){return ar.apply($y(u7,d7,rn,Ey,Hd,Wd,Ay,Ny,sa,X_).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Kd(){var e=0,t=1,r,n,a,i,s=xt,l=!1,c;function u(d){return d==null||isNaN(d=+d)?c:s(a===0?.5:(d=(i(d)-r)*a,l?Math.max(0,Math.min(1,d)):d))}u.domain=function(d){return arguments.length?([e,t]=d,r=i(e=+e),n=i(t=+t),a=r===n?0:1/(n-r),u):[e,t]},u.clamp=function(d){return arguments.length?(l=!!d,u):l},u.interpolator=function(d){return arguments.length?(s=d,u):s};function f(d){return function(h){var p,g;return arguments.length?([p,g]=h,s=d(p,g),u):[s(0),s(1)]}}return u.range=f(po),u.rangeRound=f(yy),u.unknown=function(d){return arguments.length?(c=d,u):c},function(d){return i=d,r=d(e),n=d(t),a=r===n?0:1/(n-r),u}}function Un(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Q_(){var e=Wn(Kd()(xt));return e.copy=function(){return Un(e,Q_())},sn.apply(e,arguments)}function J_(){var e=jy(Kd()).domain([1,10]);return e.copy=function(){return Un(e,J_()).base(e.base())},sn.apply(e,arguments)}function Z_(){var e=wy(Kd());return e.copy=function(){return Un(e,Z_()).constant(e.constant())},sn.apply(e,arguments)}function Ty(){var e=Sy(Kd());return e.copy=function(){return Un(e,Ty()).exponent(e.exponent())},sn.apply(e,arguments)}function xz(){return Ty.apply(null,arguments).exponent(.5)}function ek(){var e=[],t=xt;function r(n){if(n!=null&&!isNaN(n=+n))return t((vl(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let a of n)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(Tn),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,a)=>t(a/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(a,i)=>i9(e,i/n))},r.copy=function(){return ek(t).domain(e)},sn.apply(r,arguments)}function Vd(){var e=0,t=.5,r=1,n=1,a,i,s,l,c,u=xt,f,d=!1,h;function p(y){return isNaN(y=+y)?h:(y=.5+((y=+f(y))-i)*(n*y<n*i?l:c),u(d?Math.max(0,Math.min(1,y)):y))}p.domain=function(y){return arguments.length?([e,t,r]=y,a=f(e=+e),i=f(t=+t),s=f(r=+r),l=a===i?0:.5/(i-a),c=i===s?0:.5/(s-i),n=i<a?-1:1,p):[e,t,r]},p.clamp=function(y){return arguments.length?(d=!!y,p):d},p.interpolator=function(y){return arguments.length?(u=y,p):u};function g(y){return function(b){var v,m,x;return arguments.length?([v,m,x]=b,u=E9(y,[v,m,x]),p):[u(0),u(.5),u(1)]}}return p.range=g(po),p.rangeRound=g(yy),p.unknown=function(y){return arguments.length?(h=y,p):h},function(y){return f=y,a=y(e),i=y(t),s=y(r),l=a===i?0:.5/(i-a),c=i===s?0:.5/(s-i),n=i<a?-1:1,p}}function tk(){var e=Wn(Vd()(xt));return e.copy=function(){return Un(e,tk())},sn.apply(e,arguments)}function rk(){var e=jy(Vd()).domain([.1,1,10]);return e.copy=function(){return Un(e,rk()).base(e.base())},sn.apply(e,arguments)}function nk(){var e=wy(Vd());return e.copy=function(){return Un(e,nk()).constant(e.constant())},sn.apply(e,arguments)}function My(){var e=Sy(Vd());return e.copy=function(){return Un(e,My()).exponent(e.exponent())},sn.apply(e,arguments)}function bz(){return My.apply(null,arguments).exponent(.5)}const Pb=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:$s,scaleDiverging:tk,scaleDivergingLog:rk,scaleDivergingPow:My,scaleDivergingSqrt:bz,scaleDivergingSymlog:nk,scaleIdentity:I_,scaleImplicit:Hp,scaleLinear:gu,scaleLog:D_,scaleOrdinal:py,scalePoint:ts,scalePow:_y,scaleQuantile:F_,scaleQuantize:z_,scaleRadial:B_,scaleSequential:Q_,scaleSequentialLog:J_,scaleSequentialPow:Ty,scaleSequentialQuantile:ek,scaleSequentialSqrt:xz,scaleSequentialSymlog:Z_,scaleSqrt:e7,scaleSymlog:R_,scaleThreshold:W_,scaleTime:yz,scaleUtc:gz,tickFormat:M_},Symbol.toStringTag,{value:"Module"}));var jz=no;function wz(e,t,r){for(var n=-1,a=e.length;++n<a;){var i=e[n],s=t(i);if(s!=null&&(l===void 0?s===s&&!jz(s):r(s,l)))var l=s,c=i}return c}var Gd=wz;function Sz(e,t){return e>t}var ak=Sz,_z=Gd,kz=ak,Oz=ho;function Nz(e){return e&&e.length?_z(e,Oz,kz):void 0}var Pz=Nz;const jn=de(Pz);function Az(e,t){return e<t}var ik=Az,Cz=Gd,Ez=ik,$z=ho;function Tz(e){return e&&e.length?Cz(e,$z,Ez):void 0}var Mz=Tz;const Yd=de(Mz);var Iz=Yv,Lz=Mr,Dz=p_,Rz=Et;function Bz(e,t){var r=Rz(e)?Iz:Dz;return r(e,Lz(t))}var Fz=Bz,zz=f_,Wz=Fz;function Uz(e,t){return zz(Wz(e,t),1)}var Hz=Uz;const Kz=de(Hz);var Vz=cy;function Gz(e,t){return Vz(e,t)}var Yz=Gz;const Sa=de(Yz);var mo=1e9,qz={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Ly,Pe=!0,tr="[DecimalError] ",pa=tr+"Invalid argument: ",Iy=tr+"Exponent out of range: ",vo=Math.floor,ea=Math.pow,Xz=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,It,Ze=1e7,_e=7,ok=9007199254740991,wu=vo(ok/_e),Y={};Y.absoluteValue=Y.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Y.comparedTo=Y.cmp=function(e){var t,r,n,a,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(n=i.d.length,a=e.d.length,t=0,r=n<a?n:a;t<r;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return n===a?0:n>a^i.s<0?1:-1};Y.decimalPlaces=Y.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*_e;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};Y.dividedBy=Y.div=function(e){return Yr(this,new this.constructor(e))};Y.dividedToIntegerBy=Y.idiv=function(e){var t=this,r=t.constructor;return ve(Yr(t,new r(e),0,1),r.precision)};Y.equals=Y.eq=function(e){return!this.cmp(e)};Y.exponent=function(){return ze(this)};Y.greaterThan=Y.gt=function(e){return this.cmp(e)>0};Y.greaterThanOrEqualTo=Y.gte=function(e){return this.cmp(e)>=0};Y.isInteger=Y.isint=function(){return this.e>this.d.length-2};Y.isNegative=Y.isneg=function(){return this.s<0};Y.isPositive=Y.ispos=function(){return this.s>0};Y.isZero=function(){return this.s===0};Y.lessThan=Y.lt=function(e){return this.cmp(e)<0};Y.lessThanOrEqualTo=Y.lte=function(e){return this.cmp(e)<1};Y.logarithm=Y.log=function(e){var t,r=this,n=r.constructor,a=n.precision,i=a+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(It))throw Error(tr+"NaN");if(r.s<1)throw Error(tr+(r.s?"NaN":"-Infinity"));return r.eq(It)?new n(0):(Pe=!1,t=Yr(Ds(r,i),Ds(e,i),i),Pe=!0,ve(t,a))};Y.minus=Y.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?ck(t,e):sk(t,(e.s=-e.s,e))};Y.modulo=Y.mod=function(e){var t,r=this,n=r.constructor,a=n.precision;if(e=new n(e),!e.s)throw Error(tr+"NaN");return r.s?(Pe=!1,t=Yr(r,e,0,1).times(e),Pe=!0,r.minus(t)):ve(new n(r),a)};Y.naturalExponential=Y.exp=function(){return lk(this)};Y.naturalLogarithm=Y.ln=function(){return Ds(this)};Y.negated=Y.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Y.plus=Y.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?sk(t,e):ck(t,(e.s=-e.s,e))};Y.precision=Y.sd=function(e){var t,r,n,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(pa+e);if(t=ze(a)+1,n=a.d.length-1,r=n*_e+1,n=a.d[n],n){for(;n%10==0;n/=10)r--;for(n=a.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};Y.squareRoot=Y.sqrt=function(){var e,t,r,n,a,i,s,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(tr+"NaN")}for(e=ze(l),Pe=!1,a=Math.sqrt(+l),a==0||a==1/0?(t=kr(l.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=vo((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(a.toString()),r=c.precision,a=s=r+3;;)if(i=n,n=i.plus(Yr(l,i,s+2)).times(.5),kr(i.d).slice(0,s)===(t=kr(n.d)).slice(0,s)){if(t=t.slice(s-3,s+1),a==s&&t=="4999"){if(ve(i,r+1,0),i.times(i).eq(l)){n=i;break}}else if(t!="9999")break;s+=4}return Pe=!0,ve(n,r)};Y.times=Y.mul=function(e){var t,r,n,a,i,s,l,c,u,f=this,d=f.constructor,h=f.d,p=(e=new d(e)).d;if(!f.s||!e.s)return new d(0);for(e.s*=f.s,r=f.e+e.e,c=h.length,u=p.length,c<u&&(i=h,h=p,p=i,s=c,c=u,u=s),i=[],s=c+u,n=s;n--;)i.push(0);for(n=u;--n>=0;){for(t=0,a=c+n;a>n;)l=i[a]+p[n]*h[a-n-1]+t,i[a--]=l%Ze|0,t=l/Ze|0;i[a]=(i[a]+t)%Ze|0}for(;!i[--s];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,Pe?ve(e,d.precision):e};Y.toDecimalPlaces=Y.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:($r(e,0,mo),t===void 0?t=n.rounding:$r(t,0,8),ve(r,e+ze(r)+1,t))};Y.toExponential=function(e,t){var r,n=this,a=n.constructor;return e===void 0?r=_a(n,!0):($r(e,0,mo),t===void 0?t=a.rounding:$r(t,0,8),n=ve(new a(n),e+1,t),r=_a(n,!0,e+1)),r};Y.toFixed=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?_a(a):($r(e,0,mo),t===void 0?t=i.rounding:$r(t,0,8),n=ve(new i(a),e+ze(a)+1,t),r=_a(n.abs(),!1,e+ze(n)+1),a.isneg()&&!a.isZero()?"-"+r:r)};Y.toInteger=Y.toint=function(){var e=this,t=e.constructor;return ve(new t(e),ze(e)+1,t.rounding)};Y.toNumber=function(){return+this};Y.toPower=Y.pow=function(e){var t,r,n,a,i,s,l=this,c=l.constructor,u=12,f=+(e=new c(e));if(!e.s)return new c(It);if(l=new c(l),!l.s){if(e.s<1)throw Error(tr+"Infinity");return l}if(l.eq(It))return l;if(n=c.precision,e.eq(It))return ve(l,n);if(t=e.e,r=e.d.length-1,s=t>=r,i=l.s,s){if((r=f<0?-f:f)<=ok){for(a=new c(It),t=Math.ceil(n/_e+4),Pe=!1;r%2&&(a=a.times(l),Cb(a.d,t)),r=vo(r/2),r!==0;)l=l.times(l),Cb(l.d,t);return Pe=!0,e.s<0?new c(It).div(a):ve(a,n)}}else if(i<0)throw Error(tr+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,Pe=!1,a=e.times(Ds(l,n+u)),Pe=!0,a=lk(a),a.s=i,a};Y.toPrecision=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?(r=ze(a),n=_a(a,r<=i.toExpNeg||r>=i.toExpPos)):($r(e,1,mo),t===void 0?t=i.rounding:$r(t,0,8),a=ve(new i(a),e,t),r=ze(a),n=_a(a,e<=r||r<=i.toExpNeg,e)),n};Y.toSignificantDigits=Y.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):($r(e,1,mo),t===void 0?t=n.rounding:$r(t,0,8)),ve(new n(r),e,t)};Y.toString=Y.valueOf=Y.val=Y.toJSON=Y[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=ze(e),r=e.constructor;return _a(e,t<=r.toExpNeg||t>=r.toExpPos)};function sk(e,t){var r,n,a,i,s,l,c,u,f=e.constructor,d=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),Pe?ve(t,d):t;if(c=e.d,u=t.d,s=e.e,a=t.e,c=c.slice(),i=s-a,i){for(i<0?(n=c,i=-i,l=u.length):(n=u,a=s,l=c.length),s=Math.ceil(d/_e),l=s>l?s+1:l+1,i>l&&(i=l,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(l=c.length,i=u.length,l-i<0&&(i=l,n=u,u=c,c=n),r=0;i;)r=(c[--i]=c[i]+u[i]+r)/Ze|0,c[i]%=Ze;for(r&&(c.unshift(r),++a),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=a,Pe?ve(t,d):t}function $r(e,t,r){if(e!==~~e||e<t||e>r)throw Error(pa+e)}function kr(e){var t,r,n,a=e.length-1,i="",s=e[0];if(a>0){for(i+=s,t=1;t<a;t++)n=e[t]+"",r=_e-n.length,r&&(i+=pn(r)),i+=n;s=e[t],n=s+"",r=_e-n.length,r&&(i+=pn(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return i+s}var Yr=function(){function e(n,a){var i,s=0,l=n.length;for(n=n.slice();l--;)i=n[l]*a+s,n[l]=i%Ze|0,s=i/Ze|0;return s&&n.unshift(s),n}function t(n,a,i,s){var l,c;if(i!=s)c=i>s?1:-1;else for(l=c=0;l<i;l++)if(n[l]!=a[l]){c=n[l]>a[l]?1:-1;break}return c}function r(n,a,i){for(var s=0;i--;)n[i]-=s,s=n[i]<a[i]?1:0,n[i]=s*Ze+n[i]-a[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,a,i,s){var l,c,u,f,d,h,p,g,y,b,v,m,x,S,j,w,_,O,N=n.constructor,k=n.s==a.s?1:-1,E=n.d,T=a.d;if(!n.s)return new N(n);if(!a.s)throw Error(tr+"Division by zero");for(c=n.e-a.e,_=T.length,j=E.length,p=new N(k),g=p.d=[],u=0;T[u]==(E[u]||0);)++u;if(T[u]>(E[u]||0)&&--c,i==null?m=i=N.precision:s?m=i+(ze(n)-ze(a))+1:m=i,m<0)return new N(0);if(m=m/_e+2|0,u=0,_==1)for(f=0,T=T[0],m++;(u<j||f)&&m--;u++)x=f*Ze+(E[u]||0),g[u]=x/T|0,f=x%T|0;else{for(f=Ze/(T[0]+1)|0,f>1&&(T=e(T,f),E=e(E,f),_=T.length,j=E.length),S=_,y=E.slice(0,_),b=y.length;b<_;)y[b++]=0;O=T.slice(),O.unshift(0),w=T[0],T[1]>=Ze/2&&++w;do f=0,l=t(T,y,_,b),l<0?(v=y[0],_!=b&&(v=v*Ze+(y[1]||0)),f=v/w|0,f>1?(f>=Ze&&(f=Ze-1),d=e(T,f),h=d.length,b=y.length,l=t(d,y,h,b),l==1&&(f--,r(d,_<h?O:T,h))):(f==0&&(l=f=1),d=T.slice()),h=d.length,h<b&&d.unshift(0),r(y,d,b),l==-1&&(b=y.length,l=t(T,y,_,b),l<1&&(f++,r(y,_<b?O:T,b))),b=y.length):l===0&&(f++,y=[0]),g[u++]=f,l&&y[0]?y[b++]=E[S]||0:(y=[E[S]],b=1);while((S++<j||y[0]!==void 0)&&m--)}return g[0]||g.shift(),p.e=c,ve(p,s?i+ze(p)+1:i)}}();function lk(e,t){var r,n,a,i,s,l,c=0,u=0,f=e.constructor,d=f.precision;if(ze(e)>16)throw Error(Iy+ze(e));if(!e.s)return new f(It);for(Pe=!1,l=d,s=new f(.03125);e.abs().gte(.1);)e=e.times(s),u+=5;for(n=Math.log(ea(2,u))/Math.LN10*2+5|0,l+=n,r=a=i=new f(It),f.precision=l;;){if(a=ve(a.times(e),l),r=r.times(++c),s=i.plus(Yr(a,r,l)),kr(s.d).slice(0,l)===kr(i.d).slice(0,l)){for(;u--;)i=ve(i.times(i),l);return f.precision=d,t==null?(Pe=!0,ve(i,d)):i}i=s}}function ze(e){for(var t=e.e*_e,r=e.d[0];r>=10;r/=10)t++;return t}function ih(e,t,r){if(t>e.LN10.sd())throw Pe=!0,r&&(e.precision=r),Error(tr+"LN10 precision limit exceeded");return ve(new e(e.LN10),t)}function pn(e){for(var t="";e--;)t+="0";return t}function Ds(e,t){var r,n,a,i,s,l,c,u,f,d=1,h=10,p=e,g=p.d,y=p.constructor,b=y.precision;if(p.s<1)throw Error(tr+(p.s?"NaN":"-Infinity"));if(p.eq(It))return new y(0);if(t==null?(Pe=!1,u=b):u=t,p.eq(10))return t==null&&(Pe=!0),ih(y,u);if(u+=h,y.precision=u,r=kr(g),n=r.charAt(0),i=ze(p),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=kr(p.d),n=r.charAt(0),d++;i=ze(p),n>1?(p=new y("0."+r),i++):p=new y(n+"."+r.slice(1))}else return c=ih(y,u+2,b).times(i+""),p=Ds(new y(n+"."+r.slice(1)),u-h).plus(c),y.precision=b,t==null?(Pe=!0,ve(p,b)):p;for(l=s=p=Yr(p.minus(It),p.plus(It),u),f=ve(p.times(p),u),a=3;;){if(s=ve(s.times(f),u),c=l.plus(Yr(s,new y(a),u)),kr(c.d).slice(0,u)===kr(l.d).slice(0,u))return l=l.times(2),i!==0&&(l=l.plus(ih(y,u+2,b).times(i+""))),l=Yr(l,new y(d),u),y.precision=b,t==null?(Pe=!0,ve(l,b)):l;l=c,a+=2}}function Ab(e,t){var r,n,a;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(n,a),t){if(a-=n,r=r-n-1,e.e=vo(r/_e),e.d=[],n=(r+1)%_e,r<0&&(n+=_e),n<a){for(n&&e.d.push(+t.slice(0,n)),a-=_e;n<a;)e.d.push(+t.slice(n,n+=_e));t=t.slice(n),n=_e-t.length}else n-=a;for(;n--;)t+="0";if(e.d.push(+t),Pe&&(e.e>wu||e.e<-wu))throw Error(Iy+r)}else e.s=0,e.e=0,e.d=[0];return e}function ve(e,t,r){var n,a,i,s,l,c,u,f,d=e.d;for(s=1,i=d[0];i>=10;i/=10)s++;if(n=t-s,n<0)n+=_e,a=t,u=d[f=0];else{if(f=Math.ceil((n+1)/_e),i=d.length,f>=i)return e;for(u=i=d[f],s=1;i>=10;i/=10)s++;n%=_e,a=n-_e+s}if(r!==void 0&&(i=ea(10,s-a-1),l=u/i%10|0,c=t<0||d[f+1]!==void 0||u%i,c=r<4?(l||c)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?a>0?u/ea(10,s-a):0:d[f-1])%10&1||r==(e.s<0?8:7))),t<1||!d[0])return c?(i=ze(e),d.length=1,t=t-i-1,d[0]=ea(10,(_e-t%_e)%_e),e.e=vo(-t/_e)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(n==0?(d.length=f,i=1,f--):(d.length=f+1,i=ea(10,_e-n),d[f]=a>0?(u/ea(10,s-a)%ea(10,a)|0)*i:0),c)for(;;)if(f==0){(d[0]+=i)==Ze&&(d[0]=1,++e.e);break}else{if(d[f]+=i,d[f]!=Ze)break;d[f--]=0,i=1}for(n=d.length;d[--n]===0;)d.pop();if(Pe&&(e.e>wu||e.e<-wu))throw Error(Iy+ze(e));return e}function ck(e,t){var r,n,a,i,s,l,c,u,f,d,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),Pe?ve(t,p):t;if(c=e.d,d=t.d,n=t.e,u=e.e,c=c.slice(),s=u-n,s){for(f=s<0,f?(r=c,s=-s,l=d.length):(r=d,n=u,l=c.length),a=Math.max(Math.ceil(p/_e),l)+2,s>a&&(s=a,r.length=1),r.reverse(),a=s;a--;)r.push(0);r.reverse()}else{for(a=c.length,l=d.length,f=a<l,f&&(l=a),a=0;a<l;a++)if(c[a]!=d[a]){f=c[a]<d[a];break}s=0}for(f&&(r=c,c=d,d=r,t.s=-t.s),l=c.length,a=d.length-l;a>0;--a)c[l++]=0;for(a=d.length;a>s;){if(c[--a]<d[a]){for(i=a;i&&c[--i]===0;)c[i]=Ze-1;--c[i],c[a]+=Ze}c[a]-=d[a]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,Pe?ve(t,p):t):new h(0)}function _a(e,t,r){var n,a=ze(e),i=kr(e.d),s=i.length;return t?(r&&(n=r-s)>0?i=i.charAt(0)+"."+i.slice(1)+pn(n):s>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+pn(-a-1)+i,r&&(n=r-s)>0&&(i+=pn(n))):a>=s?(i+=pn(a+1-s),r&&(n=r-a-1)>0&&(i=i+"."+pn(n))):((n=a+1)<s&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-s)>0&&(a+1===s&&(i+="."),i+=pn(n))),e.s<0?"-"+i:i}function Cb(e,t){if(e.length>t)return e.length=t,!0}function uk(e){var t,r,n;function a(i){var s=this;if(!(s instanceof a))return new a(i);if(s.constructor=a,i instanceof a){s.s=i.s,s.e=i.e,s.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(pa+i);if(i>0)s.s=1;else if(i<0)i=-i,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(i===~~i&&i<1e7){s.e=0,s.d=[i];return}return Ab(s,i.toString())}else if(typeof i!="string")throw Error(pa+i);if(i.charCodeAt(0)===45?(i=i.slice(1),s.s=-1):s.s=1,Xz.test(i))Ab(s,i);else throw Error(pa+i)}if(a.prototype=Y,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=uk,a.config=a.set=Qz,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return a.config(e),a}function Qz(e){if(!e||typeof e!="object")throw Error(tr+"Object expected");var t,r,n,a=["precision",1,mo,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<a.length;t+=3)if((n=e[r=a[t]])!==void 0)if(vo(n)===n&&n>=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(pa+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(pa+r+": "+n);return this}var Ly=uk(qz);It=new Ly(1);const pe=Ly;function Jz(e){return rW(e)||tW(e)||eW(e)||Zz()}function Zz(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eW(e,t){if(e){if(typeof e=="string")return Yp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yp(e,t)}}function tW(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function rW(e){if(Array.isArray(e))return Yp(e)}function Yp(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var nW=function(t){return t},dk={},fk=function(t){return t===dk},Eb=function(t){return function r(){return arguments.length===0||arguments.length===1&&fk(arguments.length<=0?void 0:arguments[0])?r:t.apply(void 0,arguments)}},aW=function e(t,r){return t===1?r:Eb(function(){for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];var s=a.filter(function(l){return l!==dk}).length;return s>=t?r.apply(void 0,a):e(t-s,Eb(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var f=a.map(function(d){return fk(d)?c.shift():d});return r.apply(void 0,Jz(f).concat(c))}))})},qd=function(t){return aW(t.length,t)},qp=function(t,r){for(var n=[],a=t;a<r;++a)n[a-t]=a;return n},iW=qd(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(r){return t[r]}).map(e)}),oW=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(!r.length)return nW;var a=r.reverse(),i=a[0],s=a.slice(1);return function(){return s.reduce(function(l,c){return c(l)},i.apply(void 0,arguments))}},Xp=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},hk=function(t){var r=null,n=null;return function(){for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return r&&i.every(function(l,c){return l===r[c]})||(r=i,n=t.apply(void 0,i)),n}};function sW(e){var t;return e===0?t=1:t=Math.floor(new pe(e).abs().log(10).toNumber())+1,t}function lW(e,t,r){for(var n=new pe(e),a=0,i=[];n.lt(t)&&a<1e5;)i.push(n.toNumber()),n=n.add(r),a++;return i}var cW=qd(function(e,t,r){var n=+e,a=+t;return n+r*(a-n)}),uW=qd(function(e,t,r){var n=t-+e;return n=n||1/0,(r-e)/n}),dW=qd(function(e,t,r){var n=t-+e;return n=n||1/0,Math.max(0,Math.min(1,(r-e)/n))});const Xd={rangeStep:lW,getDigitCount:sW,interpolateNumber:cW,uninterpolateNumber:uW,uninterpolateTruncation:dW};function Qp(e){return pW(e)||hW(e)||pk(e)||fW()}function fW(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hW(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function pW(e){if(Array.isArray(e))return Jp(e)}function Rs(e,t){return yW(e)||vW(e,t)||pk(e,t)||mW()}function mW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pk(e,t){if(e){if(typeof e=="string")return Jp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Jp(e,t)}}function Jp(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function vW(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,i=void 0;try{for(var s=e[Symbol.iterator](),l;!(n=(l=s.next()).done)&&(r.push(l.value),!(t&&r.length===t));n=!0);}catch(c){a=!0,i=c}finally{try{!n&&s.return!=null&&s.return()}finally{if(a)throw i}}return r}}function yW(e){if(Array.isArray(e))return e}function mk(e){var t=Rs(e,2),r=t[0],n=t[1],a=r,i=n;return r>n&&(a=n,i=r),[a,i]}function vk(e,t,r){if(e.lte(0))return new pe(0);var n=Xd.getDigitCount(e.toNumber()),a=new pe(10).pow(n),i=e.div(a),s=n!==1?.05:.1,l=new pe(Math.ceil(i.div(s).toNumber())).add(r).mul(s),c=l.mul(a);return t?c:new pe(Math.ceil(c))}function gW(e,t,r){var n=1,a=new pe(e);if(!a.isint()&&r){var i=Math.abs(e);i<1?(n=new pe(10).pow(Xd.getDigitCount(e)-1),a=new pe(Math.floor(a.div(n).toNumber())).mul(n)):i>1&&(a=new pe(Math.floor(e)))}else e===0?a=new pe(Math.floor((t-1)/2)):r||(a=new pe(Math.floor(e)));var s=Math.floor((t-1)/2),l=oW(iW(function(c){return a.add(new pe(c-s).mul(n)).toNumber()}),qp);return l(0,t)}function yk(e,t,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new pe(0),tickMin:new pe(0),tickMax:new pe(0)};var i=vk(new pe(t).sub(e).div(r-1),n,a),s;e<=0&&t>=0?s=new pe(0):(s=new pe(e).add(t).div(2),s=s.sub(new pe(s).mod(i)));var l=Math.ceil(s.sub(e).div(i).toNumber()),c=Math.ceil(new pe(t).sub(s).div(i).toNumber()),u=l+c+1;return u>r?yk(e,t,r,n,a+1):(u<r&&(c=t>0?c+(r-u):c,l=t>0?l:l+(r-u)),{step:i,tickMin:s.sub(new pe(l).mul(i)),tickMax:s.add(new pe(c).mul(i))})}function xW(e){var t=Rs(e,2),r=t[0],n=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(a,2),l=mk([r,n]),c=Rs(l,2),u=c[0],f=c[1];if(u===-1/0||f===1/0){var d=f===1/0?[u].concat(Qp(qp(0,a-1).map(function(){return 1/0}))):[].concat(Qp(qp(0,a-1).map(function(){return-1/0})),[f]);return r>n?Xp(d):d}if(u===f)return gW(u,a,i);var h=yk(u,f,s,i),p=h.step,g=h.tickMin,y=h.tickMax,b=Xd.rangeStep(g,y.add(new pe(.1).mul(p)),p);return r>n?Xp(b):b}function bW(e,t){var r=Rs(e,2),n=r[0],a=r[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=mk([n,a]),l=Rs(s,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[n,a];if(c===u)return[c];var f=Math.max(t,2),d=vk(new pe(u).sub(c).div(f-1),i,0),h=[].concat(Qp(Xd.rangeStep(new pe(c),new pe(u).sub(new pe(.99).mul(d)),d)),[u]);return n>a?Xp(h):h}var jW=hk(xW),wW=hk(bW),SW="Invariant failed";function ka(e,t){throw new Error(SW)}var _W=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Mi(e){"@babel/helpers - typeof";return Mi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mi(e)}function Su(){return Su=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Su.apply(this,arguments)}function kW(e,t){return AW(e)||PW(e,t)||NW(e,t)||OW()}function OW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NW(e,t){if(e){if(typeof e=="string")return $b(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $b(e,t)}}function $b(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function PW(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function AW(e){if(Array.isArray(e))return e}function CW(e,t){if(e==null)return{};var r=EW(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function EW(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function $W(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TW(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,bk(n.key),n)}}function MW(e,t,r){return t&&TW(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function IW(e,t,r){return t=_u(t),LW(e,gk()?Reflect.construct(t,r||[],_u(e).constructor):t.apply(e,r))}function LW(e,t){if(t&&(Mi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return DW(e)}function DW(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(gk=function(){return!!e})()}function _u(e){return _u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},_u(e)}function RW(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zp(e,t)}function Zp(e,t){return Zp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Zp(e,t)}function xk(e,t,r){return t=bk(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bk(e){var t=BW(e,"string");return Mi(t)=="symbol"?t:t+""}function BW(e,t){if(Mi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Mi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Qd=function(e){function t(){return $W(this,t),IW(this,t,arguments)}return RW(t,e),MW(t,[{key:"render",value:function(){var n=this.props,a=n.offset,i=n.layout,s=n.width,l=n.dataKey,c=n.data,u=n.dataPointFormatter,f=n.xAxis,d=n.yAxis,h=CW(n,_W),p=X(h,!1);this.props.direction==="x"&&f.type!=="number"&&ka();var g=c.map(function(y){var b=u(y,l),v=b.x,m=b.y,x=b.value,S=b.errorVal;if(!S)return null;var j=[],w,_;if(Array.isArray(S)){var O=kW(S,2);w=O[0],_=O[1]}else w=_=S;if(i==="vertical"){var N=f.scale,k=m+a,E=k+s,T=k-s,D=N(x-w),A=N(x+_);j.push({x1:A,y1:E,x2:A,y2:T}),j.push({x1:D,y1:k,x2:A,y2:k}),j.push({x1:D,y1:E,x2:D,y2:T})}else if(i==="horizontal"){var L=d.scale,C=v+a,M=C-s,I=C+s,R=L(x-w),F=L(x+_);j.push({x1:M,y1:F,x2:I,y2:F}),j.push({x1:C,y1:R,x2:C,y2:F}),j.push({x1:M,y1:R,x2:I,y2:R})}return $.createElement(ne,Su({className:"recharts-errorBar",key:"bar-".concat(j.map(function(K){return"".concat(K.x1,"-").concat(K.x2,"-").concat(K.y1,"-").concat(K.y2)}))},p),j.map(function(K){return $.createElement("line",Su({},K,{key:"line-".concat(K.x1,"-").concat(K.x2,"-").concat(K.y1,"-").concat(K.y2)}))}))});return $.createElement(ne,{className:"recharts-errorBars"},g)}}])}($.Component);xk(Qd,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});xk(Qd,"displayName","ErrorBar");function Bs(e){"@babel/helpers - typeof";return Bs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bs(e)}function Tb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Gn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Tb(Object(r),!0).forEach(function(n){FW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function FW(e,t,r){return t=zW(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zW(e){var t=WW(e,"string");return Bs(t)=="symbol"?t:t+""}function WW(e,t){if(Bs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Bs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jk=function(t){var r=t.children,n=t.formattedGraphicalItems,a=t.legendWidth,i=t.legendContent,s=Mt(r,mi);if(!s)return null;var l=mi.defaultProps,c=l!==void 0?Gn(Gn({},l),s.props):{},u;return s.props&&s.props.payload?u=s.props&&s.props.payload:i==="children"?u=(n||[]).reduce(function(f,d){var h=d.item,p=d.props,g=p.sectors||p.data||[];return f.concat(g.map(function(y){return{type:s.props.iconType||h.props.legendType,value:y.name,color:y.fill,payload:y}}))},[]):u=(n||[]).map(function(f){var d=f.item,h=d.type.defaultProps,p=h!==void 0?Gn(Gn({},h),d.props):{},g=p.dataKey,y=p.name,b=p.legendType,v=p.hide;return{inactive:v,dataKey:g,type:c.iconType||b||"square",color:Dy(d),value:y||g,payload:p}}),Gn(Gn(Gn({},c),mi.getWithHeight(s,a)),{},{payload:u,item:s})};function Fs(e){"@babel/helpers - typeof";return Fs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fs(e)}function Mb(e){return VW(e)||KW(e)||HW(e)||UW()}function UW(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HW(e,t){if(e){if(typeof e=="string")return em(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return em(e,t)}}function KW(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function VW(e){if(Array.isArray(e))return em(e)}function em(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ib(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ie(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ib(Object(r),!0).forEach(function(n){yi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ib(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function yi(e,t,r){return t=GW(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function GW(e){var t=YW(e,"string");return Fs(t)=="symbol"?t:t+""}function YW(e,t){if(Fs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Fs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Be(e,t,r){return te(e)||te(t)?r:qe(t)?Rt(e,t,r):Q(t)?t(e):r}function rs(e,t,r,n){var a=Kz(e,function(l){return Be(l,t)});if(r==="number"){var i=a.filter(function(l){return U(l)||parseFloat(l)});return i.length?[Yd(i),jn(i)]:[1/0,-1/0]}var s=n?a.filter(function(l){return!te(l)}):a;return s.map(function(l){return qe(l)||l instanceof Date?l:""})}var qW=function(t){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,s=-1,l=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(l<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var c=i.range,u=0;u<l;u++){var f=u>0?a[u-1].coordinate:a[l-1].coordinate,d=a[u].coordinate,h=u>=l-1?a[0].coordinate:a[u+1].coordinate,p=void 0;if(rt(d-f)!==rt(h-d)){var g=[];if(rt(h-d)===rt(c[1]-c[0])){p=h;var y=d+c[1]-c[0];g[0]=Math.min(y,(y+f)/2),g[1]=Math.max(y,(y+f)/2)}else{p=f;var b=h+c[1]-c[0];g[0]=Math.min(d,(b+d)/2),g[1]=Math.max(d,(b+d)/2)}var v=[Math.min(d,(p+d)/2),Math.max(d,(p+d)/2)];if(t>v[0]&&t<=v[1]||t>=g[0]&&t<=g[1]){s=a[u].index;break}}else{var m=Math.min(f,h),x=Math.max(f,h);if(t>(m+d)/2&&t<=(x+d)/2){s=a[u].index;break}}}else for(var S=0;S<l;S++)if(S===0&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S>0&&S<l-1&&t>(n[S].coordinate+n[S-1].coordinate)/2&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S===l-1&&t>(n[S].coordinate+n[S-1].coordinate)/2){s=n[S].index;break}return s},Dy=function(t){var r,n=t,a=n.type.displayName,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Ie(Ie({},t.type.defaultProps),t.props):t.props,s=i.stroke,l=i.fill,c;switch(a){case"Line":c=s;break;case"Area":case"Radar":c=s&&s!=="none"?s:l;break;default:c=l;break}return c},XW=function(t){var r=t.barSize,n=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var s={},l=Object.keys(i),c=0,u=l.length;c<u;c++)for(var f=i[l[c]].stackGroups,d=Object.keys(f),h=0,p=d.length;h<p;h++){var g=f[d[h]],y=g.items,b=g.cateAxisId,v=y.filter(function(_){return Gr(_.type).indexOf("Bar")>=0});if(v&&v.length){var m=v[0].type.defaultProps,x=m!==void 0?Ie(Ie({},m),v[0].props):v[0].props,S=x.barSize,j=x[b];s[j]||(s[j]=[]);var w=te(S)?r:S;s[j].push({item:v[0],stackList:v.slice(1),barSize:te(w)?void 0:gt(w,n,0)})}}return s},QW=function(t){var r=t.barGap,n=t.barCategoryGap,a=t.bandSize,i=t.sizeList,s=i===void 0?[]:i,l=t.maxBarSize,c=s.length;if(c<1)return null;var u=gt(r,a,0,!0),f,d=[];if(s[0].barSize===+s[0].barSize){var h=!1,p=a/c,g=s.reduce(function(S,j){return S+j.barSize||0},0);g+=(c-1)*u,g>=a&&(g-=(c-1)*u,u=0),g>=a&&p>0&&(h=!0,p*=.9,g=c*p);var y=(a-g)/2>>0,b={offset:y-u,size:0};f=s.reduce(function(S,j){var w={item:j.item,position:{offset:b.offset+b.size+u,size:h?p:j.barSize}},_=[].concat(Mb(S),[w]);return b=_[_.length-1].position,j.stackList&&j.stackList.length&&j.stackList.forEach(function(O){_.push({item:O,position:b})}),_},d)}else{var v=gt(n,a,0,!0);a-2*v-(c-1)*u<=0&&(u=0);var m=(a-2*v-(c-1)*u)/c;m>1&&(m>>=0);var x=l===+l?Math.min(m,l):m;f=s.reduce(function(S,j,w){var _=[].concat(Mb(S),[{item:j.item,position:{offset:v+(m+u)*w+(m-x)/2,size:x}}]);return j.stackList&&j.stackList.length&&j.stackList.forEach(function(O){_.push({item:O,position:_[_.length-1].position})}),_},d)}return f},JW=function(t,r,n,a){var i=n.children,s=n.width,l=n.margin,c=s-(l.left||0)-(l.right||0),u=jk({children:i,legendWidth:c});if(u){var f=a||{},d=f.width,h=f.height,p=u.align,g=u.verticalAlign,y=u.layout;if((y==="vertical"||y==="horizontal"&&g==="middle")&&p!=="center"&&U(t[p]))return Ie(Ie({},t),{},yi({},p,t[p]+(d||0)));if((y==="horizontal"||y==="vertical"&&p==="center")&&g!=="middle"&&U(t[g]))return Ie(Ie({},t),{},yi({},g,t[g]+(h||0)))}return t},ZW=function(t,r,n){return te(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},wk=function(t,r,n,a,i){var s=r.props.children,l=Bt(s,Qd).filter(function(u){return ZW(a,i,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,f){var d=Be(f,n);if(te(d))return u;var h=Array.isArray(d)?[Yd(d),jn(d)]:[d,d],p=c.reduce(function(g,y){var b=Be(f,y,0),v=h[0]-Math.abs(Array.isArray(b)?b[0]:b),m=h[1]+Math.abs(Array.isArray(b)?b[1]:b);return[Math.min(v,g[0]),Math.max(m,g[1])]},[1/0,-1/0]);return[Math.min(p[0],u[0]),Math.max(p[1],u[1])]},[1/0,-1/0])}return null},eU=function(t,r,n,a,i){var s=r.map(function(l){return wk(t,l,n,i,a)}).filter(function(l){return!te(l)});return s&&s.length?s.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},Sk=function(t,r,n,a,i){var s=r.map(function(c){var u=c.props.dataKey;return n==="number"&&u&&wk(t,c,u,a)||rs(t,u,n,i)});if(n==="number")return s.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return s.reduce(function(c,u){for(var f=0,d=u.length;f<d;f++)l[u[f]]||(l[u[f]]=!0,c.push(u[f]));return c},[])},_k=function(t,r){return t==="horizontal"&&r==="xAxis"||t==="vertical"&&r==="yAxis"||t==="centric"&&r==="angleAxis"||t==="radial"&&r==="radiusAxis"},kk=function(t,r,n,a){if(a)return t.map(function(c){return c.coordinate});var i,s,l=t.map(function(c){return c.coordinate===r&&(i=!0),c.coordinate===n&&(s=!0),c.coordinate});return i||l.push(r),s||l.push(n),l},Kr=function(t,r,n){if(!t)return null;var a=t.scale,i=t.duplicateDomain,s=t.type,l=t.range,c=t.realScaleType==="scaleBand"?a.bandwidth()/2:2,u=(r||n)&&s==="category"&&a.bandwidth?a.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?rt(l[0]-l[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var f=(t.ticks||t.niceTicks).map(function(d){var h=i?i.indexOf(d):d;return{coordinate:a(h)+u,value:d,offset:u}});return f.filter(function(d){return!lo(d.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(d,h){return{coordinate:a(d)+u,value:d,index:h,offset:u}}):a.ticks&&!n?a.ticks(t.tickCount).map(function(d){return{coordinate:a(d)+u,value:d,offset:u}}):a.domain().map(function(d,h){return{coordinate:a(d)+u,value:i?i[d]:d,index:h,offset:u}})},oh=new WeakMap,Jl=function(t,r){if(typeof r!="function")return t;oh.has(t)||oh.set(t,new WeakMap);var n=oh.get(t);if(n.has(r))return n.get(r);var a=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,a),a},Ok=function(t,r,n){var a=t.scale,i=t.type,s=t.layout,l=t.axisType;if(a==="auto")return s==="radial"&&l==="radiusAxis"?{scale:$s(),realScaleType:"band"}:s==="radial"&&l==="angleAxis"?{scale:gu(),realScaleType:"linear"}:i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:ts(),realScaleType:"point"}:i==="category"?{scale:$s(),realScaleType:"band"}:{scale:gu(),realScaleType:"linear"};if(ja(a)){var c="scale".concat(Md(a));return{scale:(Pb[c]||ts)(),realScaleType:Pb[c]?c:"point"}}return Q(a)?{scale:a}:{scale:ts(),realScaleType:"point"}},Lb=1e-4,Nk=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,a=t.range(),i=Math.min(a[0],a[1])-Lb,s=Math.max(a[0],a[1])+Lb,l=t(r[0]),c=t(r[n-1]);(l<i||l>s||c<i||c>s)&&t.domain([r[0],r[n-1]])}},Pk=function(t,r){if(!t)return null;for(var n=0,a=t.length;n<a;n++)if(t[n].item===r)return t[n].position;return null},Ak=function(t,r){if(!r||r.length!==2||!U(r[0])||!U(r[1]))return t;var n=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]),i=[t[0],t[1]];return(!U(t[0])||t[0]<n)&&(i[0]=n),(!U(t[1])||t[1]>a)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]<n&&(i[1]=n),i},tU=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n<a;++n)for(var i=0,s=0,l=0;l<r;++l){var c=lo(t[l][n][1])?t[l][n][0]:t[l][n][1];c>=0?(t[l][n][0]=i,t[l][n][1]=i+c,i=t[l][n][1]):(t[l][n][0]=s,t[l][n][1]=s+c,s=t[l][n][1])}},rU=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n<a;++n)for(var i=0,s=0;s<r;++s){var l=lo(t[s][n][1])?t[s][n][0]:t[s][n][1];l>=0?(t[s][n][0]=i,t[s][n][1]=i+l,i=t[s][n][1]):(t[s][n][0]=0,t[s][n][1]=0)}},nU={sign:tU,expand:_4,none:Oi,silhouette:k4,wiggle:O4,positive:rU},aU=function(t,r,n){var a=r.map(function(l){return l.props.dataKey}),i=nU[n],s=S4().keys(a).value(function(l,c){return+Be(l,c,0)}).order(kp).offset(i);return s(t)},iU=function(t,r,n,a,i,s){if(!t)return null;var l=s?r.reverse():r,c={},u=l.reduce(function(d,h){var p,g=(p=h.type)!==null&&p!==void 0&&p.defaultProps?Ie(Ie({},h.type.defaultProps),h.props):h.props,y=g.stackId,b=g.hide;if(b)return d;var v=g[n],m=d[v]||{hasStack:!1,stackGroups:{}};if(qe(y)){var x=m.stackGroups[y]||{numericAxisId:n,cateAxisId:a,items:[]};x.items.push(h),m.hasStack=!0,m.stackGroups[y]=x}else m.stackGroups[co("_stackId_")]={numericAxisId:n,cateAxisId:a,items:[h]};return Ie(Ie({},d),{},yi({},v,m))},c),f={};return Object.keys(u).reduce(function(d,h){var p=u[h];if(p.hasStack){var g={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(y,b){var v=p.stackGroups[b];return Ie(Ie({},y),{},yi({},b,{numericAxisId:n,cateAxisId:a,items:v.items,stackedData:aU(t,v.items,i)}))},g)}return Ie(Ie({},d),{},yi({},h,p))},f)},Ck=function(t,r){var n=r.realScaleType,a=r.type,i=r.tickCount,s=r.originalDomain,l=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(i&&a==="number"&&s&&(s[0]==="auto"||s[1]==="auto")){var u=t.domain();if(!u.length)return null;var f=jW(u,i,l);return t.domain([Yd(f),jn(f)]),{niceTicks:f}}if(i&&a==="number"){var d=t.domain(),h=wW(d,i,l);return{niceTicks:h}}return null};function Db(e){var t=e.axis,r=e.ticks,n=e.bandSize,a=e.entry,i=e.index,s=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!te(a[t.dataKey])){var l=Xc(r,"value",a[t.dataKey]);if(l)return l.coordinate+n/2}return r[i]?r[i].coordinate+n/2:null}var c=Be(a,te(s)?t.dataKey:s);return te(c)?null:t.scale(c)}var ku=function(t){var r=t.axis,n=t.ticks,a=t.offset,i=t.bandSize,s=t.entry,l=t.index;if(r.type==="category")return n[l]?n[l].coordinate+a:null;var c=Be(s,r.dataKey,r.domain[l]);return te(c)?null:r.scale(c)-i/2+a},Ek=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var a=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return a<=0&&i>=0?0:i<0?i:a}return n[0]},oU=function(t,r){var n,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Ie(Ie({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(qe(i)){var s=r[i];if(s){var l=s.items.indexOf(t);return l>=0?s.stackedData[l]:null}}return null},sU=function(t){return t.reduce(function(r,n){return[Yd(n.concat([r[0]]).filter(U)),jn(n.concat([r[1]]).filter(U))]},[1/0,-1/0])},$k=function(t,r,n){return Object.keys(t).reduce(function(a,i){var s=t[i],l=s.stackedData,c=l.reduce(function(u,f){var d=sU(f.slice(r,n+1));return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]);return[Math.min(c[0],a[0]),Math.max(c[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},Rb=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Bb=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,tm=function(t,r,n){if(Q(t))return t(r,n);if(!Array.isArray(t))return r;var a=[];if(U(t[0]))a[0]=n?t[0]:Math.min(t[0],r[0]);else if(Rb.test(t[0])){var i=+Rb.exec(t[0])[1];a[0]=r[0]-i}else Q(t[0])?a[0]=t[0](r[0]):a[0]=r[0];if(U(t[1]))a[1]=n?t[1]:Math.max(t[1],r[1]);else if(Bb.test(t[1])){var s=+Bb.exec(t[1])[1];a[1]=r[1]+s}else Q(t[1])?a[1]=t[1](r[1]):a[1]=r[1];return a},Ou=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!n||a>0)return a}if(t&&r&&r.length>=2){for(var i=dy(r,function(d){return d.coordinate}),s=1/0,l=1,c=i.length;l<c;l++){var u=i[l],f=i[l-1];s=Math.min((u.coordinate||0)-(f.coordinate||0),s)}return s===1/0?0:s}return n?void 0:0},Fb=function(t,r,n){return!t||!t.length||Sa(t,Rt(n,"type.defaultProps.domain"))?r:t},Ry=function(t,r){var n=t.type.defaultProps?Ie(Ie({},t.type.defaultProps),t.props):t.props,a=n.dataKey,i=n.name,s=n.unit,l=n.formatter,c=n.tooltipType,u=n.chartType,f=n.hide;return Ie(Ie({},X(t,!1)),{},{dataKey:a,unit:s,formatter:l,name:i||a,color:Dy(t),value:Be(r,a),type:c,payload:r,chartType:u,hide:f})};function zs(e){"@babel/helpers - typeof";return zs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zs(e)}function zb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Br(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zb(Object(r),!0).forEach(function(n){Tk(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Tk(e,t,r){return t=lU(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lU(e){var t=cU(e,"string");return zs(t)=="symbol"?t:t+""}function cU(e,t){if(zs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(zs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function uU(e,t){return pU(e)||hU(e,t)||fU(e,t)||dU()}function dU(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fU(e,t){if(e){if(typeof e=="string")return Wb(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Wb(e,t)}}function Wb(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function hU(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function pU(e){if(Array.isArray(e))return e}var Nu=Math.PI/180,mU=function(t){return t*180/Math.PI},ye=function(t,r,n,a){return{x:t+Math.cos(-Nu*a)*n,y:r+Math.sin(-Nu*a)*n}},Mk=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},Ik=function(t,r,n,a,i){var s=t.width,l=t.height,c=t.startAngle,u=t.endAngle,f=gt(t.cx,s,s/2),d=gt(t.cy,l,l/2),h=Mk(s,l,n),p=gt(t.innerRadius,h,0),g=gt(t.outerRadius,h,h*.8),y=Object.keys(r);return y.reduce(function(b,v){var m=r[v],x=m.domain,S=m.reversed,j;if(te(m.range))a==="angleAxis"?j=[c,u]:a==="radiusAxis"&&(j=[p,g]),S&&(j=[j[1],j[0]]);else{j=m.range;var w=j,_=uU(w,2);c=_[0],u=_[1]}var O=Ok(m,i),N=O.realScaleType,k=O.scale;k.domain(x).range(j),Nk(k);var E=Ck(k,Br(Br({},m),{},{realScaleType:N})),T=Br(Br(Br({},m),E),{},{range:j,radius:g,realScaleType:N,scale:k,cx:f,cy:d,innerRadius:p,outerRadius:g,startAngle:c,endAngle:u});return Br(Br({},b),{},Tk({},v,T))},{})},vU=function(t,r){var n=t.x,a=t.y,i=r.x,s=r.y;return Math.sqrt(Math.pow(n-i,2)+Math.pow(a-s,2))},yU=function(t,r){var n=t.x,a=t.y,i=r.cx,s=r.cy,l=vU({x:n,y:a},{x:i,y:s});if(l<=0)return{radius:l};var c=(n-i)/l,u=Math.acos(c);return a>s&&(u=2*Math.PI-u),{radius:l,angle:mU(u),angleInRadian:u}},gU=function(t){var r=t.startAngle,n=t.endAngle,a=Math.floor(r/360),i=Math.floor(n/360),s=Math.min(a,i);return{startAngle:r-s*360,endAngle:n-s*360}},xU=function(t,r){var n=r.startAngle,a=r.endAngle,i=Math.floor(n/360),s=Math.floor(a/360),l=Math.min(i,s);return t+l*360},Ub=function(t,r){var n=t.x,a=t.y,i=yU({x:n,y:a},r),s=i.radius,l=i.angle,c=r.innerRadius,u=r.outerRadius;if(s<c||s>u)return!1;if(s===0)return!0;var f=gU(r),d=f.startAngle,h=f.endAngle,p=l,g;if(d<=h){for(;p>h;)p-=360;for(;p<d;)p+=360;g=p>=d&&p<=h}else{for(;p>d;)p-=360;for(;p<h;)p+=360;g=p>=h&&p<=d}return g?Br(Br({},r),{},{radius:s,angle:xU(p,r)}):null},Lk=function(t){return!P.isValidElement(t)&&!Q(t)&&typeof t!="boolean"?t.className:""};function Ws(e){"@babel/helpers - typeof";return Ws=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ws(e)}var bU=["offset"];function jU(e){return kU(e)||_U(e)||SU(e)||wU()}function wU(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function SU(e,t){if(e){if(typeof e=="string")return rm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rm(e,t)}}function _U(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kU(e){if(Array.isArray(e))return rm(e)}function rm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function OU(e,t){if(e==null)return{};var r=NU(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function NU(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Hb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ke(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Hb(Object(r),!0).forEach(function(n){PU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function PU(e,t,r){return t=AU(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function AU(e){var t=CU(e,"string");return Ws(t)=="symbol"?t:t+""}function CU(e,t){if(Ws(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ws(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Us(){return Us=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Us.apply(this,arguments)}var EU=function(t){var r=t.value,n=t.formatter,a=te(t.children)?r:t.children;return Q(n)?n(a):a},$U=function(t,r){var n=rt(r-t),a=Math.min(Math.abs(r-t),360);return n*a},TU=function(t,r,n){var a=t.position,i=t.viewBox,s=t.offset,l=t.className,c=i,u=c.cx,f=c.cy,d=c.innerRadius,h=c.outerRadius,p=c.startAngle,g=c.endAngle,y=c.clockWise,b=(d+h)/2,v=$U(p,g),m=v>=0?1:-1,x,S;a==="insideStart"?(x=p+m*s,S=y):a==="insideEnd"?(x=g-m*s,S=!y):a==="end"&&(x=g+m*s,S=y),S=v<=0?S:!S;var j=ye(u,f,b,x),w=ye(u,f,b,x+(S?1:-1)*359),_="M".concat(j.x,",").concat(j.y,`
- A`).concat(b,",").concat(b,",0,1,").concat(S?0:1,`,
- `).concat(w.x,",").concat(w.y),O=te(t.id)?co("recharts-radial-line-"):t.id;return $.createElement("text",Us({},n,{dominantBaseline:"central",className:ee("recharts-radial-bar-label",l)}),$.createElement("defs",null,$.createElement("path",{id:O,d:_})),$.createElement("textPath",{xlinkHref:"#".concat(O)},r))},MU=function(t){var r=t.viewBox,n=t.offset,a=t.position,i=r,s=i.cx,l=i.cy,c=i.innerRadius,u=i.outerRadius,f=i.startAngle,d=i.endAngle,h=(f+d)/2;if(a==="outside"){var p=ye(s,l,u+n,h),g=p.x,y=p.y;return{x:g,y,textAnchor:g>=s?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:s,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:s,y:l,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:s,y:l,textAnchor:"middle",verticalAnchor:"end"};var b=(c+u)/2,v=ye(s,l,b,h),m=v.x,x=v.y;return{x:m,y:x,textAnchor:"middle",verticalAnchor:"middle"}},IU=function(t){var r=t.viewBox,n=t.parentViewBox,a=t.offset,i=t.position,s=r,l=s.x,c=s.y,u=s.width,f=s.height,d=f>=0?1:-1,h=d*a,p=d>0?"end":"start",g=d>0?"start":"end",y=u>=0?1:-1,b=y*a,v=y>0?"end":"start",m=y>0?"start":"end";if(i==="top"){var x={x:l+u/2,y:c-d*a,textAnchor:"middle",verticalAnchor:p};return Ke(Ke({},x),n?{height:Math.max(c-n.y,0),width:u}:{})}if(i==="bottom"){var S={x:l+u/2,y:c+f+h,textAnchor:"middle",verticalAnchor:g};return Ke(Ke({},S),n?{height:Math.max(n.y+n.height-(c+f),0),width:u}:{})}if(i==="left"){var j={x:l-b,y:c+f/2,textAnchor:v,verticalAnchor:"middle"};return Ke(Ke({},j),n?{width:Math.max(j.x-n.x,0),height:f}:{})}if(i==="right"){var w={x:l+u+b,y:c+f/2,textAnchor:m,verticalAnchor:"middle"};return Ke(Ke({},w),n?{width:Math.max(n.x+n.width-w.x,0),height:f}:{})}var _=n?{width:u,height:f}:{};return i==="insideLeft"?Ke({x:l+b,y:c+f/2,textAnchor:m,verticalAnchor:"middle"},_):i==="insideRight"?Ke({x:l+u-b,y:c+f/2,textAnchor:v,verticalAnchor:"middle"},_):i==="insideTop"?Ke({x:l+u/2,y:c+h,textAnchor:"middle",verticalAnchor:g},_):i==="insideBottom"?Ke({x:l+u/2,y:c+f-h,textAnchor:"middle",verticalAnchor:p},_):i==="insideTopLeft"?Ke({x:l+b,y:c+h,textAnchor:m,verticalAnchor:g},_):i==="insideTopRight"?Ke({x:l+u-b,y:c+h,textAnchor:v,verticalAnchor:g},_):i==="insideBottomLeft"?Ke({x:l+b,y:c+f-h,textAnchor:m,verticalAnchor:p},_):i==="insideBottomRight"?Ke({x:l+u-b,y:c+f-h,textAnchor:v,verticalAnchor:p},_):ao(i)&&(U(i.x)||ia(i.x))&&(U(i.y)||ia(i.y))?Ke({x:l+gt(i.x,u),y:c+gt(i.y,f),textAnchor:"end",verticalAnchor:"end"},_):Ke({x:l+u/2,y:c+f/2,textAnchor:"middle",verticalAnchor:"middle"},_)},LU=function(t){return"cx"in t&&U(t.cx)};function tt(e){var t=e.offset,r=t===void 0?5:t,n=OU(e,bU),a=Ke({offset:r},n),i=a.viewBox,s=a.position,l=a.value,c=a.children,u=a.content,f=a.className,d=f===void 0?"":f,h=a.textBreakAll;if(!i||te(l)&&te(c)&&!P.isValidElement(u)&&!Q(u))return null;if(P.isValidElement(u))return P.cloneElement(u,a);var p;if(Q(u)){if(p=P.createElement(u,a),P.isValidElement(p))return p}else p=EU(a);var g=LU(i),y=X(a,!0);if(g&&(s==="insideStart"||s==="insideEnd"||s==="end"))return TU(a,p,y);var b=g?MU(a):IU(a);return $.createElement(wa,Us({className:ee("recharts-label",d)},y,b,{breakAll:h}),p)}tt.displayName="Label";var Dk=function(t){var r=t.cx,n=t.cy,a=t.angle,i=t.startAngle,s=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,f=t.outerRadius,d=t.x,h=t.y,p=t.top,g=t.left,y=t.width,b=t.height,v=t.clockWise,m=t.labelViewBox;if(m)return m;if(U(y)&&U(b)){if(U(d)&&U(h))return{x:d,y:h,width:y,height:b};if(U(p)&&U(g))return{x:p,y:g,width:y,height:b}}return U(d)&&U(h)?{x:d,y:h,width:0,height:0}:U(r)&&U(n)?{cx:r,cy:n,startAngle:i||a||0,endAngle:s||a||0,innerRadius:u||0,outerRadius:f||c||l||0,clockWise:v}:t.viewBox?t.viewBox:{}},DU=function(t,r){return t?t===!0?$.createElement(tt,{key:"label-implicit",viewBox:r}):qe(t)?$.createElement(tt,{key:"label-implicit",viewBox:r,value:t}):P.isValidElement(t)?t.type===tt?P.cloneElement(t,{key:"label-implicit",viewBox:r}):$.createElement(tt,{key:"label-implicit",content:t,viewBox:r}):Q(t)?$.createElement(tt,{key:"label-implicit",content:t,viewBox:r}):ao(t)?$.createElement(tt,Us({viewBox:r},t,{key:"label-implicit"})):null:null},RU=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var a=t.children,i=Dk(t),s=Bt(a,tt).map(function(c,u){return P.cloneElement(c,{viewBox:r||i,key:"label-".concat(u)})});if(!n)return s;var l=DU(t.label,r||i);return[l].concat(jU(s))};tt.parseViewBox=Dk;tt.renderCallByParent=RU;function BU(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var FU=BU;const zU=de(FU);function Hs(e){"@babel/helpers - typeof";return Hs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hs(e)}var WU=["valueAccessor"],UU=["data","dataKey","clockWise","id","textBreakAll"];function HU(e){return YU(e)||GU(e)||VU(e)||KU()}function KU(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VU(e,t){if(e){if(typeof e=="string")return nm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nm(e,t)}}function GU(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function YU(e){if(Array.isArray(e))return nm(e)}function nm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Pu(){return Pu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pu.apply(this,arguments)}function Kb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Vb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Kb(Object(r),!0).forEach(function(n){qU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qU(e,t,r){return t=XU(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XU(e){var t=QU(e,"string");return Hs(t)=="symbol"?t:t+""}function QU(e,t){if(Hs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Hs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gb(e,t){if(e==null)return{};var r=JU(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function JU(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var ZU=function(t){return Array.isArray(t.value)?zU(t.value):t.value};function Cr(e){var t=e.valueAccessor,r=t===void 0?ZU:t,n=Gb(e,WU),a=n.data,i=n.dataKey,s=n.clockWise,l=n.id,c=n.textBreakAll,u=Gb(n,UU);return!a||!a.length?null:$.createElement(ne,{className:"recharts-label-list"},a.map(function(f,d){var h=te(i)?r(f,d):Be(f&&f.payload,i),p=te(l)?{}:{id:"".concat(l,"-").concat(d)};return $.createElement(tt,Pu({},X(f,!0),u,p,{parentViewBox:f.parentViewBox,value:h,textBreakAll:c,viewBox:tt.parseViewBox(te(s)?f:Vb(Vb({},f),{},{clockWise:s})),key:"label-".concat(d),index:d}))}))}Cr.displayName="LabelList";function eH(e,t){return e?e===!0?$.createElement(Cr,{key:"labelList-implicit",data:t}):$.isValidElement(e)||Q(e)?$.createElement(Cr,{key:"labelList-implicit",data:t,content:e}):ao(e)?$.createElement(Cr,Pu({data:t},e,{key:"labelList-implicit"})):null:null}function tH(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,a=Bt(n,Cr).map(function(s,l){return P.cloneElement(s,{data:t,key:"labelList-".concat(l)})});if(!r)return a;var i=eH(e.label,t);return[i].concat(HU(a))}Cr.renderCallByParent=tH;function Ks(e){"@babel/helpers - typeof";return Ks=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ks(e)}function am(){return am=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},am.apply(this,arguments)}function Yb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function qb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Yb(Object(r),!0).forEach(function(n){rH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rH(e,t,r){return t=nH(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nH(e){var t=aH(e,"string");return Ks(t)=="symbol"?t:t+""}function aH(e,t){if(Ks(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ks(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var iH=function(t,r){var n=rt(r-t),a=Math.min(Math.abs(r-t),359.999);return n*a},Zl=function(t){var r=t.cx,n=t.cy,a=t.radius,i=t.angle,s=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,f=c*(l?1:-1)+a,d=Math.asin(c/f)/Nu,h=u?i:i+s*d,p=ye(r,n,f,h),g=ye(r,n,a,h),y=u?i-s*d:i,b=ye(r,n,f*Math.cos(d*Nu),y);return{center:p,circleTangency:g,lineTangency:b,theta:d}},Rk=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,s=t.startAngle,l=t.endAngle,c=iH(s,l),u=s+c,f=ye(r,n,i,s),d=ye(r,n,i,u),h="M ".concat(f.x,",").concat(f.y,`
- A `).concat(i,",").concat(i,`,0,
- `).concat(+(Math.abs(c)>180),",").concat(+(s>u),`,
- `).concat(d.x,",").concat(d.y,`
- `);if(a>0){var p=ye(r,n,a,s),g=ye(r,n,a,u);h+="L ".concat(g.x,",").concat(g.y,`
- A `).concat(a,",").concat(a,`,0,
- `).concat(+(Math.abs(c)>180),",").concat(+(s<=u),`,
- `).concat(p.x,",").concat(p.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},oH=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,s=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,f=t.endAngle,d=rt(f-u),h=Zl({cx:r,cy:n,radius:i,angle:u,sign:d,cornerRadius:s,cornerIsExternal:c}),p=h.circleTangency,g=h.lineTangency,y=h.theta,b=Zl({cx:r,cy:n,radius:i,angle:f,sign:-d,cornerRadius:s,cornerIsExternal:c}),v=b.circleTangency,m=b.lineTangency,x=b.theta,S=c?Math.abs(u-f):Math.abs(u-f)-y-x;if(S<0)return l?"M ".concat(g.x,",").concat(g.y,`
- a`).concat(s,",").concat(s,",0,0,1,").concat(s*2,`,0
- a`).concat(s,",").concat(s,",0,0,1,").concat(-s*2,`,0
- `):Rk({cx:r,cy:n,innerRadius:a,outerRadius:i,startAngle:u,endAngle:f});var j="M ".concat(g.x,",").concat(g.y,`
- A`).concat(s,",").concat(s,",0,0,").concat(+(d<0),",").concat(p.x,",").concat(p.y,`
- A`).concat(i,",").concat(i,",0,").concat(+(S>180),",").concat(+(d<0),",").concat(v.x,",").concat(v.y,`
- A`).concat(s,",").concat(s,",0,0,").concat(+(d<0),",").concat(m.x,",").concat(m.y,`
- `);if(a>0){var w=Zl({cx:r,cy:n,radius:a,angle:u,sign:d,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),_=w.circleTangency,O=w.lineTangency,N=w.theta,k=Zl({cx:r,cy:n,radius:a,angle:f,sign:-d,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),E=k.circleTangency,T=k.lineTangency,D=k.theta,A=c?Math.abs(u-f):Math.abs(u-f)-N-D;if(A<0&&s===0)return"".concat(j,"L").concat(r,",").concat(n,"Z");j+="L".concat(T.x,",").concat(T.y,`
- A`).concat(s,",").concat(s,",0,0,").concat(+(d<0),",").concat(E.x,",").concat(E.y,`
- A`).concat(a,",").concat(a,",0,").concat(+(A>180),",").concat(+(d>0),",").concat(_.x,",").concat(_.y,`
- A`).concat(s,",").concat(s,",0,0,").concat(+(d<0),",").concat(O.x,",").concat(O.y,"Z")}else j+="L".concat(r,",").concat(n,"Z");return j},sH={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Bk=function(t){var r=qb(qb({},sH),t),n=r.cx,a=r.cy,i=r.innerRadius,s=r.outerRadius,l=r.cornerRadius,c=r.forceCornerRadius,u=r.cornerIsExternal,f=r.startAngle,d=r.endAngle,h=r.className;if(s<i||f===d)return null;var p=ee("recharts-sector",h),g=s-i,y=gt(l,g,0,!0),b;return y>0&&Math.abs(f-d)<360?b=oH({cx:n,cy:a,innerRadius:i,outerRadius:s,cornerRadius:Math.min(y,g/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:f,endAngle:d}):b=Rk({cx:n,cy:a,innerRadius:i,outerRadius:s,startAngle:f,endAngle:d}),$.createElement("path",am({},X(r,!0),{className:p,d:b,role:"img"}))};function Vs(e){"@babel/helpers - typeof";return Vs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vs(e)}function im(){return im=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},im.apply(this,arguments)}function Xb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Qb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xb(Object(r),!0).forEach(function(n){lH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function lH(e,t,r){return t=cH(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cH(e){var t=uH(e,"string");return Vs(t)=="symbol"?t:t+""}function uH(e,t){if(Vs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Vs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Jb={curveBasisClosed:f4,curveBasisOpen:h4,curveBasis:d4,curveBumpX:Q5,curveBumpY:J5,curveLinearClosed:p4,curveLinear:Ld,curveMonotoneX:m4,curveMonotoneY:v4,curveNatural:y4,curveStep:g4,curveStepAfter:b4,curveStepBefore:x4},ec=function(t){return t.x===+t.x&&t.y===+t.y},$o=function(t){return t.x},To=function(t){return t.y},dH=function(t,r){if(Q(t))return t;var n="curve".concat(Md(t));return(n==="curveMonotone"||n==="curveBump")&&r?Jb["".concat(n).concat(r==="vertical"?"Y":"X")]:Jb[n]||Ld},fH=function(t){var r=t.type,n=r===void 0?"linear":r,a=t.points,i=a===void 0?[]:a,s=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,f=dH(n,l),d=u?i.filter(function(y){return ec(y)}):i,h;if(Array.isArray(s)){var p=u?s.filter(function(y){return ec(y)}):s,g=d.map(function(y,b){return Qb(Qb({},y),{},{base:p[b]})});return l==="vertical"?h=Hl().y(To).x1($o).x0(function(y){return y.base.x}):h=Hl().x($o).y1(To).y0(function(y){return y.base.y}),h.defined(ec).curve(f),h(g)}return l==="vertical"&&U(s)?h=Hl().y(To).x1($o).x0(s):U(s)?h=Hl().x($o).y1(To).y0(s):h=ES().x($o).y(To),h.defined(ec).curve(f),h(d)},gi=function(t){var r=t.className,n=t.points,a=t.path,i=t.pathRef;if((!n||!n.length)&&!a)return null;var s=n&&n.length?fH(t):a;return P.createElement("path",im({},X(t,!1),Qc(t),{className:ee("recharts-curve",r),d:s,ref:i}))},Fk={exports:{}},hH="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",pH=hH,mH=pH;function zk(){}function Wk(){}Wk.resetWarningCache=zk;var vH=function(){function e(n,a,i,s,l,c){if(c!==mH){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Wk,resetWarningCache:zk};return r.PropTypes=r,r};Fk.exports=vH();var yH=Fk.exports;const ce=de(yH),{getOwnPropertyNames:gH,getOwnPropertySymbols:xH}=Object,{hasOwnProperty:bH}=Object.prototype;function sh(e,t){return function(n,a,i){return e(n,a,i)&&t(n,a,i)}}function tc(e){return function(r,n,a){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,a);const{cache:i}=a,s=i.get(r),l=i.get(n);if(s&&l)return s===n&&l===r;i.set(r,n),i.set(n,r);const c=e(r,n,a);return i.delete(r),i.delete(n),c}}function jH(e){return e!=null?e[Symbol.toStringTag]:void 0}function Zb(e){return gH(e).concat(xH(e))}const wH=Object.hasOwn||((e,t)=>bH.call(e,t));function Ta(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const SH="__v",_H="__o",kH="_owner",{getOwnPropertyDescriptor:e1,keys:t1}=Object;function OH(e,t){return e.byteLength===t.byteLength&&Au(new Uint8Array(e),new Uint8Array(t))}function NH(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function PH(e,t){return e.byteLength===t.byteLength&&Au(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function AH(e,t){return Ta(e.getTime(),t.getTime())}function CH(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function EH(e,t){return e===t}function r1(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),i=e.entries();let s,l,c=0;for(;(s=i.next())&&!s.done;){const u=t.entries();let f=!1,d=0;for(;(l=u.next())&&!l.done;){if(a[d]){d++;continue}const h=s.value,p=l.value;if(r.equals(h[0],p[0],c,d,e,t,r)&&r.equals(h[1],p[1],h[0],p[0],e,t,r)){f=a[d]=!0;break}d++}if(!f)return!1;c++}return!0}const $H=Ta;function TH(e,t,r){const n=t1(e);let a=n.length;if(t1(t).length!==a)return!1;for(;a-- >0;)if(!Uk(e,t,r,n[a]))return!1;return!0}function Mo(e,t,r){const n=Zb(e);let a=n.length;if(Zb(t).length!==a)return!1;let i,s,l;for(;a-- >0;)if(i=n[a],!Uk(e,t,r,i)||(s=e1(e,i),l=e1(t,i),(s||l)&&(!s||!l||s.configurable!==l.configurable||s.enumerable!==l.enumerable||s.writable!==l.writable)))return!1;return!0}function MH(e,t){return Ta(e.valueOf(),t.valueOf())}function IH(e,t){return e.source===t.source&&e.flags===t.flags}function n1(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),i=e.values();let s,l;for(;(s=i.next())&&!s.done;){const c=t.values();let u=!1,f=0;for(;(l=c.next())&&!l.done;){if(!a[f]&&r.equals(s.value,l.value,s.value,l.value,e,t,r)){u=a[f]=!0;break}f++}if(!u)return!1}return!0}function Au(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function LH(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function Uk(e,t,r,n){return(n===kH||n===_H||n===SH)&&(e.$$typeof||t.$$typeof)?!0:wH(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const DH="[object ArrayBuffer]",RH="[object Arguments]",BH="[object Boolean]",FH="[object DataView]",zH="[object Date]",WH="[object Error]",UH="[object Map]",HH="[object Number]",KH="[object Object]",VH="[object RegExp]",GH="[object Set]",YH="[object String]",qH={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},XH="[object URL]",QH=Object.prototype.toString;function JH({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:a,areFunctionsEqual:i,areMapsEqual:s,areNumbersEqual:l,areObjectsEqual:c,arePrimitiveWrappersEqual:u,areRegExpsEqual:f,areSetsEqual:d,areTypedArraysEqual:h,areUrlsEqual:p,unknownTagComparators:g}){return function(b,v,m){if(b===v)return!0;if(b==null||v==null)return!1;const x=typeof b;if(x!==typeof v)return!1;if(x!=="object")return x==="number"?l(b,v,m):x==="function"?i(b,v,m):!1;const S=b.constructor;if(S!==v.constructor)return!1;if(S===Object)return c(b,v,m);if(Array.isArray(b))return t(b,v,m);if(S===Date)return n(b,v,m);if(S===RegExp)return f(b,v,m);if(S===Map)return s(b,v,m);if(S===Set)return d(b,v,m);const j=QH.call(b);if(j===zH)return n(b,v,m);if(j===VH)return f(b,v,m);if(j===UH)return s(b,v,m);if(j===GH)return d(b,v,m);if(j===KH)return typeof b.then!="function"&&typeof v.then!="function"&&c(b,v,m);if(j===XH)return p(b,v,m);if(j===WH)return a(b,v,m);if(j===RH)return c(b,v,m);if(qH[j])return h(b,v,m);if(j===DH)return e(b,v,m);if(j===FH)return r(b,v,m);if(j===BH||j===HH||j===YH)return u(b,v,m);if(g){let w=g[j];if(!w){const _=jH(b);_&&(w=g[_])}if(w)return w(b,v,m)}return!1}}function ZH({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:OH,areArraysEqual:r?Mo:NH,areDataViewsEqual:PH,areDatesEqual:AH,areErrorsEqual:CH,areFunctionsEqual:EH,areMapsEqual:r?sh(r1,Mo):r1,areNumbersEqual:$H,areObjectsEqual:r?Mo:TH,arePrimitiveWrappersEqual:MH,areRegExpsEqual:IH,areSetsEqual:r?sh(n1,Mo):n1,areTypedArraysEqual:r?sh(Au,Mo):Au,areUrlsEqual:LH,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const a=tc(n.areArraysEqual),i=tc(n.areMapsEqual),s=tc(n.areObjectsEqual),l=tc(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:s,areSetsEqual:l})}return n}function eK(e){return function(t,r,n,a,i,s,l){return e(t,r,l)}}function tK({circular:e,comparator:t,createState:r,equals:n,strict:a}){if(r)return function(l,c){const{cache:u=e?new WeakMap:void 0,meta:f}=r();return t(l,c,{cache:u,equals:n,meta:f,strict:a})};if(e)return function(l,c){return t(l,c,{cache:new WeakMap,equals:n,meta:void 0,strict:a})};const i={cache:void 0,equals:n,meta:void 0,strict:a};return function(l,c){return t(l,c,i)}}const rK=Hn();Hn({strict:!0});Hn({circular:!0});Hn({circular:!0,strict:!0});Hn({createInternalComparator:()=>Ta});Hn({strict:!0,createInternalComparator:()=>Ta});Hn({circular:!0,createInternalComparator:()=>Ta});Hn({circular:!0,createInternalComparator:()=>Ta,strict:!0});function Hn(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:a=!1}=e,i=ZH(e),s=JH(i),l=r?r(s):eK(s);return tK({circular:t,comparator:s,createState:n,equals:l,strict:a})}function nK(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function a1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function a(i){r<0&&(r=i),i-r>t?(e(i),r=-1):nK(a)};requestAnimationFrame(n)}function om(e){"@babel/helpers - typeof";return om=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},om(e)}function aK(e){return lK(e)||sK(e)||oK(e)||iK()}function iK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oK(e,t){if(e){if(typeof e=="string")return i1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i1(e,t)}}function i1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function sK(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lK(e){if(Array.isArray(e))return e}function cK(){var e={},t=function(){return null},r=!1,n=function a(i){if(!r){if(Array.isArray(i)){if(!i.length)return;var s=i,l=aK(s),c=l[0],u=l.slice(1);if(typeof c=="number"){a1(a.bind(null,u),c);return}a(c),a1(a.bind(null,u));return}om(i)==="object"&&(e=i,t(e)),typeof i=="function"&&i()}};return{stop:function(){r=!0},start:function(i){r=!1,n(i)},subscribe:function(i){return t=i,function(){t=function(){return null}}}}}function Gs(e){"@babel/helpers - typeof";return Gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gs(e)}function o1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function s1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?o1(Object(r),!0).forEach(function(n){Hk(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Hk(e,t,r){return t=uK(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uK(e){var t=dK(e,"string");return Gs(t)==="symbol"?t:String(t)}function dK(e,t){if(Gs(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Gs(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var fK=function(t,r){return[Object.keys(t),Object.keys(r)].reduce(function(n,a){return n.filter(function(i){return a.includes(i)})})},hK=function(t){return t},pK=function(t){return t.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},ns=function(t,r){return Object.keys(r).reduce(function(n,a){return s1(s1({},n),{},Hk({},a,t(a,r[a])))},{})},l1=function(t,r,n){return t.map(function(a){return"".concat(pK(a)," ").concat(r,"ms ").concat(n)}).join(",")};function mK(e,t){return gK(e)||yK(e,t)||Kk(e,t)||vK()}function vK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yK(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function gK(e){if(Array.isArray(e))return e}function xK(e){return wK(e)||jK(e)||Kk(e)||bK()}function bK(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kk(e,t){if(e){if(typeof e=="string")return sm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sm(e,t)}}function jK(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function wK(e){if(Array.isArray(e))return sm(e)}function sm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Cu=1e-4,Vk=function(t,r){return[0,3*t,3*r-6*t,3*t-3*r+1]},Gk=function(t,r){return t.map(function(n,a){return n*Math.pow(r,a)}).reduce(function(n,a){return n+a})},c1=function(t,r){return function(n){var a=Vk(t,r);return Gk(a,n)}},SK=function(t,r){return function(n){var a=Vk(t,r),i=[].concat(xK(a.map(function(s,l){return s*l}).slice(1)),[0]);return Gk(i,n)}},u1=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=r[0],i=r[1],s=r[2],l=r[3];if(r.length===1)switch(r[0]){case"linear":a=0,i=0,s=1,l=1;break;case"ease":a=.25,i=.1,s=.25,l=1;break;case"ease-in":a=.42,i=0,s=1,l=1;break;case"ease-out":a=.42,i=0,s=.58,l=1;break;case"ease-in-out":a=0,i=0,s=.58,l=1;break;default:{var c=r[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(b){return parseFloat(b)}),f=mK(u,4);a=f[0],i=f[1],s=f[2],l=f[3]}}}var d=c1(a,s),h=c1(i,l),p=SK(a,s),g=function(v){return v>1?1:v<0?0:v},y=function(v){for(var m=v>1?1:v,x=m,S=0;S<8;++S){var j=d(x)-m,w=p(x);if(Math.abs(j-m)<Cu||w<Cu)return h(x);x=g(x-j/w)}return h(x)};return y.isStepper=!1,y},_K=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,a=t.damping,i=a===void 0?8:a,s=t.dt,l=s===void 0?17:s,c=function(f,d,h){var p=-(f-d)*n,g=h*i,y=h+(p-g)*l/1e3,b=h*l/1e3+f;return Math.abs(b-d)<Cu&&Math.abs(y)<Cu?[d,0]:[b,y]};return c.isStepper=!0,c.dt=l,c},kK=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=r[0];if(typeof a=="string")switch(a){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return u1(a);case"spring":return _K();default:if(a.split("(")[0]==="cubic-bezier")return u1(a)}return typeof a=="function"?a:null};function Ys(e){"@babel/helpers - typeof";return Ys=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ys(e)}function d1(e){return PK(e)||NK(e)||Yk(e)||OK()}function OK(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NK(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function PK(e){if(Array.isArray(e))return cm(e)}function f1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ot(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?f1(Object(r),!0).forEach(function(n){lm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function lm(e,t,r){return t=AK(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function AK(e){var t=CK(e,"string");return Ys(t)==="symbol"?t:String(t)}function CK(e,t){if(Ys(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ys(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function EK(e,t){return MK(e)||TK(e,t)||Yk(e,t)||$K()}function $K(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yk(e,t){if(e){if(typeof e=="string")return cm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cm(e,t)}}function cm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function TK(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function MK(e){if(Array.isArray(e))return e}var Eu=function(t,r,n){return t+(r-t)*n},um=function(t){var r=t.from,n=t.to;return r!==n},IK=function e(t,r,n){var a=ns(function(i,s){if(um(s)){var l=t(s.from,s.to,s.velocity),c=EK(l,2),u=c[0],f=c[1];return ot(ot({},s),{},{from:u,velocity:f})}return s},r);return n<1?ns(function(i,s){return um(s)?ot(ot({},s),{},{velocity:Eu(s.velocity,a[i].velocity,n),from:Eu(s.from,a[i].from,n)}):s},r):e(t,a,n-1)};const LK=function(e,t,r,n,a){var i=fK(e,t),s=i.reduce(function(b,v){return ot(ot({},b),{},lm({},v,[e[v],t[v]]))},{}),l=i.reduce(function(b,v){return ot(ot({},b),{},lm({},v,{from:e[v],velocity:0,to:t[v]}))},{}),c=-1,u,f,d=function(){return null},h=function(){return ns(function(v,m){return m.from},l)},p=function(){return!Object.values(l).filter(um).length},g=function(v){u||(u=v);var m=v-u,x=m/r.dt;l=IK(r,l,x),a(ot(ot(ot({},e),t),h())),u=v,p()||(c=requestAnimationFrame(d))},y=function(v){f||(f=v);var m=(v-f)/n,x=ns(function(j,w){return Eu.apply(void 0,d1(w).concat([r(m)]))},s);if(a(ot(ot(ot({},e),t),x)),m<1)c=requestAnimationFrame(d);else{var S=ns(function(j,w){return Eu.apply(void 0,d1(w).concat([r(1)]))},s);a(ot(ot(ot({},e),t),S))}};return d=r.isStepper?g:y,function(){return requestAnimationFrame(d),function(){cancelAnimationFrame(c)}}};function Ii(e){"@babel/helpers - typeof";return Ii=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ii(e)}var DK=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function RK(e,t){if(e==null)return{};var r=BK(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function BK(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function lh(e){return UK(e)||WK(e)||zK(e)||FK()}function FK(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zK(e,t){if(e){if(typeof e=="string")return dm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return dm(e,t)}}function WK(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function UK(e){if(Array.isArray(e))return dm(e)}function dm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function h1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function lr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?h1(Object(r),!0).forEach(function(n){Wo(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Wo(e,t,r){return t=qk(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function HK(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KK(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,qk(n.key),n)}}function VK(e,t,r){return t&&KK(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function qk(e){var t=GK(e,"string");return Ii(t)==="symbol"?t:String(t)}function GK(e,t){if(Ii(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ii(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function YK(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fm(e,t)}function fm(e,t){return fm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},fm(e,t)}function qK(e){var t=XK();return function(){var n=$u(e),a;if(t){var i=$u(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return hm(this,a)}}function hm(e,t){if(t&&(Ii(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pm(e)}function pm(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function XK(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function $u(e){return $u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$u(e)}var xr=function(e){YK(r,e);var t=qK(r);function r(n,a){var i;HK(this,r),i=t.call(this,n,a);var s=i.props,l=s.isActive,c=s.attributeName,u=s.from,f=s.to,d=s.steps,h=s.children,p=s.duration;if(i.handleStyleChange=i.handleStyleChange.bind(pm(i)),i.changeStyle=i.changeStyle.bind(pm(i)),!l||p<=0)return i.state={style:{}},typeof h=="function"&&(i.state={style:f}),hm(i);if(d&&d.length)i.state={style:d[0].style};else if(u){if(typeof h=="function")return i.state={style:u},hm(i);i.state={style:c?Wo({},c,u):u}}else i.state={style:{}};return i}return VK(r,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,s=a.canBegin;this.mounted=!0,!(!i||!s)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,s=i.isActive,l=i.canBegin,c=i.attributeName,u=i.shouldReAnimate,f=i.to,d=i.from,h=this.state.style;if(l){if(!s){var p={style:c?Wo({},c,f):f};this.state&&h&&(c&&h[c]!==f||!c&&h!==f)&&this.setState(p);return}if(!(rK(a.to,f)&&a.canBegin&&a.isActive)){var g=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var y=g||u?d:a.to;if(this.state&&h){var b={style:c?Wo({},c,y):y};(c&&h[c]!==y||!c&&h!==y)&&this.setState(b)}this.runAnimation(lr(lr({},this.props),{},{from:y,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var i=this,s=a.from,l=a.to,c=a.duration,u=a.easing,f=a.begin,d=a.onAnimationEnd,h=a.onAnimationStart,p=LK(s,l,kK(u),c,this.changeStyle),g=function(){i.stopJSAnimation=p()};this.manager.start([h,f,g,c,d])}},{key:"runStepAnimation",value:function(a){var i=this,s=a.steps,l=a.begin,c=a.onAnimationStart,u=s[0],f=u.style,d=u.duration,h=d===void 0?0:d,p=function(y,b,v){if(v===0)return y;var m=b.duration,x=b.easing,S=x===void 0?"ease":x,j=b.style,w=b.properties,_=b.onAnimationEnd,O=v>0?s[v-1]:b,N=w||Object.keys(j);if(typeof S=="function"||S==="spring")return[].concat(lh(y),[i.runJSAnimation.bind(i,{from:O.style,to:j,duration:m,easing:S}),m]);var k=l1(N,m,S),E=lr(lr(lr({},O.style),j),{},{transition:k});return[].concat(lh(y),[E,m,_]).filter(hK)};return this.manager.start([c].concat(lh(s.reduce(p,[f,Math.max(h,l)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=cK());var i=a.begin,s=a.duration,l=a.attributeName,c=a.to,u=a.easing,f=a.onAnimationStart,d=a.onAnimationEnd,h=a.steps,p=a.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(a);return}if(h.length>1){this.runStepAnimation(a);return}var y=l?Wo({},l,c):c,b=l1(Object.keys(y),s,u);g.start([f,i,lr(lr({},y),{},{transition:b}),s,d])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var s=a.duration;a.attributeName,a.easing;var l=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var c=RK(a,DK),u=P.Children.count(i),f=this.state.style;if(typeof i=="function")return i(f);if(!l||u===0||s<=0)return i;var d=function(p){var g=p.props,y=g.style,b=y===void 0?{}:y,v=g.className,m=P.cloneElement(p,lr(lr({},c),{},{style:lr(lr({},b),f),className:v}));return m};return u===1?d(P.Children.only(i)):$.createElement("div",null,P.Children.map(i,function(h){return d(h)}))}}]),r}(P.PureComponent);xr.displayName="Animate";xr.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};xr.propTypes={from:ce.oneOfType([ce.object,ce.string]),to:ce.oneOfType([ce.object,ce.string]),attributeName:ce.string,duration:ce.number,begin:ce.number,easing:ce.oneOfType([ce.string,ce.func]),steps:ce.arrayOf(ce.shape({duration:ce.number.isRequired,style:ce.object.isRequired,easing:ce.oneOfType([ce.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),ce.func]),properties:ce.arrayOf("string"),onAnimationEnd:ce.func})),children:ce.oneOfType([ce.node,ce.func]),isActive:ce.bool,canBegin:ce.bool,onAnimationEnd:ce.func,shouldReAnimate:ce.bool,onAnimationStart:ce.func,onAnimationReStart:ce.func};function qs(e){"@babel/helpers - typeof";return qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qs(e)}function Tu(){return Tu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tu.apply(this,arguments)}function QK(e,t){return tV(e)||eV(e,t)||ZK(e,t)||JK()}function JK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ZK(e,t){if(e){if(typeof e=="string")return p1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return p1(e,t)}}function p1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function eV(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function tV(e){if(Array.isArray(e))return e}function m1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function v1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?m1(Object(r),!0).forEach(function(n){rV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rV(e,t,r){return t=nV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nV(e){var t=aV(e,"string");return qs(t)=="symbol"?t:t+""}function aV(e,t){if(qs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(qs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var y1=function(t,r,n,a,i){var s=Math.min(Math.abs(n)/2,Math.abs(a)/2),l=a>=0?1:-1,c=n>=0?1:-1,u=a>=0&&n>=0||a<0&&n<0?1:0,f;if(s>0&&i instanceof Array){for(var d=[0,0,0,0],h=0,p=4;h<p;h++)d[h]=i[h]>s?s:i[h];f="M".concat(t,",").concat(r+l*d[0]),d[0]>0&&(f+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(u,",").concat(t+c*d[0],",").concat(r)),f+="L ".concat(t+n-c*d[1],",").concat(r),d[1]>0&&(f+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(u,`,
- `).concat(t+n,",").concat(r+l*d[1])),f+="L ".concat(t+n,",").concat(r+a-l*d[2]),d[2]>0&&(f+="A ".concat(d[2],",").concat(d[2],",0,0,").concat(u,`,
- `).concat(t+n-c*d[2],",").concat(r+a)),f+="L ".concat(t+c*d[3],",").concat(r+a),d[3]>0&&(f+="A ".concat(d[3],",").concat(d[3],",0,0,").concat(u,`,
- `).concat(t,",").concat(r+a-l*d[3])),f+="Z"}else if(s>0&&i===+i&&i>0){var g=Math.min(s,i);f="M ".concat(t,",").concat(r+l*g,`
- A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+c*g,",").concat(r,`
- L `).concat(t+n-c*g,",").concat(r,`
- A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+n,",").concat(r+l*g,`
- L `).concat(t+n,",").concat(r+a-l*g,`
- A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+n-c*g,",").concat(r+a,`
- L `).concat(t+c*g,",").concat(r+a,`
- A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t,",").concat(r+a-l*g," Z")}else f="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(a," h ").concat(-n," Z");return f},iV=function(t,r){if(!t||!r)return!1;var n=t.x,a=t.y,i=r.x,s=r.y,l=r.width,c=r.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(i,i+l),f=Math.max(i,i+l),d=Math.min(s,s+c),h=Math.max(s,s+c);return n>=u&&n<=f&&a>=d&&a<=h}return!1},oV={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},By=function(t){var r=v1(v1({},oV),t),n=P.useRef(),a=P.useState(-1),i=QK(a,2),s=i[0],l=i[1];P.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&l(S)}catch{}},[]);var c=r.x,u=r.y,f=r.width,d=r.height,h=r.radius,p=r.className,g=r.animationEasing,y=r.animationDuration,b=r.animationBegin,v=r.isAnimationActive,m=r.isUpdateAnimationActive;if(c!==+c||u!==+u||f!==+f||d!==+d||f===0||d===0)return null;var x=ee("recharts-rectangle",p);return m?$.createElement(xr,{canBegin:s>0,from:{width:f,height:d,x:c,y:u},to:{width:f,height:d,x:c,y:u},duration:y,animationEasing:g,isActive:m},function(S){var j=S.width,w=S.height,_=S.x,O=S.y;return $.createElement(xr,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:y,isActive:v,easing:g},$.createElement("path",Tu({},X(r,!0),{className:x,d:y1(_,O,j,w,h),ref:n})))}):$.createElement("path",Tu({},X(r,!0),{className:x,d:y1(c,u,f,d,h)}))},sV=["points","className","baseLinePoints","connectNulls"];function ai(){return ai=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ai.apply(this,arguments)}function lV(e,t){if(e==null)return{};var r=cV(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function cV(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function g1(e){return hV(e)||fV(e)||dV(e)||uV()}function uV(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dV(e,t){if(e){if(typeof e=="string")return mm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mm(e,t)}}function fV(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function hV(e){if(Array.isArray(e))return mm(e)}function mm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var x1=function(t){return t&&t.x===+t.x&&t.y===+t.y},pV=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){x1(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),x1(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},as=function(t,r){var n=pV(t);r&&(n=[n.reduce(function(i,s){return[].concat(g1(i),g1(s))},[])]);var a=n.map(function(i){return i.reduce(function(s,l,c){return"".concat(s).concat(c===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return n.length===1?"".concat(a,"Z"):a},mV=function(t,r,n){var a=as(t,n);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(as(r.reverse(),n).slice(1))},vV=function(t){var r=t.points,n=t.className,a=t.baseLinePoints,i=t.connectNulls,s=lV(t,sV);if(!r||!r.length)return null;var l=ee("recharts-polygon",n);if(a&&a.length){var c=s.stroke&&s.stroke!=="none",u=mV(r,a,i);return $.createElement("g",{className:l},$.createElement("path",ai({},X(s,!0),{fill:u.slice(-1)==="Z"?s.fill:"none",stroke:"none",d:u})),c?$.createElement("path",ai({},X(s,!0),{fill:"none",d:as(r,i)})):null,c?$.createElement("path",ai({},X(s,!0),{fill:"none",d:as(a,i)})):null)}var f=as(r,i);return $.createElement("path",ai({},X(s,!0),{fill:f.slice(-1)==="Z"?s.fill:"none",className:l,d:f}))};function vm(){return vm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vm.apply(this,arguments)}var Jd=function(t){var r=t.cx,n=t.cy,a=t.r,i=t.className,s=ee("recharts-dot",i);return r===+r&&n===+n&&a===+a?P.createElement("circle",vm({},X(t,!1),Qc(t),{className:s,cx:r,cy:n,r:a})):null};function Xs(e){"@babel/helpers - typeof";return Xs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xs(e)}var yV=["x","y","top","left","width","height","className"];function ym(){return ym=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ym.apply(this,arguments)}function b1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function gV(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?b1(Object(r),!0).forEach(function(n){xV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xV(e,t,r){return t=bV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bV(e){var t=jV(e,"string");return Xs(t)=="symbol"?t:t+""}function jV(e,t){if(Xs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Xs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wV(e,t){if(e==null)return{};var r=SV(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function SV(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var _V=function(t,r,n,a,i,s){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(s,",").concat(r,"h").concat(n)},kV=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,s=t.top,l=s===void 0?0:s,c=t.left,u=c===void 0?0:c,f=t.width,d=f===void 0?0:f,h=t.height,p=h===void 0?0:h,g=t.className,y=wV(t,yV),b=gV({x:n,y:i,top:l,left:u,width:d,height:p},y);return!U(n)||!U(i)||!U(d)||!U(p)||!U(l)||!U(u)?null:$.createElement("path",ym({},X(b,!0),{className:ee("recharts-cross",g),d:_V(n,i,d,p,l,u)}))},OV=Gd,NV=ak,PV=Mr;function AV(e,t){return e&&e.length?OV(e,PV(t),NV):void 0}var CV=AV;const EV=de(CV);var $V=Gd,TV=Mr,MV=ik;function IV(e,t){return e&&e.length?$V(e,TV(t),MV):void 0}var LV=IV;const DV=de(LV);var RV=["cx","cy","angle","ticks","axisLine"],BV=["ticks","tick","angle","tickFormatter","stroke"];function Li(e){"@babel/helpers - typeof";return Li=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Li(e)}function is(){return is=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},is.apply(this,arguments)}function j1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Yn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?j1(Object(r),!0).forEach(function(n){Zd(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function w1(e,t){if(e==null)return{};var r=FV(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function FV(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function zV(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Qk(n.key),n)}}function WV(e,t,r){return t&&S1(e.prototype,t),r&&S1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function UV(e,t,r){return t=Mu(t),HV(e,Xk()?Reflect.construct(t,r||[],Mu(e).constructor):t.apply(e,r))}function HV(e,t){if(t&&(Li(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return KV(e)}function KV(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Xk=function(){return!!e})()}function Mu(e){return Mu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Mu(e)}function VV(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gm(e,t)}function gm(e,t){return gm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},gm(e,t)}function Zd(e,t,r){return t=Qk(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qk(e){var t=GV(e,"string");return Li(t)=="symbol"?t:t+""}function GV(e,t){if(Li(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Li(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var bl=function(e){function t(){return zV(this,t),UV(this,t,arguments)}return VV(t,e),WV(t,[{key:"getTickValueCoord",value:function(n){var a=n.coordinate,i=this.props,s=i.angle,l=i.cx,c=i.cy;return ye(l,c,a,s)}},{key:"getTickTextAnchor",value:function(){var n=this.props.orientation,a;switch(n){case"left":a="end";break;case"right":a="start";break;default:a="middle";break}return a}},{key:"getViewBox",value:function(){var n=this.props,a=n.cx,i=n.cy,s=n.angle,l=n.ticks,c=EV(l,function(f){return f.coordinate||0}),u=DV(l,function(f){return f.coordinate||0});return{cx:a,cy:i,startAngle:s,endAngle:s,innerRadius:u.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.cx,i=n.cy,s=n.angle,l=n.ticks,c=n.axisLine,u=w1(n,RV),f=l.reduce(function(g,y){return[Math.min(g[0],y.coordinate),Math.max(g[1],y.coordinate)]},[1/0,-1/0]),d=ye(a,i,f[0],s),h=ye(a,i,f[1],s),p=Yn(Yn(Yn({},X(u,!1)),{},{fill:"none"},X(c,!1)),{},{x1:d.x,y1:d.y,x2:h.x,y2:h.y});return $.createElement("line",is({className:"recharts-polar-radius-axis-line"},p))}},{key:"renderTicks",value:function(){var n=this,a=this.props,i=a.ticks,s=a.tick,l=a.angle,c=a.tickFormatter,u=a.stroke,f=w1(a,BV),d=this.getTickTextAnchor(),h=X(f,!1),p=X(s,!1),g=i.map(function(y,b){var v=n.getTickValueCoord(y),m=Yn(Yn(Yn(Yn({textAnchor:d,transform:"rotate(".concat(90-l,", ").concat(v.x,", ").concat(v.y,")")},h),{},{stroke:"none",fill:u},p),{},{index:b},v),{},{payload:y});return $.createElement(ne,is({className:ee("recharts-polar-radius-axis-tick",Lk(s)),key:"tick-".concat(y.coordinate)},Zr(n.props,y,b)),t.renderTickItem(s,m,c?c(y.value,b):y.value))});return $.createElement(ne,{className:"recharts-polar-radius-axis-ticks"},g)}},{key:"render",value:function(){var n=this.props,a=n.ticks,i=n.axisLine,s=n.tick;return!a||!a.length?null:$.createElement(ne,{className:ee("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),s&&this.renderTicks(),tt.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(n,a,i){var s;return $.isValidElement(n)?s=$.cloneElement(n,a):Q(n)?s=n(a):s=$.createElement(wa,is({},a,{className:"recharts-polar-radius-axis-tick-value"}),i),s}}])}(P.PureComponent);Zd(bl,"displayName","PolarRadiusAxis");Zd(bl,"axisType","radiusAxis");Zd(bl,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function Di(e){"@babel/helpers - typeof";return Di=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Di(e)}function ta(){return ta=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ta.apply(this,arguments)}function _1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function qn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_1(Object(r),!0).forEach(function(n){ef(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function YV(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function k1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Zk(n.key),n)}}function qV(e,t,r){return t&&k1(e.prototype,t),r&&k1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function XV(e,t,r){return t=Iu(t),QV(e,Jk()?Reflect.construct(t,r||[],Iu(e).constructor):t.apply(e,r))}function QV(e,t){if(t&&(Di(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return JV(e)}function JV(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Jk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Jk=function(){return!!e})()}function Iu(e){return Iu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Iu(e)}function ZV(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xm(e,t)}function xm(e,t){return xm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},xm(e,t)}function ef(e,t,r){return t=Zk(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zk(e){var t=eG(e,"string");return Di(t)=="symbol"?t:t+""}function eG(e,t){if(Di(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Di(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var tG=Math.PI/180,O1=1e-5,jl=function(e){function t(){return YV(this,t),XV(this,t,arguments)}return ZV(t,e),qV(t,[{key:"getTickLineCoord",value:function(n){var a=this.props,i=a.cx,s=a.cy,l=a.radius,c=a.orientation,u=a.tickSize,f=u||8,d=ye(i,s,l,n.coordinate),h=ye(i,s,l+(c==="inner"?-1:1)*f,n.coordinate);return{x1:d.x,y1:d.y,x2:h.x,y2:h.y}}},{key:"getTickTextAnchor",value:function(n){var a=this.props.orientation,i=Math.cos(-n.coordinate*tG),s;return i>O1?s=a==="outer"?"start":"end":i<-O1?s=a==="outer"?"end":"start":s="middle",s}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.cx,i=n.cy,s=n.radius,l=n.axisLine,c=n.axisLineType,u=qn(qn({},X(this.props,!1)),{},{fill:"none"},X(l,!1));if(c==="circle")return $.createElement(Jd,ta({className:"recharts-polar-angle-axis-line"},u,{cx:a,cy:i,r:s}));var f=this.props.ticks,d=f.map(function(h){return ye(a,i,s,h.coordinate)});return $.createElement(vV,ta({className:"recharts-polar-angle-axis-line"},u,{points:d}))}},{key:"renderTicks",value:function(){var n=this,a=this.props,i=a.ticks,s=a.tick,l=a.tickLine,c=a.tickFormatter,u=a.stroke,f=X(this.props,!1),d=X(s,!1),h=qn(qn({},f),{},{fill:"none"},X(l,!1)),p=i.map(function(g,y){var b=n.getTickLineCoord(g),v=n.getTickTextAnchor(g),m=qn(qn(qn({textAnchor:v},f),{},{stroke:"none",fill:u},d),{},{index:y,payload:g,x:b.x2,y:b.y2});return $.createElement(ne,ta({className:ee("recharts-polar-angle-axis-tick",Lk(s)),key:"tick-".concat(g.coordinate)},Zr(n.props,g,y)),l&&$.createElement("line",ta({className:"recharts-polar-angle-axis-tick-line"},h,b)),s&&t.renderTickItem(s,m,c?c(g.value,y):g.value))});return $.createElement(ne,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var n=this.props,a=n.ticks,i=n.radius,s=n.axisLine;return i<=0||!a||!a.length?null:$.createElement(ne,{className:ee("recharts-polar-angle-axis",this.props.className)},s&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,a,i){var s;return $.isValidElement(n)?s=$.cloneElement(n,a):Q(n)?s=n(a):s=$.createElement(wa,ta({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),s}}])}(P.PureComponent);ef(jl,"displayName","PolarAngleAxis");ef(jl,"axisType","angleAxis");ef(jl,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var rG=t_,nG=rG(Object.getPrototypeOf,Object),aG=nG,iG=an,oG=aG,sG=on,lG="[object Object]",cG=Function.prototype,uG=Object.prototype,eO=cG.toString,dG=uG.hasOwnProperty,fG=eO.call(Object);function hG(e){if(!sG(e)||iG(e)!=lG)return!1;var t=oG(e);if(t===null)return!0;var r=dG.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&eO.call(r)==fG}var pG=hG;const mG=de(pG);var vG=an,yG=on,gG="[object Boolean]";function xG(e){return e===!0||e===!1||yG(e)&&vG(e)==gG}var bG=xG;const jG=de(bG);function Qs(e){"@babel/helpers - typeof";return Qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qs(e)}function Lu(){return Lu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Lu.apply(this,arguments)}function wG(e,t){return OG(e)||kG(e,t)||_G(e,t)||SG()}function SG(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _G(e,t){if(e){if(typeof e=="string")return N1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return N1(e,t)}}function N1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function kG(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function OG(e){if(Array.isArray(e))return e}function P1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function A1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?P1(Object(r),!0).forEach(function(n){NG(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function NG(e,t,r){return t=PG(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function PG(e){var t=AG(e,"string");return Qs(t)=="symbol"?t:t+""}function AG(e,t){if(Qs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Qs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var C1=function(t,r,n,a,i){var s=n-a,l;return l="M ".concat(t,",").concat(r),l+="L ".concat(t+n,",").concat(r),l+="L ".concat(t+n-s/2,",").concat(r+i),l+="L ".concat(t+n-s/2-a,",").concat(r+i),l+="L ".concat(t,",").concat(r," Z"),l},CG={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},EG=function(t){var r=A1(A1({},CG),t),n=P.useRef(),a=P.useState(-1),i=wG(a,2),s=i[0],l=i[1];P.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var x=n.current.getTotalLength();x&&l(x)}catch{}},[]);var c=r.x,u=r.y,f=r.upperWidth,d=r.lowerWidth,h=r.height,p=r.className,g=r.animationEasing,y=r.animationDuration,b=r.animationBegin,v=r.isUpdateAnimationActive;if(c!==+c||u!==+u||f!==+f||d!==+d||h!==+h||f===0&&d===0||h===0)return null;var m=ee("recharts-trapezoid",p);return v?$.createElement(xr,{canBegin:s>0,from:{upperWidth:0,lowerWidth:0,height:h,x:c,y:u},to:{upperWidth:f,lowerWidth:d,height:h,x:c,y:u},duration:y,animationEasing:g,isActive:v},function(x){var S=x.upperWidth,j=x.lowerWidth,w=x.height,_=x.x,O=x.y;return $.createElement(xr,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:y,easing:g},$.createElement("path",Lu({},X(r,!0),{className:m,d:C1(_,O,S,j,w),ref:n})))}):$.createElement("g",null,$.createElement("path",Lu({},X(r,!0),{className:m,d:C1(c,u,f,d,h)})))},$G=["option","shapeType","propTransformer","activeClassName","isActive"];function Js(e){"@babel/helpers - typeof";return Js=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Js(e)}function TG(e,t){if(e==null)return{};var r=MG(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function MG(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function E1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Du(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?E1(Object(r),!0).forEach(function(n){IG(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function IG(e,t,r){return t=LG(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function LG(e){var t=DG(e,"string");return Js(t)=="symbol"?t:t+""}function DG(e,t){if(Js(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Js(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function RG(e,t){return Du(Du({},t),e)}function BG(e,t){return e==="symbols"}function $1(e){var t=e.shapeType,r=e.elementProps;switch(t){case"rectangle":return $.createElement(By,r);case"trapezoid":return $.createElement(EG,r);case"sector":return $.createElement(Bk,r);case"symbols":if(BG(t))return $.createElement(ny,r);break;default:return null}}function FG(e){return P.isValidElement(e)?e.props:e}function Fy(e){var t=e.option,r=e.shapeType,n=e.propTransformer,a=n===void 0?RG:n,i=e.activeClassName,s=i===void 0?"recharts-active-shape":i,l=e.isActive,c=TG(e,$G),u;if(P.isValidElement(t))u=P.cloneElement(t,Du(Du({},c),FG(t)));else if(Q(t))u=t(c);else if(mG(t)&&!jG(t)){var f=a(t,c);u=$.createElement($1,{shapeType:r,elementProps:f})}else{var d=c;u=$.createElement($1,{shapeType:r,elementProps:d})}return l?$.createElement(ne,{className:s},u):u}function tf(e,t){return t!=null&&"trapezoids"in e.props}function rf(e,t){return t!=null&&"sectors"in e.props}function Zs(e,t){return t!=null&&"points"in e.props}function zG(e,t){var r,n,a=e.x===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.x)||e.x===t.x,i=e.y===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.y)||e.y===t.y;return a&&i}function WG(e,t){var r=e.endAngle===t.endAngle,n=e.startAngle===t.startAngle;return r&&n}function UG(e,t){var r=e.x===t.x,n=e.y===t.y,a=e.z===t.z;return r&&n&&a}function HG(e,t){var r;return tf(e,t)?r=zG:rf(e,t)?r=WG:Zs(e,t)&&(r=UG),r}function KG(e,t){var r;return tf(e,t)?r="trapezoids":rf(e,t)?r="sectors":Zs(e,t)&&(r="points"),r}function VG(e,t){if(tf(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}if(rf(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}return Zs(e,t)?t.payload:{}}function GG(e){var t=e.activeTooltipItem,r=e.graphicalItem,n=e.itemData,a=KG(r,t),i=VG(r,t),s=n.filter(function(c,u){var f=Sa(i,c),d=r.props[a].filter(function(g){var y=HG(r,t);return y(g,t)}),h=r.props[a].indexOf(d[d.length-1]),p=u===h;return f&&p}),l=n.indexOf(s[s.length-1]);return l}var Sc;function Ri(e){"@babel/helpers - typeof";return Ri=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ri(e)}function ii(){return ii=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ii.apply(this,arguments)}function T1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function xe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?T1(Object(r),!0).forEach(function(n){Yt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function YG(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function M1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,rO(n.key),n)}}function qG(e,t,r){return t&&M1(e.prototype,t),r&&M1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function XG(e,t,r){return t=Ru(t),QG(e,tO()?Reflect.construct(t,r||[],Ru(e).constructor):t.apply(e,r))}function QG(e,t){if(t&&(Ri(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return JG(e)}function JG(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tO=function(){return!!e})()}function Ru(e){return Ru=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ru(e)}function ZG(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bm(e,t)}function bm(e,t){return bm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},bm(e,t)}function Yt(e,t,r){return t=rO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rO(e){var t=eY(e,"string");return Ri(t)=="symbol"?t:t+""}function eY(e,t){if(Ri(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ri(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var jr=function(e){function t(r){var n;return YG(this,t),n=XG(this,t,[r]),Yt(n,"pieRef",null),Yt(n,"sectorRefs",[]),Yt(n,"id",co("recharts-pie-")),Yt(n,"handleAnimationEnd",function(){var a=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),Q(a)&&a()}),Yt(n,"handleAnimationStart",function(){var a=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),Q(a)&&a()}),n.state={isAnimationFinished:!r.isAnimationActive,prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,sectorToFocus:0},n}return ZG(t,e),qG(t,[{key:"isActiveIndex",value:function(n){var a=this.props.activeIndex;return Array.isArray(a)?a.indexOf(n)!==-1:n===a}},{key:"hasActiveIndex",value:function(){var n=this.props.activeIndex;return Array.isArray(n)?n.length!==0:n||n===0}},{key:"renderLabels",value:function(n){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var i=this.props,s=i.label,l=i.labelLine,c=i.dataKey,u=i.valueKey,f=X(this.props,!1),d=X(s,!1),h=X(l,!1),p=s&&s.offsetRadius||20,g=n.map(function(y,b){var v=(y.startAngle+y.endAngle)/2,m=ye(y.cx,y.cy,y.outerRadius+p,v),x=xe(xe(xe(xe({},f),y),{},{stroke:"none"},d),{},{index:b,textAnchor:t.getTextAnchor(m.x,y.cx)},m),S=xe(xe(xe(xe({},f),y),{},{fill:"none",stroke:y.fill},h),{},{index:b,points:[ye(y.cx,y.cy,y.outerRadius,v),m]}),j=c;return te(c)&&te(u)?j="value":te(c)&&(j=u),$.createElement(ne,{key:"label-".concat(y.startAngle,"-").concat(y.endAngle,"-").concat(y.midAngle,"-").concat(b)},l&&t.renderLabelLineItem(l,S,"line"),t.renderLabelItem(s,x,Be(y,j)))});return $.createElement(ne,{className:"recharts-pie-labels"},g)}},{key:"renderSectorsStatically",value:function(n){var a=this,i=this.props,s=i.activeShape,l=i.blendStroke,c=i.inactiveShape;return n.map(function(u,f){if((u==null?void 0:u.startAngle)===0&&(u==null?void 0:u.endAngle)===0&&n.length!==1)return null;var d=a.isActiveIndex(f),h=c&&a.hasActiveIndex()?c:null,p=d?s:h,g=xe(xe({},u),{},{stroke:l?u.fill:u.stroke,tabIndex:-1});return $.createElement(ne,ii({ref:function(b){b&&!a.sectorRefs.includes(b)&&a.sectorRefs.push(b)},tabIndex:-1,className:"recharts-pie-sector"},Zr(a.props,u,f),{key:"sector-".concat(u==null?void 0:u.startAngle,"-").concat(u==null?void 0:u.endAngle,"-").concat(u.midAngle,"-").concat(f)}),$.createElement(Fy,ii({option:p,isActive:d,shapeType:"sector"},g)))})}},{key:"renderSectorsWithAnimation",value:function(){var n=this,a=this.props,i=a.sectors,s=a.isAnimationActive,l=a.animationBegin,c=a.animationDuration,u=a.animationEasing,f=a.animationId,d=this.state,h=d.prevSectors,p=d.prevIsAnimationActive;return $.createElement(xr,{begin:l,duration:c,isActive:s,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(f,"-").concat(p),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(g){var y=g.t,b=[],v=i&&i[0],m=v.startAngle;return i.forEach(function(x,S){var j=h&&h[S],w=S>0?Rt(x,"paddingAngle",0):0;if(j){var _=lt(j.endAngle-j.startAngle,x.endAngle-x.startAngle),O=xe(xe({},x),{},{startAngle:m+w,endAngle:m+_(y)+w});b.push(O),m=O.endAngle}else{var N=x.endAngle,k=x.startAngle,E=lt(0,N-k),T=E(y),D=xe(xe({},x),{},{startAngle:m+w,endAngle:m+T+w});b.push(D),m=D.endAngle}}),$.createElement(ne,null,n.renderSectorsStatically(b))})}},{key:"attachKeyboardHandlers",value:function(n){var a=this;n.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var s=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[s].focus(),a.setState({sectorToFocus:s});break}case"ArrowRight":{var l=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[l].focus(),a.setState({sectorToFocus:l});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,a=n.sectors,i=n.isAnimationActive,s=this.state.prevSectors;return i&&a&&a.length&&(!s||!Sa(s,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,a=this.props,i=a.hide,s=a.sectors,l=a.className,c=a.label,u=a.cx,f=a.cy,d=a.innerRadius,h=a.outerRadius,p=a.isAnimationActive,g=this.state.isAnimationFinished;if(i||!s||!s.length||!U(u)||!U(f)||!U(d)||!U(h))return null;var y=ee("recharts-pie",l);return $.createElement(ne,{tabIndex:this.props.rootTabIndex,className:y,ref:function(v){n.pieRef=v}},this.renderSectors(),c&&this.renderLabels(s),tt.renderCallByParent(this.props,null,!1),(!p||g)&&Cr.renderCallByParent(this.props,s,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return a.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:n.sectors!==a.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,a){return n>a?"start":n<a?"end":"middle"}},{key:"renderLabelLineItem",value:function(n,a,i){if($.isValidElement(n))return $.cloneElement(n,a);if(Q(n))return n(a);var s=ee("recharts-pie-label-line",typeof n!="boolean"?n.className:"");return $.createElement(gi,ii({},a,{key:i,type:"linear",className:s}))}},{key:"renderLabelItem",value:function(n,a,i){if($.isValidElement(n))return $.cloneElement(n,a);var s=i;if(Q(n)&&(s=n(a),$.isValidElement(s)))return s;var l=ee("recharts-pie-label-text",typeof n!="boolean"&&!Q(n)?n.className:"");return $.createElement(wa,ii({},a,{alignmentBaseline:"middle",className:l}),s)}}])}(P.PureComponent);Sc=jr;Yt(jr,"displayName","Pie");Yt(jr,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!zn.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});Yt(jr,"parseDeltaAngle",function(e,t){var r=rt(t-e),n=Math.min(Math.abs(t-e),360);return r*n});Yt(jr,"getRealPieData",function(e){var t=e.data,r=e.children,n=X(e,!1),a=Bt(r,gr);return t&&t.length?t.map(function(i,s){return xe(xe(xe({payload:i},n),i),a&&a[s]&&a[s].props)}):a&&a.length?a.map(function(i){return xe(xe({},n),i.props)}):[]});Yt(jr,"parseCoordinateOfPie",function(e,t){var r=t.top,n=t.left,a=t.width,i=t.height,s=Mk(a,i),l=n+gt(e.cx,a,a/2),c=r+gt(e.cy,i,i/2),u=gt(e.innerRadius,s,0),f=gt(e.outerRadius,s,s*.8),d=e.maxRadius||Math.sqrt(a*a+i*i)/2;return{cx:l,cy:c,innerRadius:u,outerRadius:f,maxRadius:d}});Yt(jr,"getComposedData",function(e){var t=e.item,r=e.offset,n=t.type.defaultProps!==void 0?xe(xe({},t.type.defaultProps),t.props):t.props,a=Sc.getRealPieData(n);if(!a||!a.length)return null;var i=n.cornerRadius,s=n.startAngle,l=n.endAngle,c=n.paddingAngle,u=n.dataKey,f=n.nameKey,d=n.valueKey,h=n.tooltipType,p=Math.abs(n.minAngle),g=Sc.parseCoordinateOfPie(n,r),y=Sc.parseDeltaAngle(s,l),b=Math.abs(y),v=u;te(u)&&te(d)?(vr(!1,`Use "dataKey" to specify the value of pie,
- the props "valueKey" will be deprecated in 1.1.0`),v="value"):te(u)&&(vr(!1,`Use "dataKey" to specify the value of pie,
- the props "valueKey" will be deprecated in 1.1.0`),v=d);var m=a.filter(function(O){return Be(O,v,0)!==0}).length,x=(b>=360?m:m-1)*c,S=b-m*p-x,j=a.reduce(function(O,N){var k=Be(N,v,0);return O+(U(k)?k:0)},0),w;if(j>0){var _;w=a.map(function(O,N){var k=Be(O,v,0),E=Be(O,f,N),T=(U(k)?k:0)/j,D;N?D=_.endAngle+rt(y)*c*(k!==0?1:0):D=s;var A=D+rt(y)*((k!==0?p:0)+T*S),L=(D+A)/2,C=(g.innerRadius+g.outerRadius)/2,M=[{name:E,value:k,payload:O,dataKey:v,type:h}],I=ye(g.cx,g.cy,C,L);return _=xe(xe(xe({percent:T,cornerRadius:i,name:E,tooltipPayload:M,midAngle:L,middleRadius:C,tooltipPosition:I},O),g),{},{value:Be(O,v),startAngle:D,endAngle:A,payload:O,paddingAngle:rt(y)*c}),_})}return xe(xe({},g),{},{sectors:w,data:a})});function el(e){"@babel/helpers - typeof";return el=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},el(e)}function jm(){return jm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jm.apply(this,arguments)}function I1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ch(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?I1(Object(r),!0).forEach(function(n){tY(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):I1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function tY(e,t,r){return t=rY(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rY(e){var t=nY(e,"string");return el(t)=="symbol"?t:t+""}function nY(e,t){if(el(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(el(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function L1(e){return typeof e=="string"?parseInt(e,10):e}function aY(e,t){var r="".concat(t.cx||e.cx),n=Number(r),a="".concat(t.cy||e.cy),i=Number(a);return ch(ch(ch({},t),e),{},{cx:n,cy:i})}function D1(e){return $.createElement(Fy,jm({shapeType:"sector",propTransformer:aY},e))}var iY=["shape","activeShape","activeIndex","cornerRadius"],oY=["value","background"];function Bi(e){"@babel/helpers - typeof";return Bi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bi(e)}function Bu(){return Bu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bu.apply(this,arguments)}function R1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Je(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?R1(Object(r),!0).forEach(function(n){ma(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function B1(e,t){if(e==null)return{};var r=sY(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function sY(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function lY(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,aO(n.key),n)}}function cY(e,t,r){return t&&F1(e.prototype,t),r&&F1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function uY(e,t,r){return t=Fu(t),dY(e,nO()?Reflect.construct(t,r||[],Fu(e).constructor):t.apply(e,r))}function dY(e,t){if(t&&(Bi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fY(e)}function fY(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nO=function(){return!!e})()}function Fu(e){return Fu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Fu(e)}function hY(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wm(e,t)}function wm(e,t){return wm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},wm(e,t)}function ma(e,t,r){return t=aO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aO(e){var t=pY(e,"string");return Bi(t)=="symbol"?t:t+""}function pY(e,t){if(Bi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Bi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var wl=function(e){function t(){var r;lY(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=uY(this,t,[].concat(a)),ma(r,"state",{isAnimationFinished:!1}),ma(r,"handleAnimationEnd",function(){var s=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),Q(s)&&s()}),ma(r,"handleAnimationStart",function(){var s=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),Q(s)&&s()}),r}return hY(t,e),cY(t,[{key:"getDeltaAngle",value:function(){var n=this.props,a=n.startAngle,i=n.endAngle,s=rt(i-a),l=Math.min(Math.abs(i-a),360);return s*l}},{key:"renderSectorsStatically",value:function(n){var a=this,i=this.props,s=i.shape,l=i.activeShape,c=i.activeIndex,u=i.cornerRadius,f=B1(i,iY),d=X(f,!1);return n.map(function(h,p){var g=p===c,y=Je(Je(Je(Je({},d),{},{cornerRadius:L1(u)},h),Zr(a.props,h,p)),{},{className:"recharts-radial-bar-sector ".concat(h.className),forceCornerRadius:f.forceCornerRadius,cornerIsExternal:f.cornerIsExternal,isActive:g,option:g?l:s});return $.createElement(D1,Bu({},y,{key:"sector-".concat(p)}))})}},{key:"renderSectorsWithAnimation",value:function(){var n=this,a=this.props,i=a.data,s=a.isAnimationActive,l=a.animationBegin,c=a.animationDuration,u=a.animationEasing,f=a.animationId,d=this.state.prevData;return $.createElement(xr,{begin:l,duration:c,isActive:s,easing:u,from:{t:0},to:{t:1},key:"radialBar-".concat(f),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(h){var p=h.t,g=i.map(function(y,b){var v=d&&d[b];if(v){var m=lt(v.startAngle,y.startAngle),x=lt(v.endAngle,y.endAngle);return Je(Je({},y),{},{startAngle:m(p),endAngle:x(p)})}var S=y.endAngle,j=y.startAngle,w=lt(j,S);return Je(Je({},y),{},{endAngle:w(p)})});return $.createElement(ne,null,n.renderSectorsStatically(g))})}},{key:"renderSectors",value:function(){var n=this.props,a=n.data,i=n.isAnimationActive,s=this.state.prevData;return i&&a&&a.length&&(!s||!Sa(s,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"renderBackground",value:function(n){var a=this,i=this.props.cornerRadius,s=X(this.props.background,!1);return n.map(function(l,c){l.value;var u=l.background,f=B1(l,oY);if(!u)return null;var d=Je(Je(Je(Je(Je({cornerRadius:L1(i)},f),{},{fill:"#eee"},u),s),Zr(a.props,l,c)),{},{index:c,className:ee("recharts-radial-bar-background-sector",s==null?void 0:s.className),option:u,isActive:!1});return $.createElement(D1,Bu({},d,{key:"sector-".concat(c)}))})}},{key:"render",value:function(){var n=this.props,a=n.hide,i=n.data,s=n.className,l=n.background,c=n.isAnimationActive;if(a||!i||!i.length)return null;var u=this.state.isAnimationFinished,f=ee("recharts-area",s);return $.createElement(ne,{className:f},l&&$.createElement(ne,{className:"recharts-radial-bar-background"},this.renderBackground(i)),$.createElement(ne,{className:"recharts-radial-bar-sectors"},this.renderSectors()),(!c||u)&&Cr.renderCallByParent(Je({},this.props),i))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curData:n.data,prevData:a.curData}:n.data!==a.curData?{curData:n.data}:null}}])}(P.PureComponent);ma(wl,"displayName","RadialBar");ma(wl,"defaultProps",{angleAxisId:0,radiusAxisId:0,minPointSize:0,hide:!1,legendType:"rect",data:[],isAnimationActive:!zn.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease",forceCornerRadius:!1,cornerIsExternal:!1});ma(wl,"getComposedData",function(e){var t=e.item,r=e.props,n=e.radiusAxis,a=e.radiusAxisTicks,i=e.angleAxis,s=e.angleAxisTicks,l=e.displayedData,c=e.dataKey,u=e.stackedData,f=e.barPosition,d=e.bandSize,h=e.dataStartIndex,p=Pk(f,t);if(!p)return null;var g=i.cx,y=i.cy,b=r.layout,v=t.props,m=v.children,x=v.minPointSize,S=b==="radial"?i:n,j=u?S.scale.domain():null,w=Ek({numericAxis:S}),_=Bt(m,gr),O=l.map(function(N,k){var E,T,D,A,L,C;if(u?E=Ak(u[h+k],j):(E=Be(N,c),Array.isArray(E)||(E=[w,E])),b==="radial"){T=ku({axis:n,ticks:a,bandSize:d,offset:p.offset,entry:N,index:k}),L=i.scale(E[1]),A=i.scale(E[0]),D=T+p.size;var M=L-A;if(Math.abs(x)>0&&Math.abs(M)<Math.abs(x)){var I=rt(M||x)*(Math.abs(x)-Math.abs(M));L+=I}C={background:{cx:g,cy:y,innerRadius:T,outerRadius:D,startAngle:r.startAngle,endAngle:r.endAngle}}}else{T=n.scale(E[0]),D=n.scale(E[1]),A=ku({axis:i,ticks:s,bandSize:d,offset:p.offset,entry:N,index:k}),L=A+p.size;var R=D-T;if(Math.abs(x)>0&&Math.abs(R)<Math.abs(x)){var F=rt(R||x)*(Math.abs(x)-Math.abs(R));D+=F}}return Je(Je(Je(Je({},N),C),{},{payload:N,value:u?E:E[1],cx:g,cy:y,innerRadius:T,outerRadius:D,startAngle:A,endAngle:L},_&&_[k]&&_[k].props),{},{tooltipPayload:[Ry(t,N)],tooltipPosition:ye(g,y,(T+D)/2,(A+L)/2)})});return{data:O,layout:b}});var mY=Math.ceil,vY=Math.max;function yY(e,t,r,n){for(var a=-1,i=vY(mY((t-e)/(r||1)),0),s=Array(i);i--;)s[n?i:++a]=e,e+=r;return s}var gY=yY,xY=b_,z1=1/0,bY=17976931348623157e292;function jY(e){if(!e)return e===0?e:0;if(e=xY(e),e===z1||e===-z1){var t=e<0?-1:1;return t*bY}return e===e?e:0}var iO=jY,wY=gY,SY=Fd,uh=iO;function _Y(e){return function(t,r,n){return n&&typeof n!="number"&&SY(t,r,n)&&(r=n=void 0),t=uh(t),r===void 0?(r=t,t=0):r=uh(r),n=n===void 0?t<r?1:-1:uh(n),wY(t,r,n,e)}}var kY=_Y,OY=kY,NY=OY(),PY=NY;const zu=de(PY);function tl(e){"@babel/helpers - typeof";return tl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tl(e)}function W1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function U1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?W1(Object(r),!0).forEach(function(n){oO(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function oO(e,t,r){return t=AY(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function AY(e){var t=CY(e,"string");return tl(t)=="symbol"?t:t+""}function CY(e,t){if(tl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(tl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var EY=["Webkit","Moz","O","ms"],$Y=function(t,r){var n=t.replace(/(\w)/,function(i){return i.toUpperCase()}),a=EY.reduce(function(i,s){return U1(U1({},i),{},oO({},s+n,r))},{});return a[t]=r,a};function Fi(e){"@babel/helpers - typeof";return Fi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fi(e)}function Wu(){return Wu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wu.apply(this,arguments)}function H1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function dh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?H1(Object(r),!0).forEach(function(n){$t(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):H1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function TY(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,lO(n.key),n)}}function MY(e,t,r){return t&&K1(e.prototype,t),r&&K1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function IY(e,t,r){return t=Uu(t),LY(e,sO()?Reflect.construct(t,r||[],Uu(e).constructor):t.apply(e,r))}function LY(e,t){if(t&&(Fi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return DY(e)}function DY(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(sO=function(){return!!e})()}function Uu(e){return Uu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Uu(e)}function RY(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sm(e,t)}function Sm(e,t){return Sm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Sm(e,t)}function $t(e,t,r){return t=lO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lO(e){var t=BY(e,"string");return Fi(t)=="symbol"?t:t+""}function BY(e,t){if(Fi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Fi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var FY=function(t){var r=t.data,n=t.startIndex,a=t.endIndex,i=t.x,s=t.width,l=t.travellerWidth;if(!r||!r.length)return{};var c=r.length,u=ts().domain(zu(0,c)).range([i,i+s-l]),f=u.domain().map(function(d){return u(d)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(n),endX:u(a),scale:u,scaleValues:f}},V1=function(t){return t.changedTouches&&!!t.changedTouches.length},zi=function(e){function t(r){var n;return TY(this,t),n=IY(this,t,[r]),$t(n,"handleDrag",function(a){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(a):n.state.isSlideMoving&&n.handleSlideDrag(a)}),$t(n,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&n.handleDrag(a.changedTouches[0])}),$t(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=n.props,i=a.endIndex,s=a.onDragEnd,l=a.startIndex;s==null||s({endIndex:i,startIndex:l})}),n.detachDragEndListener()}),$t(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),$t(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),$t(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),$t(n,"handleSlideDragStart",function(a){var i=V1(a)?a.changedTouches[0]:a;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return RY(t,e),MY(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var a=n.startX,i=n.endX,s=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,f=u.length-1,d=Math.min(a,i),h=Math.max(a,i),p=t.getIndexInRange(s,d),g=t.getIndexInRange(s,h);return{startIndex:p-p%c,endIndex:g===f?f:g-g%c}}},{key:"getTextOfTick",value:function(n){var a=this.props,i=a.data,s=a.tickFormatter,l=a.dataKey,c=Be(i[n],l,n);return Q(s)?s(c,n):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var a=this.state,i=a.slideMoveStartX,s=a.startX,l=a.endX,c=this.props,u=c.x,f=c.width,d=c.travellerWidth,h=c.startIndex,p=c.endIndex,g=c.onChange,y=n.pageX-i;y>0?y=Math.min(y,u+f-d-l,u+f-d-s):y<0&&(y=Math.max(y,u-s,u-l));var b=this.getIndex({startX:s+y,endX:l+y});(b.startIndex!==h||b.endIndex!==p)&&g&&g(b),this.setState({startX:s+y,endX:l+y,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,a){var i=V1(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var a=this.state,i=a.brushMoveStartX,s=a.movingTravellerId,l=a.endX,c=a.startX,u=this.state[s],f=this.props,d=f.x,h=f.width,p=f.travellerWidth,g=f.onChange,y=f.gap,b=f.data,v={startX:this.state.startX,endX:this.state.endX},m=n.pageX-i;m>0?m=Math.min(m,d+h-p-u):m<0&&(m=Math.max(m,d-u)),v[s]=u+m;var x=this.getIndex(v),S=x.startIndex,j=x.endIndex,w=function(){var O=b.length-1;return s==="startX"&&(l>c?S%y===0:j%y===0)||l<c&&j===O||s==="endX"&&(l>c?j%y===0:S%y===0)||l>c&&j===O};this.setState($t($t({},s,u+m),"brushMoveStartX",n.pageX),function(){g&&w()&&g(x)})}},{key:"handleTravellerMoveKeyboard",value:function(n,a){var i=this,s=this.state,l=s.scaleValues,c=s.startX,u=s.endX,f=this.state[a],d=l.indexOf(f);if(d!==-1){var h=d+n;if(!(h===-1||h>=l.length)){var p=l[h];a==="startX"&&p>=u||a==="endX"&&p<=c||this.setState($t({},a,p),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,a=n.x,i=n.y,s=n.width,l=n.height,c=n.fill,u=n.stroke;return $.createElement("rect",{stroke:u,fill:c,x:a,y:i,width:s,height:l})}},{key:"renderPanorama",value:function(){var n=this.props,a=n.x,i=n.y,s=n.width,l=n.height,c=n.data,u=n.children,f=n.padding,d=P.Children.only(u);return d?$.cloneElement(d,{x:a,y:i,width:s,height:l,margin:f,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,a){var i,s,l=this,c=this.props,u=c.y,f=c.travellerWidth,d=c.height,h=c.traveller,p=c.ariaLabel,g=c.data,y=c.startIndex,b=c.endIndex,v=Math.max(n,this.props.x),m=dh(dh({},X(this.props,!1)),{},{x:v,y:u,width:f,height:d}),x=p||"Min value: ".concat((i=g[y])===null||i===void 0?void 0:i.name,", Max value: ").concat((s=g[b])===null||s===void 0?void 0:s.name);return $.createElement(ne,{tabIndex:0,role:"slider","aria-label":x,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(j){["ArrowLeft","ArrowRight"].includes(j.key)&&(j.preventDefault(),j.stopPropagation(),l.handleTravellerMoveKeyboard(j.key==="ArrowRight"?1:-1,a))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,m))}},{key:"renderSlide",value:function(n,a){var i=this.props,s=i.y,l=i.height,c=i.stroke,u=i.travellerWidth,f=Math.min(n,a)+u,d=Math.max(Math.abs(a-n)-u,0);return $.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:f,y:s,width:d,height:l})}},{key:"renderText",value:function(){var n=this.props,a=n.startIndex,i=n.endIndex,s=n.y,l=n.height,c=n.travellerWidth,u=n.stroke,f=this.state,d=f.startX,h=f.endX,p=5,g={pointerEvents:"none",fill:u};return $.createElement(ne,{className:"recharts-brush-texts"},$.createElement(wa,Wu({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,h)-p,y:s+l/2},g),this.getTextOfTick(a)),$.createElement(wa,Wu({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,h)+c+p,y:s+l/2},g),this.getTextOfTick(i)))}},{key:"render",value:function(){var n=this.props,a=n.data,i=n.className,s=n.children,l=n.x,c=n.y,u=n.width,f=n.height,d=n.alwaysShowText,h=this.state,p=h.startX,g=h.endX,y=h.isTextActive,b=h.isSlideMoving,v=h.isTravellerMoving,m=h.isTravellerFocused;if(!a||!a.length||!U(l)||!U(c)||!U(u)||!U(f)||u<=0||f<=0)return null;var x=ee("recharts-brush",i),S=$.Children.count(s)===1,j=$Y("userSelect","none");return $.createElement(ne,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:j},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(p,g),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(g,"endX"),(y||b||v||m||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var a=n.x,i=n.y,s=n.width,l=n.height,c=n.stroke,u=Math.floor(i+l/2)-1;return $.createElement($.Fragment,null,$.createElement("rect",{x:a,y:i,width:s,height:l,fill:c,stroke:"none"}),$.createElement("line",{x1:a+1,y1:u,x2:a+s-1,y2:u,fill:"none",stroke:"#fff"}),$.createElement("line",{x1:a+1,y1:u+2,x2:a+s-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,a){var i;return $.isValidElement(n)?i=$.cloneElement(n,a):Q(n)?i=n(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(n,a){var i=n.data,s=n.width,l=n.x,c=n.travellerWidth,u=n.updateId,f=n.startIndex,d=n.endIndex;if(i!==a.prevData||u!==a.prevUpdateId)return dh({prevData:i,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:s},i&&i.length?FY({data:i,width:s,x:l,travellerWidth:c,startIndex:f,endIndex:d}):{scale:null,scaleValues:null});if(a.scale&&(s!==a.prevWidth||l!==a.prevX||c!==a.prevTravellerWidth)){a.scale.range([l,l+s-c]);var h=a.scale.domain().map(function(p){return a.scale(p)});return{prevData:i,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:s,startX:a.scale(n.startIndex),endX:a.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,a){for(var i=n.length,s=0,l=i-1;l-s>1;){var c=Math.floor((s+l)/2);n[c]>a?l=c:s=c}return a>=n[l]?l:s}}])}(P.PureComponent);$t(zi,"displayName","Brush");$t(zi,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var zY=uy;function WY(e,t){var r;return zY(e,function(n,a,i){return r=t(n,a,i),!r}),!!r}var UY=WY,HY=GS,KY=Mr,VY=UY,GY=Et,YY=Fd;function qY(e,t,r){var n=GY(e)?HY:VY;return r&&YY(e,t,r)&&(t=void 0),n(e,KY(t))}var XY=qY;const QY=de(XY);var Er=function(t,r){var n=t.alwaysShow,a=t.ifOverflow;return n&&(a="extendDomain"),a===r},G1=m_;function JY(e,t,r){t=="__proto__"&&G1?G1(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var ZY=JY,eq=ZY,tq=h_,rq=Mr;function nq(e,t){var r={};return t=rq(t),tq(e,function(n,a,i){eq(r,a,t(n,a,i))}),r}var aq=nq;const iq=de(aq);function oq(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}var sq=oq,lq=uy;function cq(e,t){var r=!0;return lq(e,function(n,a,i){return r=!!t(n,a,i),r}),r}var uq=cq,dq=sq,fq=uq,hq=Mr,pq=Et,mq=Fd;function vq(e,t,r){var n=pq(e)?dq:fq;return r&&mq(e,t,r)&&(t=void 0),n(e,hq(t))}var yq=vq;const cO=de(yq);var gq=["x","y"];function rl(e){"@babel/helpers - typeof";return rl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rl(e)}function _m(){return _m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_m.apply(this,arguments)}function Y1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Io(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Y1(Object(r),!0).forEach(function(n){xq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Y1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xq(e,t,r){return t=bq(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bq(e){var t=jq(e,"string");return rl(t)=="symbol"?t:t+""}function jq(e,t){if(rl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(rl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wq(e,t){if(e==null)return{};var r=Sq(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Sq(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _q(e,t){var r=e.x,n=e.y,a=wq(e,gq),i="".concat(r),s=parseInt(i,10),l="".concat(n),c=parseInt(l,10),u="".concat(t.height||a.height),f=parseInt(u,10),d="".concat(t.width||a.width),h=parseInt(d,10);return Io(Io(Io(Io(Io({},t),a),s?{x:s}:{}),c?{y:c}:{}),{},{height:f,width:h,name:t.name,radius:t.radius})}function q1(e){return $.createElement(Fy,_m({shapeType:"rectangle",propTransformer:_q,activeClassName:"recharts-active-bar"},e))}var kq=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,a){if(typeof t=="number")return t;var i=U(n)||L3(n);return i?t(n,a):(i||ka(),r)}},Oq=["value","background"],uO;function Wi(e){"@babel/helpers - typeof";return Wi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wi(e)}function Nq(e,t){if(e==null)return{};var r=Pq(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Pq(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Hu(){return Hu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hu.apply(this,arguments)}function X1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function De(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?X1(Object(r),!0).forEach(function(n){wn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Aq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Q1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,fO(n.key),n)}}function Cq(e,t,r){return t&&Q1(e.prototype,t),r&&Q1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Eq(e,t,r){return t=Ku(t),$q(e,dO()?Reflect.construct(t,r||[],Ku(e).constructor):t.apply(e,r))}function $q(e,t){if(t&&(Wi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Tq(e)}function Tq(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dO=function(){return!!e})()}function Ku(e){return Ku=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ku(e)}function Mq(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&km(e,t)}function km(e,t){return km=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},km(e,t)}function wn(e,t,r){return t=fO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fO(e){var t=Iq(e,"string");return Wi(t)=="symbol"?t:t+""}function Iq(e,t){if(Wi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Wi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var rr=function(e){function t(){var r;Aq(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=Eq(this,t,[].concat(a)),wn(r,"state",{isAnimationFinished:!1}),wn(r,"id",co("recharts-bar-")),wn(r,"handleAnimationEnd",function(){var s=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),s&&s()}),wn(r,"handleAnimationStart",function(){var s=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),s&&s()}),r}return Mq(t,e),Cq(t,[{key:"renderRectanglesStatically",value:function(n){var a=this,i=this.props,s=i.shape,l=i.dataKey,c=i.activeIndex,u=i.activeBar,f=X(this.props,!1);return n&&n.map(function(d,h){var p=h===c,g=p?u:s,y=De(De(De({},f),d),{},{isActive:p,option:g,index:h,dataKey:l,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return $.createElement(ne,Hu({className:"recharts-bar-rectangle"},Zr(a.props,d,h),{key:"rectangle-".concat(d==null?void 0:d.x,"-").concat(d==null?void 0:d.y,"-").concat(d==null?void 0:d.value,"-").concat(h)}),$.createElement(q1,y))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,a=this.props,i=a.data,s=a.layout,l=a.isAnimationActive,c=a.animationBegin,u=a.animationDuration,f=a.animationEasing,d=a.animationId,h=this.state.prevData;return $.createElement(xr,{begin:c,duration:u,isActive:l,easing:f,from:{t:0},to:{t:1},key:"bar-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(p){var g=p.t,y=i.map(function(b,v){var m=h&&h[v];if(m){var x=lt(m.x,b.x),S=lt(m.y,b.y),j=lt(m.width,b.width),w=lt(m.height,b.height);return De(De({},b),{},{x:x(g),y:S(g),width:j(g),height:w(g)})}if(s==="horizontal"){var _=lt(0,b.height),O=_(g);return De(De({},b),{},{y:b.y+b.height-O,height:O})}var N=lt(0,b.width),k=N(g);return De(De({},b),{},{width:k})});return $.createElement(ne,null,n.renderRectanglesStatically(y))})}},{key:"renderRectangles",value:function(){var n=this.props,a=n.data,i=n.isAnimationActive,s=this.state.prevData;return i&&a&&a.length&&(!s||!Sa(s,a))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(a)}},{key:"renderBackground",value:function(){var n=this,a=this.props,i=a.data,s=a.dataKey,l=a.activeIndex,c=X(this.props.background,!1);return i.map(function(u,f){u.value;var d=u.background,h=Nq(u,Oq);if(!d)return null;var p=De(De(De(De(De({},h),{},{fill:"#eee"},d),c),Zr(n.props,u,f)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:s,index:f,className:"recharts-bar-background-rectangle"});return $.createElement(q1,Hu({key:"background-bar-".concat(f),option:n.props.background,isActive:f===l},p))})}},{key:"renderErrorBar",value:function(n,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,s=i.data,l=i.xAxis,c=i.yAxis,u=i.layout,f=i.children,d=Bt(f,Qd);if(!d)return null;var h=u==="vertical"?s[0].height/2:s[0].width/2,p=function(b,v){var m=Array.isArray(b.value)?b.value[1]:b.value;return{x:b.x,y:b.y,value:m,errorVal:Be(b,v)}},g={clipPath:n?"url(#clipPath-".concat(a,")"):null};return $.createElement(ne,g,d.map(function(y){return $.cloneElement(y,{key:"error-bar-".concat(a,"-").concat(y.props.dataKey),data:s,xAxis:l,yAxis:c,layout:u,offset:h,dataPointFormatter:p})}))}},{key:"render",value:function(){var n=this.props,a=n.hide,i=n.data,s=n.className,l=n.xAxis,c=n.yAxis,u=n.left,f=n.top,d=n.width,h=n.height,p=n.isAnimationActive,g=n.background,y=n.id;if(a||!i||!i.length)return null;var b=this.state.isAnimationFinished,v=ee("recharts-bar",s),m=l&&l.allowDataOverflow,x=c&&c.allowDataOverflow,S=m||x,j=te(y)?this.id:y;return $.createElement(ne,{className:v},m||x?$.createElement("defs",null,$.createElement("clipPath",{id:"clipPath-".concat(j)},$.createElement("rect",{x:m?u:u-d/2,y:x?f:f-h/2,width:m?d:d*2,height:x?h:h*2}))):null,$.createElement(ne,{className:"recharts-bar-rectangles",clipPath:S?"url(#clipPath-".concat(j,")"):null},g?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(S,j),(!p||b)&&Cr.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curData:n.data,prevData:a.curData}:n.data!==a.curData?{curData:n.data}:null}}])}(P.PureComponent);uO=rr;wn(rr,"displayName","Bar");wn(rr,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!zn.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});wn(rr,"getComposedData",function(e){var t=e.props,r=e.item,n=e.barPosition,a=e.bandSize,i=e.xAxis,s=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,f=e.dataStartIndex,d=e.displayedData,h=e.offset,p=Pk(n,r);if(!p)return null;var g=t.layout,y=r.type.defaultProps,b=y!==void 0?De(De({},y),r.props):r.props,v=b.dataKey,m=b.children,x=b.minPointSize,S=g==="horizontal"?s:i,j=u?S.scale.domain():null,w=Ek({numericAxis:S}),_=Bt(m,gr),O=d.map(function(N,k){var E,T,D,A,L,C;u?E=Ak(u[f+k],j):(E=Be(N,v),Array.isArray(E)||(E=[w,E]));var M=kq(x,uO.defaultProps.minPointSize)(E[1],k);if(g==="horizontal"){var I,R=[s.scale(E[0]),s.scale(E[1])],F=R[0],K=R[1];T=ku({axis:i,ticks:l,bandSize:a,offset:p.offset,entry:N,index:k}),D=(I=K??F)!==null&&I!==void 0?I:void 0,A=p.size;var z=F-K;if(L=Number.isNaN(z)?0:z,C={x:T,y:s.y,width:A,height:s.height},Math.abs(M)>0&&Math.abs(L)<Math.abs(M)){var q=rt(L||M)*(Math.abs(M)-Math.abs(L));D-=q,L+=q}}else{var ie=[i.scale(E[0]),i.scale(E[1])],he=ie[0],ge=ie[1];if(T=he,D=ku({axis:s,ticks:c,bandSize:a,offset:p.offset,entry:N,index:k}),A=ge-he,L=p.size,C={x:i.x,y:D,width:i.width,height:L},Math.abs(M)>0&&Math.abs(A)<Math.abs(M)){var Qe=rt(A||M)*(Math.abs(M)-Math.abs(A));A+=Qe}}return De(De(De({},N),{},{x:T,y:D,width:A,height:L,value:u?E:E[1],payload:N,background:C},_&&_[k]&&_[k].props),{},{tooltipPayload:[Ry(r,N)],tooltipPosition:{x:T+A/2,y:D+L/2}})});return De({data:O,layout:g},h)});function nl(e){"@babel/helpers - typeof";return nl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nl(e)}function Lq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,hO(n.key),n)}}function Dq(e,t,r){return t&&J1(e.prototype,t),r&&J1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Z1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function dr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Z1(Object(r),!0).forEach(function(n){nf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function nf(e,t,r){return t=hO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hO(e){var t=Rq(e,"string");return nl(t)=="symbol"?t:t+""}function Rq(e,t){if(nl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(nl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var pO=function(t,r,n,a,i){var s=t.width,l=t.height,c=t.layout,u=t.children,f=Object.keys(r),d={left:n.left,leftMirror:n.left,right:s-n.right,rightMirror:s-n.right,top:n.top,topMirror:n.top,bottom:l-n.bottom,bottomMirror:l-n.bottom},h=!!Mt(u,rr);return f.reduce(function(p,g){var y=r[g],b=y.orientation,v=y.domain,m=y.padding,x=m===void 0?{}:m,S=y.mirror,j=y.reversed,w="".concat(b).concat(S?"Mirror":""),_,O,N,k,E;if(y.type==="number"&&(y.padding==="gap"||y.padding==="no-gap")){var T=v[1]-v[0],D=1/0,A=y.categoricalDomain.sort(B3);if(A.forEach(function(ie,he){he>0&&(D=Math.min((ie||0)-(A[he-1]||0),D))}),Number.isFinite(D)){var L=D/T,C=y.layout==="vertical"?n.height:n.width;if(y.padding==="gap"&&(_=L*C/2),y.padding==="no-gap"){var M=gt(t.barCategoryGap,L*C),I=L*C/2;_=I-M-(I-M)/C*M}}}a==="xAxis"?O=[n.left+(x.left||0)+(_||0),n.left+n.width-(x.right||0)-(_||0)]:a==="yAxis"?O=c==="horizontal"?[n.top+n.height-(x.bottom||0),n.top+(x.top||0)]:[n.top+(x.top||0)+(_||0),n.top+n.height-(x.bottom||0)-(_||0)]:O=y.range,j&&(O=[O[1],O[0]]);var R=Ok(y,i,h),F=R.scale,K=R.realScaleType;F.domain(v).range(O),Nk(F);var z=Ck(F,dr(dr({},y),{},{realScaleType:K}));a==="xAxis"?(E=b==="top"&&!S||b==="bottom"&&S,N=n.left,k=d[w]-E*y.height):a==="yAxis"&&(E=b==="left"&&!S||b==="right"&&S,N=d[w]-E*y.width,k=n.top);var q=dr(dr(dr({},y),z),{},{realScaleType:K,x:N,y:k,scale:F,width:a==="xAxis"?n.width:y.width,height:a==="yAxis"?n.height:y.height});return q.bandSize=Ou(q,z),!y.hide&&a==="xAxis"?d[w]+=(E?-1:1)*q.height:y.hide||(d[w]+=(E?-1:1)*q.width),dr(dr({},p),{},nf({},g,q))},{})},mO=function(t,r){var n=t.x,a=t.y,i=r.x,s=r.y;return{x:Math.min(n,i),y:Math.min(a,s),width:Math.abs(i-n),height:Math.abs(s-a)}},Bq=function(t){var r=t.x1,n=t.y1,a=t.x2,i=t.y2;return mO({x:r,y:n},{x:a,y:i})},vO=function(){function e(t){Lq(this,e),this.scale=t}return Dq(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.bandAware,i=n.position;if(r!==void 0){if(i)switch(i){case"start":return this.scale(r);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+s}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(r)+l}default:return this.scale(r)}if(a){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),a=n[0],i=n[n.length-1];return a<=i?r>=a&&r<=i:r>=i&&r<=a}}],[{key:"create",value:function(r){return new e(r)}}])}();nf(vO,"EPS",1e-4);var zy=function(t){var r=Object.keys(t).reduce(function(n,a){return dr(dr({},n),{},nf({},a,vO.create(t[a])))},{});return dr(dr({},r),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.bandAware,l=i.position;return iq(a,function(c,u){return r[u].apply(c,{bandAware:s,position:l})})},isInRange:function(a){return cO(a,function(i,s){return r[s].isInRange(i)})}})};function Fq(e){return(e%180+180)%180}var zq=function(t){var r=t.width,n=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=Fq(a),s=i*Math.PI/180,l=Math.atan(n/r),c=s>l&&s<Math.PI-l?n/Math.sin(s):r/Math.cos(s);return Math.abs(c)},Wq=Mr,Uq=ml,Hq=Rd;function Kq(e){return function(t,r,n){var a=Object(t);if(!Uq(t)){var i=Wq(r);t=Hq(t),r=function(l){return i(a[l],l,a)}}var s=e(t,r,n);return s>-1?a[i?t[s]:s]:void 0}}var Vq=Kq,Gq=iO;function Yq(e){var t=Gq(e),r=t%1;return t===t?r?t-r:t:0}var qq=Yq,Xq=s_,Qq=Mr,Jq=qq,Zq=Math.max;function eX(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var a=r==null?0:Jq(r);return a<0&&(a=Zq(n+a,0)),Xq(e,Qq(t),a)}var tX=eX,rX=Vq,nX=tX,aX=rX(nX),iX=aX;const oX=de(iX);var sX=WT(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),Wy=P.createContext(void 0),Uy=P.createContext(void 0),yO=P.createContext(void 0),gO=P.createContext({}),xO=P.createContext(void 0),bO=P.createContext(0),jO=P.createContext(0),ej=function(t){var r=t.state,n=r.xAxisMap,a=r.yAxisMap,i=r.offset,s=t.clipPathId,l=t.children,c=t.width,u=t.height,f=sX(i);return $.createElement(Wy.Provider,{value:n},$.createElement(Uy.Provider,{value:a},$.createElement(gO.Provider,{value:i},$.createElement(yO.Provider,{value:f},$.createElement(xO.Provider,{value:s},$.createElement(bO.Provider,{value:u},$.createElement(jO.Provider,{value:c},l)))))))},lX=function(){return P.useContext(xO)},wO=function(t){var r=P.useContext(Wy);r==null&&ka();var n=r[t];return n==null&&ka(),n},cX=function(){var t=P.useContext(Wy);return yn(t)},uX=function(){var t=P.useContext(Uy),r=oX(t,function(n){return cO(n.domain,Number.isFinite)});return r||yn(t)},SO=function(t){var r=P.useContext(Uy);r==null&&ka();var n=r[t];return n==null&&ka(),n},dX=function(){var t=P.useContext(yO);return t},fX=function(){return P.useContext(gO)},Hy=function(){return P.useContext(jO)},Ky=function(){return P.useContext(bO)};function Ui(e){"@babel/helpers - typeof";return Ui=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ui(e)}function hX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pX(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,kO(n.key),n)}}function mX(e,t,r){return t&&pX(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function vX(e,t,r){return t=Vu(t),yX(e,_O()?Reflect.construct(t,r||[],Vu(e).constructor):t.apply(e,r))}function yX(e,t){if(t&&(Ui(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gX(e)}function gX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _O(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_O=function(){return!!e})()}function Vu(e){return Vu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Vu(e)}function xX(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Om(e,t)}function Om(e,t){return Om=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Om(e,t)}function tj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function rj(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?tj(Object(r),!0).forEach(function(n){Vy(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Vy(e,t,r){return t=kO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kO(e){var t=bX(e,"string");return Ui(t)=="symbol"?t:t+""}function bX(e,t){if(Ui(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ui(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function jX(e,t){return kX(e)||_X(e,t)||SX(e,t)||wX()}function wX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function SX(e,t){if(e){if(typeof e=="string")return nj(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nj(e,t)}}function nj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _X(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function kX(e){if(Array.isArray(e))return e}function Nm(){return Nm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Nm.apply(this,arguments)}var OX=function(t,r){var n;return $.isValidElement(t)?n=$.cloneElement(t,r):Q(t)?n=t(r):n=$.createElement("line",Nm({},r,{className:"recharts-reference-line-line"})),n},NX=function(t,r,n,a,i,s,l,c,u){var f=i.x,d=i.y,h=i.width,p=i.height;if(n){var g=u.y,y=t.y.apply(g,{position:s});if(Er(u,"discard")&&!t.y.isInRange(y))return null;var b=[{x:f+h,y},{x:f,y}];return c==="left"?b.reverse():b}if(r){var v=u.x,m=t.x.apply(v,{position:s});if(Er(u,"discard")&&!t.x.isInRange(m))return null;var x=[{x:m,y:d+p},{x:m,y:d}];return l==="top"?x.reverse():x}if(a){var S=u.segment,j=S.map(function(w){return t.apply(w,{position:s})});return Er(u,"discard")&&QY(j,function(w){return!t.isInRange(w)})?null:j}return null};function PX(e){var t=e.x,r=e.y,n=e.segment,a=e.xAxisId,i=e.yAxisId,s=e.shape,l=e.className,c=e.alwaysShow,u=lX(),f=wO(a),d=SO(i),h=dX();if(!u||!h)return null;vr(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=zy({x:f.scale,y:d.scale}),g=qe(t),y=qe(r),b=n&&n.length===2,v=NX(p,g,y,b,h,e.position,f.orientation,d.orientation,e);if(!v)return null;var m=jX(v,2),x=m[0],S=x.x,j=x.y,w=m[1],_=w.x,O=w.y,N=Er(e,"hidden")?"url(#".concat(u,")"):void 0,k=rj(rj({clipPath:N},X(e,!0)),{},{x1:S,y1:j,x2:_,y2:O});return $.createElement(ne,{className:ee("recharts-reference-line",l)},OX(s,k),tt.renderCallByParent(e,Bq({x1:S,y1:j,x2:_,y2:O})))}var Gy=function(e){function t(){return hX(this,t),vX(this,t,arguments)}return xX(t,e),mX(t,[{key:"render",value:function(){return $.createElement(PX,this.props)}}])}($.Component);Vy(Gy,"displayName","ReferenceLine");Vy(Gy,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function Pm(){return Pm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pm.apply(this,arguments)}function Hi(e){"@babel/helpers - typeof";return Hi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hi(e)}function aj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ij(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?aj(Object(r),!0).forEach(function(n){af(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):aj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function AX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CX(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,NO(n.key),n)}}function EX(e,t,r){return t&&CX(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $X(e,t,r){return t=Gu(t),TX(e,OO()?Reflect.construct(t,r||[],Gu(e).constructor):t.apply(e,r))}function TX(e,t){if(t&&(Hi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return MX(e)}function MX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function OO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(OO=function(){return!!e})()}function Gu(e){return Gu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Gu(e)}function IX(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Am(e,t)}function Am(e,t){return Am=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Am(e,t)}function af(e,t,r){return t=NO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function NO(e){var t=LX(e,"string");return Hi(t)=="symbol"?t:t+""}function LX(e,t){if(Hi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Hi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var DX=function(t){var r=t.x,n=t.y,a=t.xAxis,i=t.yAxis,s=zy({x:a.scale,y:i.scale}),l=s.apply({x:r,y:n},{bandAware:!0});return Er(t,"discard")&&!s.isInRange(l)?null:l},of=function(e){function t(){return AX(this,t),$X(this,t,arguments)}return IX(t,e),EX(t,[{key:"render",value:function(){var n=this.props,a=n.x,i=n.y,s=n.r,l=n.alwaysShow,c=n.clipPathId,u=qe(a),f=qe(i);if(vr(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!f)return null;var d=DX(this.props);if(!d)return null;var h=d.x,p=d.y,g=this.props,y=g.shape,b=g.className,v=Er(this.props,"hidden")?"url(#".concat(c,")"):void 0,m=ij(ij({clipPath:v},X(this.props,!0)),{},{cx:h,cy:p});return $.createElement(ne,{className:ee("recharts-reference-dot",b)},t.renderDot(y,m),tt.renderCallByParent(this.props,{x:h-s,y:p-s,width:2*s,height:2*s}))}}])}($.Component);af(of,"displayName","ReferenceDot");af(of,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});af(of,"renderDot",function(e,t){var r;return $.isValidElement(e)?r=$.cloneElement(e,t):Q(e)?r=e(t):r=$.createElement(Jd,Pm({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),r});function Cm(){return Cm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Cm.apply(this,arguments)}function Ki(e){"@babel/helpers - typeof";return Ki=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ki(e)}function oj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function sj(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?oj(Object(r),!0).forEach(function(n){sf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function RX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function BX(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,AO(n.key),n)}}function FX(e,t,r){return t&&BX(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function zX(e,t,r){return t=Yu(t),WX(e,PO()?Reflect.construct(t,r||[],Yu(e).constructor):t.apply(e,r))}function WX(e,t){if(t&&(Ki(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return UX(e)}function UX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function PO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(PO=function(){return!!e})()}function Yu(e){return Yu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Yu(e)}function HX(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Em(e,t)}function Em(e,t){return Em=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Em(e,t)}function sf(e,t,r){return t=AO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function AO(e){var t=KX(e,"string");return Ki(t)=="symbol"?t:t+""}function KX(e,t){if(Ki(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ki(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var VX=function(t,r,n,a,i){var s=i.x1,l=i.x2,c=i.y1,u=i.y2,f=i.xAxis,d=i.yAxis;if(!f||!d)return null;var h=zy({x:f.scale,y:d.scale}),p={x:t?h.x.apply(s,{position:"start"}):h.x.rangeMin,y:n?h.y.apply(c,{position:"start"}):h.y.rangeMin},g={x:r?h.x.apply(l,{position:"end"}):h.x.rangeMax,y:a?h.y.apply(u,{position:"end"}):h.y.rangeMax};return Er(i,"discard")&&(!h.isInRange(p)||!h.isInRange(g))?null:mO(p,g)},lf=function(e){function t(){return RX(this,t),zX(this,t,arguments)}return HX(t,e),FX(t,[{key:"render",value:function(){var n=this.props,a=n.x1,i=n.x2,s=n.y1,l=n.y2,c=n.className,u=n.alwaysShow,f=n.clipPathId;vr(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var d=qe(a),h=qe(i),p=qe(s),g=qe(l),y=this.props.shape;if(!d&&!h&&!p&&!g&&!y)return null;var b=VX(d,h,p,g,this.props);if(!b&&!y)return null;var v=Er(this.props,"hidden")?"url(#".concat(f,")"):void 0;return $.createElement(ne,{className:ee("recharts-reference-area",c)},t.renderRect(y,sj(sj({clipPath:v},X(this.props,!0)),b)),tt.renderCallByParent(this.props,b))}}])}($.Component);sf(lf,"displayName","ReferenceArea");sf(lf,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});sf(lf,"renderRect",function(e,t){var r;return $.isValidElement(e)?r=$.cloneElement(e,t):Q(e)?r=e(t):r=$.createElement(By,Cm({},t,{className:"recharts-reference-area-rect"})),r});function CO(e,t,r){if(t<1)return[];if(t===1&&r===void 0)return e;for(var n=[],a=0;a<e.length;a+=t)n.push(e[a]);return n}function GX(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return zq(n,r)}function YX(e,t,r){var n=r==="width",a=e.x,i=e.y,s=e.width,l=e.height;return t===1?{start:n?a:i,end:n?a+s:i+l}:{start:n?a+s:i+l,end:n?a:i}}function qu(e,t,r,n,a){if(e*t<e*n||e*t>e*a)return!1;var i=r();return e*(t-e*i/2-n)>=0&&e*(t+e*i/2-a)<=0}function qX(e,t){return CO(e,t+1)}function XX(e,t,r,n,a){for(var i=(n||[]).slice(),s=t.start,l=t.end,c=0,u=1,f=s,d=function(){var g=n==null?void 0:n[c];if(g===void 0)return{v:CO(n,u)};var y=c,b,v=function(){return b===void 0&&(b=r(g,y)),b},m=g.coordinate,x=c===0||qu(e,m,v,f,l);x||(c=0,f=s,u+=1),x&&(f=m+e*(v()/2+a),c+=u)},h;u<=i.length;)if(h=d(),h)return h.v;return[]}function al(e){"@babel/helpers - typeof";return al=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},al(e)}function lj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ht(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lj(Object(r),!0).forEach(function(n){QX(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function QX(e,t,r){return t=JX(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function JX(e){var t=ZX(e,"string");return al(t)=="symbol"?t:t+""}function ZX(e,t){if(al(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(al(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eQ(e,t,r,n,a){for(var i=(n||[]).slice(),s=i.length,l=t.start,c=t.end,u=function(h){var p=i[h],g,y=function(){return g===void 0&&(g=r(p,h)),g};if(h===s-1){var b=e*(p.coordinate+e*y()/2-c);i[h]=p=ht(ht({},p),{},{tickCoord:b>0?p.coordinate-b*e:p.coordinate})}else i[h]=p=ht(ht({},p),{},{tickCoord:p.coordinate});var v=qu(e,p.tickCoord,y,l,c);v&&(c=p.tickCoord-e*(y()/2+a),i[h]=ht(ht({},p),{},{isShow:!0}))},f=s-1;f>=0;f--)u(f);return i}function tQ(e,t,r,n,a,i){var s=(n||[]).slice(),l=s.length,c=t.start,u=t.end;if(i){var f=n[l-1],d=r(f,l-1),h=e*(f.coordinate+e*d/2-u);s[l-1]=f=ht(ht({},f),{},{tickCoord:h>0?f.coordinate-h*e:f.coordinate});var p=qu(e,f.tickCoord,function(){return d},c,u);p&&(u=f.tickCoord-e*(d/2+a),s[l-1]=ht(ht({},f),{},{isShow:!0}))}for(var g=i?l-1:l,y=function(m){var x=s[m],S,j=function(){return S===void 0&&(S=r(x,m)),S};if(m===0){var w=e*(x.coordinate-e*j()/2-c);s[m]=x=ht(ht({},x),{},{tickCoord:w<0?x.coordinate-w*e:x.coordinate})}else s[m]=x=ht(ht({},x),{},{tickCoord:x.coordinate});var _=qu(e,x.tickCoord,j,c,u);_&&(c=x.tickCoord+e*(j()/2+a),s[m]=ht(ht({},x),{},{isShow:!0}))},b=0;b<g;b++)y(b);return s}function Yy(e,t,r){var n=e.tick,a=e.ticks,i=e.viewBox,s=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,f=e.unit,d=e.angle;if(!a||!a.length||!n)return[];if(U(c)||zn.isSsr)return qX(a,typeof c=="number"&&U(c)?c:0);var h=[],p=l==="top"||l==="bottom"?"width":"height",g=f&&p==="width"?es(f,{fontSize:t,letterSpacing:r}):{width:0,height:0},y=function(x,S){var j=Q(u)?u(x.value,S):x.value;return p==="width"?GX(es(j,{fontSize:t,letterSpacing:r}),g,d):es(j,{fontSize:t,letterSpacing:r})[p]},b=a.length>=2?rt(a[1].coordinate-a[0].coordinate):1,v=YX(i,b,p);return c==="equidistantPreserveStart"?XX(b,v,y,a,s):(c==="preserveStart"||c==="preserveStartEnd"?h=tQ(b,v,y,a,s,c==="preserveStartEnd"):h=eQ(b,v,y,a,s),h.filter(function(m){return m.isShow}))}var rQ=["viewBox"],nQ=["viewBox"],aQ=["ticks"];function Vi(e){"@babel/helpers - typeof";return Vi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vi(e)}function oi(){return oi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},oi.apply(this,arguments)}function cj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function He(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cj(Object(r),!0).forEach(function(n){qy(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fh(e,t){if(e==null)return{};var r=iQ(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function iQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function oQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uj(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,$O(n.key),n)}}function sQ(e,t,r){return t&&uj(e.prototype,t),r&&uj(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function lQ(e,t,r){return t=Xu(t),cQ(e,EO()?Reflect.construct(t,r||[],Xu(e).constructor):t.apply(e,r))}function cQ(e,t){if(t&&(Vi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return uQ(e)}function uQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function EO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(EO=function(){return!!e})()}function Xu(e){return Xu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Xu(e)}function dQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$m(e,t)}function $m(e,t){return $m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},$m(e,t)}function qy(e,t,r){return t=$O(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $O(e){var t=fQ(e,"string");return Vi(t)=="symbol"?t:t+""}function fQ(e,t){if(Vi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Vi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var yo=function(e){function t(r){var n;return oQ(this,t),n=lQ(this,t,[r]),n.state={fontSize:"",letterSpacing:""},n}return dQ(t,e),sQ(t,[{key:"shouldComponentUpdate",value:function(n,a){var i=n.viewBox,s=fh(n,rQ),l=this.props,c=l.viewBox,u=fh(l,nQ);return!pi(i,c)||!pi(s,u)||!pi(a,this.state)}},{key:"componentDidMount",value:function(){var n=this.layerReference;if(n){var a=n.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];a&&this.setState({fontSize:window.getComputedStyle(a).fontSize,letterSpacing:window.getComputedStyle(a).letterSpacing})}}},{key:"getTickLineCoord",value:function(n){var a=this.props,i=a.x,s=a.y,l=a.width,c=a.height,u=a.orientation,f=a.tickSize,d=a.mirror,h=a.tickMargin,p,g,y,b,v,m,x=d?-1:1,S=n.tickSize||f,j=U(n.tickCoord)?n.tickCoord:n.coordinate;switch(u){case"top":p=g=n.coordinate,b=s+ +!d*c,y=b-x*S,m=y-x*h,v=j;break;case"left":y=b=n.coordinate,g=i+ +!d*l,p=g-x*S,v=p-x*h,m=j;break;case"right":y=b=n.coordinate,g=i+ +d*l,p=g+x*S,v=p+x*h,m=j;break;default:p=g=n.coordinate,b=s+ +d*c,y=b+x*S,m=y+x*h,v=j;break}return{line:{x1:p,y1:y,x2:g,y2:b},tick:{x:v,y:m}}}},{key:"getTickTextAnchor",value:function(){var n=this.props,a=n.orientation,i=n.mirror,s;switch(a){case"left":s=i?"start":"end";break;case"right":s=i?"end":"start";break;default:s="middle";break}return s}},{key:"getTickVerticalAnchor",value:function(){var n=this.props,a=n.orientation,i=n.mirror,s="end";switch(a){case"left":case"right":s="middle";break;case"top":s=i?"start":"end";break;default:s=i?"end":"start";break}return s}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.x,i=n.y,s=n.width,l=n.height,c=n.orientation,u=n.mirror,f=n.axisLine,d=He(He(He({},X(this.props,!1)),X(f,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var h=+(c==="top"&&!u||c==="bottom"&&u);d=He(He({},d),{},{x1:a,y1:i+h*l,x2:a+s,y2:i+h*l})}else{var p=+(c==="left"&&!u||c==="right"&&u);d=He(He({},d),{},{x1:a+p*s,y1:i,x2:a+p*s,y2:i+l})}return $.createElement("line",oi({},d,{className:ee("recharts-cartesian-axis-line",Rt(f,"className"))}))}},{key:"renderTicks",value:function(n,a,i){var s=this,l=this.props,c=l.tickLine,u=l.stroke,f=l.tick,d=l.tickFormatter,h=l.unit,p=Yy(He(He({},this.props),{},{ticks:n}),a,i),g=this.getTickTextAnchor(),y=this.getTickVerticalAnchor(),b=X(this.props,!1),v=X(f,!1),m=He(He({},b),{},{fill:"none"},X(c,!1)),x=p.map(function(S,j){var w=s.getTickLineCoord(S),_=w.line,O=w.tick,N=He(He(He(He({textAnchor:g,verticalAnchor:y},b),{},{stroke:"none",fill:u},v),O),{},{index:j,payload:S,visibleTicksCount:p.length,tickFormatter:d});return $.createElement(ne,oi({className:"recharts-cartesian-axis-tick",key:"tick-".concat(S.value,"-").concat(S.coordinate,"-").concat(S.tickCoord)},Zr(s.props,S,j)),c&&$.createElement("line",oi({},m,_,{className:ee("recharts-cartesian-axis-tick-line",Rt(c,"className"))})),f&&t.renderTickItem(f,N,"".concat(Q(d)?d(S.value,j):S.value).concat(h||"")))});return $.createElement("g",{className:"recharts-cartesian-axis-ticks"},x)}},{key:"render",value:function(){var n=this,a=this.props,i=a.axisLine,s=a.width,l=a.height,c=a.ticksGenerator,u=a.className,f=a.hide;if(f)return null;var d=this.props,h=d.ticks,p=fh(d,aQ),g=h;return Q(c)&&(g=h&&h.length>0?c(this.props):c(p)),s<=0||l<=0||!g||!g.length?null:$.createElement(ne,{className:ee("recharts-cartesian-axis",u),ref:function(b){n.layerReference=b}},i&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),tt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,a,i){var s,l=ee(a.className,"recharts-cartesian-axis-tick-value");return $.isValidElement(n)?s=$.cloneElement(n,He(He({},a),{},{className:l})):Q(n)?s=n(He(He({},a),{},{className:l})):s=$.createElement(wa,oi({},a,{className:"recharts-cartesian-axis-tick-value"}),i),s}}])}(P.Component);qy(yo,"displayName","CartesianAxis");qy(yo,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var hQ=["x1","y1","x2","y2","key"],pQ=["offset"];function Oa(e){"@babel/helpers - typeof";return Oa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oa(e)}function dj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function mt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?dj(Object(r),!0).forEach(function(n){mQ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function mQ(e,t,r){return t=vQ(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vQ(e){var t=yQ(e,"string");return Oa(t)=="symbol"?t:t+""}function yQ(e,t){if(Oa(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Oa(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function la(){return la=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},la.apply(this,arguments)}function fj(e,t){if(e==null)return{};var r=gQ(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function gQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var xQ=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,a=t.x,i=t.y,s=t.width,l=t.height,c=t.ry;return $.createElement("rect",{x:a,y:i,ry:c,width:s,height:l,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function TO(e,t){var r;if($.isValidElement(e))r=$.cloneElement(e,t);else if(Q(e))r=e(t);else{var n=t.x1,a=t.y1,i=t.x2,s=t.y2,l=t.key,c=fj(t,hQ),u=X(c,!1);u.offset;var f=fj(u,pQ);r=$.createElement("line",la({},f,{x1:n,y1:a,x2:i,y2:s,fill:"none",key:l}))}return r}function bQ(e){var t=e.x,r=e.width,n=e.horizontal,a=n===void 0?!0:n,i=e.horizontalPoints;if(!a||!i||!i.length)return null;var s=i.map(function(l,c){var u=mt(mt({},e),{},{x1:t,y1:l,x2:t+r,y2:l,key:"line-".concat(c),index:c});return TO(a,u)});return $.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function jQ(e){var t=e.y,r=e.height,n=e.vertical,a=n===void 0?!0:n,i=e.verticalPoints;if(!a||!i||!i.length)return null;var s=i.map(function(l,c){var u=mt(mt({},e),{},{x1:l,y1:t,x2:l,y2:t+r,key:"line-".concat(c),index:c});return TO(a,u)});return $.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function wQ(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,a=e.y,i=e.width,s=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var f=l.map(function(h){return Math.round(h+a-a)}).sort(function(h,p){return h-p});a!==f[0]&&f.unshift(0);var d=f.map(function(h,p){var g=!f[p+1],y=g?a+s-h:f[p+1]-h;if(y<=0)return null;var b=p%t.length;return $.createElement("rect",{key:"react-".concat(p),y:h,x:n,height:y,width:i,stroke:"none",fill:t[b],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return $.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function SQ(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,a=e.fillOpacity,i=e.x,s=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!r||!n||!n.length)return null;var f=u.map(function(h){return Math.round(h+i-i)}).sort(function(h,p){return h-p});i!==f[0]&&f.unshift(0);var d=f.map(function(h,p){var g=!f[p+1],y=g?i+l-h:f[p+1]-h;if(y<=0)return null;var b=p%n.length;return $.createElement("rect",{key:"react-".concat(p),x:h,y:s,width:y,height:c,stroke:"none",fill:n[b],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return $.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var _Q=function(t,r){var n=t.xAxis,a=t.width,i=t.height,s=t.offset;return kk(Yy(mt(mt(mt({},yo.defaultProps),n),{},{ticks:Kr(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),s.left,s.left+s.width,r)},kQ=function(t,r){var n=t.yAxis,a=t.width,i=t.height,s=t.offset;return kk(Yy(mt(mt(mt({},yo.defaultProps),n),{},{ticks:Kr(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),s.top,s.top+s.height,r)},Ba={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Ma(e){var t,r,n,a,i,s,l=Hy(),c=Ky(),u=fX(),f=mt(mt({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Ba.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Ba.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Ba.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:Ba.horizontalFill,vertical:(i=e.vertical)!==null&&i!==void 0?i:Ba.vertical,verticalFill:(s=e.verticalFill)!==null&&s!==void 0?s:Ba.verticalFill,x:U(e.x)?e.x:u.left,y:U(e.y)?e.y:u.top,width:U(e.width)?e.width:u.width,height:U(e.height)?e.height:u.height}),d=f.x,h=f.y,p=f.width,g=f.height,y=f.syncWithTicks,b=f.horizontalValues,v=f.verticalValues,m=cX(),x=uX();if(!U(p)||p<=0||!U(g)||g<=0||!U(d)||d!==+d||!U(h)||h!==+h)return null;var S=f.verticalCoordinatesGenerator||_Q,j=f.horizontalCoordinatesGenerator||kQ,w=f.horizontalPoints,_=f.verticalPoints;if((!w||!w.length)&&Q(j)){var O=b&&b.length,N=j({yAxis:x?mt(mt({},x),{},{ticks:O?b:x.ticks}):void 0,width:l,height:c,offset:u},O?!0:y);vr(Array.isArray(N),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Oa(N),"]")),Array.isArray(N)&&(w=N)}if((!_||!_.length)&&Q(S)){var k=v&&v.length,E=S({xAxis:m?mt(mt({},m),{},{ticks:k?v:m.ticks}):void 0,width:l,height:c,offset:u},k?!0:y);vr(Array.isArray(E),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Oa(E),"]")),Array.isArray(E)&&(_=E)}return $.createElement("g",{className:"recharts-cartesian-grid"},$.createElement(xQ,{fill:f.fill,fillOpacity:f.fillOpacity,x:f.x,y:f.y,width:f.width,height:f.height,ry:f.ry}),$.createElement(bQ,la({},f,{offset:u,horizontalPoints:w,xAxis:m,yAxis:x})),$.createElement(jQ,la({},f,{offset:u,verticalPoints:_,xAxis:m,yAxis:x})),$.createElement(wQ,la({},f,{horizontalPoints:w})),$.createElement(SQ,la({},f,{verticalPoints:_})))}Ma.displayName="CartesianGrid";var OQ=["layout","type","stroke","connectNulls","isRange","ref"],NQ=["key"],MO;function Gi(e){"@babel/helpers - typeof";return Gi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gi(e)}function IO(e,t){if(e==null)return{};var r=PQ(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function PQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ca(){return ca=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ca.apply(this,arguments)}function hj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function un(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hj(Object(r),!0).forEach(function(n){Or(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function AQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pj(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,DO(n.key),n)}}function CQ(e,t,r){return t&&pj(e.prototype,t),r&&pj(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function EQ(e,t,r){return t=Qu(t),$Q(e,LO()?Reflect.construct(t,r||[],Qu(e).constructor):t.apply(e,r))}function $Q(e,t){if(t&&(Gi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return TQ(e)}function TQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function LO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(LO=function(){return!!e})()}function Qu(e){return Qu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Qu(e)}function MQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Tm(e,t)}function Tm(e,t){return Tm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Tm(e,t)}function Or(e,t,r){return t=DO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DO(e){var t=IQ(e,"string");return Gi(t)=="symbol"?t:t+""}function IQ(e,t){if(Gi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Gi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ir=function(e){function t(){var r;AQ(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=EQ(this,t,[].concat(a)),Or(r,"state",{isAnimationFinished:!0}),Or(r,"id",co("recharts-area-")),Or(r,"handleAnimationEnd",function(){var s=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),Q(s)&&s()}),Or(r,"handleAnimationStart",function(){var s=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),Q(s)&&s()}),r}return MQ(t,e),CQ(t,[{key:"renderDots",value:function(n,a,i){var s=this.props.isAnimationActive,l=this.state.isAnimationFinished;if(s&&!l)return null;var c=this.props,u=c.dot,f=c.points,d=c.dataKey,h=X(this.props,!1),p=X(u,!0),g=f.map(function(b,v){var m=un(un(un({key:"dot-".concat(v),r:3},h),p),{},{index:v,cx:b.x,cy:b.y,dataKey:d,value:b.value,payload:b.payload,points:f});return t.renderDotItem(u,m)}),y={clipPath:n?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return $.createElement(ne,ca({className:"recharts-area-dots"},y),g)}},{key:"renderHorizontalRect",value:function(n){var a=this.props,i=a.baseLine,s=a.points,l=a.strokeWidth,c=s[0].x,u=s[s.length-1].x,f=n*Math.abs(c-u),d=jn(s.map(function(h){return h.y||0}));return U(i)&&typeof i=="number"?d=Math.max(i,d):i&&Array.isArray(i)&&i.length&&(d=Math.max(jn(i.map(function(h){return h.y||0})),d)),U(d)?$.createElement("rect",{x:c<u?c:c-f,y:0,width:f,height:Math.floor(d+(l?parseInt("".concat(l),10):1))}):null}},{key:"renderVerticalRect",value:function(n){var a=this.props,i=a.baseLine,s=a.points,l=a.strokeWidth,c=s[0].y,u=s[s.length-1].y,f=n*Math.abs(c-u),d=jn(s.map(function(h){return h.x||0}));return U(i)&&typeof i=="number"?d=Math.max(i,d):i&&Array.isArray(i)&&i.length&&(d=Math.max(jn(i.map(function(h){return h.x||0})),d)),U(d)?$.createElement("rect",{x:0,y:c<u?c:c-f,width:d+(l?parseInt("".concat(l),10):1),height:Math.floor(f)}):null}},{key:"renderClipRect",value:function(n){var a=this.props.layout;return a==="vertical"?this.renderVerticalRect(n):this.renderHorizontalRect(n)}},{key:"renderAreaStatically",value:function(n,a,i,s){var l=this.props,c=l.layout,u=l.type,f=l.stroke,d=l.connectNulls,h=l.isRange;l.ref;var p=IO(l,OQ);return $.createElement(ne,{clipPath:i?"url(#clipPath-".concat(s,")"):null},$.createElement(gi,ca({},X(p,!0),{points:n,connectNulls:d,type:u,baseLine:a,layout:c,stroke:"none",className:"recharts-area-area"})),f!=="none"&&$.createElement(gi,ca({},X(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:d,fill:"none",points:n})),f!=="none"&&h&&$.createElement(gi,ca({},X(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:d,fill:"none",points:a})))}},{key:"renderAreaWithAnimation",value:function(n,a){var i=this,s=this.props,l=s.points,c=s.baseLine,u=s.isAnimationActive,f=s.animationBegin,d=s.animationDuration,h=s.animationEasing,p=s.animationId,g=this.state,y=g.prevPoints,b=g.prevBaseLine;return $.createElement(xr,{begin:f,duration:d,isActive:u,easing:h,from:{t:0},to:{t:1},key:"area-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(v){var m=v.t;if(y){var x=y.length/l.length,S=l.map(function(O,N){var k=Math.floor(N*x);if(y[k]){var E=y[k],T=lt(E.x,O.x),D=lt(E.y,O.y);return un(un({},O),{},{x:T(m),y:D(m)})}return O}),j;if(U(c)&&typeof c=="number"){var w=lt(b,c);j=w(m)}else if(te(c)||lo(c)){var _=lt(b,0);j=_(m)}else j=c.map(function(O,N){var k=Math.floor(N*x);if(b[k]){var E=b[k],T=lt(E.x,O.x),D=lt(E.y,O.y);return un(un({},O),{},{x:T(m),y:D(m)})}return O});return i.renderAreaStatically(S,j,n,a)}return $.createElement(ne,null,$.createElement("defs",null,$.createElement("clipPath",{id:"animationClipPath-".concat(a)},i.renderClipRect(m))),$.createElement(ne,{clipPath:"url(#animationClipPath-".concat(a,")")},i.renderAreaStatically(l,c,n,a)))})}},{key:"renderArea",value:function(n,a){var i=this.props,s=i.points,l=i.baseLine,c=i.isAnimationActive,u=this.state,f=u.prevPoints,d=u.prevBaseLine,h=u.totalLength;return c&&s&&s.length&&(!f&&h>0||!Sa(f,s)||!Sa(d,l))?this.renderAreaWithAnimation(n,a):this.renderAreaStatically(s,l,n,a)}},{key:"render",value:function(){var n,a=this.props,i=a.hide,s=a.dot,l=a.points,c=a.className,u=a.top,f=a.left,d=a.xAxis,h=a.yAxis,p=a.width,g=a.height,y=a.isAnimationActive,b=a.id;if(i||!l||!l.length)return null;var v=this.state.isAnimationFinished,m=l.length===1,x=ee("recharts-area",c),S=d&&d.allowDataOverflow,j=h&&h.allowDataOverflow,w=S||j,_=te(b)?this.id:b,O=(n=X(s,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},N=O.r,k=N===void 0?3:N,E=O.strokeWidth,T=E===void 0?2:E,D=Y3(s)?s:{},A=D.clipDot,L=A===void 0?!0:A,C=k*2+T;return $.createElement(ne,{className:x},S||j?$.createElement("defs",null,$.createElement("clipPath",{id:"clipPath-".concat(_)},$.createElement("rect",{x:S?f:f-p/2,y:j?u:u-g/2,width:S?p:p*2,height:j?g:g*2})),!L&&$.createElement("clipPath",{id:"clipPath-dots-".concat(_)},$.createElement("rect",{x:f-C/2,y:u-C/2,width:p+C,height:g+C}))):null,m?null:this.renderArea(w,_),(s||m)&&this.renderDots(w,L,_),(!y||v)&&Cr.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:a.curPoints,prevBaseLine:a.curBaseLine}:n.points!==a.curPoints||n.baseLine!==a.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(P.PureComponent);MO=Ir;Or(Ir,"displayName","Area");Or(Ir,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!zn.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Or(Ir,"getBaseValue",function(e,t,r,n){var a=e.layout,i=e.baseValue,s=t.props.baseValue,l=s??i;if(U(l)&&typeof l=="number")return l;var c=a==="horizontal"?n:r,u=c.scale.domain();if(c.type==="number"){var f=Math.max(u[0],u[1]),d=Math.min(u[0],u[1]);return l==="dataMin"?d:l==="dataMax"||f<0?f:Math.max(Math.min(u[0],u[1]),0)}return l==="dataMin"?u[0]:l==="dataMax"?u[1]:u[0]});Or(Ir,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,a=e.yAxis,i=e.xAxisTicks,s=e.yAxisTicks,l=e.bandSize,c=e.dataKey,u=e.stackedData,f=e.dataStartIndex,d=e.displayedData,h=e.offset,p=t.layout,g=u&&u.length,y=MO.getBaseValue(t,r,n,a),b=p==="horizontal",v=!1,m=d.map(function(S,j){var w;g?w=u[f+j]:(w=Be(S,c),Array.isArray(w)?v=!0:w=[y,w]);var _=w[1]==null||g&&Be(S,c)==null;return b?{x:Db({axis:n,ticks:i,bandSize:l,entry:S,index:j}),y:_?null:a.scale(w[1]),value:w,payload:S}:{x:_?null:n.scale(w[1]),y:Db({axis:a,ticks:s,bandSize:l,entry:S,index:j}),value:w,payload:S}}),x;return g||v?x=m.map(function(S){var j=Array.isArray(S.value)?S.value[0]:null;return b?{x:S.x,y:j!=null&&S.y!=null?a.scale(j):null}:{x:j!=null?n.scale(j):null,y:S.y}}):x=b?a.scale(y):n.scale(y),un({points:m,baseLine:x,layout:p,isRange:v},h)});Or(Ir,"renderDotItem",function(e,t){var r;if($.isValidElement(e))r=$.cloneElement(e,t);else if(Q(e))r=e(t);else{var n=ee("recharts-area-dot",typeof e!="boolean"?e.className:""),a=t.key,i=IO(t,NQ);r=$.createElement(Jd,ca({},i,{key:a,className:n}))}return r});function Yi(e){"@babel/helpers - typeof";return Yi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yi(e)}function LQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function DQ(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,FO(n.key),n)}}function RQ(e,t,r){return t&&DQ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function BQ(e,t,r){return t=Ju(t),FQ(e,RO()?Reflect.construct(t,r||[],Ju(e).constructor):t.apply(e,r))}function FQ(e,t){if(t&&(Yi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zQ(e)}function zQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function RO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(RO=function(){return!!e})()}function Ju(e){return Ju=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ju(e)}function WQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mm(e,t)}function Mm(e,t){return Mm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Mm(e,t)}function BO(e,t,r){return t=FO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function FO(e){var t=UQ(e,"string");return Yi(t)=="symbol"?t:t+""}function UQ(e,t){if(Yi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Yi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Im(){return Im=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Im.apply(this,arguments)}function HQ(e){var t=e.xAxisId,r=Hy(),n=Ky(),a=wO(t);return a==null?null:P.createElement(yo,Im({},a,{className:ee("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(s){return Kr(s,!0)}}))}var ir=function(e){function t(){return LQ(this,t),BQ(this,t,arguments)}return WQ(t,e),RQ(t,[{key:"render",value:function(){return P.createElement(HQ,this.props)}}])}(P.Component);BO(ir,"displayName","XAxis");BO(ir,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function qi(e){"@babel/helpers - typeof";return qi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qi(e)}function KQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VQ(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,UO(n.key),n)}}function GQ(e,t,r){return t&&VQ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function YQ(e,t,r){return t=Zu(t),qQ(e,zO()?Reflect.construct(t,r||[],Zu(e).constructor):t.apply(e,r))}function qQ(e,t){if(t&&(qi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return XQ(e)}function XQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zO=function(){return!!e})()}function Zu(e){return Zu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Zu(e)}function QQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lm(e,t)}function Lm(e,t){return Lm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Lm(e,t)}function WO(e,t,r){return t=UO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function UO(e){var t=JQ(e,"string");return qi(t)=="symbol"?t:t+""}function JQ(e,t){if(qi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(qi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Dm(){return Dm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Dm.apply(this,arguments)}var ZQ=function(t){var r=t.yAxisId,n=Hy(),a=Ky(),i=SO(r);return i==null?null:P.createElement(yo,Dm({},i,{className:ee("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:a},ticksGenerator:function(l){return Kr(l,!0)}}))},or=function(e){function t(){return KQ(this,t),YQ(this,t,arguments)}return QQ(t,e),GQ(t,[{key:"render",value:function(){return P.createElement(ZQ,this.props)}}])}(P.Component);WO(or,"displayName","YAxis");WO(or,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function mj(e){return nJ(e)||rJ(e)||tJ(e)||eJ()}function eJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tJ(e,t){if(e){if(typeof e=="string")return Rm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rm(e,t)}}function rJ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nJ(e){if(Array.isArray(e))return Rm(e)}function Rm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Bm=function(t,r,n,a,i){var s=Bt(t,Gy),l=Bt(t,of),c=[].concat(mj(s),mj(l)),u=Bt(t,lf),f="".concat(a,"Id"),d=a[0],h=r;if(c.length&&(h=c.reduce(function(y,b){if(b.props[f]===n&&Er(b.props,"extendDomain")&&U(b.props[d])){var v=b.props[d];return[Math.min(y[0],v),Math.max(y[1],v)]}return y},h)),u.length){var p="".concat(d,"1"),g="".concat(d,"2");h=u.reduce(function(y,b){if(b.props[f]===n&&Er(b.props,"extendDomain")&&U(b.props[p])&&U(b.props[g])){var v=b.props[p],m=b.props[g];return[Math.min(y[0],v,m),Math.max(y[1],v,m)]}return y},h)}return i&&i.length&&(h=i.reduce(function(y,b){return U(b)?[Math.min(y[0],b),Math.max(y[1],b)]:y},h)),h},HO={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function a(c,u,f){this.fn=c,this.context=u,this.once=f||!1}function i(c,u,f,d,h){if(typeof f!="function")throw new TypeError("The listener must be a function");var p=new a(f,d||c,h),g=r?r+u:u;return c._events[g]?c._events[g].fn?c._events[g]=[c._events[g],p]:c._events[g].push(p):(c._events[g]=p,c._eventsCount++),c}function s(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],f,d;if(this._eventsCount===0)return u;for(d in f=this._events)t.call(f,d)&&u.push(r?d.slice(1):d);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},l.prototype.listeners=function(u){var f=r?r+u:u,d=this._events[f];if(!d)return[];if(d.fn)return[d.fn];for(var h=0,p=d.length,g=new Array(p);h<p;h++)g[h]=d[h].fn;return g},l.prototype.listenerCount=function(u){var f=r?r+u:u,d=this._events[f];return d?d.fn?1:d.length:0},l.prototype.emit=function(u,f,d,h,p,g){var y=r?r+u:u;if(!this._events[y])return!1;var b=this._events[y],v=arguments.length,m,x;if(b.fn){switch(b.once&&this.removeListener(u,b.fn,void 0,!0),v){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,f),!0;case 3:return b.fn.call(b.context,f,d),!0;case 4:return b.fn.call(b.context,f,d,h),!0;case 5:return b.fn.call(b.context,f,d,h,p),!0;case 6:return b.fn.call(b.context,f,d,h,p,g),!0}for(x=1,m=new Array(v-1);x<v;x++)m[x-1]=arguments[x];b.fn.apply(b.context,m)}else{var S=b.length,j;for(x=0;x<S;x++)switch(b[x].once&&this.removeListener(u,b[x].fn,void 0,!0),v){case 1:b[x].fn.call(b[x].context);break;case 2:b[x].fn.call(b[x].context,f);break;case 3:b[x].fn.call(b[x].context,f,d);break;case 4:b[x].fn.call(b[x].context,f,d,h);break;default:if(!m)for(j=1,m=new Array(v-1);j<v;j++)m[j-1]=arguments[j];b[x].fn.apply(b[x].context,m)}}return!0},l.prototype.on=function(u,f,d){return i(this,u,f,d,!1)},l.prototype.once=function(u,f,d){return i(this,u,f,d,!0)},l.prototype.removeListener=function(u,f,d,h){var p=r?r+u:u;if(!this._events[p])return this;if(!f)return s(this,p),this;var g=this._events[p];if(g.fn)g.fn===f&&(!h||g.once)&&(!d||g.context===d)&&s(this,p);else{for(var y=0,b=[],v=g.length;y<v;y++)(g[y].fn!==f||h&&!g[y].once||d&&g[y].context!==d)&&b.push(g[y]);b.length?this._events[p]=b.length===1?b[0]:b:s(this,p)}return this},l.prototype.removeAllListeners=function(u){var f;return u?(f=r?r+u:u,this._events[f]&&s(this,f)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,e.exports=l})(HO);var aJ=HO.exports;const iJ=de(aJ);var hh=new iJ,ph="recharts.syncMouseEvents";function il(e){"@babel/helpers - typeof";return il=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},il(e)}function oJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sJ(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,KO(n.key),n)}}function lJ(e,t,r){return t&&sJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function mh(e,t,r){return t=KO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function KO(e){var t=cJ(e,"string");return il(t)=="symbol"?t:t+""}function cJ(e,t){if(il(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(il(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var uJ=function(){function e(){oJ(this,e),mh(this,"activeIndex",0),mh(this,"coordinateList",[]),mh(this,"layout","horizontal")}return lJ(e,[{key:"setDetails",value:function(r){var n,a=r.coordinateList,i=a===void 0?null:a,s=r.container,l=s===void 0?null:s,c=r.layout,u=c===void 0?null:c,f=r.offset,d=f===void 0?null:f,h=r.mouseHandlerCallback,p=h===void 0?null:h;this.coordinateList=(n=i??this.coordinateList)!==null&&n!==void 0?n:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=d??this.offset,this.mouseHandlerCallback=p??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(r){if(this.coordinateList.length!==0)switch(r.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(r){this.activeIndex=r}},{key:"spoofMouse",value:function(){var r,n;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var a=this.container.getBoundingClientRect(),i=a.x,s=a.y,l=a.height,c=this.coordinateList[this.activeIndex].coordinate,u=((r=window)===null||r===void 0?void 0:r.scrollX)||0,f=((n=window)===null||n===void 0?void 0:n.scrollY)||0,d=i+c+u,h=s+this.offset.top+l/2+f;this.mouseHandlerCallback({pageX:d,pageY:h})}}}])}();function dJ(e,t,r){if(r==="number"&&t===!0&&Array.isArray(e)){var n=e==null?void 0:e[0],a=e==null?void 0:e[1];if(n&&a&&U(n)&&U(a))return!0}return!1}function fJ(e,t,r,n){var a=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-a,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function VO(e){var t=e.cx,r=e.cy,n=e.radius,a=e.startAngle,i=e.endAngle,s=ye(t,r,n,a),l=ye(t,r,n,i);return{points:[s,l],cx:t,cy:r,radius:n,startAngle:a,endAngle:i}}function hJ(e,t,r){var n,a,i,s;if(e==="horizontal")n=t.x,i=n,a=r.top,s=r.top+r.height;else if(e==="vertical")a=t.y,s=a,n=r.left,i=r.left+r.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,u=t.innerRadius,f=t.outerRadius,d=t.angle,h=ye(l,c,u,d),p=ye(l,c,f,d);n=h.x,a=h.y,i=p.x,s=p.y}else return VO(t);return[{x:n,y:a},{x:i,y:s}]}function ol(e){"@babel/helpers - typeof";return ol=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ol(e)}function vj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function rc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vj(Object(r),!0).forEach(function(n){pJ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pJ(e,t,r){return t=mJ(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mJ(e){var t=vJ(e,"string");return ol(t)=="symbol"?t:t+""}function vJ(e,t){if(ol(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ol(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yJ(e){var t,r,n=e.element,a=e.tooltipEventType,i=e.isActive,s=e.activeCoordinate,l=e.activePayload,c=e.offset,u=e.activeTooltipIndex,f=e.tooltipAxisBandSize,d=e.layout,h=e.chartName,p=(t=n.props.cursor)!==null&&t!==void 0?t:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!p||!i||!s||h!=="ScatterChart"&&a!=="axis")return null;var g,y=gi;if(h==="ScatterChart")g=s,y=kV;else if(h==="BarChart")g=fJ(d,s,c,f),y=By;else if(d==="radial"){var b=VO(s),v=b.cx,m=b.cy,x=b.radius,S=b.startAngle,j=b.endAngle;g={cx:v,cy:m,startAngle:S,endAngle:j,innerRadius:x,outerRadius:x},y=Bk}else g={points:hJ(d,s,c)},y=gi;var w=rc(rc(rc(rc({stroke:"#ccc",pointerEvents:"none"},c),g),X(p,!1)),{},{payload:l,payloadIndex:u,className:ee("recharts-tooltip-cursor",p.className)});return P.isValidElement(p)?P.cloneElement(p,w):P.createElement(y,w)}var gJ=["item"],xJ=["children","className","width","height","style","compact","title","desc"];function Xi(e){"@babel/helpers - typeof";return Xi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xi(e)}function si(){return si=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},si.apply(this,arguments)}function yj(e,t){return wJ(e)||jJ(e,t)||YO(e,t)||bJ()}function bJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jJ(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function wJ(e){if(Array.isArray(e))return e}function gj(e,t){if(e==null)return{};var r=SJ(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function SJ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _J(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kJ(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,qO(n.key),n)}}function OJ(e,t,r){return t&&kJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function NJ(e,t,r){return t=ed(t),PJ(e,GO()?Reflect.construct(t,r||[],ed(e).constructor):t.apply(e,r))}function PJ(e,t){if(t&&(Xi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return AJ(e)}function AJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function GO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(GO=function(){return!!e})()}function ed(e){return ed=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ed(e)}function CJ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fm(e,t)}function Fm(e,t){return Fm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Fm(e,t)}function Qi(e){return TJ(e)||$J(e)||YO(e)||EJ()}function EJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YO(e,t){if(e){if(typeof e=="string")return zm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zm(e,t)}}function $J(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function TJ(e){if(Array.isArray(e))return zm(e)}function zm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function xj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function B(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xj(Object(r),!0).forEach(function(n){J(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function J(e,t,r){return t=qO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qO(e){var t=MJ(e,"string");return Xi(t)=="symbol"?t:t+""}function MJ(e,t){if(Xi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Xi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var IJ={xAxis:["bottom","top"],yAxis:["left","right"]},LJ={width:"100%",height:"100%"},XO={x:0,y:0};function nc(e){return e}var DJ=function(t,r){return r==="horizontal"?t.x:r==="vertical"?t.y:r==="centric"?t.angle:t.radius},RJ=function(t,r,n,a){var i=r.find(function(f){return f&&f.index===n});if(i){if(t==="horizontal")return{x:i.coordinate,y:a.y};if(t==="vertical")return{x:a.x,y:i.coordinate};if(t==="centric"){var s=i.coordinate,l=a.radius;return B(B(B({},a),ye(a.cx,a.cy,l,s)),{},{angle:s,radius:l})}var c=i.coordinate,u=a.angle;return B(B(B({},a),ye(a.cx,a.cy,c,u)),{},{angle:u,radius:c})}return XO},cf=function(t,r){var n=r.graphicalItems,a=r.dataStartIndex,i=r.dataEndIndex,s=(n??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(Qi(l),Qi(u)):l},[]);return s.length>0?s:t&&t.length&&U(a)&&U(i)?t.slice(a,i+1):[]};function QO(e){return e==="number"?[0,"auto"]:void 0}var Wm=function(t,r,n,a){var i=t.graphicalItems,s=t.tooltipAxis,l=cf(r,t);return n<0||!i||!i.length||n>=l.length?null:i.reduce(function(c,u){var f,d=(f=u.props.data)!==null&&f!==void 0?f:r;d&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(d=d.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(s.dataKey&&!s.allowDuplicatedCategory){var p=d===void 0?l:d;h=Xc(p,s.dataKey,a)}else h=d&&d[n]||l[n];return h?[].concat(Qi(c),[Ry(u,h)]):c},[])},bj=function(t,r,n,a){var i=a||{x:t.chartX,y:t.chartY},s=DJ(i,n),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,f=qW(s,l,u,c);if(f>=0&&u){var d=u[f]&&u[f].value,h=Wm(t,r,f,d),p=RJ(n,l,f,i);return{activeTooltipIndex:f,activeLabel:d,activePayload:h,activeCoordinate:p}}return null},BJ=function(t,r){var n=r.axes,a=r.graphicalItems,i=r.axisType,s=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,h=t.stackOffset,p=_k(f,i);return n.reduce(function(g,y){var b,v=y.type.defaultProps!==void 0?B(B({},y.type.defaultProps),y.props):y.props,m=v.type,x=v.dataKey,S=v.allowDataOverflow,j=v.allowDuplicatedCategory,w=v.scale,_=v.ticks,O=v.includeHidden,N=v[s];if(g[N])return g;var k=cf(t.data,{graphicalItems:a.filter(function(z){var q,ie=s in z.props?z.props[s]:(q=z.type.defaultProps)===null||q===void 0?void 0:q[s];return ie===N}),dataStartIndex:c,dataEndIndex:u}),E=k.length,T,D,A;dJ(v.domain,S,m)&&(T=tm(v.domain,null,S),p&&(m==="number"||w!=="auto")&&(A=rs(k,x,"category")));var L=QO(m);if(!T||T.length===0){var C,M=(C=v.domain)!==null&&C!==void 0?C:L;if(x){if(T=rs(k,x,m),m==="category"&&p){var I=R3(T);j&&I?(D=T,T=zu(0,E)):j||(T=Fb(M,T,y).reduce(function(z,q){return z.indexOf(q)>=0?z:[].concat(Qi(z),[q])},[]))}else if(m==="category")j?T=T.filter(function(z){return z!==""&&!te(z)}):T=Fb(M,T,y).reduce(function(z,q){return z.indexOf(q)>=0||q===""||te(q)?z:[].concat(Qi(z),[q])},[]);else if(m==="number"){var R=eU(k,a.filter(function(z){var q,ie,he=s in z.props?z.props[s]:(q=z.type.defaultProps)===null||q===void 0?void 0:q[s],ge="hide"in z.props?z.props.hide:(ie=z.type.defaultProps)===null||ie===void 0?void 0:ie.hide;return he===N&&(O||!ge)}),x,i,f);R&&(T=R)}p&&(m==="number"||w!=="auto")&&(A=rs(k,x,"category"))}else p?T=zu(0,E):l&&l[N]&&l[N].hasStack&&m==="number"?T=h==="expand"?[0,1]:$k(l[N].stackGroups,c,u):T=Sk(k,a.filter(function(z){var q=s in z.props?z.props[s]:z.type.defaultProps[s],ie="hide"in z.props?z.props.hide:z.type.defaultProps.hide;return q===N&&(O||!ie)}),m,f,!0);if(m==="number")T=Bm(d,T,N,i,_),M&&(T=tm(M,T,S));else if(m==="category"&&M){var F=M,K=T.every(function(z){return F.indexOf(z)>=0});K&&(T=F)}}return B(B({},g),{},J({},N,B(B({},v),{},{axisType:i,domain:T,categoricalDomain:A,duplicateDomain:D,originalDomain:(b=v.domain)!==null&&b!==void 0?b:L,isCategorical:p,layout:f})))},{})},FJ=function(t,r){var n=r.graphicalItems,a=r.Axis,i=r.axisType,s=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,h=cf(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:u}),p=h.length,g=_k(f,i),y=-1;return n.reduce(function(b,v){var m=v.type.defaultProps!==void 0?B(B({},v.type.defaultProps),v.props):v.props,x=m[s],S=QO("number");if(!b[x]){y++;var j;return g?j=zu(0,p):l&&l[x]&&l[x].hasStack?(j=$k(l[x].stackGroups,c,u),j=Bm(d,j,x,i)):(j=tm(S,Sk(h,n.filter(function(w){var _,O,N=s in w.props?w.props[s]:(_=w.type.defaultProps)===null||_===void 0?void 0:_[s],k="hide"in w.props?w.props.hide:(O=w.type.defaultProps)===null||O===void 0?void 0:O.hide;return N===x&&!k}),"number",f),a.defaultProps.allowDataOverflow),j=Bm(d,j,x,i)),B(B({},b),{},J({},x,B(B({axisType:i},a.defaultProps),{},{hide:!0,orientation:Rt(IJ,"".concat(i,".").concat(y%2),null),domain:j,originalDomain:S,isCategorical:g,layout:f})))}return b},{})},zJ=function(t,r){var n=r.axisType,a=n===void 0?"xAxis":n,i=r.AxisComp,s=r.graphicalItems,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,f=t.children,d="".concat(a,"Id"),h=Bt(f,i),p={};return h&&h.length?p=BJ(t,{axes:h,graphicalItems:s,axisType:a,axisIdKey:d,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):s&&s.length&&(p=FJ(t,{Axis:i,graphicalItems:s,axisType:a,axisIdKey:d,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),p},WJ=function(t){var r=yn(t),n=Kr(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:dy(n,function(a){return a.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Ou(r,n)}},jj=function(t){var r=t.children,n=t.defaultShowTooltip,a=Mt(r,zi),i=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(s=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!n}},UJ=function(t){return!t||!t.length?!1:t.some(function(r){var n=Gr(r&&r.type);return n&&n.indexOf("Bar")>=0})},wj=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},HJ=function(t,r){var n=t.props,a=t.graphicalItems,i=t.xAxisMap,s=i===void 0?{}:i,l=t.yAxisMap,c=l===void 0?{}:l,u=n.width,f=n.height,d=n.children,h=n.margin||{},p=Mt(d,zi),g=Mt(d,mi),y=Object.keys(c).reduce(function(j,w){var _=c[w],O=_.orientation;return!_.mirror&&!_.hide?B(B({},j),{},J({},O,j[O]+_.width)):j},{left:h.left||0,right:h.right||0}),b=Object.keys(s).reduce(function(j,w){var _=s[w],O=_.orientation;return!_.mirror&&!_.hide?B(B({},j),{},J({},O,Rt(j,"".concat(O))+_.height)):j},{top:h.top||0,bottom:h.bottom||0}),v=B(B({},b),y),m=v.bottom;p&&(v.bottom+=p.props.height||zi.defaultProps.height),g&&r&&(v=JW(v,a,n,r));var x=u-v.left-v.right,S=f-v.top-v.bottom;return B(B({brushBottom:m},v),{},{width:Math.max(x,0),height:Math.max(S,0)})},KJ=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},uf=function(t){var r=t.chartName,n=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,s=t.validateTooltipEventTypes,l=s===void 0?["axis"]:s,c=t.axisComponents,u=t.legendContent,f=t.formatAxisMap,d=t.defaultProps,h=function(v,m){var x=m.graphicalItems,S=m.stackGroups,j=m.offset,w=m.updateId,_=m.dataStartIndex,O=m.dataEndIndex,N=v.barSize,k=v.layout,E=v.barGap,T=v.barCategoryGap,D=v.maxBarSize,A=wj(k),L=A.numericAxisName,C=A.cateAxisName,M=UJ(x),I=[];return x.forEach(function(R,F){var K=cf(v.data,{graphicalItems:[R],dataStartIndex:_,dataEndIndex:O}),z=R.type.defaultProps!==void 0?B(B({},R.type.defaultProps),R.props):R.props,q=z.dataKey,ie=z.maxBarSize,he=z["".concat(L,"Id")],ge=z["".concat(C,"Id")],Qe={},Ae=c.reduce(function(Kn,Vn){var df=m["".concat(Vn.axisType,"Map")],Zy=z["".concat(Vn.axisType,"Id")];df&&df[Zy]||Vn.axisType==="zAxis"||ka();var eg=df[Zy];return B(B({},Kn),{},J(J({},Vn.axisType,eg),"".concat(Vn.axisType,"Ticks"),Kr(eg)))},Qe),V=Ae[C],Z=Ae["".concat(C,"Ticks")],re=S&&S[he]&&S[he].hasStack&&oU(R,S[he].stackGroups),W=Gr(R.type).indexOf("Bar")>=0,Te=Ou(V,Z),oe=[],We=M&&XW({barSize:N,stackGroups:S,totalSize:KJ(Ae,C)});if(W){var Ue,St,ln=te(ie)?D:ie,Ia=(Ue=(St=Ou(V,Z,!0))!==null&&St!==void 0?St:ln)!==null&&Ue!==void 0?Ue:0;oe=QW({barGap:E,barCategoryGap:T,bandSize:Ia!==Te?Ia:Te,sizeList:We[ge],maxBarSize:ln}),Ia!==Te&&(oe=oe.map(function(Kn){return B(B({},Kn),{},{position:B(B({},Kn.position),{},{offset:Kn.position.offset-Ia/2})})}))}var _l=R&&R.type&&R.type.getComposedData;_l&&I.push({props:B(B({},_l(B(B({},Ae),{},{displayedData:K,props:v,dataKey:q,item:R,bandSize:Te,barPosition:oe,offset:j,stackedData:re,layout:k,dataStartIndex:_,dataEndIndex:O}))),{},J(J(J({key:R.key||"item-".concat(F)},L,Ae[L]),C,Ae[C]),"animationId",w)),childIndex:Q3(R,v.children),item:R})}),I},p=function(v,m){var x=v.props,S=v.dataStartIndex,j=v.dataEndIndex,w=v.updateId;if(!M0({props:x}))return null;var _=x.children,O=x.layout,N=x.stackOffset,k=x.data,E=x.reverseStackOrder,T=wj(O),D=T.numericAxisName,A=T.cateAxisName,L=Bt(_,n),C=iU(k,L,"".concat(D,"Id"),"".concat(A,"Id"),N,E),M=c.reduce(function(z,q){var ie="".concat(q.axisType,"Map");return B(B({},z),{},J({},ie,zJ(x,B(B({},q),{},{graphicalItems:L,stackGroups:q.axisType===D&&C,dataStartIndex:S,dataEndIndex:j}))))},{}),I=HJ(B(B({},M),{},{props:x,graphicalItems:L}),m==null?void 0:m.legendBBox);Object.keys(M).forEach(function(z){M[z]=f(x,M[z],I,z.replace("Map",""),r)});var R=M["".concat(A,"Map")],F=WJ(R),K=h(x,B(B({},M),{},{dataStartIndex:S,dataEndIndex:j,updateId:w,graphicalItems:L,stackGroups:C,offset:I}));return B(B({formattedGraphicalItems:K,graphicalItems:L,offset:I,stackGroups:C},F),M)},g=function(b){function v(m){var x,S,j;return _J(this,v),j=NJ(this,v,[m]),J(j,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),J(j,"accessibilityManager",new uJ),J(j,"handleLegendBBoxUpdate",function(w){if(w){var _=j.state,O=_.dataStartIndex,N=_.dataEndIndex,k=_.updateId;j.setState(B({legendBBox:w},p({props:j.props,dataStartIndex:O,dataEndIndex:N,updateId:k},B(B({},j.state),{},{legendBBox:w}))))}}),J(j,"handleReceiveSyncEvent",function(w,_,O){if(j.props.syncId===w){if(O===j.eventEmitterSymbol&&typeof j.props.syncMethod!="function")return;j.applySyncEvent(_)}}),J(j,"handleBrushChange",function(w){var _=w.startIndex,O=w.endIndex;if(_!==j.state.dataStartIndex||O!==j.state.dataEndIndex){var N=j.state.updateId;j.setState(function(){return B({dataStartIndex:_,dataEndIndex:O},p({props:j.props,dataStartIndex:_,dataEndIndex:O,updateId:N},j.state))}),j.triggerSyncEvent({dataStartIndex:_,dataEndIndex:O})}}),J(j,"handleMouseEnter",function(w){var _=j.getMouseInfo(w);if(_){var O=B(B({},_),{},{isTooltipActive:!0});j.setState(O),j.triggerSyncEvent(O);var N=j.props.onMouseEnter;Q(N)&&N(O,w)}}),J(j,"triggeredAfterMouseMove",function(w){var _=j.getMouseInfo(w),O=_?B(B({},_),{},{isTooltipActive:!0}):{isTooltipActive:!1};j.setState(O),j.triggerSyncEvent(O);var N=j.props.onMouseMove;Q(N)&&N(O,w)}),J(j,"handleItemMouseEnter",function(w){j.setState(function(){return{isTooltipActive:!0,activeItem:w,activePayload:w.tooltipPayload,activeCoordinate:w.tooltipPosition||{x:w.cx,y:w.cy}}})}),J(j,"handleItemMouseLeave",function(){j.setState(function(){return{isTooltipActive:!1}})}),J(j,"handleMouseMove",function(w){w.persist(),j.throttleTriggeredAfterMouseMove(w)}),J(j,"handleMouseLeave",function(w){j.throttleTriggeredAfterMouseMove.cancel();var _={isTooltipActive:!1};j.setState(_),j.triggerSyncEvent(_);var O=j.props.onMouseLeave;Q(O)&&O(_,w)}),J(j,"handleOuterEvent",function(w){var _=X3(w),O=Rt(j.props,"".concat(_));if(_&&Q(O)){var N,k;/.*touch.*/i.test(_)?k=j.getMouseInfo(w.changedTouches[0]):k=j.getMouseInfo(w),O((N=k)!==null&&N!==void 0?N:{},w)}}),J(j,"handleClick",function(w){var _=j.getMouseInfo(w);if(_){var O=B(B({},_),{},{isTooltipActive:!0});j.setState(O),j.triggerSyncEvent(O);var N=j.props.onClick;Q(N)&&N(O,w)}}),J(j,"handleMouseDown",function(w){var _=j.props.onMouseDown;if(Q(_)){var O=j.getMouseInfo(w);_(O,w)}}),J(j,"handleMouseUp",function(w){var _=j.props.onMouseUp;if(Q(_)){var O=j.getMouseInfo(w);_(O,w)}}),J(j,"handleTouchMove",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&j.throttleTriggeredAfterMouseMove(w.changedTouches[0])}),J(j,"handleTouchStart",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&j.handleMouseDown(w.changedTouches[0])}),J(j,"handleTouchEnd",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&j.handleMouseUp(w.changedTouches[0])}),J(j,"handleDoubleClick",function(w){var _=j.props.onDoubleClick;if(Q(_)){var O=j.getMouseInfo(w);_(O,w)}}),J(j,"handleContextMenu",function(w){var _=j.props.onContextMenu;if(Q(_)){var O=j.getMouseInfo(w);_(O,w)}}),J(j,"triggerSyncEvent",function(w){j.props.syncId!==void 0&&hh.emit(ph,j.props.syncId,w,j.eventEmitterSymbol)}),J(j,"applySyncEvent",function(w){var _=j.props,O=_.layout,N=_.syncMethod,k=j.state.updateId,E=w.dataStartIndex,T=w.dataEndIndex;if(w.dataStartIndex!==void 0||w.dataEndIndex!==void 0)j.setState(B({dataStartIndex:E,dataEndIndex:T},p({props:j.props,dataStartIndex:E,dataEndIndex:T,updateId:k},j.state)));else if(w.activeTooltipIndex!==void 0){var D=w.chartX,A=w.chartY,L=w.activeTooltipIndex,C=j.state,M=C.offset,I=C.tooltipTicks;if(!M)return;if(typeof N=="function")L=N(I,w);else if(N==="value"){L=-1;for(var R=0;R<I.length;R++)if(I[R].value===w.activeLabel){L=R;break}}var F=B(B({},M),{},{x:M.left,y:M.top}),K=Math.min(D,F.x+F.width),z=Math.min(A,F.y+F.height),q=I[L]&&I[L].value,ie=Wm(j.state,j.props.data,L),he=I[L]?{x:O==="horizontal"?I[L].coordinate:K,y:O==="horizontal"?z:I[L].coordinate}:XO;j.setState(B(B({},w),{},{activeLabel:q,activeCoordinate:he,activePayload:ie,activeTooltipIndex:L}))}else j.setState(w)}),J(j,"renderCursor",function(w){var _,O=j.state,N=O.isTooltipActive,k=O.activeCoordinate,E=O.activePayload,T=O.offset,D=O.activeTooltipIndex,A=O.tooltipAxisBandSize,L=j.getTooltipEventType(),C=(_=w.props.active)!==null&&_!==void 0?_:N,M=j.props.layout,I=w.key||"_recharts-cursor";return $.createElement(yJ,{key:I,activeCoordinate:k,activePayload:E,activeTooltipIndex:D,chartName:r,element:w,isActive:C,layout:M,offset:T,tooltipAxisBandSize:A,tooltipEventType:L})}),J(j,"renderPolarAxis",function(w,_,O){var N=Rt(w,"type.axisType"),k=Rt(j.state,"".concat(N,"Map")),E=w.type.defaultProps,T=E!==void 0?B(B({},E),w.props):w.props,D=k&&k[T["".concat(N,"Id")]];return P.cloneElement(w,B(B({},D),{},{className:ee(N,D.className),key:w.key||"".concat(_,"-").concat(O),ticks:Kr(D,!0)}))}),J(j,"renderPolarGrid",function(w){var _=w.props,O=_.radialLines,N=_.polarAngles,k=_.polarRadius,E=j.state,T=E.radiusAxisMap,D=E.angleAxisMap,A=yn(T),L=yn(D),C=L.cx,M=L.cy,I=L.innerRadius,R=L.outerRadius;return P.cloneElement(w,{polarAngles:Array.isArray(N)?N:Kr(L,!0).map(function(F){return F.coordinate}),polarRadius:Array.isArray(k)?k:Kr(A,!0).map(function(F){return F.coordinate}),cx:C,cy:M,innerRadius:I,outerRadius:R,key:w.key||"polar-grid",radialLines:O})}),J(j,"renderLegend",function(){var w=j.state.formattedGraphicalItems,_=j.props,O=_.children,N=_.width,k=_.height,E=j.props.margin||{},T=N-(E.left||0)-(E.right||0),D=jk({children:O,formattedGraphicalItems:w,legendWidth:T,legendContent:u});if(!D)return null;var A=D.item,L=gj(D,gJ);return P.cloneElement(A,B(B({},L),{},{chartWidth:N,chartHeight:k,margin:E,onBBoxUpdate:j.handleLegendBBoxUpdate}))}),J(j,"renderTooltip",function(){var w,_=j.props,O=_.children,N=_.accessibilityLayer,k=Mt(O,Ge);if(!k)return null;var E=j.state,T=E.isTooltipActive,D=E.activeCoordinate,A=E.activePayload,L=E.activeLabel,C=E.offset,M=(w=k.props.active)!==null&&w!==void 0?w:T;return P.cloneElement(k,{viewBox:B(B({},C),{},{x:C.left,y:C.top}),active:M,label:L,payload:M?A:[],coordinate:D,accessibilityLayer:N})}),J(j,"renderBrush",function(w){var _=j.props,O=_.margin,N=_.data,k=j.state,E=k.offset,T=k.dataStartIndex,D=k.dataEndIndex,A=k.updateId;return P.cloneElement(w,{key:w.key||"_recharts-brush",onChange:Jl(j.handleBrushChange,w.props.onChange),data:N,x:U(w.props.x)?w.props.x:E.left,y:U(w.props.y)?w.props.y:E.top+E.height+E.brushBottom-(O.bottom||0),width:U(w.props.width)?w.props.width:E.width,startIndex:T,endIndex:D,updateId:"brush-".concat(A)})}),J(j,"renderReferenceElement",function(w,_,O){if(!w)return null;var N=j,k=N.clipPathId,E=j.state,T=E.xAxisMap,D=E.yAxisMap,A=E.offset,L=w.type.defaultProps||{},C=w.props,M=C.xAxisId,I=M===void 0?L.xAxisId:M,R=C.yAxisId,F=R===void 0?L.yAxisId:R;return P.cloneElement(w,{key:w.key||"".concat(_,"-").concat(O),xAxis:T[I],yAxis:D[F],viewBox:{x:A.left,y:A.top,width:A.width,height:A.height},clipPathId:k})}),J(j,"renderActivePoints",function(w){var _=w.item,O=w.activePoint,N=w.basePoint,k=w.childIndex,E=w.isRange,T=[],D=_.props.key,A=_.item.type.defaultProps!==void 0?B(B({},_.item.type.defaultProps),_.item.props):_.item.props,L=A.activeDot,C=A.dataKey,M=B(B({index:k,dataKey:C,cx:O.x,cy:O.y,r:4,fill:Dy(_.item),strokeWidth:2,stroke:"#fff",payload:O.payload,value:O.value},X(L,!1)),Qc(L));return T.push(v.renderActiveDot(L,M,"".concat(D,"-activePoint-").concat(k))),N?T.push(v.renderActiveDot(L,B(B({},M),{},{cx:N.x,cy:N.y}),"".concat(D,"-basePoint-").concat(k))):E&&T.push(null),T}),J(j,"renderGraphicChild",function(w,_,O){var N=j.filterFormatItem(w,_,O);if(!N)return null;var k=j.getTooltipEventType(),E=j.state,T=E.isTooltipActive,D=E.tooltipAxis,A=E.activeTooltipIndex,L=E.activeLabel,C=j.props.children,M=Mt(C,Ge),I=N.props,R=I.points,F=I.isRange,K=I.baseLine,z=N.item.type.defaultProps!==void 0?B(B({},N.item.type.defaultProps),N.item.props):N.item.props,q=z.activeDot,ie=z.hide,he=z.activeBar,ge=z.activeShape,Qe=!!(!ie&&T&&M&&(q||he||ge)),Ae={};k!=="axis"&&M&&M.props.trigger==="click"?Ae={onClick:Jl(j.handleItemMouseEnter,w.props.onClick)}:k!=="axis"&&(Ae={onMouseLeave:Jl(j.handleItemMouseLeave,w.props.onMouseLeave),onMouseEnter:Jl(j.handleItemMouseEnter,w.props.onMouseEnter)});var V=P.cloneElement(w,B(B({},N.props),Ae));function Z(Vn){return typeof D.dataKey=="function"?D.dataKey(Vn.payload):null}if(Qe)if(A>=0){var re,W;if(D.dataKey&&!D.allowDuplicatedCategory){var Te=typeof D.dataKey=="function"?Z:"payload.".concat(D.dataKey.toString());re=Xc(R,Te,L),W=F&&K&&Xc(K,Te,L)}else re=R==null?void 0:R[A],W=F&&K&&K[A];if(ge||he){var oe=w.props.activeIndex!==void 0?w.props.activeIndex:A;return[P.cloneElement(w,B(B(B({},N.props),Ae),{},{activeIndex:oe})),null,null]}if(!te(re))return[V].concat(Qi(j.renderActivePoints({item:N,activePoint:re,basePoint:W,childIndex:A,isRange:F})))}else{var We,Ue=(We=j.getItemByXY(j.state.activeCoordinate))!==null&&We!==void 0?We:{graphicalItem:V},St=Ue.graphicalItem,ln=St.item,Ia=ln===void 0?w:ln,_l=St.childIndex,Kn=B(B(B({},N.props),Ae),{},{activeIndex:_l});return[P.cloneElement(Ia,Kn),null,null]}return F?[V,null,null]:[V,null]}),J(j,"renderCustomized",function(w,_,O){return P.cloneElement(w,B(B({key:"recharts-customized-".concat(O)},j.props),j.state))}),J(j,"renderMap",{CartesianGrid:{handler:nc,once:!0},ReferenceArea:{handler:j.renderReferenceElement},ReferenceLine:{handler:nc},ReferenceDot:{handler:j.renderReferenceElement},XAxis:{handler:nc},YAxis:{handler:nc},Brush:{handler:j.renderBrush,once:!0},Bar:{handler:j.renderGraphicChild},Line:{handler:j.renderGraphicChild},Area:{handler:j.renderGraphicChild},Radar:{handler:j.renderGraphicChild},RadialBar:{handler:j.renderGraphicChild},Scatter:{handler:j.renderGraphicChild},Pie:{handler:j.renderGraphicChild},Funnel:{handler:j.renderGraphicChild},Tooltip:{handler:j.renderCursor,once:!0},PolarGrid:{handler:j.renderPolarGrid,once:!0},PolarAngleAxis:{handler:j.renderPolarAxis},PolarRadiusAxis:{handler:j.renderPolarAxis},Customized:{handler:j.renderCustomized}}),j.clipPathId="".concat((x=m.id)!==null&&x!==void 0?x:co("recharts"),"-clip"),j.throttleTriggeredAfterMouseMove=j_(j.triggeredAfterMouseMove,(S=m.throttleDelay)!==null&&S!==void 0?S:1e3/60),j.state={},j}return CJ(v,b),OJ(v,[{key:"componentDidMount",value:function(){var x,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,S=x.children,j=x.data,w=x.height,_=x.layout,O=Mt(S,Ge);if(O){var N=O.props.defaultIndex;if(!(typeof N!="number"||N<0||N>this.state.tooltipTicks.length-1)){var k=this.state.tooltipTicks[N]&&this.state.tooltipTicks[N].value,E=Wm(this.state,j,N,k),T=this.state.tooltipTicks[N].coordinate,D=(this.state.offset.top+w)/2,A=_==="horizontal",L=A?{x:T,y:D}:{y:T,x:D},C=this.state.formattedGraphicalItems.find(function(I){var R=I.item;return R.type.name==="Scatter"});C&&(L=B(B({},L),C.props.points[N].tooltipPosition),E=C.props.points[N].tooltipPayload);var M={activeTooltipIndex:N,isTooltipActive:!0,activeLabel:k,activePayload:E,activeCoordinate:L};this.setState(M),this.renderCursor(O),this.accessibilityManager.setIndex(N)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var j,w;this.accessibilityManager.setDetails({offset:{left:(j=this.props.margin.left)!==null&&j!==void 0?j:0,top:(w=this.props.margin.top)!==null&&w!==void 0?w:0}})}return null}},{key:"componentDidUpdate",value:function(x){vp([Mt(x.children,Ge)],[Mt(this.props.children,Ge)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=Mt(this.props.children,Ge);if(x&&typeof x.props.shared=="boolean"){var S=x.props.shared?"axis":"item";return l.indexOf(S)>=0?S:i}return i}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var S=this.container,j=S.getBoundingClientRect(),w=SF(j),_={chartX:Math.round(x.pageX-w.left),chartY:Math.round(x.pageY-w.top)},O=j.width/S.offsetWidth||1,N=this.inRange(_.chartX,_.chartY,O);if(!N)return null;var k=this.state,E=k.xAxisMap,T=k.yAxisMap,D=this.getTooltipEventType(),A=bj(this.state,this.props.data,this.props.layout,N);if(D!=="axis"&&E&&T){var L=yn(E).scale,C=yn(T).scale,M=L&&L.invert?L.invert(_.chartX):null,I=C&&C.invert?C.invert(_.chartY):null;return B(B({},_),{},{xValue:M,yValue:I},A)}return A?B(B({},_),A):null}},{key:"inRange",value:function(x,S){var j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,w=this.props.layout,_=x/j,O=S/j;if(w==="horizontal"||w==="vertical"){var N=this.state.offset,k=_>=N.left&&_<=N.left+N.width&&O>=N.top&&O<=N.top+N.height;return k?{x:_,y:O}:null}var E=this.state,T=E.angleAxisMap,D=E.radiusAxisMap;if(T&&D){var A=yn(T);return Ub({x:_,y:O},A)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,S=this.getTooltipEventType(),j=Mt(x,Ge),w={};j&&S==="axis"&&(j.props.trigger==="click"?w={onClick:this.handleClick}:w={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var _=Qc(this.props,this.handleOuterEvent);return B(B({},_),w)}},{key:"addListener",value:function(){hh.on(ph,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){hh.removeListener(ph,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,S,j){for(var w=this.state.formattedGraphicalItems,_=0,O=w.length;_<O;_++){var N=w[_];if(N.item===x||N.props.key===x.key||S===Gr(N.item.type)&&j===N.childIndex)return N}return null}},{key:"renderClipPath",value:function(){var x=this.clipPathId,S=this.state.offset,j=S.left,w=S.top,_=S.height,O=S.width;return $.createElement("defs",null,$.createElement("clipPath",{id:x},$.createElement("rect",{x:j,y:w,height:_,width:O})))}},{key:"getXScales",value:function(){var x=this.state.xAxisMap;return x?Object.entries(x).reduce(function(S,j){var w=yj(j,2),_=w[0],O=w[1];return B(B({},S),{},J({},_,O.scale))},{}):null}},{key:"getYScales",value:function(){var x=this.state.yAxisMap;return x?Object.entries(x).reduce(function(S,j){var w=yj(j,2),_=w[0],O=w[1];return B(B({},S),{},J({},_,O.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(x){var S;return(S=this.state.xAxisMap)===null||S===void 0||(S=S[x])===null||S===void 0?void 0:S.scale}},{key:"getYScaleByAxisId",value:function(x){var S;return(S=this.state.yAxisMap)===null||S===void 0||(S=S[x])===null||S===void 0?void 0:S.scale}},{key:"getItemByXY",value:function(x){var S=this.state,j=S.formattedGraphicalItems,w=S.activeItem;if(j&&j.length)for(var _=0,O=j.length;_<O;_++){var N=j[_],k=N.props,E=N.item,T=E.type.defaultProps!==void 0?B(B({},E.type.defaultProps),E.props):E.props,D=Gr(E.type);if(D==="Bar"){var A=(k.data||[]).find(function(I){return iV(x,I)});if(A)return{graphicalItem:N,payload:A}}else if(D==="RadialBar"){var L=(k.data||[]).find(function(I){return Ub(x,I)});if(L)return{graphicalItem:N,payload:L}}else if(tf(N,w)||rf(N,w)||Zs(N,w)){var C=GG({graphicalItem:N,activeTooltipItem:w,itemData:T.data}),M=T.activeIndex===void 0?C:T.activeIndex;return{graphicalItem:B(B({},N),{},{childIndex:M}),payload:Zs(N,w)?T.data[C]:N.props.data[C]}}}return null}},{key:"render",value:function(){var x=this;if(!M0(this))return null;var S=this.props,j=S.children,w=S.className,_=S.width,O=S.height,N=S.style,k=S.compact,E=S.title,T=S.desc,D=gj(S,xJ),A=X(D,!1);if(k)return $.createElement(ej,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},$.createElement(gp,si({},A,{width:_,height:O,title:E,desc:T}),this.renderClipPath(),L0(j,this.renderMap)));if(this.props.accessibilityLayer){var L,C;A.tabIndex=(L=this.props.tabIndex)!==null&&L!==void 0?L:0,A.role=(C=this.props.role)!==null&&C!==void 0?C:"application",A.onKeyDown=function(I){x.accessibilityManager.keyboardEvent(I)},A.onFocus=function(){x.accessibilityManager.focus()}}var M=this.parseEventsOfWrapper();return $.createElement(ej,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},$.createElement("div",si({className:ee("recharts-wrapper",w),style:B({position:"relative",cursor:"default",width:_,height:O},N)},M,{ref:function(R){x.container=R}}),$.createElement(gp,si({},A,{width:_,height:O,title:E,desc:T,style:LJ}),this.renderClipPath(),L0(j,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(P.Component);J(g,"displayName",r),J(g,"defaultProps",B({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},d)),J(g,"getDerivedStateFromProps",function(b,v){var m=b.dataKey,x=b.data,S=b.children,j=b.width,w=b.height,_=b.layout,O=b.stackOffset,N=b.margin,k=v.dataStartIndex,E=v.dataEndIndex;if(v.updateId===void 0){var T=jj(b);return B(B(B({},T),{},{updateId:0},p(B(B({props:b},T),{},{updateId:0}),v)),{},{prevDataKey:m,prevData:x,prevWidth:j,prevHeight:w,prevLayout:_,prevStackOffset:O,prevMargin:N,prevChildren:S})}if(m!==v.prevDataKey||x!==v.prevData||j!==v.prevWidth||w!==v.prevHeight||_!==v.prevLayout||O!==v.prevStackOffset||!pi(N,v.prevMargin)){var D=jj(b),A={chartX:v.chartX,chartY:v.chartY,isTooltipActive:v.isTooltipActive},L=B(B({},bj(v,x,_)),{},{updateId:v.updateId+1}),C=B(B(B({},D),A),L);return B(B(B({},C),p(B({props:b},C),v)),{},{prevDataKey:m,prevData:x,prevWidth:j,prevHeight:w,prevLayout:_,prevStackOffset:O,prevMargin:N,prevChildren:S})}if(!vp(S,v.prevChildren)){var M,I,R,F,K=Mt(S,zi),z=K&&(M=(I=K.props)===null||I===void 0?void 0:I.startIndex)!==null&&M!==void 0?M:k,q=K&&(R=(F=K.props)===null||F===void 0?void 0:F.endIndex)!==null&&R!==void 0?R:E,ie=z!==k||q!==E,he=!te(x),ge=he&&!ie?v.updateId:v.updateId+1;return B(B({updateId:ge},p(B(B({props:b},v),{},{updateId:ge,dataStartIndex:z,dataEndIndex:q}),v)),{},{prevChildren:S,dataStartIndex:z,dataEndIndex:q})}return null}),J(g,"renderActiveDot",function(b,v,m){var x;return P.isValidElement(b)?x=P.cloneElement(b,v):Q(b)?x=b(v):x=$.createElement(Jd,v),$.createElement(ne,{className:"recharts-active-dot",key:m},x)});var y=P.forwardRef(function(v,m){return $.createElement(g,si({},v,{ref:m}))});return y.displayName=g.displayName,y},Sl=uf({chartName:"BarChart",GraphicalChild:rr,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:ir},{axisType:"yAxis",AxisComp:or}],formatAxisMap:pO}),Xy=uf({chartName:"PieChart",GraphicalChild:jr,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:jl},{axisType:"radiusAxis",AxisComp:bl}],formatAxisMap:Ik,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),Qy=uf({chartName:"AreaChart",GraphicalChild:Ir,axisComponents:[{axisType:"xAxis",AxisComp:ir},{axisType:"yAxis",AxisComp:or}],formatAxisMap:pO}),VJ=uf({chartName:"RadialBarChart",GraphicalChild:wl,legendContent:"children",defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"angleAxis",AxisComp:jl},{axisType:"radiusAxis",AxisComp:bl}],formatAxisMap:Ik,defaultProps:{layout:"radial",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});function GJ({data:e=[],color:t="var(--cyan)",width:r=60,height:n=20,id:a="spark"}){const i=P.useMemo(()=>{if(!e||e.length<2)return null;const l=Math.min(...e),u=Math.max(...e)-l||1,f=2,d=e.map((y,b)=>b/(e.length-1)*r),h=e.map(y=>n-f-(y-l)/u*(n-f*2)),p=d.map((y,b)=>`${y},${h[b]}`).join(" "),g=`M ${d[0]},${h[0]} `+d.slice(1).map((y,b)=>`L ${y},${h[b+1]}`).join(" ")+` L ${d[d.length-1]},${n} L ${d[0]},${n} Z`;return{polyline:p,fillPath:g}},[e,r,n]);if(!i)return o.jsx("svg",{width:r,height:n});const s=`spark-grad-${a}`;return o.jsxs("svg",{width:r,height:n,viewBox:`0 0 ${r} ${n}`,style:{display:"inline-block",verticalAlign:"middle",flexShrink:0},"aria-hidden":"true",children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:s,x1:"0",y1:"0",x2:"0",y2:"1",children:[o.jsx("stop",{offset:"0%",stopColor:t,stopOpacity:"0.25"}),o.jsx("stop",{offset:"100%",stopColor:t,stopOpacity:"0.01"})]})}),o.jsx("path",{d:i.fillPath,fill:`url(#${s})`}),o.jsx("polyline",{points:i.polyline,fill:"none",stroke:t,strokeWidth:"1.5",strokeLinejoin:"round",strokeLinecap:"round"}),(()=>{const l=(e.length-1)/(e.length-1)*r,c=Math.min(...e),f=Math.max(...e)-c||1,d=2,h=n-d-(e[e.length-1]-c)/f*(n-d*2);return o.jsx("circle",{cx:l,cy:h,r:"2",fill:t})})()]})}function YJ(e,t=800){const[r,n]=P.useState(e),a=P.useRef(e),i=P.useRef(null),s=P.useRef(null),l=P.useRef(e);return P.useEffect(()=>{l.current=e,a.current=r,i.current=null;const c=u=>{i.current||(i.current=u);const f=u-i.current,d=Math.min(1,f/t),h=d===1?1:1-Math.pow(2,-10*d),p=a.current+(l.current-a.current)*h;n(p),d<1&&(s.current=requestAnimationFrame(c))};return s.current=requestAnimationFrame(c),()=>cancelAnimationFrame(s.current)},[e]),r}const Sj=["#00F0FF","#F7931A","#00C389","#3B82F6","#A855F7","#FF5C5C"];function qJ(e){return e?new Date(e+"T00:00:00").toLocaleDateString("en-US",{month:"short",day:"numeric"}):""}function Lo(e,t=8){let r=e;return Array.from({length:t},()=>(r=r*1664525+1013904223&4294967295,Math.abs(r)%100+10))}const _j={Balance:Lo(42,9),Positions:Lo(17,9),"Open Markets":Lo(93,9),"Today P&L":Lo(55,9),"Markets Tracked":Lo(71,9)};function ac({cents:e}){const t=Number(e||0),r=(t/100).toFixed(2);return t>0?o.jsxs("span",{className:"mono",style:{color:"var(--green)",fontWeight:700},children:["+$",r]}):t<0?o.jsxs("span",{className:"mono",style:{color:"var(--red)",fontWeight:700},children:["-$",Math.abs(t/100).toFixed(2)]}):o.jsx("span",{className:"mono",style:{color:"var(--text-muted)"},children:"$0.00"})}function kj({wins:e,losses:t}){const r=e+t;if(!r)return o.jsx("span",{style:{color:"var(--text-muted)"},children:"—"});const n=(e/r*100).toFixed(0),a=n>=80?"var(--green)":n>=50?"var(--orange)":"var(--red)";return o.jsxs("span",{style:{color:a},children:[e,"/",r," (",n,"%)"]})}function Oj({wins:e,losses:t,pnl:r}){const n=e+t,a=n>0?e/n:0,i={padding:"2px 8px",borderRadius:4,fontSize:10,fontWeight:700,fontFamily:"var(--font-body)"};return a>=.9&&r>0?o.jsx("span",{style:{...i,background:"var(--green-dim)",color:"var(--green)",border:"1px solid rgba(0,195,137,0.25)"},children:"ADD MORE"}):a>=.65&&r>0?o.jsx("span",{style:{...i,background:"var(--orange-dim)",color:"var(--orange)",border:"1px solid rgba(247,147,26,0.25)"},children:"HOLD"}):r<0?o.jsx("span",{style:{...i,background:"var(--red-dim)",color:"var(--red)",border:"1px solid rgba(255,92,92,0.25)"},children:"REDUCE"}):o.jsx("span",{style:{...i,background:"rgba(107,114,128,0.15)",color:"var(--text-muted)",border:"1px solid var(--border)"},children:"WATCH"})}function XJ({opportunities:e}){const t=e||[];if(!t.length)return o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"section-title",style:{marginBottom:8},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--cyan)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),"Best Opportunities Right Now"]}),o.jsx("p",{style:{color:"var(--text-muted)",fontSize:13,textAlign:"center",padding:"24px 0"},children:"No fresh signals — waiting for next pipeline cycle..."})]});const r=[{borderColor:"rgba(247,147,26,0.35)",background:"rgba(247,147,26,0.06)",rankColor:"var(--orange)",rankLabel:"#1"},{borderColor:"rgba(160,160,160,0.25)",background:"rgba(160,160,160,0.04)",rankColor:"var(--text-dim)",rankLabel:"#2"},{borderColor:"rgba(180,100,50,0.25)",background:"rgba(180,100,50,0.04)",rankColor:"#CD7F32",rankLabel:"#3"}];return o.jsxs("div",{className:"card",style:{border:"1px solid rgba(0,240,255,0.15)",background:"linear-gradient(135deg, rgba(0,240,255,0.03), var(--surface), rgba(0,195,137,0.03))"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:16},children:[o.jsxs("div",{className:"section-title",children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--cyan)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z"})}),"Best Opportunities Right Now"]}),o.jsx("span",{style:{marginLeft:"auto",fontSize:10,color:"var(--text-muted)",textTransform:"uppercase",fontWeight:600,letterSpacing:"0.08em"},children:"Live Signals"})]}),o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:t.map((n,a)=>{const i=r[a]||r[2],s=n.hist_trades>0,l=parseFloat(n.hist_wr)>=80?"var(--green)":parseFloat(n.hist_wr)>=50?"var(--orange)":"var(--red)";return o.jsxs("div",{className:a===0?"breathe-neon":"",style:{borderRadius:10,padding:"14px 16px",background:i.background,border:`1px solid ${i.borderColor}`,display:"flex",gap:14,alignItems:"flex-start"},children:[o.jsx("div",{style:{width:28,height:28,borderRadius:7,background:`${i.rankColor}22`,border:`1px solid ${i.borderColor}`,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:2},children:o.jsx("span",{style:{fontSize:11,fontWeight:800,color:i.rankColor,fontFamily:"var(--font-mono)"},children:i.rankLabel})}),o.jsxs("div",{style:{flex:1,minWidth:0},children:[o.jsx("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",style:{fontSize:13,fontWeight:600,color:"var(--text)",textDecoration:"none",display:"block",marginBottom:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},onMouseEnter:c=>{c.currentTarget.style.color="var(--cyan)"},onMouseLeave:c=>{c.currentTarget.style.color="var(--text)"},children:n.title}),o.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8,marginBottom:8},children:[o.jsxs("span",{className:"badge",style:n.direction==="NO"?{background:"var(--red-dim)",color:"var(--red)",border:"1px solid rgba(255,92,92,0.25)"}:{background:"var(--green-dim)",color:"var(--green)",border:"1px solid rgba(0,195,137,0.25)"},children:["BUY ",n.direction]}),o.jsxs("span",{style:{fontSize:12,color:"var(--text-muted)"},children:["Edge: ",o.jsxs("span",{className:"mono",style:{color:"var(--cyan)",fontWeight:700},children:[n.edge_pct,"%"]})]}),o.jsxs("span",{style:{fontSize:12,color:"var(--text-muted)"},children:["Conf: ",o.jsxs("span",{style:{color:"var(--blue)",fontWeight:700},children:[n.confidence,"%"]})]}),n.price_cents>0&&o.jsxs("span",{style:{fontSize:12,color:"var(--text-muted)"},children:["Price: ",o.jsxs("span",{className:"mono",style:{color:"var(--text)"},children:[n.price_cents,"c"]})]}),s&&o.jsxs("span",{style:{fontSize:12,color:"var(--text-muted)"},children:["History: ",o.jsxs("span",{style:{fontWeight:700,color:l},children:[n.hist_wr,"% WR"]}),o.jsxs("span",{style:{color:"var(--text-muted)",marginLeft:4},children:["(",n.hist_trades," trades, ",n.hist_pnl/100>=0?"+":"","$",(n.hist_pnl/100).toFixed(0),")"]})]}),!s&&o.jsx("span",{style:{fontSize:11,color:"var(--text-muted)",fontStyle:"italic"},children:"New market"})]}),o.jsx("p",{style:{fontSize:11,color:"var(--text-dim)",lineHeight:1.5},children:n.why})]})]},n.ticker)})})]})}function QJ({topMarkets:e,seedMoney:t,balance:r}){const n=(e||[]).slice(0,3);if(!n.length)return null;const a=n.reduce((f,d)=>f+d.wins/(d.wins+d.losses),0)/n.length*100,i=n.length>0?Math.round(n.reduce((f,d)=>{const h=d.wins/(d.wins+d.losses||1);return f+(h>=.9?95:80)},0)/n.length):95,s=t?t/100:5e4,l=r?r/100:s,c=s>0?(l-s)/s*100:0,u=[{icon:o.jsx("svg",{style:{width:20,height:20},fill:"none",stroke:"var(--cyan)",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"})}),label:`Start: $${s.toLocaleString()}`,sub:`$${l.toLocaleString()} (${c>=0?"+":""}${c.toFixed(1)}%)`,borderColor:"rgba(0,240,255,0.25)",subColor:c>=0?"var(--green)":"var(--red)"},{icon:o.jsx("svg",{style:{width:20,height:20},fill:"none",stroke:"var(--blue)",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0"})}),label:"Signal Found",sub:"AI scans 135 markets",borderColor:"rgba(59,130,246,0.25)",subColor:"var(--text-muted)"},{icon:o.jsx("svg",{style:{width:20,height:20},fill:"none",stroke:"var(--orange)",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),label:`Buy NO at ${i}c`,sub:"High-prob event",borderColor:"rgba(247,147,26,0.25)",subColor:"var(--text-muted)"},{icon:o.jsx("svg",{style:{width:20,height:20},fill:"none",stroke:"var(--purple)",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),label:"Hold 5min-2hr",sub:"TP +3c / SL -5c",borderColor:"rgba(168,85,247,0.25)",subColor:"var(--text-muted)"},{icon:o.jsx("svg",{style:{width:20,height:20},fill:"none",stroke:"var(--green)",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),label:`Collect ${100-i}c`,sub:`${a.toFixed(0)}% of the time`,borderColor:"rgba(0,195,137,0.25)",subColor:"var(--text-muted)"}];return o.jsxs("div",{className:"card",style:{border:"1px solid rgba(0,195,137,0.12)",background:"linear-gradient(135deg, rgba(0,195,137,0.04), var(--surface), rgba(247,147,26,0.04))"},children:[o.jsxs("div",{className:"section-title",style:{marginBottom:16},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--cyan)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Winning Strategy — Live Flow"]}),o.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:18},children:u.map((f,d)=>o.jsxs($.Fragment,{children:[o.jsxs("div",{style:{flex:1,borderRadius:10,padding:"12px 10px",background:"rgba(255,255,255,0.02)",border:`1px solid ${f.borderColor}`,textAlign:"center"},children:[o.jsx("div",{style:{display:"flex",justifyContent:"center",marginBottom:6},children:f.icon}),o.jsx("p",{style:{fontSize:11,fontWeight:600,color:"var(--text)",marginBottom:2},children:f.label}),o.jsx("p",{style:{fontSize:10,color:f.subColor},children:f.sub})]}),d<u.length-1&&o.jsx("svg",{style:{width:14,height:14,color:"var(--border-light)",flexShrink:0},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 5l7 7-7 7"})})]},d))}),o.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3,1fr)",gap:10},children:[{label:"Cost Per Trade",value:`${i}c`,sub:"buying NO side",color:"var(--orange)"},{label:"Profit on Win",value:`${100-i}c`,sub:"per contract",color:"var(--green)"},{label:"Return Multiple",value:`${((100-i)/i*100).toFixed(0)}%`,sub:"per winning trade",color:"var(--green)"}].map(f=>o.jsxs("div",{style:{borderRadius:8,padding:"12px",background:"var(--surface-el)",border:"1px solid var(--border)",textAlign:"center"},children:[o.jsx("p",{className:"stat-label",style:{marginBottom:4},children:f.label}),o.jsx("p",{className:"mono",style:{fontSize:20,fontWeight:700,color:f.color},children:f.value}),o.jsx("p",{style:{fontSize:10,color:"var(--text-muted)",marginTop:2},children:f.sub})]},f.label))})]})}function JJ({topMarkets:e,worstMarkets:t,strategies:r}){const n=(e||[]).filter(c=>c.wins/(c.wins+c.losses||1)>=.9&&c.pnl>0),a=(t||[]).filter(c=>c.pnl<-5e3),i=(r||[]).filter(c=>c.pnl<-1e4&&c.win_rate<20).slice(0,3),s=[];n.length>0&&s.push({priority:"HIGH",color:"green",iconPath:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6",title:`Double down on ${n.length} near-certain markets`,detail:n.slice(0,2).map(c=>{var u;return((u=c.title)==null?void 0:u.split("?")[0])||c.ticker}).join(", "),reason:`${n.length} markets have 90%+ win rate — the edge is proven`}),a.length>0&&s.push({priority:"HIGH",color:"red",iconPath:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636",title:`Exit ${a.length} bleeding market(s)`,detail:a.slice(0,2).map(c=>{var u;return((u=c.title)==null?void 0:u.split("?")[0])||c.ticker}).join(", "),reason:`0% win rate, losing $${Math.abs(a.reduce((c,u)=>c+u.pnl,0)/100).toFixed(0)} total`}),i.length>0&&s.push({priority:"MED",color:"orange",iconPath:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z",title:`Consider disabling ${i.length} strategy(ies)`,detail:i.map(c=>c.name).join(", "),reason:"Sub-20% win rate — these are coin flips minus fees"}),s.push({priority:"INFO",color:"cyan",iconPath:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z",title:"Keep hyper-trading high-prob NO markets",detail:"The 95c+ NO strategy is the #1 edge — scale it up",reason:"Compounding small spreads at 99%+ win rate = consistent returns"});const l={green:{bg:"var(--green-dim)",border:"rgba(0,195,137,0.2)",text:"var(--green)",badge:"rgba(0,195,137,0.2)"},red:{bg:"var(--red-dim)",border:"rgba(255,92,92,0.2)",text:"var(--red)",badge:"rgba(255,92,92,0.2)"},orange:{bg:"var(--orange-dim)",border:"rgba(247,147,26,0.2)",text:"var(--orange)",badge:"rgba(247,147,26,0.2)"},cyan:{bg:"var(--cyan-dim)",border:"rgba(0,240,255,0.2)",text:"var(--cyan)",badge:"rgba(0,240,255,0.2)"}};return o.jsxs("div",{className:"card",style:{border:"1px solid rgba(247,147,26,0.12)"},children:[o.jsxs("div",{className:"section-title",style:{marginBottom:14},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--orange)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z"})}),"What To Do Next"]}),o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:s.map((c,u)=>{const f=l[c.color];return o.jsxs("div",{style:{borderRadius:10,padding:"12px 14px",background:f.bg,border:`1px solid ${f.border}`,display:"flex",gap:12,alignItems:"flex-start"},children:[o.jsx("div",{style:{width:30,height:30,borderRadius:8,background:f.badge,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:1},children:o.jsx("svg",{style:{width:15,height:15,color:f.text},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:c.iconPath})})}),o.jsxs("div",{style:{flex:1},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:3},children:[o.jsx("span",{className:"badge",style:{background:f.badge,color:f.text,fontSize:9,padding:"2px 6px"},children:c.priority}),o.jsx("span",{style:{fontSize:13,fontWeight:600,color:f.text},children:c.title})]}),o.jsx("p",{style:{fontSize:12,color:"var(--text-dim)",marginBottom:2},children:c.detail}),o.jsx("p",{style:{fontSize:11,color:"var(--text-muted)"},children:c.reason})]})]},u)})})]})}function ZJ({strategies:e}){const t=[...e||[]].sort((n,a)=>a.pnl-n.pnl).slice(0,10);if(!t.length)return null;const r=t.map(n=>({name:n.name,pnl:n.pnl/100,fill:n.pnl>=0?"#00C389":"#FF5C5C"}));return o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"section-title",style:{marginBottom:14},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--cyan)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"})}),"Strategy P&L — Top 10"]}),o.jsx(er,{width:"100%",height:250,children:o.jsxs(Sl,{data:r,layout:"vertical",margin:{left:70,right:20},children:[o.jsx(Ma,{strokeDasharray:"3 3",stroke:"var(--border)",horizontal:!1}),o.jsx(ir,{type:"number",stroke:"var(--text-muted)",tick:{fill:"var(--text-muted)",fontSize:11},tickFormatter:n=>`$${n}`}),o.jsx(or,{type:"category",dataKey:"name",stroke:"var(--text-muted)",tick:{fill:"var(--text-muted)",fontSize:11},width:65}),o.jsx(Ge,{contentStyle:{background:"var(--surface-el)",border:"1px solid var(--border)",borderRadius:8,color:"var(--text)"},formatter:n=>[`$${n.toFixed(2)}`,"P&L"]}),o.jsx(rr,{dataKey:"pnl",radius:[0,4,4,0],children:r.map((n,a)=>o.jsx(gr,{fill:n.fill},a))})]})})]})}function eZ({todayWins:e,todayLosses:t}){const r=(e||0)+(t||0);if(!r)return null;const n=(e/r*100).toFixed(1),a=[{name:"Wins",value:e,fill:"#00C389"},{name:"Losses",value:t,fill:"#FF5C5C"}];return o.jsxs("div",{className:"card",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[o.jsx("p",{className:"stat-label",style:{marginBottom:12},children:"Today's Win Rate"}),o.jsxs("div",{style:{position:"relative",width:140,height:140},children:[o.jsx(er,{width:"100%",height:"100%",children:o.jsx(Xy,{children:o.jsx(jr,{data:a,innerRadius:45,outerRadius:65,paddingAngle:2,dataKey:"value",startAngle:90,endAngle:-270,children:a.map((i,s)=>o.jsx(gr,{fill:i.fill},s))})})}),o.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[o.jsxs("span",{className:"mono",style:{fontSize:22,fontWeight:700,color:Number(n)>=50?"var(--green)":"var(--red)"},children:[n,"%"]}),o.jsxs("span",{style:{fontSize:10,color:"var(--text-muted)",marginTop:2},children:[r.toLocaleString()," trades"]})]})]}),o.jsxs("div",{style:{display:"flex",gap:16,marginTop:10},children:[o.jsxs("span",{style:{fontSize:12,color:"var(--green)",fontWeight:600},children:[e==null?void 0:e.toLocaleString()," W"]}),o.jsxs("span",{style:{fontSize:12,color:"var(--red)",fontWeight:600},children:[t==null?void 0:t.toLocaleString()," L"]})]})]})}function tZ({active:e,payload:t,label:r}){var a;if(!e||!t||!t.length)return null;const n=((a=t[0])==null?void 0:a.payload)||{};return o.jsxs("div",{style:{background:"#1C1C24",border:"1px solid #2A2A35",borderRadius:8,padding:"10px 14px",fontFamily:"'Inter', sans-serif",fontSize:12,minWidth:160},children:[o.jsx("p",{style:{color:"#6B7280",fontWeight:600,marginBottom:6,fontSize:11},children:r}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[o.jsx("span",{style:{color:"#6B7280"},children:"Daily P&L"}),o.jsxs("span",{className:"mono",style:{color:(n.pnl||0)>=0?"#00C389":"#FF5C5C",fontWeight:700},children:[(n.pnl||0)>=0?"+":"","$",((n.pnl||0)/100).toFixed(2)]})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[o.jsx("span",{style:{color:"#6B7280"},children:"Cumulative"}),o.jsxs("span",{className:"mono",style:{color:"#00F0FF",fontWeight:700},children:[(n.cumulative_pnl||0)>=0?"+":"","$",((n.cumulative_pnl||0)/100).toFixed(2)]})]}),n.trades!=null&&o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[o.jsx("span",{style:{color:"#6B7280"},children:"Trades"}),o.jsxs("span",{className:"mono",style:{color:"#E0E0E0"},children:[n.wins||0,"W / ",(n.trades||0)-(n.wins||0),"L"]})]})]})]})}function rZ({dailyPnl:e}){var f,d;const t=e||[];if(!t.length)return o.jsxs("div",{className:"card",style:{borderLeft:"3px solid #00F0FF",paddingLeft:16},children:[o.jsx("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:12},children:o.jsx("h2",{className:"section-title section-accent-cyan",style:{borderLeft:"none",paddingLeft:0},children:"Portfolio Performance"})}),o.jsx("p",{style:{color:"#6B7280",fontSize:13,textAlign:"center",padding:"48px 0"},children:"No daily P&L data yet — will appear after trading activity is recorded"})]});const r=t.reduce((h,p)=>p.pnl>((h==null?void 0:h.pnl)||-1/0)?p:h,t[0]),n=t.reduce((h,p)=>p.pnl<((h==null?void 0:h.pnl)||1/0)?p:h,t[0]),a=((f=t[t.length-1])==null?void 0:f.cumulative_pnl)||0,i=((d=t[0])==null?void 0:d.cumulative_pnl)||0,s=a-i,l=s>=0,c=l?"#00C389":"#FF5C5C",u=t.map(h=>({...h,label:qJ(h.date),cumDisplay:h.cumulative_pnl/100}));return o.jsxs("div",{className:"card",style:{borderLeft:"3px solid #00F0FF",paddingLeft:20},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[o.jsx("h2",{className:"section-title",style:{fontSize:"1.1rem"},children:"Portfolio Performance"}),o.jsxs("div",{style:{display:"flex",gap:10},children:[o.jsxs("div",{style:{padding:"4px 12px",borderRadius:20,background:l?"rgba(0,195,137,0.12)":"rgba(255,92,92,0.12)",border:`1px solid ${l?"rgba(0,195,137,0.3)":"rgba(255,92,92,0.3)"}`},children:[o.jsx("span",{style:{fontSize:10,color:"#6B7280",marginRight:6,fontWeight:600},children:"30d RETURN"}),o.jsxs("span",{className:"mono",style:{fontSize:12,fontWeight:700,color:l?"#00C389":"#FF5C5C"},children:[l?"+":"","$",(s/100).toFixed(2)]})]}),o.jsxs("div",{style:{padding:"4px 12px",borderRadius:20,background:"rgba(0,195,137,0.08)",border:"1px solid rgba(0,195,137,0.2)"},children:[o.jsx("span",{style:{fontSize:10,color:"#6B7280",marginRight:6,fontWeight:600},children:"BEST DAY"}),o.jsxs("span",{className:"mono",style:{fontSize:12,fontWeight:700,color:"#00C389"},children:["+$",(((r==null?void 0:r.pnl)||0)/100).toFixed(2)]})]}),o.jsxs("div",{style:{padding:"4px 12px",borderRadius:20,background:"rgba(255,92,92,0.08)",border:"1px solid rgba(255,92,92,0.2)"},children:[o.jsx("span",{style:{fontSize:10,color:"#6B7280",marginRight:6,fontWeight:600},children:"WORST DAY"}),o.jsxs("span",{className:"mono",style:{fontSize:12,fontWeight:700,color:"#FF5C5C"},children:["$",(((n==null?void 0:n.pnl)||0)/100).toFixed(2)]})]})]})]}),o.jsx(er,{width:"100%",height:280,children:o.jsxs(Qy,{data:u,margin:{top:8,right:12,left:0,bottom:0},children:[o.jsxs("defs",{children:[o.jsxs("linearGradient",{id:"dailyPnlGradPos",x1:"0",y1:"0",x2:"0",y2:"1",children:[o.jsx("stop",{offset:"5%",stopColor:"#00C389",stopOpacity:.25}),o.jsx("stop",{offset:"95%",stopColor:"#00C389",stopOpacity:.01})]}),o.jsxs("linearGradient",{id:"dailyPnlGradNeg",x1:"0",y1:"0",x2:"0",y2:"1",children:[o.jsx("stop",{offset:"5%",stopColor:"#FF5C5C",stopOpacity:.22}),o.jsx("stop",{offset:"95%",stopColor:"#FF5C5C",stopOpacity:.01})]})]}),o.jsx(Ma,{strokeDasharray:"3 3",stroke:"#2A2A35",strokeOpacity:.6,horizontal:!0,vertical:!1}),o.jsx(ir,{dataKey:"label",stroke:"#2A2A35",tick:{fill:"#6B7280",fontSize:11,fontFamily:"'Inter', sans-serif"},tickLine:!1,axisLine:{stroke:"#2A2A35"}}),o.jsx(or,{stroke:"#2A2A35",tick:{fill:"#6B7280",fontSize:11,fontFamily:"'Inter', sans-serif"},tickLine:!1,axisLine:!1,tickFormatter:h=>`$${h>=0,""}${h.toFixed(0)}`,width:55}),o.jsx(Ge,{content:o.jsx(tZ,{})}),o.jsx(Ir,{type:"monotone",dataKey:"cumDisplay",name:"Cumulative P&L",stroke:c,strokeWidth:2,fill:`url(#${l?"dailyPnlGradPos":"dailyPnlGradNeg"})`,dot:!1,activeDot:{r:5,fill:"#00F0FF",stroke:"#1C1C24",strokeWidth:2,filter:"drop-shadow(0 0 6px rgba(0,240,255,0.8))"}})]})})]})}function nZ({active:e,payload:t,label:r}){var a;if(!e||!t||!t.length)return null;const n=((a=t[0])==null?void 0:a.payload)||{};return o.jsxs("div",{style:{background:"#1C1C24",border:"1px solid #2A2A35",borderRadius:8,padding:"10px 14px",fontFamily:"'Inter', sans-serif",fontSize:12,minWidth:180},children:[o.jsx("p",{style:{color:"#E0E0E0",fontWeight:600,marginBottom:6,fontSize:12},children:n.name}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[o.jsx("span",{style:{color:"#6B7280"},children:"P&L"}),o.jsxs("span",{className:"mono",style:{color:n.pnlRaw>=0?"#00C389":"#FF5C5C",fontWeight:700},children:[n.pnlRaw>=0?"+":"","$",Math.abs(n.pnlRaw).toFixed(2)]})]}),n.trades!=null&&o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[o.jsx("span",{style:{color:"#6B7280"},children:"Trades"}),o.jsx("span",{className:"mono",style:{color:"#E0E0E0"},children:n.trades})]}),n.win_rate!=null&&o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[o.jsx("span",{style:{color:"#6B7280"},children:"Win Rate"}),o.jsxs("span",{className:"mono",style:{color:n.win_rate>=50?"#00C389":"#FF5C5C"},children:[n.win_rate,"%"]})]}),n.avg_edge!=null&&o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[o.jsx("span",{style:{color:"#6B7280"},children:"Avg Edge"}),o.jsxs("span",{className:"mono",style:{color:"#00F0FF"},children:[n.avg_edge,"%"]})]})]})]})}function aZ({strategies:e}){const t=[...e||[]].sort((a,i)=>i.pnl-a.pnl).slice(0,10);if(!t.length)return o.jsxs("div",{className:"card",children:[o.jsx("h2",{className:"section-title",style:{marginBottom:12,fontSize:"1.1rem"},children:"Strategy Breakdown"}),o.jsx("p",{style:{color:"#6B7280",fontSize:13,textAlign:"center",padding:"32px 0"},children:"No strategy data yet"})]});const r=t.map(a=>({name:(a.name||a.strategy||"Unknown").slice(0,22),pnl:Math.abs(a.pnl/100),pnlRaw:a.pnl/100,fill:a.pnl>=0?"#00C389":"#FF5C5C",trades:a.trades,win_rate:a.win_rate,avg_edge:a.avg_edge})),n=Math.max(220,r.length*36);return o.jsxs("div",{className:"card",children:[o.jsx("h2",{className:"section-title",style:{marginBottom:16,fontSize:"1.1rem"},children:"Strategy Breakdown"}),o.jsx(er,{width:"100%",height:n,children:o.jsxs(Sl,{data:r,layout:"vertical",margin:{left:10,right:24,top:4,bottom:4},children:[o.jsx(Ma,{strokeDasharray:"3 3",stroke:"#2A2A35",strokeOpacity:.6,horizontal:!1}),o.jsx(ir,{type:"number",stroke:"#2A2A35",tick:{fill:"#6B7280",fontSize:11,fontFamily:"'Inter', sans-serif"},tickLine:!1,axisLine:{stroke:"#2A2A35"},tickFormatter:a=>`$${a.toFixed(0)}`}),o.jsx(or,{type:"category",dataKey:"name",stroke:"#2A2A35",tick:{fill:"#A8A8A8",fontSize:11,fontFamily:"'Inter', sans-serif"},tickLine:!1,axisLine:!1,width:130}),o.jsx(Ge,{content:o.jsx(nZ,{}),cursor:{fill:"rgba(0,240,255,0.04)"}}),o.jsx(rr,{dataKey:"pnl",radius:[0,4,4,0],maxBarSize:22,children:r.map((a,i)=>o.jsx(gr,{fill:a.fill,fillOpacity:.85},i))})]})})]})}function iZ({winRate:e}){const t=Math.round((e||0)*100),r=t>=80?"#00C389":t>=50?"#F7931A":"#FF5C5C",n=[{name:"Win Rate",value:t,fill:r}];return o.jsxs("div",{className:"card",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:200},children:[o.jsx("p",{className:"stat-label",style:{marginBottom:8},children:"Overall Win Rate"}),o.jsxs("div",{style:{position:"relative",width:160,height:160},children:[o.jsx(er,{width:"100%",height:"100%",children:o.jsx(VJ,{cx:"50%",cy:"50%",innerRadius:"60%",outerRadius:"85%",startAngle:90,endAngle:-270,data:n,children:o.jsx(wl,{background:{fill:"#2A2A35"},dataKey:"value",cornerRadius:6,fill:r})})}),o.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:[o.jsxs("span",{className:"mono",style:{fontSize:28,fontWeight:700,color:r,textShadow:`0 0 12px ${r}60`,lineHeight:1},children:[t,"%"]}),o.jsx("span",{style:{fontSize:10,color:"#6B7280",marginTop:4,fontFamily:"'Inter', sans-serif"},children:"win rate"})]})]})]})}function oZ(){const e=[{id:1,market:"NVDA closes above $50 on Mar 2",direction:"NO @ 95c",entry:"95c",exit:"$1.00",contracts:200,cost:190,profit:10,roi:"5.26%",holdTime:"47min"},{id:2,market:"S&P 500 above 4000 on Mar 2",direction:"NO @ 96c",entry:"96c",exit:"$1.00",contracts:150,cost:144,profit:6,roi:"4.17%",holdTime:"1h 12min"},{id:3,market:"BTC above $10K on Mar 2",direction:"NO @ 97c",entry:"97c",exit:"$1.00",contracts:300,cost:291,profit:9,roi:"3.09%",holdTime:"23min"},{id:4,market:"Fed rate cut Mar 2",direction:"NO @ 94c",entry:"94c",exit:"$1.00",contracts:250,cost:235,profit:15,roi:"6.38%",holdTime:"1h 45min"},{id:5,market:"Tesla below $50 on Mar 2",direction:"NO @ 93c",entry:"93c",exit:"$1.00",contracts:100,cost:93,profit:7,roi:"7.53%",holdTime:"55min"}],t=[{title:"Mathematical Edge",icon:"M9 7h6m0 10v-3m-3 3h.01M9 17h.01M9 14h.01M12 14h.01M15 11h.01M12 11h.01M9 11h.01M7 21h10a2 2 0 002-2V5a2 2 0 00-2-2H7a2 2 0 00-2 2v14a2 2 0 002 2z",color:"var(--cyan)",borderColor:"rgba(0,240,255,0.2)",bgColor:"rgba(0,240,255,0.05)",text:"Even with occasional losses, a 95% win rate with 5% gains per trade generates massive compound returns. One loss costs 5c, but 19 consecutive wins cover that loss and then some."},{title:"Market Inefficiency",icon:"M13 10V3L4 14h7v7l9-11h-7z",color:"var(--orange)",borderColor:"rgba(247,147,26,0.2)",bgColor:"rgba(247,147,26,0.05)",text:"Prediction markets still underprice certainty. Events priced at 95% probability should often be 99%+. This gap between market price and true probability is our edge."},{title:"AI Advantage",icon:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z",color:"var(--green)",borderColor:"rgba(0,195,137,0.2)",bgColor:"rgba(0,195,137,0.05)",text:"Our AI scans 135+ markets in real-time, finding opportunities humans miss. It evaluates probability, liquidity, and time-to-expiry simultaneously across every active contract."},{title:"Time Decay Works For Us",icon:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",color:"var(--purple)",borderColor:"rgba(168,85,247,0.2)",bgColor:"rgba(168,85,247,0.05)",text:"As events approach expiry, NO contracts on events that will not happen converge toward $1.00. Time is our ally. The closer to expiry, the more certain the outcome, the safer the trade."},{title:"Scalability",icon:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6",color:"var(--blue)",borderColor:"rgba(59,130,246,0.2)",bgColor:"rgba(59,130,246,0.05)",text:"Strategy works whether trading $100 or $100,000. Kalshi liquidity is sufficient for large positions on high-volume markets. Scale capital, not complexity."}],r=[{label:"AI Scans 135 Markets",color:"var(--cyan)",bgColor:"rgba(0,240,255,0.08)"},{label:"Finds High-Prob NO",color:"var(--orange)",bgColor:"rgba(247,147,26,0.08)"},{label:"Buy at 95c",color:"var(--green)",bgColor:"rgba(0,195,137,0.08)"},{label:"Hold 5min-2hr",color:"var(--purple)",bgColor:"rgba(168,85,247,0.08)"},{label:"Collect 5c Profit",color:"var(--green)",bgColor:"rgba(0,195,137,0.12)"}];return o.jsxs("div",{className:"strategy-deep-dive",children:[o.jsxs("div",{className:"sdd-header",children:[o.jsx("div",{className:"sdd-header-line"}),o.jsxs("div",{className:"sdd-header-content",children:[o.jsx("svg",{style:{width:22,height:22,color:"var(--cyan)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"})}),o.jsx("h2",{className:"heading",style:{fontSize:22,fontWeight:800,color:"var(--text)"},children:"Strategy Deep Dive"}),o.jsx("svg",{style:{width:22,height:22,color:"var(--cyan)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"})})]}),o.jsx("div",{className:"sdd-header-line"})]}),o.jsxs("div",{className:"card sdd-section-card",style:{border:"1px solid rgba(0,240,255,0.15)",background:"linear-gradient(135deg, rgba(0,240,255,0.03), var(--surface), rgba(0,195,137,0.03))"},children:[o.jsxs("div",{className:"section-title",style:{marginBottom:20},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--cyan)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Winning Strategy — How It Works"]}),o.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(5,1fr)",gap:12,marginBottom:24},children:[{label:"The Edge",value:"Buy NO at 95c",sub:"on near-certain events",color:"var(--cyan)",glow:!0},{label:"The Math",value:"95c in, $1 out",sub:"= 5c profit per contract",color:"var(--green)",glow:!1},{label:"Per-Trade Return",value:"5.26%",sub:"per winning trade",color:"var(--green)",glow:!0},{label:"Risk Mgmt",value:"TP +3c / SL -5c",sub:"early exit if favorable",color:"var(--orange)",glow:!1},{label:"Win Rate",value:"95%+",sub:"on high-prob events",color:"var(--cyan)",glow:!0}].map(n=>o.jsxs("div",{className:n.glow?"sdd-stat-glow":"",style:{borderRadius:10,padding:"16px 12px",background:"var(--surface-el)",border:`1px solid ${n.color}33`,textAlign:"center"},children:[o.jsx("p",{className:"stat-label",style:{marginBottom:6},children:n.label}),o.jsx("p",{className:"mono",style:{fontSize:16,fontWeight:700,color:n.color,lineHeight:1.2},children:n.value}),o.jsx("p",{style:{fontSize:10,color:"var(--text-muted)",marginTop:4},children:n.sub})]},n.label))}),o.jsxs("div",{style:{marginBottom:16},children:[o.jsx("p",{className:"stat-label",style:{marginBottom:12,textAlign:"center"},children:"Trade Flow"}),o.jsx("div",{className:"sdd-flow-row",children:r.map((n,a)=>o.jsxs($.Fragment,{children:[o.jsx("div",{className:"sdd-flow-step",style:{background:n.bgColor,border:`1px solid ${n.color}33`},children:o.jsx("span",{className:"mono",style:{fontSize:12,fontWeight:700,color:n.color,textAlign:"center"},children:n.label})}),a<r.length-1&&o.jsx("div",{className:"sdd-flow-arrow",children:o.jsx("svg",{style:{width:16,height:16,color:"var(--border-light)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M9 5l7 7-7 7"})})})]},a))})]}),o.jsxs("div",{style:{borderRadius:10,padding:"14px 18px",background:"linear-gradient(90deg, rgba(0,195,137,0.08), rgba(0,240,255,0.06))",border:"1px solid rgba(0,195,137,0.18)",display:"flex",alignItems:"center",gap:14},children:[o.jsx("div",{style:{width:36,height:36,borderRadius:10,background:"rgba(0,195,137,0.15)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:o.jsx("svg",{style:{width:18,height:18,color:"var(--green)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"})})}),o.jsxs("div",{children:[o.jsx("p",{style:{fontSize:13,fontWeight:600,color:"var(--green)",marginBottom:2},children:"Compound Effect"}),o.jsx("p",{style:{fontSize:12,color:"var(--text-dim)",lineHeight:1.5},children:"5% per trade x multiple trades per day = exponential growth. At just 3 trades/day with 95% win rate, capital compounds at roughly 14% per week. This is how $60K becomes $221K."})]})]})]}),o.jsxs("div",{className:"card sdd-section-card",style:{border:"1px solid rgba(247,147,26,0.15)",background:"linear-gradient(135deg, rgba(247,147,26,0.03), var(--surface))"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[o.jsxs("div",{className:"section-title",children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--orange)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})}),"Example Trades"]}),o.jsx("span",{className:"badge",style:{background:"var(--orange-dim)",color:"var(--orange)",fontSize:10},children:"ILLUSTRATIVE"})]}),o.jsx("div",{style:{overflowX:"auto"},children:o.jsxs("table",{className:"sdd-trades-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{style:{width:32},children:"#"}),o.jsx("th",{style:{textAlign:"left"},children:"Market"}),o.jsx("th",{children:"Direction"}),o.jsx("th",{style:{textAlign:"right"},children:"Entry"}),o.jsx("th",{style:{textAlign:"right"},children:"Exit"}),o.jsx("th",{style:{textAlign:"right"},children:"Contracts"}),o.jsx("th",{style:{textAlign:"right"},children:"Cost"}),o.jsx("th",{style:{textAlign:"right"},children:"Profit"}),o.jsx("th",{style:{textAlign:"right"},children:"ROI"}),o.jsx("th",{style:{textAlign:"right"},children:"Hold Time"})]})}),o.jsx("tbody",{children:e.map(n=>o.jsxs("tr",{children:[o.jsx("td",{style:{textAlign:"center"},children:o.jsx("span",{className:"mono",style:{fontSize:12,color:"var(--text-muted)"},children:n.id})}),o.jsx("td",{style:{textAlign:"left",maxWidth:240},children:o.jsx("span",{style:{fontSize:13,color:"var(--text)",fontWeight:500},children:n.market})}),o.jsx("td",{style:{textAlign:"center"},children:o.jsx("span",{className:"badge",style:{background:"var(--red-dim)",color:"var(--red)",fontSize:10,border:"1px solid rgba(255,92,92,0.25)"},children:n.direction})}),o.jsx("td",{style:{textAlign:"right"},children:o.jsx("span",{className:"mono",style:{fontSize:13,color:"var(--text-dim)"},children:n.entry})}),o.jsx("td",{style:{textAlign:"right"},children:o.jsx("span",{className:"mono",style:{fontSize:13,color:"var(--green)"},children:n.exit})}),o.jsx("td",{style:{textAlign:"right"},children:o.jsx("span",{className:"mono",style:{fontSize:13,color:"var(--text)"},children:n.contracts})}),o.jsx("td",{style:{textAlign:"right"},children:o.jsxs("span",{className:"mono",style:{fontSize:13,color:"var(--orange)"},children:["$",n.cost.toFixed(2)]})}),o.jsx("td",{style:{textAlign:"right"},children:o.jsxs("span",{className:"mono",style:{fontSize:13,fontWeight:700,color:"var(--green)"},children:["+$",n.profit.toFixed(2)]})}),o.jsx("td",{style:{textAlign:"right"},children:o.jsx("span",{className:"mono",style:{fontSize:12,color:"var(--cyan)",fontWeight:600},children:n.roi})}),o.jsx("td",{style:{textAlign:"right"},children:o.jsx("span",{style:{fontSize:12,color:"var(--text-muted)"},children:n.holdTime})})]},n.id))})]})}),o.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:12,marginTop:16,paddingTop:14,borderTop:"1px solid var(--border)"},children:[{label:"Total Cost",value:"$953.00",color:"var(--orange)"},{label:"Total Profit",value:"+$47.00",color:"var(--green)"},{label:"Avg ROI",value:"5.29%",color:"var(--cyan)"},{label:"Avg Hold",value:"52min",color:"var(--purple)"}].map(n=>o.jsxs("div",{style:{textAlign:"center"},children:[o.jsx("p",{className:"stat-label",style:{marginBottom:4},children:n.label}),o.jsx("p",{className:"mono",style:{fontSize:18,fontWeight:700,color:n.color},children:n.value})]},n.label))})]}),o.jsxs("div",{className:"card sdd-section-card",style:{border:"1px solid rgba(0,195,137,0.15)",background:"linear-gradient(135deg, rgba(0,195,137,0.03), var(--surface), rgba(168,85,247,0.03))"},children:[o.jsxs("div",{className:"section-title",style:{marginBottom:20},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--green)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),"Why This Works Long-Term"]}),o.jsx("div",{className:"sdd-insights-grid",children:t.map((n,a)=>o.jsxs("div",{className:"sdd-insight-card",style:{border:`1px solid ${n.borderColor}`,background:n.bgColor},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:10},children:[o.jsx("div",{style:{width:32,height:32,borderRadius:8,background:`${n.color}1A`,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:o.jsx("svg",{style:{width:16,height:16,color:n.color},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:n.icon})})}),o.jsx("h4",{style:{fontSize:14,fontWeight:700,color:n.color,fontFamily:"var(--font-heading)"},children:n.title})]}),o.jsx("p",{style:{fontSize:12,color:"var(--text-dim)",lineHeight:1.6},children:n.text})]},a))}),o.jsxs("div",{style:{marginTop:20,borderRadius:10,padding:"16px 20px",background:"linear-gradient(90deg, rgba(0,240,255,0.06), rgba(247,147,26,0.06))",border:"1px solid rgba(0,240,255,0.12)",textAlign:"center"},children:[o.jsx("p",{style:{fontSize:14,fontWeight:600,color:"var(--text)",marginBottom:4},children:"The Bottom Line"}),o.jsx("p",{style:{fontSize:13,color:"var(--text-dim)",lineHeight:1.6,maxWidth:700,margin:"0 auto"},children:"This is not gambling. It is systematic, AI-driven arbitrage on prediction market inefficiencies. Small, consistent profits compounded over hundreds of trades per week create exponential portfolio growth. The math is on our side, and the AI never sleeps."})]})]})]})}function sZ({label:e,rawValue:t,displayValue:r,color:n,accent:a,icon:i,sparkColor:s,hero:l}){const c=YJ(typeof t=="number"?t:0),u=_j[e]||_j.Balance,f=typeof t=="number"&&t!==0?e==="Balance"||e==="Today P&L"?`$${(c/100).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`:Math.round(c).toLocaleString():r;return o.jsxs("div",{className:`card ${a}${l?" border-neon-animated":""}`,style:{display:"flex",flexDirection:"column",gap:8},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o.jsx("span",{className:"stat-label",children:e}),o.jsx("div",{style:{width:28,height:28,borderRadius:7,background:`${n}1A`,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx("svg",{style:{width:14,height:14,color:n},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:i})})})]}),o.jsxs("div",{style:{display:"flex",alignItems:"flex-end",justifyContent:"space-between",gap:8},children:[o.jsx("p",{className:"stat-v mono",style:{color:n},children:f}),o.jsx(GJ,{data:u,color:s||n,width:60,height:22,id:e.replace(/\s+/g,"-").toLowerCase()})]})]})}function lZ(){var d;const[e,t]=P.useState(null),[r,n]=P.useState(!0);P.useEffect(()=>{a();const h=setInterval(a,3e4);return()=>clearInterval(h)},[]);async function a(){try{const h=await Oe("/dashboard");t(h)}catch{}n(!1)}if(r)return o.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:256},children:o.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})});const i=e||{},s=(i.pnl_history||[]).map((h,p)=>({day:p+1,pnl:h})),l=i.today_trades>0?(i.today_wins/i.today_trades*100).toFixed(1):"0",c=(i.strategies||[]).filter(h=>h.pnl>0).slice(0,5),u=(i.strategies||[]).filter(h=>h.pnl<0).slice(-5).reverse(),f=[{label:"Balance",rawValue:i.balance||0,displayValue:i.balance?`$${(i.balance/100).toLocaleString(void 0,{minimumFractionDigits:2})}`:"—",color:"var(--green)",sparkColor:"var(--green)",accent:"card-accent-green",icon:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"},{label:"Positions",rawValue:i.position_count||0,displayValue:i.position_count??"—",color:"var(--orange)",sparkColor:"var(--orange)",accent:"card-accent-orange",icon:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"},{label:"Open Markets",rawValue:i.open_orders||0,displayValue:i.open_orders??"—",color:"var(--blue)",sparkColor:"var(--cyan)",accent:"card-accent-blue",icon:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"},{label:"Today P&L",rawValue:i.daily_pnl||0,displayValue:i.daily_pnl?`$${(i.daily_pnl/100).toLocaleString(void 0,{minimumFractionDigits:2})}`:"$0.00",color:(i.daily_pnl||0)>=0?"var(--green)":"var(--red)",sparkColor:(i.daily_pnl||0)>=0?"var(--green)":"var(--red)",accent:(i.daily_pnl||0)>=0?"card-accent-green":"card-accent-red",icon:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},{label:"Markets Tracked",rawValue:i.markets_tracked||0,displayValue:i.markets_tracked??"—",color:"var(--purple)",sparkColor:"var(--purple)",accent:"card-accent-purple",icon:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"}];return o.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:24},children:[o.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[o.jsxs("div",{children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:4},children:[o.jsx("h1",{className:"heading",style:{fontSize:26,fontWeight:800,color:"var(--text)",letterSpacing:"-0.025em"},children:"Dashboard"}),o.jsxs("span",{className:"live-indicator",children:[o.jsx("span",{className:"live-dot"}),"LIVE"]})]}),o.jsx("p",{className:"section-subtitle",children:"Ken event contracts overview"})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[o.jsx("span",{className:"badge",style:i.env==="prod"?{background:"var(--green-dim)",color:"var(--green)"}:{background:"var(--orange-dim)",color:"var(--orange)"},children:(i.env||"DEMO").toUpperCase()}),i.safe_mode&&o.jsx("span",{className:"badge",style:{background:"var(--orange-dim)",color:"var(--orange)"},children:"SAFE MODE"})]})]}),o.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(5,1fr)",gap:14},children:f.map((h,p)=>o.jsx(sZ,{...h,hero:p===0},h.label))}),o.jsx(rZ,{dailyPnl:i.daily_pnl_history||i.dailyPnl||[]}),o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"2fr 1fr",gap:16},children:[o.jsx(aZ,{strategies:i.strategies}),o.jsx(iZ,{winRate:i.win_rate||(i.today_trades>0?i.today_wins/i.today_trades:0)})]}),i.seed_money>0&&o.jsxs("div",{className:"card",style:{border:"1px solid rgba(59,130,246,0.18)",background:"linear-gradient(135deg, rgba(59,130,246,0.04), var(--surface), rgba(0,195,137,0.04))"},children:[o.jsxs("div",{className:"section-title",style:{marginBottom:16},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--cyan)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Capital & Economics"]}),o.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(6,1fr)",gap:12,textAlign:"center"},children:[{label:"Seed Money",value:`$${(i.seed_money/100).toLocaleString(void 0,{minimumFractionDigits:0})}`,sub:`${i.num_portfolios} portfolios`,color:"var(--blue)"},{label:"Current Balance",value:`$${(i.balance/100).toLocaleString(void 0,{minimumFractionDigits:0})}`,sub:"all portfolios",color:"var(--green)"},{label:"Net P&L",value:`${i.net_pnl_from_seed>=0?"+":""}$${(i.net_pnl_from_seed/100).toLocaleString(void 0,{minimumFractionDigits:0})}`,sub:`${i.roi_pct>=0?"+":""}${i.roi_pct}% ROI`,color:i.net_pnl_from_seed>=0?"var(--green)":"var(--red)",subColor:i.roi_pct>=0?"var(--green)":"var(--red)"},{label:"Capital Deployed",value:`$${(i.total_invested/100).toLocaleString(void 0,{minimumFractionDigits:0})}`,sub:"total traded",color:"var(--orange)"},{label:"Capital at Risk",value:`$${(i.capital_at_risk/100).toLocaleString(void 0,{minimumFractionDigits:0})}`,sub:"open positions",color:"var(--red)"},{label:"Daily Budget",value:`$${(i.daily_budget/100).toLocaleString(void 0,{minimumFractionDigits:0})}`,sub:"across strategies",color:"var(--purple)"}].map(h=>o.jsxs("div",{children:[o.jsx("p",{className:"stat-label",style:{marginBottom:6},children:h.label}),o.jsx("p",{className:"mono",style:{fontSize:18,fontWeight:700,color:h.color},children:h.value}),o.jsx("p",{style:{fontSize:10,color:h.subColor||"var(--text-muted)",marginTop:2},children:h.sub})]},h.label))}),((d=i.daily_economics)==null?void 0:d.length)>0&&o.jsxs("div",{style:{marginTop:18,paddingTop:14,borderTop:"1px solid var(--border)"},children:[o.jsx("p",{className:"stat-label",style:{marginBottom:10},children:"Daily Breakdown (Last 7 Days)"}),o.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7,1fr)",gap:8},children:(i.daily_economics||[]).slice(0,7).reverse().map((h,p)=>{const g=new Date(h.day).toLocaleDateString("en-US",{weekday:"short",month:"numeric",day:"numeric",timeZone:"America/Los_Angeles"}),y=h.net_pnl>=0;return o.jsxs("div",{style:{borderRadius:8,padding:"10px 8px",background:y?"rgba(0,195,137,0.06)":"rgba(255,92,92,0.06)",border:`1px solid ${y?"rgba(0,195,137,0.18)":"rgba(255,92,92,0.18)"}`,textAlign:"center"},children:[o.jsx("p",{style:{fontSize:10,color:"var(--text-muted)",fontWeight:600,marginBottom:4},children:g}),o.jsxs("p",{className:"mono",style:{fontSize:13,fontWeight:700,color:y?"var(--green)":"var(--red)",marginBottom:3},children:[y?"+":"","$",(h.net_pnl/100).toFixed(0)]}),o.jsxs("p",{style:{fontSize:10,color:"var(--text-muted)",marginBottom:2},children:[h.trades," trades"]}),o.jsxs("p",{style:{fontSize:10,color:"var(--text-muted)"},children:[o.jsxs("span",{style:{color:"var(--green)"},children:[h.wins,"W"]})," / ",o.jsxs("span",{style:{color:"var(--red)"},children:[h.losses,"L"]})]})]},p)})})]})]}),o.jsx(XJ,{opportunities:i.top_opportunities}),o.jsxs("div",{className:"card",style:{border:"1px solid rgba(247,147,26,0.18)",background:"linear-gradient(135deg, rgba(247,147,26,0.04), var(--surface))"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:14},children:[o.jsxs("div",{className:"section-title",children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--orange)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})}),"Today's Lessons"]}),o.jsx("span",{style:{marginLeft:"auto",fontSize:12,color:"var(--text-muted)"},children:new Date().toLocaleDateString("en-US",{weekday:"long",month:"short",day:"numeric"})})]}),o.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:16,textAlign:"center"},children:[{label:"Trades Resolved",value:(i.today_trades||0).toLocaleString(),color:"var(--orange)"},{label:"Wins / Losses",value:o.jsxs("span",{children:[o.jsx("span",{style:{color:"var(--green)"},children:i.today_wins||0}),o.jsx("span",{style:{color:"var(--border-light)",margin:"0 4px"},children:"/"}),o.jsx("span",{style:{color:"var(--red)"},children:i.today_losses||0})]}),color:null},{label:"Win Rate",value:`${l}%`,color:Number(l)>=50?"var(--green)":"var(--red)"},{label:"Day P&L",value:`${(i.daily_pnl||0)>=0?"+":""}$${((i.daily_pnl||0)/100).toLocaleString(void 0,{minimumFractionDigits:2})}`,color:(i.daily_pnl||0)>=0?"var(--green)":"var(--red)"}].map((h,p)=>o.jsxs("div",{children:[o.jsx("p",{className:"stat-label",style:{marginBottom:6},children:h.label}),typeof h.value=="string"?o.jsx("p",{className:"mono",style:{fontSize:22,fontWeight:700,color:h.color},children:h.value}):o.jsx("p",{className:"mono",style:{fontSize:22,fontWeight:700},children:h.value})]},p))})]}),o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"2fr 1fr",gap:16},children:[o.jsx(QJ,{topMarkets:i.top_markets,seedMoney:i.seed_money,balance:i.balance}),o.jsx(eZ,{todayWins:i.today_wins,todayLosses:i.today_losses})]}),o.jsx(JJ,{topMarkets:i.top_markets,worstMarkets:i.worst_markets,strategies:i.strategies}),(i.top_markets||[]).length>0&&o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"section-title",style:{marginBottom:14},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--green)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M5 3l14 9-14 9V3z"})}),"Top Markets — Money Makers"]}),o.jsx("div",{style:{overflowX:"auto"},children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{style:{textAlign:"left"},children:"Market"}),o.jsx("th",{style:{textAlign:"right"},children:"Trades"}),o.jsx("th",{style:{textAlign:"right"},children:"Wins"}),o.jsx("th",{style:{textAlign:"right"},children:"P&L"}),o.jsx("th",{children:"Edge"}),o.jsx("th",{children:"Signal"})]})}),o.jsx("tbody",{children:(i.top_markets||[]).map((h,p)=>{var g;return o.jsxs("tr",{children:[o.jsxs("td",{style:{maxWidth:300},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[o.jsx(wc,{to:`/positions?market=${encodeURIComponent(h.ticker)}`,style:{fontSize:13,color:"var(--text)",textDecoration:"none",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",transition:"color 150ms"},onMouseEnter:y=>{y.currentTarget.style.color="var(--cyan)"},onMouseLeave:y=>{y.currentTarget.style.color="var(--text)"},children:h.title}),o.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent(((g=h.title)==null?void 0:g.split("?")[0])||h.ticker)}`,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--text-muted)",flexShrink:0,textDecoration:"none",fontSize:13},onMouseEnter:y=>{y.currentTarget.style.color="var(--cyan)"},onMouseLeave:y=>{y.currentTarget.style.color="var(--text-muted)"},title:"View on Kalshi",children:"↗"})]}),o.jsx("span",{className:"mono",style:{fontSize:10,color:"var(--text-muted)"},children:h.ticker})]}),o.jsx("td",{style:{textAlign:"right"},className:"mono",children:o.jsx("span",{style:{fontSize:13,color:"var(--text-dim)"},children:h.trades})}),o.jsx("td",{style:{textAlign:"right",fontSize:13},children:o.jsx(kj,{wins:h.wins,losses:h.losses})}),o.jsx("td",{style:{textAlign:"right",fontSize:13},children:o.jsx(ac,{cents:h.pnl})}),o.jsx("td",{style:{fontSize:12,color:"var(--text-muted)",whiteSpace:"nowrap"},children:h.edge}),o.jsx("td",{style:{textAlign:"center"},children:o.jsx(Oj,{wins:h.wins,losses:h.losses,pnl:h.pnl})})]},p)})})]})})]}),(i.worst_markets||[]).length>0&&o.jsxs("div",{className:"card",style:{border:"1px solid rgba(255,92,92,0.12)"},children:[o.jsxs("div",{className:"section-title",style:{marginBottom:14,color:"var(--red)"},children:[o.jsx("svg",{style:{width:18,height:18},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),"Bleeding Markets — Consider Exiting"]}),o.jsx("div",{style:{overflowX:"auto"},children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{style:{textAlign:"left"},children:"Market"}),o.jsx("th",{style:{textAlign:"right"},children:"Trades"}),o.jsx("th",{style:{textAlign:"right"},children:"Wins"}),o.jsx("th",{style:{textAlign:"right"},children:"P&L"}),o.jsx("th",{children:"Edge"}),o.jsx("th",{children:"Signal"})]})}),o.jsx("tbody",{children:(i.worst_markets||[]).map((h,p)=>{var g;return o.jsxs("tr",{children:[o.jsxs("td",{style:{maxWidth:300},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[o.jsx(wc,{to:`/positions?market=${encodeURIComponent(h.ticker)}`,style:{fontSize:13,color:"var(--text)",textDecoration:"none",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",transition:"color 150ms"},onMouseEnter:y=>{y.currentTarget.style.color="var(--red)"},onMouseLeave:y=>{y.currentTarget.style.color="var(--text)"},children:h.title}),o.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent(((g=h.title)==null?void 0:g.split("?")[0])||h.ticker)}`,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--text-muted)",flexShrink:0,textDecoration:"none",fontSize:13},onMouseEnter:y=>{y.currentTarget.style.color="var(--red)"},onMouseLeave:y=>{y.currentTarget.style.color="var(--text-muted)"},title:"View on Kalshi",children:"↗"})]}),o.jsx("span",{className:"mono",style:{fontSize:10,color:"var(--text-muted)"},children:h.ticker})]}),o.jsx("td",{style:{textAlign:"right"},className:"mono",children:o.jsx("span",{style:{fontSize:13,color:"var(--text-dim)"},children:h.trades})}),o.jsx("td",{style:{textAlign:"right",fontSize:13},children:o.jsx(kj,{wins:h.wins,losses:h.losses})}),o.jsx("td",{style:{textAlign:"right",fontSize:13},children:o.jsx(ac,{cents:h.pnl})}),o.jsx("td",{style:{fontSize:12,color:"var(--text-muted)",whiteSpace:"nowrap"},children:h.edge}),o.jsx("td",{style:{textAlign:"center"},children:o.jsx(Oj,{wins:h.wins,losses:h.losses,pnl:h.pnl})})]},p)})})]})})]}),s.length>0&&o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"section-title",style:{marginBottom:14},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--cyan)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z"})}),"P&L History (Daily)"]}),o.jsx(er,{width:"100%",height:200,children:o.jsxs(Qy,{data:s,children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:"pnlGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[o.jsx("stop",{offset:"5%",stopColor:"#00F0FF",stopOpacity:.2}),o.jsx("stop",{offset:"95%",stopColor:"#00F0FF",stopOpacity:0})]})}),o.jsx(Ma,{strokeDasharray:"3 3",stroke:"var(--border)"}),o.jsx(ir,{dataKey:"day",stroke:"var(--text-muted)",tick:{fill:"var(--text-muted)",fontSize:11}}),o.jsx(or,{stroke:"var(--text-muted)",tick:{fill:"var(--text-muted)",fontSize:11},tickFormatter:h=>`$${h}`}),o.jsx(Ge,{contentStyle:{background:"var(--surface-el)",border:"1px solid var(--border)",borderRadius:8,color:"var(--text)"}}),o.jsx(Ir,{type:"monotone",dataKey:"pnl",stroke:"var(--cyan)",strokeWidth:2,fill:"url(#pnlGrad)"})]})})]}),o.jsx(ZJ,{strategies:i.strategies}),o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:16},children:[o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"section-title",style:{marginBottom:12},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--green)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M5 3l14 9-14 9V3z"})}),"Top Strategies"]}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[c.map((h,p)=>o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 0",borderBottom:p<c.length-1?"1px solid var(--border)":"none"},children:[o.jsxs("div",{children:[o.jsx("span",{style:{fontSize:13,fontWeight:500,color:"var(--text)"},children:h.name}),o.jsx("span",{style:{marginLeft:8,fontSize:10,color:"var(--text-muted)"},children:h.strategy})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[o.jsxs("span",{style:{fontSize:11,color:"var(--text-muted)"},children:[h.win_rate,"% WR"]}),o.jsx(ac,{cents:h.pnl})]})]},p)),c.length===0&&o.jsx("p",{style:{color:"var(--text-muted)",fontSize:13,textAlign:"center",padding:"16px 0"},children:"No profitable strategies yet"})]})]}),o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"section-title",style:{marginBottom:12},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--red)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M13 17h8m0 0V9m0 8l-8-8-4 4-6-6"})}),"Losing Strategies"]}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[u.map((h,p)=>o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 0",borderBottom:p<u.length-1?"1px solid var(--border)":"none"},children:[o.jsxs("div",{children:[o.jsx("span",{style:{fontSize:13,fontWeight:500,color:"var(--text-dim)"},children:h.name}),o.jsx("span",{style:{marginLeft:8,fontSize:10,color:"var(--text-muted)"},children:h.strategy})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[o.jsxs("span",{style:{fontSize:11,color:"var(--text-muted)"},children:[h.win_rate,"% WR"]}),o.jsx(ac,{cents:h.pnl})]})]},p)),u.length===0&&o.jsx("p",{style:{color:"var(--text-muted)",fontSize:13,textAlign:"center",padding:"16px 0"},children:"No losing strategies"})]})]})]}),o.jsx(oZ,{}),o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:16},children:[o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"section-title",style:{marginBottom:12},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--cyan)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})}),"Recent Fills"]}),(i.recent_fills||[]).length>0?o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:(i.recent_fills||[]).slice(0,5).map((h,p)=>{var g;return o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:13},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[o.jsx("span",{className:"mono",style:{fontSize:11,color:"var(--text-muted)"},children:h.ticker}),o.jsx("span",{className:"badge",style:h.side==="yes"?{background:"var(--green-dim)",color:"var(--green)"}:{background:"var(--red-dim)",color:"var(--red)"},children:(g=h.side)==null?void 0:g.toUpperCase()})]}),o.jsxs("span",{className:"mono",style:{color:"var(--text-dim)",fontSize:12},children:[h.count,"@",h.yes_price,"c"]})]},p)})}):o.jsx("p",{style:{color:"var(--text-muted)",fontSize:13,textAlign:"center",padding:"24px 0"},children:"No recent fills"})]}),o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"section-title",style:{marginBottom:12},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--cyan)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Quick Actions"]}),o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[{to:"/markets",icon:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6",iconColor:"var(--orange)",label:"Browse Markets",sub:"Find weather contracts"},{to:"/positions",icon:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z",iconColor:"var(--green)",label:"View Positions",sub:"Current portfolio"},{to:"/settings",icon:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z",iconColor:"var(--blue)",label:"Scan Config",sub:"Intervals & risk params"}].map(h=>o.jsxs(wc,{to:h.to,style:{display:"flex",alignItems:"center",gap:12,padding:"10px 12px",borderRadius:8,background:"var(--surface-el)",border:"1px solid var(--border)",textDecoration:"none",transition:"all 150ms ease"},onMouseEnter:p=>{p.currentTarget.style.borderColor="var(--cyan)",p.currentTarget.style.background="rgba(0,240,255,0.04)"},onMouseLeave:p=>{p.currentTarget.style.borderColor="var(--border)",p.currentTarget.style.background="var(--surface-el)"},children:[o.jsx("div",{style:{width:32,height:32,borderRadius:8,background:`${h.iconColor}1A`,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:o.jsx("svg",{style:{width:15,height:15,color:h.iconColor},fill:"none",stroke:"currentColor",strokeWidth:"1.8",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:h.icon})})}),o.jsxs("div",{children:[o.jsx("p",{style:{fontSize:13,fontWeight:500,color:"var(--text)",marginBottom:1},children:h.label}),o.jsx("p",{style:{fontSize:11,color:"var(--text-muted)"},children:h.sub})]})]},h.to))})]})]})]})}function cZ({m:e}){const[t,r]=P.useState(null),[n,a]=P.useState(!1),[i,s]=P.useState(!1);async function l(){if(n){a(!1);return}a(!0),s(!0);try{const c=await me("/kalshi",{action:"get_orderbook",ticker:e.ticker});c.success&&r(c.orderbook)}catch{}s(!1)}return o.jsxs(o.Fragment,{children:[o.jsxs("tr",{style:{background:"rgba(0,240,255,0.02)"},children:[o.jsx("td",{className:"pl-8 max-w-[250px]",children:o.jsx("span",{className:"truncate block text-sm",style:{color:"var(--text-dim)"},children:e.title||e.subtitle||e.ticker})}),o.jsx("td",{children:o.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent((e.ticker||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"mono text-xs hover:underline transition",style:{color:"var(--cyan)"},children:e.ticker})}),o.jsx("td",{children:o.jsxs("span",{className:"mono text-sm",style:{color:"var(--green)"},children:[e.yes_bid??"—","¢"]})}),o.jsx("td",{children:o.jsxs("span",{className:"mono text-sm",style:{color:"var(--red)"},children:[e.yes_ask??"—","¢"]})}),o.jsx("td",{children:o.jsx("span",{className:"mono text-xs",style:{color:"var(--text-dim)"},children:(e.volume||0).toLocaleString()})}),o.jsx("td",{children:o.jsx("span",{className:"mono text-xs",style:{color:"var(--text-muted)"},children:e.open_interest?e.open_interest.toLocaleString():"—"})}),o.jsx("td",{children:o.jsx("button",{onClick:l,className:"btn btn-ghost btn-sm",style:{color:n?"var(--cyan)":"var(--text-muted)"},children:n?"▾ Book":"▸ Book"})})]}),n&&o.jsx("tr",{style:{background:"rgba(0,240,255,0.01)"},children:o.jsx("td",{colSpan:7,className:"p-4",children:i?o.jsx("div",{className:"flex items-center justify-center h-16",children:o.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-t-transparent rounded-full",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})}):t?o.jsxs("div",{className:"grid grid-cols-2 gap-6 max-w-lg",children:[o.jsxs("div",{children:[o.jsx("p",{className:"stat-label mb-2",style:{color:"var(--green)"},children:"YES Bids"}),o.jsxs("div",{className:"space-y-1",children:[(t.yes||[]).slice(0,8).map((c,u)=>o.jsxs("div",{className:"relative flex justify-between text-xs px-2 py-1 rounded overflow-hidden",style:{background:"var(--surface-el)"},children:[o.jsx("div",{className:"absolute inset-0 rounded",style:{width:`${Math.min((c[1]||0)*2,100)}%`,background:"rgba(0,195,137,0.08)"}}),o.jsxs("span",{className:"mono relative z-10",style:{color:"var(--green)"},children:[c[0],"¢"]}),o.jsx("span",{className:"mono relative z-10",style:{color:"var(--text-muted)"},children:c[1]})]},u)),(!t.yes||t.yes.length===0)&&o.jsx("p",{className:"text-xs text-center py-2",style:{color:"var(--text-muted)"},children:"Empty"})]})]}),o.jsxs("div",{children:[o.jsx("p",{className:"stat-label mb-2",style:{color:"var(--red)"},children:"NO Bids"}),o.jsxs("div",{className:"space-y-1",children:[(t.no||[]).slice(0,8).map((c,u)=>o.jsxs("div",{className:"relative flex justify-between text-xs px-2 py-1 rounded overflow-hidden",style:{background:"var(--surface-el)"},children:[o.jsx("div",{className:"absolute inset-0 rounded",style:{width:`${Math.min((c[1]||0)*2,100)}%`,background:"rgba(255,92,92,0.08)"}}),o.jsxs("span",{className:"mono relative z-10",style:{color:"var(--red)"},children:[c[0],"¢"]}),o.jsx("span",{className:"mono relative z-10",style:{color:"var(--text-muted)"},children:c[1]})]},u)),(!t.no||t.no.length===0)&&o.jsx("p",{className:"text-xs text-center py-2",style:{color:"var(--text-muted)"},children:"Empty"})]})]})]}):o.jsx("p",{className:"text-xs text-center py-2",style:{color:"var(--text-muted)"},children:"No orderbook data"})})})]})}function uZ({e}){const[t,r]=P.useState(!1),[n,a]=P.useState([]),[i,s]=P.useState(!1);async function l(){if(t){r(!1);return}if(r(!0),!(n.length>0)){s(!0);try{const c=await me("/kalshi",{action:"get_markets",params:{event_ticker:e.event_ticker}});a(c.markets||[])}catch{}s(!1)}}return o.jsxs(o.Fragment,{children:[o.jsxs("tr",{className:"cursor-pointer transition",onClick:l,style:{background:t?"rgba(0,240,255,0.04)":void 0},onMouseEnter:c=>{t||(c.currentTarget.style.background="var(--cyan-glow)")},onMouseLeave:c=>{t||(c.currentTarget.style.background="")},children:[o.jsx("td",{className:"max-w-[300px]",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-xs transition-transform inline-block",style:{color:"var(--text-muted)",transform:t?"rotate(90deg)":"rotate(0deg)"},children:"▶"}),o.jsx("span",{className:"truncate block font-medium heading",style:{color:"var(--text)"},children:e.title})]})}),o.jsx("td",{children:o.jsx("span",{className:"badge bg-orange",children:e.category||"—"})}),o.jsx("td",{children:o.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent((e.event_ticker||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"mono text-xs hover:underline transition",style:{color:"var(--cyan)"},onClick:c=>c.stopPropagation(),children:e.event_ticker})}),o.jsx("td",{children:o.jsx("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:e.mutually_exclusive?o.jsx("span",{className:"badge bg-blue",children:"ME"}):"—"})}),o.jsx("td",{onClick:c=>c.stopPropagation(),children:t?o.jsxs("span",{className:"text-xs mono",style:{color:"var(--cyan)"},children:[n.length||"..."," contracts"]}):o.jsx("span",{className:"text-xs transition",style:{color:"var(--text-muted)"},children:"View Contracts"})})]}),t&&o.jsx("tr",{children:o.jsx("td",{colSpan:5,className:"p-0",children:o.jsx("div",{className:"ml-6 fade-in",style:{borderLeft:"2px solid rgba(0,240,255,0.2)",background:"rgba(0,240,255,0.015)"},children:i?o.jsx("div",{className:"flex items-center justify-center py-8",children:o.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-t-transparent rounded-full",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})}):n.length===0?o.jsx("div",{className:"text-xs text-center py-4",style:{color:"var(--text-muted)"},children:"No contracts found"}):o.jsxs("table",{className:"w-full",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"pl-8",children:"Contract"}),o.jsx("th",{children:"Ticker"}),o.jsx("th",{children:"Yes Bid"}),o.jsx("th",{children:"Yes Ask"}),o.jsx("th",{children:"Volume"}),o.jsx("th",{children:"Open Int."}),o.jsx("th",{children:"Book"})]})}),o.jsx("tbody",{children:n.map(c=>o.jsx(cZ,{m:c},c.ticker))})]})})})})]})}function dZ(){const[e,t]=P.useState([]),[r,n]=P.useState(!0),[a,i]=P.useState(""),[s,l]=P.useState("");P.useEffect(()=>{c()},[]);async function c(){n(!0);try{const d=await me("/kalshi",{action:"get_events",params:{status:"open",limit:100}});t(d.events||[])}catch{}n(!1)}const u=[...new Set(e.map(d=>d.category).filter(Boolean))].sort(),f=e.filter(d=>{const h=!a||(d.title||"").toLowerCase().includes(a.toLowerCase())||(d.category||"").toLowerCase().includes(a.toLowerCase()),p=!s||d.category===s;return h&&p});return r?o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-t-transparent rounded-full pulse-cyan",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})}):o.jsxs("div",{className:"space-y-6 fade-in",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("h1",{className:"heading text-3xl font-bold",style:{color:"var(--text)"},children:"Markets"}),o.jsxs("span",{className:"badge bg-cyan",children:[e.length," events"]}),f.length!==e.length&&o.jsxs("span",{className:"badge bg-orange",children:[f.length," filtered"]})]}),o.jsx("p",{className:"section-subtitle mt-1",children:"Live Kalshi prediction markets"})]}),o.jsx("button",{onClick:c,className:"btn btn-o btn-sm",children:"↻ Refresh"})]}),o.jsxs("div",{className:"relative",children:[o.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm pointer-events-none",style:{color:"var(--text-muted)"},children:"⌕"}),o.jsx("input",{type:"text",value:a,onChange:d=>i(d.target.value),placeholder:"Search markets by name or category...",className:"input pl-8"})]}),u.length>0&&o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsx("button",{onClick:()=>l(""),className:"badge transition cursor-pointer",style:{background:s?"rgba(42,42,53,0.6)":"var(--cyan-dim)",color:s?"var(--text-muted)":"var(--cyan)",border:s?"1px solid var(--border)":"1px solid rgba(0,240,255,0.3)"},children:"All"}),u.map(d=>o.jsx("button",{onClick:()=>l(d===s?"":d),className:"badge transition cursor-pointer",style:{background:s===d?"var(--orange-dim)":"rgba(42,42,53,0.6)",color:s===d?"var(--orange)":"var(--text-muted)",border:s===d?"1px solid rgba(247,147,26,0.3)":"1px solid var(--border)"},children:d},d))]}),o.jsx("div",{className:"card overflow-x-auto",style:{padding:0},children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"pl-5",children:"Event"}),o.jsx("th",{children:"Category"}),o.jsx("th",{children:"Ticker"}),o.jsx("th",{children:"Type"}),o.jsx("th",{children:"Contracts"})]})}),o.jsx("tbody",{children:f.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:5,className:"text-center py-12",style:{color:"var(--text-muted)"},children:o.jsxs("div",{className:"flex flex-col items-center gap-2",children:[o.jsx("span",{className:"text-2xl",children:"⌕"}),o.jsx("span",{className:"text-sm",children:"No markets match your filter"})]})})}):f.map(d=>o.jsx(uZ,{e:d},d.event_ticker))})]})})]})}function ic(e,t=9,r="flat"){let n=e;const a=()=>(n=n*1664525+1013904223&4294967295,Math.abs(n)%1e3/1e3),i=r==="up"?.8:r==="down"?-.8:0;let s=45+a()*10;const l=[];for(let c=0;c<t;c++){const u=(a()-.45+i*.1)*6,f=s,d=Math.max(5,Math.min(95,s+u)),h=a()*3,p=a()*3,g=Math.max(f,d)+h,y=Math.min(f,d)-p;l.push({o:f,h:g,l:y,c:d}),s=d}return l}function oc({data:e,width:t=80,height:r=32,bullColor:n="var(--green)",bearColor:a="var(--red)"}){if(!e||e.length===0)return null;const i=e.map(m=>m.l),s=e.map(m=>m.h),l=Math.min(...i),u=Math.max(...s)-l||1,f=2,d=r-f*2,h=t-f*2,p=m=>f+d-(m-l)/u*d,g=e.length,y=h/g,b=Math.max(2,y*.55),v=1;return o.jsx("svg",{width:t,height:r,viewBox:`0 0 ${t} ${r}`,style:{display:"block",flexShrink:0},"aria-hidden":"true",children:e.map((m,x)=>{const S=m.c>=m.o,j=S?n:a,w=f+x*y+y/2,_=p(Math.max(m.o,m.c)),O=p(Math.min(m.o,m.c)),N=Math.max(1,O-_);return o.jsxs("g",{children:[o.jsx("line",{x1:w,y1:p(m.h),x2:w,y2:p(m.l),stroke:j,strokeWidth:v,strokeOpacity:.7}),o.jsx("rect",{x:w-b/2,y:_,width:b,height:N,fill:j,fillOpacity:S?.85:.75,rx:.5})]},x)})})}const dn=e=>`$${(e/100).toFixed(2)}`,Dr=e=>{const t=e/100;return`${t>=0?"+":""}$${t.toFixed(2)}`},fZ=e=>e>=0?"text-green":"text-red",Ua=e=>e==="BUY_YES"?"bg-green":"bg-red",Ha=e=>e==="BUY_YES"?"YES":"NO",Uo=(e,t,r)=>!r||r===0?null:Math.round(e+t/r),Do=e=>`https://kalshi.com/search?query=${encodeURIComponent((e||"").split("-")[0])}`,Nj=e=>{if(!e)return"";const t=Date.now()-new Date(e).getTime();return t<6e4?"just now":t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`};function hZ({positions:e}){if(!e||!e.length)return null;const r=[{label:"<-$50",min:-1/0,max:-5e3,color:"#FF5C5C"},{label:"-$20-50",min:-5e3,max:-2e3,color:"#FF7A7A"},{label:"-$1-20",min:-2e3,max:-100,color:"#FF9999"},{label:"$0",min:-100,max:100,color:"#6B7280"},{label:"$1-20",min:100,max:2e3,color:"#88DDBB"},{label:"$20-50",min:2e3,max:5e3,color:"#44CC99"},{label:">$50",min:5e3,max:1/0,color:"#00C389"}].map(a=>{const i=e.filter(s=>{const l=s.realized_pnl_cents||0;return l>a.min&&l<=a.max}).length;return{...a,count:i}}).filter(a=>a.count>0);if(!r.length)return null;const n=({active:a,payload:i,label:s})=>{var c;if(!a||!(i!=null&&i.length))return null;const l=((c=i[0])==null?void 0:c.payload)||{};return o.jsxs("div",{style:{background:"#1C1C24",border:"1px solid #2A2A35",borderRadius:8,padding:"8px 12px",fontSize:12,fontFamily:"'Inter', sans-serif"},children:[o.jsx("p",{style:{color:"#E0E0E0",fontWeight:700,marginBottom:4},children:s}),o.jsxs("p",{style:{color:l.color,fontFamily:"'JetBrains Mono', monospace",fontWeight:700},children:[l.count," position",l.count!==1?"s":""]})]})};return o.jsxs("div",{className:"card",children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:14},children:[o.jsx("h2",{className:"section-title",style:{fontSize:"1.05rem"},children:"P&L Distribution"}),o.jsxs("span",{style:{fontSize:11,color:"#6B7280"},children:[e.length," positions total"]})]}),o.jsx(er,{width:"100%",height:180,children:o.jsxs(Sl,{data:r,margin:{top:4,right:12,left:0,bottom:4},children:[o.jsx(Ma,{strokeDasharray:"3 3",stroke:"#2A2A35",strokeOpacity:.6,vertical:!1}),o.jsx(ir,{dataKey:"label",stroke:"#2A2A35",tick:{fill:"#6B7280",fontSize:10,fontFamily:"'Inter', sans-serif"},tickLine:!1,axisLine:{stroke:"#2A2A35"}}),o.jsx(or,{stroke:"#2A2A35",tick:{fill:"#6B7280",fontSize:11,fontFamily:"'Inter', sans-serif"},tickLine:!1,axisLine:!1,allowDecimals:!1,width:30}),o.jsx(Ge,{content:o.jsx(n,{}),cursor:{fill:"rgba(0,240,255,0.04)"}}),o.jsx(rr,{dataKey:"count",radius:[4,4,0,0],maxBarSize:48,children:r.map((a,i)=>o.jsx(gr,{fill:a.color,fillOpacity:.85},i))})]})})]})}function pZ(){return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"w-9 h-9 rounded-full border-2 animate-spin",style:{borderColor:"var(--border)",borderTopColor:"var(--cyan)"}})})}function Pj({p:e,trades:t,loading:r}){return o.jsxs("div",{style:{background:"var(--bg)",borderTop:"1px solid var(--border)",borderBottom:"1px solid var(--border)"},className:"px-4 py-3",children:[o.jsxs("div",{className:"flex items-center justify-between mb-3",children:[o.jsxs("span",{className:"mono text-xs font-bold",style:{color:"var(--cyan)"},children:["Trade History — ",e.ticker]}),o.jsxs("div",{className:"flex gap-4 text-xs",style:{color:"var(--text-muted)"},children:[o.jsxs("span",{children:["Open: ",o.jsx("b",{style:{color:"var(--blue)"},children:e.open_trades})]}),o.jsxs("span",{children:["Closed: ",o.jsx("b",{style:{color:"var(--text-dim)"},children:e.closed_trades})]}),o.jsxs("span",{children:["Entry Range:"," ",o.jsxs("b",{style:{color:"var(--orange)"},children:[e.min_entry,"¢ – ",e.max_entry,"¢"]})]}),o.jsxs("span",{children:["First: ",o.jsx("b",{children:new Date(e.first_trade_at).toLocaleDateString()})]})]})]}),r?o.jsx("div",{className:"flex justify-center py-4",children:o.jsx("div",{className:"w-5 h-5 rounded-full border-2 animate-spin",style:{borderColor:"var(--border)",borderTopColor:"var(--cyan)"}})}):t.length>0?o.jsx("div",{className:"overflow-x-auto",style:{maxHeight:200,overflowY:"auto"},children:o.jsxs("table",{className:"text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Time"}),o.jsx("th",{children:"Direction"}),o.jsx("th",{children:"Contracts"}),o.jsx("th",{children:"Entry"}),o.jsx("th",{children:"Exit"}),o.jsx("th",{children:"Cost"}),o.jsx("th",{children:"Profit"}),o.jsx("th",{children:"Status"})]})}),o.jsx("tbody",{children:t.map((n,a)=>{const i=parseInt(n.entry_price_cents)||0,s=parseInt(n.pnl_cents)||0,l=parseInt(n.contracts)||0,c=n.status==="closed"||n.status==="expired",u=c&&l>0?Uo(i,s,l):null;return o.jsxs("tr",{children:[o.jsx("td",{className:"mono",style:{color:"var(--text-muted)"},children:new Date(n.created_at).toLocaleString()}),o.jsx("td",{children:o.jsx("span",{className:`badge ${Ua(n.direction)}`,children:Ha(n.direction)})}),o.jsx("td",{className:"mono",children:n.contracts}),o.jsxs("td",{className:"mono",style:{color:"var(--orange)",fontFamily:"'JetBrains Mono', monospace"},children:[i,"¢"]}),o.jsx("td",{className:"mono",style:{fontFamily:"'JetBrains Mono', monospace",color:u!=null?"var(--text-dim)":"var(--text-muted)"},children:u!=null?`${u}¢`:"—"}),o.jsx("td",{className:"mono",style:{color:"var(--text-dim)"},children:dn(n.cost_cents||0)}),o.jsx("td",{className:"mono",style:{fontFamily:"'JetBrains Mono', monospace",fontWeight:700,color:s>0?"var(--green)":s<0?"var(--red)":"var(--text-muted)"},children:n.pnl_cents!=null&&c?Dr(s):"—"}),o.jsx("td",{children:o.jsx("span",{className:`badge ${n.status==="open"?"bg-blue":n.status==="closed"?"bg-green":"bg-orange"}`,children:n.status})})]},a)})})]})}):o.jsx("p",{className:"text-center py-3 text-xs",style:{color:"var(--text-muted)"},children:"No trade details available"})]})}function mZ(){var D;const[e,t]=P.useState([]),[r,n]=P.useState([]),[a,i]=P.useState({}),[s,l]=P.useState(!0),[c,u]=P.useState(null),[f,d]=P.useState(null),[h,p]=P.useState({}),[g,y]=P.useState(null),[b,v]=P.useState("grouped"),[m,x]=P.useState("cost"),S=P.useCallback(async()=>{try{const A=await Oe("/positions");A.success&&(t(A.positions||[]),n(A.grouped||[]),i(A.summary||{}))}catch{}l(!1)},[]);P.useEffect(()=>{S();const A=setInterval(S,3e4);return()=>clearInterval(A)},[S]);async function j(A,L){const C=`${A}_${L}`;if(!h[C]){y(C);try{const M=await me("/positions/trades",{ticker:A,direction:L,limit:50});M.success&&p(I=>({...I,[C]:M.trades||[]}))}catch{}y(null)}}function w(A){u(L=>L===A?null:A),d(null)}function _(A,L){const C=`${A}_${L}`;f===C?d(null):(d(C),j(A,L))}const O=[...e].sort((A,L)=>m==="pnl"?L.realized_pnl_cents-A.realized_pnl_cents:m==="contracts"?L.open_contracts-A.open_contracts:L.open_cost_cents-A.open_cost_cents),N=e.filter(A=>A.realized_pnl_cents>0).sort((A,L)=>L.realized_pnl_cents-A.realized_pnl_cents),k=e.filter(A=>A.realized_pnl_cents<0).sort((A,L)=>A.realized_pnl_cents-L.realized_pnl_cents),E=e.filter(A=>A.realized_pnl_cents===0),T=e.length>0&&N.length+k.length>0?`${Math.round(N.length/(N.length+k.length)*100)}%`:"—";return s?o.jsx(pZ,{}):o.jsxs("div",{className:"space-y-6 fade-in",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"heading text-3xl",style:{color:"var(--text)"},children:["Positions",o.jsx("span",{className:"badge bg-cyan ml-3 align-middle text-base",children:a.positionCount||0})]}),o.jsxs("p",{className:"section-subtitle mt-1",children:[a.positionCount||0," active positions •"," ",((D=a.totalTrades)==null?void 0:D.toLocaleString())||0," total trades"]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"flex rounded-lg p-0.5 gap-0.5",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[["grouped","Grouped"],["flat","All"],["pnl","P&L"]].map(([A,L])=>o.jsx("button",{onClick:()=>v(A),className:"px-3 py-1 text-xs font-semibold rounded-md transition",style:b===A?{background:"var(--cyan)",color:"var(--bg)",fontFamily:"var(--font-body)"}:{color:"var(--text-muted)",fontFamily:"var(--font-body)"},children:L},A))}),o.jsx("button",{onClick:S,className:"btn btn-o btn-sm",children:"Refresh"})]})]}),o.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[o.jsxs("div",{className:"card card-accent-cyan",children:[o.jsx("p",{className:"stat-label",children:"Positions"}),o.jsx("p",{className:"stat-v mono mt-2",style:{color:"var(--cyan)"},children:a.positionCount||0})]}),o.jsxs("div",{className:"card card-accent-orange",children:[o.jsx("p",{className:"stat-label",children:"Total Cost"}),o.jsx("p",{className:"stat-v mono mt-2",style:{color:"var(--text)"},children:dn(a.totalCost||0)})]}),o.jsxs("div",{className:`card ${(a.totalPnl||0)>=0?"card-accent-green":"card-accent-red"}`,children:[o.jsx("p",{className:"stat-label",children:"Realized P&L"}),o.jsx("p",{className:`stat-v mono mt-2 ${(a.totalPnl||0)>=0?"pnl-positive":"pnl-negative"}`,children:Dr(a.totalPnl||0)})]}),o.jsxs("div",{className:"card card-accent-blue",children:[o.jsx("p",{className:"stat-label",children:"Contracts"}),o.jsx("p",{className:"stat-v mono mt-2",style:{color:"var(--blue)"},children:(a.totalContracts||0).toLocaleString()})]}),o.jsxs("div",{className:"card card-accent-green",children:[o.jsx("p",{className:"stat-label",children:"Win Rate"}),o.jsx("p",{className:"stat-v mono mt-2 text-green",children:T})]})]}),a.totalPnl!==0&&o.jsxs("div",{className:"card py-3",children:[o.jsxs("div",{className:"flex items-center justify-between text-xs mb-2",children:[o.jsxs("span",{className:"font-semibold text-green",children:[N.length," winners"]}),o.jsxs("span",{style:{color:"var(--text-muted)"},children:[E.length," flat"]}),o.jsxs("span",{className:"font-semibold text-red",children:[k.length," losers"]})]}),o.jsx("div",{className:"progress-bar",style:{height:8},children:(()=>{const A=N.reduce((C,M)=>C+M.realized_pnl_cents,0)+Math.abs(k.reduce((C,M)=>C+M.realized_pnl_cents,0));if(!A)return null;const L=N.reduce((C,M)=>C+M.realized_pnl_cents,0)/A*100;return o.jsxs("div",{className:"flex h-full w-full",children:[o.jsx("div",{className:"bar-win-glow",style:{width:`${L}%`,background:"var(--green)",borderRadius:"2px 0 0 2px"}}),o.jsx("div",{className:"bar-loss-glow",style:{width:`${100-L}%`,background:"var(--red)",borderRadius:"0 2px 2px 0"}})]})})()})]}),o.jsx(hZ,{positions:e}),b==="grouped"&&o.jsx("div",{className:"space-y-3",children:r.map(A=>{const L=c===A.event;return o.jsxs("div",{className:"card p-0 overflow-hidden",style:{padding:0},children:[o.jsxs("button",{onClick:()=>w(A.event),className:"w-full flex items-center gap-3 p-4 text-left transition",style:{background:"transparent"},onMouseEnter:C=>C.currentTarget.style.background="var(--cyan-glow)",onMouseLeave:C=>C.currentTarget.style.background="transparent",children:[o.jsx("span",{className:"text-xs inline-block transition-transform",style:{color:"var(--cyan)",transform:L?"rotate(90deg)":"rotate(0deg)"},children:"▶"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"mono text-sm font-bold",style:{color:"var(--orange)"},children:A.event}),o.jsx("span",{className:"badge bg-cyan",children:A.positions.length})]}),o.jsx("p",{className:"text-xs truncate mt-0.5",style:{color:"var(--text-muted)"},children:A.title})]}),o.jsxs("div",{className:"flex items-center gap-6 text-right flex-shrink-0",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Cost"}),o.jsx("p",{className:"mono text-sm",style:{color:"var(--text)"},children:dn(A.totalCost)})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Contracts"}),o.jsx("p",{className:"mono text-sm",style:{color:"var(--blue)"},children:A.totalContracts.toLocaleString()})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Realized P&L"}),o.jsx("p",{className:`mono text-sm font-bold ${fZ(A.totalPnl)}`,children:Dr(A.totalPnl)})]})]})]}),L&&o.jsx("div",{style:{borderTop:"1px solid var(--border)"},children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{}),o.jsx("th",{children:"Ticker"}),o.jsx("th",{children:"Side"}),o.jsx("th",{children:"Contracts"}),o.jsx("th",{children:"Bought At"}),o.jsx("th",{children:"Sold At"}),o.jsx("th",{children:"Cost"}),o.jsx("th",{children:"Profit"}),o.jsx("th",{children:"Trades"}),o.jsx("th",{children:"Last Trade"})]})}),o.jsx("tbody",{children:A.positions.map(C=>{var Qe,Ae;const M=`${C.ticker}_${C.direction}`,I=f===M,R=h[M]||[],F=g===M,K=(C.realized_pnl_cents||0)>0,z=(C.realized_pnl_cents||0)<0,q=C.ticker.split("").reduce((V,Z)=>V+Z.charCodeAt(0),0),he=ic(q,9,K?"up":z?"down":"flat"),ge=K?"cursor-pointer position-winning":z?"cursor-pointer position-losing":"cursor-pointer";return o.jsxs($.Fragment,{children:[o.jsxs("tr",{className:ge,onClick:()=>_(C.ticker,C.direction),style:{position:"relative"},children:[o.jsx("td",{style:{width:24},children:o.jsx("span",{className:"text-xs inline-block transition-transform",style:{color:"var(--cyan)",transform:I?"rotate(90deg)":"rotate(0deg)"},children:"▶"})}),o.jsx("td",{children:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[o.jsx("a",{href:Do(C.ticker),target:"_blank",rel:"noopener noreferrer",className:"mono text-sm hover:underline",style:{color:"var(--orange)"},onClick:V=>V.stopPropagation(),children:C.ticker}),o.jsx(oc,{data:he,width:72,height:28})]})}),o.jsx("td",{children:o.jsx("span",{className:`badge ${Ua(C.direction)}`,children:Ha(C.direction)})}),o.jsx("td",{className:"mono",children:(Qe=C.open_contracts)==null?void 0:Qe.toLocaleString()}),o.jsxs("td",{className:"mono",style:{color:"var(--orange)",fontFamily:"'JetBrains Mono', monospace"},children:[C.avg_entry_price,"¢"]}),o.jsx("td",{className:"mono",style:{fontFamily:"'JetBrains Mono', monospace"},children:(()=>{const V=parseInt(C.closed_trades)||0,Z=parseInt(C.open_trades)||0;if(V>0&&Z===0){const re=Uo(C.avg_entry_price,C.realized_pnl_cents,parseInt(C.open_contracts)||parseInt(C.total_trades)||1);return o.jsxs("span",{style:{color:"var(--text-dim)"},children:[re,"¢"]})}return o.jsx("span",{className:"badge bg-blue",style:{fontSize:"0.65rem"},children:"Open"})})()}),o.jsx("td",{className:"mono",style:{color:"var(--text)"},children:dn(C.open_cost_cents)}),o.jsx("td",{className:"mono",style:{fontFamily:"'JetBrains Mono', monospace",fontWeight:700,color:C.realized_pnl_cents>0?"var(--green)":C.realized_pnl_cents<0?"var(--red)":"var(--text-muted)"},children:C.realized_pnl_cents!==0?Dr(C.realized_pnl_cents):"—"}),o.jsx("td",{className:"mono",style:{color:"var(--text-muted)"},children:(Ae=C.total_trades)==null?void 0:Ae.toLocaleString()}),o.jsx("td",{className:"text-xs",style:{color:"var(--text-muted)"},children:Nj(C.last_trade_at)})]}),I&&o.jsx("tr",{children:o.jsx("td",{colSpan:10,style:{padding:0},children:o.jsx(Pj,{p:C,trades:R,loading:F})})})]},M)})})]})})]},A.event)})}),b==="flat"&&o.jsxs("div",{className:"card overflow-x-auto",style:{padding:0},children:[o.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",style:{borderBottom:"1px solid var(--border)"},children:[o.jsx("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Sort by:"}),[["cost","Cost"],["pnl","P&L"],["contracts","Contracts"]].map(([A,L])=>o.jsx("button",{onClick:()=>x(A),className:"text-xs font-semibold px-2.5 py-1 rounded-md transition",style:m===A?{background:"var(--cyan-dim)",color:"var(--cyan)"}:{color:"var(--text-muted)"},children:L},A))]}),o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"#"}),o.jsx("th",{children:"Ticker"}),o.jsx("th",{children:"Market"}),o.jsx("th",{children:"Side"}),o.jsx("th",{children:"Contracts"}),o.jsx("th",{children:"Bought At"}),o.jsx("th",{children:"Sold At"}),o.jsx("th",{children:"Cost"}),o.jsx("th",{children:"Profit"}),o.jsx("th",{children:"Trades"}),o.jsx("th",{children:"Last Trade"})]})}),o.jsx("tbody",{children:O.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:11,className:"text-center py-12",style:{color:"var(--text-muted)"},children:"No open positions"})}):O.map((A,L)=>{var ge,Qe;const C=`${A.ticker}_${A.direction}`,M=f===C,I=h[C]||[],R=g===C,F=(A.realized_pnl_cents||0)>0,K=(A.realized_pnl_cents||0)<0,z=A.ticker.split("").reduce((Ae,V)=>Ae+V.charCodeAt(0),0),q=F?"up":K?"down":"flat",ie=ic(z+100,9,q),he=F?"cursor-pointer position-winning":K?"cursor-pointer position-losing":"cursor-pointer";return o.jsxs($.Fragment,{children:[o.jsxs("tr",{className:he,onClick:()=>_(A.ticker,A.direction),style:{position:"relative"},children:[o.jsx("td",{style:{color:"var(--text-muted)"},children:L+1}),o.jsx("td",{children:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[o.jsx("a",{href:Do(A.ticker),target:"_blank",rel:"noopener noreferrer",className:"mono text-sm hover:underline",style:{color:"var(--orange)"},onClick:Ae=>Ae.stopPropagation(),children:A.ticker}),o.jsx(oc,{data:ie,width:72,height:28})]})}),o.jsx("td",{className:"text-xs max-w-[192px] truncate",style:{color:"var(--text-dim)"},children:A.title}),o.jsx("td",{children:o.jsx("span",{className:`badge ${Ua(A.direction)}`,children:Ha(A.direction)})}),o.jsx("td",{className:"mono",children:(ge=A.open_contracts)==null?void 0:ge.toLocaleString()}),o.jsxs("td",{className:"mono",style:{color:"var(--orange)",fontFamily:"'JetBrains Mono', monospace"},children:[A.avg_entry_price,"¢"]}),o.jsx("td",{className:"mono",style:{fontFamily:"'JetBrains Mono', monospace"},children:(()=>{const Ae=parseInt(A.closed_trades)||0,V=parseInt(A.open_trades)||0;if(Ae>0&&V===0){const Z=Uo(A.avg_entry_price,A.realized_pnl_cents,parseInt(A.open_contracts)||parseInt(A.total_trades)||1);return o.jsxs("span",{style:{color:"var(--text-dim)"},children:[Z,"¢"]})}return o.jsx("span",{className:"badge bg-blue",style:{fontSize:"0.65rem"},children:"Open"})})()}),o.jsx("td",{className:"mono",style:{color:"var(--text)"},children:dn(A.open_cost_cents)}),o.jsx("td",{className:"mono",style:{fontFamily:"'JetBrains Mono', monospace",fontWeight:700,color:A.realized_pnl_cents>0?"var(--green)":A.realized_pnl_cents<0?"var(--red)":"var(--text-muted)"},children:A.realized_pnl_cents!==0?Dr(A.realized_pnl_cents):"—"}),o.jsx("td",{className:"mono",style:{color:"var(--text-muted)"},children:(Qe=A.total_trades)==null?void 0:Qe.toLocaleString()}),o.jsx("td",{className:"text-xs",style:{color:"var(--text-muted)"},children:Nj(A.last_trade_at)})]}),M&&o.jsx("tr",{children:o.jsx("td",{colSpan:11,style:{padding:0},children:o.jsx(Pj,{p:A,trades:I,loading:R})})})]},C)})})]})]}),b==="pnl"&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"card overflow-hidden",style:{padding:0},children:[o.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",style:{background:"rgba(0,195,137,0.06)",borderBottom:"1px solid rgba(0,195,137,0.2)",borderLeft:"4px solid var(--green)"},children:[o.jsx("span",{className:"text-sm font-bold text-green",style:{textShadow:"0 0 10px rgba(0,195,137,0.4)"},children:"Winners"}),o.jsx("span",{className:"badge bg-green",children:N.length}),o.jsx("div",{className:"flex-1"}),o.jsx("span",{className:"mono font-bold pnl-positive",children:Dr(N.reduce((A,L)=>A+L.realized_pnl_cents,0))})]}),o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Ticker"}),o.jsx("th",{children:"Market"}),o.jsx("th",{children:"Side"}),o.jsx("th",{children:"Contracts"}),o.jsx("th",{children:"Bought At"}),o.jsx("th",{children:"Sold At"}),o.jsx("th",{children:"Cost"}),o.jsx("th",{children:"Profit"}),o.jsx("th",{children:"ROI"})]})}),o.jsx("tbody",{children:N.map(A=>{var K;const L=A.open_cost_cents>0?`${(A.realized_pnl_cents/A.open_cost_cents*100).toFixed(0)}%`:"∞",C=A.ticker.split("").reduce((z,q)=>z+q.charCodeAt(0),0),M=ic(C+200,9,"up"),I=parseInt(A.closed_trades)||0,R=parseInt(A.open_trades)||0,F=I>0&&R===0?Uo(A.avg_entry_price,A.realized_pnl_cents,parseInt(A.open_contracts)||parseInt(A.total_trades)||1):null;return o.jsxs("tr",{className:"position-winning",style:{position:"relative"},children:[o.jsx("td",{children:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[o.jsx("a",{href:Do(A.ticker),target:"_blank",rel:"noopener",className:"mono text-sm hover:underline",style:{color:"var(--orange)"},children:A.ticker}),o.jsx(oc,{data:M,width:64,height:26})]})}),o.jsx("td",{className:"text-xs max-w-[192px] truncate",style:{color:"var(--text-dim)"},children:A.title}),o.jsx("td",{children:o.jsx("span",{className:`badge ${Ua(A.direction)}`,children:Ha(A.direction)})}),o.jsx("td",{className:"mono",children:(K=A.open_contracts)==null?void 0:K.toLocaleString()}),o.jsxs("td",{className:"mono",style:{color:"var(--orange)",fontFamily:"'JetBrains Mono', monospace"},children:[A.avg_entry_price,"¢"]}),o.jsx("td",{className:"mono",style:{fontFamily:"'JetBrains Mono', monospace",color:F!=null?"var(--text-dim)":"var(--text-muted)"},children:F!=null?`${F}¢`:o.jsx("span",{className:"badge bg-blue",style:{fontSize:"0.65rem"},children:"Open"})}),o.jsx("td",{className:"mono",style:{color:"var(--text-dim)"},children:dn(A.open_cost_cents)}),o.jsx("td",{className:"mono font-bold pnl-positive",style:{fontFamily:"'JetBrains Mono', monospace"},children:Dr(A.realized_pnl_cents)}),o.jsx("td",{className:"mono pnl-positive",children:L})]},`${A.ticker}_${A.direction}`)})})]})]}),o.jsxs("div",{className:"card overflow-hidden",style:{padding:0},children:[o.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",style:{background:"rgba(255,92,92,0.06)",borderBottom:"1px solid rgba(255,92,92,0.2)",borderLeft:"4px solid var(--red)"},children:[o.jsx("span",{className:"text-sm font-bold text-red",style:{textShadow:"0 0 10px rgba(255,92,92,0.4)"},children:"Losers"}),o.jsx("span",{className:"badge bg-red",children:k.length}),o.jsx("div",{className:"flex-1"}),o.jsx("span",{className:"mono font-bold pnl-negative",children:Dr(k.reduce((A,L)=>A+L.realized_pnl_cents,0))})]}),o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Ticker"}),o.jsx("th",{children:"Market"}),o.jsx("th",{children:"Side"}),o.jsx("th",{children:"Contracts"}),o.jsx("th",{children:"Bought At"}),o.jsx("th",{children:"Sold At"}),o.jsx("th",{children:"Cost"}),o.jsx("th",{children:"Profit"}),o.jsx("th",{children:"ROI"})]})}),o.jsx("tbody",{children:k.map(A=>{var K;const L=A.open_cost_cents>0?`${(A.realized_pnl_cents/A.open_cost_cents*100).toFixed(0)}%`:"—",C=A.ticker.split("").reduce((z,q)=>z+q.charCodeAt(0),0),M=ic(C+300,9,"down"),I=parseInt(A.closed_trades)||0,R=parseInt(A.open_trades)||0,F=I>0&&R===0?Uo(A.avg_entry_price,A.realized_pnl_cents,parseInt(A.open_contracts)||parseInt(A.total_trades)||1):null;return o.jsxs("tr",{className:"position-losing",style:{position:"relative"},children:[o.jsx("td",{children:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[o.jsx("a",{href:Do(A.ticker),target:"_blank",rel:"noopener",className:"mono text-sm hover:underline",style:{color:"var(--orange)"},children:A.ticker}),o.jsx(oc,{data:M,width:64,height:26})]})}),o.jsx("td",{className:"text-xs max-w-[192px] truncate",style:{color:"var(--text-dim)"},children:A.title}),o.jsx("td",{children:o.jsx("span",{className:`badge ${Ua(A.direction)}`,children:Ha(A.direction)})}),o.jsx("td",{className:"mono",children:(K=A.open_contracts)==null?void 0:K.toLocaleString()}),o.jsxs("td",{className:"mono",style:{color:"var(--orange)",fontFamily:"'JetBrains Mono', monospace"},children:[A.avg_entry_price,"¢"]}),o.jsx("td",{className:"mono",style:{fontFamily:"'JetBrains Mono', monospace",color:F!=null?"var(--text-dim)":"var(--text-muted)"},children:F!=null?`${F}¢`:o.jsx("span",{className:"badge bg-blue",style:{fontSize:"0.65rem"},children:"Open"})}),o.jsx("td",{className:"mono",style:{color:"var(--text-dim)"},children:dn(A.open_cost_cents)}),o.jsx("td",{className:"mono font-bold pnl-negative",style:{fontFamily:"'JetBrains Mono', monospace"},children:Dr(A.realized_pnl_cents)}),o.jsx("td",{className:"mono pnl-negative",children:L})]},`${A.ticker}_${A.direction}`)})})]})]}),E.length>0&&o.jsxs("div",{className:"card overflow-hidden",style:{padding:0},children:[o.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",style:{background:"var(--surface-el)",borderBottom:"1px solid var(--border)"},children:[o.jsx("span",{className:"text-sm font-bold",style:{color:"var(--text-dim)"},children:"Flat (No Realized P&L)"}),o.jsx("span",{className:"badge bg-orange",children:E.length})]}),o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Ticker"}),o.jsx("th",{children:"Market"}),o.jsx("th",{children:"Side"}),o.jsx("th",{children:"Contracts"}),o.jsx("th",{children:"Cost"})]})}),o.jsx("tbody",{children:E.map(A=>{var L;return o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx("a",{href:Do(A.ticker),target:"_blank",rel:"noopener",className:"mono text-sm hover:underline",style:{color:"var(--orange)"},children:A.ticker})}),o.jsx("td",{className:"text-xs max-w-[192px] truncate",style:{color:"var(--text-dim)"},children:A.title}),o.jsx("td",{children:o.jsx("span",{className:`badge ${Ua(A.direction)}`,children:Ha(A.direction)})}),o.jsx("td",{className:"mono",children:(L=A.open_contracts)==null?void 0:L.toLocaleString()}),o.jsx("td",{className:"mono",style:{color:"var(--text-dim)"},children:dn(A.open_cost_cents)})]},`${A.ticker}_${A.direction}`)})})]})]})]})]})}function vZ(e){return e==="filled"?"bg-green":e==="resting"?"bg-orange":e==="canceled"?"bg-red":"bg-blue"}function Aj({label:e}){return o.jsx("tr",{children:o.jsx("td",{colSpan:20,children:o.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-3",children:[o.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--text-muted)"},children:[o.jsx("path",{d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2"}),o.jsx("rect",{x:"9",y:"3",width:"6",height:"4",rx:"1"}),o.jsx("path",{d:"M9 12h6M9 16h4"})]}),o.jsx("p",{style:{color:"var(--text-muted)",fontFamily:"var(--font-body)",fontSize:"0.875rem"},children:e})]})})})}function yZ(){return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"w-9 h-9 rounded-full border-2 animate-spin",style:{borderColor:"var(--border)",borderTopColor:"var(--cyan)"}})})}function gZ(){const[e,t]=P.useState([]),[r,n]=P.useState([]),[a,i]=P.useState(!0),[s,l]=P.useState("orders");P.useEffect(()=>{c()},[]);async function c(){i(!0);try{const[f,d]=await Promise.all([me("/kalshi",{action:"get_orders"}),me("/kalshi",{action:"get_fills"})]);t(f.orders||[]),n(d.fills||[])}catch{}i(!1)}async function u(f){try{await me("/kalshi",{action:"cancel_order",order_id:f}),c()}catch{}}return a?o.jsx(yZ,{}):o.jsxs("div",{className:"space-y-6 fade-in",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-xl",style:{background:"var(--cyan-dim)",color:"var(--cyan)"},children:o.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M7 16V4m0 0L3 8m4-4l4 4"}),o.jsx("path",{d:"M17 8v12m0 0l4-4m-4 4l-4-4"})]})}),o.jsxs("div",{children:[o.jsx("h1",{className:"heading text-3xl",style:{color:"var(--text)"},children:"Orders"}),o.jsxs("p",{className:"section-subtitle mt-0.5",children:[e.length," orders • ",r.length," fills"]})]})]}),o.jsx("button",{onClick:c,className:"btn btn-o btn-sm",children:"Refresh"})]}),o.jsxs("div",{className:"flex rounded-xl p-1 gap-1 w-fit",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[o.jsxs("button",{onClick:()=>l("orders"),className:"btn btn-sm",style:s==="orders"?{background:"var(--cyan)",color:"var(--bg)"}:{background:"transparent",color:"var(--text-muted)",border:"none"},children:["Orders",o.jsx("span",{className:"badge ml-1",style:s==="orders"?{background:"rgba(0,0,0,0.2)",color:"var(--bg)",fontSize:"0.65rem"}:{background:"var(--surface)",color:"var(--text-muted)",fontSize:"0.65rem"},children:e.length})]}),o.jsxs("button",{onClick:()=>l("fills"),className:"btn btn-sm",style:s==="fills"?{background:"var(--cyan)",color:"var(--bg)"}:{background:"transparent",color:"var(--text-muted)",border:"none"},children:["Fills",o.jsx("span",{className:"badge ml-1",style:s==="fills"?{background:"rgba(0,0,0,0.2)",color:"var(--bg)",fontSize:"0.65rem"}:{background:"var(--surface)",color:"var(--text-muted)",fontSize:"0.65rem"},children:r.length})]})]}),s==="orders"&&o.jsx("div",{className:"card overflow-x-auto",style:{padding:0},children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Ticker"}),o.jsx("th",{children:"Side"}),o.jsx("th",{children:"Action"}),o.jsx("th",{children:"Type"}),o.jsx("th",{children:"Price"}),o.jsx("th",{children:"Qty"}),o.jsx("th",{children:"Filled"}),o.jsx("th",{children:"Status"}),o.jsx("th",{children:"Action"})]})}),o.jsx("tbody",{children:e.length===0?o.jsx(Aj,{label:"No orders yet"}):e.map((f,d)=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent((f.ticker||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"mono text-xs hover:underline transition",style:{color:"var(--orange)"},children:f.ticker})}),o.jsx("td",{children:o.jsx("span",{className:`badge ${f.side==="yes"?"bg-green":"bg-red"}`,children:(f.side||"").toUpperCase()})}),o.jsx("td",{className:"text-xs",style:{color:"var(--text-dim)"},children:(f.action||"").toUpperCase()}),o.jsx("td",{className:"text-xs",style:{color:"var(--text-muted)"},children:f.type}),o.jsxs("td",{className:"mono",style:{color:"var(--cyan)"},children:[f.yes_price||f.no_price||"—","¢"]}),o.jsx("td",{className:"mono",children:f.count||f.remaining_count||0}),o.jsx("td",{className:"mono text-green",children:f.count-(f.remaining_count||0)}),o.jsx("td",{children:o.jsx("span",{className:`badge ${vZ(f.status)}`,children:f.status})}),o.jsx("td",{children:f.status==="resting"&&o.jsx("button",{onClick:()=>u(f.order_id),className:"btn btn-d btn-sm",children:"Cancel"})})]},d))})]})}),s==="fills"&&o.jsx("div",{className:"card overflow-x-auto",style:{padding:0},children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Ticker"}),o.jsx("th",{children:"Side"}),o.jsx("th",{children:"Action"}),o.jsx("th",{children:"Price"}),o.jsx("th",{children:"Qty"}),o.jsx("th",{children:"Maker/Taker"}),o.jsx("th",{children:"Time"})]})}),o.jsx("tbody",{children:r.length===0?o.jsx(Aj,{label:"No fills yet"}):r.map((f,d)=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent((f.ticker||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"mono text-xs hover:underline transition",style:{color:"var(--orange)"},children:f.ticker})}),o.jsx("td",{children:o.jsx("span",{className:`badge ${f.side==="yes"?"bg-green":"bg-red"}`,children:(f.side||"").toUpperCase()})}),o.jsx("td",{className:"text-xs",style:{color:"var(--text-dim)"},children:(f.action||"").toUpperCase()}),o.jsxs("td",{className:"mono",style:{color:"var(--cyan)"},children:[f.yes_price||f.no_price||"—","¢"]}),o.jsx("td",{className:"mono",children:f.count}),o.jsx("td",{children:f.is_taker?o.jsx("span",{className:"badge bg-orange",children:"TAKER"}):o.jsx("span",{className:"badge bg-green",children:"MAKER"})}),o.jsx("td",{className:"mono text-xs",style:{color:"var(--text-muted)"},children:f.created_time?new Date(f.created_time).toLocaleString():"—"})]},d))})]})})]})}function xZ(){const[e,t]=P.useState(null),[r,n]=P.useState(!0);P.useEffect(()=>{a()},[]);async function a(){n(!0);try{const l=await me("/weather",{action:"get_data"});t(l)}catch{}n(!1)}async function i(){n(!0);try{const l=await me("/weather",{action:"fetch_all"});t(l)}catch{}n(!1)}if(r)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})});const s=[{label:"Stations",key:"stations",icon:"📍",color:"var(--cyan)"},{label:"Forecasts",key:"forecasts",icon:"🔮",color:"var(--blue)"},{label:"Observations",key:"observations",icon:"📊",color:"var(--green)"},{label:"Metrics",key:"metrics",icon:"📏",color:"var(--purple)"}];return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"heading text-2xl font-bold flex items-center gap-2",children:[o.jsx("span",{style:{color:"var(--cyan)"},children:"☁"}),o.jsx("span",{className:"gradient-cyan",children:"Weather Markets"})]}),o.jsx("p",{className:"section-subtitle mt-1",children:"NWS settlement data for Ken weather contracts"})]}),o.jsxs("button",{onClick:i,className:"btn btn-p",children:["↻"," Fetch Latest"]})]}),o.jsx("div",{className:"grid grid-cols-4 gap-4",children:s.map(({label:l,key:c,icon:u,color:f})=>o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[o.jsx("span",{className:"text-lg",children:u}),o.jsx("p",{className:"stat-label",children:l})]}),o.jsx("p",{className:"stat-v",style:{color:f},children:(e==null?void 0:e[c])??"—"})]},l))}),o.jsxs("div",{className:"card",children:[o.jsx("h2",{className:"section-title mb-4",children:"Settlement Rule Reference"}),o.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[o.jsxs("div",{className:"rounded-lg p-4",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[o.jsx("p",{className:"stat-label mb-3",children:"Temperature Contracts"}),o.jsx("ul",{className:"space-y-2",children:["Source: NWS Daily Climate Report (final)","Station: Market-specified (e.g. KORD, KLGA)","Values: Tmax/Tmin in degrees F","Missing data: treated as 0"].map((l,c)=>o.jsxs("li",{className:"flex items-start gap-2 text-xs",style:{color:"var(--text-dim)"},children:[o.jsx("span",{style:{color:"var(--cyan)",flexShrink:0},children:"‣"}),l]},c))})]}),o.jsxs("div",{className:"rounded-lg p-4",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[o.jsx("p",{className:"stat-label mb-3",children:"Precipitation Contracts"}),o.jsx("ul",{className:"space-y-2",children:["Source: NWS Daily Climate Report (first complete)","Trace: counted as 0.00 inches","Missing: counted as 0.00 inches","Revisions: do NOT change settlement"].map((l,c)=>o.jsxs("li",{className:"flex items-start gap-2 text-xs",style:{color:"var(--text-dim)"},children:[o.jsx("span",{style:{color:"var(--blue)",flexShrink:0},children:"‣"}),l]},c))})]})]})]}),((e==null?void 0:e.outcomes)||[]).length>0&&o.jsxs("div",{className:"card overflow-x-auto",children:[o.jsx("h2",{className:"section-title mb-4",children:"Recent Observations"}),o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Station"}),o.jsx("th",{children:"Metric"}),o.jsx("th",{children:"Value"}),o.jsx("th",{children:"Source"}),o.jsx("th",{children:"Date"})]})}),o.jsx("tbody",{children:e.outcomes.map((l,c)=>o.jsxs("tr",{className:"fade-in",children:[o.jsx("td",{className:"mono text-sm",style:{color:"var(--cyan)"},children:l.station_id}),o.jsx("td",{children:o.jsx("span",{className:"badge bg-blue",children:l.metric})}),o.jsxs("td",{className:"mono font-bold",style:{color:"var(--text)"},children:[l.value,l.units]}),o.jsx("td",{className:"text-xs",style:{color:"var(--text-muted)"},children:l.source}),o.jsx("td",{className:"text-xs mono",style:{color:"var(--text-muted)"},children:l.period_end})]},c))})]})]}),((e==null?void 0:e.outcomes)||[]).length===0&&o.jsxs("div",{className:"card text-center py-12",style:{border:"1px dashed var(--border)"},children:[o.jsx("p",{className:"text-4xl mb-3",children:"⛅"}),o.jsx("p",{className:"heading text-sm font-semibold mb-1",style:{color:"var(--text-dim)"},children:"No observations loaded"}),o.jsx("p",{className:"text-xs mb-4",style:{color:"var(--text-muted)"},children:'Click "Fetch Latest" to pull current NWS settlement data'}),o.jsx("button",{onClick:i,className:"btn btn-p btn-sm",children:"Fetch Latest"})]})]})}const bZ={aggressive:"#ef4444",conservative:"#3b82f6",weather:"#06b6d4",momentum:"#f59e0b",contrarian:"#a855f7",ai_enhanced:"#ec4899",mc_validated:"#8b5cf6",scalper:"#10b981",patient:"#6366f1",random:"#f97316",penny_pincher:"#84cc16",spray_pray:"#14b8a6",nickel_slots:"#eab308",degen_lite:"#e11d48",politics_junkie:"#7c3aed",double_down:"#dc2626",volatility_rider:"#0ea5e9",whale:"#1d4ed8",yolo:"#be123c",full_send:"#ea580c",kelly_criterion:"#4f46e5",sharpe_sniper:"#059669",bayesian_blend:"#7c3aed",ensemble_lock:"#0891b2",mean_revert:"#4338ca",info_ratio:"#b45309",anti_fomo:"#64748b",nightcrawler:"#334155",heatseeker:"#dc2626",quant_core:"#2563eb"},jZ="#F7931A";function JO(e){return e.startsWith("etf_")?jZ:bZ[e]||"#6b7280"}function wZ({won:e,lost:t,total:r}){if(!r)return o.jsx("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:"no trades"});const n=e/r*100,a=t/r*100;return o.jsxs("div",{className:"flex h-1.5 rounded-full overflow-hidden w-full",style:{background:"var(--border)"},children:[e>0&&o.jsx("div",{style:{width:`${n}%`,background:"var(--green)"}}),t>0&&o.jsx("div",{style:{width:`${a}%`,background:"var(--red)"}})]})}function SZ({streak:e}){if(e===0)return o.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.7rem"},children:"—"});const t=e>0;return o.jsxs("span",{className:"mono font-bold text-xs",style:{color:t?"var(--green)":"var(--red)"},children:[t?"+":"",e]})}const _Z=e=>e==="BUY_YES"?"YES":"NO",kZ=e=>e==="BUY_YES"?"bg-green":"bg-red",OZ=e=>e>=0?"var(--green)":"var(--red)";function Cj({trades:e,loading:t}){return t?o.jsx("div",{className:"flex justify-center py-4",children:o.jsx("div",{className:"w-5 h-5 rounded-full border-2 animate-spin",style:{borderColor:"var(--border)",borderTopColor:"var(--cyan)"}})}):!e||e.length===0?o.jsx("p",{className:"text-xs text-center py-3",style:{color:"var(--text-muted)"},children:"No trades found for this portfolio"}):o.jsx("div",{className:"overflow-x-auto",style:{maxHeight:240,overflowY:"auto"},children:o.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"0.7rem"},children:[o.jsx("thead",{children:o.jsx("tr",{style:{borderBottom:"1px solid var(--border)"},children:["Market","Dir","Entry","Qty","Cost","P&L","Status"].map(r=>o.jsx("th",{style:{padding:"4px 6px",textAlign:"left",color:"var(--text-muted)",fontWeight:600,fontFamily:"var(--font-body)",fontSize:"0.65rem",whiteSpace:"nowrap"},children:r},r))})}),o.jsx("tbody",{children:e.map((r,n)=>{const a=parseInt(r.pnl_cents)||0,i=parseInt(r.cost_cents)||0,s=parseInt(r.entry_price_cents)||0,l=parseInt(r.contracts)||0,c=r.status||"open";return o.jsxs("tr",{style:{borderBottom:"1px solid var(--border)",background:n%2===0?"transparent":"rgba(255,255,255,0.01)"},children:[o.jsxs("td",{style:{padding:"4px 6px",maxWidth:140,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--text-dim)",fontFamily:"var(--font-body)"},title:r.market_title||r.market_id,children:[(r.market_title||r.market_id||"").substring(0,28),(r.market_title||r.market_id||"").length>28?"...":""]}),o.jsx("td",{style:{padding:"4px 6px"},children:o.jsx("span",{className:`badge ${kZ(r.direction)}`,style:{fontSize:"0.6rem",padding:"1px 5px"},children:_Z(r.direction)})}),o.jsxs("td",{style:{padding:"4px 6px",fontFamily:"'JetBrains Mono', monospace",color:"var(--orange)"},children:[s,"¢"]}),o.jsx("td",{style:{padding:"4px 6px",fontFamily:"'JetBrains Mono', monospace",color:"var(--text-dim)"},children:l}),o.jsxs("td",{style:{padding:"4px 6px",fontFamily:"'JetBrains Mono', monospace",color:"var(--text-dim)"},children:["$",(i/100).toFixed(2)]}),o.jsx("td",{style:{padding:"4px 6px",fontFamily:"'JetBrains Mono', monospace",fontWeight:700,color:OZ(a)},children:a!==0?`${a>=0?"+":""}$${(a/100).toFixed(2)}`:"—"}),o.jsx("td",{style:{padding:"4px 6px"},children:o.jsx("span",{className:`badge ${c==="open"?"bg-blue":c==="closed"?"bg-green":"bg-orange"}`,style:{fontSize:"0.6rem",padding:"1px 5px"},children:c})})]},r.id||n)})})]})})}function NZ({p:e,dailyPnl:t,expanded:r,onToggle:n,pfTrades:a,pfTradesLoading:i}){const s=(e.total_returned_cents-e.total_invested_cents)/100,l=e.trades_won+e.trades_lost+e.trades_expired,c=e.total_invested_cents/100,u=e.total_returned_cents/100,f=l>0,d=JO(e.strategy),h=Math.min(100,e.daily_budget_cents/Math.max(1,1e5)*100);return o.jsxs("div",{className:"card cursor-pointer transition-all",style:r?{borderColor:"var(--cyan)",boxShadow:"0 0 20px var(--cyan-glow)",opacity:1}:f?{opacity:1}:{opacity:.5},onClick:n,children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx("div",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{background:d}}),o.jsx("span",{className:"heading font-semibold text-sm truncate",style:{color:"var(--text)"},children:e.name}),o.jsxs("span",{className:"mono text-xs flex-shrink-0",style:{color:"var(--text-muted)"},children:["#",e.id]}),l>0&&o.jsxs("span",{className:"text-xs flex-shrink-0 px-1.5 py-0.5 rounded",style:{background:"var(--surface-el)",color:"var(--text-muted)",fontSize:"0.65rem"},children:[l," trade",l!==1?"s":""]})]}),o.jsxs("span",{className:"mono text-sm font-bold flex-shrink-0 ml-2",style:{color:s>=0?"var(--green)":"var(--red)"},children:[s>=0?"+":"","$",s.toFixed(2)]})]}),o.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[o.jsx("span",{className:"mono px-1.5 py-0.5 rounded text-xs flex-shrink-0",style:{background:`${d}15`,color:d,border:`1px solid ${d}30`},children:e.strategy}),o.jsx(SZ,{streak:e.streak}),o.jsx("div",{className:"flex-1"}),o.jsx("span",{className:"badge flex-shrink-0",style:f?{background:"var(--green-dim)",color:"var(--green)"}:{background:"var(--border)",color:"var(--text-muted)"},children:f?"Active":"Dormant"})]}),o.jsxs("div",{className:"mb-3",children:[o.jsx(wZ,{won:e.trades_won,lost:e.trades_lost,total:l}),o.jsxs("div",{className:"flex justify-between mt-1",children:[o.jsxs("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:[e.trades_won,"W / ",e.trades_lost,"L"]}),o.jsxs("span",{className:"mono text-xs",style:{color:"var(--text-dim)"},children:[e.win_rate||0,"%"]})]})]}),o.jsxs("div",{className:"mb-3",children:[o.jsxs("div",{className:"flex justify-between text-xs mb-1",style:{color:"var(--text-muted)"},children:[o.jsx("span",{children:"Daily Budget"}),o.jsxs("span",{className:"mono",style:{color:"var(--text-dim)"},children:["$",(e.daily_budget_cents/100).toFixed(2)]})]}),o.jsx("div",{className:"progress-bar",children:o.jsx("div",{className:"progress-fill",style:{width:`${h}%`,background:`linear-gradient(90deg, ${d}, ${d}99)`}})})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-x-3 gap-y-1",style:{fontSize:"0.7rem"},children:[o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"Invested"}),o.jsxs("span",{className:"mono",style:{color:"var(--text-dim)"},children:["$",c.toFixed(2)]})]}),o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"Returned"}),o.jsxs("span",{className:"mono",style:{color:"var(--text-dim)"},children:["$",u.toFixed(2)]})]}),o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"Trades Today"}),o.jsx("span",{className:"mono",style:{color:"var(--cyan)"},children:e.trades_today})]}),o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"Total"}),o.jsx("span",{className:"mono",style:{color:"var(--text-dim)"},children:l})]})]}),r&&t&&t.length>0&&o.jsxs("div",{className:"mt-3 pt-3",style:{borderTop:"1px solid var(--border)"},children:[o.jsx("p",{className:"text-xs mb-1",style:{color:"var(--text-muted)"},children:"Cumulative P&L"}),o.jsx(er,{width:"100%",height:80,children:o.jsxs(Qy,{data:t,children:[o.jsx(ir,{dataKey:"date",hide:!0}),o.jsx(or,{hide:!0,domain:["dataMin","dataMax"]}),o.jsx(Ge,{contentStyle:{background:"var(--surface-el)",border:"1px solid var(--border)",borderRadius:8,fontSize:11,fontFamily:"var(--font-mono)"},formatter:p=>[`$${(p/100).toFixed(2)}`,"P&L"],labelFormatter:p=>p}),o.jsx(Ir,{type:"monotone",dataKey:"cumulative",stroke:d,fill:d,fillOpacity:.1,strokeWidth:1.5,dot:!1})]})}),e.description&&o.jsx("p",{className:"text-xs mt-1",style:{color:"var(--text-muted)"},children:e.description}),o.jsxs("div",{className:"mt-3 pt-3",style:{borderTop:"1px solid var(--border)"},children:[o.jsx("p",{className:"text-xs mb-2 font-semibold",style:{color:"var(--cyan)"},children:"Individual Trades"}),o.jsx(Cj,{trades:a,loading:i})]})]}),r&&(!t||t.length===0)&&o.jsxs("div",{className:"mt-3 pt-3",style:{borderTop:"1px solid var(--border)"},children:[o.jsx("p",{className:"text-xs mb-2 font-semibold",style:{color:"var(--cyan)"},children:"Individual Trades"}),o.jsx(Cj,{trades:a,loading:i})]})]})}function PZ(){return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"w-9 h-9 rounded-full border-2 animate-spin",style:{borderColor:"var(--border)",borderTopColor:"var(--cyan)"}})})}function AZ(){const[e,t]=P.useState([]),[r,n]=P.useState({}),[a,i]=P.useState(!0),[s,l]=P.useState("all"),[c,u]=P.useState("pnl"),[f,d]=P.useState(null),[h,p]=P.useState({}),[g,y]=P.useState(null);P.useEffect(()=>{b()},[]);async function b(){try{const[N,k]=await Promise.all([Oe("/portfolios"),Oe("/portfolio-trades?include_history=true").catch(()=>({}))]);t(N||[]),k!=null&&k.byPortfolio&&n(k.byPortfolio)}catch{}i(!1)}async function v(N){if(!h[N]){y(N);try{const k=await Oe(`/portfolio-trades?portfolio_id=${N}`);p(E=>({...E,[N]:Array.isArray(k)?k:[]}))}catch{p(k=>({...k,[N]:[]}))}y(null)}}function m(N){f===N?d(null):(d(N),v(N))}const x=P.useMemo(()=>{let N=[...e];return s==="active"&&(N=N.filter(k=>k.trades_won+k.trades_lost>0)),s==="dormant"&&(N=N.filter(k=>k.trades_won+k.trades_lost===0)),s==="etf"&&(N=N.filter(k=>k.strategy.startsWith("etf_"))),s==="core"&&(N=N.filter(k=>!k.strategy.startsWith("etf_"))),c==="pnl"&&N.sort((k,E)=>E.total_returned_cents-E.total_invested_cents-(k.total_returned_cents-k.total_invested_cents)),c==="winrate"&&N.sort((k,E)=>(E.win_rate||0)-(k.win_rate||0)),c==="invested"&&N.sort((k,E)=>E.total_invested_cents-k.total_invested_cents),c==="name"&&N.sort((k,E)=>k.name.localeCompare(E.name)),c==="id"&&N.sort((k,E)=>k.id-E.id),N},[e,s,c]),S=P.useMemo(()=>{const N=e.reduce((M,I)=>M+I.total_invested_cents,0),k=e.reduce((M,I)=>M+I.total_returned_cents,0),E=e.reduce((M,I)=>M+I.trades_won,0),T=e.reduce((M,I)=>M+I.trades_lost,0),D=e.filter(M=>M.trades_won+M.trades_lost>0).length,A=e.length-D,L=[...e].sort((M,I)=>I.total_returned_cents-I.total_invested_cents-(M.total_returned_cents-M.total_invested_cents))[0],C=[...e].sort((M,I)=>M.total_returned_cents-M.total_invested_cents-(I.total_returned_cents-I.total_invested_cents))[0];return{totalInvested:N,totalReturned:k,totalWins:E,totalLosses:T,active:D,dormant:A,bestPf:L,worstPf:C}},[e]),j=P.useMemo(()=>[...e].map(N=>({name:N.name,pnl:(N.total_returned_cents-N.total_invested_cents)/100,strategy:N.strategy})).filter(N=>N.pnl!==0).sort((N,k)=>k.pnl-N.pnl).slice(0,20),[e]),w=P.useMemo(()=>{const N={};return e.forEach(k=>{const E=k.strategy.startsWith("etf_")?"ETF Baskets":k.strategy;N[E]||(N[E]={name:E,value:0}),N[E].value+=k.total_invested_cents}),Object.values(N).filter(k=>k.value>0).sort((k,E)=>E.value-k.value)},[e]);if(a)return o.jsx(PZ,{});const _=(S.totalReturned-S.totalInvested)/100,O=S.totalWins+S.totalLosses;return o.jsxs("div",{className:"space-y-6 fade-in",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"heading text-3xl",style:{color:"var(--text)"},children:["Portfauxlios",o.jsx("span",{className:"badge bg-cyan ml-3 align-middle text-base",children:e.length})]}),o.jsxs("p",{className:"section-subtitle mt-1",children:["All ",e.length," portfolios — performance, P&L, and strategy breakdown"]})]}),o.jsx("button",{onClick:b,className:"btn btn-o btn-sm",children:"Refresh"})]}),o.jsx("div",{className:"grid grid-cols-3 md:grid-cols-6 gap-3",children:[{label:"Total P&L",value:`${_>=0?"+":""}$${_.toFixed(2)}`,color:_>=0?"var(--green)":"var(--red)"},{label:"Invested",value:`$${(S.totalInvested/100).toFixed(2)}`,color:"var(--orange)"},{label:"Returned",value:`$${(S.totalReturned/100).toFixed(2)}`,color:"var(--blue)"},{label:"Win Rate",value:O?`${(S.totalWins/O*100).toFixed(1)}%`:"0%",color:"var(--purple)"},{label:"Active",value:S.active,color:"var(--green)"},{label:"Dormant",value:S.dormant,color:"var(--text-muted)"}].map(N=>o.jsxs("div",{className:"card text-center",style:{padding:"1rem"},children:[o.jsx("div",{className:"stat-v",style:{color:N.color,fontSize:"1.4rem"},children:N.value}),o.jsx("div",{className:"stat-label mt-1",children:N.label})]},N.label))}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[o.jsxs("div",{className:"card md:col-span-2",children:[o.jsx("h2",{className:"heading text-sm mb-3",style:{color:"var(--text-dim)"},children:"P&L by Portfolio"}),j.length>0?o.jsx(er,{width:"100%",height:220,children:o.jsxs(Sl,{data:j,margin:{left:10,right:10},children:[o.jsx(ir,{dataKey:"name",tick:{fill:"var(--text-muted)",fontSize:9,fontFamily:"var(--font-mono)"},angle:-45,textAnchor:"end",height:60}),o.jsx(or,{tick:{fill:"var(--text-muted)",fontSize:10,fontFamily:"var(--font-mono)"},tickFormatter:N=>`$${N}`}),o.jsx(Ge,{contentStyle:{background:"var(--surface-el)",border:"1px solid var(--border)",borderRadius:8,fontSize:11,fontFamily:"var(--font-mono)"},formatter:N=>[`$${N.toFixed(2)}`,"P&L"]}),o.jsx(rr,{dataKey:"pnl",radius:[4,4,0,0],children:j.map((N,k)=>o.jsx(gr,{fill:N.pnl>=0?"var(--green)":"var(--red)",fillOpacity:.8},k))})]})}):o.jsx("div",{className:"text-center py-10 text-sm",style:{color:"var(--text-muted)"},children:"No P&L data yet"})]}),o.jsxs("div",{className:"card",children:[o.jsx("h2",{className:"heading text-sm mb-3",style:{color:"var(--text-dim)"},children:"Capital Allocation"}),w.length>0?o.jsx(er,{width:"100%",height:220,children:o.jsxs(Xy,{children:[o.jsx(jr,{data:w,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",innerRadius:40,outerRadius:75,paddingAngle:2,strokeWidth:0,children:w.map((N,k)=>o.jsx(gr,{fill:JO(N.name==="ETF Baskets"?"etf_":N.name),fillOpacity:.85},k))}),o.jsx(Ge,{contentStyle:{background:"var(--surface-el)",border:"1px solid var(--border)",borderRadius:8,fontSize:11,fontFamily:"var(--font-mono)"},formatter:N=>[`$${(N/100).toFixed(2)}`,"Invested"]})]})}):o.jsx("div",{className:"text-center py-10 text-sm",style:{color:"var(--text-muted)"},children:"No allocations yet"})]})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[S.bestPf&&o.jsxs("div",{className:"card",style:{borderColor:"rgba(0,195,137,0.25)",background:"var(--green-dim)"},children:[o.jsx("div",{className:"flex items-center gap-2 mb-2",children:o.jsx("span",{className:"badge",style:{background:"var(--green-dim)",color:"var(--green)"},children:"Best Performer"})}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"heading font-bold",style:{color:"var(--text)"},children:S.bestPf.name}),o.jsxs("span",{className:"mono font-bold text-green",children:["+$",((S.bestPf.total_returned_cents-S.bestPf.total_invested_cents)/100).toFixed(2)]})]}),o.jsxs("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:[S.bestPf.strategy," — ",S.bestPf.win_rate||0,"% win rate"]})]}),S.worstPf&&o.jsxs("div",{className:"card",style:{borderColor:"rgba(255,92,92,0.25)",background:"var(--red-dim)"},children:[o.jsx("div",{className:"flex items-center gap-2 mb-2",children:o.jsx("span",{className:"badge",style:{background:"var(--red-dim)",color:"var(--red)"},children:"Worst Performer"})}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"heading font-bold",style:{color:"var(--text)"},children:S.worstPf.name}),o.jsxs("span",{className:"mono font-bold text-red",children:["$",((S.worstPf.total_returned_cents-S.worstPf.total_invested_cents)/100).toFixed(2)]})]}),o.jsxs("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:[S.worstPf.strategy," — ",S.worstPf.win_rate||0,"% win rate"]})]})]}),o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[o.jsx("div",{className:"flex flex-wrap gap-2",children:["all","active","dormant","etf","core"].map(N=>o.jsx("button",{onClick:()=>l(N),className:"px-3 py-1.5 rounded-lg text-xs font-semibold transition",style:s===N?{background:"var(--cyan-dim)",color:"var(--cyan)",border:"1px solid rgba(0,240,255,0.3)"}:{background:"var(--surface-el)",color:"var(--text-muted)",border:"1px solid var(--border)"},children:N==="all"?`All (${e.length})`:N==="active"?`Active (${S.active})`:N==="dormant"?`Dormant (${S.dormant})`:N==="etf"?"ETF Baskets":"Core Strategies"},N))}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Sort:"}),["pnl","winrate","invested","name","id"].map(N=>o.jsx("button",{onClick:()=>u(N),className:"px-2 py-1 rounded text-xs font-medium transition",style:c===N?{color:"var(--cyan)",background:"var(--cyan-dim)"}:{color:"var(--text-muted)"},children:N==="pnl"?"P&L":N==="winrate"?"Win%":N.charAt(0).toUpperCase()+N.slice(1)},N))]})]}),x.length===0?o.jsx("div",{className:"text-center py-16 text-sm",style:{color:"var(--text-muted)"},children:"No portfolios match this filter"}):o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3",children:x.map(N=>{var k;return o.jsx(NZ,{p:N,dailyPnl:((k=r[N.id])==null?void 0:k.daily)||[],expanded:f===N.id,onToggle:()=>m(N.id),pfTrades:h[N.id]||null,pfTradesLoading:g===N.id},N.id)})})]})}const CZ=[{label:"30s",ms:3e4},{label:"1m",ms:6e4},{label:"2m",ms:12e4},{label:"5m",ms:3e5},{label:"8m",ms:48e4},{label:"10m",ms:6e5},{label:"15m",ms:9e5},{label:"30m",ms:18e5},{label:"60m",ms:36e5}];function EZ(e){return e>=36e5?`${e/36e5}h`:e>=6e4?`${e/6e4}m`:`${e/1e3}s`}function $Z(){return o.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"3"}),o.jsx("path",{d:"M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z"})]})}function vh({title:e,children:t}){return o.jsxs("div",{className:"card space-y-4",children:[o.jsx("h2",{className:"heading font-semibold text-base pb-3",style:{color:"var(--text)",borderBottom:"1px solid var(--border)"},children:e}),t]})}function Um({label:e,description:t,children:r}){return o.jsxs("div",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm font-medium",style:{color:"var(--text)"},children:e}),t&&o.jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--text-muted)"},children:t})]}),o.jsx("div",{className:"flex-shrink-0",children:r})]})}function sc({label:e,value:t,onChange:r,description:n}){return o.jsxs("div",{className:"space-y-2",children:[o.jsx(Um,{label:e,description:n,children:o.jsx("span",{className:"mono font-bold text-lg",style:{color:"var(--cyan)"},children:EZ(t)})}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:CZ.map(a=>o.jsx("button",{onClick:()=>r(a.ms),className:"px-2.5 py-1 rounded text-xs font-medium transition",style:t===a.ms?{background:"var(--cyan-dim)",color:"var(--cyan)",border:"1px solid rgba(0,240,255,0.4)"}:{background:"var(--surface-el)",color:"var(--text-muted)",border:"1px solid var(--border)"},children:a.label},a.ms))})]})}function Ej({msg:e}){return e?o.jsx("p",{className:"text-xs px-3 py-2 rounded-lg",style:e.type==="ok"?{background:"var(--green-dim)",color:"var(--green)"}:{background:"var(--red-dim)",color:"var(--red)"},children:e.text}):null}function TZ(){return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"w-9 h-9 rounded-full border-2 animate-spin",style:{borderColor:"var(--border)",borderTopColor:"var(--cyan)"}})})}function MZ(){const[e,t]=P.useState(null),[r,n]=P.useState(!0),[a,i]=P.useState(""),[s,l]=P.useState(""),[c,u]=P.useState("demo"),[f,d]=P.useState(!1),[h,p]=P.useState(null),[g,y]=P.useState(null),[b,v]=P.useState(null),[m,x]=P.useState(!1);P.useEffect(()=>{S(),j();const k=setInterval(j,3e4);return()=>clearInterval(k)},[]);async function S(){try{const k=await me("/kalshi",{action:"status"});t(k),k.env&&u(k.env)}catch{}n(!1)}async function j(){try{const k=await Oe("/scan-config");y(k)}catch{}}async function w(k,E){x(!0),v(null);try{const T=await Oe("/scan-config",{method:"POST",body:JSON.stringify({[k]:E})});T.success?(y(T),v({type:"ok",text:`Updated ${k.replace(/_/g," ")}`})):v({type:"err",text:T.error||"Failed"})}catch{v({type:"err",text:"Connection error"})}x(!1),setTimeout(()=>v(null),3e3)}async function _(){d(!0),p(null);try{const k=await me("/kalshi",{action:"save_keys",api_key:a,private_key:s,env:c});k.success?(p({type:"ok",text:"Keys saved and connected"}),S(),i(""),l("")):p({type:"err",text:k.error||"Failed"})}catch{p({type:"err",text:"Connection error"})}d(!1)}async function O(){try{await me("/kalshi",{action:"disconnect"}),S()}catch{}}async function N(){p(null);try{const k=await me("/kalshi",{action:"test_connection"});p({type:k.success?"ok":"err",text:k.success?`Connected. Exchange: ${k.exchange_status}`:"Connection failed"})}catch{p({type:"err",text:"Connection error"})}}return r?o.jsx(TZ,{}):o.jsxs("div",{className:"space-y-6 fade-in",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-xl",style:{background:"var(--cyan-dim)",color:"var(--cyan)"},children:o.jsx($Z,{})}),o.jsxs("div",{children:[o.jsx("h1",{className:"heading text-3xl",style:{color:"var(--text)"},children:"Settings"}),o.jsx("p",{className:"section-subtitle mt-0.5",children:"Configure scan pipeline, API keys, and risk parameters"})]})]}),g&&o.jsxs(vh,{title:"Scan & Pipeline Configuration",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Adjust intervals, thresholds, and risk parameters in real-time"}),m&&o.jsx("span",{className:"text-xs animate-pulse",style:{color:"var(--orange)"},children:"Saving..."})]}),o.jsx(Ej,{msg:b}),o.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[o.jsx("span",{className:"stat-label",children:"Cached Markets"}),o.jsx("span",{className:"mono font-bold text-xl",style:{color:"var(--cyan)"},children:g.cached_markets||0}),o.jsx("div",{className:"w-2 h-2 rounded-full pulse-cyan ml-auto",style:{background:"var(--cyan)"}})]}),o.jsxs("div",{className:"space-y-5 pt-2 pb-1",style:{borderTop:"1px solid var(--border)"},children:[o.jsx("h3",{className:"text-sm font-semibold pt-3",style:{color:"var(--text-dim)"},children:"Pipeline Intervals"}),o.jsx(sc,{label:"Market Scan",description:"How often to fetch and analyze all active Kalshi markets",value:g.scan_interval_ms,onChange:k=>w("scan_interval_ms",k)}),o.jsx(sc,{label:"Signal Pipeline",description:"News sentiment + probability + Monte Carlo signal generation",value:g.signal_pipeline_ms,onChange:k=>w("signal_pipeline_ms",k)}),o.jsx(sc,{label:"Intelligence Sweep",description:"Reddit, news feeds, Bluesky, Mastodon, Lemmy + 20 more sources",value:g.reddit_interval_ms,onChange:k=>w("reddit_interval_ms",k)}),o.jsx(sc,{label:"Trade Resolution",description:"Take-profit / stop-loss check on open portfolio positions",value:g.resolve_interval_ms,onChange:k=>w("resolve_interval_ms",k)})]}),o.jsxs("div",{className:"space-y-5",style:{borderTop:"1px solid var(--border)",paddingTop:"1rem"},children:[o.jsx("h3",{className:"text-sm font-semibold",style:{color:"var(--text-dim)"},children:"Risk Parameters"}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Um,{label:"Min Edge Threshold",description:"Minimum statistical edge required to approve a signal",children:o.jsxs("span",{className:"mono font-bold text-lg",style:{color:"var(--cyan)"},children:[(g.min_edge_threshold*100).toFixed(1),"%"]})}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:[.01,.02,.03,.05,.08,.1,.15,.2].map(k=>o.jsxs("button",{onClick:()=>w("min_edge_threshold",k),className:"px-2.5 py-1 rounded text-xs font-medium transition",style:Math.abs(g.min_edge_threshold-k)<.001?{background:"var(--cyan-dim)",color:"var(--cyan)",border:"1px solid rgba(0,240,255,0.4)"}:{background:"var(--surface-el)",color:"var(--text-muted)",border:"1px solid var(--border)"},children:[(k*100).toFixed(0),"%"]},k))})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Um,{label:"Min Liquidity (24h Vol)",description:"Minimum 24-hour trading volume to consider a market",children:o.jsx("span",{className:"mono font-bold text-lg",style:{color:"var(--cyan)"},children:g.min_liquidity})}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:[0,10,25,50,100,250,500,1e3].map(k=>o.jsx("button",{onClick:()=>w("min_liquidity",k),className:"px-2.5 py-1 rounded text-xs font-medium transition",style:g.min_liquidity===k?{background:"var(--cyan-dim)",color:"var(--cyan)",border:"1px solid rgba(0,240,255,0.4)"}:{background:"var(--surface-el)",color:"var(--text-muted)",border:"1px solid var(--border)"},children:k===0?"None":k},k))})]})]})]}),o.jsxs(vh,{title:"API Configuration",children:[o.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[o.jsx("div",{className:`w-2.5 h-2.5 rounded-full ${e!=null&&e.connected?"pulse-cyan":""}`,style:{background:e!=null&&e.connected?"var(--cyan)":"var(--text-muted)"}}),o.jsx("span",{className:"text-sm font-semibold",style:{color:e!=null&&e.connected?"var(--cyan)":"var(--text-muted)"},children:e!=null&&e.connected?"Connected":"Not Connected"})]}),e!=null&&e.connected?o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"rounded-xl px-4 py-3 space-y-2",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[o.jsxs("div",{className:"flex justify-between text-sm",children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"API Key"}),o.jsx("span",{className:"mono",style:{color:"var(--text)"},children:e.api_key_masked||"•••••"})]}),o.jsxs("div",{className:"flex justify-between text-sm",children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"Environment"}),o.jsx("span",{className:"mono font-bold",style:{color:e.env==="prod"?"var(--green)":"var(--orange)"},children:(e.env||"demo").toUpperCase()})]})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("button",{onClick:N,className:"btn btn-o btn-sm",children:"Test Connection"}),o.jsx("button",{onClick:O,className:"btn btn-d btn-sm",children:"Disconnect"})]})]}):o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex gap-2",children:[o.jsx("button",{onClick:()=>u("demo"),className:"flex-1 py-2 rounded-xl text-sm font-semibold transition",style:c==="demo"?{background:"var(--orange-dim)",color:"var(--orange)",border:"1px solid rgba(247,147,26,0.4)"}:{background:"var(--surface-el)",color:"var(--text-muted)",border:"1px solid var(--border)"},children:"Demo"}),o.jsx("button",{onClick:()=>u("prod"),className:"flex-1 py-2 rounded-xl text-sm font-semibold transition",style:c==="prod"?{background:"var(--green-dim)",color:"var(--green)",border:"1px solid rgba(0,195,137,0.4)"}:{background:"var(--surface-el)",color:"var(--text-muted)",border:"1px solid var(--border)"},children:"Production"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"stat-label block mb-1.5",children:"API Key ID"}),o.jsx("input",{type:"text",value:a,onChange:k=>i(k.target.value),placeholder:"Your API key",className:"input mono"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"stat-label block mb-1.5",children:"Private Key (PEM)"}),o.jsx("textarea",{value:s,onChange:k=>l(k.target.value),placeholder:"-----BEGIN RSA PRIVATE KEY-----",rows:4,className:"input mono text-xs",style:{resize:"vertical"}})]}),o.jsx("button",{onClick:_,disabled:f||!a,className:"btn btn-p w-full",style:f||!a?{opacity:.5,cursor:"not-allowed"}:{},children:f?"Saving...":"Save & Connect"})]}),o.jsx(Ej,{msg:h})]}),o.jsx(vh,{title:"Ken API Reference",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 text-xs",style:{color:"var(--text-muted)"},children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"stat-label mb-2",children:"Environments"}),o.jsxs("div",{className:"space-y-1",children:[o.jsxs("div",{className:"flex gap-2",children:[o.jsx("span",{children:"Demo:"}),o.jsx("span",{className:"mono",style:{color:"var(--orange)"},children:"demo-api.kalshi.co"})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("span",{children:"Prod:"}),o.jsx("span",{className:"mono",style:{color:"var(--green)"},children:"api.elections.kalshi.com"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"stat-label mb-2",children:"Authentication"}),o.jsxs("div",{className:"space-y-1",children:[o.jsxs("div",{className:"flex gap-2",children:[o.jsx("span",{children:"Method:"}),o.jsx("span",{className:"mono",style:{color:"var(--text-dim)"},children:"RSA-PSS + SHA-256"})]}),o.jsxs("div",{children:[o.jsx("span",{children:"Headers: "}),o.jsx("span",{className:"mono",style:{color:"var(--text-dim)"},children:"KALSHI-ACCESS-KEY, TIMESTAMP, SIGNATURE"})]})]})]})]})})]})}const IZ={BUY_YES:"bg-green",BUY_NO:"bg-red"};function LZ(e){if(!e)return null;const t=e.match(/on\s+"([^"]+)"/);return t?t[1]:null}function DZ({value:e}){const t=Math.max(0,Math.min(100,e*100)),r=e>.7?"var(--green)":e>.5?"var(--orange)":"var(--red)";return o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"progress-bar flex-1",style:{minWidth:64},children:o.jsx("div",{className:"progress-fill",style:{width:`${t}%`,background:`linear-gradient(90deg, ${r}, ${r}cc)`}})}),o.jsxs("span",{className:"mono text-xs",style:{color:"var(--text-dim)"},children:[t.toFixed(0),"%"]})]})}function RZ({s:e}){const[t,r]=P.useState(!1),n=LZ(e.reasoning)||e.market_id,a=parseFloat(e.expected_edge)||0,i=parseFloat(e.confidence)||0;return o.jsxs(o.Fragment,{children:[o.jsxs("tr",{className:"cursor-pointer transition",onClick:()=>r(!t),style:{background:t?"rgba(0,240,255,0.04)":void 0},children:[o.jsx("td",{className:"whitespace-nowrap",children:o.jsx("span",{className:"mono text-xs",style:{color:"var(--text-muted)"},children:new Date(e.created_at).toLocaleTimeString()})}),o.jsxs("td",{className:"max-w-[280px]",children:[o.jsx("a",{href:e.kalshi_url||`https://kalshi.com/search?query=${encodeURIComponent((e.market_id||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"text-sm truncate block hover:underline transition heading",style:{color:"var(--cyan)"},onClick:s=>s.stopPropagation(),children:n}),o.jsx("span",{className:"mono text-[10px]",style:{color:"var(--text-muted)"},children:e.market_id})]}),o.jsx("td",{children:o.jsx("span",{className:`badge ${IZ[e.direction]||"bg-yellow"}`,children:e.direction})}),o.jsx("td",{children:o.jsxs("span",{className:"mono font-bold text-base",style:{color:a>0?"var(--cyan)":"var(--red)"},children:[a>0?"+":"",(a*100).toFixed(1),"%"]})}),o.jsx("td",{children:o.jsx("span",{className:"mono text-sm",style:{color:"var(--text-dim)"},children:e.size_recommendation||"—"})}),o.jsx("td",{style:{minWidth:140},children:o.jsx(DZ,{value:i})}),o.jsx("td",{children:o.jsx("span",{className:`badge ${e.risk_approved?"bg-green":"bg-red"}`,children:e.risk_approved?"APPROVED":"BLOCKED"})}),o.jsx("td",{children:o.jsx("span",{style:{color:"var(--text-muted)"},children:t?"▾":"▸"})})]}),t&&o.jsx("tr",{style:{background:"rgba(0,240,255,0.02)"},children:o.jsxs("td",{colSpan:8,className:"px-4 py-3",children:[o.jsx("p",{className:"text-xs leading-relaxed fade-in",style:{color:"var(--text-dim)"},children:e.reasoning}),e.sources&&o.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:(typeof e.sources=="string"?e.sources.split(","):Array.isArray(e.sources)?e.sources:[]).map((s,l)=>o.jsx("span",{className:"badge bg-blue text-[10px]",children:s.trim()},l))})]})})]})}function BZ({s:e}){const t=parseFloat(e.edge)||0,r=parseFloat(e.sentiment_impact)||0,n=e.market_title||e.market_id;return o.jsxs("tr",{children:[o.jsx("td",{className:"whitespace-nowrap",children:o.jsx("span",{className:"mono text-xs",style:{color:"var(--text-muted)"},children:new Date(e.created_at).toLocaleTimeString()})}),o.jsxs("td",{className:"max-w-[250px]",children:[o.jsx("a",{href:e.kalshi_url||`https://kalshi.com/search?query=${encodeURIComponent((e.market_id||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"text-sm truncate block hover:underline transition heading",style:{color:"var(--cyan)"},children:n}),o.jsx("span",{className:"mono text-[10px]",style:{color:"var(--text-muted)"},children:e.market_id})]}),o.jsx("td",{children:o.jsxs("span",{className:"mono text-sm",style:{color:"var(--text-dim)"},children:[(parseFloat(e.prior_probability)*100).toFixed(1),"%"]})}),o.jsx("td",{children:o.jsxs("span",{className:"mono text-sm font-semibold",style:{color:r>0?"var(--green)":"var(--red)"},children:[r>0?"+":"",(r*100).toFixed(2),"%"]})}),o.jsx("td",{children:o.jsxs("span",{className:"mono text-sm",style:{color:"var(--orange)"},children:[(parseFloat(e.adjusted_probability)*100).toFixed(1),"%"]})}),o.jsx("td",{children:o.jsxs("span",{className:"mono text-sm",style:{color:"var(--text-dim)"},children:[(parseFloat(e.market_probability)*100).toFixed(1),"%"]})}),o.jsx("td",{children:o.jsxs("span",{className:"mono text-sm font-bold",style:{color:t>0?"var(--green)":t<0?"var(--red)":"var(--text-muted)"},children:[t>0?"+":"",(t*100).toFixed(1),"%"]})}),o.jsx("td",{children:o.jsx("span",{className:"mono text-xs",style:{color:"var(--text-muted)"},children:e.num_articles})})]})}function FZ({s:e}){const t=parseFloat(e.avg_sent)||0;return o.jsxs("div",{className:"card flex items-center justify-between",style:{padding:"0.75rem 1rem"},children:[o.jsx("span",{className:"text-sm font-medium heading",children:e.source}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("span",{className:"mono text-xs",style:{color:"var(--text-muted)"},children:[e.cnt," items"]}),o.jsxs("span",{className:"mono text-xs font-bold",style:{color:t>.05?"var(--green)":t<-.05?"var(--red)":"var(--text-muted)"},children:[t>0?"+":"",(t*100).toFixed(0),"%"]})]})]})}function Fa({label:e,value:t,color:r}){return o.jsxs("div",{className:"card",children:[o.jsx("p",{className:"stat-label mb-2",children:e}),o.jsx("p",{className:"stat-v",style:{color:r},children:t})]})}function yh({active:e,onClick:t,children:r}){return o.jsx("button",{onClick:t,className:"btn btn-sm transition",style:{background:e?"var(--cyan-dim)":"transparent",color:e?"var(--cyan)":"var(--text-muted)",border:e?"1px solid rgba(0,240,255,0.3)":"1px solid transparent",borderRadius:"var(--radius-md)"},children:r})}function zZ(){var p,g,y,b,v,m;const[e,t]=P.useState(null),[r,n]=P.useState(null),[a,i]=P.useState(!0),[s,l]=P.useState("signals");P.useEffect(()=>{c();const x=setInterval(c,3e4);return()=>clearInterval(x)},[]);async function c(){try{const[x,S]=await Promise.all([Oe("/signals"),Oe("/signals/dashboard")]);t(x),n(S)}catch{}i(!1)}if(a)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-t-transparent rounded-full pulse-cyan",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})});const u=(r==null?void 0:r.stats)||{},f=(e==null?void 0:e.signals)||[],d=(e==null?void 0:e.probabilityShifts)||[],h=(r==null?void 0:r.sourceBreakdown)||[];return o.jsxs("div",{className:"space-y-6 fade-in",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"text-2xl",style:{color:"var(--cyan)"},children:"⚡"}),o.jsx("h1",{className:"heading text-3xl font-bold",style:{color:"var(--text)"},children:"Signals"}),o.jsxs("span",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"inline-block w-2 h-2 rounded-full pulse-cyan",style:{background:"var(--cyan)"}}),o.jsx("span",{className:"text-xs",style:{color:"var(--cyan)"},children:"LIVE"})]})]}),o.jsxs("p",{className:"section-subtitle mt-1",children:["News → Sentiment → Probability → Signals → Risk · ",((p=e==null?void 0:e.pipeline)==null?void 0:p.cachedMarkets)||0," markets tracked"]})]}),o.jsx("button",{onClick:c,className:"btn btn-o btn-sm",children:"↻ Refresh"})]}),o.jsxs("div",{className:"grid grid-cols-6 gap-3",children:[o.jsx(Fa,{label:"Signals 24h",value:u.total_signals||0,color:"var(--orange)"}),o.jsx(Fa,{label:"Approved",value:u.approved_signals||0,color:"var(--green)"}),o.jsx(Fa,{label:"BUY YES",value:u.buy_yes||0,color:"var(--green)"}),o.jsx(Fa,{label:"BUY NO",value:u.buy_no||0,color:"var(--red)"}),o.jsx(Fa,{label:"Avg Edge",value:u.avg_edge?`${(u.avg_edge*100).toFixed(1)}%`:"—",color:"var(--cyan)"}),o.jsx(Fa,{label:"Avg Confidence",value:u.avg_confidence?`${(u.avg_confidence*100).toFixed(0)}%`:"—",color:"var(--blue)"})]}),o.jsxs("div",{className:"flex gap-2 pb-3",style:{borderBottom:"1px solid var(--border)"},children:[o.jsxs(yh,{active:s==="signals",onClick:()=>l("signals"),children:["Strategy Signals (",f.length,")"]}),o.jsxs(yh,{active:s==="shifts",onClick:()=>l("shifts"),children:["Probability Shifts (",d.length,")"]}),o.jsxs(yh,{active:s==="sources",onClick:()=>l("sources"),children:["Source Breakdown (",h.length,")"]})]}),s==="signals"&&o.jsx("div",{className:"card overflow-x-auto fade-in",style:{padding:0},children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Time"}),o.jsx("th",{children:"Market"}),o.jsx("th",{children:"Direction"}),o.jsx("th",{children:"Edge"}),o.jsx("th",{children:"Size"}),o.jsx("th",{children:"Confidence"}),o.jsx("th",{children:"Risk"}),o.jsx("th",{})]})}),o.jsx("tbody",{children:f.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:8,className:"text-center py-12",style:{color:"var(--text-muted)"},children:o.jsxs("div",{className:"flex flex-col items-center gap-2",children:[o.jsx("span",{className:"text-2xl",children:"⚡"}),o.jsx("span",{className:"text-sm",children:"No signals generated yet"})]})})}):f.map(x=>o.jsx(RZ,{s:x},x.id))})]})}),s==="shifts"&&o.jsx("div",{className:"card overflow-x-auto fade-in",style:{padding:0},children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Time"}),o.jsx("th",{children:"Market"}),o.jsx("th",{children:"Prior"}),o.jsx("th",{children:"Impact"}),o.jsx("th",{children:"Adjusted"}),o.jsx("th",{children:"Market Price"}),o.jsx("th",{children:"Edge"}),o.jsx("th",{children:"Articles"})]})}),o.jsx("tbody",{children:d.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:8,className:"text-center py-12",style:{color:"var(--text-muted)"},children:o.jsxs("div",{className:"flex flex-col items-center gap-2",children:[o.jsx("span",{className:"text-2xl",children:"📊"}),o.jsx("span",{className:"text-sm",children:"No probability shifts yet"})]})})}):d.map((x,S)=>o.jsx(BZ,{s:x},S))})]})}),s==="sources"&&o.jsxs("div",{className:"grid grid-cols-2 gap-4 fade-in",children:[o.jsxs("div",{children:[o.jsxs("p",{className:"section-title mb-3",style:{fontSize:"1rem"},children:["Active Sources",o.jsx("span",{className:"badge bg-cyan ml-2",children:h.length})]}),o.jsx("div",{className:"space-y-2",children:h.length===0?o.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"No recent source data"}):h.map((x,S)=>o.jsx(FZ,{s:x},S))})]}),o.jsxs("div",{children:[o.jsx("p",{className:"section-title mb-3",style:{fontSize:"1rem"},children:"Pipeline Config"}),o.jsx("div",{className:"card space-y-2",children:[{label:"Market Scan",value:"Every 15 min"},{label:"Signal Pipeline",value:"Every 5 min"},{label:"Intelligence Sweep",value:"Every 30 min"},{label:"Min Edge Threshold",value:`${((((y=(g=e==null?void 0:e.pipeline)==null?void 0:g.riskLimits)==null?void 0:y.minEdgeThreshold)||.05)*100).toFixed(0)}%`,highlight:!0},{label:"Min Liquidity",value:`${((v=(b=e==null?void 0:e.pipeline)==null?void 0:b.riskLimits)==null?void 0:v.minLiquidity)||100} vol`,highlight:!0},{label:"Cached Markets",value:((m=e==null?void 0:e.pipeline)==null?void 0:m.cachedMarkets)||0,highlight:!0}].map(x=>o.jsxs("div",{className:"flex justify-between items-center p-2 rounded",style:{background:"var(--surface-el)"},children:[o.jsx("span",{className:"text-sm",style:{color:"var(--text-muted)"},children:x.label}),o.jsx("span",{className:"mono text-sm font-semibold",style:{color:x.highlight?"var(--cyan)":"var(--text)"},children:x.value})]},x.label))})]})]})]})}const $j={reddit_hot:"🔴",reddit:"📋",google_news:"📰",hackernews:"🟠",metaculus:"🔮",manifold:"📊",gdelt_tv:"📺",youtube:"▶️",lemmy:"🟢",lobsters:"🦞",tildes:"~",bluesky:"🦋",mastodon:"🐘",predictit:"💰",fred:"📈",nws:"⛈️",govtrack:"🏛️",discord:"💬"};function WZ(e){return["reddit_hot","reddit","lemmy"].includes(e)?"bg-red":["google_news","govtrack","nws"].includes(e)?"bg-blue":["metaculus","manifold","predictit"].includes(e)?"bg-purple":["hackernews","lobsters","tildes"].includes(e)?"bg-orange":["fred"].includes(e)?"bg-green":["bluesky","mastodon","discord"].includes(e)?"bg-cyan":"bg-blue"}function UZ({value:e}){const t=parseFloat(e)||0;return t>.1?o.jsxs("span",{className:"badge bg-cyan",children:["+",(t*100).toFixed(0),"%"]}):t<-.1?o.jsxs("span",{className:"badge bg-red",children:[(t*100).toFixed(0),"%"]}):o.jsxs("span",{className:"badge bg-orange",children:[(t*100).toFixed(0),"%"]})}function za({col:e,label:t,sortCol:r,sortDir:n,onSort:a}){const i=r===e;return o.jsx("th",{onClick:()=>a(e),className:"cursor-pointer select-none transition",style:{color:i?"var(--cyan)":void 0},children:o.jsxs("span",{className:"flex items-center gap-1",children:[t,i?o.jsx("span",{style:{color:"var(--cyan)"},children:n==="asc"?"▲":"▼"}):o.jsx("span",{style:{color:"var(--border-light)"},children:"⇅"})]})})}function lc({label:e,value:t,color:r}){return o.jsxs("div",{className:"card",children:[o.jsx("p",{className:"stat-label mb-2",children:e}),o.jsx("p",{className:"stat-v",style:{color:r},children:t})]})}function HZ(){const[e,t]=P.useState(null),[r,n]=P.useState(!0),[a,i]=P.useState(""),[s,l]=P.useState("captured_at"),[c,u]=P.useState("desc");P.useEffect(()=>{f();const S=setInterval(f,6e4);return()=>clearInterval(S)},[]);async function f(){try{const S=await Oe("/intelligence");t(S)}catch{}n(!1)}function d(S){s===S?u(j=>j==="asc"?"desc":"asc"):(l(S),u(S==="captured_at"?"desc":"asc"))}if(r)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-t-transparent rounded-full pulse-cyan",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})});const h=(e==null?void 0:e.totals)||{},p=(e==null?void 0:e.sourceCounts)||[],g=((e==null?void 0:e.recent)||[]).filter(S=>!a||S.source.toLowerCase().includes(a.toLowerCase())||(S.post_title||"").toLowerCase().includes(a.toLowerCase())||(S.keyword||"").toLowerCase().includes(a.toLowerCase()));function y(S,j){let w,_;switch(s){case"captured_at":w=new Date(S.captured_at),_=new Date(j.captured_at);break;case"source":w=S.source||"",_=j.source||"";break;case"keyword":w=S.keyword||S.subreddit||"",_=j.keyword||j.subreddit||"";break;case"post_title":w=(S.post_title||"").toLowerCase(),_=(j.post_title||"").toLowerCase();break;case"score":w=Number(S.score||0),_=Number(j.score||0);break;case"sentiment":w=parseFloat(S.sentiment_score||0),_=parseFloat(j.sentiment_score||0);break;default:return 0}return w<_?c==="asc"?-1:1:w>_?c==="asc"?1:-1:0}const b=[...g].sort(y),v=parseFloat(h.avg_sentiment_1h)||0,m=v>0?"var(--green)":v<0?"var(--red)":"var(--text-muted)",x={sortCol:s,sortDir:c,onSort:d};return o.jsxs("div",{className:"space-y-6 fade-in",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"text-2xl",style:{color:"var(--cyan)"},children:"⚗"}),o.jsx("h1",{className:"heading text-3xl font-bold",style:{color:"var(--text)"},children:"Intel Feed"}),o.jsxs("span",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"inline-block w-2 h-2 rounded-full pulse-cyan",style:{background:"var(--cyan)"}}),o.jsx("span",{className:"text-xs",style:{color:"var(--cyan)"},children:"LIVE"})]})]}),o.jsx("p",{className:"section-subtitle mt-1",children:"Real-time data from 20+ sources"})]}),o.jsx("button",{onClick:f,className:"btn btn-o btn-sm",children:"↻ Refresh"})]}),o.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[o.jsx(lc,{label:"Total Items",value:Number(h.total_items||0).toLocaleString(),color:"var(--orange)"}),o.jsx(lc,{label:"Last Hour",value:h.last_hour||0,color:"var(--green)"}),o.jsx(lc,{label:"Last 4 Hours",value:h.last_4h||0,color:"var(--blue)"}),o.jsx(lc,{label:"Avg Sentiment 1h",value:h.avg_sentiment_1h?`${(v*100).toFixed(1)}%`:"—",color:m})]}),o.jsxs("div",{className:"card",style:{padding:"1rem"},children:[o.jsx("p",{className:"section-title mb-3",style:{fontSize:"0.9rem"},children:"Active Sources"}),o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsx("button",{onClick:()=>i(""),className:"badge transition cursor-pointer",style:{background:a?"rgba(42,42,53,0.6)":"var(--cyan-dim)",color:a?"var(--text-muted)":"var(--cyan)",border:a?"1px solid var(--border)":"1px solid rgba(0,240,255,0.3)"},children:"All"}),p.map((S,j)=>{const w=a===S.source,_=parseFloat(S.avg_sent)||0;return o.jsxs("button",{onClick:()=>i(w?"":S.source),className:"badge transition cursor-pointer",style:{background:w?"var(--cyan-dim)":"rgba(42,42,53,0.6)",color:w?"var(--cyan)":"var(--text-muted)",border:w?"1px solid rgba(0,240,255,0.3)":"1px solid var(--border)"},children:[o.jsx("span",{children:$j[S.source]||"📡"}),o.jsx("span",{className:"font-medium",children:S.source}),o.jsx("span",{style:{color:"var(--text-muted)",opacity:.7},children:S.cnt}),o.jsxs("span",{className:"mono",style:{color:_>.05?"var(--green)":_<-.05?"var(--red)":"var(--text-muted)"},children:[_>0?"+":"",(_*100).toFixed(0),"%"]})]},j)})]})]}),o.jsxs("div",{className:"relative",children:[o.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm pointer-events-none",style:{color:"var(--text-muted)"},children:"⌕"}),o.jsx("input",{type:"text",value:a,onChange:S=>i(S.target.value),placeholder:"Filter by source, keyword, or title...",className:"input pl-8"})]}),o.jsxs("div",{className:"card overflow-x-auto",style:{padding:0},children:[o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx(za,{col:"captured_at",label:"Time",...x}),o.jsx(za,{col:"source",label:"Source",...x}),o.jsx(za,{col:"keyword",label:"Topic",...x}),o.jsx(za,{col:"post_title",label:"Headline",...x}),o.jsx(za,{col:"score",label:"Score",...x}),o.jsx(za,{col:"sentiment",label:"Sentiment",...x})]})}),o.jsx("tbody",{children:b.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:6,className:"text-center py-12",style:{color:"var(--text-muted)"},children:o.jsxs("div",{className:"flex flex-col items-center gap-2",children:[o.jsx("span",{className:"text-2xl",children:"⚗"}),o.jsx("span",{className:"text-sm",children:"No items match your filter"})]})})}):b.slice(0,50).map((S,j)=>(parseFloat(S.sentiment_score),o.jsxs("tr",{children:[o.jsx("td",{className:"whitespace-nowrap",children:o.jsx("span",{className:"mono text-xs",style:{color:"var(--text-muted)"},children:new Date(S.captured_at).toLocaleTimeString()})}),o.jsx("td",{children:o.jsxs("span",{className:`badge ${WZ(S.source)}`,children:[$j[S.source]||"📡"," ",S.source]})}),o.jsx("td",{children:o.jsx("span",{className:"text-xs",style:{color:"var(--text-dim)"},children:S.keyword||S.subreddit||"—"})}),o.jsx("td",{className:"max-w-[400px]",children:S.post_url?o.jsx("a",{href:S.post_url,target:"_blank",rel:"noopener noreferrer",className:"text-sm truncate block hover:underline transition heading",style:{color:"var(--text)"},children:S.post_title}):o.jsx("span",{className:"text-sm truncate block heading",style:{color:"var(--text)"},children:S.post_title})}),o.jsx("td",{children:o.jsxs("span",{className:"mono text-xs",style:{color:"var(--text-dim)"},children:[S.score||0,S.num_comments?o.jsxs("span",{style:{color:"var(--text-muted)"},children:[" / ",S.num_comments,"c"]}):null]})}),o.jsx("td",{children:o.jsx(UZ,{value:S.sentiment_score})})]},j)))})]}),b.length>0&&o.jsxs("div",{className:"px-4 py-3 text-xs",style:{color:"var(--text-muted)",borderTop:"1px solid var(--border)"},children:["Showing ",Math.min(50,b.length)," of ",b.length," items",a&&` matching "${a}"`]})]})]})}function Wa({label:e,value:t,color:r}){return o.jsxs("div",{className:"card",children:[o.jsx("p",{className:"stat-label mb-2",children:e}),o.jsx("p",{className:"stat-v",style:{color:r},children:t})]})}function _t({label:e,value:t,highlight:r}){return o.jsxs("div",{className:"flex justify-between items-center px-3 py-2 rounded",style:{background:"var(--surface-el)"},children:[o.jsx("span",{className:"text-sm",style:{color:"var(--text-muted)"},children:e}),o.jsx("span",{className:"mono text-sm font-semibold",style:{color:r||"var(--text)"},children:t})]})}function Tj({label:e,active:t,color:r,onClick:n,disabled:a}){return o.jsx("button",{onClick:n,disabled:a,className:"flex-1 py-2 rounded-lg text-sm font-bold transition",style:{background:t?`${r}22`:"var(--surface-el)",color:t?r:"var(--text-muted)",border:`1px solid ${t?r+"55":"var(--border)"}`},children:e})}function KZ(){const[e,t]=P.useState(null),[r,n]=P.useState(null),[a,i]=P.useState(null),[s,l]=P.useState(!0),[c,u]=P.useState("");P.useEffect(()=>{f();const x=setInterval(f,15e3);return()=>clearInterval(x)},[]);async function f(){try{const[x,S,j]=await Promise.all([me("/trading/mode",{action:"get"}),Oe("/trading/history"),Oe("/system")]);t(x),n(S),i(j)}catch{}l(!1)}async function d(x,S={}){u(x);try{await me("/trading/mode",{action:x,...S}),await f()}catch{}u("")}if(s)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-t-transparent rounded-full pulse-cyan",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})});const h=(e==null?void 0:e.trade_config)||{},p=(e==null?void 0:e.trader_state)||{},g=(r==null?void 0:r.summary)||{},y=(r==null?void 0:r.trades)||[],b=(a==null?void 0:a.memory)||{},v=parseInt(g.total_pnl||0),m=v>0?"var(--green)":v<0?"var(--red)":"var(--text-muted)";return o.jsxs("div",{className:"space-y-6 fade-in",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"text-2xl",style:{color:"var(--green)"},children:"$"}),o.jsx("h1",{className:"heading text-3xl font-bold",style:{color:"var(--text)"},children:"Trading"}),o.jsx("span",{className:`badge ${(e==null?void 0:e.env)==="prod"?"bg-green":"bg-orange"}`,children:((e==null?void 0:e.env)||"demo").toUpperCase()}),(e==null?void 0:e.safe_mode)&&o.jsx("span",{className:"badge bg-orange",children:"SAFE MODE"}),(e==null?void 0:e.auto_trader_enabled)&&o.jsx("span",{className:"badge bg-green",children:"AUTO ON"})]}),o.jsx("p",{className:"section-subtitle mt-1",children:"Mode control, execution, and P&L"})]}),o.jsx("button",{onClick:f,className:"btn btn-o btn-sm",children:"↻ Refresh"})]}),o.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[o.jsxs("div",{className:"card-glow",children:[o.jsx("p",{className:"stat-label mb-3",children:"Environment"}),o.jsxs("div",{className:"flex gap-2 mb-3",children:[o.jsx(Tj,{label:"DEMO",active:(e==null?void 0:e.env)==="demo",color:"var(--orange)",onClick:()=>d("switch_env",{env:"demo"}),disabled:c==="switch_env"}),o.jsx(Tj,{label:"PROD",active:(e==null?void 0:e.env)==="prod",color:"var(--green)",onClick:()=>d("switch_env",{env:"prod"}),disabled:c==="switch_env"})]}),o.jsxs("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:["API keys: ",e!=null&&e.kalshi_connected?o.jsx("span",{style:{color:"var(--green)"},children:"Configured"}):o.jsx("span",{style:{color:"var(--red)"},children:"Not set"})]})]}),o.jsxs("div",{className:"card-glow",children:[o.jsx("p",{className:"stat-label mb-3",children:"Safe Mode"}),o.jsx("button",{onClick:()=>d("toggle_safe_mode"),disabled:c==="toggle_safe_mode",className:"btn w-full btn-lg font-bold transition",style:{background:e!=null&&e.safe_mode?"rgba(247,147,26,0.15)":"var(--red-dim)",color:e!=null&&e.safe_mode?"var(--orange)":"var(--red)",border:`1px solid ${e!=null&&e.safe_mode?"rgba(247,147,26,0.4)":"rgba(255,92,92,0.4)"}`},children:c==="toggle_safe_mode"?"...":e!=null&&e.safe_mode?"SAFE MODE — ON":"SAFE MODE — OFF"}),o.jsx("p",{className:"text-xs mt-2",style:{color:"var(--text-muted)"},children:e!=null&&e.safe_mode?"No real orders will be placed":o.jsx("span",{style:{color:"var(--red)"},children:"Real orders will be executed!"})})]}),o.jsxs("div",{className:"card-glow",children:[o.jsx("p",{className:"stat-label mb-3",children:"Auto Trader"}),o.jsx("button",{onClick:()=>d("toggle_auto_trader"),disabled:c==="toggle_auto_trader",className:"btn w-full btn-lg font-bold transition",style:{background:e!=null&&e.auto_trader_enabled?"var(--green-dim)":"var(--surface-el)",color:e!=null&&e.auto_trader_enabled?"var(--green)":"var(--text-muted)",border:`1px solid ${e!=null&&e.auto_trader_enabled?"rgba(0,195,137,0.4)":"var(--border)"}`},children:c==="toggle_auto_trader"?"...":e!=null&&e.auto_trader_enabled?"AUTO TRADER: ON":"AUTO TRADER: OFF"}),o.jsxs("p",{className:"text-xs mt-2",style:{color:"var(--text-muted)"},children:["Min confidence: ",o.jsxs("span",{className:"mono",children:[h.min_confidence,"%"]})," · Budget: ",o.jsxs("span",{className:"mono",children:["$",(h.budget_cents/100).toFixed(0)]})]})]})]}),o.jsxs("div",{className:"grid grid-cols-6 gap-3",children:[o.jsx(Wa,{label:"Total Trades",value:g.total_trades||0,color:"var(--orange)"}),o.jsx(Wa,{label:"Open",value:g.open_trades||0,color:"var(--blue)"}),o.jsx(Wa,{label:"Wins",value:g.winning_trades||0,color:"var(--green)"}),o.jsx(Wa,{label:"Losses",value:g.losing_trades||0,color:"var(--red)"}),o.jsx(Wa,{label:"Total P&L",value:g.total_pnl?`$${(v/100).toFixed(2)}`:"$0.00",color:m}),o.jsx(Wa,{label:"Exposure",value:`$${(parseInt(g.open_exposure||0)/100).toFixed(2)}`,color:"var(--purple)"})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"card",children:[o.jsxs("p",{className:"section-title mb-3",style:{fontSize:"1rem"},children:[o.jsx("span",{style:{color:"var(--cyan)"},children:"⚙"})," Trade Config"]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(_t,{label:"Budget",value:`$${(h.budget_cents/100).toFixed(0)}`,highlight:"var(--cyan)"}),o.jsx(_t,{label:"Max per trade",value:`$${(h.max_position_cents/100).toFixed(0)}`}),o.jsx(_t,{label:"Max positions",value:h.max_open_positions}),o.jsx(_t,{label:"Daily loss limit",value:`$${(h.daily_loss_limit_cents/100).toFixed(0)}`,highlight:"var(--red)"}),o.jsx(_t,{label:"Min confidence",value:`${h.min_confidence}%`,highlight:"var(--orange)"}),o.jsx(_t,{label:"Take profit",value:`${h.take_profit_pct}%`,highlight:"var(--green)"}),o.jsx(_t,{label:"Stop loss",value:`${h.stop_loss_pct}%`,highlight:"var(--red)"})]})]}),o.jsxs("div",{className:"card",children:[o.jsxs("p",{className:"section-title mb-3",style:{fontSize:"1rem"},children:[o.jsx("span",{style:{color:"var(--cyan)"},children:"♥"})," System Health"]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(_t,{label:"Memory (RSS)",value:`${b.rss_mb||"?"} MB`}),o.jsx(_t,{label:"Heap Used",value:`${b.heapUsed_mb||"?"} MB`}),o.jsx(_t,{label:"Heap Total",value:`${b.heapTotal_mb||"?"} MB`}),o.jsx(_t,{label:"Uptime",value:`${(a==null?void 0:a.uptime_hours)||"?"}h`,highlight:"var(--blue)"}),o.jsx(_t,{label:"Cached Markets",value:(a==null?void 0:a.cachedMarkets)||0,highlight:"var(--cyan)"}),o.jsx(_t,{label:"PID",value:(a==null?void 0:a.pid)||"?"}),o.jsx(_t,{label:"Available Budget",value:`$${((p.available||0)/100).toFixed(2)}`,highlight:"var(--green)"})]})]})]}),o.jsxs("div",{className:"card overflow-x-auto",style:{padding:0},children:[o.jsxs("div",{className:"flex items-center justify-between px-5 py-4",style:{borderBottom:"1px solid var(--border)"},children:[o.jsxs("p",{className:"section-title",style:{fontSize:"1rem"},children:[o.jsx("span",{style:{color:"var(--orange)"},children:"◈"})," Trade History"]}),y.length>0&&o.jsxs("span",{className:"badge bg-orange",children:[y.length," trades"]})]}),o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Time"}),o.jsx("th",{children:"Market"}),o.jsx("th",{children:"Side"}),o.jsx("th",{children:"Qty"}),o.jsx("th",{children:"Entry"}),o.jsx("th",{children:"Exit"}),o.jsx("th",{children:"P&L"}),o.jsx("th",{children:"Type"}),o.jsx("th",{children:"Status"})]})}),o.jsx("tbody",{children:y.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:9,className:"text-center py-12",style:{color:"var(--text-muted)"},children:o.jsxs("div",{className:"flex flex-col items-center gap-2",children:[o.jsx("span",{className:"text-2xl",style:{color:"var(--text-muted)"},children:"$"}),o.jsx("span",{className:"text-sm",children:"No trades yet — signals are generating, waiting for execution"})]})})}):y.map((x,S)=>{const j=parseInt(x.pnl_cents)||0,w=j>0?"var(--green)":j<0?"var(--red)":"var(--text-muted)",_=x.status==="open"?"bg-blue":x.status==="profit"?"bg-green":x.status==="stopped"?"bg-red":"bg-orange";return o.jsxs("tr",{children:[o.jsx("td",{className:"whitespace-nowrap",children:o.jsxs("span",{className:"mono text-xs",style:{color:"var(--text-muted)"},children:[new Date(x.created_at).toLocaleDateString()," ",new Date(x.created_at).toLocaleTimeString()]})}),o.jsx("td",{className:"max-w-[200px]",children:o.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent((x.ticker||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"text-sm truncate block hover:underline transition heading",style:{color:"var(--cyan)"},children:x.title||x.ticker})}),o.jsx("td",{children:o.jsx("span",{className:`badge ${x.side==="yes"?"bg-green":"bg-red"}`,children:(x.side||"").toUpperCase()})}),o.jsx("td",{children:o.jsx("span",{className:"mono text-sm",style:{color:"var(--text-dim)"},children:x.count})}),o.jsx("td",{children:o.jsxs("span",{className:"mono text-sm",style:{color:"var(--text-dim)"},children:[x.price_cents,"c"]})}),o.jsx("td",{children:o.jsx("span",{className:"mono text-sm",style:{color:x.exit_price?"var(--text-dim)":"var(--text-muted)"},children:x.exit_price?`${x.exit_price}c`:"—"})}),o.jsx("td",{children:o.jsx("span",{className:"mono text-sm font-bold",style:{color:w},children:j!==0?`${j>0?"+":""}$${(j/100).toFixed(2)}`:"—"})}),o.jsx("td",{children:o.jsx("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:x.signal_type})}),o.jsx("td",{children:o.jsx("span",{className:`badge ${_}`,children:x.status})})]},S)})})]})]})]})}function Mj({value:e=0,size:t=48,strokeWidth:r=4,color:n="var(--cyan)",label:a,showValue:i=!0}){const[s,l]=P.useState(0),c=P.useRef(null),u=P.useRef(null),f=900;P.useEffect(()=>{const b=Math.min(100,Math.max(0,e)),v=s,m=x=>{u.current||(u.current=x);const S=x-u.current,j=Math.min(1,S/f),w=1-Math.pow(1-j,3);l(v+(b-v)*w),j<1&&(c.current=requestAnimationFrame(m))};return u.current=null,c.current=requestAnimationFrame(m),()=>cancelAnimationFrame(c.current)},[e]);const d=(t-r)/2,h=2*Math.PI*d,p=h-s/100*h,g=t/2,y=t<=40?t*.22:t*.2;return o.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:4},children:[o.jsxs("div",{style:{position:"relative",width:t,height:t},children:[o.jsxs("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,style:{display:"block"},children:[o.jsx("circle",{cx:g,cy:g,r:d,fill:"none",stroke:"var(--border)",strokeWidth:r}),o.jsx("circle",{cx:g,cy:g,r:d,fill:"none",stroke:n,strokeWidth:r,strokeLinecap:"round",strokeDasharray:h,strokeDashoffset:p,style:{transformOrigin:`${g}px ${g}px`,transform:"rotate(-90deg)",filter:`drop-shadow(0 0 3px ${n}80)`}})]}),i&&o.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontWeight:700,fontSize:y,color:n,lineHeight:1,letterSpacing:"-0.03em"},children:[Math.round(s),"%"]})})]}),a&&o.jsx("span",{style:{fontFamily:"var(--font-body)",fontSize:"0.6rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em",color:"var(--text-muted)"},children:a})]})}function VZ({categories:e}){const t=Object.entries(e||{});if(!t.length)return null;const r=t.map(([s,l],c)=>{const f=(Array.isArray(l)?l:[]).reduce((d,h)=>d+(h.pnl||0),0);return{name:s,value:Math.max(Math.abs(f),1),rawPnl:f,color:Sj[c%Sj.length]}}).filter(s=>Math.abs(s.rawPnl)>0).sort((s,l)=>l.value-s.value),n=t.reduce((s,[,l])=>{const c=Array.isArray(l)?l:[];return s+c.reduce((u,f)=>u+(f.pnl||0),0)},0),a=({active:s,payload:l})=>{var u;if(!s||!(l!=null&&l.length))return null;const c=((u=l[0])==null?void 0:u.payload)||{};return o.jsxs("div",{style:{background:"#1C1C24",border:"1px solid #2A2A35",borderRadius:8,padding:"8px 12px",fontSize:12,fontFamily:"'Inter', sans-serif"},children:[o.jsx("p",{style:{color:c.color,fontWeight:700,marginBottom:4},children:c.name}),o.jsxs("p",{className:"mono",style:{color:c.rawPnl>=0?"#00C389":"#FF5C5C",fontWeight:700},children:[c.rawPnl>=0?"+":"","$",(c.rawPnl/100).toFixed(2)]})]})},i=()=>o.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px 14px",justifyContent:"center",marginTop:8},children:r.map(s=>o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5},children:[o.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:s.color,flexShrink:0}}),o.jsx("span",{style:{fontSize:11,color:"#A8A8A8",fontFamily:"'Inter', sans-serif"},children:s.name})]},s.name))});return o.jsxs("div",{className:"card",style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[o.jsx("h3",{className:"section-title",style:{fontSize:"1rem",marginBottom:4,alignSelf:"flex-start"},children:"P&L by Category"}),o.jsxs("div",{style:{position:"relative",width:"100%",height:220},children:[o.jsx(er,{width:"100%",height:"100%",children:o.jsxs(Xy,{children:[o.jsx("defs",{children:r.map(s=>o.jsxs("radialGradient",{id:`donut-grad-${s.name}`,cx:"50%",cy:"50%",r:"50%",children:[o.jsx("stop",{offset:"0%",stopColor:s.color,stopOpacity:.9}),o.jsx("stop",{offset:"100%",stopColor:s.color,stopOpacity:.6})]},s.name))}),o.jsx(jr,{data:r,cx:"50%",cy:"50%",innerRadius:65,outerRadius:95,paddingAngle:2,dataKey:"value",startAngle:90,endAngle:-270,children:r.map((s,l)=>o.jsx(gr,{fill:s.color,fillOpacity:.85,stroke:"transparent"},s.name))}),o.jsx(Ge,{content:o.jsx(a,{})})]})}),o.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:[o.jsx("span",{style:{fontSize:10,color:"#6B7280",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em"},children:"Total P&L"}),o.jsxs("span",{className:"mono",style:{fontSize:20,fontWeight:700,lineHeight:1.2,color:n>=0?"#00C389":"#FF5C5C",textShadow:`0 0 10px ${n>=0?"rgba(0,195,137,0.4)":"rgba(255,92,92,0.4)"}`},children:[n>=0?"+":"","$",Math.abs(n/100).toFixed(0)]})]})]}),o.jsx(i,{})]})}function GZ({categories:e}){const t=Object.entries(e||{});if(!t.length)return null;const r=t.map(([a,i])=>{const s=Array.isArray(i)?i:[],l=s.reduce((d,h)=>d+(h.wins||0),0),c=s.reduce((d,h)=>d+(h.losses||0),0),u=l+c,f=u>0?(l/u*100).toFixed(1):0;return{name:a,wins:l,losses:c,total:u,wr:Number(f)}}).filter(a=>a.total>0).sort((a,i)=>i.total-a.total),n=({active:a,payload:i,label:s})=>{var c;if(!a||!(i!=null&&i.length))return null;const l=((c=i[0])==null?void 0:c.payload)||{};return o.jsxs("div",{style:{background:"#1C1C24",border:"1px solid #2A2A35",borderRadius:8,padding:"10px 14px",fontSize:12,fontFamily:"'Inter', sans-serif",minWidth:150},children:[o.jsx("p",{style:{color:"#E0E0E0",fontWeight:700,marginBottom:6},children:s}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[o.jsx("span",{style:{color:"#6B7280"},children:"Wins"}),o.jsx("span",{className:"mono",style:{color:"#00C389",fontWeight:700},children:l.wins})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[o.jsx("span",{style:{color:"#6B7280"},children:"Losses"}),o.jsx("span",{className:"mono",style:{color:"#FF5C5C",fontWeight:700},children:l.losses})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[o.jsx("span",{style:{color:"#6B7280"},children:"Win Rate"}),o.jsxs("span",{className:"mono",style:{color:l.wr>=50?"#00C389":"#FF5C5C",fontWeight:700},children:[l.wr,"%"]})]})]})]})};return o.jsxs("div",{className:"card",children:[o.jsx("h3",{className:"section-title",style:{fontSize:"1rem",marginBottom:16},children:"Category Win / Loss"}),o.jsx(er,{width:"100%",height:220,children:o.jsxs(Sl,{data:r,margin:{top:4,right:16,left:0,bottom:4},children:[o.jsx(Ma,{strokeDasharray:"3 3",stroke:"#2A2A35",strokeOpacity:.6,vertical:!1}),o.jsx(ir,{dataKey:"name",stroke:"#2A2A35",tick:{fill:"#6B7280",fontSize:10,fontFamily:"'Inter', sans-serif"},tickLine:!1,axisLine:{stroke:"#2A2A35"}}),o.jsx(or,{stroke:"#2A2A35",tick:{fill:"#6B7280",fontSize:11,fontFamily:"'Inter', sans-serif"},tickLine:!1,axisLine:!1,allowDecimals:!1}),o.jsx(Ge,{content:o.jsx(n,{}),cursor:{fill:"rgba(0,240,255,0.04)"}}),o.jsx(rr,{dataKey:"wins",stackId:"a",fill:"#00C389",fillOpacity:.85,radius:[0,0,0,0],maxBarSize:40,name:"Wins"}),o.jsx(rr,{dataKey:"losses",stackId:"a",fill:"#FF5C5C",fillOpacity:.85,radius:[4,4,0,0],maxBarSize:40,name:"Losses"})]})}),o.jsxs("div",{style:{display:"flex",justifyContent:"center",gap:20,marginTop:8},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[o.jsx("div",{style:{width:10,height:10,borderRadius:2,background:"#00C389"}}),o.jsx("span",{style:{fontSize:11,color:"#A8A8A8"},children:"Wins"})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[o.jsx("div",{style:{width:10,height:10,borderRadius:2,background:"#FF5C5C"}}),o.jsx("span",{style:{fontSize:11,color:"#A8A8A8"},children:"Losses"})]})]})]})}const YZ={trump:"Politics",president:"Politics",impeach:"Politics",congress:"Politics",senate:"Politics",house:"Politics",governor:"Politics",election:"Politics",democrat:"Politics",republican:"Politics",vote:"Politics",biden:"Politics",vance:"Politics",cabinet:"Politics",scotus:"Politics",supreme:"Politics",pardon:"Politics",approval:"Politics",poll:"Politics",secretary:"Politics",defense:"Politics",attorney:"Politics",gdp:"Economy",inflation:"Economy",cpi:"Economy",fed:"Economy","interest rate":"Economy",unemployment:"Economy",jobs:"Economy",payroll:"Economy",recession:"Economy",stock:"Economy",sp500:"Economy","s&p":"Economy",nasdaq:"Economy",dow:"Economy",treasury:"Economy",bond:"Economy",debt:"Economy",trade:"Economy",tariff:"Economy",deficit:"Economy",temperature:"Weather",rain:"Weather",snow:"Weather",hurricane:"Weather",weather:"Weather",tornado:"Weather",flood:"Weather",heat:"Weather",cold:"Weather",storm:"Weather",wind:"Weather",precipitation:"Weather",climate:"Weather",bitcoin:"Crypto",btc:"Crypto",ethereum:"Crypto",eth:"Crypto",crypto:"Crypto",token:"Crypto",blockchain:"Crypto",defi:"Crypto",nfl:"Sports",nba:"Sports",mlb:"Sports",nhl:"Sports",soccer:"Sports",tennis:"Sports","super bowl":"Sports",championship:"Sports",game:"Sports",match:"Sports",playoff:"Sports","world series":"Sports",ai:"Tech",spacex:"Tech",tesla:"Tech",apple:"Tech",google:"Tech",meta:"Tech",openai:"Tech",chatgpt:"Tech",tech:"Tech",rocket:"Tech",launch:"Tech",oscar:"Culture",movie:"Culture",tv:"Culture",celebrity:"Culture",grammy:"Culture",award:"Culture",music:"Culture",entertainment:"Culture",oil:"Energy",gas:"Energy",energy:"Energy",solar:"Energy",opec:"Energy",crude:"Energy",coal:"Energy",renewable:"Energy"},Sn={Politics:{bg:"var(--blue)",glow:"rgba(59,130,246,0.3)",hex:"#3B82F6"},Economy:{bg:"var(--green)",glow:"rgba(0,195,137,0.3)",hex:"#00C389"},Weather:{bg:"var(--cyan)",glow:"rgba(0,240,255,0.3)",hex:"#00F0FF"},Crypto:{bg:"var(--orange)",glow:"rgba(247,147,26,0.3)",hex:"#F7931A"},Sports:{bg:"var(--purple)",glow:"rgba(168,85,247,0.3)",hex:"#A855F7"},Tech:{bg:"var(--cyan)",glow:"rgba(0,240,255,0.3)",hex:"#00F0FF"},Culture:{bg:"var(--orange)",glow:"rgba(247,147,26,0.3)",hex:"#F7931A"},Energy:{bg:"var(--orange)",glow:"rgba(247,147,26,0.3)",hex:"#F7931A"},Other:{bg:"var(--text-muted)",glow:"rgba(107,114,128,0.3)",hex:"#6B7280"}};function Ij(e){const t=(e||"").toLowerCase();for(const[r,n]of Object.entries(YZ))if(t.includes(r))return n;return"Other"}function Lj(e){return e>5e4?"var(--green)":e>1e4?"#4ade80":e>1e3?"#86efac":e>0?"#bbf7d0":e===0?"var(--text-muted)":e>-1e3?"#fecaca":e>-1e4?"#f87171":"var(--red)"}function cc(e){return e>5e4?"rgba(0,195,137,0.35)":e>1e4?"rgba(0,195,137,0.25)":e>1e3?"rgba(0,195,137,0.15)":e>0?"rgba(0,195,137,0.08)":e===0?"rgba(107,114,128,0.15)":e>-1e3?"rgba(255,92,92,0.08)":e>-1e4?"rgba(255,92,92,0.15)":"rgba(255,92,92,0.30)"}function ua(e,t,r,n,a){if(!e.length)return[];if(e.length===1)return[{...e[0],x:t,y:r,w:n,h:a}];const i=e.reduce((p,g)=>p+g.size,0);if(i===0)return e.map(p=>({...p,x:t,y:r,w:0,h:0}));let s=0,l=0;const c=i*.5;for(let p=0;p<e.length;p++)if(s+=e[p].size,s>=c){l=p+1;break}l===0&&(l=1),l>=e.length&&(l=e.length-1);const u=e.slice(0,l),f=e.slice(l),h=u.reduce((p,g)=>p+g.size,0)/i;if(n>=a){const p=n*h;return[...ua(u,t,r,p,a),...ua(f,t+p,r,n-p,a)]}else{const p=a*h;return[...ua(u,t,r,n,p),...ua(f,t,r+p,n,a-p)]}}function ZO({item:e,onClick:t,isSelected:r}){const n=(e.pnl/100).toFixed(2),a=e.trades>0?(e.wins/e.trades*100).toFixed(0):"0",i=e.w<120||e.h<80,s=e.w<80||e.h<50;return o.jsxs("div",{onClick:()=>t(e),className:"absolute cursor-pointer overflow-hidden group",style:{left:e.x,top:e.y,width:e.w,height:e.h,backgroundColor:cc(e.pnl),border:r?"2px solid var(--cyan)":"1px solid var(--border)",borderRadius:6,zIndex:r?10:1,transition:"all 150ms ease",boxShadow:r?"0 0 16px rgba(0,240,255,0.4)":void 0},children:[o.jsx("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 pointer-events-none",style:{background:`radial-gradient(circle at center, ${cc(e.pnl).replace(")",", transparent)").replace("rgba","radial-gradient").includes("radial"),cc(e.pnl)}, transparent)`,boxShadow:`inset 0 0 12px ${e.pnl>=0?"rgba(0,195,137,0.3)":"rgba(255,92,92,0.3)"}`,transition:"opacity 200ms ease"}}),o.jsxs("div",{className:"relative h-full p-1.5 flex flex-col justify-between z-10",children:[!s&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"truncate text-[10px] font-medium leading-tight",style:{color:"var(--text-dim)"},children:e.shortTitle}),o.jsxs("div",{className:"flex items-end justify-between mt-auto",children:[o.jsxs("span",{className:"mono font-bold text-xs",style:{color:Lj(e.pnl)},children:[e.pnl>=0?"+":"",n>999?`$${(e.pnl/100/1e3).toFixed(1)}k`:`$${n}`]}),!i&&o.jsxs("span",{className:"text-[9px] font-bold mono",style:{color:Number(a)>=80?"var(--green)":Number(a)>=50?"var(--orange)":"var(--red)"},children:[a,"%"]})]})]}),s&&o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsxs("span",{className:"mono font-bold text-[10px]",style:{color:Lj(e.pnl)},children:[e.pnl>=0?"+":"",(e.pnl/100).toFixed(0)]})})]})]})}function qZ({category:e,items:t,x:r,y:n,w:a,h:i,onTileClick:s,selectedTicker:l}){const c=Sn[e]||Sn.Other,u=t.reduce((p,g)=>p+g.pnl,0),f=t.reduce((p,g)=>p+g.trades,0),d=Math.min(28,i*.15),h=ua(t,0,0,a,i-d);return o.jsxs("div",{className:"absolute overflow-hidden",style:{left:r,top:n,width:a,height:i,borderRadius:8,border:`1px solid ${c.hex}40`},children:[o.jsxs("div",{className:"flex items-center justify-between px-2 relative z-20",style:{height:d,background:`linear-gradient(135deg, ${c.hex}25, ${c.hex}0D)`,borderBottom:`1px solid ${c.hex}40`},children:[o.jsx("span",{className:"text-xs font-bold tracking-wide heading",style:{color:c.hex},children:e}),o.jsxs("span",{className:"text-[10px] mono",style:{color:u>=0?"var(--green)":"var(--red)"},children:[u>=0?"+":"","$",(u/100).toFixed(0)," | ",f," trades"]})]}),o.jsx("div",{className:"relative",style:{height:i-d},children:h.map(p=>o.jsx(ZO,{item:{...p,y:p.y},onClick:s,isSelected:l===p.ticker},p.ticker))})]})}function XZ({market:e,onClose:t}){if(!e)return null;const r=(e.pnl/100).toFixed(2),n=e.trades>0?(e.wins/e.trades*100).toFixed(1):"0",a=Sn[e.category]||Sn.Other;return o.jsxs("div",{className:"card-glow fade-in",children:[o.jsxs("div",{className:"flex items-start justify-between mb-4",children:[o.jsxs("div",{className:"flex-1 min-w-0 mr-4",children:[o.jsx("h3",{className:"heading text-sm font-bold truncate",style:{color:"var(--text)"},children:e.title}),o.jsx("p",{className:"mono text-xs mt-1",style:{color:"var(--text-muted)"},children:e.ticker})]}),o.jsx("button",{onClick:t,className:"btn btn-ghost text-lg leading-none",style:{padding:"0 6px"},children:"×"})]}),o.jsx("div",{className:"grid grid-cols-4 gap-3 text-center",children:[{label:"P&L",value:`${e.pnl>=0?"+":""}$${r}`,color:e.pnl>=0?"var(--green)":"var(--red)"},{label:"Win Rate",value:`${n}%`,color:Number(n)>=80?"var(--green)":Number(n)>=50?"var(--orange)":"var(--red)"},{label:"Trades",value:e.trades.toLocaleString(),color:"var(--orange)"},{label:"Record",valueEl:o.jsxs("p",{className:"text-lg font-bold",children:[o.jsx("span",{style:{color:"var(--green)"},children:e.wins}),o.jsx("span",{style:{color:"var(--border-light)"},className:"mx-0.5",children:"-"}),o.jsx("span",{style:{color:"var(--red)"},children:e.losses})]})}].map(i=>o.jsxs("div",{className:"rounded-lg p-2.5 text-center",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[o.jsx("p",{className:"stat-label mb-1",children:i.label}),i.valueEl||o.jsx("p",{className:"stat-v text-lg",style:{color:i.color},children:i.value})]},i.label))}),o.jsxs("div",{className:"mt-3 flex items-center justify-between text-xs",children:[o.jsxs("span",{style:{color:"var(--text-muted)"},children:["Category:"," ",o.jsx("span",{style:{color:a.hex},className:"font-semibold",children:e.category})]}),e.url&&o.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-cyan transition-colors",style:{color:"var(--cyan)"},children:"View on Kalshi →"})]}),e.edge&&o.jsx("div",{className:"mt-2 text-[11px] rounded-lg px-3 py-2",style:{color:"var(--text-dim)",background:"var(--surface-el)",border:"1px solid var(--border)"},children:e.edge})]})}function QZ(){const e=[{label:"> $500",bg:"rgba(0,195,137,0.35)"},{label:"$100-500",bg:"rgba(0,195,137,0.25)"},{label:"$10-100",bg:"rgba(0,195,137,0.15)"},{label:"$0-10",bg:"rgba(0,195,137,0.08)"},{label:"$0",bg:"rgba(107,114,128,0.15)"},{label:"-$10",bg:"rgba(255,92,92,0.08)"},{label:"-$100",bg:"rgba(255,92,92,0.15)"},{label:"< -$100",bg:"rgba(255,92,92,0.30)"}];return o.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[o.jsx("span",{className:"stat-label mr-1",children:"P&L Scale:"}),e.map(t=>o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("div",{className:"w-3 h-3 rounded-sm",style:{backgroundColor:t.bg,border:"1px solid var(--border)"}}),o.jsx("span",{className:"text-[9px]",style:{color:"var(--text-muted)"},children:t.label})]},t.label))]})}function JZ(){var _;const[e,t]=P.useState(null),[r,n]=P.useState(null),[a,i]=P.useState(!0),[s,l]=P.useState(null),[c,u]=P.useState("category"),[f,d]=P.useState("pnl");P.useEffect(()=>{h();const O=setInterval(h,3e4);return()=>clearInterval(O)},[]);async function h(){try{const[O,N]=await Promise.all([Oe("/dashboard"),Oe("/signals")]);t(O),n(N)}catch{}i(!1)}const{categories:p,allMarkets:g,summary:y}=P.useMemo(()=>{if(!e)return{categories:{},allMarkets:[],summary:{}};const O=[],N=new Set;for(const C of e.top_markets||[])if(!N.has(C.ticker)){N.add(C.ticker);const M=Ij(C.title);O.push({...C,category:M,trades:(C.wins||0)+(C.losses||0),shortTitle:(C.title||C.ticker).split("?")[0].substring(0,40),size:Math.max(Math.abs(C.pnl||1),100)})}for(const C of e.worst_markets||[])if(!N.has(C.ticker)){N.add(C.ticker);const M=Ij(C.title);O.push({...C,category:M,trades:(C.wins||0)+(C.losses||0),shortTitle:(C.title||C.ticker).split("?")[0].substring(0,40),size:Math.max(Math.abs(C.pnl||1),100)})}for(const C of e.strategies||[]){const M=`strategy-${C.strategy||C.name}`;N.has(M)||(N.add(M),O.push({ticker:M,title:`Strategy: ${C.name}`,shortTitle:C.name,category:"Other",wins:C.wins||0,losses:C.losses||0,trades:(C.wins||0)+(C.losses||0),pnl:C.pnl||0,edge:`Win Rate: ${C.win_rate||0}%`,size:Math.max(Math.abs(C.pnl||1),100)}))}f==="pnl"?O.sort((C,M)=>M.pnl-C.pnl):f==="trades"?O.sort((C,M)=>M.trades-C.trades):f==="winrate"&&O.sort((C,M)=>{const I=C.trades>0?C.wins/C.trades:0;return(M.trades>0?M.wins/M.trades:0)-I});const k={};for(const C of O)k[C.category]||(k[C.category]=[]),k[C.category].push(C);const E=O.reduce((C,M)=>C+M.pnl,0),T=O.reduce((C,M)=>C+M.trades,0),D=O.reduce((C,M)=>C+M.wins,0),A=O.reduce((C,M)=>C+M.losses,0),L=O.filter(C=>C.pnl>0).length;return{categories:k,allMarkets:O,summary:{totalPnl:E,totalTrades:T,totalWins:D,totalLosses:A,profitableCount:L,totalMarkets:O.length}}},[e,f]),b=g.find(O=>O.ticker===s);if(a)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})});const v=1200,m=700,x=Object.entries(p).sort((O,N)=>{const k=O[1].reduce((T,D)=>T+Math.abs(D.pnl),0);return N[1].reduce((T,D)=>T+Math.abs(D.pnl),0)-k}),S=ua(x.map(([O,N])=>({name:O,size:N.reduce((k,E)=>k+Math.abs(E.pnl||1),0)+N.length*100,items:N})),0,0,v,m),j=c==="flat"?ua(g.map(O=>({...O,size:Math.max(Math.abs(O.pnl||1),200)})),0,0,v,m):[],w=[{label:"Total P&L",value:`${y.totalPnl>=0?"+":""}$${(y.totalPnl/100).toLocaleString(void 0,{minimumFractionDigits:0})}`,color:y.totalPnl>=0?"var(--green)":"var(--red)"},{label:"Total Trades",value:((_=y.totalTrades)==null?void 0:_.toLocaleString())||"0",color:"var(--orange)"},{label:"Win Rate",value:y.totalTrades>0?`${(y.totalWins/y.totalTrades*100).toFixed(1)}%`:"0%",color:"var(--blue)"},{label:"Markets",value:y.totalMarkets||0,color:"var(--purple)"},{label:"Profitable",value:y.profitableCount||0,color:"var(--green)"},{label:"Categories",value:Object.keys(p).length,color:"var(--cyan)"}];return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"heading text-2xl font-bold kalshi-gradient",children:"Market Heatmap"}),o.jsx("p",{className:"section-subtitle mt-1",children:"Treemap visualization of trading activity and P&L by market category"})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex items-center gap-0.5 rounded-lg p-0.5",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:["category","flat"].map(O=>o.jsx("button",{onClick:()=>u(O),className:"btn btn-sm",style:c===O?{background:"var(--cyan)",color:"var(--bg)",fontWeight:700}:{background:"transparent",color:"var(--text-muted)"},children:O==="category"?"By Category":"All Markets"},O))}),o.jsxs("select",{value:f,onChange:O=>d(O.target.value),className:"input",style:{width:"auto",paddingRight:"1.5rem"},children:[o.jsx("option",{value:"pnl",children:"Sort by P&L"}),o.jsx("option",{value:"trades",children:"Sort by Trades"}),o.jsx("option",{value:"winrate",children:"Sort by Win Rate"})]}),o.jsx("button",{onClick:h,className:"btn btn-o btn-sm",children:"Refresh"})]})]}),o.jsx("div",{className:"grid grid-cols-6 gap-3",children:w.map((O,N)=>{var E;const k=["card-accent-green","card-accent-orange","card-accent-blue","card-accent-purple","card-accent-green","card-accent-cyan"];if(O.label==="Win Rate"){const T=parseFloat(O.value)||0;return o.jsxs("div",{className:`card ${k[N]||"card-accent-cyan"}`,style:{display:"flex",alignItems:"center",gap:12},children:[o.jsx(Mj,{value:T,size:52,strokeWidth:4,color:T>=80?"var(--green)":T>=50?"var(--orange)":"var(--red)"}),o.jsxs("div",{children:[o.jsx("p",{className:"stat-label mb-0.5",children:O.label}),o.jsx("p",{className:"stat-v mono text-lg",style:{color:O.color},children:O.value})]})]},O.label)}if(O.label==="Profitable"){const T=((E=w.find(A=>A.label==="Markets"))==null?void 0:E.value)||1,D=T>0?Math.round(Number(O.value)/Number(T)*100):0;return o.jsxs("div",{className:`card ${k[N]||"card-accent-cyan"}`,style:{display:"flex",alignItems:"center",gap:12},children:[o.jsx(Mj,{value:D,size:52,strokeWidth:4,color:"var(--green)"}),o.jsxs("div",{children:[o.jsx("p",{className:"stat-label mb-0.5",children:O.label}),o.jsx("p",{className:"stat-v mono text-lg",style:{color:O.color},children:O.value})]})]},O.label)}return o.jsxs("div",{className:`card ${k[N]||"card-accent-cyan"}`,children:[o.jsx("p",{className:"stat-label mb-1",children:O.label}),o.jsx("p",{className:"stat-v mono text-xl",style:{color:O.color},children:O.value})]},O.label)})}),Object.keys(p).length>0&&o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 2fr",gap:16},children:[o.jsx(VZ,{categories:p}),o.jsx(GZ,{categories:p})]}),o.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:Object.entries(p).map(([O,N])=>{const k=Sn[O]||Sn.Other,E=N.reduce((T,D)=>T+D.pnl,0);return o.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full",style:{backgroundColor:`${k.hex}18`,border:`1px solid ${k.hex}40`},children:[o.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:k.hex}}),o.jsx("span",{className:"text-xs font-semibold heading",style:{color:k.hex},children:O}),o.jsx("span",{className:"text-[10px]",style:{color:"var(--text-muted)"},children:N.length}),o.jsxs("span",{className:"text-[10px] mono font-bold",style:{color:E>=0?"var(--green)":"var(--red)"},children:[E>=0?"+":"","$",(E/100).toFixed(0)]})]},O)})}),o.jsxs("div",{className:"card p-2 relative overflow-hidden",style:{minHeight:m+20},children:[o.jsx("div",{className:"relative",style:{width:v,height:m,margin:"0 auto",maxWidth:"100%"},children:c==="category"?S.map(O=>o.jsx(qZ,{category:O.name,items:O.items,x:O.x,y:O.y,w:O.w,h:O.h,onTileClick:N=>l(N.ticker===s?null:N.ticker),selectedTicker:s},O.name)):j.map(O=>o.jsx(ZO,{item:O,onClick:N=>l(N.ticker===s?null:N.ticker),isSelected:s===O.ticker},O.ticker))}),o.jsx("div",{className:"mt-3 px-2",children:o.jsx(QZ,{})})]}),b&&o.jsx(XZ,{market:b,onClose:()=>l(null)}),o.jsxs("div",{className:"card",children:[o.jsx("div",{className:"flex items-center gap-2 mb-4",children:o.jsx("h2",{className:"section-title",children:"Category Breakdown"})}),o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Category"}),o.jsx("th",{children:"Markets"}),o.jsx("th",{children:"Total Trades"}),o.jsx("th",{children:"Win Rate"}),o.jsx("th",{children:"P&L"}),o.jsx("th",{children:"Best Market"})]})}),o.jsx("tbody",{children:x.map(([O,N])=>{const k=Sn[O]||Sn.Other,E=N.reduce((C,M)=>C+M.pnl,0),T=N.reduce((C,M)=>C+M.trades,0),D=N.reduce((C,M)=>C+M.wins,0),A=T>0?(D/T*100).toFixed(1):"0",L=N.reduce((C,M)=>M.pnl>((C==null?void 0:C.pnl)||-1/0)?M:C,N[0]);return o.jsxs("tr",{children:[o.jsx("td",{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:k.hex}}),o.jsx("span",{className:"font-semibold heading",style:{color:k.hex},children:O})]})}),o.jsx("td",{style:{color:"var(--text-dim)"},children:N.length}),o.jsx("td",{className:"mono",style:{color:"var(--text-dim)"},children:T.toLocaleString()}),o.jsxs("td",{className:"mono font-bold",style:{color:Number(A)>=80?"var(--green)":Number(A)>=50?"var(--orange)":"var(--red)"},children:[A,"%"]}),o.jsxs("td",{className:"mono font-bold",style:{color:E>=0?"var(--green)":"var(--red)"},children:[E>=0?"+":"","$",(E/100).toFixed(2)]}),o.jsx("td",{className:"text-xs truncate max-w-[200px]",style:{color:"var(--text-muted)"},children:(L==null?void 0:L.shortTitle)||"--"})]},O)})})]})]})]})}const Ho=[{radius:80,label:"Core",color:"#00F0FF",opacity:.5,description:"Highest confidence"},{radius:160,label:"Inner",color:"#00C389",opacity:.35,description:"Strong signals"},{radius:240,label:"Mid",color:"#3B82F6",opacity:.25,description:"Moderate signals"},{radius:320,label:"Outer",color:"#A855F7",opacity:.18,description:"Weak signals"},{radius:400,label:"Edge",color:"#FF5C5C",opacity:.12,description:"Speculative"}],Ji={BUY_YES:{fill:"#00C389",stroke:"#009E6F",glow:"rgba(0,195,137,0.5)"},BUY_NO:{fill:"#FF5C5C",stroke:"#CC4A4A",glow:"rgba(255,92,92,0.5)"},YES:{fill:"#00C389",stroke:"#009E6F",glow:"rgba(0,195,137,0.5)"},NO:{fill:"#FF5C5C",stroke:"#CC4A4A",glow:"rgba(255,92,92,0.5)"}};function Jy(e){return e>=.9?"#00C389":e>=.7?"#F7931A":e>=.5?"#3B82F6":e>=.3?"#A855F7":"#FF5C5C"}function eN(e){return e>=.9?0:e>=.75?1:e>=.6?2:e>=.4?3:4}function ZZ({width:e,height:t}){const r=P.useMemo(()=>{const n=[];for(let a=0;a<80;a++)n.push({x:Math.random()*e,y:Math.random()*t,r:Math.random()*1.2+.3,opacity:Math.random()*.4+.05,delay:Math.random()*3});return n},[e,t]);return o.jsx(o.Fragment,{children:r.map((n,a)=>o.jsx("circle",{cx:n.x,cy:n.y,r:n.r,fill:"white",opacity:n.opacity,className:"animate-pulse",style:{animationDelay:`${n.delay}s`,animationDuration:`${2+Math.random()*3}s`}},a))})}function eee({market:e,cx:t,cy:r,size:n,isSelected:a,onSelect:i,animate:s}){var h;const l=Ji[e.direction]||Ji.BUY_YES,c=parseFloat(e.confidence)||0,u=Jy(c),f=n+4,d=`gradient-${(h=e.ticker)==null?void 0:h.replace(/[^a-zA-Z0-9]/g,"")}`;return o.jsxs("g",{onClick:()=>i(e),className:"cursor-pointer",style:{transition:"all 0.5s ease-out"},children:[o.jsx("circle",{cx:t,cy:r,r:f,fill:"none",stroke:l.glow,strokeWidth:1.5,opacity:a?.9:.3,className:s?"animate-ping":"",style:{animationDuration:"2s",transformOrigin:`${t}px ${r}px`}}),o.jsx("circle",{cx:t,cy:r,r:n+2,fill:"none",stroke:u,strokeWidth:2,opacity:.65,strokeDasharray:`${c*20} ${(1-c)*20}`}),o.jsx("circle",{cx:t,cy:r,r:n,fill:`url(#${d})`,stroke:a?"#00F0FF":l.stroke,strokeWidth:a?2.5:1,className:"transition-all duration-300"}),o.jsx("defs",{children:o.jsxs("radialGradient",{id:d,children:[o.jsx("stop",{offset:"0%",stopColor:l.fill,stopOpacity:"0.9"}),o.jsx("stop",{offset:"70%",stopColor:l.fill,stopOpacity:"0.6"}),o.jsx("stop",{offset:"100%",stopColor:l.stroke,stopOpacity:"0.4"})]})}),n>=8&&o.jsx("text",{x:t,y:r+1,textAnchor:"middle",dominantBaseline:"middle",fill:"white",fontSize:Math.max(7,n*.6),fontWeight:"bold",fontFamily:"'JetBrains Mono', monospace",style:{pointerEvents:"none"},children:e.edge_display||""}),n>=10&&o.jsx("text",{x:t,y:r+n+12,textAnchor:"middle",fill:"#A8A8A8",fontSize:8,fontFamily:"'JetBrains Mono', monospace",style:{pointerEvents:"none"},children:(e.shortTitle||"").substring(0,18)})]})}function tee({market:e,onClose:t}){var s;if(!e)return null;const r=parseFloat(e.confidence)||0,n=parseFloat(e.expected_edge)||0,a=Ji[e.direction]||Ji.BUY_YES,i=((s=Ho[eN(r)])==null?void 0:s.label)||"Edge";return o.jsxs("div",{className:"card-glow fade-in",children:[o.jsxs("div",{className:"flex items-start justify-between mb-4",children:[o.jsxs("div",{className:"flex-1 min-w-0 mr-4",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[o.jsx("span",{className:"inline-block w-3 h-3 rounded-full",style:{backgroundColor:a.fill}}),o.jsx("span",{className:"badge",style:e.direction==="BUY_YES"||e.direction==="YES"?{background:"var(--green-dim)",color:"var(--green)"}:{background:"var(--red-dim)",color:"var(--red)"},children:e.direction}),e.risk_approved?o.jsx("span",{className:"badge bg-green",children:"APPROVED"}):o.jsx("span",{className:"badge bg-red",children:"BLOCKED"})]}),o.jsx("h3",{className:"heading text-sm font-bold",style:{color:"var(--text)"},children:e.title||e.ticker}),o.jsx("p",{className:"mono text-xs mt-1",style:{color:"var(--text-muted)"},children:e.ticker})]}),o.jsx("button",{onClick:t,className:"btn btn-ghost text-lg leading-none",style:{padding:"0 6px"},children:"×"})]}),o.jsx("div",{className:"grid grid-cols-3 gap-3 mb-4",children:[{label:"Edge",value:`${(n*100).toFixed(1)}%`,color:"var(--orange)"},{label:"Confidence",value:`${(r*100).toFixed(0)}%`,color:Jy(r)},{label:"Orbit Ring",value:i,color:"var(--purple)"}].map(l=>o.jsxs("div",{className:"rounded-lg p-2.5 text-center",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[o.jsx("p",{className:"stat-label mb-1",children:l.label}),o.jsx("p",{className:"stat-v text-lg",style:{color:l.color},children:l.value})]},l.label))}),e.reasoning&&o.jsx("div",{className:"text-[11px] rounded-lg px-3 py-2 mb-3 leading-relaxed",style:{color:"var(--text-dim)",background:"var(--surface-el)",border:"1px solid var(--border)"},children:e.reasoning}),e.sources&&e.sources.length>0&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("p",{className:"stat-label mb-1",children:"Signal Sources"}),e.sources.map((l,c)=>{var u;return o.jsxs("div",{className:"flex items-center gap-2 text-xs rounded-lg px-3 py-2",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[o.jsx("span",{className:"badge bg-blue",children:l.source}),o.jsx("span",{className:"truncate flex-1",style:{color:"var(--text-dim)"},children:l.headline}),o.jsxs("span",{className:"mono text-[10px]",style:{color:l.sentiment>0?"var(--green)":l.sentiment<0?"var(--red)":"var(--text-muted)"},children:[l.sentiment>0?"+":"",(u=l.sentiment)==null?void 0:u.toFixed(2)]})]},c)})]}),o.jsxs("div",{className:"mt-3 text-[10px]",style:{color:"var(--text-muted)"},children:["Signal created:"," ",e.created_at?new Date(e.created_at).toLocaleString("en-US",{timeZone:"America/Los_Angeles",hour:"2-digit",minute:"2-digit",month:"short",day:"numeric"}):"Unknown"]})]})}function ree(){const[e,t]=P.useState(null),[r,n]=P.useState(null),[a,i]=P.useState(!0),[s,l]=P.useState(null),[c,u]=P.useState("all"),[f,d]=P.useState(!0),h=P.useRef(null);P.useEffect(()=>{p();const k=setInterval(p,3e4);return()=>clearInterval(k)},[]);async function p(){try{const[k,E,T]=await Promise.all([Oe("/dashboard"),Oe("/signals"),Oe("/signals/dashboard")]);t(k),n({signals:(E==null?void 0:E.signals)||[],dashboard:T})}catch{}i(!1)}const{orbitalMarkets:g,stats:y}=P.useMemo(()=>{if(!(r!=null&&r.signals))return{orbitalMarkets:[],stats:{}};let k=r.signals.map(C=>{var z,q;const M=parseFloat(C.confidence)||0,I=parseFloat(C.expected_edge)||0,R=eN(M),K=((z=(C.ticker||"").split("-")[0])==null?void 0:z.replace("KX","").substring(0,12))||C.ticker;return{...C,shortTitle:K,title:((q=C.reasoning)==null?void 0:q.split('"')[1])||C.ticker,ring:R,conf:M,edge:I,edge_display:`${(I*100).toFixed(0)}%`,size:Math.max(6,Math.min(22,I*120+6))}});c==="approved"&&(k=k.filter(C=>C.risk_approved)),c==="yes"&&(k=k.filter(C=>C.direction==="BUY_YES")),c==="no"&&(k=k.filter(C=>C.direction==="BUY_NO")),k.sort((C,M)=>M.edge-C.edge),k=k.slice(0,60);const E=k.filter(C=>C.risk_approved).length,T=k.filter(C=>C.direction==="BUY_YES").length,D=k.filter(C=>C.direction==="BUY_NO").length,A=k.length>0?k.reduce((C,M)=>C+M.conf,0)/k.length:0,L=k.length>0?k.reduce((C,M)=>C+M.edge,0)/k.length:0;return{orbitalMarkets:k,stats:{total:k.length,approved:E,buyYes:T,buyNo:D,avgConf:A,avgEdge:L}}},[r,c]),b=g.find(k=>k.ticker===s);if(a)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})});const v=450,m=430,x=900,S=860,j={};g.forEach(k=>{j[k.ring]=(j[k.ring]||0)+1});const w={},_=g.map(k=>{const E=Ho[k.ring];w[k.ring]||(w[k.ring]=0);const T=w[k.ring]++,D=j[k.ring],L=2*Math.PI/D*T+k.ring*.4,C=Math.sin(T*7.3)*.15,M=L+C,I=E.radius+Math.cos(T*3.7)*15;return{...k,cx:v+I*Math.cos(M),cy:m+I*Math.sin(M)}}),O=[{key:"all",label:"All"},{key:"approved",label:"Approved"},{key:"yes",label:"BUY YES"},{key:"no",label:"BUY NO"}],N=[{label:"Active Signals",value:y.total||0,color:"var(--cyan)"},{label:"Risk Approved",value:y.approved||0,color:"var(--green)"},{label:"BUY YES",value:y.buyYes||0,color:"var(--green)"},{label:"BUY NO",value:y.buyNo||0,color:"var(--red)"},{label:"Avg Confidence",value:`${((y.avgConf||0)*100).toFixed(0)}%`,color:"var(--blue)"},{label:"Avg Edge",value:`${((y.avgEdge||0)*100).toFixed(1)}%`,color:"var(--purple)"}];return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"heading text-2xl font-bold flex items-center gap-2",children:[o.jsx("span",{style:{color:"var(--cyan)"},children:"◐"}),o.jsx("span",{className:"gradient-cyan",children:"Signal Orbit"})]}),o.jsx("p",{className:"section-subtitle mt-1",children:"Radial visualization — distance from center = confidence, size = edge strength"})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex items-center gap-0.5 rounded-lg p-0.5",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:O.map(k=>o.jsx("button",{onClick:()=>u(k.key),className:"btn btn-sm",style:c===k.key?{background:"var(--cyan)",color:"var(--bg)",fontWeight:700}:{background:"transparent",color:"var(--text-muted)"},children:k.label},k.key))}),o.jsxs("label",{className:"flex items-center gap-2 text-xs cursor-pointer",style:{color:"var(--text-dim)"},children:[o.jsx("input",{type:"checkbox",checked:f,onChange:k=>d(k.target.checked),className:"rounded",style:{accentColor:"var(--cyan)"}}),"Animate"]}),o.jsx("button",{onClick:p,className:"btn btn-o btn-sm",children:"Refresh"})]})]}),o.jsx("div",{className:"grid grid-cols-6 gap-3",children:N.map(k=>o.jsxs("div",{className:"card",children:[o.jsx("p",{className:"stat-label mb-1",children:k.label}),o.jsx("p",{className:"stat-v",style:{color:k.color},children:k.value})]},k.label))}),o.jsxs("div",{className:"card p-0 overflow-hidden relative",style:{background:"radial-gradient(ellipse at center, #0D1B2E 0%, #080D14 60%, var(--bg) 100%)"},children:[o.jsxs("svg",{ref:h,viewBox:`0 0 ${x} ${S}`,className:"w-full",style:{maxHeight:"75vh"},children:[o.jsx(ZZ,{width:x,height:S}),Ho.map((k,E)=>o.jsxs("g",{children:[o.jsx("circle",{cx:v,cy:m,r:k.radius,fill:"none",stroke:k.color,strokeWidth:.8,opacity:k.opacity,strokeDasharray:"4 4"}),o.jsx("text",{x:v+k.radius+6,y:m-4,fill:k.color,fontSize:9,opacity:k.opacity+.2,fontFamily:"'JetBrains Mono', monospace",children:k.label})]},E)),o.jsxs("defs",{children:[o.jsxs("radialGradient",{id:"sun-gradient",children:[o.jsx("stop",{offset:"0%",stopColor:"#00F0FF",stopOpacity:"1"}),o.jsx("stop",{offset:"50%",stopColor:"#00B8C8",stopOpacity:"0.8"}),o.jsx("stop",{offset:"100%",stopColor:"#006070",stopOpacity:"0.4"})]}),o.jsxs("filter",{id:"sun-glow",children:[o.jsx("feGaussianBlur",{stdDeviation:"10",result:"blur"}),o.jsxs("feMerge",{children:[o.jsx("feMergeNode",{in:"blur"}),o.jsx("feMergeNode",{in:"SourceGraphic"})]})]})]}),o.jsx("circle",{cx:v,cy:m,r:40,fill:"url(#sun-gradient)",filter:"url(#sun-glow)",opacity:.55}),o.jsx("circle",{cx:v,cy:m,r:25,fill:"url(#sun-gradient)"}),o.jsx("text",{x:v,y:m-4,textAnchor:"middle",fill:"#0E0E10",fontSize:12,fontWeight:"bold",fontFamily:"'JetBrains Mono', monospace",children:"KEN"}),o.jsx("text",{x:v,y:m+10,textAnchor:"middle",fill:"#0E0E10",fontSize:7,fontFamily:"'JetBrains Mono', monospace",opacity:.7,children:"TRADER"}),_.map(k=>{const E=Ji[k.direction]||Ji.BUY_YES;return o.jsx("line",{x1:v,y1:m,x2:k.cx,y2:k.cy,stroke:E.fill,strokeWidth:.4,opacity:s===k.ticker?.6:.1},`line-${k.ticker}`)}),_.map(k=>o.jsx(eee,{market:k,cx:k.cx,cy:k.cy,size:k.size,isSelected:s===k.ticker,onSelect:E=>l(E.ticker===s?null:E.ticker),animate:f&&k.risk_approved},k.ticker))]}),o.jsx("div",{className:"absolute bottom-3 left-3 rounded-lg p-3",style:{background:"rgba(14,14,16,0.85)",backdropFilter:"blur(8px)",border:"1px solid var(--border)"},children:o.jsxs("div",{className:"flex items-center gap-4 text-[10px]",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:"var(--green)"}}),o.jsx("span",{style:{color:"var(--text-dim)"},children:"BUY YES"})]}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:"var(--red)"}}),o.jsx("span",{style:{color:"var(--text-dim)"},children:"BUY NO"})]}),o.jsx("span",{style:{color:"var(--border-light)"},children:"|"}),o.jsx("span",{style:{color:"var(--text-muted)"},children:"Closer to center = higher confidence"}),o.jsx("span",{style:{color:"var(--text-muted)"},children:"Larger = bigger edge"})]})}),o.jsxs("div",{className:"absolute top-3 right-3 rounded-lg p-2.5",style:{background:"rgba(14,14,16,0.85)",backdropFilter:"blur(8px)",border:"1px solid var(--border)"},children:[o.jsx("p",{className:"stat-label mb-1.5",children:"Orbit Rings"}),o.jsx("div",{className:"space-y-1",children:Ho.map((k,E)=>o.jsxs("div",{className:"flex items-center gap-2 text-[10px]",children:[o.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:k.color,opacity:k.opacity+.3}}),o.jsx("span",{style:{color:k.color},children:k.label}),o.jsx("span",{style:{color:"var(--text-muted)"},children:k.description})]},E))})]})]}),b&&o.jsx(tee,{market:b,onClose:()=>l(null)}),o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[o.jsx("h2",{className:"section-title",children:"Orbital Signal Registry"}),o.jsxs("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:[g.length," signals in orbit"]})]}),o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Ring"}),o.jsx("th",{children:"Ticker"}),o.jsx("th",{children:"Direction"}),o.jsx("th",{children:"Edge"}),o.jsx("th",{children:"Confidence"}),o.jsx("th",{children:"Risk"}),o.jsx("th",{children:"Sources"})]})}),o.jsx("tbody",{children:g.slice(0,20).map(k=>{var T;const E=Ho[k.ring];return o.jsxs("tr",{onClick:()=>l(k.ticker===s?null:k.ticker),className:"cursor-pointer",style:s===k.ticker?{background:"var(--cyan-glow)"}:{},children:[o.jsx("td",{children:o.jsx("span",{className:"text-xs font-bold heading",style:{color:E.color},children:E.label})}),o.jsx("td",{className:"mono text-xs",style:{color:"var(--text-dim)"},children:k.ticker}),o.jsx("td",{children:o.jsx("span",{className:"badge",style:k.direction==="BUY_YES"?{background:"var(--green-dim)",color:"var(--green)"}:{background:"var(--red-dim)",color:"var(--red)"},children:k.direction})}),o.jsxs("td",{className:"mono font-bold text-sm",style:{color:"var(--orange)"},children:[(k.edge*100).toFixed(1),"%"]}),o.jsxs("td",{className:"mono text-sm",style:{color:Jy(k.conf)},children:[(k.conf*100).toFixed(0),"%"]}),o.jsx("td",{children:k.risk_approved?o.jsx("span",{className:"text-xs font-bold",style:{color:"var(--green)"},children:"OK"}):o.jsx("span",{className:"text-xs font-bold",style:{color:"var(--red)"},children:"BLOCKED"})}),o.jsx("td",{className:"text-xs",style:{color:"var(--text-muted)"},children:((T=k.sources)==null?void 0:T.length)||0})]},k.ticker)})})]})})]})]})}const _c=[{name:"Economy",icon:"💰",subcategories:["GDP","Inflation","Jobs","Fed Rate","Recession","Trade","Debt","Markets"],keywords:["gdp","inflation","cpi","unemployment","jobs","payroll","fed","interest rate","recession","stock","sp500","nasdaq","dow","treasury","bond","debt","trade","tariff","deficit"],cssColor:"var(--green)",dimColor:"var(--green-dim)",rgbColor:[0,195,137]},{name:"Politics",icon:"🏛",subcategories:["White House","Congress","Elections","SCOTUS","Cabinet","Polls","Policy","Foreign"],keywords:["trump","president","impeach","congress","senate","house","governor","election","democrat","republican","vote","biden","vance","cabinet","scotus","supreme","pardon","approval","poll","secretary","defense","attorney"],cssColor:"var(--blue)",dimColor:"var(--blue-dim)",rgbColor:[59,130,246]},{name:"Weather",icon:"⛈",subcategories:["Temperature","Storms","Snow","Rain","Hurricanes","Heat","Wind","Climate"],keywords:["temperature","rain","snow","hurricane","weather","tornado","flood","heat","cold","storm","wind","precipitation","climate"],cssColor:"var(--cyan)",dimColor:"var(--cyan-dim)",rgbColor:[0,240,255]},{name:"Technology",icon:"💻",subcategories:["AI","SpaceX","Tesla","Big Tech","Startups","Chips","Cyber","Social"],keywords:["ai","spacex","tesla","apple","google","meta","openai","chatgpt","tech","rocket","launch"],cssColor:"var(--cyan)",dimColor:"var(--cyan-dim)",rgbColor:[0,240,255]},{name:"Crypto",icon:"🪙",subcategories:["Bitcoin","Ethereum","DeFi","NFTs","Regulation","Mining","Stablecoins","Altcoins"],keywords:["bitcoin","btc","ethereum","eth","crypto","token","blockchain","defi"],cssColor:"var(--orange)",dimColor:"var(--orange-dim)",rgbColor:[247,147,26]},{name:"Sports",icon:"🏈",subcategories:["NFL","NBA","MLB","Soccer","Tennis","UFC","Olympics","Playoffs"],keywords:["nfl","nba","mlb","nhl","soccer","tennis","super bowl","championship","game","match","playoff","world series"],cssColor:"var(--purple)",dimColor:"var(--purple-dim)",rgbColor:[168,85,247]},{name:"Energy",icon:"⚡",subcategories:["Oil","Gas","Solar","Nuclear","OPEC","EVs","Grid","Coal"],keywords:["oil","gas","energy","solar","opec","crude","coal","renewable"],cssColor:"var(--orange)",dimColor:"var(--orange-dim)",rgbColor:[247,147,26]},{name:"Culture",icon:"🎬",subcategories:["Movies","Music","Awards","TV","Social Media","Trends","Celebrity","Gaming"],keywords:["oscar","movie","tv","celebrity","grammy","award","music","entertainment"],cssColor:"var(--orange)",dimColor:"var(--orange-dim)",rgbColor:[247,147,26]}];_c.forEach((e,t)=>{e.baseColor=e.rgbColor});function nee(e,t){const[r,n,a]=t,i=Math.max(.05,Math.min(.9,e));return`rgba(${r},${n},${a},${i})`}function aee(e,t){const[r,n,a]=t,i=Math.max(.1,Math.min(.6,e*.8));return`rgba(${r},${n},${a},${i})`}function iee(e,t){const[r,n,a]=t;return e>.5?`rgb(${Math.min(255,r+60)},${Math.min(255,n+60)},${Math.min(255,a+60)})`:e>.2?`rgb(${r},${n},${a})`:"var(--text-muted)"}function oee({subcategory:e,intensity:t,signalCount:r,sentiment:n,baseColor:a,onClick:i,isSelected:s}){const l=nee(t,a),c=aee(t,a),u=iee(t,a),f=t>.3;return o.jsxs("div",{onClick:i,className:`relative overflow-hidden rounded-lg cursor-pointer group ${s?"z-10":""}`,style:{backgroundColor:l,border:s?"2px solid var(--cyan)":`1px solid ${c}`,minHeight:70,transform:s?"scale(1.05)":void 0,transition:"all 200ms ease",boxShadow:s?"0 0 16px rgba(0,240,255,0.2)":void 0},children:[f&&o.jsx("div",{className:"absolute inset-0 opacity-10 pointer-events-none",style:{backgroundImage:"repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.03) 2px, rgba(255,255,255,0.03) 4px)"}}),t>.6&&o.jsx("div",{className:"absolute inset-0 animate-pulse opacity-30 pointer-events-none",style:{background:`radial-gradient(circle at center, rgba(${a.join(",")},0.4), transparent 70%)`,animationDuration:`${3-t*2}s`}}),o.jsx("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 pointer-events-none",style:{background:`radial-gradient(circle at center, rgba(${a.join(",")},0.08), transparent)`,transition:"opacity 150ms ease"}}),o.jsxs("div",{className:"relative p-2.5 h-full flex flex-col justify-between z-10",children:[o.jsx("div",{children:o.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider",style:{color:u},children:e})}),o.jsxs("div",{className:"flex items-end justify-between mt-1",children:[o.jsx("div",{children:r>0?o.jsx("p",{className:"text-lg font-bold mono",style:{color:u},children:r}):o.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"--"})}),n!==0&&o.jsxs("div",{className:"text-[9px] mono font-bold px-1.5 py-0.5 rounded",style:n>0?{background:"var(--green-dim)",color:"var(--green)"}:{background:"var(--red-dim)",color:"var(--red)"},children:[n>0?"+":"",n.toFixed(2)]})]})]}),o.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5",style:{background:`linear-gradient(90deg, transparent, rgba(${a.join(",")},${t}), transparent)`}})]})}function see({category:e,subcategoryData:t,onCellClick:r,selectedCell:n}){const a=t.reduce((l,c)=>l+c.signalCount,0),i=Math.max(...t.map(l=>l.intensity),0),s=t.reduce((l,c)=>l+c.sentiment,0)/t.length;return o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-lg",children:e.icon}),o.jsx("h3",{className:"text-sm font-bold heading",style:{color:e.cssColor},children:e.name}),o.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-muted)"},children:[a," signals"]})]}),o.jsxs("div",{className:"flex items-center gap-3 text-[10px]",children:[o.jsxs("span",{style:{color:"var(--text-muted)"},children:["Peak:"," ",o.jsxs("span",{className:"font-bold",style:{color:e.cssColor},children:[(i*100).toFixed(0),"%"]})]}),o.jsxs("span",{className:"mono",style:{color:s>0?"var(--green)":s<0?"var(--red)":"var(--text-muted)"},children:["Sentiment: ",s>0?"+":"",s.toFixed(3)]})]})]}),o.jsx("div",{className:"grid grid-cols-8 gap-2",children:t.map(l=>o.jsx(oee,{subcategory:l.name,intensity:l.intensity,signalCount:l.signalCount,sentiment:l.sentiment,baseColor:e.baseColor,onClick:()=>r({category:e.name,subcategory:l.name,...l}),isSelected:(n==null?void 0:n.category)===e.name&&(n==null?void 0:n.subcategory)===l.name},l.name))})]})}function lee(){return o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"stat-label",children:"Low"}),o.jsx("div",{className:"flex gap-px",children:Array.from({length:10}).map((t,r)=>o.jsx("div",{className:"w-5 h-3 rounded-sm",style:{backgroundColor:`rgba(0,240,255,${(r+1)/10*.7+.05})`}},r))}),o.jsx("span",{className:"stat-label",children:"High"})]})}function cee({cell:e,signals:t,onClose:r}){if(!e)return null;const n=t.filter(a=>{var s;const i=(a.reasoning||a.ticker||"").toLowerCase();return(s=e.matchingKeywords)==null?void 0:s.some(l=>i.includes(l))}).slice(0,10);return o.jsxs("div",{className:"card-glow fade-in",children:[o.jsxs("div",{className:"flex items-start justify-between mb-3",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx("span",{className:"text-lg",children:e.categoryIcon}),o.jsxs("h3",{className:"heading text-sm font-bold",style:{color:"var(--text)"},children:[e.category," / ",e.subcategory]})]}),o.jsxs("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:[e.signalCount," signals | Intensity: ",(e.intensity*100).toFixed(0),"% | Sentiment:"," ",o.jsxs("span",{style:{color:e.sentiment>0?"var(--green)":e.sentiment<0?"var(--red)":"var(--text-dim)"},children:[e.sentiment>0?"+":"",e.sentiment.toFixed(3)]})]})]}),o.jsx("button",{onClick:r,className:"btn btn-ghost text-lg leading-none",style:{padding:"0 6px"},children:"×"})]}),n.length>0?o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"stat-label mb-1",children:"Related Signals"}),n.map((a,i)=>o.jsxs("div",{className:"flex items-center gap-3 text-xs rounded-lg px-3 py-2",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[o.jsx("span",{className:"badge",style:a.direction==="BUY_YES"?{background:"var(--green-dim)",color:"var(--green)"}:{background:"var(--red-dim)",color:"var(--red)"},children:a.direction}),o.jsx("span",{className:"mono truncate flex-1",style:{color:"var(--text-dim)"},children:a.ticker}),o.jsxs("span",{className:"mono font-bold",style:{color:"var(--orange)"},children:[(parseFloat(a.expected_edge)*100).toFixed(1),"%"]}),o.jsxs("span",{className:"mono",style:{color:"var(--blue)"},children:[(parseFloat(a.confidence)*100).toFixed(0),"%"]}),a.risk_approved?o.jsx("span",{className:"text-[9px] font-bold",style:{color:"var(--green)"},children:"OK"}):o.jsx("span",{className:"text-[9px] font-bold",style:{color:"var(--red)"},children:"BLOCKED"})]},i))]}):o.jsx("p",{className:"text-sm text-center py-4",style:{color:"var(--text-muted)"},children:"No matching signals for this subcategory"})]})}function uee({categoryStats:e}){const t=Math.max(...e.map(r=>r.totalSignals),1);return o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[o.jsx("h2",{className:"section-title",children:"National Activity Overview"}),o.jsx("span",{className:"section-subtitle",children:"Signal density across categories"})]}),o.jsx("div",{className:"space-y-2",children:e.sort((r,n)=>n.totalSignals-r.totalSignals).map(r=>{const n=r.totalSignals/t*100;return o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"text-sm w-5",children:r.icon}),o.jsx("span",{className:"text-xs font-medium w-20 heading",style:{color:r.cssColor||`rgb(${r.baseColor.join(",")})`},children:r.name}),o.jsxs("div",{className:"flex-1 h-5 rounded-full overflow-hidden relative",style:{background:"var(--surface-el)"},children:[o.jsx("div",{className:"h-full rounded-full transition-all duration-1000 relative overflow-hidden",style:{width:`${Math.max(n,2)}%`,background:`linear-gradient(90deg, rgba(${r.baseColor.join(",")},0.3), rgba(${r.baseColor.join(",")},0.6))`},children:o.jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%)",animation:"shimmer 2s infinite"}})}),o.jsx("span",{className:"absolute right-2 top-0 bottom-0 flex items-center text-[10px] mono",style:{color:"var(--text-dim)"},children:r.totalSignals})]}),o.jsxs("span",{className:"text-[10px] mono w-12 text-right",style:{color:r.avgSentiment>0?"var(--green)":r.avgSentiment<0?"var(--red)":"var(--text-muted)"},children:[r.avgSentiment>0?"+":"",r.avgSentiment.toFixed(2)]})]},r.name)})})]})}function dee(){const[e,t]=P.useState(null),[r,n]=P.useState(null),[a,i]=P.useState(null),[s,l]=P.useState(!0),[c,u]=P.useState(null),[f,d]=P.useState("24h");P.useEffect(()=>{h();const v=setInterval(h,3e4);return()=>clearInterval(v)},[]);async function h(){try{const[v,m,x]=await Promise.all([Oe("/dashboard"),Oe("/signals"),Oe("/signals/dashboard")]);t(v),n((m==null?void 0:m.signals)||[]),i(x)}catch{}l(!1)}const{categoryData:p,categoryStats:g,overallStats:y}=P.useMemo(()=>{var w;if(!r)return{categoryData:[],categoryStats:[],overallStats:{}};const v=r||[],m=Math.max(..._c.flatMap(_=>_.subcategories.map(O=>(_.keywords.filter(k=>O.toLowerCase().includes(k.split(" ")[0])||k.includes(O.toLowerCase())),v.filter(k=>{const E=(k.reasoning||k.ticker||"").toLowerCase();return _.keywords.some(T=>E.includes(T))}).length))),1),x=_c.map(_=>{const O=v.filter(k=>{const E=(k.reasoning||k.ticker||"").toLowerCase();return _.keywords.some(T=>E.includes(T))});O.length,O.length>0&&O.reduce((k,E)=>{const T=(E.sources||[]).reduce((D,A)=>D+(A.sentiment||0),0);return k+T},0)/Math.max(O.length,1);const N=_.subcategories.map(k=>{const E=_.keywords.filter(C=>{const M=k.toLowerCase();return C.includes(M)||M.includes(C.split(" ")[0])});let T;if(E.length>0)T=v.filter(C=>{const M=(C.reasoning||C.ticker||"").toLowerCase();return E.some(I=>M.includes(I))});else{const C=k.split("").reduce((M,I)=>(M<<5)-M+I.charCodeAt(0)|0,0);T=O.filter((M,I)=>I%_.subcategories.length===Math.abs(C)%_.subcategories.length)}const D=T.length,A=T.reduce((C,M)=>{const I=(M.sources||[]).reduce((R,F)=>R+(F.sentiment||0),0);return C+I},0)/Math.max(T.length,1),L=Math.min(1,D/Math.max(m*.5,1));return{name:k,signalCount:D,sentiment:A,intensity:L,matchingKeywords:E.length>0?E:_.keywords,categoryIcon:_.icon}});return{category:_,subcategoryData:N}}),S=_c.map(_=>{const O=v.filter(N=>{const k=(N.reasoning||N.ticker||"").toLowerCase();return _.keywords.some(E=>k.includes(E))});return{name:_.name,icon:_.icon,baseColor:_.baseColor,cssColor:_.cssColor,totalSignals:O.length,avgSentiment:O.length>0?O.reduce((N,k)=>N+(k.sources||[]).reduce((E,T)=>E+(T.sentiment||0),0),0)/O.length:0}}),j={totalSignals:v.length,buyYes:v.filter(_=>_.direction==="BUY_YES").length,buyNo:v.filter(_=>_.direction==="BUY_NO").length,approved:v.filter(_=>_.risk_approved).length,avgEdge:v.length>0?v.reduce((_,O)=>_+parseFloat(O.expected_edge||0),0)/v.length:0,avgConf:v.length>0?v.reduce((_,O)=>_+parseFloat(O.confidence||0),0)/v.length:0,hottest:((w=[...S].sort((_,O)=>O.totalSignals-_.totalSignals)[0])==null?void 0:w.name)||"None"};return{categoryData:x,categoryStats:S,overallStats:j}},[r]);if(s)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})});const b=[{label:"Total Signals",value:y.totalSignals||0,color:"var(--cyan)"},{label:"BUY YES",value:y.buyYes||0,color:"var(--green)"},{label:"BUY NO",value:y.buyNo||0,color:"var(--red)"},{label:"Approved",value:y.approved||0,color:"var(--green)"},{label:"Avg Edge",value:`${((y.avgEdge||0)*100).toFixed(1)}%`,color:"var(--orange)"},{label:"Avg Confidence",value:`${((y.avgConf||0)*100).toFixed(0)}%`,color:"var(--blue)"},{label:"Hottest Sector",value:y.hottest,color:"var(--red)"}];return o.jsxs("div",{className:"space-y-6",children:[o.jsx("style",{children:`
- @keyframes shimmer {
- 0% { transform: translateX(-100%); }
- 100% { transform: translateX(200%); }
- }
- `}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"heading text-2xl font-bold flex items-center gap-3",children:[o.jsx("span",{className:"inline-flex items-center justify-center w-3 h-3 rounded-full pulse-cyan",style:{backgroundColor:"var(--cyan)",flexShrink:0}}),o.jsx("span",{className:"gradient-cyan",children:"Pulse of America"})]}),o.jsx("p",{className:"section-subtitle mt-1",children:"Sentiment and activity heatmap across American prediction markets"})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex items-center gap-0.5 rounded-lg p-0.5",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:["24h","7d","30d"].map(v=>o.jsx("button",{onClick:()=>d(v),className:"btn btn-sm",style:f===v?{background:"var(--cyan)",color:"var(--bg)",fontWeight:700}:{background:"transparent",color:"var(--text-muted)"},children:v},v))}),o.jsx("button",{onClick:h,className:"btn btn-o btn-sm",children:"Refresh"})]})]}),o.jsx("div",{className:"grid grid-cols-7 gap-3",children:b.map(v=>o.jsxs("div",{className:"card",children:[o.jsx("p",{className:"stat-label mb-1",children:v.label}),o.jsx("p",{className:"stat-v text-lg",style:{color:v.color},children:v.value})]},v.label))}),o.jsx(uee,{categoryStats:g}),o.jsxs("div",{className:"card p-4",children:[o.jsxs("div",{className:"flex items-center justify-between mb-5",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-2 h-2 rounded-full animate-pulse",style:{backgroundColor:"var(--red)"}}),o.jsx("h2",{className:"section-title",children:"Live Signal Heatmap"})]}),o.jsx(lee,{})]}),o.jsx("div",{className:"space-y-5",children:p.map(({category:v,subcategoryData:m})=>o.jsx(see,{category:v,subcategoryData:m,onCellClick:x=>u((c==null?void 0:c.category)===x.category&&(c==null?void 0:c.subcategory)===x.subcategory?null:x),selectedCell:c},v.name))})]}),c&&o.jsx(cee,{cell:c,signals:r||[],onClose:()=>u(null)}),o.jsxs("div",{className:"card",children:[o.jsx("div",{className:"flex items-center gap-2 mb-4",children:o.jsx("h2",{className:"section-title",children:"Signal Source Breakdown"})}),o.jsx("div",{className:"grid grid-cols-4 gap-3",children:((a==null?void 0:a.sourceBreakdown)||[]).slice(0,8).map(v=>{const m=parseFloat(v.avg_sent)||0,x=parseInt(v.cnt)||0;return o.jsxs("div",{className:"rounded-lg p-3",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("span",{className:"text-xs font-bold heading",style:{color:"var(--text-dim)"},children:v.source.replace("_"," ").toUpperCase()}),o.jsx("span",{className:"mono text-xs font-bold",style:{color:"var(--orange)"},children:x})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"progress-bar flex-1",children:o.jsx("div",{className:"progress-fill",style:{width:`${Math.min(100,Math.abs(m)*5e3+10)}%`,background:m>0?"var(--green)":m<0?"var(--red)":"var(--text-muted)"}})}),o.jsxs("span",{className:"text-[10px] mono",style:{color:m>0?"var(--green)":m<0?"var(--red)":"var(--text-muted)"},children:[m>0?"+":"",m.toFixed(3)]})]})]},v.source)})})]}),e&&o.jsxs("div",{className:"card",children:[o.jsx("div",{className:"flex items-center gap-2 mb-4",children:o.jsx("h2",{className:"section-title",children:"Market Pulse Metrics"})}),o.jsx("div",{className:"grid grid-cols-5 gap-3 text-center",children:[{label:"Balance",value:`$${e.balance?(e.balance/100).toLocaleString(void 0,{minimumFractionDigits:0}):"0"}`,color:"var(--green)"},{label:"Today's P&L",value:`${(e.daily_pnl||0)>=0?"+":""}$${((e.daily_pnl||0)/100).toFixed(2)}`,color:(e.daily_pnl||0)>=0?"var(--green)":"var(--red)"},{label:"Today's Trades",value:(e.today_trades||0).toLocaleString(),color:"var(--orange)"},{label:"Win Rate",value:`${e.today_trades>0?(e.today_wins/e.today_trades*100).toFixed(1):"0"}%`,color:e.today_trades>0&&e.today_wins/e.today_trades*100>=50?"var(--green)":"var(--red)"},{label:"Markets Tracked",value:e.markets_tracked||0,color:"var(--purple)"}].map(v=>o.jsxs("div",{className:"rounded-lg p-3",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[o.jsx("p",{className:"stat-label mb-1",children:v.label}),o.jsx("p",{className:"stat-v text-lg",style:{color:v.color},children:v.value})]},v.label))})]})]})}function fee(){return o.jsx(CC,{children:o.jsxs(SC,{children:[o.jsx(it,{path:"/login",element:o.jsx(zC,{})}),o.jsx(it,{path:"/setup",element:o.jsx(iE,{})}),o.jsxs(it,{path:"/",element:o.jsx(GC,{}),children:[o.jsx(it,{index:!0,element:o.jsx(lZ,{})}),o.jsx(it,{path:"markets",element:o.jsx(dZ,{})}),o.jsx(it,{path:"positions",element:o.jsx(mZ,{})}),o.jsx(it,{path:"orders",element:o.jsx(gZ,{})}),o.jsx(it,{path:"signals",element:o.jsx(zZ,{})}),o.jsx(it,{path:"intelligence",element:o.jsx(HZ,{})}),o.jsx(it,{path:"trading",element:o.jsx(KZ,{})}),o.jsx(it,{path:"heatmap",element:o.jsx(JZ,{})}),o.jsx(it,{path:"orbit",element:o.jsx(ree,{})}),o.jsx(it,{path:"pulse",element:o.jsx(dee,{})}),o.jsx(it,{path:"weather",element:o.jsx(xZ,{})}),o.jsx(it,{path:"risk",element:o.jsx(AZ,{})}),o.jsx(it,{path:"settings",element:o.jsx(MZ,{})})]})]})})}gh.createRoot(document.getElementById("root")).render(o.jsx(fee,{}));
diff --git a/kalshi-dash/dist/assets/index-_K_ynK5-.js b/kalshi-dash/dist/assets/index-_K_ynK5-.js
new file mode 100644
index 0000000..a2ae682
--- /dev/null
+++ b/kalshi-dash/dist/assets/index-_K_ynK5-.js
@@ -0,0 +1,157 @@
+function rN(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(n,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>n[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var Ol=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function de(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rj={exports:{}},rd={},Bj={exports:{}},ae={};/**
+ * @license React
+ * react.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var ll=Symbol.for("react.element"),nN=Symbol.for("react.portal"),aN=Symbol.for("react.fragment"),iN=Symbol.for("react.strict_mode"),oN=Symbol.for("react.profiler"),sN=Symbol.for("react.provider"),lN=Symbol.for("react.context"),cN=Symbol.for("react.forward_ref"),uN=Symbol.for("react.suspense"),dN=Symbol.for("react.memo"),fN=Symbol.for("react.lazy"),rg=Symbol.iterator;function hN(e){return e===null||typeof e!="object"?null:(e=rg&&e[rg]||e["@@iterator"],typeof e=="function"?e:null)}var Fj={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},zj=Object.assign,Wj={};function eo(e,t,r){this.props=e,this.context=t,this.refs=Wj,this.updater=r||Fj}eo.prototype.isReactComponent={};eo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};eo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Uj(){}Uj.prototype=eo.prototype;function Km(e,t,r){this.props=e,this.context=t,this.refs=Wj,this.updater=r||Fj}var Vm=Km.prototype=new Uj;Vm.constructor=Km;zj(Vm,eo.prototype);Vm.isPureReactComponent=!0;var ng=Array.isArray,Hj=Object.prototype.hasOwnProperty,Gm={current:null},Kj={key:!0,ref:!0,__self:!0,__source:!0};function Vj(e,t,r){var n,a={},i=null,s=null;if(t!=null)for(n in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)Hj.call(t,n)&&!Kj.hasOwnProperty(n)&&(a[n]=t[n]);var l=arguments.length-2;if(l===1)a.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];a.children=c}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)a[n]===void 0&&(a[n]=l[n]);return{$$typeof:ll,type:e,key:i,ref:s,props:a,_owner:Gm.current}}function pN(e,t){return{$$typeof:ll,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ym(e){return typeof e=="object"&&e!==null&&e.$$typeof===ll}function mN(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var ag=/\/+/g;function hf(e,t){return typeof e=="object"&&e!==null&&e.key!=null?mN(""+e.key):t.toString(36)}function dc(e,t,r,n,a){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case ll:case nN:s=!0}}if(s)return s=e,a=a(s),e=n===""?"."+hf(s,0):n,ng(a)?(r="",e!=null&&(r=e.replace(ag,"$&/")+"/"),dc(a,t,r,"",function(u){return u})):a!=null&&(Ym(a)&&(a=pN(a,r+(!a.key||s&&s.key===a.key?"":(""+a.key).replace(ag,"$&/")+"/")+e)),t.push(a)),1;if(s=0,n=n===""?".":n+":",ng(e))for(var l=0;l<e.length;l++){i=e[l];var c=n+hf(i,l);s+=dc(i,t,r,c,a)}else if(c=hN(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=n+hf(i,l++),s+=dc(i,t,r,c,a);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function Nl(e,t,r){if(e==null)return e;var n=[],a=0;return dc(e,n,"","",function(i){return t.call(r,i,a++)}),n}function vN(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var wt={current:null},fc={transition:null},yN={ReactCurrentDispatcher:wt,ReactCurrentBatchConfig:fc,ReactCurrentOwner:Gm};function Gj(){throw Error("act(...) is not supported in production builds of React.")}ae.Children={map:Nl,forEach:function(e,t,r){Nl(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Nl(e,function(){t++}),t},toArray:function(e){return Nl(e,function(t){return t})||[]},only:function(e){if(!Ym(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ae.Component=eo;ae.Fragment=aN;ae.Profiler=oN;ae.PureComponent=Km;ae.StrictMode=iN;ae.Suspense=uN;ae.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=yN;ae.act=Gj;ae.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=zj({},e.props),a=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=Gm.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)Hj.call(t,c)&&!Kj.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];n.children=l}return{$$typeof:ll,type:e.type,key:a,ref:i,props:n,_owner:s}};ae.createContext=function(e){return e={$$typeof:lN,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:sN,_context:e},e.Consumer=e};ae.createElement=Vj;ae.createFactory=function(e){var t=Vj.bind(null,e);return t.type=e,t};ae.createRef=function(){return{current:null}};ae.forwardRef=function(e){return{$$typeof:cN,render:e}};ae.isValidElement=Ym;ae.lazy=function(e){return{$$typeof:fN,_payload:{_status:-1,_result:e},_init:vN}};ae.memo=function(e,t){return{$$typeof:dN,type:e,compare:t===void 0?null:t}};ae.startTransition=function(e){var t=fc.transition;fc.transition={};try{e()}finally{fc.transition=t}};ae.unstable_act=Gj;ae.useCallback=function(e,t){return wt.current.useCallback(e,t)};ae.useContext=function(e){return wt.current.useContext(e)};ae.useDebugValue=function(){};ae.useDeferredValue=function(e){return wt.current.useDeferredValue(e)};ae.useEffect=function(e,t){return wt.current.useEffect(e,t)};ae.useId=function(){return wt.current.useId()};ae.useImperativeHandle=function(e,t,r){return wt.current.useImperativeHandle(e,t,r)};ae.useInsertionEffect=function(e,t){return wt.current.useInsertionEffect(e,t)};ae.useLayoutEffect=function(e,t){return wt.current.useLayoutEffect(e,t)};ae.useMemo=function(e,t){return wt.current.useMemo(e,t)};ae.useReducer=function(e,t,r){return wt.current.useReducer(e,t,r)};ae.useRef=function(e){return wt.current.useRef(e)};ae.useState=function(e){return wt.current.useState(e)};ae.useSyncExternalStore=function(e,t,r){return wt.current.useSyncExternalStore(e,t,r)};ae.useTransition=function(){return wt.current.useTransition()};ae.version="18.3.1";Bj.exports=ae;var P=Bj.exports;const $=de(P),gN=rN({__proto__:null,default:$},[P]);/**
+ * @license React
+ * react-jsx-runtime.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var xN=P,bN=Symbol.for("react.element"),jN=Symbol.for("react.fragment"),wN=Object.prototype.hasOwnProperty,SN=xN.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,_N={key:!0,ref:!0,__self:!0,__source:!0};function Yj(e,t,r){var n,a={},i=null,s=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(n in t)wN.call(t,n)&&!_N.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)a[n]===void 0&&(a[n]=t[n]);return{$$typeof:bN,type:e,key:i,ref:s,props:a,_owner:SN.current}}rd.Fragment=jN;rd.jsx=Yj;rd.jsxs=Yj;Rj.exports=rd;var o=Rj.exports,xh={},qj={exports:{}},Wt={},Xj={exports:{}},Qj={};/**
+ * @license React
+ * scheduler.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */(function(e){function t(I,R){var F=I.length;I.push(R);e:for(;0<F;){var K=F-1>>>1,z=I[K];if(0<a(z,R))I[K]=R,I[F]=z,F=K;else break e}}function r(I){return I.length===0?null:I[0]}function n(I){if(I.length===0)return null;var R=I[0],F=I.pop();if(F!==R){I[0]=F;e:for(var K=0,z=I.length,q=z>>>1;K<q;){var ie=2*(K+1)-1,he=I[ie],ge=ie+1,Qe=I[ge];if(0>a(he,F))ge<z&&0>a(Qe,he)?(I[K]=Qe,I[ge]=F,K=ge):(I[K]=he,I[ie]=F,K=ie);else if(ge<z&&0>a(Qe,F))I[K]=Qe,I[ge]=F,K=ge;else break e}}return R}function a(I,R){var F=I.sortIndex-R.sortIndex;return F!==0?F:I.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var c=[],u=[],f=1,d=null,h=3,p=!1,g=!1,y=!1,b=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(I){for(var R=r(u);R!==null;){if(R.callback===null)n(u);else if(R.startTime<=I)n(u),R.sortIndex=R.expirationTime,t(c,R);else break;R=r(u)}}function S(I){if(y=!1,x(I),!g)if(r(c)!==null)g=!0,C(j);else{var R=r(u);R!==null&&M(S,R.startTime-I)}}function j(I,R){g=!1,y&&(y=!1,v(O),O=-1),p=!0;var F=h;try{for(x(R),d=r(c);d!==null&&(!(d.expirationTime>R)||I&&!E());){var K=d.callback;if(typeof K=="function"){d.callback=null,h=d.priorityLevel;var z=K(d.expirationTime<=R);R=e.unstable_now(),typeof z=="function"?d.callback=z:d===r(c)&&n(c),x(R)}else n(c);d=r(c)}if(d!==null)var q=!0;else{var ie=r(u);ie!==null&&M(S,ie.startTime-R),q=!1}return q}finally{d=null,h=F,p=!1}}var w=!1,_=null,O=-1,N=5,k=-1;function E(){return!(e.unstable_now()-k<N)}function T(){if(_!==null){var I=e.unstable_now();k=I;var R=!0;try{R=_(!0,I)}finally{R?D():(w=!1,_=null)}}else w=!1}var D;if(typeof m=="function")D=function(){m(T)};else if(typeof MessageChannel<"u"){var A=new MessageChannel,L=A.port2;A.port1.onmessage=T,D=function(){L.postMessage(null)}}else D=function(){b(T,0)};function C(I){_=I,w||(w=!0,D())}function M(I,R){O=b(function(){I(e.unstable_now())},R)}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(I){I.callback=null},e.unstable_continueExecution=function(){g||p||(g=!0,C(j))},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(I){switch(h){case 1:case 2:case 3:var R=3;break;default:R=h}var F=h;h=R;try{return I()}finally{h=F}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(I,R){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var F=h;h=I;try{return R()}finally{h=F}},e.unstable_scheduleCallback=function(I,R,F){var K=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?K+F:K):F=K,I){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=F+z,I={id:f++,callback:R,priorityLevel:I,startTime:F,expirationTime:z,sortIndex:-1},F>K?(I.sortIndex=F,t(u,I),r(c)===null&&I===r(u)&&(y?(v(O),O=-1):y=!0,M(S,F-K))):(I.sortIndex=z,t(c,I),g||p||(g=!0,C(j))),I},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(I){var R=h;return function(){var F=h;h=R;try{return I.apply(this,arguments)}finally{h=F}}}})(Qj);Xj.exports=Qj;var kN=Xj.exports;/**
+ * @license React
+ * react-dom.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var ON=P,zt=kN;function H(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Jj=new Set,ss={};function Pa(e,t){bi(e,t),bi(e+"Capture",t)}function bi(e,t){for(ss[e]=t,e=0;e<t.length;e++)Jj.add(t[e])}var Xr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),bh=Object.prototype.hasOwnProperty,NN=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ig={},og={};function PN(e){return bh.call(og,e)?!0:bh.call(ig,e)?!1:NN.test(e)?og[e]=!0:(ig[e]=!0,!1)}function AN(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function CN(e,t,r,n){if(t===null||typeof t>"u"||AN(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function St(e,t,r,n,a,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var ut={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ut[e]=new St(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ut[t]=new St(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ut[e]=new St(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ut[e]=new St(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ut[e]=new St(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ut[e]=new St(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ut[e]=new St(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ut[e]=new St(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ut[e]=new St(e,5,!1,e.toLowerCase(),null,!1,!1)});var qm=/[\-:]([a-z])/g;function Xm(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(qm,Xm);ut[t]=new St(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(qm,Xm);ut[t]=new St(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(qm,Xm);ut[t]=new St(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ut[e]=new St(e,1,!1,e.toLowerCase(),null,!1,!1)});ut.xlinkHref=new St("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ut[e]=new St(e,1,!1,e.toLowerCase(),null,!0,!0)});function Qm(e,t,r,n){var a=ut.hasOwnProperty(t)?ut[t]:null;(a!==null?a.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(CN(t,r,a,n)&&(r=null),n||a===null?PN(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):a.mustUseProperty?e[a.propertyName]=r===null?a.type===3?!1:"":r:(t=a.attributeName,n=a.attributeNamespace,r===null?e.removeAttribute(t):(a=a.type,r=a===3||a===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var an=ON.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Pl=Symbol.for("react.element"),Va=Symbol.for("react.portal"),Ga=Symbol.for("react.fragment"),Jm=Symbol.for("react.strict_mode"),jh=Symbol.for("react.profiler"),Zj=Symbol.for("react.provider"),ew=Symbol.for("react.context"),Zm=Symbol.for("react.forward_ref"),wh=Symbol.for("react.suspense"),Sh=Symbol.for("react.suspense_list"),ev=Symbol.for("react.memo"),hn=Symbol.for("react.lazy"),tw=Symbol.for("react.offscreen"),sg=Symbol.iterator;function xo(e){return e===null||typeof e!="object"?null:(e=sg&&e[sg]||e["@@iterator"],typeof e=="function"?e:null)}var $e=Object.assign,pf;function Bo(e){if(pf===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);pf=t&&t[1]||""}return`
+`+pf+e}var mf=!1;function vf(e,t){if(!e||mf)return"";mf=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var n=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){n=u}e.call(t.prototype)}else{try{throw Error()}catch(u){n=u}e()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var a=u.stack.split(`
+`),i=n.stack.split(`
+`),s=a.length-1,l=i.length-1;1<=s&&0<=l&&a[s]!==i[l];)l--;for(;1<=s&&0<=l;s--,l--)if(a[s]!==i[l]){if(s!==1||l!==1)do if(s--,l--,0>l||a[s]!==i[l]){var c=`
+`+a[s].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=s&&0<=l);break}}}finally{mf=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Bo(e):""}function EN(e){switch(e.tag){case 5:return Bo(e.type);case 16:return Bo("Lazy");case 13:return Bo("Suspense");case 19:return Bo("SuspenseList");case 0:case 2:case 15:return e=vf(e.type,!1),e;case 11:return e=vf(e.type.render,!1),e;case 1:return e=vf(e.type,!0),e;default:return""}}function _h(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ga:return"Fragment";case Va:return"Portal";case jh:return"Profiler";case Jm:return"StrictMode";case wh:return"Suspense";case Sh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ew:return(e.displayName||"Context")+".Consumer";case Zj:return(e._context.displayName||"Context")+".Provider";case Zm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ev:return t=e.displayName||null,t!==null?t:_h(e.type)||"Memo";case hn:t=e._payload,e=e._init;try{return _h(e(t))}catch{}}return null}function $N(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _h(t);case 8:return t===Jm?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function In(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function rw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function TN(e){var t=rw(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(s){n=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Al(e){e._valueTracker||(e._valueTracker=TN(e))}function nw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=rw(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Oc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function kh(e,t){var r=t.checked;return $e({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function lg(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=In(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function aw(e,t){t=t.checked,t!=null&&Qm(e,"checked",t,!1)}function Oh(e,t){aw(e,t);var r=In(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Nh(e,t.type,r):t.hasOwnProperty("defaultValue")&&Nh(e,t.type,In(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function cg(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Nh(e,t,r){(t!=="number"||Oc(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Fo=Array.isArray;function ci(e,t,r,n){if(e=e.options,t){t={};for(var a=0;a<r.length;a++)t["$"+r[a]]=!0;for(r=0;r<e.length;r++)a=t.hasOwnProperty("$"+e[r].value),e[r].selected!==a&&(e[r].selected=a),a&&n&&(e[r].defaultSelected=!0)}else{for(r=""+In(r),t=null,a=0;a<e.length;a++){if(e[a].value===r){e[a].selected=!0,n&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function Ph(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(H(91));return $e({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ug(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(H(92));if(Fo(r)){if(1<r.length)throw Error(H(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:In(r)}}function iw(e,t){var r=In(t.value),n=In(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function dg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function ow(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ah(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ow(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Cl,sw=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,a){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Cl=Cl||document.createElement("div"),Cl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Cl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ls(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Vo={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},MN=["Webkit","ms","Moz","O"];Object.keys(Vo).forEach(function(e){MN.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Vo[t]=Vo[e]})});function lw(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Vo.hasOwnProperty(e)&&Vo[e]?(""+t).trim():t+"px"}function cw(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,a=lw(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,a):e[r]=a}}var IN=$e({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ch(e,t){if(t){if(IN[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function Eh(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var $h=null;function tv(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Th=null,ui=null,di=null;function fg(e){if(e=dl(e)){if(typeof Th!="function")throw Error(H(280));var t=e.stateNode;t&&(t=sd(t),Th(e.stateNode,e.type,t))}}function uw(e){ui?di?di.push(e):di=[e]:ui=e}function dw(){if(ui){var e=ui,t=di;if(di=ui=null,fg(e),t)for(e=0;e<t.length;e++)fg(t[e])}}function fw(e,t){return e(t)}function hw(){}var yf=!1;function pw(e,t,r){if(yf)return e(t,r);yf=!0;try{return fw(e,t,r)}finally{yf=!1,(ui!==null||di!==null)&&(hw(),dw())}}function cs(e,t){var r=e.stateNode;if(r===null)return null;var n=sd(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(H(231,t,typeof r));return r}var Mh=!1;if(Xr)try{var bo={};Object.defineProperty(bo,"passive",{get:function(){Mh=!0}}),window.addEventListener("test",bo,bo),window.removeEventListener("test",bo,bo)}catch{Mh=!1}function LN(e,t,r,n,a,i,s,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(f){this.onError(f)}}var Go=!1,Nc=null,Pc=!1,Ih=null,DN={onError:function(e){Go=!0,Nc=e}};function RN(e,t,r,n,a,i,s,l,c){Go=!1,Nc=null,LN.apply(DN,arguments)}function BN(e,t,r,n,a,i,s,l,c){if(RN.apply(this,arguments),Go){if(Go){var u=Nc;Go=!1,Nc=null}else throw Error(H(198));Pc||(Pc=!0,Ih=u)}}function Aa(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function mw(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function hg(e){if(Aa(e)!==e)throw Error(H(188))}function FN(e){var t=e.alternate;if(!t){if(t=Aa(e),t===null)throw Error(H(188));return t!==e?null:e}for(var r=e,n=t;;){var a=r.return;if(a===null)break;var i=a.alternate;if(i===null){if(n=a.return,n!==null){r=n;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===r)return hg(a),e;if(i===n)return hg(a),t;i=i.sibling}throw Error(H(188))}if(r.return!==n.return)r=a,n=i;else{for(var s=!1,l=a.child;l;){if(l===r){s=!0,r=a,n=i;break}if(l===n){s=!0,n=a,r=i;break}l=l.sibling}if(!s){for(l=i.child;l;){if(l===r){s=!0,r=i,n=a;break}if(l===n){s=!0,n=i,r=a;break}l=l.sibling}if(!s)throw Error(H(189))}}if(r.alternate!==n)throw Error(H(190))}if(r.tag!==3)throw Error(H(188));return r.stateNode.current===r?e:t}function vw(e){return e=FN(e),e!==null?yw(e):null}function yw(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=yw(e);if(t!==null)return t;e=e.sibling}return null}var gw=zt.unstable_scheduleCallback,pg=zt.unstable_cancelCallback,zN=zt.unstable_shouldYield,WN=zt.unstable_requestPaint,Le=zt.unstable_now,UN=zt.unstable_getCurrentPriorityLevel,rv=zt.unstable_ImmediatePriority,xw=zt.unstable_UserBlockingPriority,Ac=zt.unstable_NormalPriority,HN=zt.unstable_LowPriority,bw=zt.unstable_IdlePriority,nd=null,Pr=null;function KN(e){if(Pr&&typeof Pr.onCommitFiberRoot=="function")try{Pr.onCommitFiberRoot(nd,e,void 0,(e.current.flags&128)===128)}catch{}}var mr=Math.clz32?Math.clz32:YN,VN=Math.log,GN=Math.LN2;function YN(e){return e>>>=0,e===0?32:31-(VN(e)/GN|0)|0}var El=64,$l=4194304;function zo(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Cc(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,a=e.suspendedLanes,i=e.pingedLanes,s=r&268435455;if(s!==0){var l=s&~a;l!==0?n=zo(l):(i&=s,i!==0&&(n=zo(i)))}else s=r&~a,s!==0?n=zo(s):i!==0&&(n=zo(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&a)&&(a=n&-n,i=t&-t,a>=i||a===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-mr(t),a=1<<r,n|=e[r],t&=~a;return n}function qN(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function XN(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-mr(i),l=1<<s,c=a[s];c===-1?(!(l&r)||l&n)&&(a[s]=qN(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function Lh(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function jw(){var e=El;return El<<=1,!(El&4194240)&&(El=64),e}function gf(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function cl(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-mr(t),e[t]=r}function QN(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var a=31-mr(r),i=1<<a;t[a]=0,n[a]=-1,e[a]=-1,r&=~i}}function nv(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-mr(r),a=1<<n;a&t|e[n]&t&&(e[n]|=t),r&=~a}}var ue=0;function ww(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Sw,av,_w,kw,Ow,Dh=!1,Tl=[],kn=null,On=null,Nn=null,us=new Map,ds=new Map,vn=[],JN="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function mg(e,t){switch(e){case"focusin":case"focusout":kn=null;break;case"dragenter":case"dragleave":On=null;break;case"mouseover":case"mouseout":Nn=null;break;case"pointerover":case"pointerout":us.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ds.delete(t.pointerId)}}function jo(e,t,r,n,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[a]},t!==null&&(t=dl(t),t!==null&&av(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function ZN(e,t,r,n,a){switch(t){case"focusin":return kn=jo(kn,e,t,r,n,a),!0;case"dragenter":return On=jo(On,e,t,r,n,a),!0;case"mouseover":return Nn=jo(Nn,e,t,r,n,a),!0;case"pointerover":var i=a.pointerId;return us.set(i,jo(us.get(i)||null,e,t,r,n,a)),!0;case"gotpointercapture":return i=a.pointerId,ds.set(i,jo(ds.get(i)||null,e,t,r,n,a)),!0}return!1}function Nw(e){var t=na(e.target);if(t!==null){var r=Aa(t);if(r!==null){if(t=r.tag,t===13){if(t=mw(r),t!==null){e.blockedOn=t,Ow(e.priority,function(){_w(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function hc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Rh(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);$h=n,r.target.dispatchEvent(n),$h=null}else return t=dl(r),t!==null&&av(t),e.blockedOn=r,!1;t.shift()}return!0}function vg(e,t,r){hc(e)&&r.delete(t)}function eP(){Dh=!1,kn!==null&&hc(kn)&&(kn=null),On!==null&&hc(On)&&(On=null),Nn!==null&&hc(Nn)&&(Nn=null),us.forEach(vg),ds.forEach(vg)}function wo(e,t){e.blockedOn===t&&(e.blockedOn=null,Dh||(Dh=!0,zt.unstable_scheduleCallback(zt.unstable_NormalPriority,eP)))}function fs(e){function t(a){return wo(a,e)}if(0<Tl.length){wo(Tl[0],e);for(var r=1;r<Tl.length;r++){var n=Tl[r];n.blockedOn===e&&(n.blockedOn=null)}}for(kn!==null&&wo(kn,e),On!==null&&wo(On,e),Nn!==null&&wo(Nn,e),us.forEach(t),ds.forEach(t),r=0;r<vn.length;r++)n=vn[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<vn.length&&(r=vn[0],r.blockedOn===null);)Nw(r),r.blockedOn===null&&vn.shift()}var fi=an.ReactCurrentBatchConfig,Ec=!0;function tP(e,t,r,n){var a=ue,i=fi.transition;fi.transition=null;try{ue=1,iv(e,t,r,n)}finally{ue=a,fi.transition=i}}function rP(e,t,r,n){var a=ue,i=fi.transition;fi.transition=null;try{ue=4,iv(e,t,r,n)}finally{ue=a,fi.transition=i}}function iv(e,t,r,n){if(Ec){var a=Rh(e,t,r,n);if(a===null)Pf(e,t,n,$c,r),mg(e,n);else if(ZN(a,e,t,r,n))n.stopPropagation();else if(mg(e,n),t&4&&-1<JN.indexOf(e)){for(;a!==null;){var i=dl(a);if(i!==null&&Sw(i),i=Rh(e,t,r,n),i===null&&Pf(e,t,n,$c,r),i===a)break;a=i}a!==null&&n.stopPropagation()}else Pf(e,t,n,null,r)}}var $c=null;function Rh(e,t,r,n){if($c=null,e=tv(n),e=na(e),e!==null)if(t=Aa(e),t===null)e=null;else if(r=t.tag,r===13){if(e=mw(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return $c=e,null}function Pw(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(UN()){case rv:return 1;case xw:return 4;case Ac:case HN:return 16;case bw:return 536870912;default:return 16}default:return 16}}var xn=null,ov=null,pc=null;function Aw(){if(pc)return pc;var e,t=ov,r=t.length,n,a="value"in xn?xn.value:xn.textContent,i=a.length;for(e=0;e<r&&t[e]===a[e];e++);var s=r-e;for(n=1;n<=s&&t[r-n]===a[i-n];n++);return pc=a.slice(e,1<n?1-n:void 0)}function mc(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ml(){return!0}function yg(){return!1}function Ut(e){function t(r,n,a,i,s){this._reactName=r,this._targetInst=a,this.type=n,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Ml:yg,this.isPropagationStopped=yg,this}return $e(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Ml)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Ml)},persist:function(){},isPersistent:Ml}),t}var to={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sv=Ut(to),ul=$e({},to,{view:0,detail:0}),nP=Ut(ul),xf,bf,So,ad=$e({},ul,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lv,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==So&&(So&&e.type==="mousemove"?(xf=e.screenX-So.screenX,bf=e.screenY-So.screenY):bf=xf=0,So=e),xf)},movementY:function(e){return"movementY"in e?e.movementY:bf}}),gg=Ut(ad),aP=$e({},ad,{dataTransfer:0}),iP=Ut(aP),oP=$e({},ul,{relatedTarget:0}),jf=Ut(oP),sP=$e({},to,{animationName:0,elapsedTime:0,pseudoElement:0}),lP=Ut(sP),cP=$e({},to,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),uP=Ut(cP),dP=$e({},to,{data:0}),xg=Ut(dP),fP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hP={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},pP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function mP(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=pP[e])?!!t[e]:!1}function lv(){return mP}var vP=$e({},ul,{key:function(e){if(e.key){var t=fP[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=mc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?hP[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lv,charCode:function(e){return e.type==="keypress"?mc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?mc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),yP=Ut(vP),gP=$e({},ad,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bg=Ut(gP),xP=$e({},ul,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lv}),bP=Ut(xP),jP=$e({},to,{propertyName:0,elapsedTime:0,pseudoElement:0}),wP=Ut(jP),SP=$e({},ad,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),_P=Ut(SP),kP=[9,13,27,32],cv=Xr&&"CompositionEvent"in window,Yo=null;Xr&&"documentMode"in document&&(Yo=document.documentMode);var OP=Xr&&"TextEvent"in window&&!Yo,Cw=Xr&&(!cv||Yo&&8<Yo&&11>=Yo),jg=" ",wg=!1;function Ew(e,t){switch(e){case"keyup":return kP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $w(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ya=!1;function NP(e,t){switch(e){case"compositionend":return $w(t);case"keypress":return t.which!==32?null:(wg=!0,jg);case"textInput":return e=t.data,e===jg&&wg?null:e;default:return null}}function PP(e,t){if(Ya)return e==="compositionend"||!cv&&Ew(e,t)?(e=Aw(),pc=ov=xn=null,Ya=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Cw&&t.locale!=="ko"?null:t.data;default:return null}}var AP={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Sg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!AP[e.type]:t==="textarea"}function Tw(e,t,r,n){uw(n),t=Tc(t,"onChange"),0<t.length&&(r=new sv("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var qo=null,hs=null;function CP(e){Hw(e,0)}function id(e){var t=Qa(e);if(nw(t))return e}function EP(e,t){if(e==="change")return t}var Mw=!1;if(Xr){var wf;if(Xr){var Sf="oninput"in document;if(!Sf){var _g=document.createElement("div");_g.setAttribute("oninput","return;"),Sf=typeof _g.oninput=="function"}wf=Sf}else wf=!1;Mw=wf&&(!document.documentMode||9<document.documentMode)}function kg(){qo&&(qo.detachEvent("onpropertychange",Iw),hs=qo=null)}function Iw(e){if(e.propertyName==="value"&&id(hs)){var t=[];Tw(t,hs,e,tv(e)),pw(CP,t)}}function $P(e,t,r){e==="focusin"?(kg(),qo=t,hs=r,qo.attachEvent("onpropertychange",Iw)):e==="focusout"&&kg()}function TP(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return id(hs)}function MP(e,t){if(e==="click")return id(t)}function IP(e,t){if(e==="input"||e==="change")return id(t)}function LP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gr=typeof Object.is=="function"?Object.is:LP;function ps(e,t){if(gr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var a=r[n];if(!bh.call(t,a)||!gr(e[a],t[a]))return!1}return!0}function Og(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ng(e,t){var r=Og(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Og(r)}}function Lw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Lw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Dw(){for(var e=window,t=Oc();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Oc(e.document)}return t}function uv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function DP(e){var t=Dw(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Lw(r.ownerDocument.documentElement,r)){if(n!==null&&uv(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=r.textContent.length,i=Math.min(n.start,a);n=n.end===void 0?i:Math.min(n.end,a),!e.extend&&i>n&&(a=n,n=i,i=a),a=Ng(r,i);var s=Ng(r,n);a&&s&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var RP=Xr&&"documentMode"in document&&11>=document.documentMode,qa=null,Bh=null,Xo=null,Fh=!1;function Pg(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Fh||qa==null||qa!==Oc(n)||(n=qa,"selectionStart"in n&&uv(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Xo&&ps(Xo,n)||(Xo=n,n=Tc(Bh,"onSelect"),0<n.length&&(t=new sv("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=qa)))}function Il(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Xa={animationend:Il("Animation","AnimationEnd"),animationiteration:Il("Animation","AnimationIteration"),animationstart:Il("Animation","AnimationStart"),transitionend:Il("Transition","TransitionEnd")},_f={},Rw={};Xr&&(Rw=document.createElement("div").style,"AnimationEvent"in window||(delete Xa.animationend.animation,delete Xa.animationiteration.animation,delete Xa.animationstart.animation),"TransitionEvent"in window||delete Xa.transitionend.transition);function od(e){if(_f[e])return _f[e];if(!Xa[e])return e;var t=Xa[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Rw)return _f[e]=t[r];return e}var Bw=od("animationend"),Fw=od("animationiteration"),zw=od("animationstart"),Ww=od("transitionend"),Uw=new Map,Ag="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Dn(e,t){Uw.set(e,t),Pa(t,[e])}for(var kf=0;kf<Ag.length;kf++){var Of=Ag[kf],BP=Of.toLowerCase(),FP=Of[0].toUpperCase()+Of.slice(1);Dn(BP,"on"+FP)}Dn(Bw,"onAnimationEnd");Dn(Fw,"onAnimationIteration");Dn(zw,"onAnimationStart");Dn("dblclick","onDoubleClick");Dn("focusin","onFocus");Dn("focusout","onBlur");Dn(Ww,"onTransitionEnd");bi("onMouseEnter",["mouseout","mouseover"]);bi("onMouseLeave",["mouseout","mouseover"]);bi("onPointerEnter",["pointerout","pointerover"]);bi("onPointerLeave",["pointerout","pointerover"]);Pa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Pa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Pa("onBeforeInput",["compositionend","keypress","textInput","paste"]);Pa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Pa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Pa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Wo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),zP=new Set("cancel close invalid load scroll toggle".split(" ").concat(Wo));function Cg(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,BN(n,t,void 0,e),e.currentTarget=null}function Hw(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],a=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var s=n.length-1;0<=s;s--){var l=n[s],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&a.isPropagationStopped())break e;Cg(a,l,u),i=c}else for(s=0;s<n.length;s++){if(l=n[s],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&a.isPropagationStopped())break e;Cg(a,l,u),i=c}}}if(Pc)throw e=Ih,Pc=!1,Ih=null,e}function we(e,t){var r=t[Kh];r===void 0&&(r=t[Kh]=new Set);var n=e+"__bubble";r.has(n)||(Kw(t,e,2,!1),r.add(n))}function Nf(e,t,r){var n=0;t&&(n|=4),Kw(r,e,n,t)}var Ll="_reactListening"+Math.random().toString(36).slice(2);function ms(e){if(!e[Ll]){e[Ll]=!0,Jj.forEach(function(r){r!=="selectionchange"&&(zP.has(r)||Nf(r,!1,e),Nf(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ll]||(t[Ll]=!0,Nf("selectionchange",!1,t))}}function Kw(e,t,r,n){switch(Pw(t)){case 1:var a=tP;break;case 4:a=rP;break;default:a=iv}r=a.bind(null,t,r,e),a=void 0,!Mh||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),n?a!==void 0?e.addEventListener(t,r,{capture:!0,passive:a}):e.addEventListener(t,r,!0):a!==void 0?e.addEventListener(t,r,{passive:a}):e.addEventListener(t,r,!1)}function Pf(e,t,r,n,a){var i=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var s=n.tag;if(s===3||s===4){var l=n.stateNode.containerInfo;if(l===a||l.nodeType===8&&l.parentNode===a)break;if(s===4)for(s=n.return;s!==null;){var c=s.tag;if((c===3||c===4)&&(c=s.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;s=s.return}for(;l!==null;){if(s=na(l),s===null)return;if(c=s.tag,c===5||c===6){n=i=s;continue e}l=l.parentNode}}n=n.return}pw(function(){var u=i,f=tv(r),d=[];e:{var h=Uw.get(e);if(h!==void 0){var p=sv,g=e;switch(e){case"keypress":if(mc(r)===0)break e;case"keydown":case"keyup":p=yP;break;case"focusin":g="focus",p=jf;break;case"focusout":g="blur",p=jf;break;case"beforeblur":case"afterblur":p=jf;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=gg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=iP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=bP;break;case Bw:case Fw:case zw:p=lP;break;case Ww:p=wP;break;case"scroll":p=nP;break;case"wheel":p=_P;break;case"copy":case"cut":case"paste":p=uP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=bg}var y=(t&4)!==0,b=!y&&e==="scroll",v=y?h!==null?h+"Capture":null:h;y=[];for(var m=u,x;m!==null;){x=m;var S=x.stateNode;if(x.tag===5&&S!==null&&(x=S,v!==null&&(S=cs(m,v),S!=null&&y.push(vs(m,S,x)))),b)break;m=m.return}0<y.length&&(h=new p(h,g,null,r,f),d.push({event:h,listeners:y}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&r!==$h&&(g=r.relatedTarget||r.fromElement)&&(na(g)||g[Qr]))break e;if((p||h)&&(h=f.window===f?f:(h=f.ownerDocument)?h.defaultView||h.parentWindow:window,p?(g=r.relatedTarget||r.toElement,p=u,g=g?na(g):null,g!==null&&(b=Aa(g),g!==b||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=u),p!==g)){if(y=gg,S="onMouseLeave",v="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(y=bg,S="onPointerLeave",v="onPointerEnter",m="pointer"),b=p==null?h:Qa(p),x=g==null?h:Qa(g),h=new y(S,m+"leave",p,r,f),h.target=b,h.relatedTarget=x,S=null,na(f)===u&&(y=new y(v,m+"enter",g,r,f),y.target=x,y.relatedTarget=b,S=y),b=S,p&&g)t:{for(y=p,v=g,m=0,x=y;x;x=Da(x))m++;for(x=0,S=v;S;S=Da(S))x++;for(;0<m-x;)y=Da(y),m--;for(;0<x-m;)v=Da(v),x--;for(;m--;){if(y===v||v!==null&&y===v.alternate)break t;y=Da(y),v=Da(v)}y=null}else y=null;p!==null&&Eg(d,h,p,y,!1),g!==null&&b!==null&&Eg(d,b,g,y,!0)}}e:{if(h=u?Qa(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var j=EP;else if(Sg(h))if(Mw)j=IP;else{j=TP;var w=$P}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(j=MP);if(j&&(j=j(e,u))){Tw(d,j,r,f);break e}w&&w(e,h,u),e==="focusout"&&(w=h._wrapperState)&&w.controlled&&h.type==="number"&&Nh(h,"number",h.value)}switch(w=u?Qa(u):window,e){case"focusin":(Sg(w)||w.contentEditable==="true")&&(qa=w,Bh=u,Xo=null);break;case"focusout":Xo=Bh=qa=null;break;case"mousedown":Fh=!0;break;case"contextmenu":case"mouseup":case"dragend":Fh=!1,Pg(d,r,f);break;case"selectionchange":if(RP)break;case"keydown":case"keyup":Pg(d,r,f)}var _;if(cv)e:{switch(e){case"compositionstart":var O="onCompositionStart";break e;case"compositionend":O="onCompositionEnd";break e;case"compositionupdate":O="onCompositionUpdate";break e}O=void 0}else Ya?Ew(e,r)&&(O="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(O="onCompositionStart");O&&(Cw&&r.locale!=="ko"&&(Ya||O!=="onCompositionStart"?O==="onCompositionEnd"&&Ya&&(_=Aw()):(xn=f,ov="value"in xn?xn.value:xn.textContent,Ya=!0)),w=Tc(u,O),0<w.length&&(O=new xg(O,e,null,r,f),d.push({event:O,listeners:w}),_?O.data=_:(_=$w(r),_!==null&&(O.data=_)))),(_=OP?NP(e,r):PP(e,r))&&(u=Tc(u,"onBeforeInput"),0<u.length&&(f=new xg("onBeforeInput","beforeinput",null,r,f),d.push({event:f,listeners:u}),f.data=_))}Hw(d,t)})}function vs(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Tc(e,t){for(var r=t+"Capture",n=[];e!==null;){var a=e,i=a.stateNode;a.tag===5&&i!==null&&(a=i,i=cs(e,r),i!=null&&n.unshift(vs(e,i,a)),i=cs(e,t),i!=null&&n.push(vs(e,i,a))),e=e.return}return n}function Da(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Eg(e,t,r,n,a){for(var i=t._reactName,s=[];r!==null&&r!==n;){var l=r,c=l.alternate,u=l.stateNode;if(c!==null&&c===n)break;l.tag===5&&u!==null&&(l=u,a?(c=cs(r,i),c!=null&&s.unshift(vs(r,c,l))):a||(c=cs(r,i),c!=null&&s.push(vs(r,c,l)))),r=r.return}s.length!==0&&e.push({event:t,listeners:s})}var WP=/\r\n?/g,UP=/\u0000|\uFFFD/g;function $g(e){return(typeof e=="string"?e:""+e).replace(WP,`
+`).replace(UP,"")}function Dl(e,t,r){if(t=$g(t),$g(e)!==t&&r)throw Error(H(425))}function Mc(){}var zh=null,Wh=null;function Uh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Hh=typeof setTimeout=="function"?setTimeout:void 0,HP=typeof clearTimeout=="function"?clearTimeout:void 0,Tg=typeof Promise=="function"?Promise:void 0,KP=typeof queueMicrotask=="function"?queueMicrotask:typeof Tg<"u"?function(e){return Tg.resolve(null).then(e).catch(VP)}:Hh;function VP(e){setTimeout(function(){throw e})}function Af(e,t){var r=t,n=0;do{var a=r.nextSibling;if(e.removeChild(r),a&&a.nodeType===8)if(r=a.data,r==="/$"){if(n===0){e.removeChild(a),fs(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=a}while(r);fs(t)}function Pn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Mg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var ro=Math.random().toString(36).slice(2),kr="__reactFiber$"+ro,ys="__reactProps$"+ro,Qr="__reactContainer$"+ro,Kh="__reactEvents$"+ro,GP="__reactListeners$"+ro,YP="__reactHandles$"+ro;function na(e){var t=e[kr];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Qr]||r[kr]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Mg(e);e!==null;){if(r=e[kr])return r;e=Mg(e)}return t}e=r,r=e.parentNode}return null}function dl(e){return e=e[kr]||e[Qr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Qa(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(H(33))}function sd(e){return e[ys]||null}var Vh=[],Ja=-1;function Rn(e){return{current:e}}function ke(e){0>Ja||(e.current=Vh[Ja],Vh[Ja]=null,Ja--)}function je(e,t){Ja++,Vh[Ja]=e.current,e.current=t}var Ln={},vt=Rn(Ln),At=Rn(!1),ya=Ln;function ji(e,t){var r=e.type.contextTypes;if(!r)return Ln;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in r)a[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Ct(e){return e=e.childContextTypes,e!=null}function Ic(){ke(At),ke(vt)}function Ig(e,t,r){if(vt.current!==Ln)throw Error(H(168));je(vt,t),je(At,r)}function Vw(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var a in n)if(!(a in t))throw Error(H(108,$N(e)||"Unknown",a));return $e({},r,n)}function Lc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ln,ya=vt.current,je(vt,e),je(At,At.current),!0}function Lg(e,t,r){var n=e.stateNode;if(!n)throw Error(H(169));r?(e=Vw(e,t,ya),n.__reactInternalMemoizedMergedChildContext=e,ke(At),ke(vt),je(vt,e)):ke(At),je(At,r)}var zr=null,ld=!1,Cf=!1;function Gw(e){zr===null?zr=[e]:zr.push(e)}function qP(e){ld=!0,Gw(e)}function Bn(){if(!Cf&&zr!==null){Cf=!0;var e=0,t=ue;try{var r=zr;for(ue=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}zr=null,ld=!1}catch(a){throw zr!==null&&(zr=zr.slice(e+1)),gw(rv,Bn),a}finally{ue=t,Cf=!1}}return null}var Za=[],ei=0,Dc=null,Rc=0,Gt=[],Yt=0,ga=null,Wr=1,Ur="";function Qn(e,t){Za[ei++]=Rc,Za[ei++]=Dc,Dc=e,Rc=t}function Yw(e,t,r){Gt[Yt++]=Wr,Gt[Yt++]=Ur,Gt[Yt++]=ga,ga=e;var n=Wr;e=Ur;var a=32-mr(n)-1;n&=~(1<<a),r+=1;var i=32-mr(t)+a;if(30<i){var s=a-a%5;i=(n&(1<<s)-1).toString(32),n>>=s,a-=s,Wr=1<<32-mr(t)+a|r<<a|n,Ur=i+e}else Wr=1<<i|r<<a|n,Ur=e}function dv(e){e.return!==null&&(Qn(e,1),Yw(e,1,0))}function fv(e){for(;e===Dc;)Dc=Za[--ei],Za[ei]=null,Rc=Za[--ei],Za[ei]=null;for(;e===ga;)ga=Gt[--Yt],Gt[Yt]=null,Ur=Gt[--Yt],Gt[Yt]=null,Wr=Gt[--Yt],Gt[Yt]=null}var Rt=null,Dt=null,Ne=!1,hr=null;function qw(e,t){var r=Xt(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Dg(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Rt=e,Dt=Pn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Rt=e,Dt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=ga!==null?{id:Wr,overflow:Ur}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Xt(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Rt=e,Dt=null,!0):!1;default:return!1}}function Gh(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Yh(e){if(Ne){var t=Dt;if(t){var r=t;if(!Dg(e,t)){if(Gh(e))throw Error(H(418));t=Pn(r.nextSibling);var n=Rt;t&&Dg(e,t)?qw(n,r):(e.flags=e.flags&-4097|2,Ne=!1,Rt=e)}}else{if(Gh(e))throw Error(H(418));e.flags=e.flags&-4097|2,Ne=!1,Rt=e}}}function Rg(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Rt=e}function Rl(e){if(e!==Rt)return!1;if(!Ne)return Rg(e),Ne=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Uh(e.type,e.memoizedProps)),t&&(t=Dt)){if(Gh(e))throw Xw(),Error(H(418));for(;t;)qw(e,t),t=Pn(t.nextSibling)}if(Rg(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(H(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Dt=Pn(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Dt=null}}else Dt=Rt?Pn(e.stateNode.nextSibling):null;return!0}function Xw(){for(var e=Dt;e;)e=Pn(e.nextSibling)}function wi(){Dt=Rt=null,Ne=!1}function hv(e){hr===null?hr=[e]:hr.push(e)}var XP=an.ReactCurrentBatchConfig;function _o(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(H(309));var n=r.stateNode}if(!n)throw Error(H(147,e));var a=n,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var l=a.refs;s===null?delete l[i]:l[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(H(284));if(!r._owner)throw Error(H(290,e))}return e}function Bl(e,t){throw e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Bg(e){var t=e._init;return t(e._payload)}function Qw(e){function t(v,m){if(e){var x=v.deletions;x===null?(v.deletions=[m],v.flags|=16):x.push(m)}}function r(v,m){if(!e)return null;for(;m!==null;)t(v,m),m=m.sibling;return null}function n(v,m){for(v=new Map;m!==null;)m.key!==null?v.set(m.key,m):v.set(m.index,m),m=m.sibling;return v}function a(v,m){return v=$n(v,m),v.index=0,v.sibling=null,v}function i(v,m,x){return v.index=x,e?(x=v.alternate,x!==null?(x=x.index,x<m?(v.flags|=2,m):x):(v.flags|=2,m)):(v.flags|=1048576,m)}function s(v){return e&&v.alternate===null&&(v.flags|=2),v}function l(v,m,x,S){return m===null||m.tag!==6?(m=Df(x,v.mode,S),m.return=v,m):(m=a(m,x),m.return=v,m)}function c(v,m,x,S){var j=x.type;return j===Ga?f(v,m,x.props.children,S,x.key):m!==null&&(m.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===hn&&Bg(j)===m.type)?(S=a(m,x.props),S.ref=_o(v,m,x),S.return=v,S):(S=wc(x.type,x.key,x.props,null,v.mode,S),S.ref=_o(v,m,x),S.return=v,S)}function u(v,m,x,S){return m===null||m.tag!==4||m.stateNode.containerInfo!==x.containerInfo||m.stateNode.implementation!==x.implementation?(m=Rf(x,v.mode,S),m.return=v,m):(m=a(m,x.children||[]),m.return=v,m)}function f(v,m,x,S,j){return m===null||m.tag!==7?(m=ha(x,v.mode,S,j),m.return=v,m):(m=a(m,x),m.return=v,m)}function d(v,m,x){if(typeof m=="string"&&m!==""||typeof m=="number")return m=Df(""+m,v.mode,x),m.return=v,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Pl:return x=wc(m.type,m.key,m.props,null,v.mode,x),x.ref=_o(v,null,m),x.return=v,x;case Va:return m=Rf(m,v.mode,x),m.return=v,m;case hn:var S=m._init;return d(v,S(m._payload),x)}if(Fo(m)||xo(m))return m=ha(m,v.mode,x,null),m.return=v,m;Bl(v,m)}return null}function h(v,m,x,S){var j=m!==null?m.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return j!==null?null:l(v,m,""+x,S);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Pl:return x.key===j?c(v,m,x,S):null;case Va:return x.key===j?u(v,m,x,S):null;case hn:return j=x._init,h(v,m,j(x._payload),S)}if(Fo(x)||xo(x))return j!==null?null:f(v,m,x,S,null);Bl(v,x)}return null}function p(v,m,x,S,j){if(typeof S=="string"&&S!==""||typeof S=="number")return v=v.get(x)||null,l(m,v,""+S,j);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Pl:return v=v.get(S.key===null?x:S.key)||null,c(m,v,S,j);case Va:return v=v.get(S.key===null?x:S.key)||null,u(m,v,S,j);case hn:var w=S._init;return p(v,m,x,w(S._payload),j)}if(Fo(S)||xo(S))return v=v.get(x)||null,f(m,v,S,j,null);Bl(m,S)}return null}function g(v,m,x,S){for(var j=null,w=null,_=m,O=m=0,N=null;_!==null&&O<x.length;O++){_.index>O?(N=_,_=null):N=_.sibling;var k=h(v,_,x[O],S);if(k===null){_===null&&(_=N);break}e&&_&&k.alternate===null&&t(v,_),m=i(k,m,O),w===null?j=k:w.sibling=k,w=k,_=N}if(O===x.length)return r(v,_),Ne&&Qn(v,O),j;if(_===null){for(;O<x.length;O++)_=d(v,x[O],S),_!==null&&(m=i(_,m,O),w===null?j=_:w.sibling=_,w=_);return Ne&&Qn(v,O),j}for(_=n(v,_);O<x.length;O++)N=p(_,v,O,x[O],S),N!==null&&(e&&N.alternate!==null&&_.delete(N.key===null?O:N.key),m=i(N,m,O),w===null?j=N:w.sibling=N,w=N);return e&&_.forEach(function(E){return t(v,E)}),Ne&&Qn(v,O),j}function y(v,m,x,S){var j=xo(x);if(typeof j!="function")throw Error(H(150));if(x=j.call(x),x==null)throw Error(H(151));for(var w=j=null,_=m,O=m=0,N=null,k=x.next();_!==null&&!k.done;O++,k=x.next()){_.index>O?(N=_,_=null):N=_.sibling;var E=h(v,_,k.value,S);if(E===null){_===null&&(_=N);break}e&&_&&E.alternate===null&&t(v,_),m=i(E,m,O),w===null?j=E:w.sibling=E,w=E,_=N}if(k.done)return r(v,_),Ne&&Qn(v,O),j;if(_===null){for(;!k.done;O++,k=x.next())k=d(v,k.value,S),k!==null&&(m=i(k,m,O),w===null?j=k:w.sibling=k,w=k);return Ne&&Qn(v,O),j}for(_=n(v,_);!k.done;O++,k=x.next())k=p(_,v,O,k.value,S),k!==null&&(e&&k.alternate!==null&&_.delete(k.key===null?O:k.key),m=i(k,m,O),w===null?j=k:w.sibling=k,w=k);return e&&_.forEach(function(T){return t(v,T)}),Ne&&Qn(v,O),j}function b(v,m,x,S){if(typeof x=="object"&&x!==null&&x.type===Ga&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Pl:e:{for(var j=x.key,w=m;w!==null;){if(w.key===j){if(j=x.type,j===Ga){if(w.tag===7){r(v,w.sibling),m=a(w,x.props.children),m.return=v,v=m;break e}}else if(w.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===hn&&Bg(j)===w.type){r(v,w.sibling),m=a(w,x.props),m.ref=_o(v,w,x),m.return=v,v=m;break e}r(v,w);break}else t(v,w);w=w.sibling}x.type===Ga?(m=ha(x.props.children,v.mode,S,x.key),m.return=v,v=m):(S=wc(x.type,x.key,x.props,null,v.mode,S),S.ref=_o(v,m,x),S.return=v,v=S)}return s(v);case Va:e:{for(w=x.key;m!==null;){if(m.key===w)if(m.tag===4&&m.stateNode.containerInfo===x.containerInfo&&m.stateNode.implementation===x.implementation){r(v,m.sibling),m=a(m,x.children||[]),m.return=v,v=m;break e}else{r(v,m);break}else t(v,m);m=m.sibling}m=Rf(x,v.mode,S),m.return=v,v=m}return s(v);case hn:return w=x._init,b(v,m,w(x._payload),S)}if(Fo(x))return g(v,m,x,S);if(xo(x))return y(v,m,x,S);Bl(v,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,m!==null&&m.tag===6?(r(v,m.sibling),m=a(m,x),m.return=v,v=m):(r(v,m),m=Df(x,v.mode,S),m.return=v,v=m),s(v)):r(v,m)}return b}var Si=Qw(!0),Jw=Qw(!1),Bc=Rn(null),Fc=null,ti=null,pv=null;function mv(){pv=ti=Fc=null}function vv(e){var t=Bc.current;ke(Bc),e._currentValue=t}function qh(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function hi(e,t){Fc=e,pv=ti=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Nt=!0),e.firstContext=null)}function Zt(e){var t=e._currentValue;if(pv!==e)if(e={context:e,memoizedValue:t,next:null},ti===null){if(Fc===null)throw Error(H(308));ti=e,Fc.dependencies={lanes:0,firstContext:e}}else ti=ti.next=e;return t}var aa=null;function yv(e){aa===null?aa=[e]:aa.push(e)}function Zw(e,t,r,n){var a=t.interleaved;return a===null?(r.next=r,yv(t)):(r.next=a.next,a.next=r),t.interleaved=r,Jr(e,n)}function Jr(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var pn=!1;function gv(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function e2(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Gr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function An(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,se&2){var a=n.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),n.pending=t,Jr(e,r)}return a=n.interleaved,a===null?(t.next=t,yv(n)):(t.next=a.next,a.next=t),n.interleaved=t,Jr(e,r)}function vc(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,nv(e,r)}}function Fg(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var a=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var s={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?a=i=s:i=i.next=s,r=r.next}while(r!==null);i===null?a=i=t:i=i.next=t}else a=i=t;r={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function zc(e,t,r,n){var a=e.updateQueue;pn=!1;var i=a.firstBaseUpdate,s=a.lastBaseUpdate,l=a.shared.pending;if(l!==null){a.shared.pending=null;var c=l,u=c.next;c.next=null,s===null?i=u:s.next=u,s=c;var f=e.alternate;f!==null&&(f=f.updateQueue,l=f.lastBaseUpdate,l!==s&&(l===null?f.firstBaseUpdate=u:l.next=u,f.lastBaseUpdate=c))}if(i!==null){var d=a.baseState;s=0,f=u=c=null,l=i;do{var h=l.lane,p=l.eventTime;if((n&h)===h){f!==null&&(f=f.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,y=l;switch(h=t,p=r,y.tag){case 1:if(g=y.payload,typeof g=="function"){d=g.call(p,d,h);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=y.payload,h=typeof g=="function"?g.call(p,d,h):g,h==null)break e;d=$e({},d,h);break e;case 2:pn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=a.effects,h===null?a.effects=[l]:h.push(l))}else p={eventTime:p,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},f===null?(u=f=p,c=d):f=f.next=p,s|=h;if(l=l.next,l===null){if(l=a.shared.pending,l===null)break;h=l,l=h.next,h.next=null,a.lastBaseUpdate=h,a.shared.pending=null}}while(!0);if(f===null&&(c=d),a.baseState=c,a.firstBaseUpdate=u,a.lastBaseUpdate=f,t=a.shared.interleaved,t!==null){a=t;do s|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);ba|=s,e.lanes=s,e.memoizedState=d}}function zg(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],a=n.callback;if(a!==null){if(n.callback=null,n=r,typeof a!="function")throw Error(H(191,a));a.call(n)}}}var fl={},Ar=Rn(fl),gs=Rn(fl),xs=Rn(fl);function ia(e){if(e===fl)throw Error(H(174));return e}function xv(e,t){switch(je(xs,t),je(gs,e),je(Ar,fl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ah(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ah(t,e)}ke(Ar),je(Ar,t)}function _i(){ke(Ar),ke(gs),ke(xs)}function t2(e){ia(xs.current);var t=ia(Ar.current),r=Ah(t,e.type);t!==r&&(je(gs,e),je(Ar,r))}function bv(e){gs.current===e&&(ke(Ar),ke(gs))}var Ce=Rn(0);function Wc(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ef=[];function jv(){for(var e=0;e<Ef.length;e++)Ef[e]._workInProgressVersionPrimary=null;Ef.length=0}var yc=an.ReactCurrentDispatcher,$f=an.ReactCurrentBatchConfig,xa=0,Ee=null,Ve=null,et=null,Uc=!1,Qo=!1,bs=0,QP=0;function dt(){throw Error(H(321))}function wv(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!gr(e[r],t[r]))return!1;return!0}function Sv(e,t,r,n,a,i){if(xa=i,Ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,yc.current=e===null||e.memoizedState===null?tA:rA,e=r(n,a),Qo){i=0;do{if(Qo=!1,bs=0,25<=i)throw Error(H(301));i+=1,et=Ve=null,t.updateQueue=null,yc.current=nA,e=r(n,a)}while(Qo)}if(yc.current=Hc,t=Ve!==null&&Ve.next!==null,xa=0,et=Ve=Ee=null,Uc=!1,t)throw Error(H(300));return e}function _v(){var e=bs!==0;return bs=0,e}function _r(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return et===null?Ee.memoizedState=et=e:et=et.next=e,et}function er(){if(Ve===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=et===null?Ee.memoizedState:et.next;if(t!==null)et=t,Ve=e;else{if(e===null)throw Error(H(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},et===null?Ee.memoizedState=et=e:et=et.next=e}return et}function js(e,t){return typeof t=="function"?t(e):t}function Tf(e){var t=er(),r=t.queue;if(r===null)throw Error(H(311));r.lastRenderedReducer=e;var n=Ve,a=n.baseQueue,i=r.pending;if(i!==null){if(a!==null){var s=a.next;a.next=i.next,i.next=s}n.baseQueue=a=i,r.pending=null}if(a!==null){i=a.next,n=n.baseState;var l=s=null,c=null,u=i;do{var f=u.lane;if((xa&f)===f)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:e(n,u.action);else{var d={lane:f,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=d,s=n):c=c.next=d,Ee.lanes|=f,ba|=f}u=u.next}while(u!==null&&u!==i);c===null?s=n:c.next=l,gr(n,t.memoizedState)||(Nt=!0),t.memoizedState=n,t.baseState=s,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){a=e;do i=a.lane,Ee.lanes|=i,ba|=i,a=a.next;while(a!==e)}else a===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Mf(e){var t=er(),r=t.queue;if(r===null)throw Error(H(311));r.lastRenderedReducer=e;var n=r.dispatch,a=r.pending,i=t.memoizedState;if(a!==null){r.pending=null;var s=a=a.next;do i=e(i,s.action),s=s.next;while(s!==a);gr(i,t.memoizedState)||(Nt=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),r.lastRenderedState=i}return[i,n]}function r2(){}function n2(e,t){var r=Ee,n=er(),a=t(),i=!gr(n.memoizedState,a);if(i&&(n.memoizedState=a,Nt=!0),n=n.queue,kv(o2.bind(null,r,n,e),[e]),n.getSnapshot!==t||i||et!==null&&et.memoizedState.tag&1){if(r.flags|=2048,ws(9,i2.bind(null,r,n,a,t),void 0,null),nt===null)throw Error(H(349));xa&30||a2(r,t,a)}return a}function a2(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Ee.updateQueue,t===null?(t={lastEffect:null,stores:null},Ee.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function i2(e,t,r,n){t.value=r,t.getSnapshot=n,s2(t)&&l2(e)}function o2(e,t,r){return r(function(){s2(t)&&l2(e)})}function s2(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!gr(e,r)}catch{return!0}}function l2(e){var t=Jr(e,1);t!==null&&vr(t,e,1,-1)}function Wg(e){var t=_r();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:e},t.queue=e,e=e.dispatch=eA.bind(null,Ee,e),[t.memoizedState,e]}function ws(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Ee.updateQueue,t===null?(t={lastEffect:null,stores:null},Ee.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function c2(){return er().memoizedState}function gc(e,t,r,n){var a=_r();Ee.flags|=e,a.memoizedState=ws(1|t,r,void 0,n===void 0?null:n)}function cd(e,t,r,n){var a=er();n=n===void 0?null:n;var i=void 0;if(Ve!==null){var s=Ve.memoizedState;if(i=s.destroy,n!==null&&wv(n,s.deps)){a.memoizedState=ws(t,r,i,n);return}}Ee.flags|=e,a.memoizedState=ws(1|t,r,i,n)}function Ug(e,t){return gc(8390656,8,e,t)}function kv(e,t){return cd(2048,8,e,t)}function u2(e,t){return cd(4,2,e,t)}function d2(e,t){return cd(4,4,e,t)}function f2(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function h2(e,t,r){return r=r!=null?r.concat([e]):null,cd(4,4,f2.bind(null,t,e),r)}function Ov(){}function p2(e,t){var r=er();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&wv(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function m2(e,t){var r=er();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&wv(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function v2(e,t,r){return xa&21?(gr(r,t)||(r=jw(),Ee.lanes|=r,ba|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Nt=!0),e.memoizedState=r)}function JP(e,t){var r=ue;ue=r!==0&&4>r?r:4,e(!0);var n=$f.transition;$f.transition={};try{e(!1),t()}finally{ue=r,$f.transition=n}}function y2(){return er().memoizedState}function ZP(e,t,r){var n=En(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},g2(e))x2(t,r);else if(r=Zw(e,t,r,n),r!==null){var a=jt();vr(r,e,n,a),b2(r,t,n)}}function eA(e,t,r){var n=En(e),a={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(g2(e))x2(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,l=i(s,r);if(a.hasEagerState=!0,a.eagerState=l,gr(l,s)){var c=t.interleaved;c===null?(a.next=a,yv(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}r=Zw(e,t,a,n),r!==null&&(a=jt(),vr(r,e,n,a),b2(r,t,n))}}function g2(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function x2(e,t){Qo=Uc=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function b2(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,nv(e,r)}}var Hc={readContext:Zt,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useInsertionEffect:dt,useLayoutEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useMutableSource:dt,useSyncExternalStore:dt,useId:dt,unstable_isNewReconciler:!1},tA={readContext:Zt,useCallback:function(e,t){return _r().memoizedState=[e,t===void 0?null:t],e},useContext:Zt,useEffect:Ug,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,gc(4194308,4,f2.bind(null,t,e),r)},useLayoutEffect:function(e,t){return gc(4194308,4,e,t)},useInsertionEffect:function(e,t){return gc(4,2,e,t)},useMemo:function(e,t){var r=_r();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=_r();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=ZP.bind(null,Ee,e),[n.memoizedState,e]},useRef:function(e){var t=_r();return e={current:e},t.memoizedState=e},useState:Wg,useDebugValue:Ov,useDeferredValue:function(e){return _r().memoizedState=e},useTransition:function(){var e=Wg(!1),t=e[0];return e=JP.bind(null,e[1]),_r().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ee,a=_r();if(Ne){if(r===void 0)throw Error(H(407));r=r()}else{if(r=t(),nt===null)throw Error(H(349));xa&30||a2(n,t,r)}a.memoizedState=r;var i={value:r,getSnapshot:t};return a.queue=i,Ug(o2.bind(null,n,i,e),[e]),n.flags|=2048,ws(9,i2.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=_r(),t=nt.identifierPrefix;if(Ne){var r=Ur,n=Wr;r=(n&~(1<<32-mr(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=bs++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=QP++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},rA={readContext:Zt,useCallback:p2,useContext:Zt,useEffect:kv,useImperativeHandle:h2,useInsertionEffect:u2,useLayoutEffect:d2,useMemo:m2,useReducer:Tf,useRef:c2,useState:function(){return Tf(js)},useDebugValue:Ov,useDeferredValue:function(e){var t=er();return v2(t,Ve.memoizedState,e)},useTransition:function(){var e=Tf(js)[0],t=er().memoizedState;return[e,t]},useMutableSource:r2,useSyncExternalStore:n2,useId:y2,unstable_isNewReconciler:!1},nA={readContext:Zt,useCallback:p2,useContext:Zt,useEffect:kv,useImperativeHandle:h2,useInsertionEffect:u2,useLayoutEffect:d2,useMemo:m2,useReducer:Mf,useRef:c2,useState:function(){return Mf(js)},useDebugValue:Ov,useDeferredValue:function(e){var t=er();return Ve===null?t.memoizedState=e:v2(t,Ve.memoizedState,e)},useTransition:function(){var e=Mf(js)[0],t=er().memoizedState;return[e,t]},useMutableSource:r2,useSyncExternalStore:n2,useId:y2,unstable_isNewReconciler:!1};function ur(e,t){if(e&&e.defaultProps){t=$e({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Xh(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:$e({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var ud={isMounted:function(e){return(e=e._reactInternals)?Aa(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=jt(),a=En(e),i=Gr(n,a);i.payload=t,r!=null&&(i.callback=r),t=An(e,i,a),t!==null&&(vr(t,e,a,n),vc(t,e,a))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=jt(),a=En(e),i=Gr(n,a);i.tag=1,i.payload=t,r!=null&&(i.callback=r),t=An(e,i,a),t!==null&&(vr(t,e,a,n),vc(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=jt(),n=En(e),a=Gr(r,n);a.tag=2,t!=null&&(a.callback=t),t=An(e,a,n),t!==null&&(vr(t,e,n,r),vc(t,e,n))}};function Hg(e,t,r,n,a,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,s):t.prototype&&t.prototype.isPureReactComponent?!ps(r,n)||!ps(a,i):!0}function j2(e,t,r){var n=!1,a=Ln,i=t.contextType;return typeof i=="object"&&i!==null?i=Zt(i):(a=Ct(t)?ya:vt.current,n=t.contextTypes,i=(n=n!=null)?ji(e,a):Ln),t=new t(r,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ud,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=i),t}function Kg(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&ud.enqueueReplaceState(t,t.state,null)}function Qh(e,t,r,n){var a=e.stateNode;a.props=r,a.state=e.memoizedState,a.refs={},gv(e);var i=t.contextType;typeof i=="object"&&i!==null?a.context=Zt(i):(i=Ct(t)?ya:vt.current,a.context=ji(e,i)),a.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Xh(e,t,i,r),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&ud.enqueueReplaceState(a,a.state,null),zc(e,r,a,n),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function ki(e,t){try{var r="",n=t;do r+=EN(n),n=n.return;while(n);var a=r}catch(i){a=`
+Error generating stack: `+i.message+`
+`+i.stack}return{value:e,source:t,stack:a,digest:null}}function If(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Jh(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var aA=typeof WeakMap=="function"?WeakMap:Map;function w2(e,t,r){r=Gr(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Vc||(Vc=!0,lp=n),Jh(e,t)},r}function S2(e,t,r){r=Gr(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var a=t.value;r.payload=function(){return n(a)},r.callback=function(){Jh(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){Jh(e,t),typeof n!="function"&&(Cn===null?Cn=new Set([this]):Cn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),r}function Vg(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new aA;var a=new Set;n.set(t,a)}else a=n.get(t),a===void 0&&(a=new Set,n.set(t,a));a.has(r)||(a.add(r),e=gA.bind(null,e,t,r),t.then(e,e))}function Gg(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Yg(e,t,r,n,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Gr(-1,1),t.tag=2,An(r,t,1))),r.lanes|=1),e)}var iA=an.ReactCurrentOwner,Nt=!1;function gt(e,t,r,n){t.child=e===null?Jw(t,null,r,n):Si(t,e.child,r,n)}function qg(e,t,r,n,a){r=r.render;var i=t.ref;return hi(t,a),n=Sv(e,t,r,n,i,a),r=_v(),e!==null&&!Nt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Zr(e,t,a)):(Ne&&r&&dv(t),t.flags|=1,gt(e,t,n,a),t.child)}function Xg(e,t,r,n,a){if(e===null){var i=r.type;return typeof i=="function"&&!Mv(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=i,_2(e,t,i,n,a)):(e=wc(r.type,null,n,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&a)){var s=i.memoizedProps;if(r=r.compare,r=r!==null?r:ps,r(s,n)&&e.ref===t.ref)return Zr(e,t,a)}return t.flags|=1,e=$n(i,n),e.ref=t.ref,e.return=t,t.child=e}function _2(e,t,r,n,a){if(e!==null){var i=e.memoizedProps;if(ps(i,n)&&e.ref===t.ref)if(Nt=!1,t.pendingProps=n=i,(e.lanes&a)!==0)e.flags&131072&&(Nt=!0);else return t.lanes=e.lanes,Zr(e,t,a)}return Zh(e,t,r,n,a)}function k2(e,t,r){var n=t.pendingProps,a=n.children,i=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},je(ni,Mt),Mt|=r;else{if(!(r&1073741824))return e=i!==null?i.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,je(ni,Mt),Mt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,je(ni,Mt),Mt|=n}else i!==null?(n=i.baseLanes|r,t.memoizedState=null):n=r,je(ni,Mt),Mt|=n;return gt(e,t,a,r),t.child}function O2(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Zh(e,t,r,n,a){var i=Ct(r)?ya:vt.current;return i=ji(t,i),hi(t,a),r=Sv(e,t,r,n,i,a),n=_v(),e!==null&&!Nt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Zr(e,t,a)):(Ne&&n&&dv(t),t.flags|=1,gt(e,t,r,a),t.child)}function Qg(e,t,r,n,a){if(Ct(r)){var i=!0;Lc(t)}else i=!1;if(hi(t,a),t.stateNode===null)xc(e,t),j2(t,r,n),Qh(t,r,n,a),n=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var c=s.context,u=r.contextType;typeof u=="object"&&u!==null?u=Zt(u):(u=Ct(r)?ya:vt.current,u=ji(t,u));var f=r.getDerivedStateFromProps,d=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==n||c!==u)&&Kg(t,s,n,u),pn=!1;var h=t.memoizedState;s.state=h,zc(t,n,s,a),c=t.memoizedState,l!==n||h!==c||At.current||pn?(typeof f=="function"&&(Xh(t,r,f,n),c=t.memoizedState),(l=pn||Hg(t,r,l,n,h,c,u))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),s.props=n,s.state=c,s.context=u,n=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{s=t.stateNode,e2(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:ur(t.type,l),s.props=u,d=t.pendingProps,h=s.context,c=r.contextType,typeof c=="object"&&c!==null?c=Zt(c):(c=Ct(r)?ya:vt.current,c=ji(t,c));var p=r.getDerivedStateFromProps;(f=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==d||h!==c)&&Kg(t,s,n,c),pn=!1,h=t.memoizedState,s.state=h,zc(t,n,s,a);var g=t.memoizedState;l!==d||h!==g||At.current||pn?(typeof p=="function"&&(Xh(t,r,p,n),g=t.memoizedState),(u=pn||Hg(t,r,u,n,h,g,c)||!1)?(f||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(n,g,c),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(n,g,c)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=g),s.props=n,s.state=g,s.context=c,n=u):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return ep(e,t,r,n,i,a)}function ep(e,t,r,n,a,i){O2(e,t);var s=(t.flags&128)!==0;if(!n&&!s)return a&&Lg(t,r,!1),Zr(e,t,i);n=t.stateNode,iA.current=t;var l=s&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&s?(t.child=Si(t,e.child,null,i),t.child=Si(t,null,l,i)):gt(e,t,l,i),t.memoizedState=n.state,a&&Lg(t,r,!0),t.child}function N2(e){var t=e.stateNode;t.pendingContext?Ig(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ig(e,t.context,!1),xv(e,t.containerInfo)}function Jg(e,t,r,n,a){return wi(),hv(a),t.flags|=256,gt(e,t,r,n),t.child}var tp={dehydrated:null,treeContext:null,retryLane:0};function rp(e){return{baseLanes:e,cachePool:null,transitions:null}}function P2(e,t,r){var n=t.pendingProps,a=Ce.current,i=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(a&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),je(Ce,a&1),e===null)return Yh(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=n.children,e=n.fallback,i?(n=t.mode,i=t.child,s={mode:"hidden",children:s},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=hd(s,n,0,null),e=ha(e,n,r,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=rp(r),t.memoizedState=tp,e):Nv(t,s));if(a=e.memoizedState,a!==null&&(l=a.dehydrated,l!==null))return oA(e,t,s,n,l,a,r);if(i){i=n.fallback,s=t.mode,a=e.child,l=a.sibling;var c={mode:"hidden",children:n.children};return!(s&1)&&t.child!==a?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=$n(a,c),n.subtreeFlags=a.subtreeFlags&14680064),l!==null?i=$n(l,i):(i=ha(i,s,r,null),i.flags|=2),i.return=t,n.return=t,n.sibling=i,t.child=n,n=i,i=t.child,s=e.child.memoizedState,s=s===null?rp(r):{baseLanes:s.baseLanes|r,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~r,t.memoizedState=tp,n}return i=e.child,e=i.sibling,n=$n(i,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function Nv(e,t){return t=hd({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Fl(e,t,r,n){return n!==null&&hv(n),Si(t,e.child,null,r),e=Nv(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function oA(e,t,r,n,a,i,s){if(r)return t.flags&256?(t.flags&=-257,n=If(Error(H(422))),Fl(e,t,s,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=n.fallback,a=t.mode,n=hd({mode:"visible",children:n.children},a,0,null),i=ha(i,a,s,null),i.flags|=2,n.return=t,i.return=t,n.sibling=i,t.child=n,t.mode&1&&Si(t,e.child,null,s),t.child.memoizedState=rp(s),t.memoizedState=tp,i);if(!(t.mode&1))return Fl(e,t,s,null);if(a.data==="$!"){if(n=a.nextSibling&&a.nextSibling.dataset,n)var l=n.dgst;return n=l,i=Error(H(419)),n=If(i,n,void 0),Fl(e,t,s,n)}if(l=(s&e.childLanes)!==0,Nt||l){if(n=nt,n!==null){switch(s&-s){case 4:a=2;break;case 16:a=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(n.suspendedLanes|s)?0:a,a!==0&&a!==i.retryLane&&(i.retryLane=a,Jr(e,a),vr(n,e,a,-1))}return Tv(),n=If(Error(H(421))),Fl(e,t,s,n)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=xA.bind(null,e),a._reactRetry=t,null):(e=i.treeContext,Dt=Pn(a.nextSibling),Rt=t,Ne=!0,hr=null,e!==null&&(Gt[Yt++]=Wr,Gt[Yt++]=Ur,Gt[Yt++]=ga,Wr=e.id,Ur=e.overflow,ga=t),t=Nv(t,n.children),t.flags|=4096,t)}function Zg(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),qh(e.return,t,r)}function Lf(e,t,r,n,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=a)}function A2(e,t,r){var n=t.pendingProps,a=n.revealOrder,i=n.tail;if(gt(e,t,n.children,r),n=Ce.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Zg(e,r,t);else if(e.tag===19)Zg(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(je(Ce,n),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(r=t.child,a=null;r!==null;)e=r.alternate,e!==null&&Wc(e)===null&&(a=r),r=r.sibling;r=a,r===null?(a=t.child,t.child=null):(a=r.sibling,r.sibling=null),Lf(t,!1,a,r,i);break;case"backwards":for(r=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Wc(e)===null){t.child=a;break}e=a.sibling,a.sibling=r,r=a,a=e}Lf(t,!0,r,null,i);break;case"together":Lf(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function xc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Zr(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),ba|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(H(153));if(t.child!==null){for(e=t.child,r=$n(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=$n(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function sA(e,t,r){switch(t.tag){case 3:N2(t),wi();break;case 5:t2(t);break;case 1:Ct(t.type)&&Lc(t);break;case 4:xv(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,a=t.memoizedProps.value;je(Bc,n._currentValue),n._currentValue=a;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(je(Ce,Ce.current&1),t.flags|=128,null):r&t.child.childLanes?P2(e,t,r):(je(Ce,Ce.current&1),e=Zr(e,t,r),e!==null?e.sibling:null);je(Ce,Ce.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return A2(e,t,r);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),je(Ce,Ce.current),n)break;return null;case 22:case 23:return t.lanes=0,k2(e,t,r)}return Zr(e,t,r)}var C2,np,E2,$2;C2=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};np=function(){};E2=function(e,t,r,n){var a=e.memoizedProps;if(a!==n){e=t.stateNode,ia(Ar.current);var i=null;switch(r){case"input":a=kh(e,a),n=kh(e,n),i=[];break;case"select":a=$e({},a,{value:void 0}),n=$e({},n,{value:void 0}),i=[];break;case"textarea":a=Ph(e,a),n=Ph(e,n),i=[];break;default:typeof a.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Mc)}Ch(r,n);var s;r=null;for(u in a)if(!n.hasOwnProperty(u)&&a.hasOwnProperty(u)&&a[u]!=null)if(u==="style"){var l=a[u];for(s in l)l.hasOwnProperty(s)&&(r||(r={}),r[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(ss.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in n){var c=n[u];if(l=a!=null?a[u]:void 0,n.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(s in l)!l.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(r||(r={}),r[s]="");for(s in c)c.hasOwnProperty(s)&&l[s]!==c[s]&&(r||(r={}),r[s]=c[s])}else r||(i||(i=[]),i.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(ss.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&we("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}r&&(i=i||[]).push("style",r);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};$2=function(e,t,r,n){r!==n&&(t.flags|=4)};function ko(e,t){if(!Ne)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function ft(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var a=e.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags&14680064,n|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags,n|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function lA(e,t,r){var n=t.pendingProps;switch(fv(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ft(t),null;case 1:return Ct(t.type)&&Ic(),ft(t),null;case 3:return n=t.stateNode,_i(),ke(At),ke(vt),jv(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Rl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,hr!==null&&(dp(hr),hr=null))),np(e,t),ft(t),null;case 5:bv(t);var a=ia(xs.current);if(r=t.type,e!==null&&t.stateNode!=null)E2(e,t,r,n,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(H(166));return ft(t),null}if(e=ia(Ar.current),Rl(t)){n=t.stateNode,r=t.type;var i=t.memoizedProps;switch(n[kr]=t,n[ys]=i,e=(t.mode&1)!==0,r){case"dialog":we("cancel",n),we("close",n);break;case"iframe":case"object":case"embed":we("load",n);break;case"video":case"audio":for(a=0;a<Wo.length;a++)we(Wo[a],n);break;case"source":we("error",n);break;case"img":case"image":case"link":we("error",n),we("load",n);break;case"details":we("toggle",n);break;case"input":lg(n,i),we("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},we("invalid",n);break;case"textarea":ug(n,i),we("invalid",n)}Ch(r,i),a=null;for(var s in i)if(i.hasOwnProperty(s)){var l=i[s];s==="children"?typeof l=="string"?n.textContent!==l&&(i.suppressHydrationWarning!==!0&&Dl(n.textContent,l,e),a=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Dl(n.textContent,l,e),a=["children",""+l]):ss.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&we("scroll",n)}switch(r){case"input":Al(n),cg(n,i,!0);break;case"textarea":Al(n),dg(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=Mc)}n=a,t.updateQueue=n,n!==null&&(t.flags|=4)}else{s=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=ow(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=s.createElement(r,{is:n.is}):(e=s.createElement(r),r==="select"&&(s=e,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):e=s.createElementNS(e,r),e[kr]=t,e[ys]=n,C2(e,t,!1,!1),t.stateNode=e;e:{switch(s=Eh(r,n),r){case"dialog":we("cancel",e),we("close",e),a=n;break;case"iframe":case"object":case"embed":we("load",e),a=n;break;case"video":case"audio":for(a=0;a<Wo.length;a++)we(Wo[a],e);a=n;break;case"source":we("error",e),a=n;break;case"img":case"image":case"link":we("error",e),we("load",e),a=n;break;case"details":we("toggle",e),a=n;break;case"input":lg(e,n),a=kh(e,n),we("invalid",e);break;case"option":a=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},a=$e({},n,{value:void 0}),we("invalid",e);break;case"textarea":ug(e,n),a=Ph(e,n),we("invalid",e);break;default:a=n}Ch(r,a),l=a;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?cw(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&sw(e,c)):i==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&ls(e,c):typeof c=="number"&&ls(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(ss.hasOwnProperty(i)?c!=null&&i==="onScroll"&&we("scroll",e):c!=null&&Qm(e,i,c,s))}switch(r){case"input":Al(e),cg(e,n,!1);break;case"textarea":Al(e),dg(e);break;case"option":n.value!=null&&e.setAttribute("value",""+In(n.value));break;case"select":e.multiple=!!n.multiple,i=n.value,i!=null?ci(e,!!n.multiple,i,!1):n.defaultValue!=null&&ci(e,!!n.multiple,n.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=Mc)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ft(t),null;case 6:if(e&&t.stateNode!=null)$2(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(H(166));if(r=ia(xs.current),ia(Ar.current),Rl(t)){if(n=t.stateNode,r=t.memoizedProps,n[kr]=t,(i=n.nodeValue!==r)&&(e=Rt,e!==null))switch(e.tag){case 3:Dl(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Dl(n.nodeValue,r,(e.mode&1)!==0)}i&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[kr]=t,t.stateNode=n}return ft(t),null;case 13:if(ke(Ce),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ne&&Dt!==null&&t.mode&1&&!(t.flags&128))Xw(),wi(),t.flags|=98560,i=!1;else if(i=Rl(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(H(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(H(317));i[kr]=t}else wi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ft(t),i=!1}else hr!==null&&(dp(hr),hr=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||Ce.current&1?Ye===0&&(Ye=3):Tv())),t.updateQueue!==null&&(t.flags|=4),ft(t),null);case 4:return _i(),np(e,t),e===null&&ms(t.stateNode.containerInfo),ft(t),null;case 10:return vv(t.type._context),ft(t),null;case 17:return Ct(t.type)&&Ic(),ft(t),null;case 19:if(ke(Ce),i=t.memoizedState,i===null)return ft(t),null;if(n=(t.flags&128)!==0,s=i.rendering,s===null)if(n)ko(i,!1);else{if(Ye!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Wc(e),s!==null){for(t.flags|=128,ko(i,!1),n=s.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)i=r,e=n,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return je(Ce,Ce.current&1|2),t.child}e=e.sibling}i.tail!==null&&Le()>Oi&&(t.flags|=128,n=!0,ko(i,!1),t.lanes=4194304)}else{if(!n)if(e=Wc(s),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ko(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Ne)return ft(t),null}else 2*Le()-i.renderingStartTime>Oi&&r!==1073741824&&(t.flags|=128,n=!0,ko(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(r=i.last,r!==null?r.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Le(),t.sibling=null,r=Ce.current,je(Ce,n?r&1|2:r&1),t):(ft(t),null);case 22:case 23:return $v(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Mt&1073741824&&(ft(t),t.subtreeFlags&6&&(t.flags|=8192)):ft(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function cA(e,t){switch(fv(t),t.tag){case 1:return Ct(t.type)&&Ic(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _i(),ke(At),ke(vt),jv(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return bv(t),null;case 13:if(ke(Ce),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));wi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ke(Ce),null;case 4:return _i(),null;case 10:return vv(t.type._context),null;case 22:case 23:return $v(),null;case 24:return null;default:return null}}var zl=!1,pt=!1,uA=typeof WeakSet=="function"?WeakSet:Set,G=null;function ri(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Me(e,t,n)}else r.current=null}function ap(e,t,r){try{r()}catch(n){Me(e,t,n)}}var e0=!1;function dA(e,t){if(zh=Ec,e=Dw(),uv(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var a=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var s=0,l=-1,c=-1,u=0,f=0,d=e,h=null;t:for(;;){for(var p;d!==r||a!==0&&d.nodeType!==3||(l=s+a),d!==i||n!==0&&d.nodeType!==3||(c=s+n),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)h=d,d=p;for(;;){if(d===e)break t;if(h===r&&++u===a&&(l=s),h===i&&++f===n&&(c=s),(p=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=p}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Wh={focusedElem:e,selectionRange:r},Ec=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var y=g.memoizedProps,b=g.memoizedState,v=t.stateNode,m=v.getSnapshotBeforeUpdate(t.elementType===t.type?y:ur(t.type,y),b);v.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(S){Me(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return g=e0,e0=!1,g}function Jo(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var a=n=n.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&ap(t,r,i)}a=a.next}while(a!==n)}}function dd(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function ip(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function T2(e){var t=e.alternate;t!==null&&(e.alternate=null,T2(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[kr],delete t[ys],delete t[Kh],delete t[GP],delete t[YP])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function M2(e){return e.tag===5||e.tag===3||e.tag===4}function t0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||M2(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function op(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Mc));else if(n!==4&&(e=e.child,e!==null))for(op(e,t,r),e=e.sibling;e!==null;)op(e,t,r),e=e.sibling}function sp(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(sp(e,t,r),e=e.sibling;e!==null;)sp(e,t,r),e=e.sibling}var st=null,dr=!1;function un(e,t,r){for(r=r.child;r!==null;)I2(e,t,r),r=r.sibling}function I2(e,t,r){if(Pr&&typeof Pr.onCommitFiberUnmount=="function")try{Pr.onCommitFiberUnmount(nd,r)}catch{}switch(r.tag){case 5:pt||ri(r,t);case 6:var n=st,a=dr;st=null,un(e,t,r),st=n,dr=a,st!==null&&(dr?(e=st,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):st.removeChild(r.stateNode));break;case 18:st!==null&&(dr?(e=st,r=r.stateNode,e.nodeType===8?Af(e.parentNode,r):e.nodeType===1&&Af(e,r),fs(e)):Af(st,r.stateNode));break;case 4:n=st,a=dr,st=r.stateNode.containerInfo,dr=!0,un(e,t,r),st=n,dr=a;break;case 0:case 11:case 14:case 15:if(!pt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){a=n=n.next;do{var i=a,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&ap(r,t,s),a=a.next}while(a!==n)}un(e,t,r);break;case 1:if(!pt&&(ri(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){Me(r,t,l)}un(e,t,r);break;case 21:un(e,t,r);break;case 22:r.mode&1?(pt=(n=pt)||r.memoizedState!==null,un(e,t,r),pt=n):un(e,t,r);break;default:un(e,t,r)}}function r0(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new uA),t.forEach(function(n){var a=bA.bind(null,e,n);r.has(n)||(r.add(n),n.then(a,a))})}}function lr(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var a=r[n];try{var i=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:st=l.stateNode,dr=!1;break e;case 3:st=l.stateNode.containerInfo,dr=!0;break e;case 4:st=l.stateNode.containerInfo,dr=!0;break e}l=l.return}if(st===null)throw Error(H(160));I2(i,s,a),st=null,dr=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(u){Me(a,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)L2(t,e),t=t.sibling}function L2(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(lr(t,e),Sr(e),n&4){try{Jo(3,e,e.return),dd(3,e)}catch(y){Me(e,e.return,y)}try{Jo(5,e,e.return)}catch(y){Me(e,e.return,y)}}break;case 1:lr(t,e),Sr(e),n&512&&r!==null&&ri(r,r.return);break;case 5:if(lr(t,e),Sr(e),n&512&&r!==null&&ri(r,r.return),e.flags&32){var a=e.stateNode;try{ls(a,"")}catch(y){Me(e,e.return,y)}}if(n&4&&(a=e.stateNode,a!=null)){var i=e.memoizedProps,s=r!==null?r.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&aw(a,i),Eh(l,s);var u=Eh(l,i);for(s=0;s<c.length;s+=2){var f=c[s],d=c[s+1];f==="style"?cw(a,d):f==="dangerouslySetInnerHTML"?sw(a,d):f==="children"?ls(a,d):Qm(a,f,d,u)}switch(l){case"input":Oh(a,i);break;case"textarea":iw(a,i);break;case"select":var h=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?ci(a,!!i.multiple,p,!1):h!==!!i.multiple&&(i.defaultValue!=null?ci(a,!!i.multiple,i.defaultValue,!0):ci(a,!!i.multiple,i.multiple?[]:"",!1))}a[ys]=i}catch(y){Me(e,e.return,y)}}break;case 6:if(lr(t,e),Sr(e),n&4){if(e.stateNode===null)throw Error(H(162));a=e.stateNode,i=e.memoizedProps;try{a.nodeValue=i}catch(y){Me(e,e.return,y)}}break;case 3:if(lr(t,e),Sr(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{fs(t.containerInfo)}catch(y){Me(e,e.return,y)}break;case 4:lr(t,e),Sr(e);break;case 13:lr(t,e),Sr(e),a=e.child,a.flags&8192&&(i=a.memoizedState!==null,a.stateNode.isHidden=i,!i||a.alternate!==null&&a.alternate.memoizedState!==null||(Cv=Le())),n&4&&r0(e);break;case 22:if(f=r!==null&&r.memoizedState!==null,e.mode&1?(pt=(u=pt)||f,lr(t,e),pt=u):lr(t,e),Sr(e),n&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!f&&e.mode&1)for(G=e,f=e.child;f!==null;){for(d=G=f;G!==null;){switch(h=G,p=h.child,h.tag){case 0:case 11:case 14:case 15:Jo(4,h,h.return);break;case 1:ri(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){n=h,r=h.return;try{t=n,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(y){Me(n,r,y)}}break;case 5:ri(h,h.return);break;case 22:if(h.memoizedState!==null){a0(d);continue}}p!==null?(p.return=h,G=p):a0(d)}f=f.sibling}e:for(f=null,d=e;;){if(d.tag===5){if(f===null){f=d;try{a=d.stateNode,u?(i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=d.stateNode,c=d.memoizedProps.style,s=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=lw("display",s))}catch(y){Me(e,e.return,y)}}}else if(d.tag===6){if(f===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(y){Me(e,e.return,y)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;f===d&&(f=null),d=d.return}f===d&&(f=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:lr(t,e),Sr(e),n&4&&r0(e);break;case 21:break;default:lr(t,e),Sr(e)}}function Sr(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(M2(r)){var n=r;break e}r=r.return}throw Error(H(160))}switch(n.tag){case 5:var a=n.stateNode;n.flags&32&&(ls(a,""),n.flags&=-33);var i=t0(e);sp(e,i,a);break;case 3:case 4:var s=n.stateNode.containerInfo,l=t0(e);op(e,l,s);break;default:throw Error(H(161))}}catch(c){Me(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function fA(e,t,r){G=e,D2(e)}function D2(e,t,r){for(var n=(e.mode&1)!==0;G!==null;){var a=G,i=a.child;if(a.tag===22&&n){var s=a.memoizedState!==null||zl;if(!s){var l=a.alternate,c=l!==null&&l.memoizedState!==null||pt;l=zl;var u=pt;if(zl=s,(pt=c)&&!u)for(G=a;G!==null;)s=G,c=s.child,s.tag===22&&s.memoizedState!==null?i0(a):c!==null?(c.return=s,G=c):i0(a);for(;i!==null;)G=i,D2(i),i=i.sibling;G=a,zl=l,pt=u}n0(e)}else a.subtreeFlags&8772&&i!==null?(i.return=a,G=i):n0(e)}}function n0(e){for(;G!==null;){var t=G;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:pt||dd(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!pt)if(r===null)n.componentDidMount();else{var a=t.elementType===t.type?r.memoizedProps:ur(t.type,r.memoizedProps);n.componentDidUpdate(a,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&zg(t,i,n);break;case 3:var s=t.updateQueue;if(s!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}zg(t,s,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var f=u.memoizedState;if(f!==null){var d=f.dehydrated;d!==null&&fs(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}pt||t.flags&512&&ip(t)}catch(h){Me(t,t.return,h)}}if(t===e){G=null;break}if(r=t.sibling,r!==null){r.return=t.return,G=r;break}G=t.return}}function a0(e){for(;G!==null;){var t=G;if(t===e){G=null;break}var r=t.sibling;if(r!==null){r.return=t.return,G=r;break}G=t.return}}function i0(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{dd(4,t)}catch(c){Me(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var a=t.return;try{n.componentDidMount()}catch(c){Me(t,a,c)}}var i=t.return;try{ip(t)}catch(c){Me(t,i,c)}break;case 5:var s=t.return;try{ip(t)}catch(c){Me(t,s,c)}}}catch(c){Me(t,t.return,c)}if(t===e){G=null;break}var l=t.sibling;if(l!==null){l.return=t.return,G=l;break}G=t.return}}var hA=Math.ceil,Kc=an.ReactCurrentDispatcher,Pv=an.ReactCurrentOwner,Jt=an.ReactCurrentBatchConfig,se=0,nt=null,Re=null,ct=0,Mt=0,ni=Rn(0),Ye=0,Ss=null,ba=0,fd=0,Av=0,Zo=null,Ot=null,Cv=0,Oi=1/0,Br=null,Vc=!1,lp=null,Cn=null,Wl=!1,bn=null,Gc=0,es=0,cp=null,bc=-1,jc=0;function jt(){return se&6?Le():bc!==-1?bc:bc=Le()}function En(e){return e.mode&1?se&2&&ct!==0?ct&-ct:XP.transition!==null?(jc===0&&(jc=jw()),jc):(e=ue,e!==0||(e=window.event,e=e===void 0?16:Pw(e.type)),e):1}function vr(e,t,r,n){if(50<es)throw es=0,cp=null,Error(H(185));cl(e,r,n),(!(se&2)||e!==nt)&&(e===nt&&(!(se&2)&&(fd|=r),Ye===4&&yn(e,ct)),Et(e,n),r===1&&se===0&&!(t.mode&1)&&(Oi=Le()+500,ld&&Bn()))}function Et(e,t){var r=e.callbackNode;XN(e,t);var n=Cc(e,e===nt?ct:0);if(n===0)r!==null&&pg(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&pg(r),t===1)e.tag===0?qP(o0.bind(null,e)):Gw(o0.bind(null,e)),KP(function(){!(se&6)&&Bn()}),r=null;else{switch(ww(n)){case 1:r=rv;break;case 4:r=xw;break;case 16:r=Ac;break;case 536870912:r=bw;break;default:r=Ac}r=K2(r,R2.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function R2(e,t){if(bc=-1,jc=0,se&6)throw Error(H(327));var r=e.callbackNode;if(pi()&&e.callbackNode!==r)return null;var n=Cc(e,e===nt?ct:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Yc(e,n);else{t=n;var a=se;se|=2;var i=F2();(nt!==e||ct!==t)&&(Br=null,Oi=Le()+500,fa(e,t));do try{vA();break}catch(l){B2(e,l)}while(!0);mv(),Kc.current=i,se=a,Re!==null?t=0:(nt=null,ct=0,t=Ye)}if(t!==0){if(t===2&&(a=Lh(e),a!==0&&(n=a,t=up(e,a))),t===1)throw r=Ss,fa(e,0),yn(e,n),Et(e,Le()),r;if(t===6)yn(e,n);else{if(a=e.current.alternate,!(n&30)&&!pA(a)&&(t=Yc(e,n),t===2&&(i=Lh(e),i!==0&&(n=i,t=up(e,i))),t===1))throw r=Ss,fa(e,0),yn(e,n),Et(e,Le()),r;switch(e.finishedWork=a,e.finishedLanes=n,t){case 0:case 1:throw Error(H(345));case 2:Jn(e,Ot,Br);break;case 3:if(yn(e,n),(n&130023424)===n&&(t=Cv+500-Le(),10<t)){if(Cc(e,0)!==0)break;if(a=e.suspendedLanes,(a&n)!==n){jt(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Hh(Jn.bind(null,e,Ot,Br),t);break}Jn(e,Ot,Br);break;case 4:if(yn(e,n),(n&4194240)===n)break;for(t=e.eventTimes,a=-1;0<n;){var s=31-mr(n);i=1<<s,s=t[s],s>a&&(a=s),n&=~i}if(n=a,n=Le()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*hA(n/1960))-n,10<n){e.timeoutHandle=Hh(Jn.bind(null,e,Ot,Br),n);break}Jn(e,Ot,Br);break;case 5:Jn(e,Ot,Br);break;default:throw Error(H(329))}}}return Et(e,Le()),e.callbackNode===r?R2.bind(null,e):null}function up(e,t){var r=Zo;return e.current.memoizedState.isDehydrated&&(fa(e,t).flags|=256),e=Yc(e,t),e!==2&&(t=Ot,Ot=r,t!==null&&dp(t)),e}function dp(e){Ot===null?Ot=e:Ot.push.apply(Ot,e)}function pA(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var a=r[n],i=a.getSnapshot;a=a.value;try{if(!gr(i(),a))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function yn(e,t){for(t&=~Av,t&=~fd,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-mr(t),n=1<<r;e[r]=-1,t&=~n}}function o0(e){if(se&6)throw Error(H(327));pi();var t=Cc(e,0);if(!(t&1))return Et(e,Le()),null;var r=Yc(e,t);if(e.tag!==0&&r===2){var n=Lh(e);n!==0&&(t=n,r=up(e,n))}if(r===1)throw r=Ss,fa(e,0),yn(e,t),Et(e,Le()),r;if(r===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Jn(e,Ot,Br),Et(e,Le()),null}function Ev(e,t){var r=se;se|=1;try{return e(t)}finally{se=r,se===0&&(Oi=Le()+500,ld&&Bn())}}function ja(e){bn!==null&&bn.tag===0&&!(se&6)&&pi();var t=se;se|=1;var r=Jt.transition,n=ue;try{if(Jt.transition=null,ue=1,e)return e()}finally{ue=n,Jt.transition=r,se=t,!(se&6)&&Bn()}}function $v(){Mt=ni.current,ke(ni)}function fa(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,HP(r)),Re!==null)for(r=Re.return;r!==null;){var n=r;switch(fv(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Ic();break;case 3:_i(),ke(At),ke(vt),jv();break;case 5:bv(n);break;case 4:_i();break;case 13:ke(Ce);break;case 19:ke(Ce);break;case 10:vv(n.type._context);break;case 22:case 23:$v()}r=r.return}if(nt=e,Re=e=$n(e.current,null),ct=Mt=t,Ye=0,Ss=null,Av=fd=ba=0,Ot=Zo=null,aa!==null){for(t=0;t<aa.length;t++)if(r=aa[t],n=r.interleaved,n!==null){r.interleaved=null;var a=n.next,i=r.pending;if(i!==null){var s=i.next;i.next=a,n.next=s}r.pending=n}aa=null}return e}function B2(e,t){do{var r=Re;try{if(mv(),yc.current=Hc,Uc){for(var n=Ee.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}Uc=!1}if(xa=0,et=Ve=Ee=null,Qo=!1,bs=0,Pv.current=null,r===null||r.return===null){Ye=1,Ss=t,Re=null;break}e:{var i=e,s=r.return,l=r,c=t;if(t=ct,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,f=l,d=f.tag;if(!(f.mode&1)&&(d===0||d===11||d===15)){var h=f.alternate;h?(f.updateQueue=h.updateQueue,f.memoizedState=h.memoizedState,f.lanes=h.lanes):(f.updateQueue=null,f.memoizedState=null)}var p=Gg(s);if(p!==null){p.flags&=-257,Yg(p,s,l,i,t),p.mode&1&&Vg(i,u,t),t=p,c=u;var g=t.updateQueue;if(g===null){var y=new Set;y.add(c),t.updateQueue=y}else g.add(c);break e}else{if(!(t&1)){Vg(i,u,t),Tv();break e}c=Error(H(426))}}else if(Ne&&l.mode&1){var b=Gg(s);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Yg(b,s,l,i,t),hv(ki(c,l));break e}}i=c=ki(c,l),Ye!==4&&(Ye=2),Zo===null?Zo=[i]:Zo.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var v=w2(i,c,t);Fg(i,v);break e;case 1:l=c;var m=i.type,x=i.stateNode;if(!(i.flags&128)&&(typeof m.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Cn===null||!Cn.has(x)))){i.flags|=65536,t&=-t,i.lanes|=t;var S=S2(i,l,t);Fg(i,S);break e}}i=i.return}while(i!==null)}W2(r)}catch(j){t=j,Re===r&&r!==null&&(Re=r=r.return);continue}break}while(!0)}function F2(){var e=Kc.current;return Kc.current=Hc,e===null?Hc:e}function Tv(){(Ye===0||Ye===3||Ye===2)&&(Ye=4),nt===null||!(ba&268435455)&&!(fd&268435455)||yn(nt,ct)}function Yc(e,t){var r=se;se|=2;var n=F2();(nt!==e||ct!==t)&&(Br=null,fa(e,t));do try{mA();break}catch(a){B2(e,a)}while(!0);if(mv(),se=r,Kc.current=n,Re!==null)throw Error(H(261));return nt=null,ct=0,Ye}function mA(){for(;Re!==null;)z2(Re)}function vA(){for(;Re!==null&&!zN();)z2(Re)}function z2(e){var t=H2(e.alternate,e,Mt);e.memoizedProps=e.pendingProps,t===null?W2(e):Re=t,Pv.current=null}function W2(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=cA(r,t),r!==null){r.flags&=32767,Re=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ye=6,Re=null;return}}else if(r=lA(r,t,Mt),r!==null){Re=r;return}if(t=t.sibling,t!==null){Re=t;return}Re=t=e}while(t!==null);Ye===0&&(Ye=5)}function Jn(e,t,r){var n=ue,a=Jt.transition;try{Jt.transition=null,ue=1,yA(e,t,r,n)}finally{Jt.transition=a,ue=n}return null}function yA(e,t,r,n){do pi();while(bn!==null);if(se&6)throw Error(H(327));r=e.finishedWork;var a=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(H(177));e.callbackNode=null,e.callbackPriority=0;var i=r.lanes|r.childLanes;if(QN(e,i),e===nt&&(Re=nt=null,ct=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Wl||(Wl=!0,K2(Ac,function(){return pi(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=Jt.transition,Jt.transition=null;var s=ue;ue=1;var l=se;se|=4,Pv.current=null,dA(e,r),L2(r,e),DP(Wh),Ec=!!zh,Wh=zh=null,e.current=r,fA(r),WN(),se=l,ue=s,Jt.transition=i}else e.current=r;if(Wl&&(Wl=!1,bn=e,Gc=a),i=e.pendingLanes,i===0&&(Cn=null),KN(r.stateNode),Et(e,Le()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)a=t[r],n(a.value,{componentStack:a.stack,digest:a.digest});if(Vc)throw Vc=!1,e=lp,lp=null,e;return Gc&1&&e.tag!==0&&pi(),i=e.pendingLanes,i&1?e===cp?es++:(es=0,cp=e):es=0,Bn(),null}function pi(){if(bn!==null){var e=ww(Gc),t=Jt.transition,r=ue;try{if(Jt.transition=null,ue=16>e?16:e,bn===null)var n=!1;else{if(e=bn,bn=null,Gc=0,se&6)throw Error(H(331));var a=se;for(se|=4,G=e.current;G!==null;){var i=G,s=i.child;if(G.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(G=u;G!==null;){var f=G;switch(f.tag){case 0:case 11:case 15:Jo(8,f,i)}var d=f.child;if(d!==null)d.return=f,G=d;else for(;G!==null;){f=G;var h=f.sibling,p=f.return;if(T2(f),f===u){G=null;break}if(h!==null){h.return=p,G=h;break}G=p}}}var g=i.alternate;if(g!==null){var y=g.child;if(y!==null){g.child=null;do{var b=y.sibling;y.sibling=null,y=b}while(y!==null)}}G=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,G=s;else e:for(;G!==null;){if(i=G,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Jo(9,i,i.return)}var v=i.sibling;if(v!==null){v.return=i.return,G=v;break e}G=i.return}}var m=e.current;for(G=m;G!==null;){s=G;var x=s.child;if(s.subtreeFlags&2064&&x!==null)x.return=s,G=x;else e:for(s=m;G!==null;){if(l=G,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:dd(9,l)}}catch(j){Me(l,l.return,j)}if(l===s){G=null;break e}var S=l.sibling;if(S!==null){S.return=l.return,G=S;break e}G=l.return}}if(se=a,Bn(),Pr&&typeof Pr.onPostCommitFiberRoot=="function")try{Pr.onPostCommitFiberRoot(nd,e)}catch{}n=!0}return n}finally{ue=r,Jt.transition=t}}return!1}function s0(e,t,r){t=ki(r,t),t=w2(e,t,1),e=An(e,t,1),t=jt(),e!==null&&(cl(e,1,t),Et(e,t))}function Me(e,t,r){if(e.tag===3)s0(e,e,r);else for(;t!==null;){if(t.tag===3){s0(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Cn===null||!Cn.has(n))){e=ki(r,e),e=S2(t,e,1),t=An(t,e,1),e=jt(),t!==null&&(cl(t,1,e),Et(t,e));break}}t=t.return}}function gA(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=jt(),e.pingedLanes|=e.suspendedLanes&r,nt===e&&(ct&r)===r&&(Ye===4||Ye===3&&(ct&130023424)===ct&&500>Le()-Cv?fa(e,0):Av|=r),Et(e,t)}function U2(e,t){t===0&&(e.mode&1?(t=$l,$l<<=1,!($l&130023424)&&($l=4194304)):t=1);var r=jt();e=Jr(e,t),e!==null&&(cl(e,t,r),Et(e,r))}function xA(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),U2(e,r)}function bA(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(H(314))}n!==null&&n.delete(t),U2(e,r)}var H2;H2=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||At.current)Nt=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Nt=!1,sA(e,t,r);Nt=!!(e.flags&131072)}else Nt=!1,Ne&&t.flags&1048576&&Yw(t,Rc,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;xc(e,t),e=t.pendingProps;var a=ji(t,vt.current);hi(t,r),a=Sv(null,t,n,e,a,r);var i=_v();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ct(n)?(i=!0,Lc(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,gv(t),a.updater=ud,t.stateNode=a,a._reactInternals=t,Qh(t,n,e,r),t=ep(null,t,n,!0,i,r)):(t.tag=0,Ne&&i&&dv(t),gt(null,t,a,r),t=t.child),t;case 16:n=t.elementType;e:{switch(xc(e,t),e=t.pendingProps,a=n._init,n=a(n._payload),t.type=n,a=t.tag=wA(n),e=ur(n,e),a){case 0:t=Zh(null,t,n,e,r);break e;case 1:t=Qg(null,t,n,e,r);break e;case 11:t=qg(null,t,n,e,r);break e;case 14:t=Xg(null,t,n,ur(n.type,e),r);break e}throw Error(H(306,n,""))}return t;case 0:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:ur(n,a),Zh(e,t,n,a,r);case 1:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:ur(n,a),Qg(e,t,n,a,r);case 3:e:{if(N2(t),e===null)throw Error(H(387));n=t.pendingProps,i=t.memoizedState,a=i.element,e2(e,t),zc(t,n,null,r);var s=t.memoizedState;if(n=s.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){a=ki(Error(H(423)),t),t=Jg(e,t,n,r,a);break e}else if(n!==a){a=ki(Error(H(424)),t),t=Jg(e,t,n,r,a);break e}else for(Dt=Pn(t.stateNode.containerInfo.firstChild),Rt=t,Ne=!0,hr=null,r=Jw(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(wi(),n===a){t=Zr(e,t,r);break e}gt(e,t,n,r)}t=t.child}return t;case 5:return t2(t),e===null&&Yh(t),n=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,s=a.children,Uh(n,a)?s=null:i!==null&&Uh(n,i)&&(t.flags|=32),O2(e,t),gt(e,t,s,r),t.child;case 6:return e===null&&Yh(t),null;case 13:return P2(e,t,r);case 4:return xv(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Si(t,null,n,r):gt(e,t,n,r),t.child;case 11:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:ur(n,a),qg(e,t,n,a,r);case 7:return gt(e,t,t.pendingProps,r),t.child;case 8:return gt(e,t,t.pendingProps.children,r),t.child;case 12:return gt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,a=t.pendingProps,i=t.memoizedProps,s=a.value,je(Bc,n._currentValue),n._currentValue=s,i!==null)if(gr(i.value,s)){if(i.children===a.children&&!At.current){t=Zr(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){s=i.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(i.tag===1){c=Gr(-1,r&-r),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?c.next=c:(c.next=f.next,f.next=c),u.pending=c}}i.lanes|=r,c=i.alternate,c!==null&&(c.lanes|=r),qh(i.return,r,t),l.lanes|=r;break}c=c.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(H(341));s.lanes|=r,l=s.alternate,l!==null&&(l.lanes|=r),qh(s,r,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}gt(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,n=t.pendingProps.children,hi(t,r),a=Zt(a),n=n(a),t.flags|=1,gt(e,t,n,r),t.child;case 14:return n=t.type,a=ur(n,t.pendingProps),a=ur(n.type,a),Xg(e,t,n,a,r);case 15:return _2(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:ur(n,a),xc(e,t),t.tag=1,Ct(n)?(e=!0,Lc(t)):e=!1,hi(t,r),j2(t,n,a),Qh(t,n,a,r),ep(null,t,n,!0,e,r);case 19:return A2(e,t,r);case 22:return k2(e,t,r)}throw Error(H(156,t.tag))};function K2(e,t){return gw(e,t)}function jA(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xt(e,t,r,n){return new jA(e,t,r,n)}function Mv(e){return e=e.prototype,!(!e||!e.isReactComponent)}function wA(e){if(typeof e=="function")return Mv(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Zm)return 11;if(e===ev)return 14}return 2}function $n(e,t){var r=e.alternate;return r===null?(r=Xt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function wc(e,t,r,n,a,i){var s=2;if(n=e,typeof e=="function")Mv(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Ga:return ha(r.children,a,i,t);case Jm:s=8,a|=8;break;case jh:return e=Xt(12,r,t,a|2),e.elementType=jh,e.lanes=i,e;case wh:return e=Xt(13,r,t,a),e.elementType=wh,e.lanes=i,e;case Sh:return e=Xt(19,r,t,a),e.elementType=Sh,e.lanes=i,e;case tw:return hd(r,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Zj:s=10;break e;case ew:s=9;break e;case Zm:s=11;break e;case ev:s=14;break e;case hn:s=16,n=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=Xt(s,r,t,a),t.elementType=e,t.type=n,t.lanes=i,t}function ha(e,t,r,n){return e=Xt(7,e,n,t),e.lanes=r,e}function hd(e,t,r,n){return e=Xt(22,e,n,t),e.elementType=tw,e.lanes=r,e.stateNode={isHidden:!1},e}function Df(e,t,r){return e=Xt(6,e,null,t),e.lanes=r,e}function Rf(e,t,r){return t=Xt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function SA(e,t,r,n,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gf(0),this.expirationTimes=gf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gf(0),this.identifierPrefix=n,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function Iv(e,t,r,n,a,i,s,l,c){return e=new SA(e,t,r,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Xt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},gv(i),e}function _A(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Va,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function V2(e){if(!e)return Ln;e=e._reactInternals;e:{if(Aa(e)!==e||e.tag!==1)throw Error(H(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ct(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(H(171))}if(e.tag===1){var r=e.type;if(Ct(r))return Vw(e,r,t)}return t}function G2(e,t,r,n,a,i,s,l,c){return e=Iv(r,n,!0,e,a,i,s,l,c),e.context=V2(null),r=e.current,n=jt(),a=En(r),i=Gr(n,a),i.callback=t??null,An(r,i,a),e.current.lanes=a,cl(e,a,n),Et(e,n),e}function pd(e,t,r,n){var a=t.current,i=jt(),s=En(a);return r=V2(r),t.context===null?t.context=r:t.pendingContext=r,t=Gr(i,s),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=An(a,t,s),e!==null&&(vr(e,a,s,i),vc(e,a,s)),s}function qc(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function l0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Lv(e,t){l0(e,t),(e=e.alternate)&&l0(e,t)}function kA(){return null}var Y2=typeof reportError=="function"?reportError:function(e){console.error(e)};function Dv(e){this._internalRoot=e}md.prototype.render=Dv.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));pd(e,t,null,null)};md.prototype.unmount=Dv.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ja(function(){pd(null,e,null,null)}),t[Qr]=null}};function md(e){this._internalRoot=e}md.prototype.unstable_scheduleHydration=function(e){if(e){var t=kw();e={blockedOn:null,target:e,priority:t};for(var r=0;r<vn.length&&t!==0&&t<vn[r].priority;r++);vn.splice(r,0,e),r===0&&Nw(e)}};function Rv(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function vd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function c0(){}function OA(e,t,r,n,a){if(a){if(typeof n=="function"){var i=n;n=function(){var u=qc(s);i.call(u)}}var s=G2(t,n,e,0,null,!1,!1,"",c0);return e._reactRootContainer=s,e[Qr]=s.current,ms(e.nodeType===8?e.parentNode:e),ja(),s}for(;a=e.lastChild;)e.removeChild(a);if(typeof n=="function"){var l=n;n=function(){var u=qc(c);l.call(u)}}var c=Iv(e,0,!1,null,null,!1,!1,"",c0);return e._reactRootContainer=c,e[Qr]=c.current,ms(e.nodeType===8?e.parentNode:e),ja(function(){pd(t,c,r,n)}),c}function yd(e,t,r,n,a){var i=r._reactRootContainer;if(i){var s=i;if(typeof a=="function"){var l=a;a=function(){var c=qc(s);l.call(c)}}pd(t,s,e,a)}else s=OA(r,t,e,a,n);return qc(s)}Sw=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=zo(t.pendingLanes);r!==0&&(nv(t,r|1),Et(t,Le()),!(se&6)&&(Oi=Le()+500,Bn()))}break;case 13:ja(function(){var n=Jr(e,1);if(n!==null){var a=jt();vr(n,e,1,a)}}),Lv(e,1)}};av=function(e){if(e.tag===13){var t=Jr(e,134217728);if(t!==null){var r=jt();vr(t,e,134217728,r)}Lv(e,134217728)}};_w=function(e){if(e.tag===13){var t=En(e),r=Jr(e,t);if(r!==null){var n=jt();vr(r,e,t,n)}Lv(e,t)}};kw=function(){return ue};Ow=function(e,t){var r=ue;try{return ue=e,t()}finally{ue=r}};Th=function(e,t,r){switch(t){case"input":if(Oh(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var a=sd(n);if(!a)throw Error(H(90));nw(n),Oh(n,a)}}}break;case"textarea":iw(e,r);break;case"select":t=r.value,t!=null&&ci(e,!!r.multiple,t,!1)}};fw=Ev;hw=ja;var NA={usingClientEntryPoint:!1,Events:[dl,Qa,sd,uw,dw,Ev]},Oo={findFiberByHostInstance:na,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},PA={bundleType:Oo.bundleType,version:Oo.version,rendererPackageName:Oo.rendererPackageName,rendererConfig:Oo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:an.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=vw(e),e===null?null:e.stateNode},findFiberByHostInstance:Oo.findFiberByHostInstance||kA,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ul=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ul.isDisabled&&Ul.supportsFiber)try{nd=Ul.inject(PA),Pr=Ul}catch{}}Wt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=NA;Wt.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Rv(t))throw Error(H(200));return _A(e,t,null,r)};Wt.createRoot=function(e,t){if(!Rv(e))throw Error(H(299));var r=!1,n="",a=Y2;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=Iv(e,1,!1,null,null,r,!1,n,a),e[Qr]=t.current,ms(e.nodeType===8?e.parentNode:e),new Dv(t)};Wt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(H(188)):(e=Object.keys(e).join(","),Error(H(268,e)));return e=vw(t),e=e===null?null:e.stateNode,e};Wt.flushSync=function(e){return ja(e)};Wt.hydrate=function(e,t,r){if(!vd(t))throw Error(H(200));return yd(null,e,t,!0,r)};Wt.hydrateRoot=function(e,t,r){if(!Rv(e))throw Error(H(405));var n=r!=null&&r.hydratedSources||null,a=!1,i="",s=Y2;if(r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(s=r.onRecoverableError)),t=G2(t,null,e,1,r??null,a,!1,i,s),e[Qr]=t.current,ms(e),n)for(e=0;e<n.length;e++)r=n[e],a=r._getVersion,a=a(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,a]:t.mutableSourceEagerHydrationData.push(r,a);return new md(t)};Wt.render=function(e,t,r){if(!vd(t))throw Error(H(200));return yd(null,e,t,!1,r)};Wt.unmountComponentAtNode=function(e){if(!vd(e))throw Error(H(40));return e._reactRootContainer?(ja(function(){yd(null,null,e,!1,function(){e._reactRootContainer=null,e[Qr]=null})}),!0):!1};Wt.unstable_batchedUpdates=Ev;Wt.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!vd(r))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return yd(e,t,r,!1,n)};Wt.version="18.3.1-next-f1338f8080-20240426";function q2(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(q2)}catch(e){console.error(e)}}q2(),qj.exports=Wt;var AA=qj.exports,u0=AA;xh.createRoot=u0.createRoot,xh.hydrateRoot=u0.hydrateRoot;/**
+ * @remix-run/router v1.23.2
+ *
+ * Copyright (c) Remix Software Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE.md file in the root directory of this source tree.
+ *
+ * @license MIT
+ */function _s(){return _s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_s.apply(this,arguments)}var jn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(jn||(jn={}));const d0="popstate";function CA(e){e===void 0&&(e={});function t(n,a){let{pathname:i,search:s,hash:l}=n.location;return fp("",{pathname:i,search:s,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:Xc(a)}return $A(t,r,null,e)}function Fe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Bv(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function EA(){return Math.random().toString(36).substr(2,8)}function f0(e,t){return{usr:e.state,key:e.key,idx:t}}function fp(e,t,r,n){return r===void 0&&(r=null),_s({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?no(t):t,{state:r,key:t&&t.key||n||EA()})}function Xc(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function no(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function $A(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:i=!1}=n,s=a.history,l=jn.Pop,c=null,u=f();u==null&&(u=0,s.replaceState(_s({},s.state,{idx:u}),""));function f(){return(s.state||{idx:null}).idx}function d(){l=jn.Pop;let b=f(),v=b==null?null:b-u;u=b,c&&c({action:l,location:y.location,delta:v})}function h(b,v){l=jn.Push;let m=fp(y.location,b,v);u=f()+1;let x=f0(m,u),S=y.createHref(m);try{s.pushState(x,"",S)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;a.location.assign(S)}i&&c&&c({action:l,location:y.location,delta:1})}function p(b,v){l=jn.Replace;let m=fp(y.location,b,v);u=f();let x=f0(m,u),S=y.createHref(m);s.replaceState(x,"",S),i&&c&&c({action:l,location:y.location,delta:0})}function g(b){let v=a.location.origin!=="null"?a.location.origin:a.location.href,m=typeof b=="string"?b:Xc(b);return m=m.replace(/ $/,"%20"),Fe(v,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,v)}let y={get action(){return l},get location(){return e(a,s)},listen(b){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(d0,d),c=b,()=>{a.removeEventListener(d0,d),c=null}},createHref(b){return t(a,b)},createURL:g,encodeLocation(b){let v=g(b);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:p,go(b){return s.go(b)}};return y}var h0;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(h0||(h0={}));function TA(e,t,r){return r===void 0&&(r="/"),MA(e,t,r)}function MA(e,t,r,n){let a=typeof t=="string"?no(t):t,i=Fv(a.pathname||"/",r);if(i==null)return null;let s=X2(e);IA(s);let l=null;for(let c=0;l==null&&c<s.length;++c){let u=GA(i);l=HA(s[c],u)}return l}function X2(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(i,s,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};c.relativePath.startsWith("/")&&(Fe(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let u=Tn([n,c.relativePath]),f=r.concat(c);i.children&&i.children.length>0&&(Fe(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),X2(i.children,t,f,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:WA(u,i.index),routesMeta:f})};return e.forEach((i,s)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))a(i,s);else for(let c of Q2(i.path))a(i,s,c)}),t}function Q2(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let s=Q2(n.join("/")),l=[];return l.push(...s.map(c=>c===""?i:[i,c].join("/"))),a&&l.push(...s),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function IA(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:UA(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const LA=/^:[\w-]+$/,DA=3,RA=2,BA=1,FA=10,zA=-2,p0=e=>e==="*";function WA(e,t){let r=e.split("/"),n=r.length;return r.some(p0)&&(n+=zA),t&&(n+=RA),r.filter(a=>!p0(a)).reduce((a,i)=>a+(LA.test(i)?DA:i===""?BA:FA),n)}function UA(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function HA(e,t,r){let{routesMeta:n}=e,a={},i="/",s=[];for(let l=0;l<n.length;++l){let c=n[l],u=l===n.length-1,f=i==="/"?t:t.slice(i.length)||"/",d=KA({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},f),h=c.route;if(!d)return null;Object.assign(a,d.params),s.push({params:a,pathname:Tn([i,d.pathname]),pathnameBase:JA(Tn([i,d.pathnameBase])),route:h}),d.pathnameBase!=="/"&&(i=Tn([i,d.pathnameBase]))}return s}function KA(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=VA(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let i=a[0],s=i.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((u,f,d)=>{let{paramName:h,isOptional:p}=f;if(h==="*"){let y=l[d]||"";s=i.slice(0,i.length-y.length).replace(/(.)\/+$/,"$1")}const g=l[d];return p&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:s,pattern:e}}function VA(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Bv(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function GA(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Bv(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Fv(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const YA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,qA=e=>YA.test(e);function XA(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?no(e):e,i;if(r)if(qA(r))i=r;else{if(r.includes("//")){let s=r;r=r.replace(/\/\/+/g,"/"),Bv(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+r))}r.startsWith("/")?i=m0(r.substring(1),"/"):i=m0(r,t)}else i=t;return{pathname:i,search:ZA(n),hash:eC(a)}}function m0(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Bf(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function QA(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function J2(e,t){let r=QA(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Z2(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=no(e):(a=_s({},e),Fe(!a.pathname||!a.pathname.includes("?"),Bf("?","pathname","search",a)),Fe(!a.pathname||!a.pathname.includes("#"),Bf("#","pathname","hash",a)),Fe(!a.search||!a.search.includes("#"),Bf("#","search","hash",a)));let i=e===""||a.pathname==="",s=i?"/":a.pathname,l;if(s==null)l=r;else{let d=t.length-1;if(!n&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),d-=1;a.pathname=h.join("/")}l=d>=0?t[d]:"/"}let c=XA(a,l),u=s&&s!=="/"&&s.endsWith("/"),f=(i||s===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||f)&&(c.pathname+="/"),c}const Tn=e=>e.join("/").replace(/\/\/+/g,"/"),JA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ZA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,eC=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function tC(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const eS=["post","put","patch","delete"];new Set(eS);const rC=["get",...eS];new Set(rC);/**
+ * React Router v6.30.3
+ *
+ * Copyright (c) Remix Software Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE.md file in the root directory of this source tree.
+ *
+ * @license MIT
+ */function ks(){return ks=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ks.apply(this,arguments)}const zv=P.createContext(null),nC=P.createContext(null),Ca=P.createContext(null),gd=P.createContext(null),Fn=P.createContext({outlet:null,matches:[],isDataRoute:!1}),tS=P.createContext(null);function aC(e,t){let{relative:r}=t===void 0?{}:t;hl()||Fe(!1);let{basename:n,navigator:a}=P.useContext(Ca),{hash:i,pathname:s,search:l}=nS(e,{relative:r}),c=s;return n!=="/"&&(c=s==="/"?n:Tn([n,s])),a.createHref({pathname:c,search:l,hash:i})}function hl(){return P.useContext(gd)!=null}function pl(){return hl()||Fe(!1),P.useContext(gd).location}function rS(e){P.useContext(Ca).static||P.useLayoutEffect(e)}function xd(){let{isDataRoute:e}=P.useContext(Fn);return e?xC():iC()}function iC(){hl()||Fe(!1);let e=P.useContext(zv),{basename:t,future:r,navigator:n}=P.useContext(Ca),{matches:a}=P.useContext(Fn),{pathname:i}=pl(),s=JSON.stringify(J2(a,r.v7_relativeSplatPath)),l=P.useRef(!1);return rS(()=>{l.current=!0}),P.useCallback(function(u,f){if(f===void 0&&(f={}),!l.current)return;if(typeof u=="number"){n.go(u);return}let d=Z2(u,JSON.parse(s),i,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Tn([t,d.pathname])),(f.replace?n.replace:n.push)(d,f.state,f)},[t,n,s,i,e])}const oC=P.createContext(null);function sC(e){let t=P.useContext(Fn).outlet;return t&&P.createElement(oC.Provider,{value:e},t)}function nS(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=P.useContext(Ca),{matches:a}=P.useContext(Fn),{pathname:i}=pl(),s=JSON.stringify(J2(a,n.v7_relativeSplatPath));return P.useMemo(()=>Z2(e,JSON.parse(s),i,r==="path"),[e,s,i,r])}function lC(e,t){return cC(e,t)}function cC(e,t,r,n){hl()||Fe(!1);let{navigator:a}=P.useContext(Ca),{matches:i}=P.useContext(Fn),s=i[i.length-1],l=s?s.params:{};s&&s.pathname;let c=s?s.pathnameBase:"/";s&&s.route;let u=pl(),f;if(t){var d;let b=typeof t=="string"?no(t):t;c==="/"||(d=b.pathname)!=null&&d.startsWith(c)||Fe(!1),f=b}else f=u;let h=f.pathname||"/",p=h;if(c!=="/"){let b=c.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(b.length).join("/")}let g=TA(e,{pathname:p}),y=pC(g&&g.map(b=>Object.assign({},b,{params:Object.assign({},l,b.params),pathname:Tn([c,a.encodeLocation?a.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?c:Tn([c,a.encodeLocation?a.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),i,r,n);return t&&y?P.createElement(gd.Provider,{value:{location:ks({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:jn.Pop}},y):y}function uC(){let e=gC(),t=tC(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return P.createElement(P.Fragment,null,P.createElement("h2",null,"Unexpected Application Error!"),P.createElement("h3",{style:{fontStyle:"italic"}},t),r?P.createElement("pre",{style:a},r):null,null)}const dC=P.createElement(uC,null);class fC extends P.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?P.createElement(Fn.Provider,{value:this.props.routeContext},P.createElement(tS.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function hC(e){let{routeContext:t,match:r,children:n}=e,a=P.useContext(zv);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),P.createElement(Fn.Provider,{value:t},n)}function pC(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var i;if(!r)return null;if(r.errors)e=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let s=e,l=(a=r)==null?void 0:a.errors;if(l!=null){let f=s.findIndex(d=>d.route.id&&(l==null?void 0:l[d.route.id])!==void 0);f>=0||Fe(!1),s=s.slice(0,Math.min(s.length,f+1))}let c=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let f=0;f<s.length;f++){let d=s[f];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=f),d.route.id){let{loaderData:h,errors:p}=r,g=d.route.loader&&h[d.route.id]===void 0&&(!p||p[d.route.id]===void 0);if(d.route.lazy||g){c=!0,u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((f,d,h)=>{let p,g=!1,y=null,b=null;r&&(p=l&&d.route.id?l[d.route.id]:void 0,y=d.route.errorElement||dC,c&&(u<0&&h===0?(bC("route-fallback"),g=!0,b=null):u===h&&(g=!0,b=d.route.hydrateFallbackElement||null)));let v=t.concat(s.slice(0,h+1)),m=()=>{let x;return p?x=y:g?x=b:d.route.Component?x=P.createElement(d.route.Component,null):d.route.element?x=d.route.element:x=f,P.createElement(hC,{match:d,routeContext:{outlet:f,matches:v,isDataRoute:r!=null},children:x})};return r&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?P.createElement(fC,{location:r.location,revalidation:r.revalidation,component:y,error:p,children:m(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):m()},null)}var aS=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(aS||{}),iS=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(iS||{});function mC(e){let t=P.useContext(zv);return t||Fe(!1),t}function vC(e){let t=P.useContext(nC);return t||Fe(!1),t}function yC(e){let t=P.useContext(Fn);return t||Fe(!1),t}function oS(e){let t=yC(),r=t.matches[t.matches.length-1];return r.route.id||Fe(!1),r.route.id}function gC(){var e;let t=P.useContext(tS),r=vC(),n=oS();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function xC(){let{router:e}=mC(aS.UseNavigateStable),t=oS(iS.UseNavigateStable),r=P.useRef(!1);return rS(()=>{r.current=!0}),P.useCallback(function(a,i){i===void 0&&(i={}),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,ks({fromRouteId:t},i)))},[e,t])}const v0={};function bC(e,t,r){v0[e]||(v0[e]=!0)}function jC(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function wC(e){return sC(e.context)}function it(e){Fe(!1)}function SC(e){let{basename:t="/",children:r=null,location:n,navigationType:a=jn.Pop,navigator:i,static:s=!1,future:l}=e;hl()&&Fe(!1);let c=t.replace(/^\/*/,"/"),u=P.useMemo(()=>({basename:c,navigator:i,static:s,future:ks({v7_relativeSplatPath:!1},l)}),[c,l,i,s]);typeof n=="string"&&(n=no(n));let{pathname:f="/",search:d="",hash:h="",state:p=null,key:g="default"}=n,y=P.useMemo(()=>{let b=Fv(f,c);return b==null?null:{location:{pathname:b,search:d,hash:h,state:p,key:g},navigationType:a}},[c,f,d,h,p,g,a]);return y==null?null:P.createElement(Ca.Provider,{value:u},P.createElement(gd.Provider,{children:r,value:y}))}function _C(e){let{children:t,location:r}=e;return lC(hp(t),r)}new Promise(()=>{});function hp(e,t){t===void 0&&(t=[]);let r=[];return P.Children.forEach(e,(n,a)=>{if(!P.isValidElement(n))return;let i=[...t,a];if(n.type===P.Fragment){r.push.apply(r,hp(n.props.children,i));return}n.type!==it&&Fe(!1),!n.props.index||!n.props.children||Fe(!1);let s={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(s.children=hp(n.props.children,i)),r.push(s)}),r}/**
+ * React Router DOM v6.30.3
+ *
+ * Copyright (c) Remix Software Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE.md file in the root directory of this source tree.
+ *
+ * @license MIT
+ */function pp(){return pp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pp.apply(this,arguments)}function kC(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function OC(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function NC(e,t){return e.button===0&&(!t||t==="_self")&&!OC(e)}const PC=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],AC="6";try{window.__reactRouterVersion=AC}catch{}const CC="startTransition",y0=gN[CC];function EC(e){let{basename:t,children:r,future:n,window:a}=e,i=P.useRef();i.current==null&&(i.current=CA({window:a,v5Compat:!0}));let s=i.current,[l,c]=P.useState({action:s.action,location:s.location}),{v7_startTransition:u}=n||{},f=P.useCallback(d=>{u&&y0?y0(()=>c(d)):c(d)},[c,u]);return P.useLayoutEffect(()=>s.listen(f),[s,f]),P.useEffect(()=>jC(n),[n]),P.createElement(SC,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}const $C=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",TC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Sc=P.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:i,replace:s,state:l,target:c,to:u,preventScrollReset:f,viewTransition:d}=t,h=kC(t,PC),{basename:p}=P.useContext(Ca),g,y=!1;if(typeof u=="string"&&TC.test(u)&&(g=u,$C))try{let x=new URL(window.location.href),S=u.startsWith("//")?new URL(x.protocol+u):new URL(u),j=Fv(S.pathname,p);S.origin===x.origin&&j!=null?u=j+S.search+S.hash:y=!0}catch{}let b=aC(u,{relative:a}),v=MC(u,{replace:s,state:l,target:c,preventScrollReset:f,relative:a,viewTransition:d});function m(x){n&&n(x),x.defaultPrevented||v(x)}return P.createElement("a",pp({},h,{href:g||b,onClick:y||i?n:m,ref:r,target:c}))});var g0;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(g0||(g0={}));var x0;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(x0||(x0={}));function MC(e,t){let{target:r,replace:n,state:a,preventScrollReset:i,relative:s,viewTransition:l}=t===void 0?{}:t,c=xd(),u=pl(),f=nS(e,{relative:s});return P.useCallback(d=>{if(NC(d,r)){d.preventDefault();let h=n!==void 0?n:Xc(u)===Xc(f);c(e,{replace:h,state:a,preventScrollReset:i,relative:s,viewTransition:l})}},[u,c,f,n,a,r,e,i,s,l])}const IC="/api";async function Oe(e,t={}){const r=await fetch(`${IC}${e}`,{...t,credentials:"same-origin",headers:{"Content-Type":"application/json",...t.headers}});return r.status===401&&!e.startsWith("/auth/")?(window.location.href="/login",{}):r.json()}async function me(e,t){return Oe(e,{method:"POST",body:JSON.stringify(t)})}async function Wv(){try{return(await Oe("/auth/session")).authenticated===!0}catch{return!1}}async function LC(e,t){return(await me("/auth/login",{username:e,password:t})).success===!0}async function DC(e){return await me("/auth/google",{credential:e})}async function RC(){try{return await Oe("/auth/google-config")}catch{return{configured:!1}}}async function BC(){await me("/auth/logout",{}),window.location.href="/login"}const FC=`
+@keyframes floatDot {
+ 0%, 100% { transform: translateY(0px) scale(1); opacity: 0.18; }
+ 50% { transform: translateY(-18px) scale(1.1); opacity: 0.35; }
+}
+.login-dot {
+ position: absolute;
+ border-radius: 50%;
+ background: var(--cyan);
+ animation: floatDot linear infinite;
+ pointer-events: none;
+}
+`,zC=Array.from({length:22},(e,t)=>({size:2+Math.random()*4,top:Math.random()*100,left:Math.random()*100,duration:4+Math.random()*6,delay:-(Math.random()*8)}));function WC(){const[e,t]=P.useState(""),[r,n]=P.useState(""),[a,i]=P.useState(!1),[s,l]=P.useState(""),[c,u]=P.useState(!1),[f,d]=P.useState(!0),[h,p]=P.useState(!1),[g,y]=P.useState(null),b=P.useRef(null),v=xd();P.useEffect(()=>{Wv().then(w=>{w?v("/"):d(!1)}),RC().then(w=>{w.configured&&w.client_id&&(y(w.client_id),m(w.client_id))})},[]);function m(w){if(document.getElementById("google-gsi")){x(w);return}const _=document.createElement("script");_.id="google-gsi",_.src="https://accounts.google.com/gsi/client",_.async=!0,_.defer=!0,_.onload=()=>x(w),document.head.appendChild(_)}function x(w){var _,O;(O=(_=window.google)==null?void 0:_.accounts)!=null&&O.id&&(window.google.accounts.id.initialize({client_id:w,callback:S,auto_select:!1}),p(!0))}P.useEffect(()=>{var w,_;h&&b.current&&((_=(w=window.google)==null?void 0:w.accounts)!=null&&_.id)&&window.google.accounts.id.renderButton(b.current,{type:"standard",theme:"filled_black",size:"large",text:"signin_with",shape:"pill",width:360})},[h]);async function S(w){l(""),u(!0);try{const _=await DC(w.credential);_.success?v("/"):l(_.error||"Google login failed")}catch{l("Connection error")}u(!1)}async function j(w){w.preventDefault(),l(""),u(!0);try{await LC(e,r)?v("/"):l("Invalid credentials")}catch{l("Connection error")}u(!1)}return f?o.jsx("div",{className:"flex items-center justify-center min-h-screen",style:{background:"var(--bg)"},children:o.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})}):o.jsxs("div",{className:"min-h-screen flex items-center justify-center p-4",style:{background:"var(--bg)",position:"relative",overflow:"hidden"},children:[o.jsx("style",{children:FC}),zC.map((w,_)=>o.jsx("span",{className:"login-dot",style:{width:w.size,height:w.size,top:`${w.top}%`,left:`${w.left}%`,animationDuration:`${w.duration}s`,animationDelay:`${w.delay}s`}},_)),o.jsx("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:600,height:600,borderRadius:"50%",background:"radial-gradient(ellipse, rgba(0,240,255,0.04) 0%, transparent 70%)",pointerEvents:"none"}}),o.jsxs("div",{className:"card-glow fade-in w-full",style:{maxWidth:400,position:"relative",zIndex:1},children:[o.jsxs("div",{className:"flex flex-col items-center mb-7",children:[o.jsx("div",{style:{width:72,height:72,borderRadius:18,background:"linear-gradient(135deg, var(--orange), #C45A08)",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:16,boxShadow:"0 4px 24px rgba(247,147,26,0.35)"},children:o.jsx("span",{style:{color:"#0E0E10",fontWeight:900,fontSize:32,fontFamily:"var(--font-heading)",lineHeight:1},children:"K"})}),o.jsx("h1",{className:"kalshi-gradient heading",style:{fontSize:26,fontWeight:800,letterSpacing:"-0.02em",marginBottom:6},children:"KEN TRADER"}),o.jsx("p",{style:{fontSize:13,color:"var(--text-muted)",marginBottom:4},children:"Event Contracts Trading Platform"}),o.jsx("span",{className:"badge bg-green",style:{fontSize:10},children:"CFTC-Regulated DCM"})]}),s&&o.jsxs("div",{className:"fade-in",style:{display:"flex",alignItems:"center",gap:8,background:"var(--red-dim)",border:"1px solid rgba(255,92,92,0.25)",borderRadius:8,padding:"10px 12px",marginBottom:16,color:"var(--red)",fontSize:13},children:[o.jsx("svg",{style:{width:15,height:15,flexShrink:0},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),s]}),g&&o.jsxs("div",{style:{marginBottom:4},children:[o.jsx("div",{ref:b,style:{display:"flex",justifyContent:"center",marginBottom:16}}),o.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",marginBottom:20},children:[o.jsx("div",{style:{flex:1,height:1,background:"var(--border)"}}),o.jsx("span",{style:{padding:"0 12px",fontSize:11,color:"var(--text-muted)",background:"var(--surface)",whiteSpace:"nowrap"},children:"or sign in with password"}),o.jsx("div",{style:{flex:1,height:1,background:"var(--border)"}})]})]}),o.jsxs("form",{onSubmit:j,children:[o.jsxs("div",{style:{marginBottom:14},children:[o.jsx("label",{style:{display:"block",fontSize:11,fontWeight:600,color:"var(--text-dim)",marginBottom:6,textTransform:"uppercase",letterSpacing:"0.06em"},children:"Username"}),o.jsx("input",{type:"text",value:e,onChange:w=>t(w.target.value),required:!0,autoComplete:"username",placeholder:"admin",className:"input"})]}),o.jsxs("div",{style:{marginBottom:20},children:[o.jsx("label",{style:{display:"block",fontSize:11,fontWeight:600,color:"var(--text-dim)",marginBottom:6,textTransform:"uppercase",letterSpacing:"0.06em"},children:"Password"}),o.jsxs("div",{style:{position:"relative"},children:[o.jsx("input",{type:a?"text":"password",value:r,onChange:w=>n(w.target.value),required:!0,autoComplete:"current-password",placeholder:"Enter password",className:"input",style:{paddingRight:"2.5rem"}}),o.jsx("button",{type:"button",onClick:()=>i(!a),style:{position:"absolute",right:12,top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",color:"var(--text-muted)",padding:0,display:"flex"},children:o.jsx("svg",{style:{width:16,height:16},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:a?"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.878 9.878L3 3m6.878 6.879L21 21":"M15 12a3 3 0 11-6 0 3 3 0 016 0z M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})})})]})]}),o.jsxs("button",{type:"submit",disabled:c,className:"btn btn-p btn-lg",style:{width:"100%",opacity:c?.6:1},children:[c&&o.jsx("span",{className:"w-4 h-4 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"#0E0E10",borderTopColor:"transparent"}}),c?"Signing in...":"Sign In"]})]}),o.jsx("p",{style:{textAlign:"center",marginTop:20,fontSize:10,color:"var(--text-muted)",letterSpacing:"0.02em"},children:"Ken operates as a CFTC-regulated Designated Contract Market"})]})]})}const b0=[{sym:"POTUS-2028",price:"52c",chg:"+3.1%",up:!0},{sym:"FED-RATE-CUT",price:"78c",chg:"-1.2%",up:!1},{sym:"BTC-100K",price:"34c",chg:"+5.8%",up:!0},{sym:"NVIDIA-BEAT",price:"91c",chg:"+0.4%",up:!0},{sym:"SP-5500",price:"67c",chg:"-2.3%",up:!1},{sym:"INFLATION-4PCT",price:"21c",chg:"+1.7%",up:!0},{sym:"RECESSION-2025",price:"18c",chg:"-0.9%",up:!1},{sym:"ETH-5K",price:"45c",chg:"+2.2%",up:!0},{sym:"APPLE-3T",price:"83c",chg:"+0.6%",up:!0},{sym:"FED-HOLD-JUN",price:"62c",chg:"-1.5%",up:!1},{sym:"JOBS-200K",price:"55c",chg:"+0.8%",up:!0},{sym:"OIL-90",price:"29c",chg:"-3.1%",up:!1},{sym:"OPENAI-IPO",price:"41c",chg:"+4.4%",up:!0},{sym:"GOLD-3K",price:"71c",chg:"+1.9%",up:!0},{sym:"TESLA-SPLIT",price:"37c",chg:"-0.7%",up:!1},{sym:"CPI-3PCT",price:"48c",chg:"+2.6%",up:!0},{sym:"TRUMP-TARIFF",price:"86c",chg:"+0.3%",up:!0},{sym:"VIX-SPIKE",price:"16c",chg:"-4.2%",up:!1},{sym:"SPACEX-LAUNCH",price:"94c",chg:"+0.1%",up:!0},{sym:"SENATE-FLIP",price:"33c",chg:"+3.7%",up:!0}];function UC(){return o.jsx("span",{style:{display:"inline-block",width:3,height:3,borderRadius:"50%",background:"var(--cyan)",opacity:.4,margin:"0 14px",verticalAlign:"middle",flexShrink:0}})}function HC({sym:e,price:t,chg:r,up:n}){return o.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,whiteSpace:"nowrap",fontFamily:"var(--font-mono)",fontSize:"0.68rem"},children:[o.jsx("span",{style:{color:"var(--text-dim)",fontWeight:600,letterSpacing:"0.04em"},children:e}),o.jsx("span",{style:{color:"var(--text)",fontWeight:700},children:t}),o.jsx("span",{style:{color:n?"var(--green)":"var(--red)",fontWeight:700,fontSize:"0.62rem"},children:r})]})}function KC(){const e=P.useMemo(()=>[...b0,...b0],[]);return o.jsxs("div",{style:{width:"100%",overflow:"hidden",background:"var(--surface)",borderBottom:"1px solid var(--border)",borderTop:"1px solid var(--border)",height:32,display:"flex",alignItems:"center",position:"relative"},"aria-label":"Live market ticker",role:"marquee",children:[o.jsx("div",{style:{position:"absolute",left:0,top:0,bottom:0,width:48,background:"linear-gradient(90deg, var(--surface), transparent)",zIndex:2,pointerEvents:"none"}}),o.jsx("div",{style:{position:"absolute",right:0,top:0,bottom:0,width:48,background:"linear-gradient(270deg, var(--surface), transparent)",zIndex:2,pointerEvents:"none"}}),o.jsx("div",{style:{display:"inline-flex",alignItems:"center",animation:"ticker 60s linear infinite",willChange:"transform",paddingLeft:24},children:e.map((t,r)=>o.jsxs($.Fragment,{children:[o.jsx(HC,{...t}),o.jsx(UC,{})]},r))})]})}const VC=[{to:"/",label:"Dashboard",d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"},{to:"/markets",label:"Markets",d:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"},{to:"/signals",label:"Signals",d:"M13 10V3L4 14h7v7l9-11h-7z"},{to:"/intelligence",label:"Intel Feed",d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z"},{to:"/trading",label:"Trading",d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},{to:"/positions",label:"Positions",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"},{to:"/orders",label:"Orders",d:"M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"},{to:"/heatmap",label:"Heatmap",d:"M4 5a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H5a1 1 0 01-1-1V5zm10 0a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1V5zM4 15a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H5a1 1 0 01-1-1v-4zm10 0a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z"},{to:"/orbit",label:"Orbit",d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"},{to:"/pulse",label:"Pulse",d:"M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},{to:"/weather",label:"Weather",d:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"},{to:"/risk",label:"Portfauxlios",d:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"},{to:"/settings",label:"Settings",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z"}];function GC({active:e,warn:t}){const r=t?"var(--orange)":e?"var(--green)":"var(--red)";return o.jsx("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:r,flexShrink:0,boxShadow:`0 0 4px ${r}`}})}function YC(){const e=pl(),t=xd(),[r,n]=P.useState(null),[a,i]=P.useState(!1),[s,l]=P.useState(!1);if(P.useEffect(()=>{Wv().then(u=>{if(!u){t("/login");return}l(!0);const f=()=>Oe("/health").then(n).catch(()=>{});f();const d=setInterval(f,15e3);return()=>clearInterval(d)})},[]),!s)return o.jsx("div",{className:"flex items-center justify-center min-h-screen",style:{background:"var(--bg)"},children:o.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})});const c=a?64:220;return o.jsxs("div",{className:"flex min-h-screen",style:{background:"var(--bg)"},children:[o.jsx("div",{className:"scan-overlay","aria-hidden":"true"}),o.jsxs("aside",{className:"sidebar-mesh",style:{width:c,minWidth:c,borderRight:"1px solid var(--border)",display:"flex",flexDirection:"column",transition:"width 200ms ease, min-width 200ms ease",overflow:"hidden",position:"sticky",top:0,height:"100vh"},children:[o.jsxs("div",{style:{padding:a?"16px 12px":"16px 18px",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",gap:12,minHeight:64,flexShrink:0},children:[o.jsx("div",{className:"logo-animated",style:{width:34,height:34,borderRadius:8,background:"linear-gradient(135deg, var(--orange), #E5690D)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,boxShadow:"0 2px 10px rgba(247,147,26,0.3)"},children:o.jsx("span",{style:{color:"#0E0E10",fontWeight:900,fontSize:16,fontFamily:"var(--font-heading)"},children:"K"})}),!a&&o.jsx("span",{className:"kalshi-gradient heading",style:{fontSize:13,fontWeight:700,letterSpacing:"0.06em",whiteSpace:"nowrap",filter:"drop-shadow(0 0 8px rgba(0,240,255,0.3))"},children:"KEN TRADER"})]}),o.jsx("nav",{style:{flex:1,padding:"10px 8px",overflowY:"auto",overflowX:"hidden"},children:VC.map((u,f)=>{const d=e.pathname===u.to||u.to!=="/"&&e.pathname.startsWith(u.to),h=u.to==="/settings";return o.jsxs($.Fragment,{children:[h&&o.jsx("div",{style:{margin:"8px 4px",height:1,background:"linear-gradient(90deg, transparent, var(--border), transparent)"}}),o.jsxs(Sc,{to:u.to,title:a?u.label:void 0,style:{display:"flex",alignItems:"center",gap:a?0:10,padding:a?"9px 0":"9px 10px",justifyContent:a?"center":"flex-start",borderRadius:8,marginBottom:2,textDecoration:"none",fontSize:13,fontWeight:d?600:400,color:d?"var(--cyan)":"var(--text-dim)",background:d?"rgba(0,240,255,0.08)":"transparent",borderLeft:d?"3px solid var(--cyan)":"3px solid transparent",boxShadow:d?"inset 0 0 16px rgba(0,240,255,0.06), inset 3px 0 8px rgba(0,240,255,0.1)":void 0,textShadow:d?"0 0 8px rgba(0,240,255,0.4)":void 0,transition:"all 150ms ease",whiteSpace:"nowrap",overflow:"hidden"},onMouseEnter:p=>{d||(p.currentTarget.style.color="var(--text)",p.currentTarget.style.background="rgba(0,240,255,0.04)",p.currentTarget.style.borderLeftColor="rgba(0,240,255,0.3)")},onMouseLeave:p=>{d||(p.currentTarget.style.color="var(--text-dim)",p.currentTarget.style.background="transparent",p.currentTarget.style.borderLeftColor="transparent")},children:[o.jsx("svg",{style:{width:17,height:17,flexShrink:0,opacity:d?1:.7},fill:"none",stroke:"currentColor",strokeWidth:"1.6",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:u.d})}),!a&&o.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis"},children:u.label})]})]},u.to)})}),o.jsxs("div",{style:{borderTop:"1px solid var(--border)",padding:a?"12px 8px":"12px 14px",flexShrink:0},children:[!a&&r&&o.jsx("div",{style:{marginBottom:10,display:"flex",flexDirection:"column",gap:6},children:[{label:"Env",value:(r.env||"demo").toUpperCase(),warn:r.env==="demo",active:r.env==="prod"},{label:"API",value:r.kalshi_connected?"CONNECTED":"OFF",active:r.kalshi_connected},{label:"DB",value:r.db_connected?"OK":"DOWN",active:r.db_connected},{label:"Safe Mode",value:r.safe_mode?"ON":"OFF",warn:r.safe_mode,active:!r.safe_mode}].map(u=>o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o.jsx("span",{style:{fontSize:10,color:"var(--text-muted)",fontFamily:"var(--font-body)"},children:u.label}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5},children:[o.jsx(GC,{active:u.active,warn:u.warn}),o.jsx("span",{style:{fontSize:10,fontFamily:"var(--font-mono)",fontWeight:600,color:u.warn?"var(--orange)":u.active?"var(--green)":"var(--red)"},children:u.value})]})]},u.label))}),o.jsxs("div",{style:{display:"flex",gap:6,alignItems:"center"},children:[o.jsx("button",{onClick:()=>i(!a),title:a?"Expand sidebar":"Collapse sidebar",style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",padding:"7px 0",background:"transparent",border:"1px solid var(--border)",borderRadius:7,cursor:"pointer",color:"var(--text-muted)",transition:"all 150ms ease"},onMouseEnter:u=>{u.currentTarget.style.borderColor="var(--cyan)",u.currentTarget.style.color="var(--cyan)"},onMouseLeave:u=>{u.currentTarget.style.borderColor="var(--border)",u.currentTarget.style.color="var(--text-muted)"},children:o.jsx("svg",{style:{width:14,height:14,transition:"transform 200ms ease",transform:a?"rotate(180deg)":"none"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M11 19l-7-7 7-7m8 14l-7-7 7-7"})})}),!a&&o.jsx("button",{onClick:BC,style:{padding:"7px 10px",background:"transparent",border:"1px solid var(--border)",borderRadius:7,cursor:"pointer",color:"var(--text-muted)",fontSize:11,fontFamily:"var(--font-body)",fontWeight:500,transition:"all 150ms ease",whiteSpace:"nowrap"},onMouseEnter:u=>{u.currentTarget.style.borderColor="var(--red)",u.currentTarget.style.color="var(--red)"},onMouseLeave:u=>{u.currentTarget.style.borderColor="var(--border)",u.currentTarget.style.color="var(--text-muted)"},children:"Logout"})]})]})]}),o.jsxs("main",{style:{flex:1,overflowY:"auto",overflowX:"hidden",display:"flex",flexDirection:"column"},children:[o.jsx(KC,{}),o.jsxs("div",{className:"market-status-bar",children:[o.jsx("span",{style:{color:"var(--cyan)",fontWeight:700,letterSpacing:"0.06em"},children:"KEN TRADER"}),o.jsx("span",{style:{color:"var(--border-light)"},children:"|"}),o.jsxs("span",{children:["KALSHI"," ",o.jsx("span",{style:{color:r!=null&&r.kalshi_connected?"var(--green)":"var(--red)",fontWeight:700},children:r!=null&&r.kalshi_connected?"LIVE":"OFFLINE"})]}),o.jsx("span",{style:{color:"var(--border-light)"},children:"|"}),o.jsxs("span",{children:["DB"," ",o.jsx("span",{style:{color:r!=null&&r.db_connected?"var(--green)":"var(--red)",fontWeight:700},children:r!=null&&r.db_connected?"OK":"DOWN"})]}),o.jsx("span",{style:{color:"var(--border-light)"},children:"|"}),o.jsxs("span",{children:["ENV"," ",o.jsx("span",{style:{color:(r==null?void 0:r.env)==="prod"?"var(--green)":"var(--orange)",fontWeight:700},children:((r==null?void 0:r.env)||"DEMO").toUpperCase()})]}),(r==null?void 0:r.safe_mode)&&o.jsxs(o.Fragment,{children:[o.jsx("span",{style:{color:"var(--border-light)"},children:"|"}),o.jsx("span",{style:{color:"var(--orange)",fontWeight:700},children:"SAFE MODE ON"})]}),o.jsxs("span",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:12},children:[o.jsxs("span",{style:{color:"var(--border-light)"},children:[new Date().toLocaleTimeString("en-US",{timeZone:"America/Los_Angeles",hour:"2-digit",minute:"2-digit",second:"2-digit"})," PT"]}),o.jsxs("button",{className:"notification-bell","aria-label":"Alerts (7 unread)",title:"7 unread alerts",style:{background:"none",border:"none",display:"flex",alignItems:"center"},children:[o.jsx("svg",{fill:"none",stroke:"currentColor",strokeWidth:"1.8",viewBox:"0 0 24 24","aria-hidden":"true",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})}),o.jsx("span",{className:"notification-count","aria-label":"7 alerts",children:"7"})]})]})]}),o.jsx("div",{style:{maxWidth:1600,margin:"0 auto",padding:"24px 28px",flex:1,width:"100%"},children:o.jsx(wC,{})})]})]})}const qC=[{title:"Event Contracts",desc:"Betting on weather like a person who never learned to just look outside. CFTC-regulated, at least.",icon:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"},{title:"Weather Intelligence",desc:"We schlepp forecast data from the government so you don't have to read the almanac yourself.",icon:"M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"},{title:"Automated Execution",desc:"The machine places your bets so your hands stay clean. Safe mode included, because I worry.",icon:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"}],XC=["Hook up to Ken (demo first, like a sensible person)","Snoop around the weather contracts","Schlep in the NWS settlement data","Let the computer do the math you were too lazy to learn","Set some limits so you don't lose your shirt","Place the bets (on paper first, God willing)"];function QC({next:e}){return o.jsxs("div",{className:"space-y-8",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("h1",{className:"text-4xl font-bold kalshi-gradient mb-3",children:"Oy, Look Who Finally Showed Up"}),o.jsx("p",{className:"text-gray-400 text-lg",children:"So you want to bet on the weather? Your mother would be so proud."})]}),o.jsx("div",{className:"grid grid-cols-3 gap-4",children:qC.map(t=>o.jsxs("div",{className:"card text-center",children:[o.jsx("div",{className:"w-10 h-10 rounded-lg bg-amber-500/10 flex items-center justify-center mx-auto mb-3",children:o.jsx("svg",{className:"w-5 h-5 text-amber-400",fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:t.icon})})}),o.jsx("h3",{className:"font-semibold text-sm mb-1",children:t.title}),o.jsx("p",{className:"text-xs text-gray-500 leading-relaxed",children:t.desc})]},t.title))}),o.jsxs("div",{className:"card",children:[o.jsx("h3",{className:"font-semibold text-sm mb-3",children:"Listen, this is how it works"}),o.jsx("div",{className:"grid grid-cols-2 gap-2",children:XC.map((t,r)=>o.jsxs("div",{className:"flex items-center gap-3 py-1.5",children:[o.jsx("span",{className:"w-6 h-6 rounded-full bg-amber-500/15 text-amber-400 flex items-center justify-center text-xs font-bold flex-shrink-0",children:r+1}),o.jsx("span",{className:"text-sm text-gray-300",children:t})]},r))})]}),o.jsx("div",{className:"card bg-green-500/5 border-green-500/20",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("svg",{className:"w-5 h-5 text-green-400 mt-0.5 flex-shrink-0",fill:"none",stroke:"currentColor",strokeWidth:"1.5",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-green-400",children:"At least it's legal, thank God"}),o.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Ken is a real CFTC-regulated exchange, not some offshore mishegoss. You'll need an account with API access. Go make one already, I'll wait."})]})]})}),o.jsx("div",{className:"flex justify-center",children:o.jsx("button",{onClick:e,className:"btn btn-p px-8 py-3 text-base font-bold rounded-xl",children:"Nu, Let's Go Already"})})]})}function JC({data:e,update:t,next:r,back:n}){var b,v,m;const[a,i]=P.useState(((b=e.keys)==null?void 0:b.api_key)||""),[s,l]=P.useState(((v=e.keys)==null?void 0:v.private_key)||""),[c,u]=P.useState(((m=e.keys)==null?void 0:m.env)||"demo"),[f,d]=P.useState(!1),[h,p]=P.useState(null);async function g(){d(!0),p(null);try{const x=await me("/kalshi",{action:"save_keys",api_key:a,private_key:s,env:c});x.success?(t({keys:{api_key:a,private_key:"***",env:c}}),r()):p(x.error||"Failed to save")}catch{p("Connection error")}d(!1)}function y(){t({keys:null,skippedConnect:!0}),r()}return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Give Me the Keys"}),o.jsx("p",{className:"text-gray-400 text-sm",children:"Your API credentials, darling. I don't have all day."})]}),o.jsxs("div",{className:"card space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-xs text-gray-400 mb-1.5 font-medium",children:"Which playground are we using?"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("button",{onClick:()=>u("demo"),className:`flex-1 py-2 rounded-lg text-sm font-medium transition ${c==="demo"?"bg-yellow-500/15 text-yellow-400 border border-yellow-500/30":"bg-gray-800/50 text-gray-500 border border-gray-700"}`,children:"Demo (Smart)"}),o.jsx("button",{onClick:()=>u("prod"),className:`flex-1 py-2 rounded-lg text-sm font-medium transition ${c==="prod"?"bg-green-500/15 text-green-400 border border-green-500/30":"bg-gray-800/50 text-gray-500 border border-gray-700"}`,children:"Production (Brave)"})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-xs text-gray-400 mb-1.5 font-medium",children:"API Key ID (the one they gave you)"}),o.jsx("input",{type:"text",value:a,onChange:x=>i(x.target.value),placeholder:"Paste it here, bubeleh",className:"w-full px-3 py-2 bg-gray-800/50 border border-gray-700 rounded-lg text-sm focus:border-amber-500 focus:outline-none font-mono"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-xs text-gray-400 mb-1.5 font-medium",children:"Private Key (the whole megillah, PEM format)"}),o.jsx("textarea",{value:s,onChange:x=>l(x.target.value),placeholder:`-----BEGIN RSA PRIVATE KEY-----
+...
+-----END RSA PRIVATE KEY-----`,rows:6,className:"w-full px-3 py-2 bg-gray-800/50 border border-gray-700 rounded-lg text-sm focus:border-amber-500 focus:outline-none font-mono text-xs leading-relaxed"}),o.jsx("p",{className:"text-[10px] text-gray-600 mt-1",children:"Don't worry, I keep it locked up tighter than your grandmother's jewelry box"})]}),h&&o.jsx("p",{className:"text-red-400 text-xs",children:h})]}),o.jsxs("div",{className:"card bg-gray-800/30",children:[o.jsx("h3",{className:"text-sm font-medium mb-2",children:"What, you don't have keys yet? Oy vey."}),o.jsxs("ol",{className:"text-xs text-gray-400 space-y-1.5 list-decimal list-inside",children:[o.jsxs("li",{children:["Go log into ",o.jsx("span",{className:"text-amber-400 font-mono",children:"ken.com"})," like a mensch"]}),o.jsx("li",{children:"Find Settings → API Keys (it's not that hard, look around)"}),o.jsxs("li",{children:['Click "Create API Key" and ',o.jsx("strong",{children:"download that private key file immediately"})]}),o.jsx("li",{children:"Copy the Key ID and paste the PEM contents up there. Simple."})]}),o.jsx("p",{className:"text-[10px] text-red-400 mt-2",children:"Listen to me — that private key file? You can only download it ONCE. Lose it and you start over. Don't say I didn't warn you."})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("button",{onClick:n,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("button",{onClick:y,className:"text-sm text-gray-500 hover:text-gray-300",children:"Skip (play pretend)"}),o.jsx("button",{onClick:g,disabled:f||!a||!s,className:"btn btn-p",children:f?"Saving, patience...":"Save & Continue"})]})]})]})}function ZC({data:e,update:t,next:r,back:n}){const[a,i]=P.useState(null),[s,l]=P.useState(null),[c,u]=P.useState(!0),[f,d]=P.useState(!1);P.useEffect(()=>{h()},[]);async function h(){u(!0);try{const b=await me("/kalshi",{action:"test_connection"});i(b),b.success&&e.keys&&!e.skippedConnect&&p()}catch{i({error:!0})}u(!1)}async function p(){d(!0);try{const b=await me("/kalshi",{action:"get_balance"});l(b),b.success&&t({connectionOk:!0})}catch{l({error:!0})}d(!1)}const g=e.skippedConnect,y=({title:b,loading:v,result:m,skippedMsg:x})=>o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[x?o.jsx("div",{className:"w-5 h-5 rounded-full bg-yellow-500 flex items-center justify-center",children:o.jsx("span",{className:"text-white text-xs font-bold",children:"—"})}):v?o.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-amber-500 border-t-transparent rounded-full"}):m!=null&&m.success?o.jsx("div",{className:"w-5 h-5 rounded-full bg-green-500 flex items-center justify-center",children:o.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",strokeWidth:"3",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}):m!=null&&m.error?o.jsx("div",{className:"w-5 h-5 rounded-full bg-red-500 flex items-center justify-center",children:o.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",strokeWidth:"3",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}):o.jsx("div",{className:"w-5 h-5 rounded-full bg-gray-600"}),o.jsx("h3",{className:"font-semibold text-sm",children:b})]}),x?o.jsx("p",{className:"text-xs text-yellow-400",children:x}):m!=null&&m.success?o.jsxs("div",{className:"space-y-1 text-xs text-gray-400",children:[m.exchange_status&&o.jsxs("p",{children:["Exchange: ",o.jsx("span",{className:"text-green-400 font-mono",children:m.exchange_status})]}),m.balance!==void 0&&o.jsxs("p",{children:["Balance: ",o.jsxs("span",{className:"text-green-400 font-mono",children:["$",(m.balance/100).toFixed(2)]})]}),m.env&&o.jsxs("p",{children:["Env: ",o.jsx("span",{className:"text-amber-400 font-mono",children:m.env.toUpperCase()})]})]}):m!=null&&m.error?o.jsx("p",{className:"text-xs text-red-400",children:typeof m.error=="string"?m.error:"Connection failed"}):null]});return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Let's See If This Thing Works"}),o.jsx("p",{className:"text-gray-400 text-sm",children:"I'm checking your wiring. Hold your horses."})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsx(y,{title:"Is Ken Even Open?",loading:c,result:a}),o.jsx(y,{title:"Do They Know Who You Are?",loading:f,result:s,skippedMsg:g?"You skipped this — playing pretend, remember?":e.keys?null:"No keys, no entry. What did you expect?"})]}),!c&&!f&&o.jsx("div",{className:"flex justify-center",children:o.jsx("button",{onClick:h,className:"text-xs text-gray-500 hover:text-gray-300",children:"Try again, maybe this time it'll listen"})}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("button",{onClick:n,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),o.jsx("button",{onClick:r,className:"btn btn-p",children:"Continue"})]})]})}function eE({data:e,update:t,next:r,back:n}){var h,p;const[a,i]=P.useState(!0),[s,l]=P.useState(null),[c,u]=P.useState(null);P.useEffect(()=>{f()},[]);async function f(){var g;i(!0),u(null);try{const y=await me("/kalshi",{action:"get_events",params:{status:"open",limit:50}});l(y);const b=((g=y.events)==null?void 0:g.length)||0;t({marketsLoaded:b})}catch{u("Failed to load markets")}i(!1)}const d=((s==null?void 0:s.events)||[]).filter(g=>(g.category||"").toLowerCase().includes("climate")||(g.category||"").toLowerCase().includes("weather")||(g.title||"").toLowerCase().includes("temperature")||(g.title||"").toLowerCase().includes("rain")||(g.title||"").toLowerCase().includes("snow")||(g.title||"").toLowerCase().includes("precipitation"));return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Let's See What They're Selling"}),o.jsx("p",{className:"text-gray-400 text-sm",children:"I'm snooping through the markets. You're welcome."})]}),o.jsx("div",{className:"card",children:a?o.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-4",children:[o.jsx("div",{className:"animate-spin w-10 h-10 border-3 border-amber-500 border-t-transparent rounded-full"}),o.jsx("p",{className:"text-sm text-gray-400",children:"Schlepping markets from Ken... patience is a virtue"})]}):c?o.jsxs("div",{className:"text-center py-8",children:[o.jsx("p",{className:"text-red-400 text-sm mb-3",children:c}),o.jsx("button",{onClick:f,className:"btn btn-s text-sm",children:"Retry"})]}):o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("p",{className:"stat-v text-amber-400",children:((h=s==null?void 0:s.events)==null?void 0:h.length)||0}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Things to Bet On"})]}),o.jsxs("div",{className:"text-center",children:[o.jsx("p",{className:"stat-v text-blue-400",children:d.length}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Weather Bets (Our Thing)"})]}),o.jsxs("div",{className:"text-center",children:[o.jsx("p",{className:"stat-v text-green-400",children:((p=s==null?void 0:s.markets)==null?void 0:p.length)||"—"}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Individual Contracts"})]})]}),d.length>0&&o.jsxs("div",{className:"border-t border-gray-800 pt-3",children:[o.jsx("p",{className:"text-xs text-gray-500 mb-2 uppercase font-medium",children:"Weather Bets I Found For You"}),o.jsx("div",{className:"space-y-1.5 max-h-48 overflow-y-auto",children:d.slice(0,12).map((g,y)=>o.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[o.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-500 flex-shrink-0"}),o.jsx("span",{className:"text-gray-300 truncate",children:g.title}),o.jsx("span",{className:"text-gray-600 ml-auto font-mono text-[10px]",children:g.event_ticker})]},y))})]}),d.length===0&&o.jsx("p",{className:"text-center text-gray-500 text-sm py-4",children:"No weather bets right now. What, the weather took a day off? Other markets are there at least."})]})}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("button",{onClick:n,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),o.jsx("button",{onClick:r,disabled:a,className:"btn btn-p",children:a?"Loading...":"Continue"})]})]})}function tE({data:e,update:t,next:r,back:n}){var d;const[a,i]=P.useState(!0),[s,l]=P.useState(null),[c,u]=P.useState(null);P.useEffect(()=>{f()},[]);async function f(){i(!0),u(null);try{const h=await me("/weather",{action:"fetch_all"});l(h),t({weatherFetched:!0})}catch{u("Failed to fetch weather data")}i(!1)}return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Checking the Weather, Darling"}),o.jsx("p",{className:"text-gray-400 text-sm",children:"I'm schlepping in the government weather reports. In my day we just looked outside."})]}),o.jsx("div",{className:"card",children:a?o.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-4",children:[o.jsx("div",{className:"animate-spin w-10 h-10 border-3 border-blue-500 border-t-transparent rounded-full"}),o.jsx("p",{className:"text-sm text-gray-400",children:"Fetching from the National Weather Service... they take their sweet time"})]}):c?o.jsxs("div",{className:"text-center py-8",children:[o.jsx("p",{className:"text-red-400 text-sm mb-3",children:c}),o.jsx("button",{onClick:f,className:"btn btn-s text-sm",children:"Retry"})]}):o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center justify-center gap-3 py-4",children:[o.jsx("div",{className:"w-12 h-12 rounded-full bg-green-500/10 flex items-center justify-center",children:o.jsx("svg",{className:"w-6 h-6 text-green-400",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),o.jsxs("div",{children:[o.jsx("p",{className:"font-semibold text-green-400",children:"Got the Weather, Finally"}),o.jsx("p",{className:"text-xs text-gray-400",children:"All the fancy government data, right here in your tuchas seat"})]})]}),o.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[o.jsxs("div",{className:"text-center p-3 bg-gray-800/30 rounded-lg",children:[o.jsx("p",{className:"stat-v text-blue-400",children:(s==null?void 0:s.stations)||"—"}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Stations"})]}),o.jsxs("div",{className:"text-center p-3 bg-gray-800/30 rounded-lg",children:[o.jsx("p",{className:"stat-v text-amber-400",children:(s==null?void 0:s.data_points)||"—"}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Data Points"})]}),o.jsxs("div",{className:"text-center p-3 bg-gray-800/30 rounded-lg",children:[o.jsx("p",{className:"stat-v text-green-400",children:((d=s==null?void 0:s.metrics)==null?void 0:d.length)||"—"}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Metrics"})]})]})]})}),o.jsxs("div",{className:"card bg-gray-800/30",children:[o.jsx("p",{className:"text-xs text-gray-500 mb-1 font-medium",children:"How They Settle (Pay Attention)"}),o.jsxs("p",{className:"text-xs text-gray-400",children:["Ken settles on the ",o.jsx("span",{className:"text-amber-400",children:"final NWS Daily Climate Report"}),". A trace of rain? That's zero. Missing data? Also zero. And listen — the first report is the last word. They don't go back and change it, even if the weatherman was wrong. Such is life."]})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("button",{onClick:n,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),o.jsx("button",{onClick:r,disabled:a,className:"btn btn-p",children:a?"Fetching...":"Continue"})]})]})}function rE({data:e,update:t,next:r,back:n}){const[a,i]=P.useState(!0),[s,l]=P.useState(null),[c,u]=P.useState(null);P.useEffect(()=>{f()},[]);async function f(){i(!0),u(null);try{const p=await me("/kalshi",{action:"run_predictions"});l(p),t({predictionsRun:!0})}catch{u("Failed to generate predictions")}i(!1)}const d=(s==null?void 0:s.predictions)||[],h=d.filter(p=>(p.edge_bps||0)>0);return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("h2",{className:"text-2xl font-bold mb-2",children:"The Machine Is Thinking"}),o.jsx("p",{className:"text-gray-400 text-sm",children:"Running the numbers so you don't have to use that head of yours"})]}),o.jsx("div",{className:"card",children:a?o.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-4",children:[o.jsx("div",{className:"animate-spin w-10 h-10 border-3 border-green-500 border-t-transparent rounded-full"}),o.jsx("p",{className:"text-sm text-gray-400",children:"Crunching numbers... in my day we did this with an abacus"})]}):c?o.jsxs("div",{className:"text-center py-8",children:[o.jsx("p",{className:"text-red-400 text-sm mb-3",children:c}),o.jsx("button",{onClick:f,className:"btn btn-s text-sm",children:"Retry"})]}):o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("p",{className:"stat-v text-amber-400",children:d.length}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Opinions"})]}),o.jsxs("div",{className:"text-center",children:[o.jsx("p",{className:"stat-v text-green-400",children:h.length}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Worth a Look"})]}),o.jsxs("div",{className:"text-center",children:[o.jsxs("p",{className:"stat-v text-blue-400",children:[(s==null?void 0:s.avg_edge_bps)||0,"bps"]}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Your Edge (God Willing)"})]})]}),d.length>0&&o.jsx("div",{className:"border-t border-gray-800 pt-3",children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Contract"}),o.jsx("th",{children:"Side"}),o.jsx("th",{children:"Price"}),o.jsx("th",{children:"Edge"}),o.jsx("th",{children:"Signal"})]})}),o.jsx("tbody",{children:d.slice(0,6).map((p,g)=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-[180px]",children:o.jsx("span",{className:"truncate block text-xs",children:p.ticker||p.market})}),o.jsx("td",{children:o.jsx("span",{className:`badge ${p.side==="yes"?"bg-green":"bg-red"}`,children:(p.side||"yes").toUpperCase()})}),o.jsxs("td",{className:"font-mono text-sm",children:[p.price_cents||"—","c"]}),o.jsxs("td",{className:`font-mono text-sm ${(p.edge_bps||0)>0?"text-green-400":"text-gray-500"}`,children:[p.edge_bps||0,"bps"]}),o.jsx("td",{children:o.jsx("span",{className:`badge ${(p.edge_bps||0)>0?"bg-green":"bg-yellow"}`,children:(p.edge_bps||0)>0?"BUY":"HOLD"})})]},g))})]})})]})}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("button",{onClick:n,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),o.jsx("button",{onClick:r,disabled:a,className:"btn btn-p",children:a?"Processing...":"Continue"})]})]})}const j0=[{name:"Conservative",maxContracts:5,maxDollars:25,dailyLoss:10,color:"blue",desc:"Like your bubbe taught you — small bets, tight grip on the purse strings."},{name:"Moderate",maxContracts:20,maxDollars:100,dailyLoss:50,color:"amber",desc:"Not too much, not too little. Like Goldilocks, but with money.",recommended:!0},{name:"Aggressive",maxContracts:50,maxDollars:500,dailyLoss:200,color:"red",desc:"What are you, a big shot? Don't come crying to me when it goes sideways."}];function nE({data:e,update:t,next:r,back:n}){const[a,i]=P.useState(e.riskProfile||"Moderate"),[s,l]=P.useState(!1);async function c(){l(!0);const u=j0.find(f=>f.name===a);try{await me("/risk",{action:"update_config",max_contracts_per_market:u.maxContracts,max_dollars_at_risk:u.maxDollars,daily_loss_cap:u.dailyLoss,risk_profile:u.name}),t({riskProfile:a}),r()}catch{}l(!1)}return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("h2",{className:"text-2xl font-bold mb-2",children:"How Much Are You Willing to Lose?"}),o.jsx("p",{className:"text-gray-400 text-sm",children:'Pick one. And no, "all of it" is not an option.'})]}),o.jsx("div",{className:"grid grid-cols-3 gap-4",children:j0.map(u=>{const d={blue:{ring:"#3b82f6",text:"text-blue-400"},amber:{ring:"#f59e0b",text:"text-amber-400"},red:{ring:"#ef4444",text:"text-red-400"}}[u.color];return o.jsxs("button",{onClick:()=>i(u.name),className:"card text-left transition-all relative",style:a===u.name?{boxShadow:`0 0 0 2px ${d.ring}`}:{},children:[u.recommended&&o.jsx("span",{className:"absolute -top-2 right-3 text-[9px] font-bold uppercase px-2 py-0.5 rounded-full bg-amber-500 text-black",children:"Recommended"}),o.jsx("h3",{className:`font-bold text-lg mb-1 ${d.text}`,children:u.name}),o.jsx("p",{className:"text-xs text-gray-500 mb-3",children:u.desc}),o.jsxs("div",{className:"space-y-1.5 text-xs",children:[o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{className:"text-gray-500",children:"Max Contracts"}),o.jsx("span",{className:"font-mono text-gray-300",children:u.maxContracts})]}),o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{className:"text-gray-500",children:"Max $ at Risk"}),o.jsxs("span",{className:"font-mono text-gray-300",children:["$",u.maxDollars]})]}),o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{className:"text-gray-500",children:"Daily Loss Cap"}),o.jsxs("span",{className:"font-mono text-gray-300",children:["$",u.dailyLoss]})]})]})]},u.name)})}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("button",{onClick:n,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),o.jsx("button",{onClick:c,disabled:s,className:"btn btn-p",children:s?"Saving...":"Save & Continue"})]})]})}const Ff=[{key:"keys",label:"Gave me the API keys (good)",check:e=>!!e.keys},{key:"conn",label:"Connection actually works (miracle)",check:e=>!!e.connectionOk},{key:"markets",label:"Found some markets to bet on",check:e=>e.marketsLoaded>0},{key:"weather",label:"Got the weather data (finally)",check:e=>!!e.weatherFetched},{key:"preds",label:"The machine made its predictions",check:e=>!!e.predictionsRun},{key:"risk",label:"Set some limits (smart)",check:e=>!!e.riskProfile}];function aE({data:e,complete:t,back:r}){const[n,a]=P.useState(!0),[i,s]=P.useState(!1),l=Ff.filter(f=>f.check(e)).length,c=e.skippedConnect;async function u(){s(!0),await t()}return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"text-center",children:[o.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Alright, Mazel Tov"}),o.jsx("p",{className:"text-gray-400 text-sm",children:"Let's see if you actually did everything right. I have my doubts."})]}),o.jsxs("div",{className:"card",children:[o.jsx("h3",{className:"font-semibold text-sm mb-3",children:"Your Report Card"}),o.jsx("div",{className:"space-y-2",children:Ff.map(f=>{const d=f.check(e),h=f.key==="keys"&&c;return o.jsxs("div",{className:"flex items-center gap-3",children:[d?o.jsx("div",{className:"w-5 h-5 rounded-full bg-green-500 flex items-center justify-center flex-shrink-0",children:o.jsx("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",strokeWidth:"3",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}):h?o.jsx("div",{className:"w-5 h-5 rounded-full bg-yellow-500 flex items-center justify-center flex-shrink-0",children:o.jsx("span",{className:"text-white text-[10px] font-bold",children:"—"})}):o.jsx("div",{className:"w-5 h-5 rounded-full bg-gray-700 flex-shrink-0"}),o.jsxs("span",{className:`text-sm ${d?"text-gray-200":h?"text-yellow-400":"text-gray-500"}`,children:[f.label,h?" (skipped)":""]})]},f.key)})}),o.jsxs("p",{className:"text-xs text-gray-500 mt-3 pt-3 border-t border-gray-800",children:[l,"/",Ff.length," steps completed"]})]}),o.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[o.jsxs("div",{className:"card text-center",children:[o.jsx("p",{className:"stat-v text-amber-400",children:e.marketsLoaded||0}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Markets"})]}),o.jsxs("div",{className:"card text-center",children:[o.jsx("p",{className:"stat-v text-blue-400",children:e.riskProfile||"—"}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Risk Profile"})]}),o.jsxs("div",{className:"card text-center",children:[o.jsx("p",{className:"stat-v text-green-400",children:e.keys?(e.keys.env||"demo").toUpperCase():"PAPER"}),o.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Mode"})]})]}),o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"font-semibold text-sm",children:"Safe Mode (I Recommend It)"}),o.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:n?"Paper trading — playing pretend, like a sensible person":"Live orders! With real money! Oy gevalt."})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:`text-xs font-medium ${n?"text-yellow-400":"text-gray-500"}`,children:"Safe"}),o.jsx("button",{onClick:()=>a(!n),disabled:!e.keys,className:`w-11 h-6 rounded-full transition-colors relative ${n?"bg-yellow-500/30":"bg-green-500/30"} ${e.keys?"":"opacity-50 cursor-not-allowed"}`,children:o.jsx("div",{className:`w-4 h-4 rounded-full absolute top-1 transition-all ${n?"left-1 bg-yellow-400":"left-6 bg-green-400"}`})}),o.jsx("span",{className:`text-xs font-medium ${n?"text-gray-500":"text-green-400"}`,children:"Live"})]})]}),!n&&o.jsx("div",{className:"mt-3 p-2 bg-red-500/10 border border-red-500/20 rounded-lg",children:o.jsx("p",{className:"text-xs text-red-400",children:"Live mode means real money, bubeleh. Real. Money. Don't say I didn't warn you. Make sure you've got funds and your limits are set, or so help me."})})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("button",{onClick:r,className:"text-sm text-gray-500 hover:text-gray-300",children:"Back"}),o.jsx("button",{onClick:u,disabled:i,className:"btn btn-p text-lg px-8 py-3 rounded-xl font-bold",children:i?"Starting up, hold your horses...":"Go Make Some Gelt Already"})]})]})}const Hl=[{label:"Shalom",icon:"1"},{label:"Keys",icon:"2"},{label:"Test It",icon:"3"},{label:"Snoop",icon:"4"},{label:"Weather",icon:"5"},{label:"Predict",icon:"6"},{label:"Limits",icon:"7"},{label:"Mazel Tov",icon:"8"}],iE=[QC,JC,ZC,eE,tE,rE,nE,aE];function oE(){const e=xd(),[t,r]=P.useState(!1),[n,a]=P.useState(0),[i,s]=P.useState({keys:null,connectionOk:!1,marketsLoaded:0,weatherFetched:!1,predictionsRun:!1,riskProfile:null});P.useEffect(()=>{Wv().then(p=>{if(!p){e("/login");return}r(!0),Oe("/setup").then(g=>{if(g.setup_complete){e("/");return}g.setup_progress&&(a(g.setup_progress.step||0),s(y=>({...y,...g.setup_progress.data})))}).catch(()=>{})})},[]),P.useEffect(()=>{t&&n>0&&me("/setup",{action:"save_progress",progress:{step:n,data:i}}).catch(()=>{})},[n]);function l(){n<Hl.length-1&&a(p=>p+1)}function c(){n>0&&a(p=>p-1)}function u(p){p<=n&&a(p)}function f(p){s(g=>({...g,...p}))}async function d(){await me("/setup",{action:"complete",progress:{step:Hl.length-1,data:i}}),e("/")}if(!t)return o.jsx("div",{className:"flex items-center justify-center min-h-screen",children:o.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-amber-500 border-t-transparent rounded-full"})});const h=iE[n];return o.jsxs("div",{className:"min-h-screen flex flex-col",style:{background:"var(--bg)"},children:[o.jsxs("div",{className:"flex items-center gap-3 px-6 py-4 border-b border-gray-800",children:[o.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"linear-gradient(135deg,#f59e0b,#f97316)"},children:o.jsx("span",{className:"text-black font-bold text-sm",children:"K"})}),o.jsx("span",{className:"font-bold text-sm kalshi-gradient",children:"KEN SETUP — SIT, WE'LL TALK"})]}),o.jsx("div",{className:"px-6 py-5",children:o.jsx("div",{className:"max-w-3xl mx-auto flex items-center",children:Hl.map((p,g)=>o.jsxs($.Fragment,{children:[o.jsxs("button",{onClick:()=>u(g),disabled:g>n,className:"flex flex-col items-center gap-1.5 group",style:{minWidth:56},children:[o.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center text-xs font-bold transition-all ${g<n?"bg-green-500 text-white":g===n?"bg-amber-500 text-black":"bg-gray-800 text-gray-500"} ${g<=n?"cursor-pointer":"cursor-default"}`,style:g===n?{animation:"pg 2s infinite"}:{},children:g<n?o.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",strokeWidth:"2.5",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):p.icon}),o.jsx("span",{className:`text-[10px] font-medium ${g<n?"text-green-400":g===n?"text-amber-400":"text-gray-600"}`,children:p.label})]}),g<Hl.length-1&&o.jsx("div",{className:`h-0.5 flex-1 transition-colors ${g<n?"bg-green-500":"bg-gray-800"}`})]},g))})}),o.jsx("div",{className:"flex-1 flex items-start justify-center px-6 pb-10",children:o.jsx("div",{className:"w-full max-w-2xl",children:o.jsx(h,{data:i,update:f,next:l,back:c,complete:d,step:n})},n)})]})}function sS(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=sS(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function ee(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=sS(e))&&(n&&(n+=" "),n+=t);return n}var sE=Array.isArray,$t=sE,lE=typeof Ol=="object"&&Ol&&Ol.Object===Object&&Ol,lS=lE,cE=lS,uE=typeof self=="object"&&self&&self.Object===Object&&self,dE=cE||uE||Function("return this")(),Mr=dE,fE=Mr,hE=fE.Symbol,ml=hE,w0=ml,cS=Object.prototype,pE=cS.hasOwnProperty,mE=cS.toString,No=w0?w0.toStringTag:void 0;function vE(e){var t=pE.call(e,No),r=e[No];try{e[No]=void 0;var n=!0}catch{}var a=mE.call(e);return n&&(t?e[No]=r:delete e[No]),a}var yE=vE,gE=Object.prototype,xE=gE.toString;function bE(e){return xE.call(e)}var jE=bE,S0=ml,wE=yE,SE=jE,_E="[object Null]",kE="[object Undefined]",_0=S0?S0.toStringTag:void 0;function OE(e){return e==null?e===void 0?kE:_E:_0&&_0 in Object(e)?wE(e):SE(e)}var on=OE;function NE(e){return e!=null&&typeof e=="object"}var sn=NE,PE=on,AE=sn,CE="[object Symbol]";function EE(e){return typeof e=="symbol"||AE(e)&&PE(e)==CE}var ao=EE,$E=$t,TE=ao,ME=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,IE=/^\w*$/;function LE(e,t){if($E(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||TE(e)?!0:IE.test(e)||!ME.test(e)||t!=null&&e in Object(t)}var Uv=LE;function DE(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var zn=DE;const io=de(zn);var RE=on,BE=zn,FE="[object AsyncFunction]",zE="[object Function]",WE="[object GeneratorFunction]",UE="[object Proxy]";function HE(e){if(!BE(e))return!1;var t=RE(e);return t==zE||t==WE||t==FE||t==UE}var Hv=HE;const Q=de(Hv);var KE=Mr,VE=KE["__core-js_shared__"],GE=VE,zf=GE,k0=function(){var e=/[^.]+$/.exec(zf&&zf.keys&&zf.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function YE(e){return!!k0&&k0 in e}var qE=YE,XE=Function.prototype,QE=XE.toString;function JE(e){if(e!=null){try{return QE.call(e)}catch{}try{return e+""}catch{}}return""}var uS=JE,ZE=Hv,e$=qE,t$=zn,r$=uS,n$=/[\\^$.*+?()[\]{}|]/g,a$=/^\[object .+?Constructor\]$/,i$=Function.prototype,o$=Object.prototype,s$=i$.toString,l$=o$.hasOwnProperty,c$=RegExp("^"+s$.call(l$).replace(n$,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function u$(e){if(!t$(e)||e$(e))return!1;var t=ZE(e)?c$:a$;return t.test(r$(e))}var d$=u$;function f$(e,t){return e==null?void 0:e[t]}var h$=f$,p$=d$,m$=h$;function v$(e,t){var r=m$(e,t);return p$(r)?r:void 0}var Ea=v$,y$=Ea,g$=y$(Object,"create"),bd=g$,O0=bd;function x$(){this.__data__=O0?O0(null):{},this.size=0}var b$=x$;function j$(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var w$=j$,S$=bd,_$="__lodash_hash_undefined__",k$=Object.prototype,O$=k$.hasOwnProperty;function N$(e){var t=this.__data__;if(S$){var r=t[e];return r===_$?void 0:r}return O$.call(t,e)?t[e]:void 0}var P$=N$,A$=bd,C$=Object.prototype,E$=C$.hasOwnProperty;function $$(e){var t=this.__data__;return A$?t[e]!==void 0:E$.call(t,e)}var T$=$$,M$=bd,I$="__lodash_hash_undefined__";function L$(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=M$&&t===void 0?I$:t,this}var D$=L$,R$=b$,B$=w$,F$=P$,z$=T$,W$=D$;function oo(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}oo.prototype.clear=R$;oo.prototype.delete=B$;oo.prototype.get=F$;oo.prototype.has=z$;oo.prototype.set=W$;var U$=oo;function H$(){this.__data__=[],this.size=0}var K$=H$;function V$(e,t){return e===t||e!==e&&t!==t}var Kv=V$,G$=Kv;function Y$(e,t){for(var r=e.length;r--;)if(G$(e[r][0],t))return r;return-1}var jd=Y$,q$=jd,X$=Array.prototype,Q$=X$.splice;function J$(e){var t=this.__data__,r=q$(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Q$.call(t,r,1),--this.size,!0}var Z$=J$,eT=jd;function tT(e){var t=this.__data__,r=eT(t,e);return r<0?void 0:t[r][1]}var rT=tT,nT=jd;function aT(e){return nT(this.__data__,e)>-1}var iT=aT,oT=jd;function sT(e,t){var r=this.__data__,n=oT(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var lT=sT,cT=K$,uT=Z$,dT=rT,fT=iT,hT=lT;function so(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}so.prototype.clear=cT;so.prototype.delete=uT;so.prototype.get=dT;so.prototype.has=fT;so.prototype.set=hT;var wd=so,pT=Ea,mT=Mr,vT=pT(mT,"Map"),Vv=vT,N0=U$,yT=wd,gT=Vv;function xT(){this.size=0,this.__data__={hash:new N0,map:new(gT||yT),string:new N0}}var bT=xT;function jT(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var wT=jT,ST=wT;function _T(e,t){var r=e.__data__;return ST(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Sd=_T,kT=Sd;function OT(e){var t=kT(this,e).delete(e);return this.size-=t?1:0,t}var NT=OT,PT=Sd;function AT(e){return PT(this,e).get(e)}var CT=AT,ET=Sd;function $T(e){return ET(this,e).has(e)}var TT=$T,MT=Sd;function IT(e,t){var r=MT(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var LT=IT,DT=bT,RT=NT,BT=CT,FT=TT,zT=LT;function lo(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}lo.prototype.clear=DT;lo.prototype.delete=RT;lo.prototype.get=BT;lo.prototype.has=FT;lo.prototype.set=zT;var Gv=lo,dS=Gv,WT="Expected a function";function Yv(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(WT);var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var s=e.apply(this,n);return r.cache=i.set(a,s)||i,s};return r.cache=new(Yv.Cache||dS),r}Yv.Cache=dS;var fS=Yv;const UT=de(fS);var HT=fS,KT=500;function VT(e){var t=HT(e,function(n){return r.size===KT&&r.clear(),n}),r=t.cache;return t}var GT=VT,YT=GT,qT=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,XT=/\\(\\)?/g,QT=YT(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(qT,function(r,n,a,i){t.push(a?i.replace(XT,"$1"):n||r)}),t}),JT=QT;function ZT(e,t){for(var r=-1,n=e==null?0:e.length,a=Array(n);++r<n;)a[r]=t(e[r],r,e);return a}var qv=ZT,P0=ml,e3=qv,t3=$t,r3=ao,A0=P0?P0.prototype:void 0,C0=A0?A0.toString:void 0;function hS(e){if(typeof e=="string")return e;if(t3(e))return e3(e,hS)+"";if(r3(e))return C0?C0.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var n3=hS,a3=n3;function i3(e){return e==null?"":a3(e)}var pS=i3,o3=$t,s3=Uv,l3=JT,c3=pS;function u3(e,t){return o3(e)?e:s3(e,t)?[e]:l3(c3(e))}var mS=u3,d3=ao;function f3(e){if(typeof e=="string"||d3(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}var _d=f3,h3=mS,p3=_d;function m3(e,t){t=h3(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[p3(t[r++])];return r&&r==n?e:void 0}var Xv=m3,v3=Xv;function y3(e,t,r){var n=e==null?void 0:v3(e,t);return n===void 0?r:n}var vS=y3;const Bt=de(vS);function g3(e){return e==null}var x3=g3;const te=de(x3);var b3=on,j3=$t,w3=sn,S3="[object String]";function _3(e){return typeof e=="string"||!j3(e)&&w3(e)&&b3(e)==S3}var k3=_3;const wa=de(k3);var yS={exports:{}},fe={};/**
+ * @license React
+ * react-is.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var Qv=Symbol.for("react.element"),Jv=Symbol.for("react.portal"),kd=Symbol.for("react.fragment"),Od=Symbol.for("react.strict_mode"),Nd=Symbol.for("react.profiler"),Pd=Symbol.for("react.provider"),Ad=Symbol.for("react.context"),O3=Symbol.for("react.server_context"),Cd=Symbol.for("react.forward_ref"),Ed=Symbol.for("react.suspense"),$d=Symbol.for("react.suspense_list"),Td=Symbol.for("react.memo"),Md=Symbol.for("react.lazy"),N3=Symbol.for("react.offscreen"),gS;gS=Symbol.for("react.module.reference");function ar(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Qv:switch(e=e.type,e){case kd:case Nd:case Od:case Ed:case $d:return e;default:switch(e=e&&e.$$typeof,e){case O3:case Ad:case Cd:case Md:case Td:case Pd:return e;default:return t}}case Jv:return t}}}fe.ContextConsumer=Ad;fe.ContextProvider=Pd;fe.Element=Qv;fe.ForwardRef=Cd;fe.Fragment=kd;fe.Lazy=Md;fe.Memo=Td;fe.Portal=Jv;fe.Profiler=Nd;fe.StrictMode=Od;fe.Suspense=Ed;fe.SuspenseList=$d;fe.isAsyncMode=function(){return!1};fe.isConcurrentMode=function(){return!1};fe.isContextConsumer=function(e){return ar(e)===Ad};fe.isContextProvider=function(e){return ar(e)===Pd};fe.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Qv};fe.isForwardRef=function(e){return ar(e)===Cd};fe.isFragment=function(e){return ar(e)===kd};fe.isLazy=function(e){return ar(e)===Md};fe.isMemo=function(e){return ar(e)===Td};fe.isPortal=function(e){return ar(e)===Jv};fe.isProfiler=function(e){return ar(e)===Nd};fe.isStrictMode=function(e){return ar(e)===Od};fe.isSuspense=function(e){return ar(e)===Ed};fe.isSuspenseList=function(e){return ar(e)===$d};fe.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===kd||e===Nd||e===Od||e===Ed||e===$d||e===N3||typeof e=="object"&&e!==null&&(e.$$typeof===Md||e.$$typeof===Td||e.$$typeof===Pd||e.$$typeof===Ad||e.$$typeof===Cd||e.$$typeof===gS||e.getModuleId!==void 0)};fe.typeOf=ar;yS.exports=fe;var P3=yS.exports,A3=on,C3=sn,E3="[object Number]";function $3(e){return typeof e=="number"||C3(e)&&A3(e)==E3}var xS=$3;const T3=de(xS);var M3=xS;function I3(e){return M3(e)&&e!=+e}var L3=I3;const co=de(L3);var rt=function(t){return t===0?0:t>0?1:-1},oa=function(t){return wa(t)&&t.indexOf("%")===t.length-1},U=function(t){return T3(t)&&!co(t)},D3=function(t){return te(t)},qe=function(t){return U(t)||wa(t)},R3=0,uo=function(t){var r=++R3;return"".concat(t||"").concat(r)},xt=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!U(t)&&!wa(t))return n;var i;if(oa(t)){var s=t.indexOf("%");i=r*parseFloat(t.slice(0,s))/100}else i=+t;return co(i)&&(i=n),a&&i>r&&(i=r),i},gn=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},B3=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},a=0;a<r;a++)if(!n[t[a]])n[t[a]]=!0;else return!0;return!1},lt=function(t,r){return U(t)&&U(r)?function(n){return t+n*(r-t)}:function(){return r}};function Qc(e,t,r){return!e||!e.length?null:e.find(function(n){return n&&(typeof t=="function"?t(n):Bt(n,t))===r})}var F3=function(t,r){return U(t)&&U(r)?t-r:wa(t)&&wa(r)?t.localeCompare(r):t instanceof Date&&r instanceof Date?t.getTime()-r.getTime():String(t).localeCompare(String(r))};function mi(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}function mp(e){"@babel/helpers - typeof";return mp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mp(e)}var z3=["viewBox","children"],W3=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],E0=["points","pathLength"],Wf={svg:z3,polygon:E0,polyline:E0},Zv=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],Jc=function(t,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var n=t;if(P.isValidElement(t)&&(n=t.props),!io(n))return null;var a={};return Object.keys(n).forEach(function(i){Zv.includes(i)&&(a[i]=r||function(s){return n[i](n,s)})}),a},U3=function(t,r,n){return function(a){return t(r,n,a),null}},en=function(t,r,n){if(!io(t)||mp(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(i){var s=t[i];Zv.includes(i)&&typeof s=="function"&&(a||(a={}),a[i]=U3(s,r,n))}),a},H3=["children"],K3=["children"];function $0(e,t){if(e==null)return{};var r=V3(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function V3(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function vp(e){"@babel/helpers - typeof";return vp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vp(e)}var T0={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Yr=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},M0=null,Uf=null,ey=function e(t){if(t===M0&&Array.isArray(Uf))return Uf;var r=[];return P.Children.forEach(t,function(n){te(n)||(P3.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),Uf=r,M0=t,r};function Ft(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(a){return Yr(a)}):n=[Yr(t)],ey(e).forEach(function(a){var i=Bt(a,"type.displayName")||Bt(a,"type.name");n.indexOf(i)!==-1&&r.push(a)}),r}function It(e,t){var r=Ft(e,t);return r&&r[0]}var I0=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,a=r.height;return!(!U(n)||n<=0||!U(a)||a<=0)},G3=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Y3=function(t){return t&&t.type&&wa(t.type)&&G3.indexOf(t.type)>=0},q3=function(t){return t&&vp(t)==="object"&&"clipDot"in t},X3=function(t,r,n,a){var i,s=(i=Wf==null?void 0:Wf[a])!==null&&i!==void 0?i:[];return r.startsWith("data-")||!Q(t)&&(a&&s.includes(r)||W3.includes(r))||n&&Zv.includes(r)},X=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(P.isValidElement(t)&&(a=t.props),!io(a))return null;var i={};return Object.keys(a).forEach(function(s){var l;X3((l=a)===null||l===void 0?void 0:l[s],s,r,n)&&(i[s]=a[s])}),i},yp=function e(t,r){if(t===r)return!0;var n=P.Children.count(t);if(n!==P.Children.count(r))return!1;if(n===0)return!0;if(n===1)return L0(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var a=0;a<n;a++){var i=t[a],s=r[a];if(Array.isArray(i)||Array.isArray(s)){if(!e(i,s))return!1}else if(!L0(i,s))return!1}return!0},L0=function(t,r){if(te(t)&&te(r))return!0;if(!te(t)&&!te(r)){var n=t.props||{},a=n.children,i=$0(n,H3),s=r.props||{},l=s.children,c=$0(s,K3);return a&&l?mi(i,c)&&yp(a,l):!a&&!l?mi(i,c):!1}return!1},D0=function(t,r){var n=[],a={};return ey(t).forEach(function(i,s){if(Y3(i))n.push(i);else if(i){var l=Yr(i.type),c=r[l]||{},u=c.handler,f=c.once;if(u&&(!f||!a[l])){var d=u(i,l,s);n.push(d),a[l]=!0}}}),n},Q3=function(t){var r=t&&t.type;return r&&T0[r]?T0[r]:null},J3=function(t,r){return ey(r).indexOf(t)},Z3=["children","width","height","viewBox","className","style","title","desc"];function gp(){return gp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gp.apply(this,arguments)}function e5(e,t){if(e==null)return{};var r=t5(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function t5(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function xp(e){var t=e.children,r=e.width,n=e.height,a=e.viewBox,i=e.className,s=e.style,l=e.title,c=e.desc,u=e5(e,Z3),f=a||{width:r,height:n,x:0,y:0},d=ee("recharts-surface",i);return $.createElement("svg",gp({},X(u,!0,"svg"),{className:d,width:r,height:n,style:s,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),$.createElement("title",null,l),$.createElement("desc",null,c),t)}var r5=["children","className"];function bp(){return bp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bp.apply(this,arguments)}function n5(e,t){if(e==null)return{};var r=a5(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function a5(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var ne=$.forwardRef(function(e,t){var r=e.children,n=e.className,a=n5(e,r5),i=ee("recharts-layer",n);return $.createElement("g",bp({className:i},X(a,!0),{ref:t}),r)}),yr=function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i]};function i5(e,t,r){var n=-1,a=e.length;t<0&&(t=-t>a?0:a+t),r=r>a?a:r,r<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(a);++n<a;)i[n]=e[n+t];return i}var o5=i5,s5=o5;function l5(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:s5(e,t,r)}var c5=l5,u5="\\ud800-\\udfff",d5="\\u0300-\\u036f",f5="\\ufe20-\\ufe2f",h5="\\u20d0-\\u20ff",p5=d5+f5+h5,m5="\\ufe0e\\ufe0f",v5="\\u200d",y5=RegExp("["+v5+u5+p5+m5+"]");function g5(e){return y5.test(e)}var bS=g5;function x5(e){return e.split("")}var b5=x5,jS="\\ud800-\\udfff",j5="\\u0300-\\u036f",w5="\\ufe20-\\ufe2f",S5="\\u20d0-\\u20ff",_5=j5+w5+S5,k5="\\ufe0e\\ufe0f",O5="["+jS+"]",jp="["+_5+"]",wp="\\ud83c[\\udffb-\\udfff]",N5="(?:"+jp+"|"+wp+")",wS="[^"+jS+"]",SS="(?:\\ud83c[\\udde6-\\uddff]){2}",_S="[\\ud800-\\udbff][\\udc00-\\udfff]",P5="\\u200d",kS=N5+"?",OS="["+k5+"]?",A5="(?:"+P5+"(?:"+[wS,SS,_S].join("|")+")"+OS+kS+")*",C5=OS+kS+A5,E5="(?:"+[wS+jp+"?",jp,SS,_S,O5].join("|")+")",$5=RegExp(wp+"(?="+wp+")|"+E5+C5,"g");function T5(e){return e.match($5)||[]}var M5=T5,I5=b5,L5=bS,D5=M5;function R5(e){return L5(e)?D5(e):I5(e)}var B5=R5,F5=c5,z5=bS,W5=B5,U5=pS;function H5(e){return function(t){t=U5(t);var r=z5(t)?W5(t):void 0,n=r?r[0]:t.charAt(0),a=r?F5(r,1).join(""):t.slice(1);return n[e]()+a}}var K5=H5,V5=K5,G5=V5("toUpperCase"),Y5=G5;const Id=de(Y5);function be(e){return function(){return e}}const NS=Math.cos,Zc=Math.sin,jr=Math.sqrt,eu=Math.PI,Ld=2*eu,Sp=Math.PI,_p=2*Sp,Zn=1e-6,q5=_p-Zn;function PS(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function X5(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return PS;const r=10**t;return function(n){this._+=n[0];for(let a=1,i=n.length;a<i;++a)this._+=Math.round(arguments[a]*r)/r+n[a]}}class Q5{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?PS:X5(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,a){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+a}`}bezierCurveTo(t,r,n,a,i,s){this._append`C${+t},${+r},${+n},${+a},${this._x1=+i},${this._y1=+s}`}arcTo(t,r,n,a,i){if(t=+t,r=+r,n=+n,a=+a,i=+i,i<0)throw new Error(`negative radius: ${i}`);let s=this._x1,l=this._y1,c=n-t,u=a-r,f=s-t,d=l-r,h=f*f+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(h>Zn)if(!(Math.abs(d*c-u*f)>Zn)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-s,g=a-l,y=c*c+u*u,b=p*p+g*g,v=Math.sqrt(y),m=Math.sqrt(h),x=i*Math.tan((Sp-Math.acos((y+h-b)/(2*v*m)))/2),S=x/m,j=x/v;Math.abs(S-1)>Zn&&this._append`L${t+S*f},${r+S*d}`,this._append`A${i},${i},0,0,${+(d*p>f*g)},${this._x1=t+j*c},${this._y1=r+j*u}`}}arc(t,r,n,a,i,s){if(t=+t,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(a),c=n*Math.sin(a),u=t+l,f=r+c,d=1^s,h=s?a-i:i-a;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>Zn||Math.abs(this._y1-f)>Zn)&&this._append`L${u},${f}`,n&&(h<0&&(h=h%_p+_p),h>q5?this._append`A${n},${n},0,1,${d},${t-l},${r-c}A${n},${n},0,1,${d},${this._x1=u},${this._y1=f}`:h>Zn&&this._append`A${n},${n},0,${+(h>=Sp)},${d},${this._x1=t+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(t,r,n,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}}function ty(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new Q5(t)}function ry(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function AS(e){this._context=e}AS.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 Dd(e){return new AS(e)}function CS(e){return e[0]}function ES(e){return e[1]}function $S(e,t){var r=be(!0),n=null,a=Dd,i=null,s=ty(l);e=typeof e=="function"?e:e===void 0?CS:be(e),t=typeof t=="function"?t:t===void 0?ES:be(t);function l(c){var u,f=(c=ry(c)).length,d,h=!1,p;for(n==null&&(i=a(p=s())),u=0;u<=f;++u)!(u<f&&r(d=c[u],u,c))===h&&((h=!h)?i.lineStart():i.lineEnd()),h&&i.point(+e(d,u,c),+t(d,u,c));if(p)return i=null,p+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:be(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:be(+c),l):t},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:be(!!c),l):r},l.curve=function(c){return arguments.length?(a=c,n!=null&&(i=a(n)),l):a},l.context=function(c){return arguments.length?(c==null?n=i=null:i=a(n=c),l):n},l}function Kl(e,t,r){var n=null,a=be(!0),i=null,s=Dd,l=null,c=ty(u);e=typeof e=="function"?e:e===void 0?CS:be(+e),t=typeof t=="function"?t:be(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?ES:be(+r);function u(d){var h,p,g,y=(d=ry(d)).length,b,v=!1,m,x=new Array(y),S=new Array(y);for(i==null&&(l=s(m=c())),h=0;h<=y;++h){if(!(h<y&&a(b=d[h],h,d))===v)if(v=!v)p=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),g=h-1;g>=p;--g)l.point(x[g],S[g]);l.lineEnd(),l.areaEnd()}v&&(x[h]=+e(b,h,d),S[h]=+t(b,h,d),l.point(n?+n(b,h,d):x[h],r?+r(b,h,d):S[h]))}if(m)return l=null,m+""||null}function f(){return $S().defined(a).curve(s).context(i)}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:be(+d),n=null,u):e},u.x0=function(d){return arguments.length?(e=typeof d=="function"?d:be(+d),u):e},u.x1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:be(+d),u):n},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:be(+d),r=null,u):t},u.y0=function(d){return arguments.length?(t=typeof d=="function"?d:be(+d),u):t},u.y1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:be(+d),u):r},u.lineX0=u.lineY0=function(){return f().x(e).y(t)},u.lineY1=function(){return f().x(e).y(r)},u.lineX1=function(){return f().x(n).y(t)},u.defined=function(d){return arguments.length?(a=typeof d=="function"?d:be(!!d),u):a},u.curve=function(d){return arguments.length?(s=d,i!=null&&(l=s(i)),u):s},u.context=function(d){return arguments.length?(d==null?i=l=null:l=s(i=d),u):i},u}class TS{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function J5(e){return new TS(e,!0)}function Z5(e){return new TS(e,!1)}const ny={draw(e,t){const r=jr(t/eu);e.moveTo(r,0),e.arc(0,0,r,0,Ld)}},e4={draw(e,t){const r=jr(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},MS=jr(1/3),t4=MS*2,r4={draw(e,t){const r=jr(t/t4),n=r*MS;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},n4={draw(e,t){const r=jr(t),n=-r/2;e.rect(n,n,r,r)}},a4=.8908130915292852,IS=Zc(eu/10)/Zc(7*eu/10),i4=Zc(Ld/10)*IS,o4=-NS(Ld/10)*IS,s4={draw(e,t){const r=jr(t*a4),n=i4*r,a=o4*r;e.moveTo(0,-r),e.lineTo(n,a);for(let i=1;i<5;++i){const s=Ld*i/5,l=NS(s),c=Zc(s);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*a,c*n+l*a)}e.closePath()}},Hf=jr(3),l4={draw(e,t){const r=-jr(t/(Hf*3));e.moveTo(0,r*2),e.lineTo(-Hf*r,-r),e.lineTo(Hf*r,-r),e.closePath()}},Ht=-.5,Kt=jr(3)/2,kp=1/jr(12),c4=(kp/2+1)*3,u4={draw(e,t){const r=jr(t/c4),n=r/2,a=r*kp,i=n,s=r*kp+r,l=-i,c=s;e.moveTo(n,a),e.lineTo(i,s),e.lineTo(l,c),e.lineTo(Ht*n-Kt*a,Kt*n+Ht*a),e.lineTo(Ht*i-Kt*s,Kt*i+Ht*s),e.lineTo(Ht*l-Kt*c,Kt*l+Ht*c),e.lineTo(Ht*n+Kt*a,Ht*a-Kt*n),e.lineTo(Ht*i+Kt*s,Ht*s-Kt*i),e.lineTo(Ht*l+Kt*c,Ht*c-Kt*l),e.closePath()}};function d4(e,t){let r=null,n=ty(a);e=typeof e=="function"?e:be(e||ny),t=typeof t=="function"?t:be(t===void 0?64:+t);function a(){let i;if(r||(r=i=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:be(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:be(+i),a):t},a.context=function(i){return arguments.length?(r=i??null,a):r},a}function tu(){}function ru(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function LS(e){this._context=e}LS.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:ru(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:ru(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function f4(e){return new LS(e)}function DS(e){this._context=e}DS.prototype={areaStart:tu,areaEnd:tu,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:ru(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function h4(e){return new DS(e)}function RS(e){this._context=e}RS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:ru(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function p4(e){return new RS(e)}function BS(e){this._context=e}BS.prototype={areaStart:tu,areaEnd:tu,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 m4(e){return new BS(e)}function R0(e){return e<0?-1:1}function B0(e,t,r){var n=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(n||a<0&&-0),s=(r-e._y1)/(a||n<0&&-0),l=(i*a+s*n)/(n+a);return(R0(i)+R0(s))*Math.min(Math.abs(i),Math.abs(s),.5*Math.abs(l))||0}function F0(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Kf(e,t,r){var n=e._x0,a=e._y0,i=e._x1,s=e._y1,l=(i-n)/3;e._context.bezierCurveTo(n+l,a+l*t,i-l,s-l*r,i,s)}function nu(e){this._context=e}nu.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:Kf(this,this._t0,F0(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Kf(this,F0(this,r=B0(this,e,t)),r);break;default:Kf(this,this._t0,r=B0(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function FS(e){this._context=new zS(e)}(FS.prototype=Object.create(nu.prototype)).point=function(e,t){nu.prototype.point.call(this,t,e)};function zS(e){this._context=e}zS.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,a,i){this._context.bezierCurveTo(t,e,n,r,i,a)}};function v4(e){return new nu(e)}function y4(e){return new FS(e)}function WS(e){this._context=e}WS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=z0(e),a=z0(t),i=0,s=1;s<r;++i,++s)this._context.bezierCurveTo(n[0][i],a[0][i],n[1][i],a[1][i],e[s],t[s]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function z0(e){var t,r=e.length-1,n,a=new Array(r),i=new Array(r),s=new Array(r);for(a[0]=0,i[0]=2,s[0]=e[0]+2*e[1],t=1;t<r-1;++t)a[t]=1,i[t]=4,s[t]=4*e[t]+2*e[t+1];for(a[r-1]=2,i[r-1]=7,s[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=a[t]/i[t-1],i[t]-=n,s[t]-=n*s[t-1];for(a[r-1]=s[r-1]/i[r-1],t=r-2;t>=0;--t)a[t]=(s[t]-a[t+1])/i[t];for(i[r-1]=(e[r]+a[r-1])/2,t=0;t<r-1;++t)i[t]=2*e[t+1]-a[t+1];return[a,i]}function g4(e){return new WS(e)}function Rd(e,t){this._context=e,this._t=t}Rd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function x4(e){return new Rd(e,.5)}function b4(e){return new Rd(e,0)}function j4(e){return new Rd(e,1)}function Ni(e,t){if((s=e.length)>1)for(var r=1,n,a,i=e[t[0]],s,l=i.length;r<s;++r)for(a=i,i=e[t[r]],n=0;n<l;++n)i[n][1]+=i[n][0]=isNaN(a[n][1])?a[n][0]:a[n][1]}function Op(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function w4(e,t){return e[t]}function S4(e){const t=[];return t.key=e,t}function _4(){var e=be([]),t=Op,r=Ni,n=w4;function a(i){var s=Array.from(e.apply(this,arguments),S4),l,c=s.length,u=-1,f;for(const d of i)for(l=0,++u;l<c;++l)(s[l][u]=[0,+n(d,s[l].key,u,i)]).data=d;for(l=0,f=ry(t(s));l<c;++l)s[f[l]].index=l;return r(s,f),s}return a.keys=function(i){return arguments.length?(e=typeof i=="function"?i:be(Array.from(i)),a):e},a.value=function(i){return arguments.length?(n=typeof i=="function"?i:be(+i),a):n},a.order=function(i){return arguments.length?(t=i==null?Op:typeof i=="function"?i:be(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(r=i??Ni,a):r},a}function k4(e,t){if((n=e.length)>0){for(var r,n,a=0,i=e[0].length,s;a<i;++a){for(s=r=0;r<n;++r)s+=e[r][a][1]||0;if(s)for(r=0;r<n;++r)e[r][a][1]/=s}Ni(e,t)}}function O4(e,t){if((a=e.length)>0){for(var r=0,n=e[t[0]],a,i=n.length;r<i;++r){for(var s=0,l=0;s<a;++s)l+=e[s][r][1]||0;n[r][1]+=n[r][0]=-l/2}Ni(e,t)}}function N4(e,t){if(!(!((s=e.length)>0)||!((i=(a=e[t[0]]).length)>0))){for(var r=0,n=1,a,i,s;n<i;++n){for(var l=0,c=0,u=0;l<s;++l){for(var f=e[t[l]],d=f[n][1]||0,h=f[n-1][1]||0,p=(d-h)/2,g=0;g<l;++g){var y=e[t[g]],b=y[n][1]||0,v=y[n-1][1]||0;p+=b-v}c+=d,u+=p*d}a[n-1][1]+=a[n-1][0]=r,c&&(r-=u/c)}a[n-1][1]+=a[n-1][0]=r,Ni(e,t)}}function Os(e){"@babel/helpers - typeof";return Os=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Os(e)}var P4=["type","size","sizeType"];function Np(){return Np=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Np.apply(this,arguments)}function W0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function U0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?W0(Object(r),!0).forEach(function(n){A4(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function A4(e,t,r){return t=C4(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function C4(e){var t=E4(e,"string");return Os(t)=="symbol"?t:t+""}function E4(e,t){if(Os(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Os(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $4(e,t){if(e==null)return{};var r=T4(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function T4(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var US={symbolCircle:ny,symbolCross:e4,symbolDiamond:r4,symbolSquare:n4,symbolStar:s4,symbolTriangle:l4,symbolWye:u4},M4=Math.PI/180,I4=function(t){var r="symbol".concat(Id(t));return US[r]||ny},L4=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*M4;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},D4=function(t,r){US["symbol".concat(Id(t))]=r},ay=function(t){var r=t.type,n=r===void 0?"circle":r,a=t.size,i=a===void 0?64:a,s=t.sizeType,l=s===void 0?"area":s,c=$4(t,P4),u=U0(U0({},c),{},{type:n,size:i,sizeType:l}),f=function(){var b=I4(n),v=d4().type(b).size(L4(i,l,n));return v()},d=u.className,h=u.cx,p=u.cy,g=X(u,!0);return h===+h&&p===+p&&i===+i?$.createElement("path",Np({},g,{className:ee("recharts-symbols",d),transform:"translate(".concat(h,", ").concat(p,")"),d:f()})):null};ay.registerSymbol=D4;function Pi(e){"@babel/helpers - typeof";return Pi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pi(e)}function Pp(){return Pp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pp.apply(this,arguments)}function H0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function R4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?H0(Object(r),!0).forEach(function(n){Ns(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):H0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function B4(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F4(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,KS(n.key),n)}}function z4(e,t,r){return t&&F4(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function W4(e,t,r){return t=au(t),U4(e,HS()?Reflect.construct(t,r||[],au(e).constructor):t.apply(e,r))}function U4(e,t){if(t&&(Pi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return H4(e)}function H4(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function HS(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(HS=function(){return!!e})()}function au(e){return au=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},au(e)}function K4(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ap(e,t)}function Ap(e,t){return Ap=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Ap(e,t)}function Ns(e,t,r){return t=KS(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function KS(e){var t=V4(e,"string");return Pi(t)=="symbol"?t:t+""}function V4(e,t){if(Pi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Pi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Vt=32,iy=function(e){function t(){return B4(this,t),W4(this,t,arguments)}return K4(t,e),z4(t,[{key:"renderIcon",value:function(n){var a=this.props.inactiveColor,i=Vt/2,s=Vt/6,l=Vt/3,c=n.inactive?a:n.color;if(n.type==="plainline")return $.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:i,x2:Vt,y2:i,className:"recharts-legend-icon"});if(n.type==="line")return $.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(i,"h").concat(l,`
+ A`).concat(s,",").concat(s,",0,1,1,").concat(2*l,",").concat(i,`
+ H`).concat(Vt,"M").concat(2*l,",").concat(i,`
+ A`).concat(s,",").concat(s,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(n.type==="rect")return $.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Vt/8,"h").concat(Vt,"v").concat(Vt*3/4,"h").concat(-Vt,"z"),className:"recharts-legend-icon"});if($.isValidElement(n.legendIcon)){var u=R4({},n);return delete u.legendIcon,$.cloneElement(n.legendIcon,u)}return $.createElement(ay,{fill:c,cx:i,cy:i,size:Vt,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,a=this.props,i=a.payload,s=a.iconSize,l=a.layout,c=a.formatter,u=a.inactiveColor,f={x:0,y:0,width:Vt,height:Vt},d={display:l==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(p,g){var y=p.formatter||c,b=ee(Ns(Ns({"recharts-legend-item":!0},"legend-item-".concat(g),!0),"inactive",p.inactive));if(p.type==="none")return null;var v=Q(p.value)?null:p.value;yr(!Q(p.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var m=p.inactive?u:p.color;return $.createElement("li",Pp({className:b,style:d,key:"legend-item-".concat(g)},en(n.props,p,g)),$.createElement(xp,{width:s,height:s,viewBox:f,style:h},n.renderIcon(p)),$.createElement("span",{className:"recharts-legend-item-text",style:{color:m}},y?y(v,p,g):v))})}},{key:"render",value:function(){var n=this.props,a=n.payload,i=n.layout,s=n.align;if(!a||!a.length)return null;var l={padding:0,margin:0,textAlign:i==="horizontal"?s:"left"};return $.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(P.PureComponent);Ns(iy,"displayName","Legend");Ns(iy,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var G4=wd;function Y4(){this.__data__=new G4,this.size=0}var q4=Y4;function X4(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var Q4=X4;function J4(e){return this.__data__.get(e)}var Z4=J4;function eM(e){return this.__data__.has(e)}var tM=eM,rM=wd,nM=Vv,aM=Gv,iM=200;function oM(e,t){var r=this.__data__;if(r instanceof rM){var n=r.__data__;if(!nM||n.length<iM-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new aM(n)}return r.set(e,t),this.size=r.size,this}var sM=oM,lM=wd,cM=q4,uM=Q4,dM=Z4,fM=tM,hM=sM;function fo(e){var t=this.__data__=new lM(e);this.size=t.size}fo.prototype.clear=cM;fo.prototype.delete=uM;fo.prototype.get=dM;fo.prototype.has=fM;fo.prototype.set=hM;var VS=fo,pM="__lodash_hash_undefined__";function mM(e){return this.__data__.set(e,pM),this}var vM=mM;function yM(e){return this.__data__.has(e)}var gM=yM,xM=Gv,bM=vM,jM=gM;function iu(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new xM;++t<r;)this.add(e[t])}iu.prototype.add=iu.prototype.push=bM;iu.prototype.has=jM;var GS=iu;function wM(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var YS=wM;function SM(e,t){return e.has(t)}var qS=SM,_M=GS,kM=YS,OM=qS,NM=1,PM=2;function AM(e,t,r,n,a,i){var s=r&NM,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var u=i.get(e),f=i.get(t);if(u&&f)return u==t&&f==e;var d=-1,h=!0,p=r&PM?new _M:void 0;for(i.set(e,t),i.set(t,e);++d<l;){var g=e[d],y=t[d];if(n)var b=s?n(y,g,d,t,e,i):n(g,y,d,e,t,i);if(b!==void 0){if(b)continue;h=!1;break}if(p){if(!kM(t,function(v,m){if(!OM(p,m)&&(g===v||a(g,v,r,n,i)))return p.push(m)})){h=!1;break}}else if(!(g===y||a(g,y,r,n,i))){h=!1;break}}return i.delete(e),i.delete(t),h}var XS=AM,CM=Mr,EM=CM.Uint8Array,$M=EM;function TM(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}var MM=TM;function IM(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var oy=IM,K0=ml,V0=$M,LM=Kv,DM=XS,RM=MM,BM=oy,FM=1,zM=2,WM="[object Boolean]",UM="[object Date]",HM="[object Error]",KM="[object Map]",VM="[object Number]",GM="[object RegExp]",YM="[object Set]",qM="[object String]",XM="[object Symbol]",QM="[object ArrayBuffer]",JM="[object DataView]",G0=K0?K0.prototype:void 0,Vf=G0?G0.valueOf:void 0;function ZM(e,t,r,n,a,i,s){switch(r){case JM:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case QM:return!(e.byteLength!=t.byteLength||!i(new V0(e),new V0(t)));case WM:case UM:case VM:return LM(+e,+t);case HM:return e.name==t.name&&e.message==t.message;case GM:case qM:return e==t+"";case KM:var l=RM;case YM:var c=n&FM;if(l||(l=BM),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;n|=zM,s.set(e,t);var f=DM(l(e),l(t),n,a,i,s);return s.delete(e),f;case XM:if(Vf)return Vf.call(e)==Vf.call(t)}return!1}var eI=ZM;function tI(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}var QS=tI,rI=QS,nI=$t;function aI(e,t,r){var n=t(e);return nI(e)?n:rI(n,r(e))}var iI=aI;function oI(e,t){for(var r=-1,n=e==null?0:e.length,a=0,i=[];++r<n;){var s=e[r];t(s,r,e)&&(i[a++]=s)}return i}var sI=oI;function lI(){return[]}var cI=lI,uI=sI,dI=cI,fI=Object.prototype,hI=fI.propertyIsEnumerable,Y0=Object.getOwnPropertySymbols,pI=Y0?function(e){return e==null?[]:(e=Object(e),uI(Y0(e),function(t){return hI.call(e,t)}))}:dI,mI=pI;function vI(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var yI=vI,gI=on,xI=sn,bI="[object Arguments]";function jI(e){return xI(e)&&gI(e)==bI}var wI=jI,q0=wI,SI=sn,JS=Object.prototype,_I=JS.hasOwnProperty,kI=JS.propertyIsEnumerable,OI=q0(function(){return arguments}())?q0:function(e){return SI(e)&&_I.call(e,"callee")&&!kI.call(e,"callee")},sy=OI,ou={exports:{}};function NI(){return!1}var PI=NI;ou.exports;(function(e,t){var r=Mr,n=PI,a=t&&!t.nodeType&&t,i=a&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===a,l=s?r.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||n;e.exports=u})(ou,ou.exports);var ZS=ou.exports,AI=9007199254740991,CI=/^(?:0|[1-9]\d*)$/;function EI(e,t){var r=typeof e;return t=t??AI,!!t&&(r=="number"||r!="symbol"&&CI.test(e))&&e>-1&&e%1==0&&e<t}var ly=EI,$I=9007199254740991;function TI(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=$I}var cy=TI,MI=on,II=cy,LI=sn,DI="[object Arguments]",RI="[object Array]",BI="[object Boolean]",FI="[object Date]",zI="[object Error]",WI="[object Function]",UI="[object Map]",HI="[object Number]",KI="[object Object]",VI="[object RegExp]",GI="[object Set]",YI="[object String]",qI="[object WeakMap]",XI="[object ArrayBuffer]",QI="[object DataView]",JI="[object Float32Array]",ZI="[object Float64Array]",eL="[object Int8Array]",tL="[object Int16Array]",rL="[object Int32Array]",nL="[object Uint8Array]",aL="[object Uint8ClampedArray]",iL="[object Uint16Array]",oL="[object Uint32Array]",Se={};Se[JI]=Se[ZI]=Se[eL]=Se[tL]=Se[rL]=Se[nL]=Se[aL]=Se[iL]=Se[oL]=!0;Se[DI]=Se[RI]=Se[XI]=Se[BI]=Se[QI]=Se[FI]=Se[zI]=Se[WI]=Se[UI]=Se[HI]=Se[KI]=Se[VI]=Se[GI]=Se[YI]=Se[qI]=!1;function sL(e){return LI(e)&&II(e.length)&&!!Se[MI(e)]}var lL=sL;function cL(e){return function(t){return e(t)}}var e_=cL,su={exports:{}};su.exports;(function(e,t){var r=lS,n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,s=i&&r.process,l=function(){try{var c=a&&a.require&&a.require("util").types;return c||s&&s.binding&&s.binding("util")}catch{}}();e.exports=l})(su,su.exports);var uL=su.exports,dL=lL,fL=e_,X0=uL,Q0=X0&&X0.isTypedArray,hL=Q0?fL(Q0):dL,t_=hL,pL=yI,mL=sy,vL=$t,yL=ZS,gL=ly,xL=t_,bL=Object.prototype,jL=bL.hasOwnProperty;function wL(e,t){var r=vL(e),n=!r&&mL(e),a=!r&&!n&&yL(e),i=!r&&!n&&!a&&xL(e),s=r||n||a||i,l=s?pL(e.length,String):[],c=l.length;for(var u in e)(t||jL.call(e,u))&&!(s&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||gL(u,c)))&&l.push(u);return l}var SL=wL,_L=Object.prototype;function kL(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||_L;return e===r}var OL=kL;function NL(e,t){return function(r){return e(t(r))}}var r_=NL,PL=r_,AL=PL(Object.keys,Object),CL=AL,EL=OL,$L=CL,TL=Object.prototype,ML=TL.hasOwnProperty;function IL(e){if(!EL(e))return $L(e);var t=[];for(var r in Object(e))ML.call(e,r)&&r!="constructor"&&t.push(r);return t}var LL=IL,DL=Hv,RL=cy;function BL(e){return e!=null&&RL(e.length)&&!DL(e)}var vl=BL,FL=SL,zL=LL,WL=vl;function UL(e){return WL(e)?FL(e):zL(e)}var Bd=UL,HL=iI,KL=mI,VL=Bd;function GL(e){return HL(e,VL,KL)}var YL=GL,J0=YL,qL=1,XL=Object.prototype,QL=XL.hasOwnProperty;function JL(e,t,r,n,a,i){var s=r&qL,l=J0(e),c=l.length,u=J0(t),f=u.length;if(c!=f&&!s)return!1;for(var d=c;d--;){var h=l[d];if(!(s?h in t:QL.call(t,h)))return!1}var p=i.get(e),g=i.get(t);if(p&&g)return p==t&&g==e;var y=!0;i.set(e,t),i.set(t,e);for(var b=s;++d<c;){h=l[d];var v=e[h],m=t[h];if(n)var x=s?n(m,v,h,t,e,i):n(v,m,h,e,t,i);if(!(x===void 0?v===m||a(v,m,r,n,i):x)){y=!1;break}b||(b=h=="constructor")}if(y&&!b){var S=e.constructor,j=t.constructor;S!=j&&"constructor"in e&&"constructor"in t&&!(typeof S=="function"&&S instanceof S&&typeof j=="function"&&j instanceof j)&&(y=!1)}return i.delete(e),i.delete(t),y}var ZL=JL,e6=Ea,t6=Mr,r6=e6(t6,"DataView"),n6=r6,a6=Ea,i6=Mr,o6=a6(i6,"Promise"),s6=o6,l6=Ea,c6=Mr,u6=l6(c6,"Set"),n_=u6,d6=Ea,f6=Mr,h6=d6(f6,"WeakMap"),p6=h6,Cp=n6,Ep=Vv,$p=s6,Tp=n_,Mp=p6,a_=on,ho=uS,Z0="[object Map]",m6="[object Object]",ex="[object Promise]",tx="[object Set]",rx="[object WeakMap]",nx="[object DataView]",v6=ho(Cp),y6=ho(Ep),g6=ho($p),x6=ho(Tp),b6=ho(Mp),ea=a_;(Cp&&ea(new Cp(new ArrayBuffer(1)))!=nx||Ep&&ea(new Ep)!=Z0||$p&&ea($p.resolve())!=ex||Tp&&ea(new Tp)!=tx||Mp&&ea(new Mp)!=rx)&&(ea=function(e){var t=a_(e),r=t==m6?e.constructor:void 0,n=r?ho(r):"";if(n)switch(n){case v6:return nx;case y6:return Z0;case g6:return ex;case x6:return tx;case b6:return rx}return t});var j6=ea,Gf=VS,w6=XS,S6=eI,_6=ZL,ax=j6,ix=$t,ox=ZS,k6=t_,O6=1,sx="[object Arguments]",lx="[object Array]",Vl="[object Object]",N6=Object.prototype,cx=N6.hasOwnProperty;function P6(e,t,r,n,a,i){var s=ix(e),l=ix(t),c=s?lx:ax(e),u=l?lx:ax(t);c=c==sx?Vl:c,u=u==sx?Vl:u;var f=c==Vl,d=u==Vl,h=c==u;if(h&&ox(e)){if(!ox(t))return!1;s=!0,f=!1}if(h&&!f)return i||(i=new Gf),s||k6(e)?w6(e,t,r,n,a,i):S6(e,t,c,r,n,a,i);if(!(r&O6)){var p=f&&cx.call(e,"__wrapped__"),g=d&&cx.call(t,"__wrapped__");if(p||g){var y=p?e.value():e,b=g?t.value():t;return i||(i=new Gf),a(y,b,r,n,i)}}return h?(i||(i=new Gf),_6(e,t,r,n,a,i)):!1}var A6=P6,C6=A6,ux=sn;function i_(e,t,r,n,a){return e===t?!0:e==null||t==null||!ux(e)&&!ux(t)?e!==e&&t!==t:C6(e,t,r,n,i_,a)}var uy=i_,E6=VS,$6=uy,T6=1,M6=2;function I6(e,t,r,n){var a=r.length,i=a,s=!n;if(e==null)return!i;for(e=Object(e);a--;){var l=r[a];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++a<i;){l=r[a];var c=l[0],u=e[c],f=l[1];if(s&&l[2]){if(u===void 0&&!(c in e))return!1}else{var d=new E6;if(n)var h=n(u,f,c,e,t,d);if(!(h===void 0?$6(f,u,T6|M6,n,d):h))return!1}}return!0}var L6=I6,D6=zn;function R6(e){return e===e&&!D6(e)}var o_=R6,B6=o_,F6=Bd;function z6(e){for(var t=F6(e),r=t.length;r--;){var n=t[r],a=e[n];t[r]=[n,a,B6(a)]}return t}var W6=z6;function U6(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var s_=U6,H6=L6,K6=W6,V6=s_;function G6(e){var t=K6(e);return t.length==1&&t[0][2]?V6(t[0][0],t[0][1]):function(r){return r===e||H6(r,e,t)}}var Y6=G6;function q6(e,t){return e!=null&&t in Object(e)}var X6=q6,Q6=mS,J6=sy,Z6=$t,e8=ly,t8=cy,r8=_d;function n8(e,t,r){t=Q6(t,e);for(var n=-1,a=t.length,i=!1;++n<a;){var s=r8(t[n]);if(!(i=e!=null&&r(e,s)))break;e=e[s]}return i||++n!=a?i:(a=e==null?0:e.length,!!a&&t8(a)&&e8(s,a)&&(Z6(e)||J6(e)))}var a8=n8,i8=X6,o8=a8;function s8(e,t){return e!=null&&o8(e,t,i8)}var l8=s8,c8=uy,u8=vS,d8=l8,f8=Uv,h8=o_,p8=s_,m8=_d,v8=1,y8=2;function g8(e,t){return f8(e)&&h8(t)?p8(m8(e),t):function(r){var n=u8(r,e);return n===void 0&&n===t?d8(r,e):c8(t,n,v8|y8)}}var x8=g8;function b8(e){return e}var po=b8;function j8(e){return function(t){return t==null?void 0:t[e]}}var w8=j8,S8=Xv;function _8(e){return function(t){return S8(t,e)}}var k8=_8,O8=w8,N8=k8,P8=Uv,A8=_d;function C8(e){return P8(e)?O8(A8(e)):N8(e)}var E8=C8,$8=Y6,T8=x8,M8=po,I8=$t,L8=E8;function D8(e){return typeof e=="function"?e:e==null?M8:typeof e=="object"?I8(e)?T8(e[0],e[1]):$8(e):L8(e)}var Ir=D8;function R8(e,t,r,n){for(var a=e.length,i=r+(n?1:-1);n?i--:++i<a;)if(t(e[i],i,e))return i;return-1}var l_=R8;function B8(e){return e!==e}var F8=B8;function z8(e,t,r){for(var n=r-1,a=e.length;++n<a;)if(e[n]===t)return n;return-1}var W8=z8,U8=l_,H8=F8,K8=W8;function V8(e,t,r){return t===t?K8(e,t,r):U8(e,H8,r)}var G8=V8,Y8=G8;function q8(e,t){var r=e==null?0:e.length;return!!r&&Y8(e,t,0)>-1}var X8=q8;function Q8(e,t,r){for(var n=-1,a=e==null?0:e.length;++n<a;)if(r(t,e[n]))return!0;return!1}var J8=Q8;function Z8(){}var eD=Z8,Yf=n_,tD=eD,rD=oy,nD=1/0,aD=Yf&&1/rD(new Yf([,-0]))[1]==nD?function(e){return new Yf(e)}:tD,iD=aD,oD=GS,sD=X8,lD=J8,cD=qS,uD=iD,dD=oy,fD=200;function hD(e,t,r){var n=-1,a=sD,i=e.length,s=!0,l=[],c=l;if(r)s=!1,a=lD;else if(i>=fD){var u=t?null:uD(e);if(u)return dD(u);s=!1,a=cD,c=new oD}else c=t?[]:l;e:for(;++n<i;){var f=e[n],d=t?t(f):f;if(f=r||f!==0?f:0,s&&d===d){for(var h=c.length;h--;)if(c[h]===d)continue e;t&&c.push(d),l.push(f)}else a(c,d,r)||(c!==l&&c.push(d),l.push(f))}return l}var pD=hD,mD=Ir,vD=pD;function yD(e,t){return e&&e.length?vD(e,mD(t)):[]}var gD=yD;const dx=de(gD);function c_(e,t,r){return t===!0?dx(e,r):Q(t)?dx(e,t):e}function Ai(e){"@babel/helpers - typeof";return Ai=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ai(e)}var xD=["ref"];function fx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Dr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?fx(Object(r),!0).forEach(function(n){Fd(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fx(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hx(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,d_(n.key),n)}}function jD(e,t,r){return t&&hx(e.prototype,t),r&&hx(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function wD(e,t,r){return t=lu(t),SD(e,u_()?Reflect.construct(t,r||[],lu(e).constructor):t.apply(e,r))}function SD(e,t){if(t&&(Ai(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _D(e)}function _D(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(u_=function(){return!!e})()}function lu(e){return lu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},lu(e)}function kD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ip(e,t)}function Ip(e,t){return Ip=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Ip(e,t)}function Fd(e,t,r){return t=d_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d_(e){var t=OD(e,"string");return Ai(t)=="symbol"?t:t+""}function OD(e,t){if(Ai(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ai(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function ND(e,t){if(e==null)return{};var r=PD(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function PD(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function AD(e){return e.value}function CD(e,t){if($.isValidElement(e))return $.cloneElement(e,t);if(typeof e=="function")return $.createElement(e,t);t.ref;var r=ND(t,xD);return $.createElement(iy,r)}var px=1,vi=function(e){function t(){var r;bD(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=wD(this,t,[].concat(a)),Fd(r,"lastBoundingBox",{width:-1,height:-1}),r}return kD(t,e),jD(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();return n.height=this.wrapperNode.offsetHeight,n.width=this.wrapperNode.offsetWidth,n}return null}},{key:"updateBBox",value:function(){var n=this.props.onBBoxUpdate,a=this.getBBox();a?(Math.abs(a.width-this.lastBoundingBox.width)>px||Math.abs(a.height-this.lastBoundingBox.height)>px)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,n&&n(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Dr({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var a=this.props,i=a.layout,s=a.align,l=a.verticalAlign,c=a.margin,u=a.chartWidth,f=a.chartHeight,d,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(s==="center"&&i==="vertical"){var p=this.getBBoxSnapshot();d={left:((u||0)-p.width)/2}}else d=s==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(l==="middle"){var g=this.getBBoxSnapshot();h={top:((f||0)-g.height)/2}}else h=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Dr(Dr({},d),h)}},{key:"render",value:function(){var n=this,a=this.props,i=a.content,s=a.width,l=a.height,c=a.wrapperStyle,u=a.payloadUniqBy,f=a.payload,d=Dr(Dr({position:"absolute",width:s||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return $.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(p){n.wrapperNode=p}},CD(i,Dr(Dr({},this.props),{},{payload:c_(f,u,AD)})))}}],[{key:"getWithHeight",value:function(n,a){var i=Dr(Dr({},this.defaultProps),n.props),s=i.layout;return s==="vertical"&&U(n.props.height)?{height:n.props.height}:s==="horizontal"?{width:n.props.width||a}:null}}])}(P.PureComponent);Fd(vi,"displayName","Legend");Fd(vi,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var mx=ml,ED=sy,$D=$t,vx=mx?mx.isConcatSpreadable:void 0;function TD(e){return $D(e)||ED(e)||!!(vx&&e&&e[vx])}var MD=TD,ID=QS,LD=MD;function f_(e,t,r,n,a){var i=-1,s=e.length;for(r||(r=LD),a||(a=[]);++i<s;){var l=e[i];t>0&&r(l)?t>1?f_(l,t-1,r,n,a):ID(a,l):n||(a[a.length]=l)}return a}var h_=f_;function DD(e){return function(t,r,n){for(var a=-1,i=Object(t),s=n(t),l=s.length;l--;){var c=s[e?l:++a];if(r(i[c],c,i)===!1)break}return t}}var RD=DD,BD=RD,FD=BD(),zD=FD,WD=zD,UD=Bd;function HD(e,t){return e&&WD(e,t,UD)}var p_=HD,KD=vl;function VD(e,t){return function(r,n){if(r==null)return r;if(!KD(r))return e(r,n);for(var a=r.length,i=t?a:-1,s=Object(r);(t?i--:++i<a)&&n(s[i],i,s)!==!1;);return r}}var GD=VD,YD=p_,qD=GD,XD=qD(YD),dy=XD,QD=dy,JD=vl;function ZD(e,t){var r=-1,n=JD(e)?Array(e.length):[];return QD(e,function(a,i,s){n[++r]=t(a,i,s)}),n}var m_=ZD;function eR(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}var tR=eR,yx=ao;function rR(e,t){if(e!==t){var r=e!==void 0,n=e===null,a=e===e,i=yx(e),s=t!==void 0,l=t===null,c=t===t,u=yx(t);if(!l&&!u&&!i&&e>t||i&&s&&c&&!l&&!u||n&&s&&c||!r&&c||!a)return 1;if(!n&&!i&&!u&&e<t||u&&r&&a&&!n&&!i||l&&r&&a||!s&&a||!c)return-1}return 0}var nR=rR,aR=nR;function iR(e,t,r){for(var n=-1,a=e.criteria,i=t.criteria,s=a.length,l=r.length;++n<s;){var c=aR(a[n],i[n]);if(c){if(n>=l)return c;var u=r[n];return c*(u=="desc"?-1:1)}}return e.index-t.index}var oR=iR,qf=qv,sR=Xv,lR=Ir,cR=m_,uR=tR,dR=e_,fR=oR,hR=po,pR=$t;function mR(e,t,r){t.length?t=qf(t,function(i){return pR(i)?function(s){return sR(s,i.length===1?i[0]:i)}:i}):t=[hR];var n=-1;t=qf(t,dR(lR));var a=cR(e,function(i,s,l){var c=qf(t,function(u){return u(i)});return{criteria:c,index:++n,value:i}});return uR(a,function(i,s){return fR(i,s,r)})}var vR=mR;function yR(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var gR=yR,xR=gR,gx=Math.max;function bR(e,t,r){return t=gx(t===void 0?e.length-1:t,0),function(){for(var n=arguments,a=-1,i=gx(n.length-t,0),s=Array(i);++a<i;)s[a]=n[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=n[a];return l[t]=r(s),xR(e,this,l)}}var jR=bR;function wR(e){return function(){return e}}var SR=wR,_R=Ea,kR=function(){try{var e=_R(Object,"defineProperty");return e({},"",{}),e}catch{}}(),v_=kR,OR=SR,xx=v_,NR=po,PR=xx?function(e,t){return xx(e,"toString",{configurable:!0,enumerable:!1,value:OR(t),writable:!0})}:NR,AR=PR,CR=800,ER=16,$R=Date.now;function TR(e){var t=0,r=0;return function(){var n=$R(),a=ER-(n-r);if(r=n,a>0){if(++t>=CR)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var MR=TR,IR=AR,LR=MR,DR=LR(IR),RR=DR,BR=po,FR=jR,zR=RR;function WR(e,t){return zR(FR(e,t,BR),e+"")}var UR=WR,HR=Kv,KR=vl,VR=ly,GR=zn;function YR(e,t,r){if(!GR(r))return!1;var n=typeof t;return(n=="number"?KR(r)&&VR(t,r.length):n=="string"&&t in r)?HR(r[t],e):!1}var zd=YR,qR=h_,XR=vR,QR=UR,bx=zd,JR=QR(function(e,t){if(e==null)return[];var r=t.length;return r>1&&bx(e,t[0],t[1])?t=[]:r>2&&bx(t[0],t[1],t[2])&&(t=[t[0]]),XR(e,qR(t,1),[])}),ZR=JR;const fy=de(ZR);function Ps(e){"@babel/helpers - typeof";return Ps=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ps(e)}function Lp(){return Lp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Lp.apply(this,arguments)}function eB(e,t){return aB(e)||nB(e,t)||rB(e,t)||tB()}function tB(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rB(e,t){if(e){if(typeof e=="string")return jx(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jx(e,t)}}function jx(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function nB(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function aB(e){if(Array.isArray(e))return e}function wx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Xf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wx(Object(r),!0).forEach(function(n){iB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wx(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function iB(e,t,r){return t=oB(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oB(e){var t=sB(e,"string");return Ps(t)=="symbol"?t:t+""}function sB(e,t){if(Ps(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ps(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lB(e){return Array.isArray(e)&&qe(e[0])&&qe(e[1])?e.join(" ~ "):e}var cB=function(t){var r=t.separator,n=r===void 0?" : ":r,a=t.contentStyle,i=a===void 0?{}:a,s=t.itemStyle,l=s===void 0?{}:s,c=t.labelStyle,u=c===void 0?{}:c,f=t.payload,d=t.formatter,h=t.itemSorter,p=t.wrapperClassName,g=t.labelClassName,y=t.label,b=t.labelFormatter,v=t.accessibilityLayer,m=v===void 0?!1:v,x=function(){if(f&&f.length){var T={padding:0,margin:0},D=(h?fy(f,h):f).map(function(A,L){if(A.type==="none")return null;var C=Xf({display:"block",paddingTop:4,paddingBottom:4,color:A.color||"#000"},l),M=A.formatter||d||lB,I=A.value,R=A.name,F=I,K=R;if(M&&F!=null&&K!=null){var z=M(I,R,A,L,f);if(Array.isArray(z)){var q=eB(z,2);F=q[0],K=q[1]}else F=z}return $.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(L),style:C},qe(K)?$.createElement("span",{className:"recharts-tooltip-item-name"},K):null,qe(K)?$.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,$.createElement("span",{className:"recharts-tooltip-item-value"},F),$.createElement("span",{className:"recharts-tooltip-item-unit"},A.unit||""))});return $.createElement("ul",{className:"recharts-tooltip-item-list",style:T},D)}return null},S=Xf({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),j=Xf({margin:0},u),w=!te(y),_=w?y:"",O=ee("recharts-default-tooltip",p),N=ee("recharts-tooltip-label",g);w&&b&&f!==void 0&&f!==null&&(_=b(y,f));var k=m?{role:"status","aria-live":"assertive"}:{};return $.createElement("div",Lp({className:O,style:S},k),$.createElement("p",{className:N,style:j},$.isValidElement(_)?_:"".concat(_)),x())};function As(e){"@babel/helpers - typeof";return As=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},As(e)}function Gl(e,t,r){return t=uB(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uB(e){var t=dB(e,"string");return As(t)=="symbol"?t:t+""}function dB(e,t){if(As(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(As(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Po="recharts-tooltip-wrapper",fB={visibility:"hidden"};function hB(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return ee(Po,Gl(Gl(Gl(Gl({},"".concat(Po,"-right"),U(r)&&t&&U(t.x)&&r>=t.x),"".concat(Po,"-left"),U(r)&&t&&U(t.x)&&r<t.x),"".concat(Po,"-bottom"),U(n)&&t&&U(t.y)&&n>=t.y),"".concat(Po,"-top"),U(n)&&t&&U(t.y)&&n<t.y))}function Sx(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.key,a=e.offsetTopLeft,i=e.position,s=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(i&&U(i[n]))return i[n];var f=r[n]-l-a,d=r[n]+a;if(t[n])return s[n]?f:d;if(s[n]){var h=f,p=c[n];return h<p?Math.max(d,c[n]):Math.max(f,c[n])}var g=d+l,y=c[n]+u;return g>y?Math.max(f,c[n]):Math.max(d,c[n])}function pB(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function mB(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,a=e.position,i=e.reverseDirection,s=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,f,d;return s.height>0&&s.width>0&&r?(f=Sx({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:s.width,viewBox:c,viewBoxDimension:c.width}),d=Sx({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:s.height,viewBox:c,viewBoxDimension:c.height}),u=pB({translateX:f,translateY:d,useTranslate3d:l})):u=fB,{cssProperties:u,cssClasses:hB({translateX:f,translateY:d,coordinate:r})}}function Ci(e){"@babel/helpers - typeof";return Ci=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ci(e)}function _x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function kx(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_x(Object(r),!0).forEach(function(n){Rp(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_x(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yB(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,g_(n.key),n)}}function gB(e,t,r){return t&&yB(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function xB(e,t,r){return t=cu(t),bB(e,y_()?Reflect.construct(t,r||[],cu(e).constructor):t.apply(e,r))}function bB(e,t){if(t&&(Ci(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return jB(e)}function jB(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(y_=function(){return!!e})()}function cu(e){return cu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},cu(e)}function wB(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Dp(e,t)}function Dp(e,t){return Dp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Dp(e,t)}function Rp(e,t,r){return t=g_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function g_(e){var t=SB(e,"string");return Ci(t)=="symbol"?t:t+""}function SB(e,t){if(Ci(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ci(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ox=1,_B=function(e){function t(){var r;vB(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=xB(this,t,[].concat(a)),Rp(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),Rp(r,"handleKeyDown",function(s){if(s.key==="Escape"){var l,c,u,f;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=r.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(f=r.props.coordinate)===null||f===void 0?void 0:f.y)!==null&&u!==void 0?u:0}})}}),r}return wB(t,e),gB(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>Ox||Math.abs(n.height-this.state.lastBoundingBox.height)>Ox)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,a=this.props,i=a.active,s=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.children,f=a.coordinate,d=a.hasPayload,h=a.isAnimationActive,p=a.offset,g=a.position,y=a.reverseDirection,b=a.useTranslate3d,v=a.viewBox,m=a.wrapperStyle,x=mB({allowEscapeViewBox:s,coordinate:f,offsetTopLeft:p,position:g,reverseDirection:y,tooltipBox:this.state.lastBoundingBox,useTranslate3d:b,viewBox:v}),S=x.cssClasses,j=x.cssProperties,w=kx(kx({transition:h&&i?"transform ".concat(l,"ms ").concat(c):void 0},j),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&d?"visible":"hidden",position:"absolute",top:0,left:0},m);return $.createElement("div",{tabIndex:-1,className:S,style:w,ref:function(O){n.wrapperNode=O}},u)}}])}(P.PureComponent),kB=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Wn={isSsr:kB()};function Ei(e){"@babel/helpers - typeof";return Ei=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ei(e)}function Nx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Px(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Nx(Object(r),!0).forEach(function(n){hy(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Nx(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function OB(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NB(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,b_(n.key),n)}}function PB(e,t,r){return t&&NB(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function AB(e,t,r){return t=uu(t),CB(e,x_()?Reflect.construct(t,r||[],uu(e).constructor):t.apply(e,r))}function CB(e,t){if(t&&(Ei(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return EB(e)}function EB(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function x_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(x_=function(){return!!e})()}function uu(e){return uu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},uu(e)}function $B(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bp(e,t)}function Bp(e,t){return Bp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Bp(e,t)}function hy(e,t,r){return t=b_(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b_(e){var t=TB(e,"string");return Ei(t)=="symbol"?t:t+""}function TB(e,t){if(Ei(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ei(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function MB(e){return e.dataKey}function IB(e,t){return $.isValidElement(e)?$.cloneElement(e,t):typeof e=="function"?$.createElement(e,t):$.createElement(cB,t)}var Ge=function(e){function t(){return OB(this,t),AB(this,t,arguments)}return $B(t,e),PB(t,[{key:"render",value:function(){var n=this,a=this.props,i=a.active,s=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.content,f=a.coordinate,d=a.filterNull,h=a.isAnimationActive,p=a.offset,g=a.payload,y=a.payloadUniqBy,b=a.position,v=a.reverseDirection,m=a.useTranslate3d,x=a.viewBox,S=a.wrapperStyle,j=g??[];d&&j.length&&(j=c_(g.filter(function(_){return _.value!=null&&(_.hide!==!0||n.props.includeHidden)}),y,MB));var w=j.length>0;return $.createElement(_B,{allowEscapeViewBox:s,animationDuration:l,animationEasing:c,isAnimationActive:h,active:i,coordinate:f,hasPayload:w,offset:p,position:b,reverseDirection:v,useTranslate3d:m,viewBox:x,wrapperStyle:S},IB(u,Px(Px({},this.props),{},{payload:j})))}}])}(P.PureComponent);hy(Ge,"displayName","Tooltip");hy(Ge,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Wn.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var LB=Mr,DB=function(){return LB.Date.now()},RB=DB,BB=/\s/;function FB(e){for(var t=e.length;t--&&BB.test(e.charAt(t)););return t}var zB=FB,WB=zB,UB=/^\s+/;function HB(e){return e&&e.slice(0,WB(e)+1).replace(UB,"")}var KB=HB,VB=KB,Ax=zn,GB=ao,Cx=NaN,YB=/^[-+]0x[0-9a-f]+$/i,qB=/^0b[01]+$/i,XB=/^0o[0-7]+$/i,QB=parseInt;function JB(e){if(typeof e=="number")return e;if(GB(e))return Cx;if(Ax(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ax(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=VB(e);var r=qB.test(e);return r||XB.test(e)?QB(e.slice(2),r?2:8):YB.test(e)?Cx:+e}var j_=JB,ZB=zn,Qf=RB,Ex=j_,eF="Expected a function",tF=Math.max,rF=Math.min;function nF(e,t,r){var n,a,i,s,l,c,u=0,f=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(eF);t=Ex(t)||0,ZB(r)&&(f=!!r.leading,d="maxWait"in r,i=d?tF(Ex(r.maxWait)||0,t):i,h="trailing"in r?!!r.trailing:h);function p(w){var _=n,O=a;return n=a=void 0,u=w,s=e.apply(O,_),s}function g(w){return u=w,l=setTimeout(v,t),f?p(w):s}function y(w){var _=w-c,O=w-u,N=t-_;return d?rF(N,i-O):N}function b(w){var _=w-c,O=w-u;return c===void 0||_>=t||_<0||d&&O>=i}function v(){var w=Qf();if(b(w))return m(w);l=setTimeout(v,y(w))}function m(w){return l=void 0,h&&n?p(w):(n=a=void 0,s)}function x(){l!==void 0&&clearTimeout(l),u=0,n=c=a=l=void 0}function S(){return l===void 0?s:m(Qf())}function j(){var w=Qf(),_=b(w);if(n=arguments,a=this,c=w,_){if(l===void 0)return g(c);if(d)return clearTimeout(l),l=setTimeout(v,t),p(c)}return l===void 0&&(l=setTimeout(v,t)),s}return j.cancel=x,j.flush=S,j}var aF=nF,iF=aF,oF=zn,sF="Expected a function";function lF(e,t,r){var n=!0,a=!0;if(typeof e!="function")throw new TypeError(sF);return oF(r)&&(n="leading"in r?!!r.leading:n,a="trailing"in r?!!r.trailing:a),iF(e,t,{leading:n,maxWait:t,trailing:a})}var cF=lF;const w_=de(cF);function Cs(e){"@babel/helpers - typeof";return Cs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cs(e)}function $x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Yl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$x(Object(r),!0).forEach(function(n){uF(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$x(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uF(e,t,r){return t=dF(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dF(e){var t=fF(e,"string");return Cs(t)=="symbol"?t:t+""}function fF(e,t){if(Cs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Cs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hF(e,t){return yF(e)||vF(e,t)||mF(e,t)||pF()}function pF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mF(e,t){if(e){if(typeof e=="string")return Tx(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Tx(e,t)}}function Tx(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function vF(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function yF(e){if(Array.isArray(e))return e}var tr=P.forwardRef(function(e,t){var r=e.aspect,n=e.initialDimension,a=n===void 0?{width:-1,height:-1}:n,i=e.width,s=i===void 0?"100%":i,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,f=u===void 0?0:u,d=e.minHeight,h=e.maxHeight,p=e.children,g=e.debounce,y=g===void 0?0:g,b=e.id,v=e.className,m=e.onResize,x=e.style,S=x===void 0?{}:x,j=P.useRef(null),w=P.useRef();w.current=m,P.useImperativeHandle(t,function(){return Object.defineProperty(j.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),j.current},configurable:!0})});var _=P.useState({containerWidth:a.width,containerHeight:a.height}),O=hF(_,2),N=O[0],k=O[1],E=P.useCallback(function(D,A){k(function(L){var C=Math.round(D),M=Math.round(A);return L.containerWidth===C&&L.containerHeight===M?L:{containerWidth:C,containerHeight:M}})},[]);P.useEffect(function(){var D=function(R){var F,K=R[0].contentRect,z=K.width,q=K.height;E(z,q),(F=w.current)===null||F===void 0||F.call(w,z,q)};y>0&&(D=w_(D,y,{trailing:!0,leading:!1}));var A=new ResizeObserver(D),L=j.current.getBoundingClientRect(),C=L.width,M=L.height;return E(C,M),A.observe(j.current),function(){A.disconnect()}},[E,y]);var T=P.useMemo(function(){var D=N.containerWidth,A=N.containerHeight;if(D<0||A<0)return null;yr(oa(s)||oa(c),`The width(%s) and height(%s) are both fixed numbers,
+ maybe you don't need to use a ResponsiveContainer.`,s,c),yr(!r||r>0,"The aspect(%s) must be greater than zero.",r);var L=oa(s)?D:s,C=oa(c)?A:c;r&&r>0&&(L?C=L/r:C&&(L=C*r),h&&C>h&&(C=h)),yr(L>0||C>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.`,L,C,s,c,f,d,r);var M=!Array.isArray(p)&&Yr(p.type).endsWith("Chart");return $.Children.map(p,function(I){return $.isValidElement(I)?P.cloneElement(I,Yl({width:L,height:C},M?{style:Yl({height:"100%",width:"100%",maxHeight:C,maxWidth:L},I.props.style)}:{})):I})},[r,p,c,h,d,f,N,s]);return $.createElement("div",{id:b?"".concat(b):void 0,className:ee("recharts-responsive-container",v),style:Yl(Yl({},S),{},{width:s,height:c,minWidth:f,minHeight:d,maxHeight:h}),ref:j},T)}),xr=function(t){return null};xr.displayName="Cell";function Es(e){"@babel/helpers - typeof";return Es=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Es(e)}function Mx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Fp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Mx(Object(r),!0).forEach(function(n){gF(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mx(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gF(e,t,r){return t=xF(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xF(e){var t=bF(e,"string");return Es(t)=="symbol"?t:t+""}function bF(e,t){if(Es(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Es(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ra={widthCache:{},cacheCount:0},jF=2e3,wF={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Ix="recharts_measurement_span";function SF(e){var t=Fp({},e);return Object.keys(t).forEach(function(r){t[r]||delete t[r]}),t}var ts=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Wn.isSsr)return{width:0,height:0};var n=SF(r),a=JSON.stringify({text:t,copyStyle:n});if(Ra.widthCache[a])return Ra.widthCache[a];try{var i=document.getElementById(Ix);i||(i=document.createElement("span"),i.setAttribute("id",Ix),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var s=Fp(Fp({},wF),n);Object.assign(i.style,s),i.textContent="".concat(t);var l=i.getBoundingClientRect(),c={width:l.width,height:l.height};return Ra.widthCache[a]=c,++Ra.cacheCount>jF&&(Ra.cacheCount=0,Ra.widthCache={}),c}catch{return{width:0,height:0}}},_F=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function $s(e){"@babel/helpers - typeof";return $s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$s(e)}function du(e,t){return PF(e)||NF(e,t)||OF(e,t)||kF()}function kF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OF(e,t){if(e){if(typeof e=="string")return Lx(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Lx(e,t)}}function Lx(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function NF(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function PF(e){if(Array.isArray(e))return e}function AF(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dx(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,EF(n.key),n)}}function CF(e,t,r){return t&&Dx(e.prototype,t),r&&Dx(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function EF(e){var t=$F(e,"string");return $s(t)=="symbol"?t:t+""}function $F(e,t){if($s(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if($s(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Rx=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Bx=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,TF=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,MF=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,S_={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},IF=Object.keys(S_),ai="NaN";function LF(e,t){return e*S_[t]}var ql=function(){function e(t,r){AF(this,e),this.num=t,this.unit=r,this.num=t,this.unit=r,Number.isNaN(t)&&(this.unit=""),r!==""&&!TF.test(r)&&(this.num=NaN,this.unit=""),IF.includes(r)&&(this.num=LF(t,r),this.unit="px")}return CF(e,[{key:"add",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num+r.num,this.unit)}},{key:"subtract",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num-r.num,this.unit)}},{key:"multiply",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num*r.num,this.unit||r.unit)}},{key:"divide",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num/r.num,this.unit||r.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(r){var n,a=(n=MF.exec(r))!==null&&n!==void 0?n:[],i=du(a,3),s=i[1],l=i[2];return new e(parseFloat(s),l??"")}}])}();function __(e){if(e.includes(ai))return ai;for(var t=e;t.includes("*")||t.includes("/");){var r,n=(r=Rx.exec(t))!==null&&r!==void 0?r:[],a=du(n,4),i=a[1],s=a[2],l=a[3],c=ql.parse(i??""),u=ql.parse(l??""),f=s==="*"?c.multiply(u):c.divide(u);if(f.isNaN())return ai;t=t.replace(Rx,f.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,h=(d=Bx.exec(t))!==null&&d!==void 0?d:[],p=du(h,4),g=p[1],y=p[2],b=p[3],v=ql.parse(g??""),m=ql.parse(b??""),x=y==="+"?v.add(m):v.subtract(m);if(x.isNaN())return ai;t=t.replace(Bx,x.toString())}return t}var Fx=/\(([^()]*)\)/;function DF(e){for(var t=e;t.includes("(");){var r=Fx.exec(t),n=du(r,2),a=n[1];t=t.replace(Fx,__(a))}return t}function RF(e){var t=e.replace(/\s+/g,"");return t=DF(t),t=__(t),t}function BF(e){try{return RF(e)}catch{return ai}}function Jf(e){var t=BF(e.slice(5,-1));return t===ai?"":t}var FF=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],zF=["dx","dy","angle","className","breakAll"];function zp(){return zp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zp.apply(this,arguments)}function zx(e,t){if(e==null)return{};var r=WF(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function WF(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Wx(e,t){return VF(e)||KF(e,t)||HF(e,t)||UF()}function UF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HF(e,t){if(e){if(typeof e=="string")return Ux(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ux(e,t)}}function Ux(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function KF(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function VF(e){if(Array.isArray(e))return e}var k_=/[ \f\n\r\t\v\u2028\u2029]+/,O_=function(t){var r=t.children,n=t.breakAll,a=t.style;try{var i=[];te(r)||(n?i=r.toString().split(""):i=r.toString().split(k_));var s=i.map(function(c){return{word:c,width:ts(c,a).width}}),l=n?0:ts(" ",a).width;return{wordsWithComputedWidth:s,spaceWidth:l}}catch{return null}},GF=function(t,r,n,a,i){var s=t.maxLines,l=t.children,c=t.style,u=t.breakAll,f=U(s),d=l,h=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return L.reduce(function(C,M){var I=M.word,R=M.width,F=C[C.length-1];if(F&&(a==null||i||F.width+R+n<Number(a)))F.words.push(I),F.width+=R+n;else{var K={words:[I],width:R};C.push(K)}return C},[])},p=h(r),g=function(L){return L.reduce(function(C,M){return C.width>M.width?C:M})};if(!f)return p;for(var y="…",b=function(L){var C=d.slice(0,L),M=O_({breakAll:u,style:c,children:C+y}).wordsWithComputedWidth,I=h(M),R=I.length>s||g(I).width>Number(a);return[R,I]},v=0,m=d.length-1,x=0,S;v<=m&&x<=d.length-1;){var j=Math.floor((v+m)/2),w=j-1,_=b(w),O=Wx(_,2),N=O[0],k=O[1],E=b(j),T=Wx(E,1),D=T[0];if(!N&&!D&&(v=j+1),N&&D&&(m=j-1),!N&&D){S=k;break}x++}return S||p},Hx=function(t){var r=te(t)?[]:t.toString().split(k_);return[{words:r}]},YF=function(t){var r=t.width,n=t.scaleToFit,a=t.children,i=t.style,s=t.breakAll,l=t.maxLines;if((r||n)&&!Wn.isSsr){var c,u,f=O_({breakAll:s,children:a,style:i});if(f){var d=f.wordsWithComputedWidth,h=f.spaceWidth;c=d,u=h}else return Hx(a);return GF({breakAll:s,children:a,maxLines:l,style:i},c,u,r,n)}return Hx(a)},Kx="#808080",Sa=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,s=t.lineHeight,l=s===void 0?"1em":s,c=t.capHeight,u=c===void 0?"0.71em":c,f=t.scaleToFit,d=f===void 0?!1:f,h=t.textAnchor,p=h===void 0?"start":h,g=t.verticalAnchor,y=g===void 0?"end":g,b=t.fill,v=b===void 0?Kx:b,m=zx(t,FF),x=P.useMemo(function(){return YF({breakAll:m.breakAll,children:m.children,maxLines:m.maxLines,scaleToFit:d,style:m.style,width:m.width})},[m.breakAll,m.children,m.maxLines,d,m.style,m.width]),S=m.dx,j=m.dy,w=m.angle,_=m.className,O=m.breakAll,N=zx(m,zF);if(!qe(n)||!qe(i))return null;var k=n+(U(S)?S:0),E=i+(U(j)?j:0),T;switch(y){case"start":T=Jf("calc(".concat(u,")"));break;case"middle":T=Jf("calc(".concat((x.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:T=Jf("calc(".concat(x.length-1," * -").concat(l,")"));break}var D=[];if(d){var A=x[0].width,L=m.width;D.push("scale(".concat((U(L)?L/A:1)/A,")"))}return w&&D.push("rotate(".concat(w,", ").concat(k,", ").concat(E,")")),D.length&&(N.transform=D.join(" ")),$.createElement("text",zp({},X(N,!0),{x:k,y:E,className:ee("recharts-text",_),textAnchor:p,fill:v.includes("url")?Kx:v}),x.map(function(C,M){var I=C.words.join(O?"":" ");return $.createElement("tspan",{x:k,dy:M===0?T:l,key:"".concat(I,"-").concat(M)},I)}))};function Mn(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function qF(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function py(e){let t,r,n;e.length!==2?(t=Mn,r=(l,c)=>Mn(e(l),c),n=(l,c)=>e(l)-c):(t=e===Mn||e===qF?e:XF,r=e,n=e);function a(l,c,u=0,f=l.length){if(u<f){if(t(c,c)!==0)return f;do{const d=u+f>>>1;r(l[d],c)<0?u=d+1:f=d}while(u<f)}return u}function i(l,c,u=0,f=l.length){if(u<f){if(t(c,c)!==0)return f;do{const d=u+f>>>1;r(l[d],c)<=0?u=d+1:f=d}while(u<f)}return u}function s(l,c,u=0,f=l.length){const d=a(l,c,u,f-1);return d>u&&n(l[d-1],c)>-n(l[d],c)?d-1:d}return{left:a,center:s,right:i}}function XF(){return 0}function N_(e){return e===null?NaN:+e}function*QF(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const JF=py(Mn),yl=JF.right;py(N_).center;class Vx extends Map{constructor(t,r=t9){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,a]of t)this.set(n,a)}get(t){return super.get(Gx(this,t))}has(t){return super.has(Gx(this,t))}set(t,r){return super.set(ZF(this,t),r)}delete(t){return super.delete(e9(this,t))}}function Gx({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function ZF({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function e9({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function t9(e){return e!==null&&typeof e=="object"?e.valueOf():e}function r9(e=Mn){if(e===Mn)return P_;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function P_(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const n9=Math.sqrt(50),a9=Math.sqrt(10),i9=Math.sqrt(2);function fu(e,t,r){const n=(t-e)/Math.max(0,r),a=Math.floor(Math.log10(n)),i=n/Math.pow(10,a),s=i>=n9?10:i>=a9?5:i>=i9?2:1;let l,c,u;return a<0?(u=Math.pow(10,-a)/s,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,a)*s,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=r&&r<2?fu(e,t,r*2):[l,c,u]}function Wp(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[a,i,s]=n?fu(t,e,r):fu(e,t,r);if(!(i>=a))return[];const l=i-a+1,c=new Array(l);if(n)if(s<0)for(let u=0;u<l;++u)c[u]=(i-u)/-s;else for(let u=0;u<l;++u)c[u]=(i-u)*s;else if(s<0)for(let u=0;u<l;++u)c[u]=(a+u)/-s;else for(let u=0;u<l;++u)c[u]=(a+u)*s;return c}function Up(e,t,r){return t=+t,e=+e,r=+r,fu(e,t,r)[2]}function Hp(e,t,r){t=+t,e=+e,r=+r;const n=t<e,a=n?Up(t,e,r):Up(e,t,r);return(n?-1:1)*(a<0?1/-a:a)}function Yx(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function qx(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function A_(e,t,r=0,n=1/0,a){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(a=a===void 0?P_:r9(a);n>r;){if(n-r>600){const c=n-r+1,u=t-r+1,f=Math.log(c),d=.5*Math.exp(2*f/3),h=.5*Math.sqrt(f*d*(c-d)/c)*(u-c/2<0?-1:1),p=Math.max(r,Math.floor(t-u*d/c+h)),g=Math.min(n,Math.floor(t+(c-u)*d/c+h));A_(e,t,p,g,a)}const i=e[t];let s=r,l=n;for(Ao(e,r,t),a(e[n],i)>0&&Ao(e,r,n);s<l;){for(Ao(e,s,l),++s,--l;a(e[s],i)<0;)++s;for(;a(e[l],i)>0;)--l}a(e[r],i)===0?Ao(e,r,l):(++l,Ao(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function Ao(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function o9(e,t,r){if(e=Float64Array.from(QF(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return qx(e);if(t>=1)return Yx(e);var n,a=(n-1)*t,i=Math.floor(a),s=Yx(A_(e,i).subarray(0,i+1)),l=qx(e.subarray(i+1));return s+(l-s)*(a-i)}}function s9(e,t,r=N_){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,a=(n-1)*t,i=Math.floor(a),s=+r(e[i],i,e),l=+r(e[i+1],i+1,e);return s+(l-s)*(a-i)}}function l9(e,t,r){e=+e,t=+t,r=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+r;for(var n=-1,a=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(a);++n<a;)i[n]=e+n*r;return i}function ir(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function ln(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const Kp=Symbol("implicit");function my(){var e=new Vx,t=[],r=[],n=Kp;function a(i){let s=e.get(i);if(s===void 0){if(n!==Kp)return n;e.set(i,s=t.push(i)-1)}return r[s%r.length]}return a.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new Vx;for(const s of i)e.has(s)||e.set(s,t.push(s)-1);return a},a.range=function(i){return arguments.length?(r=Array.from(i),a):r.slice()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return my(t,r).unknown(n)},ir.apply(a,arguments),a}function Ts(){var e=my().unknown(void 0),t=e.domain,r=e.range,n=0,a=1,i,s,l=!1,c=0,u=0,f=.5;delete e.unknown;function d(){var h=t().length,p=a<n,g=p?a:n,y=p?n:a;i=(y-g)/Math.max(1,h-c+u*2),l&&(i=Math.floor(i)),g+=(y-g-i*(h-c))*f,s=i*(1-c),l&&(g=Math.round(g),s=Math.round(s));var b=l9(h).map(function(v){return g+i*v});return r(p?b.reverse():b)}return e.domain=function(h){return arguments.length?(t(h),d()):t()},e.range=function(h){return arguments.length?([n,a]=h,n=+n,a=+a,d()):[n,a]},e.rangeRound=function(h){return[n,a]=h,n=+n,a=+a,l=!0,d()},e.bandwidth=function(){return s},e.step=function(){return i},e.round=function(h){return arguments.length?(l=!!h,d()):l},e.padding=function(h){return arguments.length?(c=Math.min(1,u=+h),d()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),d()):c},e.paddingOuter=function(h){return arguments.length?(u=+h,d()):u},e.align=function(h){return arguments.length?(f=Math.max(0,Math.min(1,h)),d()):f},e.copy=function(){return Ts(t(),[n,a]).round(l).paddingInner(c).paddingOuter(u).align(f)},ir.apply(d(),arguments)}function C_(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return C_(t())},e}function rs(){return C_(Ts.apply(null,arguments).paddingInner(1))}function vy(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function E_(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function gl(){}var Ms=.7,hu=1/Ms,yi="\\s*([+-]?\\d+)\\s*",Is="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Cr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",c9=/^#([0-9a-f]{3,8})$/,u9=new RegExp(`^rgb\\(${yi},${yi},${yi}\\)$`),d9=new RegExp(`^rgb\\(${Cr},${Cr},${Cr}\\)$`),f9=new RegExp(`^rgba\\(${yi},${yi},${yi},${Is}\\)$`),h9=new RegExp(`^rgba\\(${Cr},${Cr},${Cr},${Is}\\)$`),p9=new RegExp(`^hsl\\(${Is},${Cr},${Cr}\\)$`),m9=new RegExp(`^hsla\\(${Is},${Cr},${Cr},${Is}\\)$`),Xx={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};vy(gl,Ls,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Qx,formatHex:Qx,formatHex8:v9,formatHsl:y9,formatRgb:Jx,toString:Jx});function Qx(){return this.rgb().formatHex()}function v9(){return this.rgb().formatHex8()}function y9(){return $_(this).formatHsl()}function Jx(){return this.rgb().formatRgb()}function Ls(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=c9.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Zx(t):r===3?new Pt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Xl(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Xl(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=u9.exec(e))?new Pt(t[1],t[2],t[3],1):(t=d9.exec(e))?new Pt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=f9.exec(e))?Xl(t[1],t[2],t[3],t[4]):(t=h9.exec(e))?Xl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=p9.exec(e))?rb(t[1],t[2]/100,t[3]/100,1):(t=m9.exec(e))?rb(t[1],t[2]/100,t[3]/100,t[4]):Xx.hasOwnProperty(e)?Zx(Xx[e]):e==="transparent"?new Pt(NaN,NaN,NaN,0):null}function Zx(e){return new Pt(e>>16&255,e>>8&255,e&255,1)}function Xl(e,t,r,n){return n<=0&&(e=t=r=NaN),new Pt(e,t,r,n)}function g9(e){return e instanceof gl||(e=Ls(e)),e?(e=e.rgb(),new Pt(e.r,e.g,e.b,e.opacity)):new Pt}function Vp(e,t,r,n){return arguments.length===1?g9(e):new Pt(e,t,r,n??1)}function Pt(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}vy(Pt,Vp,E_(gl,{brighter(e){return e=e==null?hu:Math.pow(hu,e),new Pt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ms:Math.pow(Ms,e),new Pt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Pt(pa(this.r),pa(this.g),pa(this.b),pu(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:eb,formatHex:eb,formatHex8:x9,formatRgb:tb,toString:tb}));function eb(){return`#${sa(this.r)}${sa(this.g)}${sa(this.b)}`}function x9(){return`#${sa(this.r)}${sa(this.g)}${sa(this.b)}${sa((isNaN(this.opacity)?1:this.opacity)*255)}`}function tb(){const e=pu(this.opacity);return`${e===1?"rgb(":"rgba("}${pa(this.r)}, ${pa(this.g)}, ${pa(this.b)}${e===1?")":`, ${e})`}`}function pu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function pa(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function sa(e){return e=pa(e),(e<16?"0":"")+e.toString(16)}function rb(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new pr(e,t,r,n)}function $_(e){if(e instanceof pr)return new pr(e.h,e.s,e.l,e.opacity);if(e instanceof gl||(e=Ls(e)),!e)return new pr;if(e instanceof pr)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),i=Math.max(t,r,n),s=NaN,l=i-a,c=(i+a)/2;return l?(t===i?s=(r-n)/l+(r<n)*6:r===i?s=(n-t)/l+2:s=(t-r)/l+4,l/=c<.5?i+a:2-i-a,s*=60):l=c>0&&c<1?0:s,new pr(s,l,c,e.opacity)}function b9(e,t,r,n){return arguments.length===1?$_(e):new pr(e,t,r,n??1)}function pr(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}vy(pr,b9,E_(gl,{brighter(e){return e=e==null?hu:Math.pow(hu,e),new pr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ms:Math.pow(Ms,e),new pr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,a=2*r-n;return new Pt(Zf(e>=240?e-240:e+120,a,n),Zf(e,a,n),Zf(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new pr(nb(this.h),Ql(this.s),Ql(this.l),pu(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=pu(this.opacity);return`${e===1?"hsl(":"hsla("}${nb(this.h)}, ${Ql(this.s)*100}%, ${Ql(this.l)*100}%${e===1?")":`, ${e})`}`}}));function nb(e){return e=(e||0)%360,e<0?e+360:e}function Ql(e){return Math.max(0,Math.min(1,e||0))}function Zf(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const yy=e=>()=>e;function j9(e,t){return function(r){return e+r*t}}function w9(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function S9(e){return(e=+e)==1?T_:function(t,r){return r-t?w9(t,r,e):yy(isNaN(t)?r:t)}}function T_(e,t){var r=t-e;return r?j9(e,r):yy(isNaN(e)?t:e)}const ab=function e(t){var r=S9(t);function n(a,i){var s=r((a=Vp(a)).r,(i=Vp(i)).r),l=r(a.g,i.g),c=r(a.b,i.b),u=T_(a.opacity,i.opacity);return function(f){return a.r=s(f),a.g=l(f),a.b=c(f),a.opacity=u(f),a+""}}return n.gamma=e,n}(1);function _9(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),a;return function(i){for(a=0;a<r;++a)n[a]=e[a]*(1-i)+t[a]*i;return n}}function k9(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function O9(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,a=new Array(n),i=new Array(r),s;for(s=0;s<n;++s)a[s]=mo(e[s],t[s]);for(;s<r;++s)i[s]=t[s];return function(l){for(s=0;s<n;++s)i[s]=a[s](l);return i}}function N9(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function mu(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function P9(e,t){var r={},n={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?r[a]=mo(e[a],t[a]):n[a]=t[a];return function(i){for(a in r)n[a]=r[a](i);return n}}var Gp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,eh=new RegExp(Gp.source,"g");function A9(e){return function(){return e}}function C9(e){return function(t){return e(t)+""}}function E9(e,t){var r=Gp.lastIndex=eh.lastIndex=0,n,a,i,s=-1,l=[],c=[];for(e=e+"",t=t+"";(n=Gp.exec(e))&&(a=eh.exec(t));)(i=a.index)>r&&(i=t.slice(r,i),l[s]?l[s]+=i:l[++s]=i),(n=n[0])===(a=a[0])?l[s]?l[s]+=a:l[++s]=a:(l[++s]=null,c.push({i:s,x:mu(n,a)})),r=eh.lastIndex;return r<t.length&&(i=t.slice(r),l[s]?l[s]+=i:l[++s]=i),l.length<2?c[0]?C9(c[0].x):A9(t):(t=c.length,function(u){for(var f=0,d;f<t;++f)l[(d=c[f]).i]=d.x(u);return l.join("")})}function mo(e,t){var r=typeof t,n;return t==null||r==="boolean"?yy(t):(r==="number"?mu:r==="string"?(n=Ls(t))?(t=n,ab):E9:t instanceof Ls?ab:t instanceof Date?N9:k9(t)?_9:Array.isArray(t)?O9:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?P9:mu)(e,t)}function gy(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function $9(e,t){t===void 0&&(t=e,e=mo);for(var r=0,n=t.length-1,a=t[0],i=new Array(n<0?0:n);r<n;)i[r]=e(a,a=t[++r]);return function(s){var l=Math.max(0,Math.min(n-1,Math.floor(s*=n)));return i[l](s-l)}}function T9(e){return function(){return e}}function vu(e){return+e}var ib=[0,1];function bt(e){return e}function Yp(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:T9(isNaN(t)?NaN:.5)}function M9(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function I9(e,t,r){var n=e[0],a=e[1],i=t[0],s=t[1];return a<n?(n=Yp(a,n),i=r(s,i)):(n=Yp(n,a),i=r(i,s)),function(l){return i(n(l))}}function L9(e,t,r){var n=Math.min(e.length,t.length)-1,a=new Array(n),i=new Array(n),s=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<n;)a[s]=Yp(e[s],e[s+1]),i[s]=r(t[s],t[s+1]);return function(l){var c=yl(e,l,1,n)-1;return i[c](a[c](l))}}function xl(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Wd(){var e=ib,t=ib,r=mo,n,a,i,s=bt,l,c,u;function f(){var h=Math.min(e.length,t.length);return s!==bt&&(s=M9(e[0],e[h-1])),l=h>2?L9:I9,c=u=null,d}function d(h){return h==null||isNaN(h=+h)?i:(c||(c=l(e.map(n),t,r)))(n(s(h)))}return d.invert=function(h){return s(a((u||(u=l(t,e.map(n),mu)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,vu),f()):e.slice()},d.range=function(h){return arguments.length?(t=Array.from(h),f()):t.slice()},d.rangeRound=function(h){return t=Array.from(h),r=gy,f()},d.clamp=function(h){return arguments.length?(s=h?!0:bt,f()):s!==bt},d.interpolate=function(h){return arguments.length?(r=h,f()):r},d.unknown=function(h){return arguments.length?(i=h,d):i},function(h,p){return n=h,a=p,f()}}function xy(){return Wd()(bt,bt)}function D9(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function yu(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function $i(e){return e=yu(Math.abs(e)),e?e[1]:NaN}function R9(e,t){return function(r,n){for(var a=r.length,i=[],s=0,l=e[0],c=0;a>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),i.push(r.substring(a-=l,a+l)),!((c+=l+1)>n));)l=e[s=(s+1)%e.length];return i.reverse().join(t)}}function B9(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var F9=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ds(e){if(!(t=F9.exec(e)))throw new Error("invalid format: "+e);var t;return new by({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]})}Ds.prototype=by.prototype;function by(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+""}by.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 z9(e){e:for(var t=e.length,r=1,n=-1,a;r<t;++r)switch(e[r]){case".":n=a=r;break;case"0":n===0&&(n=r),a=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(a+1):e}var gu;function W9(e,t){var r=yu(e,t);if(!r)return gu=void 0,e.toPrecision(t);var n=r[0],a=r[1],i=a-(gu=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,s=n.length;return i===s?n:i>s?n+new Array(i-s+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+yu(e,Math.max(0,t+i-1))[0]}function ob(e,t){var r=yu(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const sb={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:D9,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)=>ob(e*100,t),r:ob,s:W9,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function lb(e){return e}var cb=Array.prototype.map,ub=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function U9(e){var t=e.grouping===void 0||e.thousands===void 0?lb:R9(cb.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?lb:B9(cb.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(d,h){d=Ds(d);var p=d.fill,g=d.align,y=d.sign,b=d.symbol,v=d.zero,m=d.width,x=d.comma,S=d.precision,j=d.trim,w=d.type;w==="n"?(x=!0,w="g"):sb[w]||(S===void 0&&(S=12),j=!0,w="g"),(v||p==="0"&&g==="=")&&(v=!0,p="0",g="=");var _=(h&&h.prefix!==void 0?h.prefix:"")+(b==="$"?r:b==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():""),O=(b==="$"?n:/[%p]/.test(w)?s:"")+(h&&h.suffix!==void 0?h.suffix:""),N=sb[w],k=/[defgprs%]/.test(w);S=S===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function E(T){var D=_,A=O,L,C,M;if(w==="c")A=N(T)+A,T="";else{T=+T;var I=T<0||1/T<0;if(T=isNaN(T)?c:N(Math.abs(T),S),j&&(T=z9(T)),I&&+T==0&&y!=="+"&&(I=!1),D=(I?y==="("?y:l:y==="-"||y==="("?"":y)+D,A=(w==="s"&&!isNaN(T)&&gu!==void 0?ub[8+gu/3]:"")+A+(I&&y==="("?")":""),k){for(L=-1,C=T.length;++L<C;)if(M=T.charCodeAt(L),48>M||M>57){A=(M===46?a+T.slice(L+1):T.slice(L))+A,T=T.slice(0,L);break}}}x&&!v&&(T=t(T,1/0));var R=D.length+T.length+A.length,F=R<m?new Array(m-R+1).join(p):"";switch(x&&v&&(T=t(F+T,F.length?m-A.length:1/0),F=""),g){case"<":T=D+T+A+F;break;case"=":T=D+F+T+A;break;case"^":T=F.slice(0,R=F.length>>1)+D+T+A+F.slice(R);break;default:T=F+D+T+A;break}return i(T)}return E.toString=function(){return d+""},E}function f(d,h){var p=Math.max(-8,Math.min(8,Math.floor($i(h)/3)))*3,g=Math.pow(10,-p),y=u((d=Ds(d),d.type="f",d),{suffix:ub[8+p/3]});return function(b){return y(g*b)}}return{format:u,formatPrefix:f}}var Jl,jy,M_;H9({thousands:",",grouping:[3],currency:["$",""]});function H9(e){return Jl=U9(e),jy=Jl.format,M_=Jl.formatPrefix,Jl}function K9(e){return Math.max(0,-$i(Math.abs(e)))}function V9(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor($i(t)/3)))*3-$i(Math.abs(e)))}function G9(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,$i(t)-$i(e))+1}function I_(e,t,r,n){var a=Hp(e,t,r),i;switch(n=Ds(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=V9(a,s))&&(n.precision=i),M_(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=G9(a,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=K9(a))&&(n.precision=i-(n.type==="%")*2);break}}return jy(n)}function Un(e){var t=e.domain;return e.ticks=function(r){var n=t();return Wp(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var a=t();return I_(a[0],a[a.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),a=0,i=n.length-1,s=n[a],l=n[i],c,u,f=10;for(l<s&&(u=s,s=l,l=u,u=a,a=i,i=u);f-- >0;){if(u=Up(s,l,r),u===c)return n[a]=s,n[i]=l,t(n);if(u>0)s=Math.floor(s/u)*u,l=Math.ceil(l/u)*u;else if(u<0)s=Math.ceil(s*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function xu(){var e=xy();return e.copy=function(){return xl(e,xu())},ir.apply(e,arguments),Un(e)}function L_(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,vu),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return L_(e).unknown(t)},e=arguments.length?Array.from(e,vu):[0,1],Un(r)}function D_(e,t){e=e.slice();var r=0,n=e.length-1,a=e[r],i=e[n],s;return i<a&&(s=r,r=n,n=s,s=a,a=i,i=s),e[r]=t.floor(a),e[n]=t.ceil(i),e}function db(e){return Math.log(e)}function fb(e){return Math.exp(e)}function Y9(e){return-Math.log(-e)}function q9(e){return-Math.exp(-e)}function X9(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Q9(e){return e===10?X9:e===Math.E?Math.exp:t=>Math.pow(e,t)}function J9(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 hb(e){return(t,r)=>-e(-t,r)}function wy(e){const t=e(db,fb),r=t.domain;let n=10,a,i;function s(){return a=J9(n),i=Q9(n),r()[0]<0?(a=hb(a),i=hb(i),e(Y9,q9)):e(db,fb),t}return t.base=function(l){return arguments.length?(n=+l,s()):n},t.domain=function(l){return arguments.length?(r(l),s()):r()},t.ticks=l=>{const c=r();let u=c[0],f=c[c.length-1];const d=f<u;d&&([u,f]=[f,u]);let h=a(u),p=a(f),g,y;const b=l==null?10:+l;let v=[];if(!(n%1)&&p-h<b){if(h=Math.floor(h),p=Math.ceil(p),u>0){for(;h<=p;++h)for(g=1;g<n;++g)if(y=h<0?g/i(-h):g*i(h),!(y<u)){if(y>f)break;v.push(y)}}else for(;h<=p;++h)for(g=n-1;g>=1;--g)if(y=h>0?g/i(-h):g*i(h),!(y<u)){if(y>f)break;v.push(y)}v.length*2<b&&(v=Wp(u,f,b))}else v=Wp(h,p,Math.min(p-h,b)).map(i);return d?v.reverse():v},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=Ds(c)).precision==null&&(c.trim=!0),c=jy(c)),l===1/0)return c;const u=Math.max(1,n*l/t.ticks().length);return f=>{let d=f/i(Math.round(a(f)));return d*n<n-.5&&(d*=n),d<=u?c(f):""}},t.nice=()=>r(D_(r(),{floor:l=>i(Math.floor(a(l))),ceil:l=>i(Math.ceil(a(l)))})),t}function R_(){const e=wy(Wd()).domain([1,10]);return e.copy=()=>xl(e,R_()).base(e.base()),ir.apply(e,arguments),e}function pb(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function mb(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Sy(e){var t=1,r=e(pb(t),mb(t));return r.constant=function(n){return arguments.length?e(pb(t=+n),mb(t)):t},Un(r)}function B_(){var e=Sy(Wd());return e.copy=function(){return xl(e,B_()).constant(e.constant())},ir.apply(e,arguments)}function vb(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Z9(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function e7(e){return e<0?-e*e:e*e}function _y(e){var t=e(bt,bt),r=1;function n(){return r===1?e(bt,bt):r===.5?e(Z9,e7):e(vb(r),vb(1/r))}return t.exponent=function(a){return arguments.length?(r=+a,n()):r},Un(t)}function ky(){var e=_y(Wd());return e.copy=function(){return xl(e,ky()).exponent(e.exponent())},ir.apply(e,arguments),e}function t7(){return ky.apply(null,arguments).exponent(.5)}function yb(e){return Math.sign(e)*e*e}function r7(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function F_(){var e=xy(),t=[0,1],r=!1,n;function a(i){var s=r7(e(i));return isNaN(s)?n:r?Math.round(s):s}return a.invert=function(i){return e.invert(yb(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,vu)).map(yb)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(r=!!i,a):r},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return F_(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},ir.apply(a,arguments),Un(a)}function z_(){var e=[],t=[],r=[],n;function a(){var s=0,l=Math.max(1,t.length);for(r=new Array(l-1);++s<l;)r[s-1]=s9(e,s/l);return i}function i(s){return s==null||isNaN(s=+s)?n:t[yl(r,s)]}return i.invertExtent=function(s){var l=t.indexOf(s);return l<0?[NaN,NaN]:[l>0?r[l-1]:e[0],l<r.length?r[l]:e[e.length-1]]},i.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let l of s)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Mn),a()},i.range=function(s){return arguments.length?(t=Array.from(s),a()):t.slice()},i.unknown=function(s){return arguments.length?(n=s,i):n},i.quantiles=function(){return r.slice()},i.copy=function(){return z_().domain(e).range(t).unknown(n)},ir.apply(i,arguments)}function W_(){var e=0,t=1,r=1,n=[.5],a=[0,1],i;function s(c){return c!=null&&c<=c?a[yl(n,c,0,r)]:i}function l(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*t-(c-r)*e)/(r+1);return s}return s.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},s.range=function(c){return arguments.length?(r=(a=Array.from(c)).length-1,l()):a.slice()},s.invertExtent=function(c){var u=a.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,n[0]]:u>=r?[n[r-1],t]:[n[u-1],n[u]]},s.unknown=function(c){return arguments.length&&(i=c),s},s.thresholds=function(){return n.slice()},s.copy=function(){return W_().domain([e,t]).range(a).unknown(i)},ir.apply(Un(s),arguments)}function U_(){var e=[.5],t=[0,1],r,n=1;function a(i){return i!=null&&i<=i?t[yl(e,i,0,n)]:r}return a.domain=function(i){return arguments.length?(e=Array.from(i),n=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),n=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var s=t.indexOf(i);return[e[s-1],e[s]]},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return U_().domain(e).range(t).unknown(r)},ir.apply(a,arguments)}const th=new Date,rh=new Date;function Xe(e,t,r,n){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const s=a(i),l=a.ceil(i);return i-s<l-i?s:l},a.offset=(i,s)=>(t(i=new Date(+i),s==null?1:Math.floor(s)),i),a.range=(i,s,l)=>{const c=[];if(i=a.ceil(i),l=l==null?1:Math.floor(l),!(i<s)||!(l>0))return c;let u;do c.push(u=new Date(+i)),t(i,l),e(i);while(u<i&&i<s);return c},a.filter=i=>Xe(s=>{if(s>=s)for(;e(s),!i(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;t(s,-1),!i(s););else for(;--l>=0;)for(;t(s,1),!i(s););}),r&&(a.count=(i,s)=>(th.setTime(+i),rh.setTime(+s),e(th),e(rh),Math.floor(r(th,rh))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(n?s=>n(s)%i===0:s=>a.count(0,s)%i===0):a)),a}const bu=Xe(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);bu.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Xe(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):bu);bu.range;const Hr=1e3,Qt=Hr*60,Kr=Qt*60,tn=Kr*24,Oy=tn*7,gb=tn*30,nh=tn*365,la=Xe(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Hr)},(e,t)=>(t-e)/Hr,e=>e.getUTCSeconds());la.range;const Ny=Xe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Hr)},(e,t)=>{e.setTime(+e+t*Qt)},(e,t)=>(t-e)/Qt,e=>e.getMinutes());Ny.range;const Py=Xe(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Qt)},(e,t)=>(t-e)/Qt,e=>e.getUTCMinutes());Py.range;const Ay=Xe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Hr-e.getMinutes()*Qt)},(e,t)=>{e.setTime(+e+t*Kr)},(e,t)=>(t-e)/Kr,e=>e.getHours());Ay.range;const Cy=Xe(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Kr)},(e,t)=>(t-e)/Kr,e=>e.getUTCHours());Cy.range;const bl=Xe(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Qt)/tn,e=>e.getDate()-1);bl.range;const Ud=Xe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/tn,e=>e.getUTCDate()-1);Ud.range;const H_=Xe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/tn,e=>Math.floor(e/tn));H_.range;function $a(e){return Xe(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Qt)/Oy)}const Hd=$a(0),ju=$a(1),n7=$a(2),a7=$a(3),Ti=$a(4),i7=$a(5),o7=$a(6);Hd.range;ju.range;n7.range;a7.range;Ti.range;i7.range;o7.range;function Ta(e){return Xe(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/Oy)}const Kd=Ta(0),wu=Ta(1),s7=Ta(2),l7=Ta(3),Mi=Ta(4),c7=Ta(5),u7=Ta(6);Kd.range;wu.range;s7.range;l7.range;Mi.range;c7.range;u7.range;const Ey=Xe(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());Ey.range;const $y=Xe(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());$y.range;const rn=Xe(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());rn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Xe(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});rn.range;const nn=Xe(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());nn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Xe(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});nn.range;function K_(e,t,r,n,a,i){const s=[[la,1,Hr],[la,5,5*Hr],[la,15,15*Hr],[la,30,30*Hr],[i,1,Qt],[i,5,5*Qt],[i,15,15*Qt],[i,30,30*Qt],[a,1,Kr],[a,3,3*Kr],[a,6,6*Kr],[a,12,12*Kr],[n,1,tn],[n,2,2*tn],[r,1,Oy],[t,1,gb],[t,3,3*gb],[e,1,nh]];function l(u,f,d){const h=f<u;h&&([u,f]=[f,u]);const p=d&&typeof d.range=="function"?d:c(u,f,d),g=p?p.range(u,+f+1):[];return h?g.reverse():g}function c(u,f,d){const h=Math.abs(f-u)/d,p=py(([,,b])=>b).right(s,h);if(p===s.length)return e.every(Hp(u/nh,f/nh,d));if(p===0)return bu.every(Math.max(Hp(u,f,d),1));const[g,y]=s[h/s[p-1][2]<s[p][2]/h?p-1:p];return g.every(y)}return[l,c]}const[d7,f7]=K_(nn,$y,Kd,H_,Cy,Py),[h7,p7]=K_(rn,Ey,Hd,bl,Ay,Ny);function ah(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function ih(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Co(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function m7(e){var t=e.dateTime,r=e.date,n=e.time,a=e.periods,i=e.days,s=e.shortDays,l=e.months,c=e.shortMonths,u=Eo(a),f=$o(a),d=Eo(i),h=$o(i),p=Eo(s),g=$o(s),y=Eo(l),b=$o(l),v=Eo(c),m=$o(c),x={a:M,A:I,b:R,B:F,c:null,d:_b,e:_b,f:R7,g:Y7,G:X7,H:I7,I:L7,j:D7,L:V_,m:B7,M:F7,p:K,q:z,Q:Nb,s:Pb,S:z7,u:W7,U:U7,V:H7,w:K7,W:V7,x:null,X:null,y:G7,Y:q7,Z:Q7,"%":Ob},S={a:q,A:ie,b:he,B:ge,c:null,d:kb,e:kb,f:tz,g:dz,G:hz,H:J7,I:Z7,j:ez,L:Y_,m:rz,M:nz,p:Qe,q:Ae,Q:Nb,s:Pb,S:az,u:iz,U:oz,V:sz,w:lz,W:cz,x:null,X:null,y:uz,Y:fz,Z:pz,"%":Ob},j={a:k,A:E,b:T,B:D,c:A,d:wb,e:wb,f:E7,g:jb,G:bb,H:Sb,I:Sb,j:N7,L:C7,m:O7,M:P7,p:N,q:k7,Q:T7,s:M7,S:A7,u:b7,U:j7,V:w7,w:x7,W:S7,x:L,X:C,y:jb,Y:bb,Z:_7,"%":$7};x.x=w(r,x),x.X=w(n,x),x.c=w(t,x),S.x=w(r,S),S.X=w(n,S),S.c=w(t,S);function w(V,Z){return function(re){var W=[],Te=-1,oe=0,We=V.length,Ue,_t,cn;for(re instanceof Date||(re=new Date(+re));++Te<We;)V.charCodeAt(Te)===37&&(W.push(V.slice(oe,Te)),(_t=xb[Ue=V.charAt(++Te)])!=null?Ue=V.charAt(++Te):_t=Ue==="e"?" ":"0",(cn=Z[Ue])&&(Ue=cn(re,_t)),W.push(Ue),oe=Te+1);return W.push(V.slice(oe,Te)),W.join("")}}function _(V,Z){return function(re){var W=Co(1900,void 0,1),Te=O(W,V,re+="",0),oe,We;if(Te!=re.length)return null;if("Q"in W)return new Date(W.Q);if("s"in W)return new Date(W.s*1e3+("L"in W?W.L:0));if(Z&&!("Z"in W)&&(W.Z=0),"p"in W&&(W.H=W.H%12+W.p*12),W.m===void 0&&(W.m="q"in W?W.q:0),"V"in W){if(W.V<1||W.V>53)return null;"w"in W||(W.w=1),"Z"in W?(oe=ih(Co(W.y,0,1)),We=oe.getUTCDay(),oe=We>4||We===0?wu.ceil(oe):wu(oe),oe=Ud.offset(oe,(W.V-1)*7),W.y=oe.getUTCFullYear(),W.m=oe.getUTCMonth(),W.d=oe.getUTCDate()+(W.w+6)%7):(oe=ah(Co(W.y,0,1)),We=oe.getDay(),oe=We>4||We===0?ju.ceil(oe):ju(oe),oe=bl.offset(oe,(W.V-1)*7),W.y=oe.getFullYear(),W.m=oe.getMonth(),W.d=oe.getDate()+(W.w+6)%7)}else("W"in W||"U"in W)&&("w"in W||(W.w="u"in W?W.u%7:"W"in W?1:0),We="Z"in W?ih(Co(W.y,0,1)).getUTCDay():ah(Co(W.y,0,1)).getDay(),W.m=0,W.d="W"in W?(W.w+6)%7+W.W*7-(We+5)%7:W.w+W.U*7-(We+6)%7);return"Z"in W?(W.H+=W.Z/100|0,W.M+=W.Z%100,ih(W)):ah(W)}}function O(V,Z,re,W){for(var Te=0,oe=Z.length,We=re.length,Ue,_t;Te<oe;){if(W>=We)return-1;if(Ue=Z.charCodeAt(Te++),Ue===37){if(Ue=Z.charAt(Te++),_t=j[Ue in xb?Z.charAt(Te++):Ue],!_t||(W=_t(V,re,W))<0)return-1}else if(Ue!=re.charCodeAt(W++))return-1}return W}function N(V,Z,re){var W=u.exec(Z.slice(re));return W?(V.p=f.get(W[0].toLowerCase()),re+W[0].length):-1}function k(V,Z,re){var W=p.exec(Z.slice(re));return W?(V.w=g.get(W[0].toLowerCase()),re+W[0].length):-1}function E(V,Z,re){var W=d.exec(Z.slice(re));return W?(V.w=h.get(W[0].toLowerCase()),re+W[0].length):-1}function T(V,Z,re){var W=v.exec(Z.slice(re));return W?(V.m=m.get(W[0].toLowerCase()),re+W[0].length):-1}function D(V,Z,re){var W=y.exec(Z.slice(re));return W?(V.m=b.get(W[0].toLowerCase()),re+W[0].length):-1}function A(V,Z,re){return O(V,t,Z,re)}function L(V,Z,re){return O(V,r,Z,re)}function C(V,Z,re){return O(V,n,Z,re)}function M(V){return s[V.getDay()]}function I(V){return i[V.getDay()]}function R(V){return c[V.getMonth()]}function F(V){return l[V.getMonth()]}function K(V){return a[+(V.getHours()>=12)]}function z(V){return 1+~~(V.getMonth()/3)}function q(V){return s[V.getUTCDay()]}function ie(V){return i[V.getUTCDay()]}function he(V){return c[V.getUTCMonth()]}function ge(V){return l[V.getUTCMonth()]}function Qe(V){return a[+(V.getUTCHours()>=12)]}function Ae(V){return 1+~~(V.getUTCMonth()/3)}return{format:function(V){var Z=w(V+="",x);return Z.toString=function(){return V},Z},parse:function(V){var Z=_(V+="",!1);return Z.toString=function(){return V},Z},utcFormat:function(V){var Z=w(V+="",S);return Z.toString=function(){return V},Z},utcParse:function(V){var Z=_(V+="",!0);return Z.toString=function(){return V},Z}}}var xb={"-":"",_:" ",0:"0"},at=/^\s*\d+/,v7=/^%/,y7=/[\\^$*+?|[\]().{}]/g;function le(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",i=a.length;return n+(i<r?new Array(r-i+1).join(t)+a:a)}function g7(e){return e.replace(y7,"\\$&")}function Eo(e){return new RegExp("^(?:"+e.map(g7).join("|")+")","i")}function $o(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function x7(e,t,r){var n=at.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function b7(e,t,r){var n=at.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function j7(e,t,r){var n=at.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function w7(e,t,r){var n=at.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function S7(e,t,r){var n=at.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function bb(e,t,r){var n=at.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function jb(e,t,r){var n=at.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function _7(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function k7(e,t,r){var n=at.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function O7(e,t,r){var n=at.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function wb(e,t,r){var n=at.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function N7(e,t,r){var n=at.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function Sb(e,t,r){var n=at.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function P7(e,t,r){var n=at.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function A7(e,t,r){var n=at.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function C7(e,t,r){var n=at.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function E7(e,t,r){var n=at.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function $7(e,t,r){var n=v7.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function T7(e,t,r){var n=at.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function M7(e,t,r){var n=at.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function _b(e,t){return le(e.getDate(),t,2)}function I7(e,t){return le(e.getHours(),t,2)}function L7(e,t){return le(e.getHours()%12||12,t,2)}function D7(e,t){return le(1+bl.count(rn(e),e),t,3)}function V_(e,t){return le(e.getMilliseconds(),t,3)}function R7(e,t){return V_(e,t)+"000"}function B7(e,t){return le(e.getMonth()+1,t,2)}function F7(e,t){return le(e.getMinutes(),t,2)}function z7(e,t){return le(e.getSeconds(),t,2)}function W7(e){var t=e.getDay();return t===0?7:t}function U7(e,t){return le(Hd.count(rn(e)-1,e),t,2)}function G_(e){var t=e.getDay();return t>=4||t===0?Ti(e):Ti.ceil(e)}function H7(e,t){return e=G_(e),le(Ti.count(rn(e),e)+(rn(e).getDay()===4),t,2)}function K7(e){return e.getDay()}function V7(e,t){return le(ju.count(rn(e)-1,e),t,2)}function G7(e,t){return le(e.getFullYear()%100,t,2)}function Y7(e,t){return e=G_(e),le(e.getFullYear()%100,t,2)}function q7(e,t){return le(e.getFullYear()%1e4,t,4)}function X7(e,t){var r=e.getDay();return e=r>=4||r===0?Ti(e):Ti.ceil(e),le(e.getFullYear()%1e4,t,4)}function Q7(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+le(t/60|0,"0",2)+le(t%60,"0",2)}function kb(e,t){return le(e.getUTCDate(),t,2)}function J7(e,t){return le(e.getUTCHours(),t,2)}function Z7(e,t){return le(e.getUTCHours()%12||12,t,2)}function ez(e,t){return le(1+Ud.count(nn(e),e),t,3)}function Y_(e,t){return le(e.getUTCMilliseconds(),t,3)}function tz(e,t){return Y_(e,t)+"000"}function rz(e,t){return le(e.getUTCMonth()+1,t,2)}function nz(e,t){return le(e.getUTCMinutes(),t,2)}function az(e,t){return le(e.getUTCSeconds(),t,2)}function iz(e){var t=e.getUTCDay();return t===0?7:t}function oz(e,t){return le(Kd.count(nn(e)-1,e),t,2)}function q_(e){var t=e.getUTCDay();return t>=4||t===0?Mi(e):Mi.ceil(e)}function sz(e,t){return e=q_(e),le(Mi.count(nn(e),e)+(nn(e).getUTCDay()===4),t,2)}function lz(e){return e.getUTCDay()}function cz(e,t){return le(wu.count(nn(e)-1,e),t,2)}function uz(e,t){return le(e.getUTCFullYear()%100,t,2)}function dz(e,t){return e=q_(e),le(e.getUTCFullYear()%100,t,2)}function fz(e,t){return le(e.getUTCFullYear()%1e4,t,4)}function hz(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Mi(e):Mi.ceil(e),le(e.getUTCFullYear()%1e4,t,4)}function pz(){return"+0000"}function Ob(){return"%"}function Nb(e){return+e}function Pb(e){return Math.floor(+e/1e3)}var Ba,X_,Q_;mz({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 mz(e){return Ba=m7(e),X_=Ba.format,Ba.parse,Q_=Ba.utcFormat,Ba.utcParse,Ba}function vz(e){return new Date(e)}function yz(e){return e instanceof Date?+e:+new Date(+e)}function Ty(e,t,r,n,a,i,s,l,c,u){var f=xy(),d=f.invert,h=f.domain,p=u(".%L"),g=u(":%S"),y=u("%I:%M"),b=u("%I %p"),v=u("%a %d"),m=u("%b %d"),x=u("%B"),S=u("%Y");function j(w){return(c(w)<w?p:l(w)<w?g:s(w)<w?y:i(w)<w?b:n(w)<w?a(w)<w?v:m:r(w)<w?x:S)(w)}return f.invert=function(w){return new Date(d(w))},f.domain=function(w){return arguments.length?h(Array.from(w,yz)):h().map(vz)},f.ticks=function(w){var _=h();return e(_[0],_[_.length-1],w??10)},f.tickFormat=function(w,_){return _==null?j:u(_)},f.nice=function(w){var _=h();return(!w||typeof w.range!="function")&&(w=t(_[0],_[_.length-1],w??10)),w?h(D_(_,w)):f},f.copy=function(){return xl(f,Ty(e,t,r,n,a,i,s,l,c,u))},f}function gz(){return ir.apply(Ty(h7,p7,rn,Ey,Hd,bl,Ay,Ny,la,X_).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function xz(){return ir.apply(Ty(d7,f7,nn,$y,Kd,Ud,Cy,Py,la,Q_).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Vd(){var e=0,t=1,r,n,a,i,s=bt,l=!1,c;function u(d){return d==null||isNaN(d=+d)?c:s(a===0?.5:(d=(i(d)-r)*a,l?Math.max(0,Math.min(1,d)):d))}u.domain=function(d){return arguments.length?([e,t]=d,r=i(e=+e),n=i(t=+t),a=r===n?0:1/(n-r),u):[e,t]},u.clamp=function(d){return arguments.length?(l=!!d,u):l},u.interpolator=function(d){return arguments.length?(s=d,u):s};function f(d){return function(h){var p,g;return arguments.length?([p,g]=h,s=d(p,g),u):[s(0),s(1)]}}return u.range=f(mo),u.rangeRound=f(gy),u.unknown=function(d){return arguments.length?(c=d,u):c},function(d){return i=d,r=d(e),n=d(t),a=r===n?0:1/(n-r),u}}function Hn(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function J_(){var e=Un(Vd()(bt));return e.copy=function(){return Hn(e,J_())},ln.apply(e,arguments)}function Z_(){var e=wy(Vd()).domain([1,10]);return e.copy=function(){return Hn(e,Z_()).base(e.base())},ln.apply(e,arguments)}function ek(){var e=Sy(Vd());return e.copy=function(){return Hn(e,ek()).constant(e.constant())},ln.apply(e,arguments)}function My(){var e=_y(Vd());return e.copy=function(){return Hn(e,My()).exponent(e.exponent())},ln.apply(e,arguments)}function bz(){return My.apply(null,arguments).exponent(.5)}function tk(){var e=[],t=bt;function r(n){if(n!=null&&!isNaN(n=+n))return t((yl(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let a of n)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(Mn),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,a)=>t(a/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(a,i)=>o9(e,i/n))},r.copy=function(){return tk(t).domain(e)},ln.apply(r,arguments)}function Gd(){var e=0,t=.5,r=1,n=1,a,i,s,l,c,u=bt,f,d=!1,h;function p(y){return isNaN(y=+y)?h:(y=.5+((y=+f(y))-i)*(n*y<n*i?l:c),u(d?Math.max(0,Math.min(1,y)):y))}p.domain=function(y){return arguments.length?([e,t,r]=y,a=f(e=+e),i=f(t=+t),s=f(r=+r),l=a===i?0:.5/(i-a),c=i===s?0:.5/(s-i),n=i<a?-1:1,p):[e,t,r]},p.clamp=function(y){return arguments.length?(d=!!y,p):d},p.interpolator=function(y){return arguments.length?(u=y,p):u};function g(y){return function(b){var v,m,x;return arguments.length?([v,m,x]=b,u=$9(y,[v,m,x]),p):[u(0),u(.5),u(1)]}}return p.range=g(mo),p.rangeRound=g(gy),p.unknown=function(y){return arguments.length?(h=y,p):h},function(y){return f=y,a=y(e),i=y(t),s=y(r),l=a===i?0:.5/(i-a),c=i===s?0:.5/(s-i),n=i<a?-1:1,p}}function rk(){var e=Un(Gd()(bt));return e.copy=function(){return Hn(e,rk())},ln.apply(e,arguments)}function nk(){var e=wy(Gd()).domain([.1,1,10]);return e.copy=function(){return Hn(e,nk()).base(e.base())},ln.apply(e,arguments)}function ak(){var e=Sy(Gd());return e.copy=function(){return Hn(e,ak()).constant(e.constant())},ln.apply(e,arguments)}function Iy(){var e=_y(Gd());return e.copy=function(){return Hn(e,Iy()).exponent(e.exponent())},ln.apply(e,arguments)}function jz(){return Iy.apply(null,arguments).exponent(.5)}const Ab=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Ts,scaleDiverging:rk,scaleDivergingLog:nk,scaleDivergingPow:Iy,scaleDivergingSqrt:jz,scaleDivergingSymlog:ak,scaleIdentity:L_,scaleImplicit:Kp,scaleLinear:xu,scaleLog:R_,scaleOrdinal:my,scalePoint:rs,scalePow:ky,scaleQuantile:z_,scaleQuantize:W_,scaleRadial:F_,scaleSequential:J_,scaleSequentialLog:Z_,scaleSequentialPow:My,scaleSequentialQuantile:tk,scaleSequentialSqrt:bz,scaleSequentialSymlog:ek,scaleSqrt:t7,scaleSymlog:B_,scaleThreshold:U_,scaleTime:gz,scaleUtc:xz,tickFormat:I_},Symbol.toStringTag,{value:"Module"}));var wz=ao;function Sz(e,t,r){for(var n=-1,a=e.length;++n<a;){var i=e[n],s=t(i);if(s!=null&&(l===void 0?s===s&&!wz(s):r(s,l)))var l=s,c=i}return c}var Yd=Sz;function _z(e,t){return e>t}var ik=_z,kz=Yd,Oz=ik,Nz=po;function Pz(e){return e&&e.length?kz(e,Nz,Oz):void 0}var Az=Pz;const wn=de(Az);function Cz(e,t){return e<t}var ok=Cz,Ez=Yd,$z=ok,Tz=po;function Mz(e){return e&&e.length?Ez(e,Tz,$z):void 0}var Iz=Mz;const qd=de(Iz);var Lz=qv,Dz=Ir,Rz=m_,Bz=$t;function Fz(e,t){var r=Bz(e)?Lz:Rz;return r(e,Dz(t))}var zz=Fz,Wz=h_,Uz=zz;function Hz(e,t){return Wz(Uz(e,t),1)}var Kz=Hz;const Vz=de(Kz);var Gz=uy;function Yz(e,t){return Gz(e,t)}var qz=Yz;const _a=de(qz);var vo=1e9,Xz={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Dy,Pe=!0,rr="[DecimalError] ",ma=rr+"Invalid argument: ",Ly=rr+"Exponent out of range: ",yo=Math.floor,ta=Math.pow,Qz=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Lt,Ze=1e7,_e=7,sk=9007199254740991,Su=yo(sk/_e),Y={};Y.absoluteValue=Y.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Y.comparedTo=Y.cmp=function(e){var t,r,n,a,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(n=i.d.length,a=e.d.length,t=0,r=n<a?n:a;t<r;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return n===a?0:n>a^i.s<0?1:-1};Y.decimalPlaces=Y.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*_e;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};Y.dividedBy=Y.div=function(e){return qr(this,new this.constructor(e))};Y.dividedToIntegerBy=Y.idiv=function(e){var t=this,r=t.constructor;return ve(qr(t,new r(e),0,1),r.precision)};Y.equals=Y.eq=function(e){return!this.cmp(e)};Y.exponent=function(){return ze(this)};Y.greaterThan=Y.gt=function(e){return this.cmp(e)>0};Y.greaterThanOrEqualTo=Y.gte=function(e){return this.cmp(e)>=0};Y.isInteger=Y.isint=function(){return this.e>this.d.length-2};Y.isNegative=Y.isneg=function(){return this.s<0};Y.isPositive=Y.ispos=function(){return this.s>0};Y.isZero=function(){return this.s===0};Y.lessThan=Y.lt=function(e){return this.cmp(e)<0};Y.lessThanOrEqualTo=Y.lte=function(e){return this.cmp(e)<1};Y.logarithm=Y.log=function(e){var t,r=this,n=r.constructor,a=n.precision,i=a+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Lt))throw Error(rr+"NaN");if(r.s<1)throw Error(rr+(r.s?"NaN":"-Infinity"));return r.eq(Lt)?new n(0):(Pe=!1,t=qr(Rs(r,i),Rs(e,i),i),Pe=!0,ve(t,a))};Y.minus=Y.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?uk(t,e):lk(t,(e.s=-e.s,e))};Y.modulo=Y.mod=function(e){var t,r=this,n=r.constructor,a=n.precision;if(e=new n(e),!e.s)throw Error(rr+"NaN");return r.s?(Pe=!1,t=qr(r,e,0,1).times(e),Pe=!0,r.minus(t)):ve(new n(r),a)};Y.naturalExponential=Y.exp=function(){return ck(this)};Y.naturalLogarithm=Y.ln=function(){return Rs(this)};Y.negated=Y.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Y.plus=Y.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?lk(t,e):uk(t,(e.s=-e.s,e))};Y.precision=Y.sd=function(e){var t,r,n,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ma+e);if(t=ze(a)+1,n=a.d.length-1,r=n*_e+1,n=a.d[n],n){for(;n%10==0;n/=10)r--;for(n=a.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};Y.squareRoot=Y.sqrt=function(){var e,t,r,n,a,i,s,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(rr+"NaN")}for(e=ze(l),Pe=!1,a=Math.sqrt(+l),a==0||a==1/0?(t=Or(l.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=yo((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(a.toString()),r=c.precision,a=s=r+3;;)if(i=n,n=i.plus(qr(l,i,s+2)).times(.5),Or(i.d).slice(0,s)===(t=Or(n.d)).slice(0,s)){if(t=t.slice(s-3,s+1),a==s&&t=="4999"){if(ve(i,r+1,0),i.times(i).eq(l)){n=i;break}}else if(t!="9999")break;s+=4}return Pe=!0,ve(n,r)};Y.times=Y.mul=function(e){var t,r,n,a,i,s,l,c,u,f=this,d=f.constructor,h=f.d,p=(e=new d(e)).d;if(!f.s||!e.s)return new d(0);for(e.s*=f.s,r=f.e+e.e,c=h.length,u=p.length,c<u&&(i=h,h=p,p=i,s=c,c=u,u=s),i=[],s=c+u,n=s;n--;)i.push(0);for(n=u;--n>=0;){for(t=0,a=c+n;a>n;)l=i[a]+p[n]*h[a-n-1]+t,i[a--]=l%Ze|0,t=l/Ze|0;i[a]=(i[a]+t)%Ze|0}for(;!i[--s];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,Pe?ve(e,d.precision):e};Y.toDecimalPlaces=Y.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Tr(e,0,vo),t===void 0?t=n.rounding:Tr(t,0,8),ve(r,e+ze(r)+1,t))};Y.toExponential=function(e,t){var r,n=this,a=n.constructor;return e===void 0?r=ka(n,!0):(Tr(e,0,vo),t===void 0?t=a.rounding:Tr(t,0,8),n=ve(new a(n),e+1,t),r=ka(n,!0,e+1)),r};Y.toFixed=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?ka(a):(Tr(e,0,vo),t===void 0?t=i.rounding:Tr(t,0,8),n=ve(new i(a),e+ze(a)+1,t),r=ka(n.abs(),!1,e+ze(n)+1),a.isneg()&&!a.isZero()?"-"+r:r)};Y.toInteger=Y.toint=function(){var e=this,t=e.constructor;return ve(new t(e),ze(e)+1,t.rounding)};Y.toNumber=function(){return+this};Y.toPower=Y.pow=function(e){var t,r,n,a,i,s,l=this,c=l.constructor,u=12,f=+(e=new c(e));if(!e.s)return new c(Lt);if(l=new c(l),!l.s){if(e.s<1)throw Error(rr+"Infinity");return l}if(l.eq(Lt))return l;if(n=c.precision,e.eq(Lt))return ve(l,n);if(t=e.e,r=e.d.length-1,s=t>=r,i=l.s,s){if((r=f<0?-f:f)<=sk){for(a=new c(Lt),t=Math.ceil(n/_e+4),Pe=!1;r%2&&(a=a.times(l),Eb(a.d,t)),r=yo(r/2),r!==0;)l=l.times(l),Eb(l.d,t);return Pe=!0,e.s<0?new c(Lt).div(a):ve(a,n)}}else if(i<0)throw Error(rr+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,Pe=!1,a=e.times(Rs(l,n+u)),Pe=!0,a=ck(a),a.s=i,a};Y.toPrecision=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?(r=ze(a),n=ka(a,r<=i.toExpNeg||r>=i.toExpPos)):(Tr(e,1,vo),t===void 0?t=i.rounding:Tr(t,0,8),a=ve(new i(a),e,t),r=ze(a),n=ka(a,e<=r||r<=i.toExpNeg,e)),n};Y.toSignificantDigits=Y.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Tr(e,1,vo),t===void 0?t=n.rounding:Tr(t,0,8)),ve(new n(r),e,t)};Y.toString=Y.valueOf=Y.val=Y.toJSON=Y[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=ze(e),r=e.constructor;return ka(e,t<=r.toExpNeg||t>=r.toExpPos)};function lk(e,t){var r,n,a,i,s,l,c,u,f=e.constructor,d=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),Pe?ve(t,d):t;if(c=e.d,u=t.d,s=e.e,a=t.e,c=c.slice(),i=s-a,i){for(i<0?(n=c,i=-i,l=u.length):(n=u,a=s,l=c.length),s=Math.ceil(d/_e),l=s>l?s+1:l+1,i>l&&(i=l,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(l=c.length,i=u.length,l-i<0&&(i=l,n=u,u=c,c=n),r=0;i;)r=(c[--i]=c[i]+u[i]+r)/Ze|0,c[i]%=Ze;for(r&&(c.unshift(r),++a),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=a,Pe?ve(t,d):t}function Tr(e,t,r){if(e!==~~e||e<t||e>r)throw Error(ma+e)}function Or(e){var t,r,n,a=e.length-1,i="",s=e[0];if(a>0){for(i+=s,t=1;t<a;t++)n=e[t]+"",r=_e-n.length,r&&(i+=mn(r)),i+=n;s=e[t],n=s+"",r=_e-n.length,r&&(i+=mn(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return i+s}var qr=function(){function e(n,a){var i,s=0,l=n.length;for(n=n.slice();l--;)i=n[l]*a+s,n[l]=i%Ze|0,s=i/Ze|0;return s&&n.unshift(s),n}function t(n,a,i,s){var l,c;if(i!=s)c=i>s?1:-1;else for(l=c=0;l<i;l++)if(n[l]!=a[l]){c=n[l]>a[l]?1:-1;break}return c}function r(n,a,i){for(var s=0;i--;)n[i]-=s,s=n[i]<a[i]?1:0,n[i]=s*Ze+n[i]-a[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,a,i,s){var l,c,u,f,d,h,p,g,y,b,v,m,x,S,j,w,_,O,N=n.constructor,k=n.s==a.s?1:-1,E=n.d,T=a.d;if(!n.s)return new N(n);if(!a.s)throw Error(rr+"Division by zero");for(c=n.e-a.e,_=T.length,j=E.length,p=new N(k),g=p.d=[],u=0;T[u]==(E[u]||0);)++u;if(T[u]>(E[u]||0)&&--c,i==null?m=i=N.precision:s?m=i+(ze(n)-ze(a))+1:m=i,m<0)return new N(0);if(m=m/_e+2|0,u=0,_==1)for(f=0,T=T[0],m++;(u<j||f)&&m--;u++)x=f*Ze+(E[u]||0),g[u]=x/T|0,f=x%T|0;else{for(f=Ze/(T[0]+1)|0,f>1&&(T=e(T,f),E=e(E,f),_=T.length,j=E.length),S=_,y=E.slice(0,_),b=y.length;b<_;)y[b++]=0;O=T.slice(),O.unshift(0),w=T[0],T[1]>=Ze/2&&++w;do f=0,l=t(T,y,_,b),l<0?(v=y[0],_!=b&&(v=v*Ze+(y[1]||0)),f=v/w|0,f>1?(f>=Ze&&(f=Ze-1),d=e(T,f),h=d.length,b=y.length,l=t(d,y,h,b),l==1&&(f--,r(d,_<h?O:T,h))):(f==0&&(l=f=1),d=T.slice()),h=d.length,h<b&&d.unshift(0),r(y,d,b),l==-1&&(b=y.length,l=t(T,y,_,b),l<1&&(f++,r(y,_<b?O:T,b))),b=y.length):l===0&&(f++,y=[0]),g[u++]=f,l&&y[0]?y[b++]=E[S]||0:(y=[E[S]],b=1);while((S++<j||y[0]!==void 0)&&m--)}return g[0]||g.shift(),p.e=c,ve(p,s?i+ze(p)+1:i)}}();function ck(e,t){var r,n,a,i,s,l,c=0,u=0,f=e.constructor,d=f.precision;if(ze(e)>16)throw Error(Ly+ze(e));if(!e.s)return new f(Lt);for(Pe=!1,l=d,s=new f(.03125);e.abs().gte(.1);)e=e.times(s),u+=5;for(n=Math.log(ta(2,u))/Math.LN10*2+5|0,l+=n,r=a=i=new f(Lt),f.precision=l;;){if(a=ve(a.times(e),l),r=r.times(++c),s=i.plus(qr(a,r,l)),Or(s.d).slice(0,l)===Or(i.d).slice(0,l)){for(;u--;)i=ve(i.times(i),l);return f.precision=d,t==null?(Pe=!0,ve(i,d)):i}i=s}}function ze(e){for(var t=e.e*_e,r=e.d[0];r>=10;r/=10)t++;return t}function oh(e,t,r){if(t>e.LN10.sd())throw Pe=!0,r&&(e.precision=r),Error(rr+"LN10 precision limit exceeded");return ve(new e(e.LN10),t)}function mn(e){for(var t="";e--;)t+="0";return t}function Rs(e,t){var r,n,a,i,s,l,c,u,f,d=1,h=10,p=e,g=p.d,y=p.constructor,b=y.precision;if(p.s<1)throw Error(rr+(p.s?"NaN":"-Infinity"));if(p.eq(Lt))return new y(0);if(t==null?(Pe=!1,u=b):u=t,p.eq(10))return t==null&&(Pe=!0),oh(y,u);if(u+=h,y.precision=u,r=Or(g),n=r.charAt(0),i=ze(p),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=Or(p.d),n=r.charAt(0),d++;i=ze(p),n>1?(p=new y("0."+r),i++):p=new y(n+"."+r.slice(1))}else return c=oh(y,u+2,b).times(i+""),p=Rs(new y(n+"."+r.slice(1)),u-h).plus(c),y.precision=b,t==null?(Pe=!0,ve(p,b)):p;for(l=s=p=qr(p.minus(Lt),p.plus(Lt),u),f=ve(p.times(p),u),a=3;;){if(s=ve(s.times(f),u),c=l.plus(qr(s,new y(a),u)),Or(c.d).slice(0,u)===Or(l.d).slice(0,u))return l=l.times(2),i!==0&&(l=l.plus(oh(y,u+2,b).times(i+""))),l=qr(l,new y(d),u),y.precision=b,t==null?(Pe=!0,ve(l,b)):l;l=c,a+=2}}function Cb(e,t){var r,n,a;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(n,a),t){if(a-=n,r=r-n-1,e.e=yo(r/_e),e.d=[],n=(r+1)%_e,r<0&&(n+=_e),n<a){for(n&&e.d.push(+t.slice(0,n)),a-=_e;n<a;)e.d.push(+t.slice(n,n+=_e));t=t.slice(n),n=_e-t.length}else n-=a;for(;n--;)t+="0";if(e.d.push(+t),Pe&&(e.e>Su||e.e<-Su))throw Error(Ly+r)}else e.s=0,e.e=0,e.d=[0];return e}function ve(e,t,r){var n,a,i,s,l,c,u,f,d=e.d;for(s=1,i=d[0];i>=10;i/=10)s++;if(n=t-s,n<0)n+=_e,a=t,u=d[f=0];else{if(f=Math.ceil((n+1)/_e),i=d.length,f>=i)return e;for(u=i=d[f],s=1;i>=10;i/=10)s++;n%=_e,a=n-_e+s}if(r!==void 0&&(i=ta(10,s-a-1),l=u/i%10|0,c=t<0||d[f+1]!==void 0||u%i,c=r<4?(l||c)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?a>0?u/ta(10,s-a):0:d[f-1])%10&1||r==(e.s<0?8:7))),t<1||!d[0])return c?(i=ze(e),d.length=1,t=t-i-1,d[0]=ta(10,(_e-t%_e)%_e),e.e=yo(-t/_e)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(n==0?(d.length=f,i=1,f--):(d.length=f+1,i=ta(10,_e-n),d[f]=a>0?(u/ta(10,s-a)%ta(10,a)|0)*i:0),c)for(;;)if(f==0){(d[0]+=i)==Ze&&(d[0]=1,++e.e);break}else{if(d[f]+=i,d[f]!=Ze)break;d[f--]=0,i=1}for(n=d.length;d[--n]===0;)d.pop();if(Pe&&(e.e>Su||e.e<-Su))throw Error(Ly+ze(e));return e}function uk(e,t){var r,n,a,i,s,l,c,u,f,d,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),Pe?ve(t,p):t;if(c=e.d,d=t.d,n=t.e,u=e.e,c=c.slice(),s=u-n,s){for(f=s<0,f?(r=c,s=-s,l=d.length):(r=d,n=u,l=c.length),a=Math.max(Math.ceil(p/_e),l)+2,s>a&&(s=a,r.length=1),r.reverse(),a=s;a--;)r.push(0);r.reverse()}else{for(a=c.length,l=d.length,f=a<l,f&&(l=a),a=0;a<l;a++)if(c[a]!=d[a]){f=c[a]<d[a];break}s=0}for(f&&(r=c,c=d,d=r,t.s=-t.s),l=c.length,a=d.length-l;a>0;--a)c[l++]=0;for(a=d.length;a>s;){if(c[--a]<d[a]){for(i=a;i&&c[--i]===0;)c[i]=Ze-1;--c[i],c[a]+=Ze}c[a]-=d[a]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,Pe?ve(t,p):t):new h(0)}function ka(e,t,r){var n,a=ze(e),i=Or(e.d),s=i.length;return t?(r&&(n=r-s)>0?i=i.charAt(0)+"."+i.slice(1)+mn(n):s>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+mn(-a-1)+i,r&&(n=r-s)>0&&(i+=mn(n))):a>=s?(i+=mn(a+1-s),r&&(n=r-a-1)>0&&(i=i+"."+mn(n))):((n=a+1)<s&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-s)>0&&(a+1===s&&(i+="."),i+=mn(n))),e.s<0?"-"+i:i}function Eb(e,t){if(e.length>t)return e.length=t,!0}function dk(e){var t,r,n;function a(i){var s=this;if(!(s instanceof a))return new a(i);if(s.constructor=a,i instanceof a){s.s=i.s,s.e=i.e,s.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(ma+i);if(i>0)s.s=1;else if(i<0)i=-i,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(i===~~i&&i<1e7){s.e=0,s.d=[i];return}return Cb(s,i.toString())}else if(typeof i!="string")throw Error(ma+i);if(i.charCodeAt(0)===45?(i=i.slice(1),s.s=-1):s.s=1,Qz.test(i))Cb(s,i);else throw Error(ma+i)}if(a.prototype=Y,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=dk,a.config=a.set=Jz,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return a.config(e),a}function Jz(e){if(!e||typeof e!="object")throw Error(rr+"Object expected");var t,r,n,a=["precision",1,vo,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<a.length;t+=3)if((n=e[r=a[t]])!==void 0)if(yo(n)===n&&n>=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(ma+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(ma+r+": "+n);return this}var Dy=dk(Xz);Lt=new Dy(1);const pe=Dy;function Zz(e){return nW(e)||rW(e)||tW(e)||eW()}function eW(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tW(e,t){if(e){if(typeof e=="string")return qp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qp(e,t)}}function rW(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function nW(e){if(Array.isArray(e))return qp(e)}function qp(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var aW=function(t){return t},fk={},hk=function(t){return t===fk},$b=function(t){return function r(){return arguments.length===0||arguments.length===1&&hk(arguments.length<=0?void 0:arguments[0])?r:t.apply(void 0,arguments)}},iW=function e(t,r){return t===1?r:$b(function(){for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];var s=a.filter(function(l){return l!==fk}).length;return s>=t?r.apply(void 0,a):e(t-s,$b(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var f=a.map(function(d){return hk(d)?c.shift():d});return r.apply(void 0,Zz(f).concat(c))}))})},Xd=function(t){return iW(t.length,t)},Xp=function(t,r){for(var n=[],a=t;a<r;++a)n[a-t]=a;return n},oW=Xd(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(r){return t[r]}).map(e)}),sW=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(!r.length)return aW;var a=r.reverse(),i=a[0],s=a.slice(1);return function(){return s.reduce(function(l,c){return c(l)},i.apply(void 0,arguments))}},Qp=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},pk=function(t){var r=null,n=null;return function(){for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return r&&i.every(function(l,c){return l===r[c]})||(r=i,n=t.apply(void 0,i)),n}};function lW(e){var t;return e===0?t=1:t=Math.floor(new pe(e).abs().log(10).toNumber())+1,t}function cW(e,t,r){for(var n=new pe(e),a=0,i=[];n.lt(t)&&a<1e5;)i.push(n.toNumber()),n=n.add(r),a++;return i}var uW=Xd(function(e,t,r){var n=+e,a=+t;return n+r*(a-n)}),dW=Xd(function(e,t,r){var n=t-+e;return n=n||1/0,(r-e)/n}),fW=Xd(function(e,t,r){var n=t-+e;return n=n||1/0,Math.max(0,Math.min(1,(r-e)/n))});const Qd={rangeStep:cW,getDigitCount:lW,interpolateNumber:uW,uninterpolateNumber:dW,uninterpolateTruncation:fW};function Jp(e){return mW(e)||pW(e)||mk(e)||hW()}function hW(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pW(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function mW(e){if(Array.isArray(e))return Zp(e)}function Bs(e,t){return gW(e)||yW(e,t)||mk(e,t)||vW()}function vW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mk(e,t){if(e){if(typeof e=="string")return Zp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Zp(e,t)}}function Zp(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function yW(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,i=void 0;try{for(var s=e[Symbol.iterator](),l;!(n=(l=s.next()).done)&&(r.push(l.value),!(t&&r.length===t));n=!0);}catch(c){a=!0,i=c}finally{try{!n&&s.return!=null&&s.return()}finally{if(a)throw i}}return r}}function gW(e){if(Array.isArray(e))return e}function vk(e){var t=Bs(e,2),r=t[0],n=t[1],a=r,i=n;return r>n&&(a=n,i=r),[a,i]}function yk(e,t,r){if(e.lte(0))return new pe(0);var n=Qd.getDigitCount(e.toNumber()),a=new pe(10).pow(n),i=e.div(a),s=n!==1?.05:.1,l=new pe(Math.ceil(i.div(s).toNumber())).add(r).mul(s),c=l.mul(a);return t?c:new pe(Math.ceil(c))}function xW(e,t,r){var n=1,a=new pe(e);if(!a.isint()&&r){var i=Math.abs(e);i<1?(n=new pe(10).pow(Qd.getDigitCount(e)-1),a=new pe(Math.floor(a.div(n).toNumber())).mul(n)):i>1&&(a=new pe(Math.floor(e)))}else e===0?a=new pe(Math.floor((t-1)/2)):r||(a=new pe(Math.floor(e)));var s=Math.floor((t-1)/2),l=sW(oW(function(c){return a.add(new pe(c-s).mul(n)).toNumber()}),Xp);return l(0,t)}function gk(e,t,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new pe(0),tickMin:new pe(0),tickMax:new pe(0)};var i=yk(new pe(t).sub(e).div(r-1),n,a),s;e<=0&&t>=0?s=new pe(0):(s=new pe(e).add(t).div(2),s=s.sub(new pe(s).mod(i)));var l=Math.ceil(s.sub(e).div(i).toNumber()),c=Math.ceil(new pe(t).sub(s).div(i).toNumber()),u=l+c+1;return u>r?gk(e,t,r,n,a+1):(u<r&&(c=t>0?c+(r-u):c,l=t>0?l:l+(r-u)),{step:i,tickMin:s.sub(new pe(l).mul(i)),tickMax:s.add(new pe(c).mul(i))})}function bW(e){var t=Bs(e,2),r=t[0],n=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(a,2),l=vk([r,n]),c=Bs(l,2),u=c[0],f=c[1];if(u===-1/0||f===1/0){var d=f===1/0?[u].concat(Jp(Xp(0,a-1).map(function(){return 1/0}))):[].concat(Jp(Xp(0,a-1).map(function(){return-1/0})),[f]);return r>n?Qp(d):d}if(u===f)return xW(u,a,i);var h=gk(u,f,s,i),p=h.step,g=h.tickMin,y=h.tickMax,b=Qd.rangeStep(g,y.add(new pe(.1).mul(p)),p);return r>n?Qp(b):b}function jW(e,t){var r=Bs(e,2),n=r[0],a=r[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=vk([n,a]),l=Bs(s,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[n,a];if(c===u)return[c];var f=Math.max(t,2),d=yk(new pe(u).sub(c).div(f-1),i,0),h=[].concat(Jp(Qd.rangeStep(new pe(c),new pe(u).sub(new pe(.99).mul(d)),d)),[u]);return n>a?Qp(h):h}var wW=pk(bW),SW=pk(jW),_W="Invariant failed";function Oa(e,t){throw new Error(_W)}var kW=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Ii(e){"@babel/helpers - typeof";return Ii=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ii(e)}function _u(){return _u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_u.apply(this,arguments)}function OW(e,t){return CW(e)||AW(e,t)||PW(e,t)||NW()}function NW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PW(e,t){if(e){if(typeof e=="string")return Tb(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Tb(e,t)}}function Tb(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function AW(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function CW(e){if(Array.isArray(e))return e}function EW(e,t){if(e==null)return{};var r=$W(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $W(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function TW(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MW(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,jk(n.key),n)}}function IW(e,t,r){return t&&MW(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function LW(e,t,r){return t=ku(t),DW(e,xk()?Reflect.construct(t,r||[],ku(e).constructor):t.apply(e,r))}function DW(e,t){if(t&&(Ii(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return RW(e)}function RW(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(xk=function(){return!!e})()}function ku(e){return ku=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ku(e)}function BW(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&em(e,t)}function em(e,t){return em=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},em(e,t)}function bk(e,t,r){return t=jk(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jk(e){var t=FW(e,"string");return Ii(t)=="symbol"?t:t+""}function FW(e,t){if(Ii(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ii(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Jd=function(e){function t(){return TW(this,t),LW(this,t,arguments)}return BW(t,e),IW(t,[{key:"render",value:function(){var n=this.props,a=n.offset,i=n.layout,s=n.width,l=n.dataKey,c=n.data,u=n.dataPointFormatter,f=n.xAxis,d=n.yAxis,h=EW(n,kW),p=X(h,!1);this.props.direction==="x"&&f.type!=="number"&&Oa();var g=c.map(function(y){var b=u(y,l),v=b.x,m=b.y,x=b.value,S=b.errorVal;if(!S)return null;var j=[],w,_;if(Array.isArray(S)){var O=OW(S,2);w=O[0],_=O[1]}else w=_=S;if(i==="vertical"){var N=f.scale,k=m+a,E=k+s,T=k-s,D=N(x-w),A=N(x+_);j.push({x1:A,y1:E,x2:A,y2:T}),j.push({x1:D,y1:k,x2:A,y2:k}),j.push({x1:D,y1:E,x2:D,y2:T})}else if(i==="horizontal"){var L=d.scale,C=v+a,M=C-s,I=C+s,R=L(x-w),F=L(x+_);j.push({x1:M,y1:F,x2:I,y2:F}),j.push({x1:C,y1:R,x2:C,y2:F}),j.push({x1:M,y1:R,x2:I,y2:R})}return $.createElement(ne,_u({className:"recharts-errorBar",key:"bar-".concat(j.map(function(K){return"".concat(K.x1,"-").concat(K.x2,"-").concat(K.y1,"-").concat(K.y2)}))},p),j.map(function(K){return $.createElement("line",_u({},K,{key:"line-".concat(K.x1,"-").concat(K.x2,"-").concat(K.y1,"-").concat(K.y2)}))}))});return $.createElement(ne,{className:"recharts-errorBars"},g)}}])}($.Component);bk(Jd,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});bk(Jd,"displayName","ErrorBar");function Fs(e){"@babel/helpers - typeof";return Fs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fs(e)}function Mb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Yn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Mb(Object(r),!0).forEach(function(n){zW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function zW(e,t,r){return t=WW(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WW(e){var t=UW(e,"string");return Fs(t)=="symbol"?t:t+""}function UW(e,t){if(Fs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Fs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wk=function(t){var r=t.children,n=t.formattedGraphicalItems,a=t.legendWidth,i=t.legendContent,s=It(r,vi);if(!s)return null;var l=vi.defaultProps,c=l!==void 0?Yn(Yn({},l),s.props):{},u;return s.props&&s.props.payload?u=s.props&&s.props.payload:i==="children"?u=(n||[]).reduce(function(f,d){var h=d.item,p=d.props,g=p.sectors||p.data||[];return f.concat(g.map(function(y){return{type:s.props.iconType||h.props.legendType,value:y.name,color:y.fill,payload:y}}))},[]):u=(n||[]).map(function(f){var d=f.item,h=d.type.defaultProps,p=h!==void 0?Yn(Yn({},h),d.props):{},g=p.dataKey,y=p.name,b=p.legendType,v=p.hide;return{inactive:v,dataKey:g,type:c.iconType||b||"square",color:Ry(d),value:y||g,payload:p}}),Yn(Yn(Yn({},c),vi.getWithHeight(s,a)),{},{payload:u,item:s})};function zs(e){"@babel/helpers - typeof";return zs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zs(e)}function Ib(e){return GW(e)||VW(e)||KW(e)||HW()}function HW(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KW(e,t){if(e){if(typeof e=="string")return tm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tm(e,t)}}function VW(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function GW(e){if(Array.isArray(e))return tm(e)}function tm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Lb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ie(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lb(Object(r),!0).forEach(function(n){gi(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gi(e,t,r){return t=YW(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YW(e){var t=qW(e,"string");return zs(t)=="symbol"?t:t+""}function qW(e,t){if(zs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(zs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Be(e,t,r){return te(e)||te(t)?r:qe(t)?Bt(e,t,r):Q(t)?t(e):r}function ns(e,t,r,n){var a=Vz(e,function(l){return Be(l,t)});if(r==="number"){var i=a.filter(function(l){return U(l)||parseFloat(l)});return i.length?[qd(i),wn(i)]:[1/0,-1/0]}var s=n?a.filter(function(l){return!te(l)}):a;return s.map(function(l){return qe(l)||l instanceof Date?l:""})}var XW=function(t){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,s=-1,l=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(l<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var c=i.range,u=0;u<l;u++){var f=u>0?a[u-1].coordinate:a[l-1].coordinate,d=a[u].coordinate,h=u>=l-1?a[0].coordinate:a[u+1].coordinate,p=void 0;if(rt(d-f)!==rt(h-d)){var g=[];if(rt(h-d)===rt(c[1]-c[0])){p=h;var y=d+c[1]-c[0];g[0]=Math.min(y,(y+f)/2),g[1]=Math.max(y,(y+f)/2)}else{p=f;var b=h+c[1]-c[0];g[0]=Math.min(d,(b+d)/2),g[1]=Math.max(d,(b+d)/2)}var v=[Math.min(d,(p+d)/2),Math.max(d,(p+d)/2)];if(t>v[0]&&t<=v[1]||t>=g[0]&&t<=g[1]){s=a[u].index;break}}else{var m=Math.min(f,h),x=Math.max(f,h);if(t>(m+d)/2&&t<=(x+d)/2){s=a[u].index;break}}}else for(var S=0;S<l;S++)if(S===0&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S>0&&S<l-1&&t>(n[S].coordinate+n[S-1].coordinate)/2&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S===l-1&&t>(n[S].coordinate+n[S-1].coordinate)/2){s=n[S].index;break}return s},Ry=function(t){var r,n=t,a=n.type.displayName,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Ie(Ie({},t.type.defaultProps),t.props):t.props,s=i.stroke,l=i.fill,c;switch(a){case"Line":c=s;break;case"Area":case"Radar":c=s&&s!=="none"?s:l;break;default:c=l;break}return c},QW=function(t){var r=t.barSize,n=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var s={},l=Object.keys(i),c=0,u=l.length;c<u;c++)for(var f=i[l[c]].stackGroups,d=Object.keys(f),h=0,p=d.length;h<p;h++){var g=f[d[h]],y=g.items,b=g.cateAxisId,v=y.filter(function(_){return Yr(_.type).indexOf("Bar")>=0});if(v&&v.length){var m=v[0].type.defaultProps,x=m!==void 0?Ie(Ie({},m),v[0].props):v[0].props,S=x.barSize,j=x[b];s[j]||(s[j]=[]);var w=te(S)?r:S;s[j].push({item:v[0],stackList:v.slice(1),barSize:te(w)?void 0:xt(w,n,0)})}}return s},JW=function(t){var r=t.barGap,n=t.barCategoryGap,a=t.bandSize,i=t.sizeList,s=i===void 0?[]:i,l=t.maxBarSize,c=s.length;if(c<1)return null;var u=xt(r,a,0,!0),f,d=[];if(s[0].barSize===+s[0].barSize){var h=!1,p=a/c,g=s.reduce(function(S,j){return S+j.barSize||0},0);g+=(c-1)*u,g>=a&&(g-=(c-1)*u,u=0),g>=a&&p>0&&(h=!0,p*=.9,g=c*p);var y=(a-g)/2>>0,b={offset:y-u,size:0};f=s.reduce(function(S,j){var w={item:j.item,position:{offset:b.offset+b.size+u,size:h?p:j.barSize}},_=[].concat(Ib(S),[w]);return b=_[_.length-1].position,j.stackList&&j.stackList.length&&j.stackList.forEach(function(O){_.push({item:O,position:b})}),_},d)}else{var v=xt(n,a,0,!0);a-2*v-(c-1)*u<=0&&(u=0);var m=(a-2*v-(c-1)*u)/c;m>1&&(m>>=0);var x=l===+l?Math.min(m,l):m;f=s.reduce(function(S,j,w){var _=[].concat(Ib(S),[{item:j.item,position:{offset:v+(m+u)*w+(m-x)/2,size:x}}]);return j.stackList&&j.stackList.length&&j.stackList.forEach(function(O){_.push({item:O,position:_[_.length-1].position})}),_},d)}return f},ZW=function(t,r,n,a){var i=n.children,s=n.width,l=n.margin,c=s-(l.left||0)-(l.right||0),u=wk({children:i,legendWidth:c});if(u){var f=a||{},d=f.width,h=f.height,p=u.align,g=u.verticalAlign,y=u.layout;if((y==="vertical"||y==="horizontal"&&g==="middle")&&p!=="center"&&U(t[p]))return Ie(Ie({},t),{},gi({},p,t[p]+(d||0)));if((y==="horizontal"||y==="vertical"&&p==="center")&&g!=="middle"&&U(t[g]))return Ie(Ie({},t),{},gi({},g,t[g]+(h||0)))}return t},eU=function(t,r,n){return te(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},Sk=function(t,r,n,a,i){var s=r.props.children,l=Ft(s,Jd).filter(function(u){return eU(a,i,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,f){var d=Be(f,n);if(te(d))return u;var h=Array.isArray(d)?[qd(d),wn(d)]:[d,d],p=c.reduce(function(g,y){var b=Be(f,y,0),v=h[0]-Math.abs(Array.isArray(b)?b[0]:b),m=h[1]+Math.abs(Array.isArray(b)?b[1]:b);return[Math.min(v,g[0]),Math.max(m,g[1])]},[1/0,-1/0]);return[Math.min(p[0],u[0]),Math.max(p[1],u[1])]},[1/0,-1/0])}return null},tU=function(t,r,n,a,i){var s=r.map(function(l){return Sk(t,l,n,i,a)}).filter(function(l){return!te(l)});return s&&s.length?s.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},_k=function(t,r,n,a,i){var s=r.map(function(c){var u=c.props.dataKey;return n==="number"&&u&&Sk(t,c,u,a)||ns(t,u,n,i)});if(n==="number")return s.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return s.reduce(function(c,u){for(var f=0,d=u.length;f<d;f++)l[u[f]]||(l[u[f]]=!0,c.push(u[f]));return c},[])},kk=function(t,r){return t==="horizontal"&&r==="xAxis"||t==="vertical"&&r==="yAxis"||t==="centric"&&r==="angleAxis"||t==="radial"&&r==="radiusAxis"},Ok=function(t,r,n,a){if(a)return t.map(function(c){return c.coordinate});var i,s,l=t.map(function(c){return c.coordinate===r&&(i=!0),c.coordinate===n&&(s=!0),c.coordinate});return i||l.push(r),s||l.push(n),l},Vr=function(t,r,n){if(!t)return null;var a=t.scale,i=t.duplicateDomain,s=t.type,l=t.range,c=t.realScaleType==="scaleBand"?a.bandwidth()/2:2,u=(r||n)&&s==="category"&&a.bandwidth?a.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?rt(l[0]-l[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var f=(t.ticks||t.niceTicks).map(function(d){var h=i?i.indexOf(d):d;return{coordinate:a(h)+u,value:d,offset:u}});return f.filter(function(d){return!co(d.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(d,h){return{coordinate:a(d)+u,value:d,index:h,offset:u}}):a.ticks&&!n?a.ticks(t.tickCount).map(function(d){return{coordinate:a(d)+u,value:d,offset:u}}):a.domain().map(function(d,h){return{coordinate:a(d)+u,value:i?i[d]:d,index:h,offset:u}})},sh=new WeakMap,Zl=function(t,r){if(typeof r!="function")return t;sh.has(t)||sh.set(t,new WeakMap);var n=sh.get(t);if(n.has(r))return n.get(r);var a=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,a),a},Nk=function(t,r,n){var a=t.scale,i=t.type,s=t.layout,l=t.axisType;if(a==="auto")return s==="radial"&&l==="radiusAxis"?{scale:Ts(),realScaleType:"band"}:s==="radial"&&l==="angleAxis"?{scale:xu(),realScaleType:"linear"}:i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:rs(),realScaleType:"point"}:i==="category"?{scale:Ts(),realScaleType:"band"}:{scale:xu(),realScaleType:"linear"};if(wa(a)){var c="scale".concat(Id(a));return{scale:(Ab[c]||rs)(),realScaleType:Ab[c]?c:"point"}}return Q(a)?{scale:a}:{scale:rs(),realScaleType:"point"}},Db=1e-4,Pk=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,a=t.range(),i=Math.min(a[0],a[1])-Db,s=Math.max(a[0],a[1])+Db,l=t(r[0]),c=t(r[n-1]);(l<i||l>s||c<i||c>s)&&t.domain([r[0],r[n-1]])}},Ak=function(t,r){if(!t)return null;for(var n=0,a=t.length;n<a;n++)if(t[n].item===r)return t[n].position;return null},Ck=function(t,r){if(!r||r.length!==2||!U(r[0])||!U(r[1]))return t;var n=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]),i=[t[0],t[1]];return(!U(t[0])||t[0]<n)&&(i[0]=n),(!U(t[1])||t[1]>a)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]<n&&(i[1]=n),i},rU=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n<a;++n)for(var i=0,s=0,l=0;l<r;++l){var c=co(t[l][n][1])?t[l][n][0]:t[l][n][1];c>=0?(t[l][n][0]=i,t[l][n][1]=i+c,i=t[l][n][1]):(t[l][n][0]=s,t[l][n][1]=s+c,s=t[l][n][1])}},nU=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n<a;++n)for(var i=0,s=0;s<r;++s){var l=co(t[s][n][1])?t[s][n][0]:t[s][n][1];l>=0?(t[s][n][0]=i,t[s][n][1]=i+l,i=t[s][n][1]):(t[s][n][0]=0,t[s][n][1]=0)}},aU={sign:rU,expand:k4,none:Ni,silhouette:O4,wiggle:N4,positive:nU},iU=function(t,r,n){var a=r.map(function(l){return l.props.dataKey}),i=aU[n],s=_4().keys(a).value(function(l,c){return+Be(l,c,0)}).order(Op).offset(i);return s(t)},oU=function(t,r,n,a,i,s){if(!t)return null;var l=s?r.reverse():r,c={},u=l.reduce(function(d,h){var p,g=(p=h.type)!==null&&p!==void 0&&p.defaultProps?Ie(Ie({},h.type.defaultProps),h.props):h.props,y=g.stackId,b=g.hide;if(b)return d;var v=g[n],m=d[v]||{hasStack:!1,stackGroups:{}};if(qe(y)){var x=m.stackGroups[y]||{numericAxisId:n,cateAxisId:a,items:[]};x.items.push(h),m.hasStack=!0,m.stackGroups[y]=x}else m.stackGroups[uo("_stackId_")]={numericAxisId:n,cateAxisId:a,items:[h]};return Ie(Ie({},d),{},gi({},v,m))},c),f={};return Object.keys(u).reduce(function(d,h){var p=u[h];if(p.hasStack){var g={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(y,b){var v=p.stackGroups[b];return Ie(Ie({},y),{},gi({},b,{numericAxisId:n,cateAxisId:a,items:v.items,stackedData:iU(t,v.items,i)}))},g)}return Ie(Ie({},d),{},gi({},h,p))},f)},Ek=function(t,r){var n=r.realScaleType,a=r.type,i=r.tickCount,s=r.originalDomain,l=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(i&&a==="number"&&s&&(s[0]==="auto"||s[1]==="auto")){var u=t.domain();if(!u.length)return null;var f=wW(u,i,l);return t.domain([qd(f),wn(f)]),{niceTicks:f}}if(i&&a==="number"){var d=t.domain(),h=SW(d,i,l);return{niceTicks:h}}return null};function Rb(e){var t=e.axis,r=e.ticks,n=e.bandSize,a=e.entry,i=e.index,s=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!te(a[t.dataKey])){var l=Qc(r,"value",a[t.dataKey]);if(l)return l.coordinate+n/2}return r[i]?r[i].coordinate+n/2:null}var c=Be(a,te(s)?t.dataKey:s);return te(c)?null:t.scale(c)}var Ou=function(t){var r=t.axis,n=t.ticks,a=t.offset,i=t.bandSize,s=t.entry,l=t.index;if(r.type==="category")return n[l]?n[l].coordinate+a:null;var c=Be(s,r.dataKey,r.domain[l]);return te(c)?null:r.scale(c)-i/2+a},$k=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var a=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return a<=0&&i>=0?0:i<0?i:a}return n[0]},sU=function(t,r){var n,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Ie(Ie({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(qe(i)){var s=r[i];if(s){var l=s.items.indexOf(t);return l>=0?s.stackedData[l]:null}}return null},lU=function(t){return t.reduce(function(r,n){return[qd(n.concat([r[0]]).filter(U)),wn(n.concat([r[1]]).filter(U))]},[1/0,-1/0])},Tk=function(t,r,n){return Object.keys(t).reduce(function(a,i){var s=t[i],l=s.stackedData,c=l.reduce(function(u,f){var d=lU(f.slice(r,n+1));return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]);return[Math.min(c[0],a[0]),Math.max(c[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},Bb=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Fb=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,rm=function(t,r,n){if(Q(t))return t(r,n);if(!Array.isArray(t))return r;var a=[];if(U(t[0]))a[0]=n?t[0]:Math.min(t[0],r[0]);else if(Bb.test(t[0])){var i=+Bb.exec(t[0])[1];a[0]=r[0]-i}else Q(t[0])?a[0]=t[0](r[0]):a[0]=r[0];if(U(t[1]))a[1]=n?t[1]:Math.max(t[1],r[1]);else if(Fb.test(t[1])){var s=+Fb.exec(t[1])[1];a[1]=r[1]+s}else Q(t[1])?a[1]=t[1](r[1]):a[1]=r[1];return a},Nu=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!n||a>0)return a}if(t&&r&&r.length>=2){for(var i=fy(r,function(d){return d.coordinate}),s=1/0,l=1,c=i.length;l<c;l++){var u=i[l],f=i[l-1];s=Math.min((u.coordinate||0)-(f.coordinate||0),s)}return s===1/0?0:s}return n?void 0:0},zb=function(t,r,n){return!t||!t.length||_a(t,Bt(n,"type.defaultProps.domain"))?r:t},By=function(t,r){var n=t.type.defaultProps?Ie(Ie({},t.type.defaultProps),t.props):t.props,a=n.dataKey,i=n.name,s=n.unit,l=n.formatter,c=n.tooltipType,u=n.chartType,f=n.hide;return Ie(Ie({},X(t,!1)),{},{dataKey:a,unit:s,formatter:l,name:i||a,color:Ry(t),value:Be(r,a),type:c,payload:r,chartType:u,hide:f})};function Ws(e){"@babel/helpers - typeof";return Ws=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ws(e)}function Wb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Fr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Wb(Object(r),!0).forEach(function(n){Mk(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Mk(e,t,r){return t=cU(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cU(e){var t=uU(e,"string");return Ws(t)=="symbol"?t:t+""}function uU(e,t){if(Ws(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ws(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dU(e,t){return mU(e)||pU(e,t)||hU(e,t)||fU()}function fU(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hU(e,t){if(e){if(typeof e=="string")return Ub(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ub(e,t)}}function Ub(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function pU(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function mU(e){if(Array.isArray(e))return e}var Pu=Math.PI/180,vU=function(t){return t*180/Math.PI},ye=function(t,r,n,a){return{x:t+Math.cos(-Pu*a)*n,y:r+Math.sin(-Pu*a)*n}},Ik=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},Lk=function(t,r,n,a,i){var s=t.width,l=t.height,c=t.startAngle,u=t.endAngle,f=xt(t.cx,s,s/2),d=xt(t.cy,l,l/2),h=Ik(s,l,n),p=xt(t.innerRadius,h,0),g=xt(t.outerRadius,h,h*.8),y=Object.keys(r);return y.reduce(function(b,v){var m=r[v],x=m.domain,S=m.reversed,j;if(te(m.range))a==="angleAxis"?j=[c,u]:a==="radiusAxis"&&(j=[p,g]),S&&(j=[j[1],j[0]]);else{j=m.range;var w=j,_=dU(w,2);c=_[0],u=_[1]}var O=Nk(m,i),N=O.realScaleType,k=O.scale;k.domain(x).range(j),Pk(k);var E=Ek(k,Fr(Fr({},m),{},{realScaleType:N})),T=Fr(Fr(Fr({},m),E),{},{range:j,radius:g,realScaleType:N,scale:k,cx:f,cy:d,innerRadius:p,outerRadius:g,startAngle:c,endAngle:u});return Fr(Fr({},b),{},Mk({},v,T))},{})},yU=function(t,r){var n=t.x,a=t.y,i=r.x,s=r.y;return Math.sqrt(Math.pow(n-i,2)+Math.pow(a-s,2))},gU=function(t,r){var n=t.x,a=t.y,i=r.cx,s=r.cy,l=yU({x:n,y:a},{x:i,y:s});if(l<=0)return{radius:l};var c=(n-i)/l,u=Math.acos(c);return a>s&&(u=2*Math.PI-u),{radius:l,angle:vU(u),angleInRadian:u}},xU=function(t){var r=t.startAngle,n=t.endAngle,a=Math.floor(r/360),i=Math.floor(n/360),s=Math.min(a,i);return{startAngle:r-s*360,endAngle:n-s*360}},bU=function(t,r){var n=r.startAngle,a=r.endAngle,i=Math.floor(n/360),s=Math.floor(a/360),l=Math.min(i,s);return t+l*360},Hb=function(t,r){var n=t.x,a=t.y,i=gU({x:n,y:a},r),s=i.radius,l=i.angle,c=r.innerRadius,u=r.outerRadius;if(s<c||s>u)return!1;if(s===0)return!0;var f=xU(r),d=f.startAngle,h=f.endAngle,p=l,g;if(d<=h){for(;p>h;)p-=360;for(;p<d;)p+=360;g=p>=d&&p<=h}else{for(;p>d;)p-=360;for(;p<h;)p+=360;g=p>=h&&p<=d}return g?Fr(Fr({},r),{},{radius:s,angle:bU(p,r)}):null},Dk=function(t){return!P.isValidElement(t)&&!Q(t)&&typeof t!="boolean"?t.className:""};function Us(e){"@babel/helpers - typeof";return Us=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Us(e)}var jU=["offset"];function wU(e){return OU(e)||kU(e)||_U(e)||SU()}function SU(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _U(e,t){if(e){if(typeof e=="string")return nm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nm(e,t)}}function kU(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function OU(e){if(Array.isArray(e))return nm(e)}function nm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function NU(e,t){if(e==null)return{};var r=PU(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function PU(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Kb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ke(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Kb(Object(r),!0).forEach(function(n){AU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function AU(e,t,r){return t=CU(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CU(e){var t=EU(e,"string");return Us(t)=="symbol"?t:t+""}function EU(e,t){if(Us(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Us(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hs(){return Hs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hs.apply(this,arguments)}var $U=function(t){var r=t.value,n=t.formatter,a=te(t.children)?r:t.children;return Q(n)?n(a):a},TU=function(t,r){var n=rt(r-t),a=Math.min(Math.abs(r-t),360);return n*a},MU=function(t,r,n){var a=t.position,i=t.viewBox,s=t.offset,l=t.className,c=i,u=c.cx,f=c.cy,d=c.innerRadius,h=c.outerRadius,p=c.startAngle,g=c.endAngle,y=c.clockWise,b=(d+h)/2,v=TU(p,g),m=v>=0?1:-1,x,S;a==="insideStart"?(x=p+m*s,S=y):a==="insideEnd"?(x=g-m*s,S=!y):a==="end"&&(x=g+m*s,S=y),S=v<=0?S:!S;var j=ye(u,f,b,x),w=ye(u,f,b,x+(S?1:-1)*359),_="M".concat(j.x,",").concat(j.y,`
+ A`).concat(b,",").concat(b,",0,1,").concat(S?0:1,`,
+ `).concat(w.x,",").concat(w.y),O=te(t.id)?uo("recharts-radial-line-"):t.id;return $.createElement("text",Hs({},n,{dominantBaseline:"central",className:ee("recharts-radial-bar-label",l)}),$.createElement("defs",null,$.createElement("path",{id:O,d:_})),$.createElement("textPath",{xlinkHref:"#".concat(O)},r))},IU=function(t){var r=t.viewBox,n=t.offset,a=t.position,i=r,s=i.cx,l=i.cy,c=i.innerRadius,u=i.outerRadius,f=i.startAngle,d=i.endAngle,h=(f+d)/2;if(a==="outside"){var p=ye(s,l,u+n,h),g=p.x,y=p.y;return{x:g,y,textAnchor:g>=s?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:s,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:s,y:l,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:s,y:l,textAnchor:"middle",verticalAnchor:"end"};var b=(c+u)/2,v=ye(s,l,b,h),m=v.x,x=v.y;return{x:m,y:x,textAnchor:"middle",verticalAnchor:"middle"}},LU=function(t){var r=t.viewBox,n=t.parentViewBox,a=t.offset,i=t.position,s=r,l=s.x,c=s.y,u=s.width,f=s.height,d=f>=0?1:-1,h=d*a,p=d>0?"end":"start",g=d>0?"start":"end",y=u>=0?1:-1,b=y*a,v=y>0?"end":"start",m=y>0?"start":"end";if(i==="top"){var x={x:l+u/2,y:c-d*a,textAnchor:"middle",verticalAnchor:p};return Ke(Ke({},x),n?{height:Math.max(c-n.y,0),width:u}:{})}if(i==="bottom"){var S={x:l+u/2,y:c+f+h,textAnchor:"middle",verticalAnchor:g};return Ke(Ke({},S),n?{height:Math.max(n.y+n.height-(c+f),0),width:u}:{})}if(i==="left"){var j={x:l-b,y:c+f/2,textAnchor:v,verticalAnchor:"middle"};return Ke(Ke({},j),n?{width:Math.max(j.x-n.x,0),height:f}:{})}if(i==="right"){var w={x:l+u+b,y:c+f/2,textAnchor:m,verticalAnchor:"middle"};return Ke(Ke({},w),n?{width:Math.max(n.x+n.width-w.x,0),height:f}:{})}var _=n?{width:u,height:f}:{};return i==="insideLeft"?Ke({x:l+b,y:c+f/2,textAnchor:m,verticalAnchor:"middle"},_):i==="insideRight"?Ke({x:l+u-b,y:c+f/2,textAnchor:v,verticalAnchor:"middle"},_):i==="insideTop"?Ke({x:l+u/2,y:c+h,textAnchor:"middle",verticalAnchor:g},_):i==="insideBottom"?Ke({x:l+u/2,y:c+f-h,textAnchor:"middle",verticalAnchor:p},_):i==="insideTopLeft"?Ke({x:l+b,y:c+h,textAnchor:m,verticalAnchor:g},_):i==="insideTopRight"?Ke({x:l+u-b,y:c+h,textAnchor:v,verticalAnchor:g},_):i==="insideBottomLeft"?Ke({x:l+b,y:c+f-h,textAnchor:m,verticalAnchor:p},_):i==="insideBottomRight"?Ke({x:l+u-b,y:c+f-h,textAnchor:v,verticalAnchor:p},_):io(i)&&(U(i.x)||oa(i.x))&&(U(i.y)||oa(i.y))?Ke({x:l+xt(i.x,u),y:c+xt(i.y,f),textAnchor:"end",verticalAnchor:"end"},_):Ke({x:l+u/2,y:c+f/2,textAnchor:"middle",verticalAnchor:"middle"},_)},DU=function(t){return"cx"in t&&U(t.cx)};function tt(e){var t=e.offset,r=t===void 0?5:t,n=NU(e,jU),a=Ke({offset:r},n),i=a.viewBox,s=a.position,l=a.value,c=a.children,u=a.content,f=a.className,d=f===void 0?"":f,h=a.textBreakAll;if(!i||te(l)&&te(c)&&!P.isValidElement(u)&&!Q(u))return null;if(P.isValidElement(u))return P.cloneElement(u,a);var p;if(Q(u)){if(p=P.createElement(u,a),P.isValidElement(p))return p}else p=$U(a);var g=DU(i),y=X(a,!0);if(g&&(s==="insideStart"||s==="insideEnd"||s==="end"))return MU(a,p,y);var b=g?IU(a):LU(a);return $.createElement(Sa,Hs({className:ee("recharts-label",d)},y,b,{breakAll:h}),p)}tt.displayName="Label";var Rk=function(t){var r=t.cx,n=t.cy,a=t.angle,i=t.startAngle,s=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,f=t.outerRadius,d=t.x,h=t.y,p=t.top,g=t.left,y=t.width,b=t.height,v=t.clockWise,m=t.labelViewBox;if(m)return m;if(U(y)&&U(b)){if(U(d)&&U(h))return{x:d,y:h,width:y,height:b};if(U(p)&&U(g))return{x:p,y:g,width:y,height:b}}return U(d)&&U(h)?{x:d,y:h,width:0,height:0}:U(r)&&U(n)?{cx:r,cy:n,startAngle:i||a||0,endAngle:s||a||0,innerRadius:u||0,outerRadius:f||c||l||0,clockWise:v}:t.viewBox?t.viewBox:{}},RU=function(t,r){return t?t===!0?$.createElement(tt,{key:"label-implicit",viewBox:r}):qe(t)?$.createElement(tt,{key:"label-implicit",viewBox:r,value:t}):P.isValidElement(t)?t.type===tt?P.cloneElement(t,{key:"label-implicit",viewBox:r}):$.createElement(tt,{key:"label-implicit",content:t,viewBox:r}):Q(t)?$.createElement(tt,{key:"label-implicit",content:t,viewBox:r}):io(t)?$.createElement(tt,Hs({viewBox:r},t,{key:"label-implicit"})):null:null},BU=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var a=t.children,i=Rk(t),s=Ft(a,tt).map(function(c,u){return P.cloneElement(c,{viewBox:r||i,key:"label-".concat(u)})});if(!n)return s;var l=RU(t.label,r||i);return[l].concat(wU(s))};tt.parseViewBox=Rk;tt.renderCallByParent=BU;function FU(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var zU=FU;const WU=de(zU);function Ks(e){"@babel/helpers - typeof";return Ks=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ks(e)}var UU=["valueAccessor"],HU=["data","dataKey","clockWise","id","textBreakAll"];function KU(e){return qU(e)||YU(e)||GU(e)||VU()}function VU(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GU(e,t){if(e){if(typeof e=="string")return am(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return am(e,t)}}function YU(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function qU(e){if(Array.isArray(e))return am(e)}function am(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Au(){return Au=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Au.apply(this,arguments)}function Vb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Gb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Vb(Object(r),!0).forEach(function(n){XU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function XU(e,t,r){return t=QU(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function QU(e){var t=JU(e,"string");return Ks(t)=="symbol"?t:t+""}function JU(e,t){if(Ks(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ks(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yb(e,t){if(e==null)return{};var r=ZU(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ZU(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var eH=function(t){return Array.isArray(t.value)?WU(t.value):t.value};function Er(e){var t=e.valueAccessor,r=t===void 0?eH:t,n=Yb(e,UU),a=n.data,i=n.dataKey,s=n.clockWise,l=n.id,c=n.textBreakAll,u=Yb(n,HU);return!a||!a.length?null:$.createElement(ne,{className:"recharts-label-list"},a.map(function(f,d){var h=te(i)?r(f,d):Be(f&&f.payload,i),p=te(l)?{}:{id:"".concat(l,"-").concat(d)};return $.createElement(tt,Au({},X(f,!0),u,p,{parentViewBox:f.parentViewBox,value:h,textBreakAll:c,viewBox:tt.parseViewBox(te(s)?f:Gb(Gb({},f),{},{clockWise:s})),key:"label-".concat(d),index:d}))}))}Er.displayName="LabelList";function tH(e,t){return e?e===!0?$.createElement(Er,{key:"labelList-implicit",data:t}):$.isValidElement(e)||Q(e)?$.createElement(Er,{key:"labelList-implicit",data:t,content:e}):io(e)?$.createElement(Er,Au({data:t},e,{key:"labelList-implicit"})):null:null}function rH(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,a=Ft(n,Er).map(function(s,l){return P.cloneElement(s,{data:t,key:"labelList-".concat(l)})});if(!r)return a;var i=tH(e.label,t);return[i].concat(KU(a))}Er.renderCallByParent=rH;function Vs(e){"@babel/helpers - typeof";return Vs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vs(e)}function im(){return im=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},im.apply(this,arguments)}function qb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Xb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qb(Object(r),!0).forEach(function(n){nH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function nH(e,t,r){return t=aH(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aH(e){var t=iH(e,"string");return Vs(t)=="symbol"?t:t+""}function iH(e,t){if(Vs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Vs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var oH=function(t,r){var n=rt(r-t),a=Math.min(Math.abs(r-t),359.999);return n*a},ec=function(t){var r=t.cx,n=t.cy,a=t.radius,i=t.angle,s=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,f=c*(l?1:-1)+a,d=Math.asin(c/f)/Pu,h=u?i:i+s*d,p=ye(r,n,f,h),g=ye(r,n,a,h),y=u?i-s*d:i,b=ye(r,n,f*Math.cos(d*Pu),y);return{center:p,circleTangency:g,lineTangency:b,theta:d}},Bk=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,s=t.startAngle,l=t.endAngle,c=oH(s,l),u=s+c,f=ye(r,n,i,s),d=ye(r,n,i,u),h="M ".concat(f.x,",").concat(f.y,`
+ A `).concat(i,",").concat(i,`,0,
+ `).concat(+(Math.abs(c)>180),",").concat(+(s>u),`,
+ `).concat(d.x,",").concat(d.y,`
+ `);if(a>0){var p=ye(r,n,a,s),g=ye(r,n,a,u);h+="L ".concat(g.x,",").concat(g.y,`
+ A `).concat(a,",").concat(a,`,0,
+ `).concat(+(Math.abs(c)>180),",").concat(+(s<=u),`,
+ `).concat(p.x,",").concat(p.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},sH=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,s=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,f=t.endAngle,d=rt(f-u),h=ec({cx:r,cy:n,radius:i,angle:u,sign:d,cornerRadius:s,cornerIsExternal:c}),p=h.circleTangency,g=h.lineTangency,y=h.theta,b=ec({cx:r,cy:n,radius:i,angle:f,sign:-d,cornerRadius:s,cornerIsExternal:c}),v=b.circleTangency,m=b.lineTangency,x=b.theta,S=c?Math.abs(u-f):Math.abs(u-f)-y-x;if(S<0)return l?"M ".concat(g.x,",").concat(g.y,`
+ a`).concat(s,",").concat(s,",0,0,1,").concat(s*2,`,0
+ a`).concat(s,",").concat(s,",0,0,1,").concat(-s*2,`,0
+ `):Bk({cx:r,cy:n,innerRadius:a,outerRadius:i,startAngle:u,endAngle:f});var j="M ".concat(g.x,",").concat(g.y,`
+ A`).concat(s,",").concat(s,",0,0,").concat(+(d<0),",").concat(p.x,",").concat(p.y,`
+ A`).concat(i,",").concat(i,",0,").concat(+(S>180),",").concat(+(d<0),",").concat(v.x,",").concat(v.y,`
+ A`).concat(s,",").concat(s,",0,0,").concat(+(d<0),",").concat(m.x,",").concat(m.y,`
+ `);if(a>0){var w=ec({cx:r,cy:n,radius:a,angle:u,sign:d,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),_=w.circleTangency,O=w.lineTangency,N=w.theta,k=ec({cx:r,cy:n,radius:a,angle:f,sign:-d,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),E=k.circleTangency,T=k.lineTangency,D=k.theta,A=c?Math.abs(u-f):Math.abs(u-f)-N-D;if(A<0&&s===0)return"".concat(j,"L").concat(r,",").concat(n,"Z");j+="L".concat(T.x,",").concat(T.y,`
+ A`).concat(s,",").concat(s,",0,0,").concat(+(d<0),",").concat(E.x,",").concat(E.y,`
+ A`).concat(a,",").concat(a,",0,").concat(+(A>180),",").concat(+(d>0),",").concat(_.x,",").concat(_.y,`
+ A`).concat(s,",").concat(s,",0,0,").concat(+(d<0),",").concat(O.x,",").concat(O.y,"Z")}else j+="L".concat(r,",").concat(n,"Z");return j},lH={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Fk=function(t){var r=Xb(Xb({},lH),t),n=r.cx,a=r.cy,i=r.innerRadius,s=r.outerRadius,l=r.cornerRadius,c=r.forceCornerRadius,u=r.cornerIsExternal,f=r.startAngle,d=r.endAngle,h=r.className;if(s<i||f===d)return null;var p=ee("recharts-sector",h),g=s-i,y=xt(l,g,0,!0),b;return y>0&&Math.abs(f-d)<360?b=sH({cx:n,cy:a,innerRadius:i,outerRadius:s,cornerRadius:Math.min(y,g/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:f,endAngle:d}):b=Bk({cx:n,cy:a,innerRadius:i,outerRadius:s,startAngle:f,endAngle:d}),$.createElement("path",im({},X(r,!0),{className:p,d:b,role:"img"}))};function Gs(e){"@babel/helpers - typeof";return Gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gs(e)}function om(){return om=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},om.apply(this,arguments)}function Qb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Jb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Qb(Object(r),!0).forEach(function(n){cH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cH(e,t,r){return t=uH(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uH(e){var t=dH(e,"string");return Gs(t)=="symbol"?t:t+""}function dH(e,t){if(Gs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Gs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Zb={curveBasisClosed:h4,curveBasisOpen:p4,curveBasis:f4,curveBumpX:J5,curveBumpY:Z5,curveLinearClosed:m4,curveLinear:Dd,curveMonotoneX:v4,curveMonotoneY:y4,curveNatural:g4,curveStep:x4,curveStepAfter:j4,curveStepBefore:b4},tc=function(t){return t.x===+t.x&&t.y===+t.y},To=function(t){return t.x},Mo=function(t){return t.y},fH=function(t,r){if(Q(t))return t;var n="curve".concat(Id(t));return(n==="curveMonotone"||n==="curveBump")&&r?Zb["".concat(n).concat(r==="vertical"?"Y":"X")]:Zb[n]||Dd},hH=function(t){var r=t.type,n=r===void 0?"linear":r,a=t.points,i=a===void 0?[]:a,s=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,f=fH(n,l),d=u?i.filter(function(y){return tc(y)}):i,h;if(Array.isArray(s)){var p=u?s.filter(function(y){return tc(y)}):s,g=d.map(function(y,b){return Jb(Jb({},y),{},{base:p[b]})});return l==="vertical"?h=Kl().y(Mo).x1(To).x0(function(y){return y.base.x}):h=Kl().x(To).y1(Mo).y0(function(y){return y.base.y}),h.defined(tc).curve(f),h(g)}return l==="vertical"&&U(s)?h=Kl().y(Mo).x1(To).x0(s):U(s)?h=Kl().x(To).y1(Mo).y0(s):h=$S().x(To).y(Mo),h.defined(tc).curve(f),h(d)},xi=function(t){var r=t.className,n=t.points,a=t.path,i=t.pathRef;if((!n||!n.length)&&!a)return null;var s=n&&n.length?hH(t):a;return P.createElement("path",om({},X(t,!1),Jc(t),{className:ee("recharts-curve",r),d:s,ref:i}))},zk={exports:{}},pH="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",mH=pH,vH=mH;function Wk(){}function Uk(){}Uk.resetWarningCache=Wk;var yH=function(){function e(n,a,i,s,l,c){if(c!==vH){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Uk,resetWarningCache:Wk};return r.PropTypes=r,r};zk.exports=yH();var gH=zk.exports;const ce=de(gH),{getOwnPropertyNames:xH,getOwnPropertySymbols:bH}=Object,{hasOwnProperty:jH}=Object.prototype;function lh(e,t){return function(n,a,i){return e(n,a,i)&&t(n,a,i)}}function rc(e){return function(r,n,a){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,a);const{cache:i}=a,s=i.get(r),l=i.get(n);if(s&&l)return s===n&&l===r;i.set(r,n),i.set(n,r);const c=e(r,n,a);return i.delete(r),i.delete(n),c}}function wH(e){return e!=null?e[Symbol.toStringTag]:void 0}function e1(e){return xH(e).concat(bH(e))}const SH=Object.hasOwn||((e,t)=>jH.call(e,t));function Ma(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const _H="__v",kH="__o",OH="_owner",{getOwnPropertyDescriptor:t1,keys:r1}=Object;function NH(e,t){return e.byteLength===t.byteLength&&Cu(new Uint8Array(e),new Uint8Array(t))}function PH(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function AH(e,t){return e.byteLength===t.byteLength&&Cu(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function CH(e,t){return Ma(e.getTime(),t.getTime())}function EH(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function $H(e,t){return e===t}function n1(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),i=e.entries();let s,l,c=0;for(;(s=i.next())&&!s.done;){const u=t.entries();let f=!1,d=0;for(;(l=u.next())&&!l.done;){if(a[d]){d++;continue}const h=s.value,p=l.value;if(r.equals(h[0],p[0],c,d,e,t,r)&&r.equals(h[1],p[1],h[0],p[0],e,t,r)){f=a[d]=!0;break}d++}if(!f)return!1;c++}return!0}const TH=Ma;function MH(e,t,r){const n=r1(e);let a=n.length;if(r1(t).length!==a)return!1;for(;a-- >0;)if(!Hk(e,t,r,n[a]))return!1;return!0}function Io(e,t,r){const n=e1(e);let a=n.length;if(e1(t).length!==a)return!1;let i,s,l;for(;a-- >0;)if(i=n[a],!Hk(e,t,r,i)||(s=t1(e,i),l=t1(t,i),(s||l)&&(!s||!l||s.configurable!==l.configurable||s.enumerable!==l.enumerable||s.writable!==l.writable)))return!1;return!0}function IH(e,t){return Ma(e.valueOf(),t.valueOf())}function LH(e,t){return e.source===t.source&&e.flags===t.flags}function a1(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),i=e.values();let s,l;for(;(s=i.next())&&!s.done;){const c=t.values();let u=!1,f=0;for(;(l=c.next())&&!l.done;){if(!a[f]&&r.equals(s.value,l.value,s.value,l.value,e,t,r)){u=a[f]=!0;break}f++}if(!u)return!1}return!0}function Cu(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function DH(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function Hk(e,t,r,n){return(n===OH||n===kH||n===_H)&&(e.$$typeof||t.$$typeof)?!0:SH(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const RH="[object ArrayBuffer]",BH="[object Arguments]",FH="[object Boolean]",zH="[object DataView]",WH="[object Date]",UH="[object Error]",HH="[object Map]",KH="[object Number]",VH="[object Object]",GH="[object RegExp]",YH="[object Set]",qH="[object String]",XH={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},QH="[object URL]",JH=Object.prototype.toString;function ZH({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:a,areFunctionsEqual:i,areMapsEqual:s,areNumbersEqual:l,areObjectsEqual:c,arePrimitiveWrappersEqual:u,areRegExpsEqual:f,areSetsEqual:d,areTypedArraysEqual:h,areUrlsEqual:p,unknownTagComparators:g}){return function(b,v,m){if(b===v)return!0;if(b==null||v==null)return!1;const x=typeof b;if(x!==typeof v)return!1;if(x!=="object")return x==="number"?l(b,v,m):x==="function"?i(b,v,m):!1;const S=b.constructor;if(S!==v.constructor)return!1;if(S===Object)return c(b,v,m);if(Array.isArray(b))return t(b,v,m);if(S===Date)return n(b,v,m);if(S===RegExp)return f(b,v,m);if(S===Map)return s(b,v,m);if(S===Set)return d(b,v,m);const j=JH.call(b);if(j===WH)return n(b,v,m);if(j===GH)return f(b,v,m);if(j===HH)return s(b,v,m);if(j===YH)return d(b,v,m);if(j===VH)return typeof b.then!="function"&&typeof v.then!="function"&&c(b,v,m);if(j===QH)return p(b,v,m);if(j===UH)return a(b,v,m);if(j===BH)return c(b,v,m);if(XH[j])return h(b,v,m);if(j===RH)return e(b,v,m);if(j===zH)return r(b,v,m);if(j===FH||j===KH||j===qH)return u(b,v,m);if(g){let w=g[j];if(!w){const _=wH(b);_&&(w=g[_])}if(w)return w(b,v,m)}return!1}}function eK({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:NH,areArraysEqual:r?Io:PH,areDataViewsEqual:AH,areDatesEqual:CH,areErrorsEqual:EH,areFunctionsEqual:$H,areMapsEqual:r?lh(n1,Io):n1,areNumbersEqual:TH,areObjectsEqual:r?Io:MH,arePrimitiveWrappersEqual:IH,areRegExpsEqual:LH,areSetsEqual:r?lh(a1,Io):a1,areTypedArraysEqual:r?lh(Cu,Io):Cu,areUrlsEqual:DH,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const a=rc(n.areArraysEqual),i=rc(n.areMapsEqual),s=rc(n.areObjectsEqual),l=rc(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:s,areSetsEqual:l})}return n}function tK(e){return function(t,r,n,a,i,s,l){return e(t,r,l)}}function rK({circular:e,comparator:t,createState:r,equals:n,strict:a}){if(r)return function(l,c){const{cache:u=e?new WeakMap:void 0,meta:f}=r();return t(l,c,{cache:u,equals:n,meta:f,strict:a})};if(e)return function(l,c){return t(l,c,{cache:new WeakMap,equals:n,meta:void 0,strict:a})};const i={cache:void 0,equals:n,meta:void 0,strict:a};return function(l,c){return t(l,c,i)}}const nK=Kn();Kn({strict:!0});Kn({circular:!0});Kn({circular:!0,strict:!0});Kn({createInternalComparator:()=>Ma});Kn({strict:!0,createInternalComparator:()=>Ma});Kn({circular:!0,createInternalComparator:()=>Ma});Kn({circular:!0,createInternalComparator:()=>Ma,strict:!0});function Kn(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:a=!1}=e,i=eK(e),s=ZH(i),l=r?r(s):tK(s);return rK({circular:t,comparator:s,createState:n,equals:l,strict:a})}function aK(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function i1(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function a(i){r<0&&(r=i),i-r>t?(e(i),r=-1):aK(a)};requestAnimationFrame(n)}function sm(e){"@babel/helpers - typeof";return sm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sm(e)}function iK(e){return cK(e)||lK(e)||sK(e)||oK()}function oK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sK(e,t){if(e){if(typeof e=="string")return o1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o1(e,t)}}function o1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function lK(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function cK(e){if(Array.isArray(e))return e}function uK(){var e={},t=function(){return null},r=!1,n=function a(i){if(!r){if(Array.isArray(i)){if(!i.length)return;var s=i,l=iK(s),c=l[0],u=l.slice(1);if(typeof c=="number"){i1(a.bind(null,u),c);return}a(c),i1(a.bind(null,u));return}sm(i)==="object"&&(e=i,t(e)),typeof i=="function"&&i()}};return{stop:function(){r=!0},start:function(i){r=!1,n(i)},subscribe:function(i){return t=i,function(){t=function(){return null}}}}}function Ys(e){"@babel/helpers - typeof";return Ys=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ys(e)}function s1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function l1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?s1(Object(r),!0).forEach(function(n){Kk(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Kk(e,t,r){return t=dK(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dK(e){var t=fK(e,"string");return Ys(t)==="symbol"?t:String(t)}function fK(e,t){if(Ys(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ys(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hK=function(t,r){return[Object.keys(t),Object.keys(r)].reduce(function(n,a){return n.filter(function(i){return a.includes(i)})})},pK=function(t){return t},mK=function(t){return t.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},as=function(t,r){return Object.keys(r).reduce(function(n,a){return l1(l1({},n),{},Kk({},a,t(a,r[a])))},{})},c1=function(t,r,n){return t.map(function(a){return"".concat(mK(a)," ").concat(r,"ms ").concat(n)}).join(",")};function vK(e,t){return xK(e)||gK(e,t)||Vk(e,t)||yK()}function yK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gK(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function xK(e){if(Array.isArray(e))return e}function bK(e){return SK(e)||wK(e)||Vk(e)||jK()}function jK(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vk(e,t){if(e){if(typeof e=="string")return lm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lm(e,t)}}function wK(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function SK(e){if(Array.isArray(e))return lm(e)}function lm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Eu=1e-4,Gk=function(t,r){return[0,3*t,3*r-6*t,3*t-3*r+1]},Yk=function(t,r){return t.map(function(n,a){return n*Math.pow(r,a)}).reduce(function(n,a){return n+a})},u1=function(t,r){return function(n){var a=Gk(t,r);return Yk(a,n)}},_K=function(t,r){return function(n){var a=Gk(t,r),i=[].concat(bK(a.map(function(s,l){return s*l}).slice(1)),[0]);return Yk(i,n)}},d1=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=r[0],i=r[1],s=r[2],l=r[3];if(r.length===1)switch(r[0]){case"linear":a=0,i=0,s=1,l=1;break;case"ease":a=.25,i=.1,s=.25,l=1;break;case"ease-in":a=.42,i=0,s=1,l=1;break;case"ease-out":a=.42,i=0,s=.58,l=1;break;case"ease-in-out":a=0,i=0,s=.58,l=1;break;default:{var c=r[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(b){return parseFloat(b)}),f=vK(u,4);a=f[0],i=f[1],s=f[2],l=f[3]}}}var d=u1(a,s),h=u1(i,l),p=_K(a,s),g=function(v){return v>1?1:v<0?0:v},y=function(v){for(var m=v>1?1:v,x=m,S=0;S<8;++S){var j=d(x)-m,w=p(x);if(Math.abs(j-m)<Eu||w<Eu)return h(x);x=g(x-j/w)}return h(x)};return y.isStepper=!1,y},kK=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,a=t.damping,i=a===void 0?8:a,s=t.dt,l=s===void 0?17:s,c=function(f,d,h){var p=-(f-d)*n,g=h*i,y=h+(p-g)*l/1e3,b=h*l/1e3+f;return Math.abs(b-d)<Eu&&Math.abs(y)<Eu?[d,0]:[b,y]};return c.isStepper=!0,c.dt=l,c},OK=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=r[0];if(typeof a=="string")switch(a){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return d1(a);case"spring":return kK();default:if(a.split("(")[0]==="cubic-bezier")return d1(a)}return typeof a=="function"?a:null};function qs(e){"@babel/helpers - typeof";return qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qs(e)}function f1(e){return AK(e)||PK(e)||qk(e)||NK()}function NK(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PK(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function AK(e){if(Array.isArray(e))return um(e)}function h1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ot(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?h1(Object(r),!0).forEach(function(n){cm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cm(e,t,r){return t=CK(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CK(e){var t=EK(e,"string");return qs(t)==="symbol"?t:String(t)}function EK(e,t){if(qs(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(qs(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $K(e,t){return IK(e)||MK(e,t)||qk(e,t)||TK()}function TK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qk(e,t){if(e){if(typeof e=="string")return um(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return um(e,t)}}function um(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function MK(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function IK(e){if(Array.isArray(e))return e}var $u=function(t,r,n){return t+(r-t)*n},dm=function(t){var r=t.from,n=t.to;return r!==n},LK=function e(t,r,n){var a=as(function(i,s){if(dm(s)){var l=t(s.from,s.to,s.velocity),c=$K(l,2),u=c[0],f=c[1];return ot(ot({},s),{},{from:u,velocity:f})}return s},r);return n<1?as(function(i,s){return dm(s)?ot(ot({},s),{},{velocity:$u(s.velocity,a[i].velocity,n),from:$u(s.from,a[i].from,n)}):s},r):e(t,a,n-1)};const DK=function(e,t,r,n,a){var i=hK(e,t),s=i.reduce(function(b,v){return ot(ot({},b),{},cm({},v,[e[v],t[v]]))},{}),l=i.reduce(function(b,v){return ot(ot({},b),{},cm({},v,{from:e[v],velocity:0,to:t[v]}))},{}),c=-1,u,f,d=function(){return null},h=function(){return as(function(v,m){return m.from},l)},p=function(){return!Object.values(l).filter(dm).length},g=function(v){u||(u=v);var m=v-u,x=m/r.dt;l=LK(r,l,x),a(ot(ot(ot({},e),t),h())),u=v,p()||(c=requestAnimationFrame(d))},y=function(v){f||(f=v);var m=(v-f)/n,x=as(function(j,w){return $u.apply(void 0,f1(w).concat([r(m)]))},s);if(a(ot(ot(ot({},e),t),x)),m<1)c=requestAnimationFrame(d);else{var S=as(function(j,w){return $u.apply(void 0,f1(w).concat([r(1)]))},s);a(ot(ot(ot({},e),t),S))}};return d=r.isStepper?g:y,function(){return requestAnimationFrame(d),function(){cancelAnimationFrame(c)}}};function Li(e){"@babel/helpers - typeof";return Li=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Li(e)}var RK=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function BK(e,t){if(e==null)return{};var r=FK(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function FK(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function ch(e){return HK(e)||UK(e)||WK(e)||zK()}function zK(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WK(e,t){if(e){if(typeof e=="string")return fm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fm(e,t)}}function UK(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function HK(e){if(Array.isArray(e))return fm(e)}function fm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function p1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function cr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?p1(Object(r),!0).forEach(function(n){Uo(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Uo(e,t,r){return t=Xk(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function KK(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VK(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Xk(n.key),n)}}function GK(e,t,r){return t&&VK(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xk(e){var t=YK(e,"string");return Li(t)==="symbol"?t:String(t)}function YK(e,t){if(Li(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Li(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qK(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hm(e,t)}function hm(e,t){return hm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},hm(e,t)}function XK(e){var t=QK();return function(){var n=Tu(e),a;if(t){var i=Tu(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return pm(this,a)}}function pm(e,t){if(t&&(Li(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mm(e)}function mm(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function QK(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Tu(e){return Tu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Tu(e)}var br=function(e){qK(r,e);var t=XK(r);function r(n,a){var i;KK(this,r),i=t.call(this,n,a);var s=i.props,l=s.isActive,c=s.attributeName,u=s.from,f=s.to,d=s.steps,h=s.children,p=s.duration;if(i.handleStyleChange=i.handleStyleChange.bind(mm(i)),i.changeStyle=i.changeStyle.bind(mm(i)),!l||p<=0)return i.state={style:{}},typeof h=="function"&&(i.state={style:f}),pm(i);if(d&&d.length)i.state={style:d[0].style};else if(u){if(typeof h=="function")return i.state={style:u},pm(i);i.state={style:c?Uo({},c,u):u}}else i.state={style:{}};return i}return GK(r,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,s=a.canBegin;this.mounted=!0,!(!i||!s)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,s=i.isActive,l=i.canBegin,c=i.attributeName,u=i.shouldReAnimate,f=i.to,d=i.from,h=this.state.style;if(l){if(!s){var p={style:c?Uo({},c,f):f};this.state&&h&&(c&&h[c]!==f||!c&&h!==f)&&this.setState(p);return}if(!(nK(a.to,f)&&a.canBegin&&a.isActive)){var g=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var y=g||u?d:a.to;if(this.state&&h){var b={style:c?Uo({},c,y):y};(c&&h[c]!==y||!c&&h!==y)&&this.setState(b)}this.runAnimation(cr(cr({},this.props),{},{from:y,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var i=this,s=a.from,l=a.to,c=a.duration,u=a.easing,f=a.begin,d=a.onAnimationEnd,h=a.onAnimationStart,p=DK(s,l,OK(u),c,this.changeStyle),g=function(){i.stopJSAnimation=p()};this.manager.start([h,f,g,c,d])}},{key:"runStepAnimation",value:function(a){var i=this,s=a.steps,l=a.begin,c=a.onAnimationStart,u=s[0],f=u.style,d=u.duration,h=d===void 0?0:d,p=function(y,b,v){if(v===0)return y;var m=b.duration,x=b.easing,S=x===void 0?"ease":x,j=b.style,w=b.properties,_=b.onAnimationEnd,O=v>0?s[v-1]:b,N=w||Object.keys(j);if(typeof S=="function"||S==="spring")return[].concat(ch(y),[i.runJSAnimation.bind(i,{from:O.style,to:j,duration:m,easing:S}),m]);var k=c1(N,m,S),E=cr(cr(cr({},O.style),j),{},{transition:k});return[].concat(ch(y),[E,m,_]).filter(pK)};return this.manager.start([c].concat(ch(s.reduce(p,[f,Math.max(h,l)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=uK());var i=a.begin,s=a.duration,l=a.attributeName,c=a.to,u=a.easing,f=a.onAnimationStart,d=a.onAnimationEnd,h=a.steps,p=a.children,g=this.manager;if(this.unSubscribe=g.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(a);return}if(h.length>1){this.runStepAnimation(a);return}var y=l?Uo({},l,c):c,b=c1(Object.keys(y),s,u);g.start([f,i,cr(cr({},y),{},{transition:b}),s,d])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var s=a.duration;a.attributeName,a.easing;var l=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var c=BK(a,RK),u=P.Children.count(i),f=this.state.style;if(typeof i=="function")return i(f);if(!l||u===0||s<=0)return i;var d=function(p){var g=p.props,y=g.style,b=y===void 0?{}:y,v=g.className,m=P.cloneElement(p,cr(cr({},c),{},{style:cr(cr({},b),f),className:v}));return m};return u===1?d(P.Children.only(i)):$.createElement("div",null,P.Children.map(i,function(h){return d(h)}))}}]),r}(P.PureComponent);br.displayName="Animate";br.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};br.propTypes={from:ce.oneOfType([ce.object,ce.string]),to:ce.oneOfType([ce.object,ce.string]),attributeName:ce.string,duration:ce.number,begin:ce.number,easing:ce.oneOfType([ce.string,ce.func]),steps:ce.arrayOf(ce.shape({duration:ce.number.isRequired,style:ce.object.isRequired,easing:ce.oneOfType([ce.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),ce.func]),properties:ce.arrayOf("string"),onAnimationEnd:ce.func})),children:ce.oneOfType([ce.node,ce.func]),isActive:ce.bool,canBegin:ce.bool,onAnimationEnd:ce.func,shouldReAnimate:ce.bool,onAnimationStart:ce.func,onAnimationReStart:ce.func};function Xs(e){"@babel/helpers - typeof";return Xs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xs(e)}function Mu(){return Mu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mu.apply(this,arguments)}function JK(e,t){return rV(e)||tV(e,t)||eV(e,t)||ZK()}function ZK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eV(e,t){if(e){if(typeof e=="string")return m1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m1(e,t)}}function m1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function tV(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function rV(e){if(Array.isArray(e))return e}function v1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function y1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?v1(Object(r),!0).forEach(function(n){nV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function nV(e,t,r){return t=aV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aV(e){var t=iV(e,"string");return Xs(t)=="symbol"?t:t+""}function iV(e,t){if(Xs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Xs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var g1=function(t,r,n,a,i){var s=Math.min(Math.abs(n)/2,Math.abs(a)/2),l=a>=0?1:-1,c=n>=0?1:-1,u=a>=0&&n>=0||a<0&&n<0?1:0,f;if(s>0&&i instanceof Array){for(var d=[0,0,0,0],h=0,p=4;h<p;h++)d[h]=i[h]>s?s:i[h];f="M".concat(t,",").concat(r+l*d[0]),d[0]>0&&(f+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(u,",").concat(t+c*d[0],",").concat(r)),f+="L ".concat(t+n-c*d[1],",").concat(r),d[1]>0&&(f+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(u,`,
+ `).concat(t+n,",").concat(r+l*d[1])),f+="L ".concat(t+n,",").concat(r+a-l*d[2]),d[2]>0&&(f+="A ".concat(d[2],",").concat(d[2],",0,0,").concat(u,`,
+ `).concat(t+n-c*d[2],",").concat(r+a)),f+="L ".concat(t+c*d[3],",").concat(r+a),d[3]>0&&(f+="A ".concat(d[3],",").concat(d[3],",0,0,").concat(u,`,
+ `).concat(t,",").concat(r+a-l*d[3])),f+="Z"}else if(s>0&&i===+i&&i>0){var g=Math.min(s,i);f="M ".concat(t,",").concat(r+l*g,`
+ A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+c*g,",").concat(r,`
+ L `).concat(t+n-c*g,",").concat(r,`
+ A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+n,",").concat(r+l*g,`
+ L `).concat(t+n,",").concat(r+a-l*g,`
+ A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t+n-c*g,",").concat(r+a,`
+ L `).concat(t+c*g,",").concat(r+a,`
+ A `).concat(g,",").concat(g,",0,0,").concat(u,",").concat(t,",").concat(r+a-l*g," Z")}else f="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(a," h ").concat(-n," Z");return f},oV=function(t,r){if(!t||!r)return!1;var n=t.x,a=t.y,i=r.x,s=r.y,l=r.width,c=r.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(i,i+l),f=Math.max(i,i+l),d=Math.min(s,s+c),h=Math.max(s,s+c);return n>=u&&n<=f&&a>=d&&a<=h}return!1},sV={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Fy=function(t){var r=y1(y1({},sV),t),n=P.useRef(),a=P.useState(-1),i=JK(a,2),s=i[0],l=i[1];P.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&l(S)}catch{}},[]);var c=r.x,u=r.y,f=r.width,d=r.height,h=r.radius,p=r.className,g=r.animationEasing,y=r.animationDuration,b=r.animationBegin,v=r.isAnimationActive,m=r.isUpdateAnimationActive;if(c!==+c||u!==+u||f!==+f||d!==+d||f===0||d===0)return null;var x=ee("recharts-rectangle",p);return m?$.createElement(br,{canBegin:s>0,from:{width:f,height:d,x:c,y:u},to:{width:f,height:d,x:c,y:u},duration:y,animationEasing:g,isActive:m},function(S){var j=S.width,w=S.height,_=S.x,O=S.y;return $.createElement(br,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:y,isActive:v,easing:g},$.createElement("path",Mu({},X(r,!0),{className:x,d:g1(_,O,j,w,h),ref:n})))}):$.createElement("path",Mu({},X(r,!0),{className:x,d:g1(c,u,f,d,h)}))},lV=["points","className","baseLinePoints","connectNulls"];function ii(){return ii=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ii.apply(this,arguments)}function cV(e,t){if(e==null)return{};var r=uV(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function uV(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function x1(e){return pV(e)||hV(e)||fV(e)||dV()}function dV(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fV(e,t){if(e){if(typeof e=="string")return vm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vm(e,t)}}function hV(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pV(e){if(Array.isArray(e))return vm(e)}function vm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var b1=function(t){return t&&t.x===+t.x&&t.y===+t.y},mV=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){b1(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),b1(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},is=function(t,r){var n=mV(t);r&&(n=[n.reduce(function(i,s){return[].concat(x1(i),x1(s))},[])]);var a=n.map(function(i){return i.reduce(function(s,l,c){return"".concat(s).concat(c===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return n.length===1?"".concat(a,"Z"):a},vV=function(t,r,n){var a=is(t,n);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(is(r.reverse(),n).slice(1))},yV=function(t){var r=t.points,n=t.className,a=t.baseLinePoints,i=t.connectNulls,s=cV(t,lV);if(!r||!r.length)return null;var l=ee("recharts-polygon",n);if(a&&a.length){var c=s.stroke&&s.stroke!=="none",u=vV(r,a,i);return $.createElement("g",{className:l},$.createElement("path",ii({},X(s,!0),{fill:u.slice(-1)==="Z"?s.fill:"none",stroke:"none",d:u})),c?$.createElement("path",ii({},X(s,!0),{fill:"none",d:is(r,i)})):null,c?$.createElement("path",ii({},X(s,!0),{fill:"none",d:is(a,i)})):null)}var f=is(r,i);return $.createElement("path",ii({},X(s,!0),{fill:f.slice(-1)==="Z"?s.fill:"none",className:l,d:f}))};function ym(){return ym=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ym.apply(this,arguments)}var Zd=function(t){var r=t.cx,n=t.cy,a=t.r,i=t.className,s=ee("recharts-dot",i);return r===+r&&n===+n&&a===+a?P.createElement("circle",ym({},X(t,!1),Jc(t),{className:s,cx:r,cy:n,r:a})):null};function Qs(e){"@babel/helpers - typeof";return Qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qs(e)}var gV=["x","y","top","left","width","height","className"];function gm(){return gm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gm.apply(this,arguments)}function j1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function xV(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?j1(Object(r),!0).forEach(function(n){bV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bV(e,t,r){return t=jV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jV(e){var t=wV(e,"string");return Qs(t)=="symbol"?t:t+""}function wV(e,t){if(Qs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Qs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function SV(e,t){if(e==null)return{};var r=_V(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _V(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var kV=function(t,r,n,a,i,s){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(s,",").concat(r,"h").concat(n)},OV=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,s=t.top,l=s===void 0?0:s,c=t.left,u=c===void 0?0:c,f=t.width,d=f===void 0?0:f,h=t.height,p=h===void 0?0:h,g=t.className,y=SV(t,gV),b=xV({x:n,y:i,top:l,left:u,width:d,height:p},y);return!U(n)||!U(i)||!U(d)||!U(p)||!U(l)||!U(u)?null:$.createElement("path",gm({},X(b,!0),{className:ee("recharts-cross",g),d:kV(n,i,d,p,l,u)}))},NV=Yd,PV=ik,AV=Ir;function CV(e,t){return e&&e.length?NV(e,AV(t),PV):void 0}var EV=CV;const $V=de(EV);var TV=Yd,MV=Ir,IV=ok;function LV(e,t){return e&&e.length?TV(e,MV(t),IV):void 0}var DV=LV;const RV=de(DV);var BV=["cx","cy","angle","ticks","axisLine"],FV=["ticks","tick","angle","tickFormatter","stroke"];function Di(e){"@babel/helpers - typeof";return Di=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Di(e)}function os(){return os=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},os.apply(this,arguments)}function w1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function qn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?w1(Object(r),!0).forEach(function(n){ef(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function S1(e,t){if(e==null)return{};var r=zV(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zV(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function WV(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Jk(n.key),n)}}function UV(e,t,r){return t&&_1(e.prototype,t),r&&_1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function HV(e,t,r){return t=Iu(t),KV(e,Qk()?Reflect.construct(t,r||[],Iu(e).constructor):t.apply(e,r))}function KV(e,t){if(t&&(Di(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return VV(e)}function VV(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Qk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Qk=function(){return!!e})()}function Iu(e){return Iu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Iu(e)}function GV(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xm(e,t)}function xm(e,t){return xm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},xm(e,t)}function ef(e,t,r){return t=Jk(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jk(e){var t=YV(e,"string");return Di(t)=="symbol"?t:t+""}function YV(e,t){if(Di(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Di(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jl=function(e){function t(){return WV(this,t),HV(this,t,arguments)}return GV(t,e),UV(t,[{key:"getTickValueCoord",value:function(n){var a=n.coordinate,i=this.props,s=i.angle,l=i.cx,c=i.cy;return ye(l,c,a,s)}},{key:"getTickTextAnchor",value:function(){var n=this.props.orientation,a;switch(n){case"left":a="end";break;case"right":a="start";break;default:a="middle";break}return a}},{key:"getViewBox",value:function(){var n=this.props,a=n.cx,i=n.cy,s=n.angle,l=n.ticks,c=$V(l,function(f){return f.coordinate||0}),u=RV(l,function(f){return f.coordinate||0});return{cx:a,cy:i,startAngle:s,endAngle:s,innerRadius:u.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.cx,i=n.cy,s=n.angle,l=n.ticks,c=n.axisLine,u=S1(n,BV),f=l.reduce(function(g,y){return[Math.min(g[0],y.coordinate),Math.max(g[1],y.coordinate)]},[1/0,-1/0]),d=ye(a,i,f[0],s),h=ye(a,i,f[1],s),p=qn(qn(qn({},X(u,!1)),{},{fill:"none"},X(c,!1)),{},{x1:d.x,y1:d.y,x2:h.x,y2:h.y});return $.createElement("line",os({className:"recharts-polar-radius-axis-line"},p))}},{key:"renderTicks",value:function(){var n=this,a=this.props,i=a.ticks,s=a.tick,l=a.angle,c=a.tickFormatter,u=a.stroke,f=S1(a,FV),d=this.getTickTextAnchor(),h=X(f,!1),p=X(s,!1),g=i.map(function(y,b){var v=n.getTickValueCoord(y),m=qn(qn(qn(qn({textAnchor:d,transform:"rotate(".concat(90-l,", ").concat(v.x,", ").concat(v.y,")")},h),{},{stroke:"none",fill:u},p),{},{index:b},v),{},{payload:y});return $.createElement(ne,os({className:ee("recharts-polar-radius-axis-tick",Dk(s)),key:"tick-".concat(y.coordinate)},en(n.props,y,b)),t.renderTickItem(s,m,c?c(y.value,b):y.value))});return $.createElement(ne,{className:"recharts-polar-radius-axis-ticks"},g)}},{key:"render",value:function(){var n=this.props,a=n.ticks,i=n.axisLine,s=n.tick;return!a||!a.length?null:$.createElement(ne,{className:ee("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),s&&this.renderTicks(),tt.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(n,a,i){var s;return $.isValidElement(n)?s=$.cloneElement(n,a):Q(n)?s=n(a):s=$.createElement(Sa,os({},a,{className:"recharts-polar-radius-axis-tick-value"}),i),s}}])}(P.PureComponent);ef(jl,"displayName","PolarRadiusAxis");ef(jl,"axisType","radiusAxis");ef(jl,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function Ri(e){"@babel/helpers - typeof";return Ri=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ri(e)}function ra(){return ra=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ra.apply(this,arguments)}function k1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Xn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?k1(Object(r),!0).forEach(function(n){tf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qV(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,eO(n.key),n)}}function XV(e,t,r){return t&&O1(e.prototype,t),r&&O1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function QV(e,t,r){return t=Lu(t),JV(e,Zk()?Reflect.construct(t,r||[],Lu(e).constructor):t.apply(e,r))}function JV(e,t){if(t&&(Ri(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ZV(e)}function ZV(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zk(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Zk=function(){return!!e})()}function Lu(e){return Lu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Lu(e)}function eG(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bm(e,t)}function bm(e,t){return bm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},bm(e,t)}function tf(e,t,r){return t=eO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eO(e){var t=tG(e,"string");return Ri(t)=="symbol"?t:t+""}function tG(e,t){if(Ri(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ri(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rG=Math.PI/180,N1=1e-5,wl=function(e){function t(){return qV(this,t),QV(this,t,arguments)}return eG(t,e),XV(t,[{key:"getTickLineCoord",value:function(n){var a=this.props,i=a.cx,s=a.cy,l=a.radius,c=a.orientation,u=a.tickSize,f=u||8,d=ye(i,s,l,n.coordinate),h=ye(i,s,l+(c==="inner"?-1:1)*f,n.coordinate);return{x1:d.x,y1:d.y,x2:h.x,y2:h.y}}},{key:"getTickTextAnchor",value:function(n){var a=this.props.orientation,i=Math.cos(-n.coordinate*rG),s;return i>N1?s=a==="outer"?"start":"end":i<-N1?s=a==="outer"?"end":"start":s="middle",s}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.cx,i=n.cy,s=n.radius,l=n.axisLine,c=n.axisLineType,u=Xn(Xn({},X(this.props,!1)),{},{fill:"none"},X(l,!1));if(c==="circle")return $.createElement(Zd,ra({className:"recharts-polar-angle-axis-line"},u,{cx:a,cy:i,r:s}));var f=this.props.ticks,d=f.map(function(h){return ye(a,i,s,h.coordinate)});return $.createElement(yV,ra({className:"recharts-polar-angle-axis-line"},u,{points:d}))}},{key:"renderTicks",value:function(){var n=this,a=this.props,i=a.ticks,s=a.tick,l=a.tickLine,c=a.tickFormatter,u=a.stroke,f=X(this.props,!1),d=X(s,!1),h=Xn(Xn({},f),{},{fill:"none"},X(l,!1)),p=i.map(function(g,y){var b=n.getTickLineCoord(g),v=n.getTickTextAnchor(g),m=Xn(Xn(Xn({textAnchor:v},f),{},{stroke:"none",fill:u},d),{},{index:y,payload:g,x:b.x2,y:b.y2});return $.createElement(ne,ra({className:ee("recharts-polar-angle-axis-tick",Dk(s)),key:"tick-".concat(g.coordinate)},en(n.props,g,y)),l&&$.createElement("line",ra({className:"recharts-polar-angle-axis-tick-line"},h,b)),s&&t.renderTickItem(s,m,c?c(g.value,y):g.value))});return $.createElement(ne,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var n=this.props,a=n.ticks,i=n.radius,s=n.axisLine;return i<=0||!a||!a.length?null:$.createElement(ne,{className:ee("recharts-polar-angle-axis",this.props.className)},s&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,a,i){var s;return $.isValidElement(n)?s=$.cloneElement(n,a):Q(n)?s=n(a):s=$.createElement(Sa,ra({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),s}}])}(P.PureComponent);tf(wl,"displayName","PolarAngleAxis");tf(wl,"axisType","angleAxis");tf(wl,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var nG=r_,aG=nG(Object.getPrototypeOf,Object),iG=aG,oG=on,sG=iG,lG=sn,cG="[object Object]",uG=Function.prototype,dG=Object.prototype,tO=uG.toString,fG=dG.hasOwnProperty,hG=tO.call(Object);function pG(e){if(!lG(e)||oG(e)!=cG)return!1;var t=sG(e);if(t===null)return!0;var r=fG.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&tO.call(r)==hG}var mG=pG;const vG=de(mG);var yG=on,gG=sn,xG="[object Boolean]";function bG(e){return e===!0||e===!1||gG(e)&&yG(e)==xG}var jG=bG;const wG=de(jG);function Js(e){"@babel/helpers - typeof";return Js=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Js(e)}function Du(){return Du=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Du.apply(this,arguments)}function SG(e,t){return NG(e)||OG(e,t)||kG(e,t)||_G()}function _G(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kG(e,t){if(e){if(typeof e=="string")return P1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return P1(e,t)}}function P1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function OG(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function NG(e){if(Array.isArray(e))return e}function A1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function C1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?A1(Object(r),!0).forEach(function(n){PG(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function PG(e,t,r){return t=AG(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function AG(e){var t=CG(e,"string");return Js(t)=="symbol"?t:t+""}function CG(e,t){if(Js(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Js(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var E1=function(t,r,n,a,i){var s=n-a,l;return l="M ".concat(t,",").concat(r),l+="L ".concat(t+n,",").concat(r),l+="L ".concat(t+n-s/2,",").concat(r+i),l+="L ".concat(t+n-s/2-a,",").concat(r+i),l+="L ".concat(t,",").concat(r," Z"),l},EG={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},$G=function(t){var r=C1(C1({},EG),t),n=P.useRef(),a=P.useState(-1),i=SG(a,2),s=i[0],l=i[1];P.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var x=n.current.getTotalLength();x&&l(x)}catch{}},[]);var c=r.x,u=r.y,f=r.upperWidth,d=r.lowerWidth,h=r.height,p=r.className,g=r.animationEasing,y=r.animationDuration,b=r.animationBegin,v=r.isUpdateAnimationActive;if(c!==+c||u!==+u||f!==+f||d!==+d||h!==+h||f===0&&d===0||h===0)return null;var m=ee("recharts-trapezoid",p);return v?$.createElement(br,{canBegin:s>0,from:{upperWidth:0,lowerWidth:0,height:h,x:c,y:u},to:{upperWidth:f,lowerWidth:d,height:h,x:c,y:u},duration:y,animationEasing:g,isActive:v},function(x){var S=x.upperWidth,j=x.lowerWidth,w=x.height,_=x.x,O=x.y;return $.createElement(br,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:y,easing:g},$.createElement("path",Du({},X(r,!0),{className:m,d:E1(_,O,S,j,w),ref:n})))}):$.createElement("g",null,$.createElement("path",Du({},X(r,!0),{className:m,d:E1(c,u,f,d,h)})))},TG=["option","shapeType","propTransformer","activeClassName","isActive"];function Zs(e){"@babel/helpers - typeof";return Zs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zs(e)}function MG(e,t){if(e==null)return{};var r=IG(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function IG(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function $1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ru(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$1(Object(r),!0).forEach(function(n){LG(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function LG(e,t,r){return t=DG(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DG(e){var t=RG(e,"string");return Zs(t)=="symbol"?t:t+""}function RG(e,t){if(Zs(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Zs(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function BG(e,t){return Ru(Ru({},t),e)}function FG(e,t){return e==="symbols"}function T1(e){var t=e.shapeType,r=e.elementProps;switch(t){case"rectangle":return $.createElement(Fy,r);case"trapezoid":return $.createElement($G,r);case"sector":return $.createElement(Fk,r);case"symbols":if(FG(t))return $.createElement(ay,r);break;default:return null}}function zG(e){return P.isValidElement(e)?e.props:e}function zy(e){var t=e.option,r=e.shapeType,n=e.propTransformer,a=n===void 0?BG:n,i=e.activeClassName,s=i===void 0?"recharts-active-shape":i,l=e.isActive,c=MG(e,TG),u;if(P.isValidElement(t))u=P.cloneElement(t,Ru(Ru({},c),zG(t)));else if(Q(t))u=t(c);else if(vG(t)&&!wG(t)){var f=a(t,c);u=$.createElement(T1,{shapeType:r,elementProps:f})}else{var d=c;u=$.createElement(T1,{shapeType:r,elementProps:d})}return l?$.createElement(ne,{className:s},u):u}function rf(e,t){return t!=null&&"trapezoids"in e.props}function nf(e,t){return t!=null&&"sectors"in e.props}function el(e,t){return t!=null&&"points"in e.props}function WG(e,t){var r,n,a=e.x===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.x)||e.x===t.x,i=e.y===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.y)||e.y===t.y;return a&&i}function UG(e,t){var r=e.endAngle===t.endAngle,n=e.startAngle===t.startAngle;return r&&n}function HG(e,t){var r=e.x===t.x,n=e.y===t.y,a=e.z===t.z;return r&&n&&a}function KG(e,t){var r;return rf(e,t)?r=WG:nf(e,t)?r=UG:el(e,t)&&(r=HG),r}function VG(e,t){var r;return rf(e,t)?r="trapezoids":nf(e,t)?r="sectors":el(e,t)&&(r="points"),r}function GG(e,t){if(rf(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}if(nf(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}return el(e,t)?t.payload:{}}function YG(e){var t=e.activeTooltipItem,r=e.graphicalItem,n=e.itemData,a=VG(r,t),i=GG(r,t),s=n.filter(function(c,u){var f=_a(i,c),d=r.props[a].filter(function(g){var y=KG(r,t);return y(g,t)}),h=r.props[a].indexOf(d[d.length-1]),p=u===h;return f&&p}),l=n.indexOf(s[s.length-1]);return l}var _c;function Bi(e){"@babel/helpers - typeof";return Bi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bi(e)}function oi(){return oi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},oi.apply(this,arguments)}function M1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function xe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?M1(Object(r),!0).forEach(function(n){qt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):M1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qG(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function I1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,nO(n.key),n)}}function XG(e,t,r){return t&&I1(e.prototype,t),r&&I1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function QG(e,t,r){return t=Bu(t),JG(e,rO()?Reflect.construct(t,r||[],Bu(e).constructor):t.apply(e,r))}function JG(e,t){if(t&&(Bi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ZG(e)}function ZG(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rO=function(){return!!e})()}function Bu(e){return Bu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Bu(e)}function eY(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jm(e,t)}function jm(e,t){return jm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},jm(e,t)}function qt(e,t,r){return t=nO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nO(e){var t=tY(e,"string");return Bi(t)=="symbol"?t:t+""}function tY(e,t){if(Bi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Bi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var wr=function(e){function t(r){var n;return qG(this,t),n=QG(this,t,[r]),qt(n,"pieRef",null),qt(n,"sectorRefs",[]),qt(n,"id",uo("recharts-pie-")),qt(n,"handleAnimationEnd",function(){var a=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),Q(a)&&a()}),qt(n,"handleAnimationStart",function(){var a=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),Q(a)&&a()}),n.state={isAnimationFinished:!r.isAnimationActive,prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,sectorToFocus:0},n}return eY(t,e),XG(t,[{key:"isActiveIndex",value:function(n){var a=this.props.activeIndex;return Array.isArray(a)?a.indexOf(n)!==-1:n===a}},{key:"hasActiveIndex",value:function(){var n=this.props.activeIndex;return Array.isArray(n)?n.length!==0:n||n===0}},{key:"renderLabels",value:function(n){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var i=this.props,s=i.label,l=i.labelLine,c=i.dataKey,u=i.valueKey,f=X(this.props,!1),d=X(s,!1),h=X(l,!1),p=s&&s.offsetRadius||20,g=n.map(function(y,b){var v=(y.startAngle+y.endAngle)/2,m=ye(y.cx,y.cy,y.outerRadius+p,v),x=xe(xe(xe(xe({},f),y),{},{stroke:"none"},d),{},{index:b,textAnchor:t.getTextAnchor(m.x,y.cx)},m),S=xe(xe(xe(xe({},f),y),{},{fill:"none",stroke:y.fill},h),{},{index:b,points:[ye(y.cx,y.cy,y.outerRadius,v),m]}),j=c;return te(c)&&te(u)?j="value":te(c)&&(j=u),$.createElement(ne,{key:"label-".concat(y.startAngle,"-").concat(y.endAngle,"-").concat(y.midAngle,"-").concat(b)},l&&t.renderLabelLineItem(l,S,"line"),t.renderLabelItem(s,x,Be(y,j)))});return $.createElement(ne,{className:"recharts-pie-labels"},g)}},{key:"renderSectorsStatically",value:function(n){var a=this,i=this.props,s=i.activeShape,l=i.blendStroke,c=i.inactiveShape;return n.map(function(u,f){if((u==null?void 0:u.startAngle)===0&&(u==null?void 0:u.endAngle)===0&&n.length!==1)return null;var d=a.isActiveIndex(f),h=c&&a.hasActiveIndex()?c:null,p=d?s:h,g=xe(xe({},u),{},{stroke:l?u.fill:u.stroke,tabIndex:-1});return $.createElement(ne,oi({ref:function(b){b&&!a.sectorRefs.includes(b)&&a.sectorRefs.push(b)},tabIndex:-1,className:"recharts-pie-sector"},en(a.props,u,f),{key:"sector-".concat(u==null?void 0:u.startAngle,"-").concat(u==null?void 0:u.endAngle,"-").concat(u.midAngle,"-").concat(f)}),$.createElement(zy,oi({option:p,isActive:d,shapeType:"sector"},g)))})}},{key:"renderSectorsWithAnimation",value:function(){var n=this,a=this.props,i=a.sectors,s=a.isAnimationActive,l=a.animationBegin,c=a.animationDuration,u=a.animationEasing,f=a.animationId,d=this.state,h=d.prevSectors,p=d.prevIsAnimationActive;return $.createElement(br,{begin:l,duration:c,isActive:s,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(f,"-").concat(p),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(g){var y=g.t,b=[],v=i&&i[0],m=v.startAngle;return i.forEach(function(x,S){var j=h&&h[S],w=S>0?Bt(x,"paddingAngle",0):0;if(j){var _=lt(j.endAngle-j.startAngle,x.endAngle-x.startAngle),O=xe(xe({},x),{},{startAngle:m+w,endAngle:m+_(y)+w});b.push(O),m=O.endAngle}else{var N=x.endAngle,k=x.startAngle,E=lt(0,N-k),T=E(y),D=xe(xe({},x),{},{startAngle:m+w,endAngle:m+T+w});b.push(D),m=D.endAngle}}),$.createElement(ne,null,n.renderSectorsStatically(b))})}},{key:"attachKeyboardHandlers",value:function(n){var a=this;n.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var s=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[s].focus(),a.setState({sectorToFocus:s});break}case"ArrowRight":{var l=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[l].focus(),a.setState({sectorToFocus:l});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,a=n.sectors,i=n.isAnimationActive,s=this.state.prevSectors;return i&&a&&a.length&&(!s||!_a(s,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,a=this.props,i=a.hide,s=a.sectors,l=a.className,c=a.label,u=a.cx,f=a.cy,d=a.innerRadius,h=a.outerRadius,p=a.isAnimationActive,g=this.state.isAnimationFinished;if(i||!s||!s.length||!U(u)||!U(f)||!U(d)||!U(h))return null;var y=ee("recharts-pie",l);return $.createElement(ne,{tabIndex:this.props.rootTabIndex,className:y,ref:function(v){n.pieRef=v}},this.renderSectors(),c&&this.renderLabels(s),tt.renderCallByParent(this.props,null,!1),(!p||g)&&Er.renderCallByParent(this.props,s,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return a.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:n.sectors!==a.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,a){return n>a?"start":n<a?"end":"middle"}},{key:"renderLabelLineItem",value:function(n,a,i){if($.isValidElement(n))return $.cloneElement(n,a);if(Q(n))return n(a);var s=ee("recharts-pie-label-line",typeof n!="boolean"?n.className:"");return $.createElement(xi,oi({},a,{key:i,type:"linear",className:s}))}},{key:"renderLabelItem",value:function(n,a,i){if($.isValidElement(n))return $.cloneElement(n,a);var s=i;if(Q(n)&&(s=n(a),$.isValidElement(s)))return s;var l=ee("recharts-pie-label-text",typeof n!="boolean"&&!Q(n)?n.className:"");return $.createElement(Sa,oi({},a,{alignmentBaseline:"middle",className:l}),s)}}])}(P.PureComponent);_c=wr;qt(wr,"displayName","Pie");qt(wr,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!Wn.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});qt(wr,"parseDeltaAngle",function(e,t){var r=rt(t-e),n=Math.min(Math.abs(t-e),360);return r*n});qt(wr,"getRealPieData",function(e){var t=e.data,r=e.children,n=X(e,!1),a=Ft(r,xr);return t&&t.length?t.map(function(i,s){return xe(xe(xe({payload:i},n),i),a&&a[s]&&a[s].props)}):a&&a.length?a.map(function(i){return xe(xe({},n),i.props)}):[]});qt(wr,"parseCoordinateOfPie",function(e,t){var r=t.top,n=t.left,a=t.width,i=t.height,s=Ik(a,i),l=n+xt(e.cx,a,a/2),c=r+xt(e.cy,i,i/2),u=xt(e.innerRadius,s,0),f=xt(e.outerRadius,s,s*.8),d=e.maxRadius||Math.sqrt(a*a+i*i)/2;return{cx:l,cy:c,innerRadius:u,outerRadius:f,maxRadius:d}});qt(wr,"getComposedData",function(e){var t=e.item,r=e.offset,n=t.type.defaultProps!==void 0?xe(xe({},t.type.defaultProps),t.props):t.props,a=_c.getRealPieData(n);if(!a||!a.length)return null;var i=n.cornerRadius,s=n.startAngle,l=n.endAngle,c=n.paddingAngle,u=n.dataKey,f=n.nameKey,d=n.valueKey,h=n.tooltipType,p=Math.abs(n.minAngle),g=_c.parseCoordinateOfPie(n,r),y=_c.parseDeltaAngle(s,l),b=Math.abs(y),v=u;te(u)&&te(d)?(yr(!1,`Use "dataKey" to specify the value of pie,
+ the props "valueKey" will be deprecated in 1.1.0`),v="value"):te(u)&&(yr(!1,`Use "dataKey" to specify the value of pie,
+ the props "valueKey" will be deprecated in 1.1.0`),v=d);var m=a.filter(function(O){return Be(O,v,0)!==0}).length,x=(b>=360?m:m-1)*c,S=b-m*p-x,j=a.reduce(function(O,N){var k=Be(N,v,0);return O+(U(k)?k:0)},0),w;if(j>0){var _;w=a.map(function(O,N){var k=Be(O,v,0),E=Be(O,f,N),T=(U(k)?k:0)/j,D;N?D=_.endAngle+rt(y)*c*(k!==0?1:0):D=s;var A=D+rt(y)*((k!==0?p:0)+T*S),L=(D+A)/2,C=(g.innerRadius+g.outerRadius)/2,M=[{name:E,value:k,payload:O,dataKey:v,type:h}],I=ye(g.cx,g.cy,C,L);return _=xe(xe(xe({percent:T,cornerRadius:i,name:E,tooltipPayload:M,midAngle:L,middleRadius:C,tooltipPosition:I},O),g),{},{value:Be(O,v),startAngle:D,endAngle:A,payload:O,paddingAngle:rt(y)*c}),_})}return xe(xe({},g),{},{sectors:w,data:a})});function tl(e){"@babel/helpers - typeof";return tl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tl(e)}function wm(){return wm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wm.apply(this,arguments)}function L1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function uh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?L1(Object(r),!0).forEach(function(n){rY(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rY(e,t,r){return t=nY(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nY(e){var t=aY(e,"string");return tl(t)=="symbol"?t:t+""}function aY(e,t){if(tl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(tl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function D1(e){return typeof e=="string"?parseInt(e,10):e}function iY(e,t){var r="".concat(t.cx||e.cx),n=Number(r),a="".concat(t.cy||e.cy),i=Number(a);return uh(uh(uh({},t),e),{},{cx:n,cy:i})}function R1(e){return $.createElement(zy,wm({shapeType:"sector",propTransformer:iY},e))}var oY=["shape","activeShape","activeIndex","cornerRadius"],sY=["value","background"];function Fi(e){"@babel/helpers - typeof";return Fi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fi(e)}function Fu(){return Fu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fu.apply(this,arguments)}function B1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Je(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?B1(Object(r),!0).forEach(function(n){va(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):B1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function F1(e,t){if(e==null)return{};var r=lY(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function lY(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function cY(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function z1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,iO(n.key),n)}}function uY(e,t,r){return t&&z1(e.prototype,t),r&&z1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function dY(e,t,r){return t=zu(t),fY(e,aO()?Reflect.construct(t,r||[],zu(e).constructor):t.apply(e,r))}function fY(e,t){if(t&&(Fi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hY(e)}function hY(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function aO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(aO=function(){return!!e})()}function zu(e){return zu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zu(e)}function pY(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sm(e,t)}function Sm(e,t){return Sm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Sm(e,t)}function va(e,t,r){return t=iO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iO(e){var t=mY(e,"string");return Fi(t)=="symbol"?t:t+""}function mY(e,t){if(Fi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Fi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Sl=function(e){function t(){var r;cY(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=dY(this,t,[].concat(a)),va(r,"state",{isAnimationFinished:!1}),va(r,"handleAnimationEnd",function(){var s=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),Q(s)&&s()}),va(r,"handleAnimationStart",function(){var s=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),Q(s)&&s()}),r}return pY(t,e),uY(t,[{key:"getDeltaAngle",value:function(){var n=this.props,a=n.startAngle,i=n.endAngle,s=rt(i-a),l=Math.min(Math.abs(i-a),360);return s*l}},{key:"renderSectorsStatically",value:function(n){var a=this,i=this.props,s=i.shape,l=i.activeShape,c=i.activeIndex,u=i.cornerRadius,f=F1(i,oY),d=X(f,!1);return n.map(function(h,p){var g=p===c,y=Je(Je(Je(Je({},d),{},{cornerRadius:D1(u)},h),en(a.props,h,p)),{},{className:"recharts-radial-bar-sector ".concat(h.className),forceCornerRadius:f.forceCornerRadius,cornerIsExternal:f.cornerIsExternal,isActive:g,option:g?l:s});return $.createElement(R1,Fu({},y,{key:"sector-".concat(p)}))})}},{key:"renderSectorsWithAnimation",value:function(){var n=this,a=this.props,i=a.data,s=a.isAnimationActive,l=a.animationBegin,c=a.animationDuration,u=a.animationEasing,f=a.animationId,d=this.state.prevData;return $.createElement(br,{begin:l,duration:c,isActive:s,easing:u,from:{t:0},to:{t:1},key:"radialBar-".concat(f),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(h){var p=h.t,g=i.map(function(y,b){var v=d&&d[b];if(v){var m=lt(v.startAngle,y.startAngle),x=lt(v.endAngle,y.endAngle);return Je(Je({},y),{},{startAngle:m(p),endAngle:x(p)})}var S=y.endAngle,j=y.startAngle,w=lt(j,S);return Je(Je({},y),{},{endAngle:w(p)})});return $.createElement(ne,null,n.renderSectorsStatically(g))})}},{key:"renderSectors",value:function(){var n=this.props,a=n.data,i=n.isAnimationActive,s=this.state.prevData;return i&&a&&a.length&&(!s||!_a(s,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"renderBackground",value:function(n){var a=this,i=this.props.cornerRadius,s=X(this.props.background,!1);return n.map(function(l,c){l.value;var u=l.background,f=F1(l,sY);if(!u)return null;var d=Je(Je(Je(Je(Je({cornerRadius:D1(i)},f),{},{fill:"#eee"},u),s),en(a.props,l,c)),{},{index:c,className:ee("recharts-radial-bar-background-sector",s==null?void 0:s.className),option:u,isActive:!1});return $.createElement(R1,Fu({},d,{key:"sector-".concat(c)}))})}},{key:"render",value:function(){var n=this.props,a=n.hide,i=n.data,s=n.className,l=n.background,c=n.isAnimationActive;if(a||!i||!i.length)return null;var u=this.state.isAnimationFinished,f=ee("recharts-area",s);return $.createElement(ne,{className:f},l&&$.createElement(ne,{className:"recharts-radial-bar-background"},this.renderBackground(i)),$.createElement(ne,{className:"recharts-radial-bar-sectors"},this.renderSectors()),(!c||u)&&Er.renderCallByParent(Je({},this.props),i))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curData:n.data,prevData:a.curData}:n.data!==a.curData?{curData:n.data}:null}}])}(P.PureComponent);va(Sl,"displayName","RadialBar");va(Sl,"defaultProps",{angleAxisId:0,radiusAxisId:0,minPointSize:0,hide:!1,legendType:"rect",data:[],isAnimationActive:!Wn.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease",forceCornerRadius:!1,cornerIsExternal:!1});va(Sl,"getComposedData",function(e){var t=e.item,r=e.props,n=e.radiusAxis,a=e.radiusAxisTicks,i=e.angleAxis,s=e.angleAxisTicks,l=e.displayedData,c=e.dataKey,u=e.stackedData,f=e.barPosition,d=e.bandSize,h=e.dataStartIndex,p=Ak(f,t);if(!p)return null;var g=i.cx,y=i.cy,b=r.layout,v=t.props,m=v.children,x=v.minPointSize,S=b==="radial"?i:n,j=u?S.scale.domain():null,w=$k({numericAxis:S}),_=Ft(m,xr),O=l.map(function(N,k){var E,T,D,A,L,C;if(u?E=Ck(u[h+k],j):(E=Be(N,c),Array.isArray(E)||(E=[w,E])),b==="radial"){T=Ou({axis:n,ticks:a,bandSize:d,offset:p.offset,entry:N,index:k}),L=i.scale(E[1]),A=i.scale(E[0]),D=T+p.size;var M=L-A;if(Math.abs(x)>0&&Math.abs(M)<Math.abs(x)){var I=rt(M||x)*(Math.abs(x)-Math.abs(M));L+=I}C={background:{cx:g,cy:y,innerRadius:T,outerRadius:D,startAngle:r.startAngle,endAngle:r.endAngle}}}else{T=n.scale(E[0]),D=n.scale(E[1]),A=Ou({axis:i,ticks:s,bandSize:d,offset:p.offset,entry:N,index:k}),L=A+p.size;var R=D-T;if(Math.abs(x)>0&&Math.abs(R)<Math.abs(x)){var F=rt(R||x)*(Math.abs(x)-Math.abs(R));D+=F}}return Je(Je(Je(Je({},N),C),{},{payload:N,value:u?E:E[1],cx:g,cy:y,innerRadius:T,outerRadius:D,startAngle:A,endAngle:L},_&&_[k]&&_[k].props),{},{tooltipPayload:[By(t,N)],tooltipPosition:ye(g,y,(T+D)/2,(A+L)/2)})});return{data:O,layout:b}});var vY=Math.ceil,yY=Math.max;function gY(e,t,r,n){for(var a=-1,i=yY(vY((t-e)/(r||1)),0),s=Array(i);i--;)s[n?i:++a]=e,e+=r;return s}var xY=gY,bY=j_,W1=1/0,jY=17976931348623157e292;function wY(e){if(!e)return e===0?e:0;if(e=bY(e),e===W1||e===-W1){var t=e<0?-1:1;return t*jY}return e===e?e:0}var oO=wY,SY=xY,_Y=zd,dh=oO;function kY(e){return function(t,r,n){return n&&typeof n!="number"&&_Y(t,r,n)&&(r=n=void 0),t=dh(t),r===void 0?(r=t,t=0):r=dh(r),n=n===void 0?t<r?1:-1:dh(n),SY(t,r,n,e)}}var OY=kY,NY=OY,PY=NY(),AY=PY;const Wu=de(AY);function rl(e){"@babel/helpers - typeof";return rl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rl(e)}function U1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function H1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?U1(Object(r),!0).forEach(function(n){sO(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function sO(e,t,r){return t=CY(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CY(e){var t=EY(e,"string");return rl(t)=="symbol"?t:t+""}function EY(e,t){if(rl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(rl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $Y=["Webkit","Moz","O","ms"],TY=function(t,r){var n=t.replace(/(\w)/,function(i){return i.toUpperCase()}),a=$Y.reduce(function(i,s){return H1(H1({},i),{},sO({},s+n,r))},{});return a[t]=r,a};function zi(e){"@babel/helpers - typeof";return zi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zi(e)}function Uu(){return Uu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Uu.apply(this,arguments)}function K1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function fh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?K1(Object(r),!0).forEach(function(n){Tt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):K1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function MY(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function V1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,cO(n.key),n)}}function IY(e,t,r){return t&&V1(e.prototype,t),r&&V1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function LY(e,t,r){return t=Hu(t),DY(e,lO()?Reflect.construct(t,r||[],Hu(e).constructor):t.apply(e,r))}function DY(e,t){if(t&&(zi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return RY(e)}function RY(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(lO=function(){return!!e})()}function Hu(e){return Hu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Hu(e)}function BY(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_m(e,t)}function _m(e,t){return _m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},_m(e,t)}function Tt(e,t,r){return t=cO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cO(e){var t=FY(e,"string");return zi(t)=="symbol"?t:t+""}function FY(e,t){if(zi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(zi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var zY=function(t){var r=t.data,n=t.startIndex,a=t.endIndex,i=t.x,s=t.width,l=t.travellerWidth;if(!r||!r.length)return{};var c=r.length,u=rs().domain(Wu(0,c)).range([i,i+s-l]),f=u.domain().map(function(d){return u(d)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(n),endX:u(a),scale:u,scaleValues:f}},G1=function(t){return t.changedTouches&&!!t.changedTouches.length},Wi=function(e){function t(r){var n;return MY(this,t),n=LY(this,t,[r]),Tt(n,"handleDrag",function(a){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(a):n.state.isSlideMoving&&n.handleSlideDrag(a)}),Tt(n,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&n.handleDrag(a.changedTouches[0])}),Tt(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=n.props,i=a.endIndex,s=a.onDragEnd,l=a.startIndex;s==null||s({endIndex:i,startIndex:l})}),n.detachDragEndListener()}),Tt(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Tt(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Tt(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Tt(n,"handleSlideDragStart",function(a){var i=G1(a)?a.changedTouches[0]:a;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return BY(t,e),IY(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var a=n.startX,i=n.endX,s=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,f=u.length-1,d=Math.min(a,i),h=Math.max(a,i),p=t.getIndexInRange(s,d),g=t.getIndexInRange(s,h);return{startIndex:p-p%c,endIndex:g===f?f:g-g%c}}},{key:"getTextOfTick",value:function(n){var a=this.props,i=a.data,s=a.tickFormatter,l=a.dataKey,c=Be(i[n],l,n);return Q(s)?s(c,n):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var a=this.state,i=a.slideMoveStartX,s=a.startX,l=a.endX,c=this.props,u=c.x,f=c.width,d=c.travellerWidth,h=c.startIndex,p=c.endIndex,g=c.onChange,y=n.pageX-i;y>0?y=Math.min(y,u+f-d-l,u+f-d-s):y<0&&(y=Math.max(y,u-s,u-l));var b=this.getIndex({startX:s+y,endX:l+y});(b.startIndex!==h||b.endIndex!==p)&&g&&g(b),this.setState({startX:s+y,endX:l+y,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,a){var i=G1(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var a=this.state,i=a.brushMoveStartX,s=a.movingTravellerId,l=a.endX,c=a.startX,u=this.state[s],f=this.props,d=f.x,h=f.width,p=f.travellerWidth,g=f.onChange,y=f.gap,b=f.data,v={startX:this.state.startX,endX:this.state.endX},m=n.pageX-i;m>0?m=Math.min(m,d+h-p-u):m<0&&(m=Math.max(m,d-u)),v[s]=u+m;var x=this.getIndex(v),S=x.startIndex,j=x.endIndex,w=function(){var O=b.length-1;return s==="startX"&&(l>c?S%y===0:j%y===0)||l<c&&j===O||s==="endX"&&(l>c?j%y===0:S%y===0)||l>c&&j===O};this.setState(Tt(Tt({},s,u+m),"brushMoveStartX",n.pageX),function(){g&&w()&&g(x)})}},{key:"handleTravellerMoveKeyboard",value:function(n,a){var i=this,s=this.state,l=s.scaleValues,c=s.startX,u=s.endX,f=this.state[a],d=l.indexOf(f);if(d!==-1){var h=d+n;if(!(h===-1||h>=l.length)){var p=l[h];a==="startX"&&p>=u||a==="endX"&&p<=c||this.setState(Tt({},a,p),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,a=n.x,i=n.y,s=n.width,l=n.height,c=n.fill,u=n.stroke;return $.createElement("rect",{stroke:u,fill:c,x:a,y:i,width:s,height:l})}},{key:"renderPanorama",value:function(){var n=this.props,a=n.x,i=n.y,s=n.width,l=n.height,c=n.data,u=n.children,f=n.padding,d=P.Children.only(u);return d?$.cloneElement(d,{x:a,y:i,width:s,height:l,margin:f,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,a){var i,s,l=this,c=this.props,u=c.y,f=c.travellerWidth,d=c.height,h=c.traveller,p=c.ariaLabel,g=c.data,y=c.startIndex,b=c.endIndex,v=Math.max(n,this.props.x),m=fh(fh({},X(this.props,!1)),{},{x:v,y:u,width:f,height:d}),x=p||"Min value: ".concat((i=g[y])===null||i===void 0?void 0:i.name,", Max value: ").concat((s=g[b])===null||s===void 0?void 0:s.name);return $.createElement(ne,{tabIndex:0,role:"slider","aria-label":x,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(j){["ArrowLeft","ArrowRight"].includes(j.key)&&(j.preventDefault(),j.stopPropagation(),l.handleTravellerMoveKeyboard(j.key==="ArrowRight"?1:-1,a))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,m))}},{key:"renderSlide",value:function(n,a){var i=this.props,s=i.y,l=i.height,c=i.stroke,u=i.travellerWidth,f=Math.min(n,a)+u,d=Math.max(Math.abs(a-n)-u,0);return $.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:f,y:s,width:d,height:l})}},{key:"renderText",value:function(){var n=this.props,a=n.startIndex,i=n.endIndex,s=n.y,l=n.height,c=n.travellerWidth,u=n.stroke,f=this.state,d=f.startX,h=f.endX,p=5,g={pointerEvents:"none",fill:u};return $.createElement(ne,{className:"recharts-brush-texts"},$.createElement(Sa,Uu({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,h)-p,y:s+l/2},g),this.getTextOfTick(a)),$.createElement(Sa,Uu({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,h)+c+p,y:s+l/2},g),this.getTextOfTick(i)))}},{key:"render",value:function(){var n=this.props,a=n.data,i=n.className,s=n.children,l=n.x,c=n.y,u=n.width,f=n.height,d=n.alwaysShowText,h=this.state,p=h.startX,g=h.endX,y=h.isTextActive,b=h.isSlideMoving,v=h.isTravellerMoving,m=h.isTravellerFocused;if(!a||!a.length||!U(l)||!U(c)||!U(u)||!U(f)||u<=0||f<=0)return null;var x=ee("recharts-brush",i),S=$.Children.count(s)===1,j=TY("userSelect","none");return $.createElement(ne,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:j},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(p,g),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(g,"endX"),(y||b||v||m||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var a=n.x,i=n.y,s=n.width,l=n.height,c=n.stroke,u=Math.floor(i+l/2)-1;return $.createElement($.Fragment,null,$.createElement("rect",{x:a,y:i,width:s,height:l,fill:c,stroke:"none"}),$.createElement("line",{x1:a+1,y1:u,x2:a+s-1,y2:u,fill:"none",stroke:"#fff"}),$.createElement("line",{x1:a+1,y1:u+2,x2:a+s-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,a){var i;return $.isValidElement(n)?i=$.cloneElement(n,a):Q(n)?i=n(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(n,a){var i=n.data,s=n.width,l=n.x,c=n.travellerWidth,u=n.updateId,f=n.startIndex,d=n.endIndex;if(i!==a.prevData||u!==a.prevUpdateId)return fh({prevData:i,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:s},i&&i.length?zY({data:i,width:s,x:l,travellerWidth:c,startIndex:f,endIndex:d}):{scale:null,scaleValues:null});if(a.scale&&(s!==a.prevWidth||l!==a.prevX||c!==a.prevTravellerWidth)){a.scale.range([l,l+s-c]);var h=a.scale.domain().map(function(p){return a.scale(p)});return{prevData:i,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:s,startX:a.scale(n.startIndex),endX:a.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,a){for(var i=n.length,s=0,l=i-1;l-s>1;){var c=Math.floor((s+l)/2);n[c]>a?l=c:s=c}return a>=n[l]?l:s}}])}(P.PureComponent);Tt(Wi,"displayName","Brush");Tt(Wi,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var WY=dy;function UY(e,t){var r;return WY(e,function(n,a,i){return r=t(n,a,i),!r}),!!r}var HY=UY,KY=YS,VY=Ir,GY=HY,YY=$t,qY=zd;function XY(e,t,r){var n=YY(e)?KY:GY;return r&&qY(e,t,r)&&(t=void 0),n(e,VY(t))}var QY=XY;const JY=de(QY);var $r=function(t,r){var n=t.alwaysShow,a=t.ifOverflow;return n&&(a="extendDomain"),a===r},Y1=v_;function ZY(e,t,r){t=="__proto__"&&Y1?Y1(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var eq=ZY,tq=eq,rq=p_,nq=Ir;function aq(e,t){var r={};return t=nq(t),rq(e,function(n,a,i){tq(r,a,t(n,a,i))}),r}var iq=aq;const oq=de(iq);function sq(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}var lq=sq,cq=dy;function uq(e,t){var r=!0;return cq(e,function(n,a,i){return r=!!t(n,a,i),r}),r}var dq=uq,fq=lq,hq=dq,pq=Ir,mq=$t,vq=zd;function yq(e,t,r){var n=mq(e)?fq:hq;return r&&vq(e,t,r)&&(t=void 0),n(e,pq(t))}var gq=yq;const uO=de(gq);var xq=["x","y"];function nl(e){"@babel/helpers - typeof";return nl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nl(e)}function km(){return km=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},km.apply(this,arguments)}function q1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Lo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?q1(Object(r),!0).forEach(function(n){bq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bq(e,t,r){return t=jq(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jq(e){var t=wq(e,"string");return nl(t)=="symbol"?t:t+""}function wq(e,t){if(nl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(nl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sq(e,t){if(e==null)return{};var r=_q(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _q(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function kq(e,t){var r=e.x,n=e.y,a=Sq(e,xq),i="".concat(r),s=parseInt(i,10),l="".concat(n),c=parseInt(l,10),u="".concat(t.height||a.height),f=parseInt(u,10),d="".concat(t.width||a.width),h=parseInt(d,10);return Lo(Lo(Lo(Lo(Lo({},t),a),s?{x:s}:{}),c?{y:c}:{}),{},{height:f,width:h,name:t.name,radius:t.radius})}function X1(e){return $.createElement(zy,km({shapeType:"rectangle",propTransformer:kq,activeClassName:"recharts-active-bar"},e))}var Oq=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,a){if(typeof t=="number")return t;var i=U(n)||D3(n);return i?t(n,a):(i||Oa(),r)}},Nq=["value","background"],dO;function Ui(e){"@babel/helpers - typeof";return Ui=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ui(e)}function Pq(e,t){if(e==null)return{};var r=Aq(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Aq(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Ku(){return Ku=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ku.apply(this,arguments)}function Q1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function De(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Q1(Object(r),!0).forEach(function(n){Sn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Q1(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Cq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,hO(n.key),n)}}function Eq(e,t,r){return t&&J1(e.prototype,t),r&&J1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function $q(e,t,r){return t=Vu(t),Tq(e,fO()?Reflect.construct(t,r||[],Vu(e).constructor):t.apply(e,r))}function Tq(e,t){if(t&&(Ui(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Mq(e)}function Mq(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fO=function(){return!!e})()}function Vu(e){return Vu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Vu(e)}function Iq(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Om(e,t)}function Om(e,t){return Om=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Om(e,t)}function Sn(e,t,r){return t=hO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hO(e){var t=Lq(e,"string");return Ui(t)=="symbol"?t:t+""}function Lq(e,t){if(Ui(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ui(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var nr=function(e){function t(){var r;Cq(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=$q(this,t,[].concat(a)),Sn(r,"state",{isAnimationFinished:!1}),Sn(r,"id",uo("recharts-bar-")),Sn(r,"handleAnimationEnd",function(){var s=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),s&&s()}),Sn(r,"handleAnimationStart",function(){var s=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),s&&s()}),r}return Iq(t,e),Eq(t,[{key:"renderRectanglesStatically",value:function(n){var a=this,i=this.props,s=i.shape,l=i.dataKey,c=i.activeIndex,u=i.activeBar,f=X(this.props,!1);return n&&n.map(function(d,h){var p=h===c,g=p?u:s,y=De(De(De({},f),d),{},{isActive:p,option:g,index:h,dataKey:l,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return $.createElement(ne,Ku({className:"recharts-bar-rectangle"},en(a.props,d,h),{key:"rectangle-".concat(d==null?void 0:d.x,"-").concat(d==null?void 0:d.y,"-").concat(d==null?void 0:d.value,"-").concat(h)}),$.createElement(X1,y))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,a=this.props,i=a.data,s=a.layout,l=a.isAnimationActive,c=a.animationBegin,u=a.animationDuration,f=a.animationEasing,d=a.animationId,h=this.state.prevData;return $.createElement(br,{begin:c,duration:u,isActive:l,easing:f,from:{t:0},to:{t:1},key:"bar-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(p){var g=p.t,y=i.map(function(b,v){var m=h&&h[v];if(m){var x=lt(m.x,b.x),S=lt(m.y,b.y),j=lt(m.width,b.width),w=lt(m.height,b.height);return De(De({},b),{},{x:x(g),y:S(g),width:j(g),height:w(g)})}if(s==="horizontal"){var _=lt(0,b.height),O=_(g);return De(De({},b),{},{y:b.y+b.height-O,height:O})}var N=lt(0,b.width),k=N(g);return De(De({},b),{},{width:k})});return $.createElement(ne,null,n.renderRectanglesStatically(y))})}},{key:"renderRectangles",value:function(){var n=this.props,a=n.data,i=n.isAnimationActive,s=this.state.prevData;return i&&a&&a.length&&(!s||!_a(s,a))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(a)}},{key:"renderBackground",value:function(){var n=this,a=this.props,i=a.data,s=a.dataKey,l=a.activeIndex,c=X(this.props.background,!1);return i.map(function(u,f){u.value;var d=u.background,h=Pq(u,Nq);if(!d)return null;var p=De(De(De(De(De({},h),{},{fill:"#eee"},d),c),en(n.props,u,f)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:s,index:f,className:"recharts-bar-background-rectangle"});return $.createElement(X1,Ku({key:"background-bar-".concat(f),option:n.props.background,isActive:f===l},p))})}},{key:"renderErrorBar",value:function(n,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,s=i.data,l=i.xAxis,c=i.yAxis,u=i.layout,f=i.children,d=Ft(f,Jd);if(!d)return null;var h=u==="vertical"?s[0].height/2:s[0].width/2,p=function(b,v){var m=Array.isArray(b.value)?b.value[1]:b.value;return{x:b.x,y:b.y,value:m,errorVal:Be(b,v)}},g={clipPath:n?"url(#clipPath-".concat(a,")"):null};return $.createElement(ne,g,d.map(function(y){return $.cloneElement(y,{key:"error-bar-".concat(a,"-").concat(y.props.dataKey),data:s,xAxis:l,yAxis:c,layout:u,offset:h,dataPointFormatter:p})}))}},{key:"render",value:function(){var n=this.props,a=n.hide,i=n.data,s=n.className,l=n.xAxis,c=n.yAxis,u=n.left,f=n.top,d=n.width,h=n.height,p=n.isAnimationActive,g=n.background,y=n.id;if(a||!i||!i.length)return null;var b=this.state.isAnimationFinished,v=ee("recharts-bar",s),m=l&&l.allowDataOverflow,x=c&&c.allowDataOverflow,S=m||x,j=te(y)?this.id:y;return $.createElement(ne,{className:v},m||x?$.createElement("defs",null,$.createElement("clipPath",{id:"clipPath-".concat(j)},$.createElement("rect",{x:m?u:u-d/2,y:x?f:f-h/2,width:m?d:d*2,height:x?h:h*2}))):null,$.createElement(ne,{className:"recharts-bar-rectangles",clipPath:S?"url(#clipPath-".concat(j,")"):null},g?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(S,j),(!p||b)&&Er.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curData:n.data,prevData:a.curData}:n.data!==a.curData?{curData:n.data}:null}}])}(P.PureComponent);dO=nr;Sn(nr,"displayName","Bar");Sn(nr,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Wn.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Sn(nr,"getComposedData",function(e){var t=e.props,r=e.item,n=e.barPosition,a=e.bandSize,i=e.xAxis,s=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,f=e.dataStartIndex,d=e.displayedData,h=e.offset,p=Ak(n,r);if(!p)return null;var g=t.layout,y=r.type.defaultProps,b=y!==void 0?De(De({},y),r.props):r.props,v=b.dataKey,m=b.children,x=b.minPointSize,S=g==="horizontal"?s:i,j=u?S.scale.domain():null,w=$k({numericAxis:S}),_=Ft(m,xr),O=d.map(function(N,k){var E,T,D,A,L,C;u?E=Ck(u[f+k],j):(E=Be(N,v),Array.isArray(E)||(E=[w,E]));var M=Oq(x,dO.defaultProps.minPointSize)(E[1],k);if(g==="horizontal"){var I,R=[s.scale(E[0]),s.scale(E[1])],F=R[0],K=R[1];T=Ou({axis:i,ticks:l,bandSize:a,offset:p.offset,entry:N,index:k}),D=(I=K??F)!==null&&I!==void 0?I:void 0,A=p.size;var z=F-K;if(L=Number.isNaN(z)?0:z,C={x:T,y:s.y,width:A,height:s.height},Math.abs(M)>0&&Math.abs(L)<Math.abs(M)){var q=rt(L||M)*(Math.abs(M)-Math.abs(L));D-=q,L+=q}}else{var ie=[i.scale(E[0]),i.scale(E[1])],he=ie[0],ge=ie[1];if(T=he,D=Ou({axis:s,ticks:c,bandSize:a,offset:p.offset,entry:N,index:k}),A=ge-he,L=p.size,C={x:i.x,y:D,width:i.width,height:L},Math.abs(M)>0&&Math.abs(A)<Math.abs(M)){var Qe=rt(A||M)*(Math.abs(M)-Math.abs(A));A+=Qe}}return De(De(De({},N),{},{x:T,y:D,width:A,height:L,value:u?E:E[1],payload:N,background:C},_&&_[k]&&_[k].props),{},{tooltipPayload:[By(r,N)],tooltipPosition:{x:T+A/2,y:D+L/2}})});return De({data:O,layout:g},h)});function al(e){"@babel/helpers - typeof";return al=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},al(e)}function Dq(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Z1(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,pO(n.key),n)}}function Rq(e,t,r){return t&&Z1(e.prototype,t),r&&Z1(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ej(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function fr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ej(Object(r),!0).forEach(function(n){af(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ej(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function af(e,t,r){return t=pO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pO(e){var t=Bq(e,"string");return al(t)=="symbol"?t:t+""}function Bq(e,t){if(al(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(al(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mO=function(t,r,n,a,i){var s=t.width,l=t.height,c=t.layout,u=t.children,f=Object.keys(r),d={left:n.left,leftMirror:n.left,right:s-n.right,rightMirror:s-n.right,top:n.top,topMirror:n.top,bottom:l-n.bottom,bottomMirror:l-n.bottom},h=!!It(u,nr);return f.reduce(function(p,g){var y=r[g],b=y.orientation,v=y.domain,m=y.padding,x=m===void 0?{}:m,S=y.mirror,j=y.reversed,w="".concat(b).concat(S?"Mirror":""),_,O,N,k,E;if(y.type==="number"&&(y.padding==="gap"||y.padding==="no-gap")){var T=v[1]-v[0],D=1/0,A=y.categoricalDomain.sort(F3);if(A.forEach(function(ie,he){he>0&&(D=Math.min((ie||0)-(A[he-1]||0),D))}),Number.isFinite(D)){var L=D/T,C=y.layout==="vertical"?n.height:n.width;if(y.padding==="gap"&&(_=L*C/2),y.padding==="no-gap"){var M=xt(t.barCategoryGap,L*C),I=L*C/2;_=I-M-(I-M)/C*M}}}a==="xAxis"?O=[n.left+(x.left||0)+(_||0),n.left+n.width-(x.right||0)-(_||0)]:a==="yAxis"?O=c==="horizontal"?[n.top+n.height-(x.bottom||0),n.top+(x.top||0)]:[n.top+(x.top||0)+(_||0),n.top+n.height-(x.bottom||0)-(_||0)]:O=y.range,j&&(O=[O[1],O[0]]);var R=Nk(y,i,h),F=R.scale,K=R.realScaleType;F.domain(v).range(O),Pk(F);var z=Ek(F,fr(fr({},y),{},{realScaleType:K}));a==="xAxis"?(E=b==="top"&&!S||b==="bottom"&&S,N=n.left,k=d[w]-E*y.height):a==="yAxis"&&(E=b==="left"&&!S||b==="right"&&S,N=d[w]-E*y.width,k=n.top);var q=fr(fr(fr({},y),z),{},{realScaleType:K,x:N,y:k,scale:F,width:a==="xAxis"?n.width:y.width,height:a==="yAxis"?n.height:y.height});return q.bandSize=Nu(q,z),!y.hide&&a==="xAxis"?d[w]+=(E?-1:1)*q.height:y.hide||(d[w]+=(E?-1:1)*q.width),fr(fr({},p),{},af({},g,q))},{})},vO=function(t,r){var n=t.x,a=t.y,i=r.x,s=r.y;return{x:Math.min(n,i),y:Math.min(a,s),width:Math.abs(i-n),height:Math.abs(s-a)}},Fq=function(t){var r=t.x1,n=t.y1,a=t.x2,i=t.y2;return vO({x:r,y:n},{x:a,y:i})},yO=function(){function e(t){Dq(this,e),this.scale=t}return Rq(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.bandAware,i=n.position;if(r!==void 0){if(i)switch(i){case"start":return this.scale(r);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+s}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(r)+l}default:return this.scale(r)}if(a){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),a=n[0],i=n[n.length-1];return a<=i?r>=a&&r<=i:r>=i&&r<=a}}],[{key:"create",value:function(r){return new e(r)}}])}();af(yO,"EPS",1e-4);var Wy=function(t){var r=Object.keys(t).reduce(function(n,a){return fr(fr({},n),{},af({},a,yO.create(t[a])))},{});return fr(fr({},r),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.bandAware,l=i.position;return oq(a,function(c,u){return r[u].apply(c,{bandAware:s,position:l})})},isInRange:function(a){return uO(a,function(i,s){return r[s].isInRange(i)})}})};function zq(e){return(e%180+180)%180}var Wq=function(t){var r=t.width,n=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=zq(a),s=i*Math.PI/180,l=Math.atan(n/r),c=s>l&&s<Math.PI-l?n/Math.sin(s):r/Math.cos(s);return Math.abs(c)},Uq=Ir,Hq=vl,Kq=Bd;function Vq(e){return function(t,r,n){var a=Object(t);if(!Hq(t)){var i=Uq(r);t=Kq(t),r=function(l){return i(a[l],l,a)}}var s=e(t,r,n);return s>-1?a[i?t[s]:s]:void 0}}var Gq=Vq,Yq=oO;function qq(e){var t=Yq(e),r=t%1;return t===t?r?t-r:t:0}var Xq=qq,Qq=l_,Jq=Ir,Zq=Xq,eX=Math.max;function tX(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var a=r==null?0:Zq(r);return a<0&&(a=eX(n+a,0)),Qq(e,Jq(t),a)}var rX=tX,nX=Gq,aX=rX,iX=nX(aX),oX=iX;const sX=de(oX);var lX=UT(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),Uy=P.createContext(void 0),Hy=P.createContext(void 0),gO=P.createContext(void 0),xO=P.createContext({}),bO=P.createContext(void 0),jO=P.createContext(0),wO=P.createContext(0),tj=function(t){var r=t.state,n=r.xAxisMap,a=r.yAxisMap,i=r.offset,s=t.clipPathId,l=t.children,c=t.width,u=t.height,f=lX(i);return $.createElement(Uy.Provider,{value:n},$.createElement(Hy.Provider,{value:a},$.createElement(xO.Provider,{value:i},$.createElement(gO.Provider,{value:f},$.createElement(bO.Provider,{value:s},$.createElement(jO.Provider,{value:u},$.createElement(wO.Provider,{value:c},l)))))))},cX=function(){return P.useContext(bO)},SO=function(t){var r=P.useContext(Uy);r==null&&Oa();var n=r[t];return n==null&&Oa(),n},uX=function(){var t=P.useContext(Uy);return gn(t)},dX=function(){var t=P.useContext(Hy),r=sX(t,function(n){return uO(n.domain,Number.isFinite)});return r||gn(t)},_O=function(t){var r=P.useContext(Hy);r==null&&Oa();var n=r[t];return n==null&&Oa(),n},fX=function(){var t=P.useContext(gO);return t},hX=function(){return P.useContext(xO)},Ky=function(){return P.useContext(wO)},Vy=function(){return P.useContext(jO)};function Hi(e){"@babel/helpers - typeof";return Hi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hi(e)}function pX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mX(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,OO(n.key),n)}}function vX(e,t,r){return t&&mX(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function yX(e,t,r){return t=Gu(t),gX(e,kO()?Reflect.construct(t,r||[],Gu(e).constructor):t.apply(e,r))}function gX(e,t){if(t&&(Hi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xX(e)}function xX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(kO=function(){return!!e})()}function Gu(e){return Gu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Gu(e)}function bX(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nm(e,t)}function Nm(e,t){return Nm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Nm(e,t)}function rj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function nj(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rj(Object(r),!0).forEach(function(n){Gy(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Gy(e,t,r){return t=OO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OO(e){var t=jX(e,"string");return Hi(t)=="symbol"?t:t+""}function jX(e,t){if(Hi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Hi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function wX(e,t){return OX(e)||kX(e,t)||_X(e,t)||SX()}function SX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _X(e,t){if(e){if(typeof e=="string")return aj(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return aj(e,t)}}function aj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function kX(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function OX(e){if(Array.isArray(e))return e}function Pm(){return Pm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pm.apply(this,arguments)}var NX=function(t,r){var n;return $.isValidElement(t)?n=$.cloneElement(t,r):Q(t)?n=t(r):n=$.createElement("line",Pm({},r,{className:"recharts-reference-line-line"})),n},PX=function(t,r,n,a,i,s,l,c,u){var f=i.x,d=i.y,h=i.width,p=i.height;if(n){var g=u.y,y=t.y.apply(g,{position:s});if($r(u,"discard")&&!t.y.isInRange(y))return null;var b=[{x:f+h,y},{x:f,y}];return c==="left"?b.reverse():b}if(r){var v=u.x,m=t.x.apply(v,{position:s});if($r(u,"discard")&&!t.x.isInRange(m))return null;var x=[{x:m,y:d+p},{x:m,y:d}];return l==="top"?x.reverse():x}if(a){var S=u.segment,j=S.map(function(w){return t.apply(w,{position:s})});return $r(u,"discard")&&JY(j,function(w){return!t.isInRange(w)})?null:j}return null};function AX(e){var t=e.x,r=e.y,n=e.segment,a=e.xAxisId,i=e.yAxisId,s=e.shape,l=e.className,c=e.alwaysShow,u=cX(),f=SO(a),d=_O(i),h=fX();if(!u||!h)return null;yr(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=Wy({x:f.scale,y:d.scale}),g=qe(t),y=qe(r),b=n&&n.length===2,v=PX(p,g,y,b,h,e.position,f.orientation,d.orientation,e);if(!v)return null;var m=wX(v,2),x=m[0],S=x.x,j=x.y,w=m[1],_=w.x,O=w.y,N=$r(e,"hidden")?"url(#".concat(u,")"):void 0,k=nj(nj({clipPath:N},X(e,!0)),{},{x1:S,y1:j,x2:_,y2:O});return $.createElement(ne,{className:ee("recharts-reference-line",l)},NX(s,k),tt.renderCallByParent(e,Fq({x1:S,y1:j,x2:_,y2:O})))}var Yy=function(e){function t(){return pX(this,t),yX(this,t,arguments)}return bX(t,e),vX(t,[{key:"render",value:function(){return $.createElement(AX,this.props)}}])}($.Component);Gy(Yy,"displayName","ReferenceLine");Gy(Yy,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function Am(){return Am=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Am.apply(this,arguments)}function Ki(e){"@babel/helpers - typeof";return Ki=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ki(e)}function ij(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function oj(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ij(Object(r),!0).forEach(function(n){of(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ij(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function CX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function EX(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,PO(n.key),n)}}function $X(e,t,r){return t&&EX(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function TX(e,t,r){return t=Yu(t),MX(e,NO()?Reflect.construct(t,r||[],Yu(e).constructor):t.apply(e,r))}function MX(e,t){if(t&&(Ki(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return IX(e)}function IX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function NO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(NO=function(){return!!e})()}function Yu(e){return Yu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Yu(e)}function LX(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cm(e,t)}function Cm(e,t){return Cm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Cm(e,t)}function of(e,t,r){return t=PO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function PO(e){var t=DX(e,"string");return Ki(t)=="symbol"?t:t+""}function DX(e,t){if(Ki(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ki(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var RX=function(t){var r=t.x,n=t.y,a=t.xAxis,i=t.yAxis,s=Wy({x:a.scale,y:i.scale}),l=s.apply({x:r,y:n},{bandAware:!0});return $r(t,"discard")&&!s.isInRange(l)?null:l},sf=function(e){function t(){return CX(this,t),TX(this,t,arguments)}return LX(t,e),$X(t,[{key:"render",value:function(){var n=this.props,a=n.x,i=n.y,s=n.r,l=n.alwaysShow,c=n.clipPathId,u=qe(a),f=qe(i);if(yr(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!f)return null;var d=RX(this.props);if(!d)return null;var h=d.x,p=d.y,g=this.props,y=g.shape,b=g.className,v=$r(this.props,"hidden")?"url(#".concat(c,")"):void 0,m=oj(oj({clipPath:v},X(this.props,!0)),{},{cx:h,cy:p});return $.createElement(ne,{className:ee("recharts-reference-dot",b)},t.renderDot(y,m),tt.renderCallByParent(this.props,{x:h-s,y:p-s,width:2*s,height:2*s}))}}])}($.Component);of(sf,"displayName","ReferenceDot");of(sf,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});of(sf,"renderDot",function(e,t){var r;return $.isValidElement(e)?r=$.cloneElement(e,t):Q(e)?r=e(t):r=$.createElement(Zd,Am({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),r});function Em(){return Em=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Em.apply(this,arguments)}function Vi(e){"@babel/helpers - typeof";return Vi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vi(e)}function sj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function lj(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sj(Object(r),!0).forEach(function(n){lf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function BX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FX(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,CO(n.key),n)}}function zX(e,t,r){return t&&FX(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function WX(e,t,r){return t=qu(t),UX(e,AO()?Reflect.construct(t,r||[],qu(e).constructor):t.apply(e,r))}function UX(e,t){if(t&&(Vi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return HX(e)}function HX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function AO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(AO=function(){return!!e})()}function qu(e){return qu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},qu(e)}function KX(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$m(e,t)}function $m(e,t){return $m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},$m(e,t)}function lf(e,t,r){return t=CO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function CO(e){var t=VX(e,"string");return Vi(t)=="symbol"?t:t+""}function VX(e,t){if(Vi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Vi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var GX=function(t,r,n,a,i){var s=i.x1,l=i.x2,c=i.y1,u=i.y2,f=i.xAxis,d=i.yAxis;if(!f||!d)return null;var h=Wy({x:f.scale,y:d.scale}),p={x:t?h.x.apply(s,{position:"start"}):h.x.rangeMin,y:n?h.y.apply(c,{position:"start"}):h.y.rangeMin},g={x:r?h.x.apply(l,{position:"end"}):h.x.rangeMax,y:a?h.y.apply(u,{position:"end"}):h.y.rangeMax};return $r(i,"discard")&&(!h.isInRange(p)||!h.isInRange(g))?null:vO(p,g)},cf=function(e){function t(){return BX(this,t),WX(this,t,arguments)}return KX(t,e),zX(t,[{key:"render",value:function(){var n=this.props,a=n.x1,i=n.x2,s=n.y1,l=n.y2,c=n.className,u=n.alwaysShow,f=n.clipPathId;yr(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var d=qe(a),h=qe(i),p=qe(s),g=qe(l),y=this.props.shape;if(!d&&!h&&!p&&!g&&!y)return null;var b=GX(d,h,p,g,this.props);if(!b&&!y)return null;var v=$r(this.props,"hidden")?"url(#".concat(f,")"):void 0;return $.createElement(ne,{className:ee("recharts-reference-area",c)},t.renderRect(y,lj(lj({clipPath:v},X(this.props,!0)),b)),tt.renderCallByParent(this.props,b))}}])}($.Component);lf(cf,"displayName","ReferenceArea");lf(cf,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});lf(cf,"renderRect",function(e,t){var r;return $.isValidElement(e)?r=$.cloneElement(e,t):Q(e)?r=e(t):r=$.createElement(Fy,Em({},t,{className:"recharts-reference-area-rect"})),r});function EO(e,t,r){if(t<1)return[];if(t===1&&r===void 0)return e;for(var n=[],a=0;a<e.length;a+=t)n.push(e[a]);return n}function YX(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return Wq(n,r)}function qX(e,t,r){var n=r==="width",a=e.x,i=e.y,s=e.width,l=e.height;return t===1?{start:n?a:i,end:n?a+s:i+l}:{start:n?a+s:i+l,end:n?a:i}}function Xu(e,t,r,n,a){if(e*t<e*n||e*t>e*a)return!1;var i=r();return e*(t-e*i/2-n)>=0&&e*(t+e*i/2-a)<=0}function XX(e,t){return EO(e,t+1)}function QX(e,t,r,n,a){for(var i=(n||[]).slice(),s=t.start,l=t.end,c=0,u=1,f=s,d=function(){var g=n==null?void 0:n[c];if(g===void 0)return{v:EO(n,u)};var y=c,b,v=function(){return b===void 0&&(b=r(g,y)),b},m=g.coordinate,x=c===0||Xu(e,m,v,f,l);x||(c=0,f=s,u+=1),x&&(f=m+e*(v()/2+a),c+=u)},h;u<=i.length;)if(h=d(),h)return h.v;return[]}function il(e){"@babel/helpers - typeof";return il=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},il(e)}function cj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ht(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cj(Object(r),!0).forEach(function(n){JX(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function JX(e,t,r){return t=ZX(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ZX(e){var t=eQ(e,"string");return il(t)=="symbol"?t:t+""}function eQ(e,t){if(il(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(il(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tQ(e,t,r,n,a){for(var i=(n||[]).slice(),s=i.length,l=t.start,c=t.end,u=function(h){var p=i[h],g,y=function(){return g===void 0&&(g=r(p,h)),g};if(h===s-1){var b=e*(p.coordinate+e*y()/2-c);i[h]=p=ht(ht({},p),{},{tickCoord:b>0?p.coordinate-b*e:p.coordinate})}else i[h]=p=ht(ht({},p),{},{tickCoord:p.coordinate});var v=Xu(e,p.tickCoord,y,l,c);v&&(c=p.tickCoord-e*(y()/2+a),i[h]=ht(ht({},p),{},{isShow:!0}))},f=s-1;f>=0;f--)u(f);return i}function rQ(e,t,r,n,a,i){var s=(n||[]).slice(),l=s.length,c=t.start,u=t.end;if(i){var f=n[l-1],d=r(f,l-1),h=e*(f.coordinate+e*d/2-u);s[l-1]=f=ht(ht({},f),{},{tickCoord:h>0?f.coordinate-h*e:f.coordinate});var p=Xu(e,f.tickCoord,function(){return d},c,u);p&&(u=f.tickCoord-e*(d/2+a),s[l-1]=ht(ht({},f),{},{isShow:!0}))}for(var g=i?l-1:l,y=function(m){var x=s[m],S,j=function(){return S===void 0&&(S=r(x,m)),S};if(m===0){var w=e*(x.coordinate-e*j()/2-c);s[m]=x=ht(ht({},x),{},{tickCoord:w<0?x.coordinate-w*e:x.coordinate})}else s[m]=x=ht(ht({},x),{},{tickCoord:x.coordinate});var _=Xu(e,x.tickCoord,j,c,u);_&&(c=x.tickCoord+e*(j()/2+a),s[m]=ht(ht({},x),{},{isShow:!0}))},b=0;b<g;b++)y(b);return s}function qy(e,t,r){var n=e.tick,a=e.ticks,i=e.viewBox,s=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,f=e.unit,d=e.angle;if(!a||!a.length||!n)return[];if(U(c)||Wn.isSsr)return XX(a,typeof c=="number"&&U(c)?c:0);var h=[],p=l==="top"||l==="bottom"?"width":"height",g=f&&p==="width"?ts(f,{fontSize:t,letterSpacing:r}):{width:0,height:0},y=function(x,S){var j=Q(u)?u(x.value,S):x.value;return p==="width"?YX(ts(j,{fontSize:t,letterSpacing:r}),g,d):ts(j,{fontSize:t,letterSpacing:r})[p]},b=a.length>=2?rt(a[1].coordinate-a[0].coordinate):1,v=qX(i,b,p);return c==="equidistantPreserveStart"?QX(b,v,y,a,s):(c==="preserveStart"||c==="preserveStartEnd"?h=rQ(b,v,y,a,s,c==="preserveStartEnd"):h=tQ(b,v,y,a,s),h.filter(function(m){return m.isShow}))}var nQ=["viewBox"],aQ=["viewBox"],iQ=["ticks"];function Gi(e){"@babel/helpers - typeof";return Gi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gi(e)}function si(){return si=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},si.apply(this,arguments)}function uj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function He(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?uj(Object(r),!0).forEach(function(n){Xy(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hh(e,t){if(e==null)return{};var r=oQ(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function oQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function sQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dj(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,TO(n.key),n)}}function lQ(e,t,r){return t&&dj(e.prototype,t),r&&dj(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function cQ(e,t,r){return t=Qu(t),uQ(e,$O()?Reflect.construct(t,r||[],Qu(e).constructor):t.apply(e,r))}function uQ(e,t){if(t&&(Gi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dQ(e)}function dQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $O(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($O=function(){return!!e})()}function Qu(e){return Qu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Qu(e)}function fQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Tm(e,t)}function Tm(e,t){return Tm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Tm(e,t)}function Xy(e,t,r){return t=TO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function TO(e){var t=hQ(e,"string");return Gi(t)=="symbol"?t:t+""}function hQ(e,t){if(Gi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Gi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var go=function(e){function t(r){var n;return sQ(this,t),n=cQ(this,t,[r]),n.state={fontSize:"",letterSpacing:""},n}return fQ(t,e),lQ(t,[{key:"shouldComponentUpdate",value:function(n,a){var i=n.viewBox,s=hh(n,nQ),l=this.props,c=l.viewBox,u=hh(l,aQ);return!mi(i,c)||!mi(s,u)||!mi(a,this.state)}},{key:"componentDidMount",value:function(){var n=this.layerReference;if(n){var a=n.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];a&&this.setState({fontSize:window.getComputedStyle(a).fontSize,letterSpacing:window.getComputedStyle(a).letterSpacing})}}},{key:"getTickLineCoord",value:function(n){var a=this.props,i=a.x,s=a.y,l=a.width,c=a.height,u=a.orientation,f=a.tickSize,d=a.mirror,h=a.tickMargin,p,g,y,b,v,m,x=d?-1:1,S=n.tickSize||f,j=U(n.tickCoord)?n.tickCoord:n.coordinate;switch(u){case"top":p=g=n.coordinate,b=s+ +!d*c,y=b-x*S,m=y-x*h,v=j;break;case"left":y=b=n.coordinate,g=i+ +!d*l,p=g-x*S,v=p-x*h,m=j;break;case"right":y=b=n.coordinate,g=i+ +d*l,p=g+x*S,v=p+x*h,m=j;break;default:p=g=n.coordinate,b=s+ +d*c,y=b+x*S,m=y+x*h,v=j;break}return{line:{x1:p,y1:y,x2:g,y2:b},tick:{x:v,y:m}}}},{key:"getTickTextAnchor",value:function(){var n=this.props,a=n.orientation,i=n.mirror,s;switch(a){case"left":s=i?"start":"end";break;case"right":s=i?"end":"start";break;default:s="middle";break}return s}},{key:"getTickVerticalAnchor",value:function(){var n=this.props,a=n.orientation,i=n.mirror,s="end";switch(a){case"left":case"right":s="middle";break;case"top":s=i?"start":"end";break;default:s=i?"end":"start";break}return s}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.x,i=n.y,s=n.width,l=n.height,c=n.orientation,u=n.mirror,f=n.axisLine,d=He(He(He({},X(this.props,!1)),X(f,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var h=+(c==="top"&&!u||c==="bottom"&&u);d=He(He({},d),{},{x1:a,y1:i+h*l,x2:a+s,y2:i+h*l})}else{var p=+(c==="left"&&!u||c==="right"&&u);d=He(He({},d),{},{x1:a+p*s,y1:i,x2:a+p*s,y2:i+l})}return $.createElement("line",si({},d,{className:ee("recharts-cartesian-axis-line",Bt(f,"className"))}))}},{key:"renderTicks",value:function(n,a,i){var s=this,l=this.props,c=l.tickLine,u=l.stroke,f=l.tick,d=l.tickFormatter,h=l.unit,p=qy(He(He({},this.props),{},{ticks:n}),a,i),g=this.getTickTextAnchor(),y=this.getTickVerticalAnchor(),b=X(this.props,!1),v=X(f,!1),m=He(He({},b),{},{fill:"none"},X(c,!1)),x=p.map(function(S,j){var w=s.getTickLineCoord(S),_=w.line,O=w.tick,N=He(He(He(He({textAnchor:g,verticalAnchor:y},b),{},{stroke:"none",fill:u},v),O),{},{index:j,payload:S,visibleTicksCount:p.length,tickFormatter:d});return $.createElement(ne,si({className:"recharts-cartesian-axis-tick",key:"tick-".concat(S.value,"-").concat(S.coordinate,"-").concat(S.tickCoord)},en(s.props,S,j)),c&&$.createElement("line",si({},m,_,{className:ee("recharts-cartesian-axis-tick-line",Bt(c,"className"))})),f&&t.renderTickItem(f,N,"".concat(Q(d)?d(S.value,j):S.value).concat(h||"")))});return $.createElement("g",{className:"recharts-cartesian-axis-ticks"},x)}},{key:"render",value:function(){var n=this,a=this.props,i=a.axisLine,s=a.width,l=a.height,c=a.ticksGenerator,u=a.className,f=a.hide;if(f)return null;var d=this.props,h=d.ticks,p=hh(d,iQ),g=h;return Q(c)&&(g=h&&h.length>0?c(this.props):c(p)),s<=0||l<=0||!g||!g.length?null:$.createElement(ne,{className:ee("recharts-cartesian-axis",u),ref:function(b){n.layerReference=b}},i&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),tt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,a,i){var s,l=ee(a.className,"recharts-cartesian-axis-tick-value");return $.isValidElement(n)?s=$.cloneElement(n,He(He({},a),{},{className:l})):Q(n)?s=n(He(He({},a),{},{className:l})):s=$.createElement(Sa,si({},a,{className:"recharts-cartesian-axis-tick-value"}),i),s}}])}(P.Component);Xy(go,"displayName","CartesianAxis");Xy(go,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var pQ=["x1","y1","x2","y2","key"],mQ=["offset"];function Na(e){"@babel/helpers - typeof";return Na=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Na(e)}function fj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function mt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?fj(Object(r),!0).forEach(function(n){vQ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vQ(e,t,r){return t=yQ(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yQ(e){var t=gQ(e,"string");return Na(t)=="symbol"?t:t+""}function gQ(e,t){if(Na(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Na(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ca(){return ca=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ca.apply(this,arguments)}function hj(e,t){if(e==null)return{};var r=xQ(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function xQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var bQ=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,a=t.x,i=t.y,s=t.width,l=t.height,c=t.ry;return $.createElement("rect",{x:a,y:i,ry:c,width:s,height:l,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function MO(e,t){var r;if($.isValidElement(e))r=$.cloneElement(e,t);else if(Q(e))r=e(t);else{var n=t.x1,a=t.y1,i=t.x2,s=t.y2,l=t.key,c=hj(t,pQ),u=X(c,!1);u.offset;var f=hj(u,mQ);r=$.createElement("line",ca({},f,{x1:n,y1:a,x2:i,y2:s,fill:"none",key:l}))}return r}function jQ(e){var t=e.x,r=e.width,n=e.horizontal,a=n===void 0?!0:n,i=e.horizontalPoints;if(!a||!i||!i.length)return null;var s=i.map(function(l,c){var u=mt(mt({},e),{},{x1:t,y1:l,x2:t+r,y2:l,key:"line-".concat(c),index:c});return MO(a,u)});return $.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function wQ(e){var t=e.y,r=e.height,n=e.vertical,a=n===void 0?!0:n,i=e.verticalPoints;if(!a||!i||!i.length)return null;var s=i.map(function(l,c){var u=mt(mt({},e),{},{x1:l,y1:t,x2:l,y2:t+r,key:"line-".concat(c),index:c});return MO(a,u)});return $.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function SQ(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,a=e.y,i=e.width,s=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var f=l.map(function(h){return Math.round(h+a-a)}).sort(function(h,p){return h-p});a!==f[0]&&f.unshift(0);var d=f.map(function(h,p){var g=!f[p+1],y=g?a+s-h:f[p+1]-h;if(y<=0)return null;var b=p%t.length;return $.createElement("rect",{key:"react-".concat(p),y:h,x:n,height:y,width:i,stroke:"none",fill:t[b],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return $.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function _Q(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,a=e.fillOpacity,i=e.x,s=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!r||!n||!n.length)return null;var f=u.map(function(h){return Math.round(h+i-i)}).sort(function(h,p){return h-p});i!==f[0]&&f.unshift(0);var d=f.map(function(h,p){var g=!f[p+1],y=g?i+l-h:f[p+1]-h;if(y<=0)return null;var b=p%n.length;return $.createElement("rect",{key:"react-".concat(p),x:h,y:s,width:y,height:c,stroke:"none",fill:n[b],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return $.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var kQ=function(t,r){var n=t.xAxis,a=t.width,i=t.height,s=t.offset;return Ok(qy(mt(mt(mt({},go.defaultProps),n),{},{ticks:Vr(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),s.left,s.left+s.width,r)},OQ=function(t,r){var n=t.yAxis,a=t.width,i=t.height,s=t.offset;return Ok(qy(mt(mt(mt({},go.defaultProps),n),{},{ticks:Vr(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),s.top,s.top+s.height,r)},Fa={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Ia(e){var t,r,n,a,i,s,l=Ky(),c=Vy(),u=hX(),f=mt(mt({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Fa.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Fa.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Fa.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:Fa.horizontalFill,vertical:(i=e.vertical)!==null&&i!==void 0?i:Fa.vertical,verticalFill:(s=e.verticalFill)!==null&&s!==void 0?s:Fa.verticalFill,x:U(e.x)?e.x:u.left,y:U(e.y)?e.y:u.top,width:U(e.width)?e.width:u.width,height:U(e.height)?e.height:u.height}),d=f.x,h=f.y,p=f.width,g=f.height,y=f.syncWithTicks,b=f.horizontalValues,v=f.verticalValues,m=uX(),x=dX();if(!U(p)||p<=0||!U(g)||g<=0||!U(d)||d!==+d||!U(h)||h!==+h)return null;var S=f.verticalCoordinatesGenerator||kQ,j=f.horizontalCoordinatesGenerator||OQ,w=f.horizontalPoints,_=f.verticalPoints;if((!w||!w.length)&&Q(j)){var O=b&&b.length,N=j({yAxis:x?mt(mt({},x),{},{ticks:O?b:x.ticks}):void 0,width:l,height:c,offset:u},O?!0:y);yr(Array.isArray(N),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Na(N),"]")),Array.isArray(N)&&(w=N)}if((!_||!_.length)&&Q(S)){var k=v&&v.length,E=S({xAxis:m?mt(mt({},m),{},{ticks:k?v:m.ticks}):void 0,width:l,height:c,offset:u},k?!0:y);yr(Array.isArray(E),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Na(E),"]")),Array.isArray(E)&&(_=E)}return $.createElement("g",{className:"recharts-cartesian-grid"},$.createElement(bQ,{fill:f.fill,fillOpacity:f.fillOpacity,x:f.x,y:f.y,width:f.width,height:f.height,ry:f.ry}),$.createElement(jQ,ca({},f,{offset:u,horizontalPoints:w,xAxis:m,yAxis:x})),$.createElement(wQ,ca({},f,{offset:u,verticalPoints:_,xAxis:m,yAxis:x})),$.createElement(SQ,ca({},f,{horizontalPoints:w})),$.createElement(_Q,ca({},f,{verticalPoints:_})))}Ia.displayName="CartesianGrid";var NQ=["layout","type","stroke","connectNulls","isRange","ref"],PQ=["key"],IO;function Yi(e){"@babel/helpers - typeof";return Yi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yi(e)}function LO(e,t){if(e==null)return{};var r=AQ(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function AQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ua(){return ua=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ua.apply(this,arguments)}function pj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function dn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pj(Object(r),!0).forEach(function(n){Nr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function CQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mj(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,RO(n.key),n)}}function EQ(e,t,r){return t&&mj(e.prototype,t),r&&mj(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function $Q(e,t,r){return t=Ju(t),TQ(e,DO()?Reflect.construct(t,r||[],Ju(e).constructor):t.apply(e,r))}function TQ(e,t){if(t&&(Yi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return MQ(e)}function MQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function DO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(DO=function(){return!!e})()}function Ju(e){return Ju=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ju(e)}function IQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mm(e,t)}function Mm(e,t){return Mm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Mm(e,t)}function Nr(e,t,r){return t=RO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function RO(e){var t=LQ(e,"string");return Yi(t)=="symbol"?t:t+""}function LQ(e,t){if(Yi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Yi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Lr=function(e){function t(){var r;CQ(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=$Q(this,t,[].concat(a)),Nr(r,"state",{isAnimationFinished:!0}),Nr(r,"id",uo("recharts-area-")),Nr(r,"handleAnimationEnd",function(){var s=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),Q(s)&&s()}),Nr(r,"handleAnimationStart",function(){var s=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),Q(s)&&s()}),r}return IQ(t,e),EQ(t,[{key:"renderDots",value:function(n,a,i){var s=this.props.isAnimationActive,l=this.state.isAnimationFinished;if(s&&!l)return null;var c=this.props,u=c.dot,f=c.points,d=c.dataKey,h=X(this.props,!1),p=X(u,!0),g=f.map(function(b,v){var m=dn(dn(dn({key:"dot-".concat(v),r:3},h),p),{},{index:v,cx:b.x,cy:b.y,dataKey:d,value:b.value,payload:b.payload,points:f});return t.renderDotItem(u,m)}),y={clipPath:n?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return $.createElement(ne,ua({className:"recharts-area-dots"},y),g)}},{key:"renderHorizontalRect",value:function(n){var a=this.props,i=a.baseLine,s=a.points,l=a.strokeWidth,c=s[0].x,u=s[s.length-1].x,f=n*Math.abs(c-u),d=wn(s.map(function(h){return h.y||0}));return U(i)&&typeof i=="number"?d=Math.max(i,d):i&&Array.isArray(i)&&i.length&&(d=Math.max(wn(i.map(function(h){return h.y||0})),d)),U(d)?$.createElement("rect",{x:c<u?c:c-f,y:0,width:f,height:Math.floor(d+(l?parseInt("".concat(l),10):1))}):null}},{key:"renderVerticalRect",value:function(n){var a=this.props,i=a.baseLine,s=a.points,l=a.strokeWidth,c=s[0].y,u=s[s.length-1].y,f=n*Math.abs(c-u),d=wn(s.map(function(h){return h.x||0}));return U(i)&&typeof i=="number"?d=Math.max(i,d):i&&Array.isArray(i)&&i.length&&(d=Math.max(wn(i.map(function(h){return h.x||0})),d)),U(d)?$.createElement("rect",{x:0,y:c<u?c:c-f,width:d+(l?parseInt("".concat(l),10):1),height:Math.floor(f)}):null}},{key:"renderClipRect",value:function(n){var a=this.props.layout;return a==="vertical"?this.renderVerticalRect(n):this.renderHorizontalRect(n)}},{key:"renderAreaStatically",value:function(n,a,i,s){var l=this.props,c=l.layout,u=l.type,f=l.stroke,d=l.connectNulls,h=l.isRange;l.ref;var p=LO(l,NQ);return $.createElement(ne,{clipPath:i?"url(#clipPath-".concat(s,")"):null},$.createElement(xi,ua({},X(p,!0),{points:n,connectNulls:d,type:u,baseLine:a,layout:c,stroke:"none",className:"recharts-area-area"})),f!=="none"&&$.createElement(xi,ua({},X(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:d,fill:"none",points:n})),f!=="none"&&h&&$.createElement(xi,ua({},X(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:d,fill:"none",points:a})))}},{key:"renderAreaWithAnimation",value:function(n,a){var i=this,s=this.props,l=s.points,c=s.baseLine,u=s.isAnimationActive,f=s.animationBegin,d=s.animationDuration,h=s.animationEasing,p=s.animationId,g=this.state,y=g.prevPoints,b=g.prevBaseLine;return $.createElement(br,{begin:f,duration:d,isActive:u,easing:h,from:{t:0},to:{t:1},key:"area-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(v){var m=v.t;if(y){var x=y.length/l.length,S=l.map(function(O,N){var k=Math.floor(N*x);if(y[k]){var E=y[k],T=lt(E.x,O.x),D=lt(E.y,O.y);return dn(dn({},O),{},{x:T(m),y:D(m)})}return O}),j;if(U(c)&&typeof c=="number"){var w=lt(b,c);j=w(m)}else if(te(c)||co(c)){var _=lt(b,0);j=_(m)}else j=c.map(function(O,N){var k=Math.floor(N*x);if(b[k]){var E=b[k],T=lt(E.x,O.x),D=lt(E.y,O.y);return dn(dn({},O),{},{x:T(m),y:D(m)})}return O});return i.renderAreaStatically(S,j,n,a)}return $.createElement(ne,null,$.createElement("defs",null,$.createElement("clipPath",{id:"animationClipPath-".concat(a)},i.renderClipRect(m))),$.createElement(ne,{clipPath:"url(#animationClipPath-".concat(a,")")},i.renderAreaStatically(l,c,n,a)))})}},{key:"renderArea",value:function(n,a){var i=this.props,s=i.points,l=i.baseLine,c=i.isAnimationActive,u=this.state,f=u.prevPoints,d=u.prevBaseLine,h=u.totalLength;return c&&s&&s.length&&(!f&&h>0||!_a(f,s)||!_a(d,l))?this.renderAreaWithAnimation(n,a):this.renderAreaStatically(s,l,n,a)}},{key:"render",value:function(){var n,a=this.props,i=a.hide,s=a.dot,l=a.points,c=a.className,u=a.top,f=a.left,d=a.xAxis,h=a.yAxis,p=a.width,g=a.height,y=a.isAnimationActive,b=a.id;if(i||!l||!l.length)return null;var v=this.state.isAnimationFinished,m=l.length===1,x=ee("recharts-area",c),S=d&&d.allowDataOverflow,j=h&&h.allowDataOverflow,w=S||j,_=te(b)?this.id:b,O=(n=X(s,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},N=O.r,k=N===void 0?3:N,E=O.strokeWidth,T=E===void 0?2:E,D=q3(s)?s:{},A=D.clipDot,L=A===void 0?!0:A,C=k*2+T;return $.createElement(ne,{className:x},S||j?$.createElement("defs",null,$.createElement("clipPath",{id:"clipPath-".concat(_)},$.createElement("rect",{x:S?f:f-p/2,y:j?u:u-g/2,width:S?p:p*2,height:j?g:g*2})),!L&&$.createElement("clipPath",{id:"clipPath-dots-".concat(_)},$.createElement("rect",{x:f-C/2,y:u-C/2,width:p+C,height:g+C}))):null,m?null:this.renderArea(w,_),(s||m)&&this.renderDots(w,L,_),(!y||v)&&Er.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:a.curPoints,prevBaseLine:a.curBaseLine}:n.points!==a.curPoints||n.baseLine!==a.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(P.PureComponent);IO=Lr;Nr(Lr,"displayName","Area");Nr(Lr,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Wn.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Nr(Lr,"getBaseValue",function(e,t,r,n){var a=e.layout,i=e.baseValue,s=t.props.baseValue,l=s??i;if(U(l)&&typeof l=="number")return l;var c=a==="horizontal"?n:r,u=c.scale.domain();if(c.type==="number"){var f=Math.max(u[0],u[1]),d=Math.min(u[0],u[1]);return l==="dataMin"?d:l==="dataMax"||f<0?f:Math.max(Math.min(u[0],u[1]),0)}return l==="dataMin"?u[0]:l==="dataMax"?u[1]:u[0]});Nr(Lr,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,a=e.yAxis,i=e.xAxisTicks,s=e.yAxisTicks,l=e.bandSize,c=e.dataKey,u=e.stackedData,f=e.dataStartIndex,d=e.displayedData,h=e.offset,p=t.layout,g=u&&u.length,y=IO.getBaseValue(t,r,n,a),b=p==="horizontal",v=!1,m=d.map(function(S,j){var w;g?w=u[f+j]:(w=Be(S,c),Array.isArray(w)?v=!0:w=[y,w]);var _=w[1]==null||g&&Be(S,c)==null;return b?{x:Rb({axis:n,ticks:i,bandSize:l,entry:S,index:j}),y:_?null:a.scale(w[1]),value:w,payload:S}:{x:_?null:n.scale(w[1]),y:Rb({axis:a,ticks:s,bandSize:l,entry:S,index:j}),value:w,payload:S}}),x;return g||v?x=m.map(function(S){var j=Array.isArray(S.value)?S.value[0]:null;return b?{x:S.x,y:j!=null&&S.y!=null?a.scale(j):null}:{x:j!=null?n.scale(j):null,y:S.y}}):x=b?a.scale(y):n.scale(y),dn({points:m,baseLine:x,layout:p,isRange:v},h)});Nr(Lr,"renderDotItem",function(e,t){var r;if($.isValidElement(e))r=$.cloneElement(e,t);else if(Q(e))r=e(t);else{var n=ee("recharts-area-dot",typeof e!="boolean"?e.className:""),a=t.key,i=LO(t,PQ);r=$.createElement(Zd,ua({},i,{key:a,className:n}))}return r});function qi(e){"@babel/helpers - typeof";return qi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qi(e)}function DQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function RQ(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,zO(n.key),n)}}function BQ(e,t,r){return t&&RQ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function FQ(e,t,r){return t=Zu(t),zQ(e,BO()?Reflect.construct(t,r||[],Zu(e).constructor):t.apply(e,r))}function zQ(e,t){if(t&&(qi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return WQ(e)}function WQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function BO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(BO=function(){return!!e})()}function Zu(e){return Zu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Zu(e)}function UQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Im(e,t)}function Im(e,t){return Im=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Im(e,t)}function FO(e,t,r){return t=zO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zO(e){var t=HQ(e,"string");return qi(t)=="symbol"?t:t+""}function HQ(e,t){if(qi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(qi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Lm(){return Lm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Lm.apply(this,arguments)}function KQ(e){var t=e.xAxisId,r=Ky(),n=Vy(),a=SO(t);return a==null?null:P.createElement(go,Lm({},a,{className:ee("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(s){return Vr(s,!0)}}))}var or=function(e){function t(){return DQ(this,t),FQ(this,t,arguments)}return UQ(t,e),BQ(t,[{key:"render",value:function(){return P.createElement(KQ,this.props)}}])}(P.Component);FO(or,"displayName","XAxis");FO(or,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function Xi(e){"@babel/helpers - typeof";return Xi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xi(e)}function VQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function GQ(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,HO(n.key),n)}}function YQ(e,t,r){return t&&GQ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function qQ(e,t,r){return t=ed(t),XQ(e,WO()?Reflect.construct(t,r||[],ed(e).constructor):t.apply(e,r))}function XQ(e,t){if(t&&(Xi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return QQ(e)}function QQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function WO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(WO=function(){return!!e})()}function ed(e){return ed=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ed(e)}function JQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Dm(e,t)}function Dm(e,t){return Dm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Dm(e,t)}function UO(e,t,r){return t=HO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function HO(e){var t=ZQ(e,"string");return Xi(t)=="symbol"?t:t+""}function ZQ(e,t){if(Xi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Xi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Rm(){return Rm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rm.apply(this,arguments)}var eJ=function(t){var r=t.yAxisId,n=Ky(),a=Vy(),i=_O(r);return i==null?null:P.createElement(go,Rm({},i,{className:ee("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:a},ticksGenerator:function(l){return Vr(l,!0)}}))},sr=function(e){function t(){return VQ(this,t),qQ(this,t,arguments)}return JQ(t,e),YQ(t,[{key:"render",value:function(){return P.createElement(eJ,this.props)}}])}(P.Component);UO(sr,"displayName","YAxis");UO(sr,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function vj(e){return aJ(e)||nJ(e)||rJ(e)||tJ()}function tJ(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rJ(e,t){if(e){if(typeof e=="string")return Bm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bm(e,t)}}function nJ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function aJ(e){if(Array.isArray(e))return Bm(e)}function Bm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Fm=function(t,r,n,a,i){var s=Ft(t,Yy),l=Ft(t,sf),c=[].concat(vj(s),vj(l)),u=Ft(t,cf),f="".concat(a,"Id"),d=a[0],h=r;if(c.length&&(h=c.reduce(function(y,b){if(b.props[f]===n&&$r(b.props,"extendDomain")&&U(b.props[d])){var v=b.props[d];return[Math.min(y[0],v),Math.max(y[1],v)]}return y},h)),u.length){var p="".concat(d,"1"),g="".concat(d,"2");h=u.reduce(function(y,b){if(b.props[f]===n&&$r(b.props,"extendDomain")&&U(b.props[p])&&U(b.props[g])){var v=b.props[p],m=b.props[g];return[Math.min(y[0],v,m),Math.max(y[1],v,m)]}return y},h)}return i&&i.length&&(h=i.reduce(function(y,b){return U(b)?[Math.min(y[0],b),Math.max(y[1],b)]:y},h)),h},KO={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function a(c,u,f){this.fn=c,this.context=u,this.once=f||!1}function i(c,u,f,d,h){if(typeof f!="function")throw new TypeError("The listener must be a function");var p=new a(f,d||c,h),g=r?r+u:u;return c._events[g]?c._events[g].fn?c._events[g]=[c._events[g],p]:c._events[g].push(p):(c._events[g]=p,c._eventsCount++),c}function s(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],f,d;if(this._eventsCount===0)return u;for(d in f=this._events)t.call(f,d)&&u.push(r?d.slice(1):d);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},l.prototype.listeners=function(u){var f=r?r+u:u,d=this._events[f];if(!d)return[];if(d.fn)return[d.fn];for(var h=0,p=d.length,g=new Array(p);h<p;h++)g[h]=d[h].fn;return g},l.prototype.listenerCount=function(u){var f=r?r+u:u,d=this._events[f];return d?d.fn?1:d.length:0},l.prototype.emit=function(u,f,d,h,p,g){var y=r?r+u:u;if(!this._events[y])return!1;var b=this._events[y],v=arguments.length,m,x;if(b.fn){switch(b.once&&this.removeListener(u,b.fn,void 0,!0),v){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,f),!0;case 3:return b.fn.call(b.context,f,d),!0;case 4:return b.fn.call(b.context,f,d,h),!0;case 5:return b.fn.call(b.context,f,d,h,p),!0;case 6:return b.fn.call(b.context,f,d,h,p,g),!0}for(x=1,m=new Array(v-1);x<v;x++)m[x-1]=arguments[x];b.fn.apply(b.context,m)}else{var S=b.length,j;for(x=0;x<S;x++)switch(b[x].once&&this.removeListener(u,b[x].fn,void 0,!0),v){case 1:b[x].fn.call(b[x].context);break;case 2:b[x].fn.call(b[x].context,f);break;case 3:b[x].fn.call(b[x].context,f,d);break;case 4:b[x].fn.call(b[x].context,f,d,h);break;default:if(!m)for(j=1,m=new Array(v-1);j<v;j++)m[j-1]=arguments[j];b[x].fn.apply(b[x].context,m)}}return!0},l.prototype.on=function(u,f,d){return i(this,u,f,d,!1)},l.prototype.once=function(u,f,d){return i(this,u,f,d,!0)},l.prototype.removeListener=function(u,f,d,h){var p=r?r+u:u;if(!this._events[p])return this;if(!f)return s(this,p),this;var g=this._events[p];if(g.fn)g.fn===f&&(!h||g.once)&&(!d||g.context===d)&&s(this,p);else{for(var y=0,b=[],v=g.length;y<v;y++)(g[y].fn!==f||h&&!g[y].once||d&&g[y].context!==d)&&b.push(g[y]);b.length?this._events[p]=b.length===1?b[0]:b:s(this,p)}return this},l.prototype.removeAllListeners=function(u){var f;return u?(f=r?r+u:u,this._events[f]&&s(this,f)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,e.exports=l})(KO);var iJ=KO.exports;const oJ=de(iJ);var ph=new oJ,mh="recharts.syncMouseEvents";function ol(e){"@babel/helpers - typeof";return ol=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ol(e)}function sJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lJ(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,VO(n.key),n)}}function cJ(e,t,r){return t&&lJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function vh(e,t,r){return t=VO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function VO(e){var t=uJ(e,"string");return ol(t)=="symbol"?t:t+""}function uJ(e,t){if(ol(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ol(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var dJ=function(){function e(){sJ(this,e),vh(this,"activeIndex",0),vh(this,"coordinateList",[]),vh(this,"layout","horizontal")}return cJ(e,[{key:"setDetails",value:function(r){var n,a=r.coordinateList,i=a===void 0?null:a,s=r.container,l=s===void 0?null:s,c=r.layout,u=c===void 0?null:c,f=r.offset,d=f===void 0?null:f,h=r.mouseHandlerCallback,p=h===void 0?null:h;this.coordinateList=(n=i??this.coordinateList)!==null&&n!==void 0?n:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=d??this.offset,this.mouseHandlerCallback=p??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(r){if(this.coordinateList.length!==0)switch(r.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(r){this.activeIndex=r}},{key:"spoofMouse",value:function(){var r,n;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var a=this.container.getBoundingClientRect(),i=a.x,s=a.y,l=a.height,c=this.coordinateList[this.activeIndex].coordinate,u=((r=window)===null||r===void 0?void 0:r.scrollX)||0,f=((n=window)===null||n===void 0?void 0:n.scrollY)||0,d=i+c+u,h=s+this.offset.top+l/2+f;this.mouseHandlerCallback({pageX:d,pageY:h})}}}])}();function fJ(e,t,r){if(r==="number"&&t===!0&&Array.isArray(e)){var n=e==null?void 0:e[0],a=e==null?void 0:e[1];if(n&&a&&U(n)&&U(a))return!0}return!1}function hJ(e,t,r,n){var a=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-a,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function GO(e){var t=e.cx,r=e.cy,n=e.radius,a=e.startAngle,i=e.endAngle,s=ye(t,r,n,a),l=ye(t,r,n,i);return{points:[s,l],cx:t,cy:r,radius:n,startAngle:a,endAngle:i}}function pJ(e,t,r){var n,a,i,s;if(e==="horizontal")n=t.x,i=n,a=r.top,s=r.top+r.height;else if(e==="vertical")a=t.y,s=a,n=r.left,i=r.left+r.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,u=t.innerRadius,f=t.outerRadius,d=t.angle,h=ye(l,c,u,d),p=ye(l,c,f,d);n=h.x,a=h.y,i=p.x,s=p.y}else return GO(t);return[{x:n,y:a},{x:i,y:s}]}function sl(e){"@babel/helpers - typeof";return sl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sl(e)}function yj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function nc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yj(Object(r),!0).forEach(function(n){mJ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function mJ(e,t,r){return t=vJ(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vJ(e){var t=yJ(e,"string");return sl(t)=="symbol"?t:t+""}function yJ(e,t){if(sl(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(sl(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gJ(e){var t,r,n=e.element,a=e.tooltipEventType,i=e.isActive,s=e.activeCoordinate,l=e.activePayload,c=e.offset,u=e.activeTooltipIndex,f=e.tooltipAxisBandSize,d=e.layout,h=e.chartName,p=(t=n.props.cursor)!==null&&t!==void 0?t:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!p||!i||!s||h!=="ScatterChart"&&a!=="axis")return null;var g,y=xi;if(h==="ScatterChart")g=s,y=OV;else if(h==="BarChart")g=hJ(d,s,c,f),y=Fy;else if(d==="radial"){var b=GO(s),v=b.cx,m=b.cy,x=b.radius,S=b.startAngle,j=b.endAngle;g={cx:v,cy:m,startAngle:S,endAngle:j,innerRadius:x,outerRadius:x},y=Fk}else g={points:pJ(d,s,c)},y=xi;var w=nc(nc(nc(nc({stroke:"#ccc",pointerEvents:"none"},c),g),X(p,!1)),{},{payload:l,payloadIndex:u,className:ee("recharts-tooltip-cursor",p.className)});return P.isValidElement(p)?P.cloneElement(p,w):P.createElement(y,w)}var xJ=["item"],bJ=["children","className","width","height","style","compact","title","desc"];function Qi(e){"@babel/helpers - typeof";return Qi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qi(e)}function li(){return li=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},li.apply(this,arguments)}function gj(e,t){return SJ(e)||wJ(e,t)||qO(e,t)||jJ()}function jJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wJ(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(f){u=!0,a=f}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return l}}function SJ(e){if(Array.isArray(e))return e}function xj(e,t){if(e==null)return{};var r=_J(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _J(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function kJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OJ(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,XO(n.key),n)}}function NJ(e,t,r){return t&&OJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function PJ(e,t,r){return t=td(t),AJ(e,YO()?Reflect.construct(t,r||[],td(e).constructor):t.apply(e,r))}function AJ(e,t){if(t&&(Qi(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return CJ(e)}function CJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function YO(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(YO=function(){return!!e})()}function td(e){return td=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},td(e)}function EJ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zm(e,t)}function zm(e,t){return zm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},zm(e,t)}function Ji(e){return MJ(e)||TJ(e)||qO(e)||$J()}function $J(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qO(e,t){if(e){if(typeof e=="string")return Wm(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Wm(e,t)}}function TJ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function MJ(e){if(Array.isArray(e))return Wm(e)}function Wm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function bj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function B(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bj(Object(r),!0).forEach(function(n){J(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bj(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function J(e,t,r){return t=XO(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XO(e){var t=IJ(e,"string");return Qi(t)=="symbol"?t:t+""}function IJ(e,t){if(Qi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Qi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var LJ={xAxis:["bottom","top"],yAxis:["left","right"]},DJ={width:"100%",height:"100%"},QO={x:0,y:0};function ac(e){return e}var RJ=function(t,r){return r==="horizontal"?t.x:r==="vertical"?t.y:r==="centric"?t.angle:t.radius},BJ=function(t,r,n,a){var i=r.find(function(f){return f&&f.index===n});if(i){if(t==="horizontal")return{x:i.coordinate,y:a.y};if(t==="vertical")return{x:a.x,y:i.coordinate};if(t==="centric"){var s=i.coordinate,l=a.radius;return B(B(B({},a),ye(a.cx,a.cy,l,s)),{},{angle:s,radius:l})}var c=i.coordinate,u=a.angle;return B(B(B({},a),ye(a.cx,a.cy,c,u)),{},{angle:u,radius:c})}return QO},uf=function(t,r){var n=r.graphicalItems,a=r.dataStartIndex,i=r.dataEndIndex,s=(n??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(Ji(l),Ji(u)):l},[]);return s.length>0?s:t&&t.length&&U(a)&&U(i)?t.slice(a,i+1):[]};function JO(e){return e==="number"?[0,"auto"]:void 0}var Um=function(t,r,n,a){var i=t.graphicalItems,s=t.tooltipAxis,l=uf(r,t);return n<0||!i||!i.length||n>=l.length?null:i.reduce(function(c,u){var f,d=(f=u.props.data)!==null&&f!==void 0?f:r;d&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(d=d.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(s.dataKey&&!s.allowDuplicatedCategory){var p=d===void 0?l:d;h=Qc(p,s.dataKey,a)}else h=d&&d[n]||l[n];return h?[].concat(Ji(c),[By(u,h)]):c},[])},jj=function(t,r,n,a){var i=a||{x:t.chartX,y:t.chartY},s=RJ(i,n),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,f=XW(s,l,u,c);if(f>=0&&u){var d=u[f]&&u[f].value,h=Um(t,r,f,d),p=BJ(n,l,f,i);return{activeTooltipIndex:f,activeLabel:d,activePayload:h,activeCoordinate:p}}return null},FJ=function(t,r){var n=r.axes,a=r.graphicalItems,i=r.axisType,s=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,h=t.stackOffset,p=kk(f,i);return n.reduce(function(g,y){var b,v=y.type.defaultProps!==void 0?B(B({},y.type.defaultProps),y.props):y.props,m=v.type,x=v.dataKey,S=v.allowDataOverflow,j=v.allowDuplicatedCategory,w=v.scale,_=v.ticks,O=v.includeHidden,N=v[s];if(g[N])return g;var k=uf(t.data,{graphicalItems:a.filter(function(z){var q,ie=s in z.props?z.props[s]:(q=z.type.defaultProps)===null||q===void 0?void 0:q[s];return ie===N}),dataStartIndex:c,dataEndIndex:u}),E=k.length,T,D,A;fJ(v.domain,S,m)&&(T=rm(v.domain,null,S),p&&(m==="number"||w!=="auto")&&(A=ns(k,x,"category")));var L=JO(m);if(!T||T.length===0){var C,M=(C=v.domain)!==null&&C!==void 0?C:L;if(x){if(T=ns(k,x,m),m==="category"&&p){var I=B3(T);j&&I?(D=T,T=Wu(0,E)):j||(T=zb(M,T,y).reduce(function(z,q){return z.indexOf(q)>=0?z:[].concat(Ji(z),[q])},[]))}else if(m==="category")j?T=T.filter(function(z){return z!==""&&!te(z)}):T=zb(M,T,y).reduce(function(z,q){return z.indexOf(q)>=0||q===""||te(q)?z:[].concat(Ji(z),[q])},[]);else if(m==="number"){var R=tU(k,a.filter(function(z){var q,ie,he=s in z.props?z.props[s]:(q=z.type.defaultProps)===null||q===void 0?void 0:q[s],ge="hide"in z.props?z.props.hide:(ie=z.type.defaultProps)===null||ie===void 0?void 0:ie.hide;return he===N&&(O||!ge)}),x,i,f);R&&(T=R)}p&&(m==="number"||w!=="auto")&&(A=ns(k,x,"category"))}else p?T=Wu(0,E):l&&l[N]&&l[N].hasStack&&m==="number"?T=h==="expand"?[0,1]:Tk(l[N].stackGroups,c,u):T=_k(k,a.filter(function(z){var q=s in z.props?z.props[s]:z.type.defaultProps[s],ie="hide"in z.props?z.props.hide:z.type.defaultProps.hide;return q===N&&(O||!ie)}),m,f,!0);if(m==="number")T=Fm(d,T,N,i,_),M&&(T=rm(M,T,S));else if(m==="category"&&M){var F=M,K=T.every(function(z){return F.indexOf(z)>=0});K&&(T=F)}}return B(B({},g),{},J({},N,B(B({},v),{},{axisType:i,domain:T,categoricalDomain:A,duplicateDomain:D,originalDomain:(b=v.domain)!==null&&b!==void 0?b:L,isCategorical:p,layout:f})))},{})},zJ=function(t,r){var n=r.graphicalItems,a=r.Axis,i=r.axisType,s=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,h=uf(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:u}),p=h.length,g=kk(f,i),y=-1;return n.reduce(function(b,v){var m=v.type.defaultProps!==void 0?B(B({},v.type.defaultProps),v.props):v.props,x=m[s],S=JO("number");if(!b[x]){y++;var j;return g?j=Wu(0,p):l&&l[x]&&l[x].hasStack?(j=Tk(l[x].stackGroups,c,u),j=Fm(d,j,x,i)):(j=rm(S,_k(h,n.filter(function(w){var _,O,N=s in w.props?w.props[s]:(_=w.type.defaultProps)===null||_===void 0?void 0:_[s],k="hide"in w.props?w.props.hide:(O=w.type.defaultProps)===null||O===void 0?void 0:O.hide;return N===x&&!k}),"number",f),a.defaultProps.allowDataOverflow),j=Fm(d,j,x,i)),B(B({},b),{},J({},x,B(B({axisType:i},a.defaultProps),{},{hide:!0,orientation:Bt(LJ,"".concat(i,".").concat(y%2),null),domain:j,originalDomain:S,isCategorical:g,layout:f})))}return b},{})},WJ=function(t,r){var n=r.axisType,a=n===void 0?"xAxis":n,i=r.AxisComp,s=r.graphicalItems,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,f=t.children,d="".concat(a,"Id"),h=Ft(f,i),p={};return h&&h.length?p=FJ(t,{axes:h,graphicalItems:s,axisType:a,axisIdKey:d,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):s&&s.length&&(p=zJ(t,{Axis:i,graphicalItems:s,axisType:a,axisIdKey:d,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),p},UJ=function(t){var r=gn(t),n=Vr(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:fy(n,function(a){return a.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Nu(r,n)}},wj=function(t){var r=t.children,n=t.defaultShowTooltip,a=It(r,Wi),i=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(s=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!n}},HJ=function(t){return!t||!t.length?!1:t.some(function(r){var n=Yr(r&&r.type);return n&&n.indexOf("Bar")>=0})},Sj=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},KJ=function(t,r){var n=t.props,a=t.graphicalItems,i=t.xAxisMap,s=i===void 0?{}:i,l=t.yAxisMap,c=l===void 0?{}:l,u=n.width,f=n.height,d=n.children,h=n.margin||{},p=It(d,Wi),g=It(d,vi),y=Object.keys(c).reduce(function(j,w){var _=c[w],O=_.orientation;return!_.mirror&&!_.hide?B(B({},j),{},J({},O,j[O]+_.width)):j},{left:h.left||0,right:h.right||0}),b=Object.keys(s).reduce(function(j,w){var _=s[w],O=_.orientation;return!_.mirror&&!_.hide?B(B({},j),{},J({},O,Bt(j,"".concat(O))+_.height)):j},{top:h.top||0,bottom:h.bottom||0}),v=B(B({},b),y),m=v.bottom;p&&(v.bottom+=p.props.height||Wi.defaultProps.height),g&&r&&(v=ZW(v,a,n,r));var x=u-v.left-v.right,S=f-v.top-v.bottom;return B(B({brushBottom:m},v),{},{width:Math.max(x,0),height:Math.max(S,0)})},VJ=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},df=function(t){var r=t.chartName,n=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,s=t.validateTooltipEventTypes,l=s===void 0?["axis"]:s,c=t.axisComponents,u=t.legendContent,f=t.formatAxisMap,d=t.defaultProps,h=function(v,m){var x=m.graphicalItems,S=m.stackGroups,j=m.offset,w=m.updateId,_=m.dataStartIndex,O=m.dataEndIndex,N=v.barSize,k=v.layout,E=v.barGap,T=v.barCategoryGap,D=v.maxBarSize,A=Sj(k),L=A.numericAxisName,C=A.cateAxisName,M=HJ(x),I=[];return x.forEach(function(R,F){var K=uf(v.data,{graphicalItems:[R],dataStartIndex:_,dataEndIndex:O}),z=R.type.defaultProps!==void 0?B(B({},R.type.defaultProps),R.props):R.props,q=z.dataKey,ie=z.maxBarSize,he=z["".concat(L,"Id")],ge=z["".concat(C,"Id")],Qe={},Ae=c.reduce(function(Vn,Gn){var ff=m["".concat(Gn.axisType,"Map")],eg=z["".concat(Gn.axisType,"Id")];ff&&ff[eg]||Gn.axisType==="zAxis"||Oa();var tg=ff[eg];return B(B({},Vn),{},J(J({},Gn.axisType,tg),"".concat(Gn.axisType,"Ticks"),Vr(tg)))},Qe),V=Ae[C],Z=Ae["".concat(C,"Ticks")],re=S&&S[he]&&S[he].hasStack&&sU(R,S[he].stackGroups),W=Yr(R.type).indexOf("Bar")>=0,Te=Nu(V,Z),oe=[],We=M&&QW({barSize:N,stackGroups:S,totalSize:VJ(Ae,C)});if(W){var Ue,_t,cn=te(ie)?D:ie,La=(Ue=(_t=Nu(V,Z,!0))!==null&&_t!==void 0?_t:cn)!==null&&Ue!==void 0?Ue:0;oe=JW({barGap:E,barCategoryGap:T,bandSize:La!==Te?La:Te,sizeList:We[ge],maxBarSize:cn}),La!==Te&&(oe=oe.map(function(Vn){return B(B({},Vn),{},{position:B(B({},Vn.position),{},{offset:Vn.position.offset-La/2})})}))}var kl=R&&R.type&&R.type.getComposedData;kl&&I.push({props:B(B({},kl(B(B({},Ae),{},{displayedData:K,props:v,dataKey:q,item:R,bandSize:Te,barPosition:oe,offset:j,stackedData:re,layout:k,dataStartIndex:_,dataEndIndex:O}))),{},J(J(J({key:R.key||"item-".concat(F)},L,Ae[L]),C,Ae[C]),"animationId",w)),childIndex:J3(R,v.children),item:R})}),I},p=function(v,m){var x=v.props,S=v.dataStartIndex,j=v.dataEndIndex,w=v.updateId;if(!I0({props:x}))return null;var _=x.children,O=x.layout,N=x.stackOffset,k=x.data,E=x.reverseStackOrder,T=Sj(O),D=T.numericAxisName,A=T.cateAxisName,L=Ft(_,n),C=oU(k,L,"".concat(D,"Id"),"".concat(A,"Id"),N,E),M=c.reduce(function(z,q){var ie="".concat(q.axisType,"Map");return B(B({},z),{},J({},ie,WJ(x,B(B({},q),{},{graphicalItems:L,stackGroups:q.axisType===D&&C,dataStartIndex:S,dataEndIndex:j}))))},{}),I=KJ(B(B({},M),{},{props:x,graphicalItems:L}),m==null?void 0:m.legendBBox);Object.keys(M).forEach(function(z){M[z]=f(x,M[z],I,z.replace("Map",""),r)});var R=M["".concat(A,"Map")],F=UJ(R),K=h(x,B(B({},M),{},{dataStartIndex:S,dataEndIndex:j,updateId:w,graphicalItems:L,stackGroups:C,offset:I}));return B(B({formattedGraphicalItems:K,graphicalItems:L,offset:I,stackGroups:C},F),M)},g=function(b){function v(m){var x,S,j;return kJ(this,v),j=PJ(this,v,[m]),J(j,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),J(j,"accessibilityManager",new dJ),J(j,"handleLegendBBoxUpdate",function(w){if(w){var _=j.state,O=_.dataStartIndex,N=_.dataEndIndex,k=_.updateId;j.setState(B({legendBBox:w},p({props:j.props,dataStartIndex:O,dataEndIndex:N,updateId:k},B(B({},j.state),{},{legendBBox:w}))))}}),J(j,"handleReceiveSyncEvent",function(w,_,O){if(j.props.syncId===w){if(O===j.eventEmitterSymbol&&typeof j.props.syncMethod!="function")return;j.applySyncEvent(_)}}),J(j,"handleBrushChange",function(w){var _=w.startIndex,O=w.endIndex;if(_!==j.state.dataStartIndex||O!==j.state.dataEndIndex){var N=j.state.updateId;j.setState(function(){return B({dataStartIndex:_,dataEndIndex:O},p({props:j.props,dataStartIndex:_,dataEndIndex:O,updateId:N},j.state))}),j.triggerSyncEvent({dataStartIndex:_,dataEndIndex:O})}}),J(j,"handleMouseEnter",function(w){var _=j.getMouseInfo(w);if(_){var O=B(B({},_),{},{isTooltipActive:!0});j.setState(O),j.triggerSyncEvent(O);var N=j.props.onMouseEnter;Q(N)&&N(O,w)}}),J(j,"triggeredAfterMouseMove",function(w){var _=j.getMouseInfo(w),O=_?B(B({},_),{},{isTooltipActive:!0}):{isTooltipActive:!1};j.setState(O),j.triggerSyncEvent(O);var N=j.props.onMouseMove;Q(N)&&N(O,w)}),J(j,"handleItemMouseEnter",function(w){j.setState(function(){return{isTooltipActive:!0,activeItem:w,activePayload:w.tooltipPayload,activeCoordinate:w.tooltipPosition||{x:w.cx,y:w.cy}}})}),J(j,"handleItemMouseLeave",function(){j.setState(function(){return{isTooltipActive:!1}})}),J(j,"handleMouseMove",function(w){w.persist(),j.throttleTriggeredAfterMouseMove(w)}),J(j,"handleMouseLeave",function(w){j.throttleTriggeredAfterMouseMove.cancel();var _={isTooltipActive:!1};j.setState(_),j.triggerSyncEvent(_);var O=j.props.onMouseLeave;Q(O)&&O(_,w)}),J(j,"handleOuterEvent",function(w){var _=Q3(w),O=Bt(j.props,"".concat(_));if(_&&Q(O)){var N,k;/.*touch.*/i.test(_)?k=j.getMouseInfo(w.changedTouches[0]):k=j.getMouseInfo(w),O((N=k)!==null&&N!==void 0?N:{},w)}}),J(j,"handleClick",function(w){var _=j.getMouseInfo(w);if(_){var O=B(B({},_),{},{isTooltipActive:!0});j.setState(O),j.triggerSyncEvent(O);var N=j.props.onClick;Q(N)&&N(O,w)}}),J(j,"handleMouseDown",function(w){var _=j.props.onMouseDown;if(Q(_)){var O=j.getMouseInfo(w);_(O,w)}}),J(j,"handleMouseUp",function(w){var _=j.props.onMouseUp;if(Q(_)){var O=j.getMouseInfo(w);_(O,w)}}),J(j,"handleTouchMove",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&j.throttleTriggeredAfterMouseMove(w.changedTouches[0])}),J(j,"handleTouchStart",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&j.handleMouseDown(w.changedTouches[0])}),J(j,"handleTouchEnd",function(w){w.changedTouches!=null&&w.changedTouches.length>0&&j.handleMouseUp(w.changedTouches[0])}),J(j,"handleDoubleClick",function(w){var _=j.props.onDoubleClick;if(Q(_)){var O=j.getMouseInfo(w);_(O,w)}}),J(j,"handleContextMenu",function(w){var _=j.props.onContextMenu;if(Q(_)){var O=j.getMouseInfo(w);_(O,w)}}),J(j,"triggerSyncEvent",function(w){j.props.syncId!==void 0&&ph.emit(mh,j.props.syncId,w,j.eventEmitterSymbol)}),J(j,"applySyncEvent",function(w){var _=j.props,O=_.layout,N=_.syncMethod,k=j.state.updateId,E=w.dataStartIndex,T=w.dataEndIndex;if(w.dataStartIndex!==void 0||w.dataEndIndex!==void 0)j.setState(B({dataStartIndex:E,dataEndIndex:T},p({props:j.props,dataStartIndex:E,dataEndIndex:T,updateId:k},j.state)));else if(w.activeTooltipIndex!==void 0){var D=w.chartX,A=w.chartY,L=w.activeTooltipIndex,C=j.state,M=C.offset,I=C.tooltipTicks;if(!M)return;if(typeof N=="function")L=N(I,w);else if(N==="value"){L=-1;for(var R=0;R<I.length;R++)if(I[R].value===w.activeLabel){L=R;break}}var F=B(B({},M),{},{x:M.left,y:M.top}),K=Math.min(D,F.x+F.width),z=Math.min(A,F.y+F.height),q=I[L]&&I[L].value,ie=Um(j.state,j.props.data,L),he=I[L]?{x:O==="horizontal"?I[L].coordinate:K,y:O==="horizontal"?z:I[L].coordinate}:QO;j.setState(B(B({},w),{},{activeLabel:q,activeCoordinate:he,activePayload:ie,activeTooltipIndex:L}))}else j.setState(w)}),J(j,"renderCursor",function(w){var _,O=j.state,N=O.isTooltipActive,k=O.activeCoordinate,E=O.activePayload,T=O.offset,D=O.activeTooltipIndex,A=O.tooltipAxisBandSize,L=j.getTooltipEventType(),C=(_=w.props.active)!==null&&_!==void 0?_:N,M=j.props.layout,I=w.key||"_recharts-cursor";return $.createElement(gJ,{key:I,activeCoordinate:k,activePayload:E,activeTooltipIndex:D,chartName:r,element:w,isActive:C,layout:M,offset:T,tooltipAxisBandSize:A,tooltipEventType:L})}),J(j,"renderPolarAxis",function(w,_,O){var N=Bt(w,"type.axisType"),k=Bt(j.state,"".concat(N,"Map")),E=w.type.defaultProps,T=E!==void 0?B(B({},E),w.props):w.props,D=k&&k[T["".concat(N,"Id")]];return P.cloneElement(w,B(B({},D),{},{className:ee(N,D.className),key:w.key||"".concat(_,"-").concat(O),ticks:Vr(D,!0)}))}),J(j,"renderPolarGrid",function(w){var _=w.props,O=_.radialLines,N=_.polarAngles,k=_.polarRadius,E=j.state,T=E.radiusAxisMap,D=E.angleAxisMap,A=gn(T),L=gn(D),C=L.cx,M=L.cy,I=L.innerRadius,R=L.outerRadius;return P.cloneElement(w,{polarAngles:Array.isArray(N)?N:Vr(L,!0).map(function(F){return F.coordinate}),polarRadius:Array.isArray(k)?k:Vr(A,!0).map(function(F){return F.coordinate}),cx:C,cy:M,innerRadius:I,outerRadius:R,key:w.key||"polar-grid",radialLines:O})}),J(j,"renderLegend",function(){var w=j.state.formattedGraphicalItems,_=j.props,O=_.children,N=_.width,k=_.height,E=j.props.margin||{},T=N-(E.left||0)-(E.right||0),D=wk({children:O,formattedGraphicalItems:w,legendWidth:T,legendContent:u});if(!D)return null;var A=D.item,L=xj(D,xJ);return P.cloneElement(A,B(B({},L),{},{chartWidth:N,chartHeight:k,margin:E,onBBoxUpdate:j.handleLegendBBoxUpdate}))}),J(j,"renderTooltip",function(){var w,_=j.props,O=_.children,N=_.accessibilityLayer,k=It(O,Ge);if(!k)return null;var E=j.state,T=E.isTooltipActive,D=E.activeCoordinate,A=E.activePayload,L=E.activeLabel,C=E.offset,M=(w=k.props.active)!==null&&w!==void 0?w:T;return P.cloneElement(k,{viewBox:B(B({},C),{},{x:C.left,y:C.top}),active:M,label:L,payload:M?A:[],coordinate:D,accessibilityLayer:N})}),J(j,"renderBrush",function(w){var _=j.props,O=_.margin,N=_.data,k=j.state,E=k.offset,T=k.dataStartIndex,D=k.dataEndIndex,A=k.updateId;return P.cloneElement(w,{key:w.key||"_recharts-brush",onChange:Zl(j.handleBrushChange,w.props.onChange),data:N,x:U(w.props.x)?w.props.x:E.left,y:U(w.props.y)?w.props.y:E.top+E.height+E.brushBottom-(O.bottom||0),width:U(w.props.width)?w.props.width:E.width,startIndex:T,endIndex:D,updateId:"brush-".concat(A)})}),J(j,"renderReferenceElement",function(w,_,O){if(!w)return null;var N=j,k=N.clipPathId,E=j.state,T=E.xAxisMap,D=E.yAxisMap,A=E.offset,L=w.type.defaultProps||{},C=w.props,M=C.xAxisId,I=M===void 0?L.xAxisId:M,R=C.yAxisId,F=R===void 0?L.yAxisId:R;return P.cloneElement(w,{key:w.key||"".concat(_,"-").concat(O),xAxis:T[I],yAxis:D[F],viewBox:{x:A.left,y:A.top,width:A.width,height:A.height},clipPathId:k})}),J(j,"renderActivePoints",function(w){var _=w.item,O=w.activePoint,N=w.basePoint,k=w.childIndex,E=w.isRange,T=[],D=_.props.key,A=_.item.type.defaultProps!==void 0?B(B({},_.item.type.defaultProps),_.item.props):_.item.props,L=A.activeDot,C=A.dataKey,M=B(B({index:k,dataKey:C,cx:O.x,cy:O.y,r:4,fill:Ry(_.item),strokeWidth:2,stroke:"#fff",payload:O.payload,value:O.value},X(L,!1)),Jc(L));return T.push(v.renderActiveDot(L,M,"".concat(D,"-activePoint-").concat(k))),N?T.push(v.renderActiveDot(L,B(B({},M),{},{cx:N.x,cy:N.y}),"".concat(D,"-basePoint-").concat(k))):E&&T.push(null),T}),J(j,"renderGraphicChild",function(w,_,O){var N=j.filterFormatItem(w,_,O);if(!N)return null;var k=j.getTooltipEventType(),E=j.state,T=E.isTooltipActive,D=E.tooltipAxis,A=E.activeTooltipIndex,L=E.activeLabel,C=j.props.children,M=It(C,Ge),I=N.props,R=I.points,F=I.isRange,K=I.baseLine,z=N.item.type.defaultProps!==void 0?B(B({},N.item.type.defaultProps),N.item.props):N.item.props,q=z.activeDot,ie=z.hide,he=z.activeBar,ge=z.activeShape,Qe=!!(!ie&&T&&M&&(q||he||ge)),Ae={};k!=="axis"&&M&&M.props.trigger==="click"?Ae={onClick:Zl(j.handleItemMouseEnter,w.props.onClick)}:k!=="axis"&&(Ae={onMouseLeave:Zl(j.handleItemMouseLeave,w.props.onMouseLeave),onMouseEnter:Zl(j.handleItemMouseEnter,w.props.onMouseEnter)});var V=P.cloneElement(w,B(B({},N.props),Ae));function Z(Gn){return typeof D.dataKey=="function"?D.dataKey(Gn.payload):null}if(Qe)if(A>=0){var re,W;if(D.dataKey&&!D.allowDuplicatedCategory){var Te=typeof D.dataKey=="function"?Z:"payload.".concat(D.dataKey.toString());re=Qc(R,Te,L),W=F&&K&&Qc(K,Te,L)}else re=R==null?void 0:R[A],W=F&&K&&K[A];if(ge||he){var oe=w.props.activeIndex!==void 0?w.props.activeIndex:A;return[P.cloneElement(w,B(B(B({},N.props),Ae),{},{activeIndex:oe})),null,null]}if(!te(re))return[V].concat(Ji(j.renderActivePoints({item:N,activePoint:re,basePoint:W,childIndex:A,isRange:F})))}else{var We,Ue=(We=j.getItemByXY(j.state.activeCoordinate))!==null&&We!==void 0?We:{graphicalItem:V},_t=Ue.graphicalItem,cn=_t.item,La=cn===void 0?w:cn,kl=_t.childIndex,Vn=B(B(B({},N.props),Ae),{},{activeIndex:kl});return[P.cloneElement(La,Vn),null,null]}return F?[V,null,null]:[V,null]}),J(j,"renderCustomized",function(w,_,O){return P.cloneElement(w,B(B({key:"recharts-customized-".concat(O)},j.props),j.state))}),J(j,"renderMap",{CartesianGrid:{handler:ac,once:!0},ReferenceArea:{handler:j.renderReferenceElement},ReferenceLine:{handler:ac},ReferenceDot:{handler:j.renderReferenceElement},XAxis:{handler:ac},YAxis:{handler:ac},Brush:{handler:j.renderBrush,once:!0},Bar:{handler:j.renderGraphicChild},Line:{handler:j.renderGraphicChild},Area:{handler:j.renderGraphicChild},Radar:{handler:j.renderGraphicChild},RadialBar:{handler:j.renderGraphicChild},Scatter:{handler:j.renderGraphicChild},Pie:{handler:j.renderGraphicChild},Funnel:{handler:j.renderGraphicChild},Tooltip:{handler:j.renderCursor,once:!0},PolarGrid:{handler:j.renderPolarGrid,once:!0},PolarAngleAxis:{handler:j.renderPolarAxis},PolarRadiusAxis:{handler:j.renderPolarAxis},Customized:{handler:j.renderCustomized}}),j.clipPathId="".concat((x=m.id)!==null&&x!==void 0?x:uo("recharts"),"-clip"),j.throttleTriggeredAfterMouseMove=w_(j.triggeredAfterMouseMove,(S=m.throttleDelay)!==null&&S!==void 0?S:1e3/60),j.state={},j}return EJ(v,b),NJ(v,[{key:"componentDidMount",value:function(){var x,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,S=x.children,j=x.data,w=x.height,_=x.layout,O=It(S,Ge);if(O){var N=O.props.defaultIndex;if(!(typeof N!="number"||N<0||N>this.state.tooltipTicks.length-1)){var k=this.state.tooltipTicks[N]&&this.state.tooltipTicks[N].value,E=Um(this.state,j,N,k),T=this.state.tooltipTicks[N].coordinate,D=(this.state.offset.top+w)/2,A=_==="horizontal",L=A?{x:T,y:D}:{y:T,x:D},C=this.state.formattedGraphicalItems.find(function(I){var R=I.item;return R.type.name==="Scatter"});C&&(L=B(B({},L),C.props.points[N].tooltipPosition),E=C.props.points[N].tooltipPayload);var M={activeTooltipIndex:N,isTooltipActive:!0,activeLabel:k,activePayload:E,activeCoordinate:L};this.setState(M),this.renderCursor(O),this.accessibilityManager.setIndex(N)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var j,w;this.accessibilityManager.setDetails({offset:{left:(j=this.props.margin.left)!==null&&j!==void 0?j:0,top:(w=this.props.margin.top)!==null&&w!==void 0?w:0}})}return null}},{key:"componentDidUpdate",value:function(x){yp([It(x.children,Ge)],[It(this.props.children,Ge)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=It(this.props.children,Ge);if(x&&typeof x.props.shared=="boolean"){var S=x.props.shared?"axis":"item";return l.indexOf(S)>=0?S:i}return i}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var S=this.container,j=S.getBoundingClientRect(),w=_F(j),_={chartX:Math.round(x.pageX-w.left),chartY:Math.round(x.pageY-w.top)},O=j.width/S.offsetWidth||1,N=this.inRange(_.chartX,_.chartY,O);if(!N)return null;var k=this.state,E=k.xAxisMap,T=k.yAxisMap,D=this.getTooltipEventType(),A=jj(this.state,this.props.data,this.props.layout,N);if(D!=="axis"&&E&&T){var L=gn(E).scale,C=gn(T).scale,M=L&&L.invert?L.invert(_.chartX):null,I=C&&C.invert?C.invert(_.chartY):null;return B(B({},_),{},{xValue:M,yValue:I},A)}return A?B(B({},_),A):null}},{key:"inRange",value:function(x,S){var j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,w=this.props.layout,_=x/j,O=S/j;if(w==="horizontal"||w==="vertical"){var N=this.state.offset,k=_>=N.left&&_<=N.left+N.width&&O>=N.top&&O<=N.top+N.height;return k?{x:_,y:O}:null}var E=this.state,T=E.angleAxisMap,D=E.radiusAxisMap;if(T&&D){var A=gn(T);return Hb({x:_,y:O},A)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,S=this.getTooltipEventType(),j=It(x,Ge),w={};j&&S==="axis"&&(j.props.trigger==="click"?w={onClick:this.handleClick}:w={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var _=Jc(this.props,this.handleOuterEvent);return B(B({},_),w)}},{key:"addListener",value:function(){ph.on(mh,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){ph.removeListener(mh,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,S,j){for(var w=this.state.formattedGraphicalItems,_=0,O=w.length;_<O;_++){var N=w[_];if(N.item===x||N.props.key===x.key||S===Yr(N.item.type)&&j===N.childIndex)return N}return null}},{key:"renderClipPath",value:function(){var x=this.clipPathId,S=this.state.offset,j=S.left,w=S.top,_=S.height,O=S.width;return $.createElement("defs",null,$.createElement("clipPath",{id:x},$.createElement("rect",{x:j,y:w,height:_,width:O})))}},{key:"getXScales",value:function(){var x=this.state.xAxisMap;return x?Object.entries(x).reduce(function(S,j){var w=gj(j,2),_=w[0],O=w[1];return B(B({},S),{},J({},_,O.scale))},{}):null}},{key:"getYScales",value:function(){var x=this.state.yAxisMap;return x?Object.entries(x).reduce(function(S,j){var w=gj(j,2),_=w[0],O=w[1];return B(B({},S),{},J({},_,O.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(x){var S;return(S=this.state.xAxisMap)===null||S===void 0||(S=S[x])===null||S===void 0?void 0:S.scale}},{key:"getYScaleByAxisId",value:function(x){var S;return(S=this.state.yAxisMap)===null||S===void 0||(S=S[x])===null||S===void 0?void 0:S.scale}},{key:"getItemByXY",value:function(x){var S=this.state,j=S.formattedGraphicalItems,w=S.activeItem;if(j&&j.length)for(var _=0,O=j.length;_<O;_++){var N=j[_],k=N.props,E=N.item,T=E.type.defaultProps!==void 0?B(B({},E.type.defaultProps),E.props):E.props,D=Yr(E.type);if(D==="Bar"){var A=(k.data||[]).find(function(I){return oV(x,I)});if(A)return{graphicalItem:N,payload:A}}else if(D==="RadialBar"){var L=(k.data||[]).find(function(I){return Hb(x,I)});if(L)return{graphicalItem:N,payload:L}}else if(rf(N,w)||nf(N,w)||el(N,w)){var C=YG({graphicalItem:N,activeTooltipItem:w,itemData:T.data}),M=T.activeIndex===void 0?C:T.activeIndex;return{graphicalItem:B(B({},N),{},{childIndex:M}),payload:el(N,w)?T.data[C]:N.props.data[C]}}}return null}},{key:"render",value:function(){var x=this;if(!I0(this))return null;var S=this.props,j=S.children,w=S.className,_=S.width,O=S.height,N=S.style,k=S.compact,E=S.title,T=S.desc,D=xj(S,bJ),A=X(D,!1);if(k)return $.createElement(tj,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},$.createElement(xp,li({},A,{width:_,height:O,title:E,desc:T}),this.renderClipPath(),D0(j,this.renderMap)));if(this.props.accessibilityLayer){var L,C;A.tabIndex=(L=this.props.tabIndex)!==null&&L!==void 0?L:0,A.role=(C=this.props.role)!==null&&C!==void 0?C:"application",A.onKeyDown=function(I){x.accessibilityManager.keyboardEvent(I)},A.onFocus=function(){x.accessibilityManager.focus()}}var M=this.parseEventsOfWrapper();return $.createElement(tj,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},$.createElement("div",li({className:ee("recharts-wrapper",w),style:B({position:"relative",cursor:"default",width:_,height:O},N)},M,{ref:function(R){x.container=R}}),$.createElement(xp,li({},A,{width:_,height:O,title:E,desc:T,style:DJ}),this.renderClipPath(),D0(j,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(P.Component);J(g,"displayName",r),J(g,"defaultProps",B({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},d)),J(g,"getDerivedStateFromProps",function(b,v){var m=b.dataKey,x=b.data,S=b.children,j=b.width,w=b.height,_=b.layout,O=b.stackOffset,N=b.margin,k=v.dataStartIndex,E=v.dataEndIndex;if(v.updateId===void 0){var T=wj(b);return B(B(B({},T),{},{updateId:0},p(B(B({props:b},T),{},{updateId:0}),v)),{},{prevDataKey:m,prevData:x,prevWidth:j,prevHeight:w,prevLayout:_,prevStackOffset:O,prevMargin:N,prevChildren:S})}if(m!==v.prevDataKey||x!==v.prevData||j!==v.prevWidth||w!==v.prevHeight||_!==v.prevLayout||O!==v.prevStackOffset||!mi(N,v.prevMargin)){var D=wj(b),A={chartX:v.chartX,chartY:v.chartY,isTooltipActive:v.isTooltipActive},L=B(B({},jj(v,x,_)),{},{updateId:v.updateId+1}),C=B(B(B({},D),A),L);return B(B(B({},C),p(B({props:b},C),v)),{},{prevDataKey:m,prevData:x,prevWidth:j,prevHeight:w,prevLayout:_,prevStackOffset:O,prevMargin:N,prevChildren:S})}if(!yp(S,v.prevChildren)){var M,I,R,F,K=It(S,Wi),z=K&&(M=(I=K.props)===null||I===void 0?void 0:I.startIndex)!==null&&M!==void 0?M:k,q=K&&(R=(F=K.props)===null||F===void 0?void 0:F.endIndex)!==null&&R!==void 0?R:E,ie=z!==k||q!==E,he=!te(x),ge=he&&!ie?v.updateId:v.updateId+1;return B(B({updateId:ge},p(B(B({props:b},v),{},{updateId:ge,dataStartIndex:z,dataEndIndex:q}),v)),{},{prevChildren:S,dataStartIndex:z,dataEndIndex:q})}return null}),J(g,"renderActiveDot",function(b,v,m){var x;return P.isValidElement(b)?x=P.cloneElement(b,v):Q(b)?x=b(v):x=$.createElement(Zd,v),$.createElement(ne,{className:"recharts-active-dot",key:m},x)});var y=P.forwardRef(function(v,m){return $.createElement(g,li({},v,{ref:m}))});return y.displayName=g.displayName,y},_l=df({chartName:"BarChart",GraphicalChild:nr,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:or},{axisType:"yAxis",AxisComp:sr}],formatAxisMap:mO}),Qy=df({chartName:"PieChart",GraphicalChild:wr,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:wl},{axisType:"radiusAxis",AxisComp:jl}],formatAxisMap:Lk,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),Jy=df({chartName:"AreaChart",GraphicalChild:Lr,axisComponents:[{axisType:"xAxis",AxisComp:or},{axisType:"yAxis",AxisComp:sr}],formatAxisMap:mO}),GJ=df({chartName:"RadialBarChart",GraphicalChild:Sl,legendContent:"children",defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"angleAxis",AxisComp:wl},{axisType:"radiusAxis",AxisComp:jl}],formatAxisMap:Lk,defaultProps:{layout:"radial",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});function YJ({data:e=[],color:t="var(--cyan)",width:r=60,height:n=20,id:a="spark"}){const i=P.useMemo(()=>{if(!e||e.length<2)return null;const l=Math.min(...e),u=Math.max(...e)-l||1,f=2,d=e.map((y,b)=>b/(e.length-1)*r),h=e.map(y=>n-f-(y-l)/u*(n-f*2)),p=d.map((y,b)=>`${y},${h[b]}`).join(" "),g=`M ${d[0]},${h[0]} `+d.slice(1).map((y,b)=>`L ${y},${h[b+1]}`).join(" ")+` L ${d[d.length-1]},${n} L ${d[0]},${n} Z`;return{polyline:p,fillPath:g}},[e,r,n]);if(!i)return o.jsx("svg",{width:r,height:n});const s=`spark-grad-${a}`;return o.jsxs("svg",{width:r,height:n,viewBox:`0 0 ${r} ${n}`,style:{display:"inline-block",verticalAlign:"middle",flexShrink:0},"aria-hidden":"true",children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:s,x1:"0",y1:"0",x2:"0",y2:"1",children:[o.jsx("stop",{offset:"0%",stopColor:t,stopOpacity:"0.25"}),o.jsx("stop",{offset:"100%",stopColor:t,stopOpacity:"0.01"})]})}),o.jsx("path",{d:i.fillPath,fill:`url(#${s})`}),o.jsx("polyline",{points:i.polyline,fill:"none",stroke:t,strokeWidth:"1.5",strokeLinejoin:"round",strokeLinecap:"round"}),(()=>{const l=(e.length-1)/(e.length-1)*r,c=Math.min(...e),f=Math.max(...e)-c||1,d=2,h=n-d-(e[e.length-1]-c)/f*(n-d*2);return o.jsx("circle",{cx:l,cy:h,r:"2",fill:t})})()]})}function qJ(e,t=800){const[r,n]=P.useState(e),a=P.useRef(e),i=P.useRef(null),s=P.useRef(null),l=P.useRef(e);return P.useEffect(()=>{l.current=e,a.current=r,i.current=null;const c=u=>{i.current||(i.current=u);const f=u-i.current,d=Math.min(1,f/t),h=d===1?1:1-Math.pow(2,-10*d),p=a.current+(l.current-a.current)*h;n(p),d<1&&(s.current=requestAnimationFrame(c))};return s.current=requestAnimationFrame(c),()=>cancelAnimationFrame(s.current)},[e]),r}const _j=["#00F0FF","#F7931A","#00C389","#3B82F6","#A855F7","#FF5C5C"];function XJ(e){return e?new Date(e+"T00:00:00").toLocaleDateString("en-US",{month:"short",day:"numeric"}):""}function Do(e,t=8){let r=e;return Array.from({length:t},()=>(r=r*1664525+1013904223&4294967295,Math.abs(r)%100+10))}const kj={Balance:Do(42,9),Positions:Do(17,9),"Open Markets":Do(93,9),"Today P&L":Do(55,9),"Markets Tracked":Do(71,9)};function ic({cents:e}){const t=Number(e||0),r=(t/100).toFixed(2);return t>0?o.jsxs("span",{className:"mono",style:{color:"var(--green)",fontWeight:700},children:["+$",r]}):t<0?o.jsxs("span",{className:"mono",style:{color:"var(--red)",fontWeight:700},children:["-$",Math.abs(t/100).toFixed(2)]}):o.jsx("span",{className:"mono",style:{color:"var(--text-muted)"},children:"$0.00"})}function Oj({wins:e,losses:t}){const r=e+t;if(!r)return o.jsx("span",{style:{color:"var(--text-muted)"},children:"—"});const n=(e/r*100).toFixed(0),a=n>=80?"var(--green)":n>=50?"var(--orange)":"var(--red)";return o.jsxs("span",{style:{color:a},children:[e,"/",r," (",n,"%)"]})}function Nj({wins:e,losses:t,pnl:r}){const n=e+t,a=n>0?e/n:0,i={padding:"2px 8px",borderRadius:4,fontSize:10,fontWeight:700,fontFamily:"var(--font-body)"};return a>=.9&&r>0?o.jsx("span",{style:{...i,background:"var(--green-dim)",color:"var(--green)",border:"1px solid rgba(0,195,137,0.25)"},children:"ADD MORE"}):a>=.65&&r>0?o.jsx("span",{style:{...i,background:"var(--orange-dim)",color:"var(--orange)",border:"1px solid rgba(247,147,26,0.25)"},children:"HOLD"}):r<0?o.jsx("span",{style:{...i,background:"var(--red-dim)",color:"var(--red)",border:"1px solid rgba(255,92,92,0.25)"},children:"REDUCE"}):o.jsx("span",{style:{...i,background:"rgba(107,114,128,0.15)",color:"var(--text-muted)",border:"1px solid var(--border)"},children:"WATCH"})}function QJ({opportunities:e}){const t=e||[];if(!t.length)return o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"section-title",style:{marginBottom:8},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--cyan)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),"Best Opportunities Right Now"]}),o.jsx("p",{style:{color:"var(--text-muted)",fontSize:13,textAlign:"center",padding:"24px 0"},children:"No fresh signals — waiting for next pipeline cycle..."})]});const r=[{borderColor:"rgba(247,147,26,0.35)",background:"rgba(247,147,26,0.06)",rankColor:"var(--orange)",rankLabel:"#1"},{borderColor:"rgba(160,160,160,0.25)",background:"rgba(160,160,160,0.04)",rankColor:"var(--text-dim)",rankLabel:"#2"},{borderColor:"rgba(180,100,50,0.25)",background:"rgba(180,100,50,0.04)",rankColor:"#CD7F32",rankLabel:"#3"}];return o.jsxs("div",{className:"card",style:{border:"1px solid rgba(0,240,255,0.15)",background:"linear-gradient(135deg, rgba(0,240,255,0.03), var(--surface), rgba(0,195,137,0.03))"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:16},children:[o.jsxs("div",{className:"section-title",children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--cyan)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z"})}),"Best Opportunities Right Now"]}),o.jsx("span",{style:{marginLeft:"auto",fontSize:10,color:"var(--text-muted)",textTransform:"uppercase",fontWeight:600,letterSpacing:"0.08em"},children:"Live Signals"})]}),o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:t.map((n,a)=>{const i=r[a]||r[2],s=n.hist_trades>0,l=parseFloat(n.hist_wr)>=80?"var(--green)":parseFloat(n.hist_wr)>=50?"var(--orange)":"var(--red)";return o.jsxs("div",{className:a===0?"breathe-neon":"",style:{borderRadius:10,padding:"14px 16px",background:i.background,border:`1px solid ${i.borderColor}`,display:"flex",gap:14,alignItems:"flex-start"},children:[o.jsx("div",{style:{width:28,height:28,borderRadius:7,background:`${i.rankColor}22`,border:`1px solid ${i.borderColor}`,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:2},children:o.jsx("span",{style:{fontSize:11,fontWeight:800,color:i.rankColor,fontFamily:"var(--font-mono)"},children:i.rankLabel})}),o.jsxs("div",{style:{flex:1,minWidth:0},children:[o.jsx("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",style:{fontSize:13,fontWeight:600,color:"var(--text)",textDecoration:"none",display:"block",marginBottom:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},onMouseEnter:c=>{c.currentTarget.style.color="var(--cyan)"},onMouseLeave:c=>{c.currentTarget.style.color="var(--text)"},children:n.title}),o.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8,marginBottom:8},children:[o.jsxs("span",{className:"badge",style:n.direction==="NO"?{background:"var(--red-dim)",color:"var(--red)",border:"1px solid rgba(255,92,92,0.25)"}:{background:"var(--green-dim)",color:"var(--green)",border:"1px solid rgba(0,195,137,0.25)"},children:["BUY ",n.direction]}),o.jsxs("span",{style:{fontSize:12,color:"var(--text-muted)"},children:["Edge: ",o.jsxs("span",{className:"mono",style:{color:"var(--cyan)",fontWeight:700},children:[n.edge_pct,"%"]})]}),o.jsxs("span",{style:{fontSize:12,color:"var(--text-muted)"},children:["Conf: ",o.jsxs("span",{style:{color:"var(--blue)",fontWeight:700},children:[n.confidence,"%"]})]}),n.price_cents>0&&o.jsxs("span",{style:{fontSize:12,color:"var(--text-muted)"},children:["Price: ",o.jsxs("span",{className:"mono",style:{color:"var(--text)"},children:[n.price_cents,"c"]})]}),s&&o.jsxs("span",{style:{fontSize:12,color:"var(--text-muted)"},children:["History: ",o.jsxs("span",{style:{fontWeight:700,color:l},children:[n.hist_wr,"% WR"]}),o.jsxs("span",{style:{color:"var(--text-muted)",marginLeft:4},children:["(",n.hist_trades," trades, ",n.hist_pnl/100>=0?"+":"","$",(n.hist_pnl/100).toFixed(0),")"]})]}),!s&&o.jsx("span",{style:{fontSize:11,color:"var(--text-muted)",fontStyle:"italic"},children:"New market"})]}),o.jsx("p",{style:{fontSize:11,color:"var(--text-dim)",lineHeight:1.5},children:n.why})]})]},n.ticker)})})]})}function JJ({topMarkets:e,seedMoney:t,balance:r}){const n=(e||[]).slice(0,3);if(!n.length)return null;const a=n.reduce((f,d)=>f+d.wins/(d.wins+d.losses),0)/n.length*100,i=n.length>0?Math.round(n.reduce((f,d)=>{const h=d.wins/(d.wins+d.losses||1);return f+(h>=.9?95:80)},0)/n.length):95,s=t?t/100:5e4,l=r?r/100:s,c=s>0?(l-s)/s*100:0,u=[{icon:o.jsx("svg",{style:{width:20,height:20},fill:"none",stroke:"var(--cyan)",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"})}),label:`Start: $${s.toLocaleString()}`,sub:`$${l.toLocaleString()} (${c>=0?"+":""}${c.toFixed(1)}%)`,borderColor:"rgba(0,240,255,0.25)",subColor:c>=0?"var(--green)":"var(--red)"},{icon:o.jsx("svg",{style:{width:20,height:20},fill:"none",stroke:"var(--blue)",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0"})}),label:"Signal Found",sub:"AI scans 135 markets",borderColor:"rgba(59,130,246,0.25)",subColor:"var(--text-muted)"},{icon:o.jsx("svg",{style:{width:20,height:20},fill:"none",stroke:"var(--orange)",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),label:`Buy NO at ${i}c`,sub:"High-prob event",borderColor:"rgba(247,147,26,0.25)",subColor:"var(--text-muted)"},{icon:o.jsx("svg",{style:{width:20,height:20},fill:"none",stroke:"var(--purple)",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),label:"Hold 5min-2hr",sub:"TP +3c / SL -5c",borderColor:"rgba(168,85,247,0.25)",subColor:"var(--text-muted)"},{icon:o.jsx("svg",{style:{width:20,height:20},fill:"none",stroke:"var(--green)",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),label:`Collect ${100-i}c`,sub:`${a.toFixed(0)}% of the time`,borderColor:"rgba(0,195,137,0.25)",subColor:"var(--text-muted)"}];return o.jsxs("div",{className:"card",style:{border:"1px solid rgba(0,195,137,0.12)",background:"linear-gradient(135deg, rgba(0,195,137,0.04), var(--surface), rgba(247,147,26,0.04))"},children:[o.jsxs("div",{className:"section-title",style:{marginBottom:16},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--cyan)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Winning Strategy — Live Flow"]}),o.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:18},children:u.map((f,d)=>o.jsxs($.Fragment,{children:[o.jsxs("div",{style:{flex:1,borderRadius:10,padding:"12px 10px",background:"rgba(255,255,255,0.02)",border:`1px solid ${f.borderColor}`,textAlign:"center"},children:[o.jsx("div",{style:{display:"flex",justifyContent:"center",marginBottom:6},children:f.icon}),o.jsx("p",{style:{fontSize:11,fontWeight:600,color:"var(--text)",marginBottom:2},children:f.label}),o.jsx("p",{style:{fontSize:10,color:f.subColor},children:f.sub})]}),d<u.length-1&&o.jsx("svg",{style:{width:14,height:14,color:"var(--border-light)",flexShrink:0},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 5l7 7-7 7"})})]},d))}),o.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3,1fr)",gap:10},children:[{label:"Cost Per Trade",value:`${i}c`,sub:"buying NO side",color:"var(--orange)"},{label:"Profit on Win",value:`${100-i}c`,sub:"per contract",color:"var(--green)"},{label:"Return Multiple",value:`${((100-i)/i*100).toFixed(0)}%`,sub:"per winning trade",color:"var(--green)"}].map(f=>o.jsxs("div",{style:{borderRadius:8,padding:"12px",background:"var(--surface-el)",border:"1px solid var(--border)",textAlign:"center"},children:[o.jsx("p",{className:"stat-label",style:{marginBottom:4},children:f.label}),o.jsx("p",{className:"mono",style:{fontSize:20,fontWeight:700,color:f.color},children:f.value}),o.jsx("p",{style:{fontSize:10,color:"var(--text-muted)",marginTop:2},children:f.sub})]},f.label))})]})}function ZJ({topMarkets:e,worstMarkets:t,strategies:r}){const n=(e||[]).filter(c=>c.wins/(c.wins+c.losses||1)>=.9&&c.pnl>0),a=(t||[]).filter(c=>c.pnl<-5e3),i=(r||[]).filter(c=>c.pnl<-1e4&&c.win_rate<20).slice(0,3),s=[];n.length>0&&s.push({priority:"HIGH",color:"green",iconPath:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6",title:`Double down on ${n.length} near-certain markets`,detail:n.slice(0,2).map(c=>{var u;return((u=c.title)==null?void 0:u.split("?")[0])||c.ticker}).join(", "),reason:`${n.length} markets have 90%+ win rate — the edge is proven`}),a.length>0&&s.push({priority:"HIGH",color:"red",iconPath:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636",title:`Exit ${a.length} bleeding market(s)`,detail:a.slice(0,2).map(c=>{var u;return((u=c.title)==null?void 0:u.split("?")[0])||c.ticker}).join(", "),reason:`0% win rate, losing $${Math.abs(a.reduce((c,u)=>c+u.pnl,0)/100).toFixed(0)} total`}),i.length>0&&s.push({priority:"MED",color:"orange",iconPath:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z",title:`Consider disabling ${i.length} strategy(ies)`,detail:i.map(c=>c.name).join(", "),reason:"Sub-20% win rate — these are coin flips minus fees"}),s.push({priority:"INFO",color:"cyan",iconPath:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z",title:"Keep hyper-trading high-prob NO markets",detail:"The 95c+ NO strategy is the #1 edge — scale it up",reason:"Compounding small spreads at 99%+ win rate = consistent returns"});const l={green:{bg:"var(--green-dim)",border:"rgba(0,195,137,0.2)",text:"var(--green)",badge:"rgba(0,195,137,0.2)"},red:{bg:"var(--red-dim)",border:"rgba(255,92,92,0.2)",text:"var(--red)",badge:"rgba(255,92,92,0.2)"},orange:{bg:"var(--orange-dim)",border:"rgba(247,147,26,0.2)",text:"var(--orange)",badge:"rgba(247,147,26,0.2)"},cyan:{bg:"var(--cyan-dim)",border:"rgba(0,240,255,0.2)",text:"var(--cyan)",badge:"rgba(0,240,255,0.2)"}};return o.jsxs("div",{className:"card",style:{border:"1px solid rgba(247,147,26,0.12)"},children:[o.jsxs("div",{className:"section-title",style:{marginBottom:14},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--orange)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z"})}),"What To Do Next"]}),o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:s.map((c,u)=>{const f=l[c.color];return o.jsxs("div",{style:{borderRadius:10,padding:"12px 14px",background:f.bg,border:`1px solid ${f.border}`,display:"flex",gap:12,alignItems:"flex-start"},children:[o.jsx("div",{style:{width:30,height:30,borderRadius:8,background:f.badge,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:1},children:o.jsx("svg",{style:{width:15,height:15,color:f.text},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:c.iconPath})})}),o.jsxs("div",{style:{flex:1},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:3},children:[o.jsx("span",{className:"badge",style:{background:f.badge,color:f.text,fontSize:9,padding:"2px 6px"},children:c.priority}),o.jsx("span",{style:{fontSize:13,fontWeight:600,color:f.text},children:c.title})]}),o.jsx("p",{style:{fontSize:12,color:"var(--text-dim)",marginBottom:2},children:c.detail}),o.jsx("p",{style:{fontSize:11,color:"var(--text-muted)"},children:c.reason})]})]},u)})})]})}function eZ({strategies:e}){const t=[...e||[]].sort((n,a)=>a.pnl-n.pnl).slice(0,10);if(!t.length)return null;const r=t.map(n=>({name:n.name,pnl:n.pnl/100,fill:n.pnl>=0?"#00C389":"#FF5C5C"}));return o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"section-title",style:{marginBottom:14},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--cyan)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"})}),"Strategy P&L — Top 10"]}),o.jsx(tr,{width:"100%",height:250,children:o.jsxs(_l,{data:r,layout:"vertical",margin:{left:70,right:20},children:[o.jsx(Ia,{strokeDasharray:"3 3",stroke:"var(--border)",horizontal:!1}),o.jsx(or,{type:"number",stroke:"var(--text-muted)",tick:{fill:"var(--text-muted)",fontSize:11},tickFormatter:n=>`$${n}`}),o.jsx(sr,{type:"category",dataKey:"name",stroke:"var(--text-muted)",tick:{fill:"var(--text-muted)",fontSize:11},width:65}),o.jsx(Ge,{contentStyle:{background:"var(--surface-el)",border:"1px solid var(--border)",borderRadius:8,color:"var(--text)"},formatter:n=>[`$${n.toFixed(2)}`,"P&L"]}),o.jsx(nr,{dataKey:"pnl",radius:[0,4,4,0],children:r.map((n,a)=>o.jsx(xr,{fill:n.fill},a))})]})})]})}function tZ({todayWins:e,todayLosses:t}){const r=(e||0)+(t||0);if(!r)return null;const n=(e/r*100).toFixed(1),a=[{name:"Wins",value:e,fill:"#00C389"},{name:"Losses",value:t,fill:"#FF5C5C"}];return o.jsxs("div",{className:"card",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[o.jsx("p",{className:"stat-label",style:{marginBottom:12},children:"Today's Win Rate"}),o.jsxs("div",{style:{position:"relative",width:140,height:140},children:[o.jsx(tr,{width:"100%",height:"100%",children:o.jsx(Qy,{children:o.jsx(wr,{data:a,innerRadius:45,outerRadius:65,paddingAngle:2,dataKey:"value",startAngle:90,endAngle:-270,children:a.map((i,s)=>o.jsx(xr,{fill:i.fill},s))})})}),o.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[o.jsxs("span",{className:"mono",style:{fontSize:22,fontWeight:700,color:Number(n)>=50?"var(--green)":"var(--red)"},children:[n,"%"]}),o.jsxs("span",{style:{fontSize:10,color:"var(--text-muted)",marginTop:2},children:[r.toLocaleString()," trades"]})]})]}),o.jsxs("div",{style:{display:"flex",gap:16,marginTop:10},children:[o.jsxs("span",{style:{fontSize:12,color:"var(--green)",fontWeight:600},children:[e==null?void 0:e.toLocaleString()," W"]}),o.jsxs("span",{style:{fontSize:12,color:"var(--red)",fontWeight:600},children:[t==null?void 0:t.toLocaleString()," L"]})]})]})}function rZ({active:e,payload:t,label:r}){var a;if(!e||!t||!t.length)return null;const n=((a=t[0])==null?void 0:a.payload)||{};return o.jsxs("div",{style:{background:"#1C1C24",border:"1px solid #2A2A35",borderRadius:8,padding:"10px 14px",fontFamily:"'Inter', sans-serif",fontSize:12,minWidth:160},children:[o.jsx("p",{style:{color:"#6B7280",fontWeight:600,marginBottom:6,fontSize:11},children:r}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[o.jsx("span",{style:{color:"#6B7280"},children:"Daily P&L"}),o.jsxs("span",{className:"mono",style:{color:(n.pnl||0)>=0?"#00C389":"#FF5C5C",fontWeight:700},children:[(n.pnl||0)>=0?"+":"","$",((n.pnl||0)/100).toFixed(2)]})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[o.jsx("span",{style:{color:"#6B7280"},children:"Cumulative"}),o.jsxs("span",{className:"mono",style:{color:"#00F0FF",fontWeight:700},children:[(n.cumulative_pnl||0)>=0?"+":"","$",((n.cumulative_pnl||0)/100).toFixed(2)]})]}),n.trades!=null&&o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[o.jsx("span",{style:{color:"#6B7280"},children:"Trades"}),o.jsxs("span",{className:"mono",style:{color:"#E0E0E0"},children:[n.wins||0,"W / ",(n.trades||0)-(n.wins||0),"L"]})]})]})]})}function nZ({dailyPnl:e}){var f,d;const t=e||[];if(!t.length)return o.jsxs("div",{className:"card",style:{borderLeft:"3px solid #00F0FF",paddingLeft:16},children:[o.jsx("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:12},children:o.jsx("h2",{className:"section-title section-accent-cyan",style:{borderLeft:"none",paddingLeft:0},children:"Portfolio Performance"})}),o.jsx("p",{style:{color:"#6B7280",fontSize:13,textAlign:"center",padding:"48px 0"},children:"No daily P&L data yet — will appear after trading activity is recorded"})]});const r=t.reduce((h,p)=>p.pnl>((h==null?void 0:h.pnl)||-1/0)?p:h,t[0]),n=t.reduce((h,p)=>p.pnl<((h==null?void 0:h.pnl)||1/0)?p:h,t[0]),a=((f=t[t.length-1])==null?void 0:f.cumulative_pnl)||0,i=((d=t[0])==null?void 0:d.cumulative_pnl)||0,s=a-i,l=s>=0,c=l?"#00C389":"#FF5C5C",u=t.map(h=>({...h,label:XJ(h.date),cumDisplay:h.cumulative_pnl/100}));return o.jsxs("div",{className:"card",style:{borderLeft:"3px solid #00F0FF",paddingLeft:20},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[o.jsx("h2",{className:"section-title",style:{fontSize:"1.1rem"},children:"Portfolio Performance"}),o.jsxs("div",{style:{display:"flex",gap:10},children:[o.jsxs("div",{style:{padding:"4px 12px",borderRadius:20,background:l?"rgba(0,195,137,0.12)":"rgba(255,92,92,0.12)",border:`1px solid ${l?"rgba(0,195,137,0.3)":"rgba(255,92,92,0.3)"}`},children:[o.jsx("span",{style:{fontSize:10,color:"#6B7280",marginRight:6,fontWeight:600},children:"30d RETURN"}),o.jsxs("span",{className:"mono",style:{fontSize:12,fontWeight:700,color:l?"#00C389":"#FF5C5C"},children:[l?"+":"","$",(s/100).toFixed(2)]})]}),o.jsxs("div",{style:{padding:"4px 12px",borderRadius:20,background:"rgba(0,195,137,0.08)",border:"1px solid rgba(0,195,137,0.2)"},children:[o.jsx("span",{style:{fontSize:10,color:"#6B7280",marginRight:6,fontWeight:600},children:"BEST DAY"}),o.jsxs("span",{className:"mono",style:{fontSize:12,fontWeight:700,color:"#00C389"},children:["+$",(((r==null?void 0:r.pnl)||0)/100).toFixed(2)]})]}),o.jsxs("div",{style:{padding:"4px 12px",borderRadius:20,background:"rgba(255,92,92,0.08)",border:"1px solid rgba(255,92,92,0.2)"},children:[o.jsx("span",{style:{fontSize:10,color:"#6B7280",marginRight:6,fontWeight:600},children:"WORST DAY"}),o.jsxs("span",{className:"mono",style:{fontSize:12,fontWeight:700,color:"#FF5C5C"},children:["$",(((n==null?void 0:n.pnl)||0)/100).toFixed(2)]})]})]})]}),o.jsx(tr,{width:"100%",height:280,children:o.jsxs(Jy,{data:u,margin:{top:8,right:12,left:0,bottom:0},children:[o.jsxs("defs",{children:[o.jsxs("linearGradient",{id:"dailyPnlGradPos",x1:"0",y1:"0",x2:"0",y2:"1",children:[o.jsx("stop",{offset:"5%",stopColor:"#00C389",stopOpacity:.25}),o.jsx("stop",{offset:"95%",stopColor:"#00C389",stopOpacity:.01})]}),o.jsxs("linearGradient",{id:"dailyPnlGradNeg",x1:"0",y1:"0",x2:"0",y2:"1",children:[o.jsx("stop",{offset:"5%",stopColor:"#FF5C5C",stopOpacity:.22}),o.jsx("stop",{offset:"95%",stopColor:"#FF5C5C",stopOpacity:.01})]})]}),o.jsx(Ia,{strokeDasharray:"3 3",stroke:"#2A2A35",strokeOpacity:.6,horizontal:!0,vertical:!1}),o.jsx(or,{dataKey:"label",stroke:"#2A2A35",tick:{fill:"#6B7280",fontSize:11,fontFamily:"'Inter', sans-serif"},tickLine:!1,axisLine:{stroke:"#2A2A35"}}),o.jsx(sr,{stroke:"#2A2A35",tick:{fill:"#6B7280",fontSize:11,fontFamily:"'Inter', sans-serif"},tickLine:!1,axisLine:!1,tickFormatter:h=>`$${h>=0,""}${h.toFixed(0)}`,width:55}),o.jsx(Ge,{content:o.jsx(rZ,{})}),o.jsx(Lr,{type:"monotone",dataKey:"cumDisplay",name:"Cumulative P&L",stroke:c,strokeWidth:2,fill:`url(#${l?"dailyPnlGradPos":"dailyPnlGradNeg"})`,dot:!1,activeDot:{r:5,fill:"#00F0FF",stroke:"#1C1C24",strokeWidth:2,filter:"drop-shadow(0 0 6px rgba(0,240,255,0.8))"}})]})})]})}function aZ({active:e,payload:t,label:r}){var a;if(!e||!t||!t.length)return null;const n=((a=t[0])==null?void 0:a.payload)||{};return o.jsxs("div",{style:{background:"#1C1C24",border:"1px solid #2A2A35",borderRadius:8,padding:"10px 14px",fontFamily:"'Inter', sans-serif",fontSize:12,minWidth:180},children:[o.jsx("p",{style:{color:"#E0E0E0",fontWeight:600,marginBottom:6,fontSize:12},children:n.name}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[o.jsx("span",{style:{color:"#6B7280"},children:"P&L"}),o.jsxs("span",{className:"mono",style:{color:n.pnlRaw>=0?"#00C389":"#FF5C5C",fontWeight:700},children:[n.pnlRaw>=0?"+":"","$",Math.abs(n.pnlRaw).toFixed(2)]})]}),n.trades!=null&&o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[o.jsx("span",{style:{color:"#6B7280"},children:"Trades"}),o.jsx("span",{className:"mono",style:{color:"#E0E0E0"},children:n.trades})]}),n.win_rate!=null&&o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[o.jsx("span",{style:{color:"#6B7280"},children:"Win Rate"}),o.jsxs("span",{className:"mono",style:{color:n.win_rate>=50?"#00C389":"#FF5C5C"},children:[n.win_rate,"%"]})]}),n.avg_edge!=null&&o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[o.jsx("span",{style:{color:"#6B7280"},children:"Avg Edge"}),o.jsxs("span",{className:"mono",style:{color:"#00F0FF"},children:[n.avg_edge,"%"]})]})]})]})}function iZ({strategies:e}){const t=[...e||[]].sort((a,i)=>i.pnl-a.pnl).slice(0,10);if(!t.length)return o.jsxs("div",{className:"card",children:[o.jsx("h2",{className:"section-title",style:{marginBottom:12,fontSize:"1.1rem"},children:"Strategy Breakdown"}),o.jsx("p",{style:{color:"#6B7280",fontSize:13,textAlign:"center",padding:"32px 0"},children:"No strategy data yet"})]});const r=t.map(a=>({name:(a.name||a.strategy||"Unknown").slice(0,22),pnl:Math.abs(a.pnl/100),pnlRaw:a.pnl/100,fill:a.pnl>=0?"#00C389":"#FF5C5C",trades:a.trades,win_rate:a.win_rate,avg_edge:a.avg_edge})),n=Math.max(220,r.length*36);return o.jsxs("div",{className:"card",children:[o.jsx("h2",{className:"section-title",style:{marginBottom:16,fontSize:"1.1rem"},children:"Strategy Breakdown"}),o.jsx(tr,{width:"100%",height:n,children:o.jsxs(_l,{data:r,layout:"vertical",margin:{left:10,right:24,top:4,bottom:4},children:[o.jsx(Ia,{strokeDasharray:"3 3",stroke:"#2A2A35",strokeOpacity:.6,horizontal:!1}),o.jsx(or,{type:"number",stroke:"#2A2A35",tick:{fill:"#6B7280",fontSize:11,fontFamily:"'Inter', sans-serif"},tickLine:!1,axisLine:{stroke:"#2A2A35"},tickFormatter:a=>`$${a.toFixed(0)}`}),o.jsx(sr,{type:"category",dataKey:"name",stroke:"#2A2A35",tick:{fill:"#A8A8A8",fontSize:11,fontFamily:"'Inter', sans-serif"},tickLine:!1,axisLine:!1,width:130}),o.jsx(Ge,{content:o.jsx(aZ,{}),cursor:{fill:"rgba(0,240,255,0.04)"}}),o.jsx(nr,{dataKey:"pnl",radius:[0,4,4,0],maxBarSize:22,children:r.map((a,i)=>o.jsx(xr,{fill:a.fill,fillOpacity:.85},i))})]})})]})}function oZ({winRate:e}){const t=Math.round((e||0)*100),r=t>=80?"#00C389":t>=50?"#F7931A":"#FF5C5C",n=[{name:"Win Rate",value:t,fill:r}];return o.jsxs("div",{className:"card",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:200},children:[o.jsx("p",{className:"stat-label",style:{marginBottom:8},children:"Overall Win Rate"}),o.jsxs("div",{style:{position:"relative",width:160,height:160},children:[o.jsx(tr,{width:"100%",height:"100%",children:o.jsx(GJ,{cx:"50%",cy:"50%",innerRadius:"60%",outerRadius:"85%",startAngle:90,endAngle:-270,data:n,children:o.jsx(Sl,{background:{fill:"#2A2A35"},dataKey:"value",cornerRadius:6,fill:r})})}),o.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:[o.jsxs("span",{className:"mono",style:{fontSize:28,fontWeight:700,color:r,textShadow:`0 0 12px ${r}60`,lineHeight:1},children:[t,"%"]}),o.jsx("span",{style:{fontSize:10,color:"#6B7280",marginTop:4,fontFamily:"'Inter', sans-serif"},children:"win rate"})]})]})]})}function sZ(){const e=[{id:1,market:"NVDA closes above $50 on Mar 2",direction:"NO @ 95c",entry:"95c",exit:"$1.00",contracts:200,cost:190,profit:10,roi:"5.26%",holdTime:"47min"},{id:2,market:"S&P 500 above 4000 on Mar 2",direction:"NO @ 96c",entry:"96c",exit:"$1.00",contracts:150,cost:144,profit:6,roi:"4.17%",holdTime:"1h 12min"},{id:3,market:"BTC above $10K on Mar 2",direction:"NO @ 97c",entry:"97c",exit:"$1.00",contracts:300,cost:291,profit:9,roi:"3.09%",holdTime:"23min"},{id:4,market:"Fed rate cut Mar 2",direction:"NO @ 94c",entry:"94c",exit:"$1.00",contracts:250,cost:235,profit:15,roi:"6.38%",holdTime:"1h 45min"},{id:5,market:"Tesla below $50 on Mar 2",direction:"NO @ 93c",entry:"93c",exit:"$1.00",contracts:100,cost:93,profit:7,roi:"7.53%",holdTime:"55min"}],t=[{title:"Mathematical Edge",icon:"M9 7h6m0 10v-3m-3 3h.01M9 17h.01M9 14h.01M12 14h.01M15 11h.01M12 11h.01M9 11h.01M7 21h10a2 2 0 002-2V5a2 2 0 00-2-2H7a2 2 0 00-2 2v14a2 2 0 002 2z",color:"var(--cyan)",borderColor:"rgba(0,240,255,0.2)",bgColor:"rgba(0,240,255,0.05)",text:"Even with occasional losses, a 95% win rate with 5% gains per trade generates massive compound returns. One loss costs 5c, but 19 consecutive wins cover that loss and then some."},{title:"Market Inefficiency",icon:"M13 10V3L4 14h7v7l9-11h-7z",color:"var(--orange)",borderColor:"rgba(247,147,26,0.2)",bgColor:"rgba(247,147,26,0.05)",text:"Prediction markets still underprice certainty. Events priced at 95% probability should often be 99%+. This gap between market price and true probability is our edge."},{title:"AI Advantage",icon:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z",color:"var(--green)",borderColor:"rgba(0,195,137,0.2)",bgColor:"rgba(0,195,137,0.05)",text:"Our AI scans 135+ markets in real-time, finding opportunities humans miss. It evaluates probability, liquidity, and time-to-expiry simultaneously across every active contract."},{title:"Time Decay Works For Us",icon:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",color:"var(--purple)",borderColor:"rgba(168,85,247,0.2)",bgColor:"rgba(168,85,247,0.05)",text:"As events approach expiry, NO contracts on events that will not happen converge toward $1.00. Time is our ally. The closer to expiry, the more certain the outcome, the safer the trade."},{title:"Scalability",icon:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6",color:"var(--blue)",borderColor:"rgba(59,130,246,0.2)",bgColor:"rgba(59,130,246,0.05)",text:"Strategy works whether trading $100 or $100,000. Kalshi liquidity is sufficient for large positions on high-volume markets. Scale capital, not complexity."}],r=[{label:"AI Scans 135 Markets",color:"var(--cyan)",bgColor:"rgba(0,240,255,0.08)"},{label:"Finds High-Prob NO",color:"var(--orange)",bgColor:"rgba(247,147,26,0.08)"},{label:"Buy at 95c",color:"var(--green)",bgColor:"rgba(0,195,137,0.08)"},{label:"Hold 5min-2hr",color:"var(--purple)",bgColor:"rgba(168,85,247,0.08)"},{label:"Collect 5c Profit",color:"var(--green)",bgColor:"rgba(0,195,137,0.12)"}];return o.jsxs("div",{className:"strategy-deep-dive",children:[o.jsxs("div",{className:"sdd-header",children:[o.jsx("div",{className:"sdd-header-line"}),o.jsxs("div",{className:"sdd-header-content",children:[o.jsx("svg",{style:{width:22,height:22,color:"var(--cyan)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"})}),o.jsx("h2",{className:"heading",style:{fontSize:22,fontWeight:800,color:"var(--text)"},children:"Strategy Deep Dive"}),o.jsx("svg",{style:{width:22,height:22,color:"var(--cyan)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z"})})]}),o.jsx("div",{className:"sdd-header-line"})]}),o.jsxs("div",{className:"card sdd-section-card",style:{border:"1px solid rgba(0,240,255,0.15)",background:"linear-gradient(135deg, rgba(0,240,255,0.03), var(--surface), rgba(0,195,137,0.03))"},children:[o.jsxs("div",{className:"section-title",style:{marginBottom:20},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--cyan)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Winning Strategy — How It Works"]}),o.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(5,1fr)",gap:12,marginBottom:24},children:[{label:"The Edge",value:"Buy NO at 95c",sub:"on near-certain events",color:"var(--cyan)",glow:!0},{label:"The Math",value:"95c in, $1 out",sub:"= 5c profit per contract",color:"var(--green)",glow:!1},{label:"Per-Trade Return",value:"5.26%",sub:"per winning trade",color:"var(--green)",glow:!0},{label:"Risk Mgmt",value:"TP +3c / SL -5c",sub:"early exit if favorable",color:"var(--orange)",glow:!1},{label:"Win Rate",value:"95%+",sub:"on high-prob events",color:"var(--cyan)",glow:!0}].map(n=>o.jsxs("div",{className:n.glow?"sdd-stat-glow":"",style:{borderRadius:10,padding:"16px 12px",background:"var(--surface-el)",border:`1px solid ${n.color}33`,textAlign:"center"},children:[o.jsx("p",{className:"stat-label",style:{marginBottom:6},children:n.label}),o.jsx("p",{className:"mono",style:{fontSize:16,fontWeight:700,color:n.color,lineHeight:1.2},children:n.value}),o.jsx("p",{style:{fontSize:10,color:"var(--text-muted)",marginTop:4},children:n.sub})]},n.label))}),o.jsxs("div",{style:{marginBottom:16},children:[o.jsx("p",{className:"stat-label",style:{marginBottom:12,textAlign:"center"},children:"Trade Flow"}),o.jsx("div",{className:"sdd-flow-row",children:r.map((n,a)=>o.jsxs($.Fragment,{children:[o.jsx("div",{className:"sdd-flow-step",style:{background:n.bgColor,border:`1px solid ${n.color}33`},children:o.jsx("span",{className:"mono",style:{fontSize:12,fontWeight:700,color:n.color,textAlign:"center"},children:n.label})}),a<r.length-1&&o.jsx("div",{className:"sdd-flow-arrow",children:o.jsx("svg",{style:{width:16,height:16,color:"var(--border-light)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",d:"M9 5l7 7-7 7"})})})]},a))})]}),o.jsxs("div",{style:{borderRadius:10,padding:"14px 18px",background:"linear-gradient(90deg, rgba(0,195,137,0.08), rgba(0,240,255,0.06))",border:"1px solid rgba(0,195,137,0.18)",display:"flex",alignItems:"center",gap:14},children:[o.jsx("div",{style:{width:36,height:36,borderRadius:10,background:"rgba(0,195,137,0.15)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:o.jsx("svg",{style:{width:18,height:18,color:"var(--green)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"})})}),o.jsxs("div",{children:[o.jsx("p",{style:{fontSize:13,fontWeight:600,color:"var(--green)",marginBottom:2},children:"Compound Effect"}),o.jsx("p",{style:{fontSize:12,color:"var(--text-dim)",lineHeight:1.5},children:"5% per trade x multiple trades per day = exponential growth. At just 3 trades/day with 95% win rate, capital compounds at roughly 14% per week. This is how $60K becomes $221K."})]})]})]}),o.jsxs("div",{className:"card sdd-section-card",style:{border:"1px solid rgba(247,147,26,0.15)",background:"linear-gradient(135deg, rgba(247,147,26,0.03), var(--surface))"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[o.jsxs("div",{className:"section-title",children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--orange)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})}),"Example Trades"]}),o.jsx("span",{className:"badge",style:{background:"var(--orange-dim)",color:"var(--orange)",fontSize:10},children:"ILLUSTRATIVE"})]}),o.jsx("div",{style:{overflowX:"auto"},children:o.jsxs("table",{className:"sdd-trades-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{style:{width:32},children:"#"}),o.jsx("th",{style:{textAlign:"left"},children:"Market"}),o.jsx("th",{children:"Direction"}),o.jsx("th",{style:{textAlign:"right"},children:"Entry"}),o.jsx("th",{style:{textAlign:"right"},children:"Exit"}),o.jsx("th",{style:{textAlign:"right"},children:"Contracts"}),o.jsx("th",{style:{textAlign:"right"},children:"Cost"}),o.jsx("th",{style:{textAlign:"right"},children:"Profit"}),o.jsx("th",{style:{textAlign:"right"},children:"ROI"}),o.jsx("th",{style:{textAlign:"right"},children:"Hold Time"})]})}),o.jsx("tbody",{children:e.map(n=>o.jsxs("tr",{children:[o.jsx("td",{style:{textAlign:"center"},children:o.jsx("span",{className:"mono",style:{fontSize:12,color:"var(--text-muted)"},children:n.id})}),o.jsx("td",{style:{textAlign:"left",maxWidth:240},children:o.jsx("span",{style:{fontSize:13,color:"var(--text)",fontWeight:500},children:n.market})}),o.jsx("td",{style:{textAlign:"center"},children:o.jsx("span",{className:"badge",style:{background:"var(--red-dim)",color:"var(--red)",fontSize:10,border:"1px solid rgba(255,92,92,0.25)"},children:n.direction})}),o.jsx("td",{style:{textAlign:"right"},children:o.jsx("span",{className:"mono",style:{fontSize:13,color:"var(--text-dim)"},children:n.entry})}),o.jsx("td",{style:{textAlign:"right"},children:o.jsx("span",{className:"mono",style:{fontSize:13,color:"var(--green)"},children:n.exit})}),o.jsx("td",{style:{textAlign:"right"},children:o.jsx("span",{className:"mono",style:{fontSize:13,color:"var(--text)"},children:n.contracts})}),o.jsx("td",{style:{textAlign:"right"},children:o.jsxs("span",{className:"mono",style:{fontSize:13,color:"var(--orange)"},children:["$",n.cost.toFixed(2)]})}),o.jsx("td",{style:{textAlign:"right"},children:o.jsxs("span",{className:"mono",style:{fontSize:13,fontWeight:700,color:"var(--green)"},children:["+$",n.profit.toFixed(2)]})}),o.jsx("td",{style:{textAlign:"right"},children:o.jsx("span",{className:"mono",style:{fontSize:12,color:"var(--cyan)",fontWeight:600},children:n.roi})}),o.jsx("td",{style:{textAlign:"right"},children:o.jsx("span",{style:{fontSize:12,color:"var(--text-muted)"},children:n.holdTime})})]},n.id))})]})}),o.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:12,marginTop:16,paddingTop:14,borderTop:"1px solid var(--border)"},children:[{label:"Total Cost",value:"$953.00",color:"var(--orange)"},{label:"Total Profit",value:"+$47.00",color:"var(--green)"},{label:"Avg ROI",value:"5.29%",color:"var(--cyan)"},{label:"Avg Hold",value:"52min",color:"var(--purple)"}].map(n=>o.jsxs("div",{style:{textAlign:"center"},children:[o.jsx("p",{className:"stat-label",style:{marginBottom:4},children:n.label}),o.jsx("p",{className:"mono",style:{fontSize:18,fontWeight:700,color:n.color},children:n.value})]},n.label))})]}),o.jsxs("div",{className:"card sdd-section-card",style:{border:"1px solid rgba(0,195,137,0.15)",background:"linear-gradient(135deg, rgba(0,195,137,0.03), var(--surface), rgba(168,85,247,0.03))"},children:[o.jsxs("div",{className:"section-title",style:{marginBottom:20},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--green)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),"Why This Works Long-Term"]}),o.jsx("div",{className:"sdd-insights-grid",children:t.map((n,a)=>o.jsxs("div",{className:"sdd-insight-card",style:{border:`1px solid ${n.borderColor}`,background:n.bgColor},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:10},children:[o.jsx("div",{style:{width:32,height:32,borderRadius:8,background:`${n.color}1A`,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:o.jsx("svg",{style:{width:16,height:16,color:n.color},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:n.icon})})}),o.jsx("h4",{style:{fontSize:14,fontWeight:700,color:n.color,fontFamily:"var(--font-heading)"},children:n.title})]}),o.jsx("p",{style:{fontSize:12,color:"var(--text-dim)",lineHeight:1.6},children:n.text})]},a))}),o.jsxs("div",{style:{marginTop:20,borderRadius:10,padding:"16px 20px",background:"linear-gradient(90deg, rgba(0,240,255,0.06), rgba(247,147,26,0.06))",border:"1px solid rgba(0,240,255,0.12)",textAlign:"center"},children:[o.jsx("p",{style:{fontSize:14,fontWeight:600,color:"var(--text)",marginBottom:4},children:"The Bottom Line"}),o.jsx("p",{style:{fontSize:13,color:"var(--text-dim)",lineHeight:1.6,maxWidth:700,margin:"0 auto"},children:"This is not gambling. It is systematic, AI-driven arbitrage on prediction market inefficiencies. Small, consistent profits compounded over hundreds of trades per week create exponential portfolio growth. The math is on our side, and the AI never sleeps."})]})]})]})}function lZ({label:e,rawValue:t,displayValue:r,color:n,accent:a,icon:i,sparkColor:s,hero:l}){const c=qJ(typeof t=="number"?t:0),u=kj[e]||kj.Balance,f=typeof t=="number"&&t!==0?e==="Balance"||e==="Today P&L"?`$${(c/100).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`:Math.round(c).toLocaleString():r;return o.jsxs("div",{className:`card ${a}${l?" border-neon-animated":""}`,style:{display:"flex",flexDirection:"column",gap:8},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o.jsx("span",{className:"stat-label",children:e}),o.jsx("div",{style:{width:28,height:28,borderRadius:7,background:`${n}1A`,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx("svg",{style:{width:14,height:14,color:n},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:i})})})]}),o.jsxs("div",{style:{display:"flex",alignItems:"flex-end",justifyContent:"space-between",gap:8},children:[o.jsx("p",{className:"stat-v mono",style:{color:n},children:f}),o.jsx(YJ,{data:u,color:s||n,width:60,height:22,id:e.replace(/\s+/g,"-").toLowerCase()})]})]})}function yt({title:e,defaultOpen:t=!0,children:r}){const n=`ken-sec-${e.toLowerCase().replace(/[^a-z0-9]/g,"-")}`,[a,i]=P.useState(()=>{try{return localStorage.getItem(n)!=="false"}catch{return t}}),s=()=>i(l=>{const c=!l;try{localStorage.setItem(n,String(c))}catch{}return c});return o.jsxs("div",{children:[o.jsxs("button",{onClick:s,style:{display:"flex",alignItems:"center",gap:8,padding:"2px 0 8px",width:"100%",background:"transparent",border:"none",cursor:"pointer"},onMouseEnter:l=>{l.currentTarget.style.opacity="0.7"},onMouseLeave:l=>{l.currentTarget.style.opacity="1"},children:[o.jsx("svg",{style:{width:12,height:12,color:"var(--text-muted)",flexShrink:0,transition:"transform 220ms ease",transform:a?"rotate(0deg)":"rotate(-90deg)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})}),o.jsx("span",{style:{fontSize:10,fontWeight:700,fontFamily:"var(--font-body)",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.1em"},children:e})]}),o.jsx("div",{style:{maxHeight:a?"3500px":0,overflow:"hidden",opacity:a?1:0,transition:"max-height 0.4s cubic-bezier(0.4,0,0.2,1), opacity 0.3s ease"},children:r})]})}function cZ(){var d;const[e,t]=P.useState(null),[r,n]=P.useState(!0);P.useEffect(()=>{a();const h=setInterval(a,3e4);return()=>clearInterval(h)},[]);async function a(){try{const h=await Oe("/dashboard");t(h)}catch{}n(!1)}if(r)return o.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:256},children:o.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})});const i=e||{},s=(i.pnl_history||[]).map((h,p)=>({day:p+1,pnl:h})),l=i.today_trades>0?(i.today_wins/i.today_trades*100).toFixed(1):"0",c=(i.strategies||[]).filter(h=>h.pnl>0).slice(0,5),u=(i.strategies||[]).filter(h=>h.pnl<0).slice(-5).reverse(),f=[{label:"Balance",rawValue:i.balance||0,displayValue:i.balance?`$${(i.balance/100).toLocaleString(void 0,{minimumFractionDigits:2})}`:"—",color:"var(--green)",sparkColor:"var(--green)",accent:"card-accent-green",icon:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"},{label:"Positions",rawValue:i.position_count||0,displayValue:i.position_count??"—",color:"var(--orange)",sparkColor:"var(--orange)",accent:"card-accent-orange",icon:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"},{label:"Open Markets",rawValue:i.open_orders||0,displayValue:i.open_orders??"—",color:"var(--blue)",sparkColor:"var(--cyan)",accent:"card-accent-blue",icon:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"},{label:"Today P&L",rawValue:i.daily_pnl||0,displayValue:i.daily_pnl?`$${(i.daily_pnl/100).toLocaleString(void 0,{minimumFractionDigits:2})}`:"$0.00",color:(i.daily_pnl||0)>=0?"var(--green)":"var(--red)",sparkColor:(i.daily_pnl||0)>=0?"var(--green)":"var(--red)",accent:(i.daily_pnl||0)>=0?"card-accent-green":"card-accent-red",icon:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},{label:"Markets Tracked",rawValue:i.markets_tracked||0,displayValue:i.markets_tracked??"—",color:"var(--purple)",sparkColor:"var(--purple)",accent:"card-accent-purple",icon:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"}];return o.jsxs("div",{className:"fade-in",style:{display:"flex",flexDirection:"column",gap:24},children:[o.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[o.jsxs("div",{children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:4},children:[o.jsx("h1",{className:"heading",style:{fontSize:26,fontWeight:800,color:"var(--text)",letterSpacing:"-0.025em"},children:"Dashboard"}),o.jsxs("span",{className:"live-indicator",children:[o.jsx("span",{className:"live-dot"}),"LIVE"]})]}),o.jsx("p",{className:"section-subtitle",children:"Ken event contracts overview"})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[o.jsx("span",{className:"badge",style:i.env==="prod"?{background:"var(--green-dim)",color:"var(--green)"}:{background:"var(--orange-dim)",color:"var(--orange)"},children:(i.env||"DEMO").toUpperCase()}),i.safe_mode&&o.jsx("span",{className:"badge",style:{background:"var(--orange-dim)",color:"var(--orange)"},children:"SAFE MODE"})]})]}),o.jsx(yt,{title:"Overview",children:o.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(5,1fr)",gap:14},children:f.map((h,p)=>o.jsx(lZ,{...h,hero:p===0},h.label))})}),o.jsx(yt,{title:"Portfolio Performance",children:o.jsx(nZ,{dailyPnl:i.daily_pnl_history||i.dailyPnl||[]})}),o.jsx(yt,{title:"Strategy Breakdown",children:o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"2fr 1fr",gap:16},children:[o.jsx(iZ,{strategies:i.strategies}),o.jsx(oZ,{winRate:i.win_rate||(i.today_trades>0?i.today_wins/i.today_trades:0)})]})}),i.seed_money>0&&o.jsx(yt,{title:"Capital & Economics",children:o.jsxs("div",{className:"card",style:{border:"1px solid rgba(59,130,246,0.18)",background:"linear-gradient(135deg, rgba(59,130,246,0.04), var(--surface), rgba(0,195,137,0.04))"},children:[o.jsxs("div",{className:"section-title",style:{marginBottom:16},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--cyan)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Capital & Economics"]}),o.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(6,1fr)",gap:12,textAlign:"center"},children:[{label:"Seed Money",value:`$${(i.seed_money/100).toLocaleString(void 0,{minimumFractionDigits:0})}`,sub:`${i.num_portfolios} portfolios`,color:"var(--blue)"},{label:"Current Balance",value:`$${(i.balance/100).toLocaleString(void 0,{minimumFractionDigits:0})}`,sub:"all portfolios",color:"var(--green)"},{label:"Net P&L",value:`${i.net_pnl_from_seed>=0?"+":""}$${(i.net_pnl_from_seed/100).toLocaleString(void 0,{minimumFractionDigits:0})}`,sub:`${i.roi_pct>=0?"+":""}${i.roi_pct}% ROI`,color:i.net_pnl_from_seed>=0?"var(--green)":"var(--red)",subColor:i.roi_pct>=0?"var(--green)":"var(--red)"},{label:"Capital Deployed",value:`$${(i.total_invested/100).toLocaleString(void 0,{minimumFractionDigits:0})}`,sub:"total traded",color:"var(--orange)"},{label:"Capital at Risk",value:`$${(i.capital_at_risk/100).toLocaleString(void 0,{minimumFractionDigits:0})}`,sub:"open positions",color:"var(--red)"},{label:"Daily Budget",value:`$${(i.daily_budget/100).toLocaleString(void 0,{minimumFractionDigits:0})}`,sub:"across strategies",color:"var(--purple)"}].map(h=>o.jsxs("div",{children:[o.jsx("p",{className:"stat-label",style:{marginBottom:6},children:h.label}),o.jsx("p",{className:"mono",style:{fontSize:18,fontWeight:700,color:h.color},children:h.value}),o.jsx("p",{style:{fontSize:10,color:h.subColor||"var(--text-muted)",marginTop:2},children:h.sub})]},h.label))}),((d=i.daily_economics)==null?void 0:d.length)>0&&o.jsxs("div",{style:{marginTop:18,paddingTop:14,borderTop:"1px solid var(--border)"},children:[o.jsx("p",{className:"stat-label",style:{marginBottom:10},children:"Daily Breakdown (Last 7 Days)"}),o.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7,1fr)",gap:8},children:(i.daily_economics||[]).slice(0,7).reverse().map((h,p)=>{const g=new Date(h.day).toLocaleDateString("en-US",{weekday:"short",month:"numeric",day:"numeric",timeZone:"America/Los_Angeles"}),y=h.net_pnl>=0;return o.jsxs("div",{style:{borderRadius:8,padding:"10px 8px",background:y?"rgba(0,195,137,0.06)":"rgba(255,92,92,0.06)",border:`1px solid ${y?"rgba(0,195,137,0.18)":"rgba(255,92,92,0.18)"}`,textAlign:"center"},children:[o.jsx("p",{style:{fontSize:10,color:"var(--text-muted)",fontWeight:600,marginBottom:4},children:g}),o.jsxs("p",{className:"mono",style:{fontSize:13,fontWeight:700,color:y?"var(--green)":"var(--red)",marginBottom:3},children:[y?"+":"","$",(h.net_pnl/100).toFixed(0)]}),o.jsxs("p",{style:{fontSize:10,color:"var(--text-muted)",marginBottom:2},children:[h.trades," trades"]}),o.jsxs("p",{style:{fontSize:10,color:"var(--text-muted)"},children:[o.jsxs("span",{style:{color:"var(--green)"},children:[h.wins,"W"]})," / ",o.jsxs("span",{style:{color:"var(--red)"},children:[h.losses,"L"]})]})]},p)})})]})]})}),o.jsx(yt,{title:"Best Opportunities",children:o.jsx(QJ,{opportunities:i.top_opportunities})}),o.jsx(yt,{title:"Today's Performance",children:o.jsxs("div",{className:"card",style:{border:"1px solid rgba(247,147,26,0.18)",background:"linear-gradient(135deg, rgba(247,147,26,0.04), var(--surface))"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:14},children:[o.jsxs("div",{className:"section-title",children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--orange)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})}),"Today's Lessons"]}),o.jsx("span",{style:{marginLeft:"auto",fontSize:12,color:"var(--text-muted)"},children:new Date().toLocaleDateString("en-US",{weekday:"long",month:"short",day:"numeric"})})]}),o.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:16,textAlign:"center"},children:[{label:"Trades Resolved",value:(i.today_trades||0).toLocaleString(),color:"var(--orange)"},{label:"Wins / Losses",value:o.jsxs("span",{children:[o.jsx("span",{style:{color:"var(--green)"},children:i.today_wins||0}),o.jsx("span",{style:{color:"var(--border-light)",margin:"0 4px"},children:"/"}),o.jsx("span",{style:{color:"var(--red)"},children:i.today_losses||0})]}),color:null},{label:"Win Rate",value:`${l}%`,color:Number(l)>=50?"var(--green)":"var(--red)"},{label:"Day P&L",value:`${(i.daily_pnl||0)>=0?"+":""}$${((i.daily_pnl||0)/100).toLocaleString(void 0,{minimumFractionDigits:2})}`,color:(i.daily_pnl||0)>=0?"var(--green)":"var(--red)"}].map((h,p)=>o.jsxs("div",{children:[o.jsx("p",{className:"stat-label",style:{marginBottom:6},children:h.label}),typeof h.value=="string"?o.jsx("p",{className:"mono",style:{fontSize:22,fontWeight:700,color:h.color},children:h.value}):o.jsx("p",{className:"mono",style:{fontSize:22,fontWeight:700},children:h.value})]},p))})]})}),o.jsx(yt,{title:"Strategy Flow",children:o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"2fr 1fr",gap:16},children:[o.jsx(JJ,{topMarkets:i.top_markets,seedMoney:i.seed_money,balance:i.balance}),o.jsx(tZ,{todayWins:i.today_wins,todayLosses:i.today_losses})]})}),o.jsx(yt,{title:"Action Plan",children:o.jsx(ZJ,{topMarkets:i.top_markets,worstMarkets:i.worst_markets,strategies:i.strategies})}),(i.top_markets||[]).length>0&&o.jsx(yt,{title:"Top Markets",children:o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"section-title",style:{marginBottom:14},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--green)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M5 3l14 9-14 9V3z"})}),"Top Markets — Money Makers"]}),o.jsx("div",{style:{overflowX:"auto"},children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{style:{textAlign:"left"},children:"Market"}),o.jsx("th",{style:{textAlign:"right"},children:"Trades"}),o.jsx("th",{style:{textAlign:"right"},children:"Wins"}),o.jsx("th",{style:{textAlign:"right"},children:"P&L"}),o.jsx("th",{children:"Edge"}),o.jsx("th",{children:"Signal"})]})}),o.jsx("tbody",{children:(i.top_markets||[]).map((h,p)=>{var g;return o.jsxs("tr",{children:[o.jsxs("td",{style:{maxWidth:300},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[o.jsx(Sc,{to:`/positions?market=${encodeURIComponent(h.ticker)}`,style:{fontSize:13,color:"var(--text)",textDecoration:"none",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",transition:"color 150ms"},onMouseEnter:y=>{y.currentTarget.style.color="var(--cyan)"},onMouseLeave:y=>{y.currentTarget.style.color="var(--text)"},children:h.title}),o.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent(((g=h.title)==null?void 0:g.split("?")[0])||h.ticker)}`,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--text-muted)",flexShrink:0,textDecoration:"none",fontSize:13},onMouseEnter:y=>{y.currentTarget.style.color="var(--cyan)"},onMouseLeave:y=>{y.currentTarget.style.color="var(--text-muted)"},title:"View on Kalshi",children:"↗"})]}),o.jsx("span",{className:"mono",style:{fontSize:10,color:"var(--text-muted)"},children:h.ticker})]}),o.jsx("td",{style:{textAlign:"right"},className:"mono",children:o.jsx("span",{style:{fontSize:13,color:"var(--text-dim)"},children:h.trades})}),o.jsx("td",{style:{textAlign:"right",fontSize:13},children:o.jsx(Oj,{wins:h.wins,losses:h.losses})}),o.jsx("td",{style:{textAlign:"right",fontSize:13},children:o.jsx(ic,{cents:h.pnl})}),o.jsx("td",{style:{fontSize:12,color:"var(--text-muted)",whiteSpace:"nowrap"},children:h.edge}),o.jsx("td",{style:{textAlign:"center"},children:o.jsx(Nj,{wins:h.wins,losses:h.losses,pnl:h.pnl})})]},p)})})]})})]})}),(i.worst_markets||[]).length>0&&o.jsx(yt,{title:"Bleeding Markets",children:o.jsxs("div",{className:"card",style:{border:"1px solid rgba(255,92,92,0.12)"},children:[o.jsxs("div",{className:"section-title",style:{marginBottom:14,color:"var(--red)"},children:[o.jsx("svg",{style:{width:18,height:18},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),"Bleeding Markets — Consider Exiting"]}),o.jsx("div",{style:{overflowX:"auto"},children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{style:{textAlign:"left"},children:"Market"}),o.jsx("th",{style:{textAlign:"right"},children:"Trades"}),o.jsx("th",{style:{textAlign:"right"},children:"Wins"}),o.jsx("th",{style:{textAlign:"right"},children:"P&L"}),o.jsx("th",{children:"Edge"}),o.jsx("th",{children:"Signal"})]})}),o.jsx("tbody",{children:(i.worst_markets||[]).map((h,p)=>{var g;return o.jsxs("tr",{children:[o.jsxs("td",{style:{maxWidth:300},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[o.jsx(Sc,{to:`/positions?market=${encodeURIComponent(h.ticker)}`,style:{fontSize:13,color:"var(--text)",textDecoration:"none",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",transition:"color 150ms"},onMouseEnter:y=>{y.currentTarget.style.color="var(--red)"},onMouseLeave:y=>{y.currentTarget.style.color="var(--text)"},children:h.title}),o.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent(((g=h.title)==null?void 0:g.split("?")[0])||h.ticker)}`,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--text-muted)",flexShrink:0,textDecoration:"none",fontSize:13},onMouseEnter:y=>{y.currentTarget.style.color="var(--red)"},onMouseLeave:y=>{y.currentTarget.style.color="var(--text-muted)"},title:"View on Kalshi",children:"↗"})]}),o.jsx("span",{className:"mono",style:{fontSize:10,color:"var(--text-muted)"},children:h.ticker})]}),o.jsx("td",{style:{textAlign:"right"},className:"mono",children:o.jsx("span",{style:{fontSize:13,color:"var(--text-dim)"},children:h.trades})}),o.jsx("td",{style:{textAlign:"right",fontSize:13},children:o.jsx(Oj,{wins:h.wins,losses:h.losses})}),o.jsx("td",{style:{textAlign:"right",fontSize:13},children:o.jsx(ic,{cents:h.pnl})}),o.jsx("td",{style:{fontSize:12,color:"var(--text-muted)",whiteSpace:"nowrap"},children:h.edge}),o.jsx("td",{style:{textAlign:"center"},children:o.jsx(Nj,{wins:h.wins,losses:h.losses,pnl:h.pnl})})]},p)})})]})})]})}),s.length>0&&o.jsx(yt,{title:"P&L History",children:o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"section-title",style:{marginBottom:14},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--cyan)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z"})}),"P&L History (Daily)"]}),o.jsx(tr,{width:"100%",height:200,children:o.jsxs(Jy,{data:s,children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:"pnlGrad",x1:"0",y1:"0",x2:"0",y2:"1",children:[o.jsx("stop",{offset:"5%",stopColor:"#00F0FF",stopOpacity:.2}),o.jsx("stop",{offset:"95%",stopColor:"#00F0FF",stopOpacity:0})]})}),o.jsx(Ia,{strokeDasharray:"3 3",stroke:"var(--border)"}),o.jsx(or,{dataKey:"day",stroke:"var(--text-muted)",tick:{fill:"var(--text-muted)",fontSize:11}}),o.jsx(sr,{stroke:"var(--text-muted)",tick:{fill:"var(--text-muted)",fontSize:11},tickFormatter:h=>`$${h}`}),o.jsx(Ge,{contentStyle:{background:"var(--surface-el)",border:"1px solid var(--border)",borderRadius:8,color:"var(--text)"}}),o.jsx(Lr,{type:"monotone",dataKey:"pnl",stroke:"var(--cyan)",strokeWidth:2,fill:"url(#pnlGrad)"})]})})]})}),o.jsx(yt,{title:"Strategy P&L",children:o.jsx(eZ,{strategies:i.strategies})}),o.jsx(yt,{title:"Strategy Leaderboard",children:o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:16},children:[o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"section-title",style:{marginBottom:12},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--green)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M5 3l14 9-14 9V3z"})}),"Top Strategies"]}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[c.map((h,p)=>o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 0",borderBottom:p<c.length-1?"1px solid var(--border)":"none"},children:[o.jsxs("div",{children:[o.jsx("span",{style:{fontSize:13,fontWeight:500,color:"var(--text)"},children:h.name}),o.jsx("span",{style:{marginLeft:8,fontSize:10,color:"var(--text-muted)"},children:h.strategy})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[o.jsxs("span",{style:{fontSize:11,color:"var(--text-muted)"},children:[h.win_rate,"% WR"]}),o.jsx(ic,{cents:h.pnl})]})]},p)),c.length===0&&o.jsx("p",{style:{color:"var(--text-muted)",fontSize:13,textAlign:"center",padding:"16px 0"},children:"No profitable strategies yet"})]})]}),o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"section-title",style:{marginBottom:12},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--red)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M13 17h8m0 0V9m0 8l-8-8-4 4-6-6"})}),"Losing Strategies"]}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[u.map((h,p)=>o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 0",borderBottom:p<u.length-1?"1px solid var(--border)":"none"},children:[o.jsxs("div",{children:[o.jsx("span",{style:{fontSize:13,fontWeight:500,color:"var(--text-dim)"},children:h.name}),o.jsx("span",{style:{marginLeft:8,fontSize:10,color:"var(--text-muted)"},children:h.strategy})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[o.jsxs("span",{style:{fontSize:11,color:"var(--text-muted)"},children:[h.win_rate,"% WR"]}),o.jsx(ic,{cents:h.pnl})]})]},p)),u.length===0&&o.jsx("p",{style:{color:"var(--text-muted)",fontSize:13,textAlign:"center",padding:"16px 0"},children:"No losing strategies"})]})]})]})}),o.jsx(yt,{title:"Strategy Deep Dive",defaultOpen:!1,children:o.jsx(sZ,{})}),o.jsx(yt,{title:"Recent Activity",children:o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:16},children:[o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"section-title",style:{marginBottom:12},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--cyan)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})}),"Recent Fills"]}),(i.recent_fills||[]).length>0?o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:(i.recent_fills||[]).slice(0,5).map((h,p)=>{var g;return o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:13},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[o.jsx("span",{className:"mono",style:{fontSize:11,color:"var(--text-muted)"},children:h.ticker}),o.jsx("span",{className:"badge",style:h.side==="yes"?{background:"var(--green-dim)",color:"var(--green)"}:{background:"var(--red-dim)",color:"var(--red)"},children:(g=h.side)==null?void 0:g.toUpperCase()})]}),o.jsxs("span",{className:"mono",style:{color:"var(--text-dim)",fontSize:12},children:[h.count,"@",h.yes_price,"c"]})]},p)})}):o.jsx("p",{style:{color:"var(--text-muted)",fontSize:13,textAlign:"center",padding:"24px 0"},children:"No recent fills"})]}),o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"section-title",style:{marginBottom:12},children:[o.jsx("svg",{style:{width:18,height:18,color:"var(--cyan)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Quick Actions"]}),o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[{to:"/markets",icon:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6",iconColor:"var(--orange)",label:"Browse Markets",sub:"Find weather contracts"},{to:"/positions",icon:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z",iconColor:"var(--green)",label:"View Positions",sub:"Current portfolio"},{to:"/settings",icon:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z",iconColor:"var(--blue)",label:"Scan Config",sub:"Intervals & risk params"}].map(h=>o.jsxs(Sc,{to:h.to,style:{display:"flex",alignItems:"center",gap:12,padding:"10px 12px",borderRadius:8,background:"var(--surface-el)",border:"1px solid var(--border)",textDecoration:"none",transition:"all 150ms ease"},onMouseEnter:p=>{p.currentTarget.style.borderColor="var(--cyan)",p.currentTarget.style.background="rgba(0,240,255,0.04)"},onMouseLeave:p=>{p.currentTarget.style.borderColor="var(--border)",p.currentTarget.style.background="var(--surface-el)"},children:[o.jsx("div",{style:{width:32,height:32,borderRadius:8,background:`${h.iconColor}1A`,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:o.jsx("svg",{style:{width:15,height:15,color:h.iconColor},fill:"none",stroke:"currentColor",strokeWidth:"1.8",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:h.icon})})}),o.jsxs("div",{children:[o.jsx("p",{style:{fontSize:13,fontWeight:500,color:"var(--text)",marginBottom:1},children:h.label}),o.jsx("p",{style:{fontSize:11,color:"var(--text-muted)"},children:h.sub})]})]},h.to))})]})]})})]})}function uZ({m:e}){const[t,r]=P.useState(null),[n,a]=P.useState(!1),[i,s]=P.useState(!1);async function l(){if(n){a(!1);return}a(!0),s(!0);try{const c=await me("/kalshi",{action:"get_orderbook",ticker:e.ticker});c.success&&r(c.orderbook)}catch{}s(!1)}return o.jsxs(o.Fragment,{children:[o.jsxs("tr",{style:{background:"rgba(0,240,255,0.02)"},children:[o.jsx("td",{className:"pl-8 max-w-[250px]",children:o.jsx("span",{className:"truncate block text-sm",style:{color:"var(--text-dim)"},children:e.title||e.subtitle||e.ticker})}),o.jsx("td",{children:o.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent((e.ticker||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"mono text-xs hover:underline transition",style:{color:"var(--cyan)"},children:e.ticker})}),o.jsx("td",{children:o.jsxs("span",{className:"mono text-sm",style:{color:"var(--green)"},children:[e.yes_bid??"—","¢"]})}),o.jsx("td",{children:o.jsxs("span",{className:"mono text-sm",style:{color:"var(--red)"},children:[e.yes_ask??"—","¢"]})}),o.jsx("td",{children:o.jsx("span",{className:"mono text-xs",style:{color:"var(--text-dim)"},children:(e.volume||0).toLocaleString()})}),o.jsx("td",{children:o.jsx("span",{className:"mono text-xs",style:{color:"var(--text-muted)"},children:e.open_interest?e.open_interest.toLocaleString():"—"})}),o.jsx("td",{children:o.jsx("button",{onClick:l,className:"btn btn-ghost btn-sm",style:{color:n?"var(--cyan)":"var(--text-muted)"},children:n?"▾ Book":"▸ Book"})})]}),n&&o.jsx("tr",{style:{background:"rgba(0,240,255,0.01)"},children:o.jsx("td",{colSpan:7,className:"p-4",children:i?o.jsx("div",{className:"flex items-center justify-center h-16",children:o.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-t-transparent rounded-full",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})}):t?o.jsxs("div",{className:"grid grid-cols-2 gap-6 max-w-lg",children:[o.jsxs("div",{children:[o.jsx("p",{className:"stat-label mb-2",style:{color:"var(--green)"},children:"YES Bids"}),o.jsxs("div",{className:"space-y-1",children:[(t.yes||[]).slice(0,8).map((c,u)=>o.jsxs("div",{className:"relative flex justify-between text-xs px-2 py-1 rounded overflow-hidden",style:{background:"var(--surface-el)"},children:[o.jsx("div",{className:"absolute inset-0 rounded",style:{width:`${Math.min((c[1]||0)*2,100)}%`,background:"rgba(0,195,137,0.08)"}}),o.jsxs("span",{className:"mono relative z-10",style:{color:"var(--green)"},children:[c[0],"¢"]}),o.jsx("span",{className:"mono relative z-10",style:{color:"var(--text-muted)"},children:c[1]})]},u)),(!t.yes||t.yes.length===0)&&o.jsx("p",{className:"text-xs text-center py-2",style:{color:"var(--text-muted)"},children:"Empty"})]})]}),o.jsxs("div",{children:[o.jsx("p",{className:"stat-label mb-2",style:{color:"var(--red)"},children:"NO Bids"}),o.jsxs("div",{className:"space-y-1",children:[(t.no||[]).slice(0,8).map((c,u)=>o.jsxs("div",{className:"relative flex justify-between text-xs px-2 py-1 rounded overflow-hidden",style:{background:"var(--surface-el)"},children:[o.jsx("div",{className:"absolute inset-0 rounded",style:{width:`${Math.min((c[1]||0)*2,100)}%`,background:"rgba(255,92,92,0.08)"}}),o.jsxs("span",{className:"mono relative z-10",style:{color:"var(--red)"},children:[c[0],"¢"]}),o.jsx("span",{className:"mono relative z-10",style:{color:"var(--text-muted)"},children:c[1]})]},u)),(!t.no||t.no.length===0)&&o.jsx("p",{className:"text-xs text-center py-2",style:{color:"var(--text-muted)"},children:"Empty"})]})]})]}):o.jsx("p",{className:"text-xs text-center py-2",style:{color:"var(--text-muted)"},children:"No orderbook data"})})})]})}function dZ({e}){const[t,r]=P.useState(!1),[n,a]=P.useState([]),[i,s]=P.useState(!1);async function l(){if(t){r(!1);return}if(r(!0),!(n.length>0)){s(!0);try{const c=await me("/kalshi",{action:"get_markets",params:{event_ticker:e.event_ticker}});a(c.markets||[])}catch{}s(!1)}}return o.jsxs(o.Fragment,{children:[o.jsxs("tr",{className:"cursor-pointer transition",onClick:l,style:{background:t?"rgba(0,240,255,0.04)":void 0},onMouseEnter:c=>{t||(c.currentTarget.style.background="var(--cyan-glow)")},onMouseLeave:c=>{t||(c.currentTarget.style.background="")},children:[o.jsx("td",{className:"max-w-[300px]",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-xs transition-transform inline-block",style:{color:"var(--text-muted)",transform:t?"rotate(90deg)":"rotate(0deg)"},children:"▶"}),o.jsx("span",{className:"truncate block font-medium heading",style:{color:"var(--text)"},children:e.title})]})}),o.jsx("td",{children:o.jsx("span",{className:"badge bg-orange",children:e.category||"—"})}),o.jsx("td",{children:o.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent((e.event_ticker||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"mono text-xs hover:underline transition",style:{color:"var(--cyan)"},onClick:c=>c.stopPropagation(),children:e.event_ticker})}),o.jsx("td",{children:o.jsx("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:e.mutually_exclusive?o.jsx("span",{className:"badge bg-blue",children:"ME"}):"—"})}),o.jsx("td",{onClick:c=>c.stopPropagation(),children:t?o.jsxs("span",{className:"text-xs mono",style:{color:"var(--cyan)"},children:[n.length||"..."," contracts"]}):o.jsx("span",{className:"text-xs transition",style:{color:"var(--text-muted)"},children:"View Contracts"})})]}),t&&o.jsx("tr",{children:o.jsx("td",{colSpan:5,className:"p-0",children:o.jsx("div",{className:"ml-6 fade-in",style:{borderLeft:"2px solid rgba(0,240,255,0.2)",background:"rgba(0,240,255,0.015)"},children:i?o.jsx("div",{className:"flex items-center justify-center py-8",children:o.jsx("div",{className:"animate-spin w-5 h-5 border-2 border-t-transparent rounded-full",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})}):n.length===0?o.jsx("div",{className:"text-xs text-center py-4",style:{color:"var(--text-muted)"},children:"No contracts found"}):o.jsxs("table",{className:"w-full",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"pl-8",children:"Contract"}),o.jsx("th",{children:"Ticker"}),o.jsx("th",{children:"Yes Bid"}),o.jsx("th",{children:"Yes Ask"}),o.jsx("th",{children:"Volume"}),o.jsx("th",{children:"Open Int."}),o.jsx("th",{children:"Book"})]})}),o.jsx("tbody",{children:n.map(c=>o.jsx(uZ,{m:c},c.ticker))})]})})})})]})}function fZ(){const[e,t]=P.useState([]),[r,n]=P.useState(!0),[a,i]=P.useState(""),[s,l]=P.useState("");P.useEffect(()=>{c()},[]);async function c(){n(!0);try{const d=await me("/kalshi",{action:"get_events",params:{status:"open",limit:100}});t(d.events||[])}catch{}n(!1)}const u=[...new Set(e.map(d=>d.category).filter(Boolean))].sort(),f=e.filter(d=>{const h=!a||(d.title||"").toLowerCase().includes(a.toLowerCase())||(d.category||"").toLowerCase().includes(a.toLowerCase()),p=!s||d.category===s;return h&&p});return r?o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-t-transparent rounded-full pulse-cyan",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})}):o.jsxs("div",{className:"space-y-6 fade-in",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("h1",{className:"heading text-3xl font-bold",style:{color:"var(--text)"},children:"Markets"}),o.jsxs("span",{className:"badge bg-cyan",children:[e.length," events"]}),f.length!==e.length&&o.jsxs("span",{className:"badge bg-orange",children:[f.length," filtered"]})]}),o.jsx("p",{className:"section-subtitle mt-1",children:"Live Kalshi prediction markets"})]}),o.jsx("button",{onClick:c,className:"btn btn-o btn-sm",children:"↻ Refresh"})]}),o.jsxs("div",{className:"relative",children:[o.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm pointer-events-none",style:{color:"var(--text-muted)"},children:"⌕"}),o.jsx("input",{type:"text",value:a,onChange:d=>i(d.target.value),placeholder:"Search markets by name or category...",className:"input pl-8"})]}),u.length>0&&o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsx("button",{onClick:()=>l(""),className:"badge transition cursor-pointer",style:{background:s?"rgba(42,42,53,0.6)":"var(--cyan-dim)",color:s?"var(--text-muted)":"var(--cyan)",border:s?"1px solid var(--border)":"1px solid rgba(0,240,255,0.3)"},children:"All"}),u.map(d=>o.jsx("button",{onClick:()=>l(d===s?"":d),className:"badge transition cursor-pointer",style:{background:s===d?"var(--orange-dim)":"rgba(42,42,53,0.6)",color:s===d?"var(--orange)":"var(--text-muted)",border:s===d?"1px solid rgba(247,147,26,0.3)":"1px solid var(--border)"},children:d},d))]}),o.jsx("div",{className:"card overflow-x-auto",style:{padding:0},children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"pl-5",children:"Event"}),o.jsx("th",{children:"Category"}),o.jsx("th",{children:"Ticker"}),o.jsx("th",{children:"Type"}),o.jsx("th",{children:"Contracts"})]})}),o.jsx("tbody",{children:f.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:5,className:"text-center py-12",style:{color:"var(--text-muted)"},children:o.jsxs("div",{className:"flex flex-col items-center gap-2",children:[o.jsx("span",{className:"text-2xl",children:"⌕"}),o.jsx("span",{className:"text-sm",children:"No markets match your filter"})]})})}):f.map(d=>o.jsx(dZ,{e:d},d.event_ticker))})]})})]})}function oc(e,t=9,r="flat"){let n=e;const a=()=>(n=n*1664525+1013904223&4294967295,Math.abs(n)%1e3/1e3),i=r==="up"?.8:r==="down"?-.8:0;let s=45+a()*10;const l=[];for(let c=0;c<t;c++){const u=(a()-.45+i*.1)*6,f=s,d=Math.max(5,Math.min(95,s+u)),h=a()*3,p=a()*3,g=Math.max(f,d)+h,y=Math.min(f,d)-p;l.push({o:f,h:g,l:y,c:d}),s=d}return l}function sc({data:e,width:t=80,height:r=32,bullColor:n="var(--green)",bearColor:a="var(--red)"}){if(!e||e.length===0)return null;const i=e.map(m=>m.l),s=e.map(m=>m.h),l=Math.min(...i),u=Math.max(...s)-l||1,f=2,d=r-f*2,h=t-f*2,p=m=>f+d-(m-l)/u*d,g=e.length,y=h/g,b=Math.max(2,y*.55),v=1;return o.jsx("svg",{width:t,height:r,viewBox:`0 0 ${t} ${r}`,style:{display:"block",flexShrink:0},"aria-hidden":"true",children:e.map((m,x)=>{const S=m.c>=m.o,j=S?n:a,w=f+x*y+y/2,_=p(Math.max(m.o,m.c)),O=p(Math.min(m.o,m.c)),N=Math.max(1,O-_);return o.jsxs("g",{children:[o.jsx("line",{x1:w,y1:p(m.h),x2:w,y2:p(m.l),stroke:j,strokeWidth:v,strokeOpacity:.7}),o.jsx("rect",{x:w-b/2,y:_,width:b,height:N,fill:j,fillOpacity:S?.85:.75,rx:.5})]},x)})})}const fn=e=>`$${(e/100).toFixed(2)}`,Rr=e=>{const t=e/100;return`${t>=0?"+":""}$${t.toFixed(2)}`},hZ=e=>e>=0?"text-green":"text-red",Ha=e=>e==="BUY_YES"?"bg-green":"bg-red",Ka=e=>e==="BUY_YES"?"YES":"NO",Ho=(e,t,r)=>!r||r===0?null:Math.round(e+t/r),Ro=e=>`https://kalshi.com/search?query=${encodeURIComponent((e||"").split("-")[0])}`,Pj=e=>{if(!e)return"";const t=Date.now()-new Date(e).getTime();return t<6e4?"just now":t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`};function pZ({positions:e}){if(!e||!e.length)return null;const r=[{label:"<-$50",min:-1/0,max:-5e3,color:"#FF5C5C"},{label:"-$20-50",min:-5e3,max:-2e3,color:"#FF7A7A"},{label:"-$1-20",min:-2e3,max:-100,color:"#FF9999"},{label:"$0",min:-100,max:100,color:"#6B7280"},{label:"$1-20",min:100,max:2e3,color:"#88DDBB"},{label:"$20-50",min:2e3,max:5e3,color:"#44CC99"},{label:">$50",min:5e3,max:1/0,color:"#00C389"}].map(a=>{const i=e.filter(s=>{const l=s.realized_pnl_cents||0;return l>a.min&&l<=a.max}).length;return{...a,count:i}}).filter(a=>a.count>0);if(!r.length)return null;const n=({active:a,payload:i,label:s})=>{var c;if(!a||!(i!=null&&i.length))return null;const l=((c=i[0])==null?void 0:c.payload)||{};return o.jsxs("div",{style:{background:"#1C1C24",border:"1px solid #2A2A35",borderRadius:8,padding:"8px 12px",fontSize:12,fontFamily:"'Inter', sans-serif"},children:[o.jsx("p",{style:{color:"#E0E0E0",fontWeight:700,marginBottom:4},children:s}),o.jsxs("p",{style:{color:l.color,fontFamily:"'JetBrains Mono', monospace",fontWeight:700},children:[l.count," position",l.count!==1?"s":""]})]})};return o.jsxs("div",{className:"card",children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:14},children:[o.jsx("h2",{className:"section-title",style:{fontSize:"1.05rem"},children:"P&L Distribution"}),o.jsxs("span",{style:{fontSize:11,color:"#6B7280"},children:[e.length," positions total"]})]}),o.jsx(tr,{width:"100%",height:180,children:o.jsxs(_l,{data:r,margin:{top:4,right:12,left:0,bottom:4},children:[o.jsx(Ia,{strokeDasharray:"3 3",stroke:"#2A2A35",strokeOpacity:.6,vertical:!1}),o.jsx(or,{dataKey:"label",stroke:"#2A2A35",tick:{fill:"#6B7280",fontSize:10,fontFamily:"'Inter', sans-serif"},tickLine:!1,axisLine:{stroke:"#2A2A35"}}),o.jsx(sr,{stroke:"#2A2A35",tick:{fill:"#6B7280",fontSize:11,fontFamily:"'Inter', sans-serif"},tickLine:!1,axisLine:!1,allowDecimals:!1,width:30}),o.jsx(Ge,{content:o.jsx(n,{}),cursor:{fill:"rgba(0,240,255,0.04)"}}),o.jsx(nr,{dataKey:"count",radius:[4,4,0,0],maxBarSize:48,children:r.map((a,i)=>o.jsx(xr,{fill:a.color,fillOpacity:.85},i))})]})})]})}function mZ(){return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"w-9 h-9 rounded-full border-2 animate-spin",style:{borderColor:"var(--border)",borderTopColor:"var(--cyan)"}})})}function Aj({p:e,trades:t,loading:r}){return o.jsxs("div",{style:{background:"var(--bg)",borderTop:"1px solid var(--border)",borderBottom:"1px solid var(--border)"},className:"px-4 py-3",children:[o.jsxs("div",{className:"flex items-center justify-between mb-3",children:[o.jsxs("span",{className:"mono text-xs font-bold",style:{color:"var(--cyan)"},children:["Trade History — ",e.ticker]}),o.jsxs("div",{className:"flex gap-4 text-xs",style:{color:"var(--text-muted)"},children:[o.jsxs("span",{children:["Open: ",o.jsx("b",{style:{color:"var(--blue)"},children:e.open_trades})]}),o.jsxs("span",{children:["Closed: ",o.jsx("b",{style:{color:"var(--text-dim)"},children:e.closed_trades})]}),o.jsxs("span",{children:["Entry Range:"," ",o.jsxs("b",{style:{color:"var(--orange)"},children:[e.min_entry,"¢ – ",e.max_entry,"¢"]})]}),o.jsxs("span",{children:["First: ",o.jsx("b",{children:new Date(e.first_trade_at).toLocaleDateString()})]})]})]}),r?o.jsx("div",{className:"flex justify-center py-4",children:o.jsx("div",{className:"w-5 h-5 rounded-full border-2 animate-spin",style:{borderColor:"var(--border)",borderTopColor:"var(--cyan)"}})}):t.length>0?o.jsx("div",{className:"overflow-x-auto",style:{maxHeight:200,overflowY:"auto"},children:o.jsxs("table",{className:"text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Time"}),o.jsx("th",{children:"Direction"}),o.jsx("th",{children:"Contracts"}),o.jsx("th",{children:"Entry"}),o.jsx("th",{children:"Exit"}),o.jsx("th",{children:"Cost"}),o.jsx("th",{children:"Profit"}),o.jsx("th",{children:"Status"})]})}),o.jsx("tbody",{children:t.map((n,a)=>{const i=parseInt(n.entry_price_cents)||0,s=parseInt(n.pnl_cents)||0,l=parseInt(n.contracts)||0,c=n.status==="closed"||n.status==="expired",u=c&&l>0?Ho(i,s,l):null;return o.jsxs("tr",{children:[o.jsx("td",{className:"mono",style:{color:"var(--text-muted)"},children:new Date(n.created_at).toLocaleString()}),o.jsx("td",{children:o.jsx("span",{className:`badge ${Ha(n.direction)}`,children:Ka(n.direction)})}),o.jsx("td",{className:"mono",children:n.contracts}),o.jsxs("td",{className:"mono",style:{color:"var(--orange)",fontFamily:"'JetBrains Mono', monospace"},children:[i,"¢"]}),o.jsx("td",{className:"mono",style:{fontFamily:"'JetBrains Mono', monospace",color:u!=null?"var(--text-dim)":"var(--text-muted)"},children:u!=null?`${u}¢`:"—"}),o.jsx("td",{className:"mono",style:{color:"var(--text-dim)"},children:fn(n.cost_cents||0)}),o.jsx("td",{className:"mono",style:{fontFamily:"'JetBrains Mono', monospace",fontWeight:700,color:s>0?"var(--green)":s<0?"var(--red)":"var(--text-muted)"},children:n.pnl_cents!=null&&c?Rr(s):"—"}),o.jsx("td",{children:o.jsx("span",{className:`badge ${n.status==="open"?"bg-blue":n.status==="closed"?"bg-green":"bg-orange"}`,children:n.status})})]},a)})})]})}):o.jsx("p",{className:"text-center py-3 text-xs",style:{color:"var(--text-muted)"},children:"No trade details available"})]})}function vZ(){var D;const[e,t]=P.useState([]),[r,n]=P.useState([]),[a,i]=P.useState({}),[s,l]=P.useState(!0),[c,u]=P.useState(null),[f,d]=P.useState(null),[h,p]=P.useState({}),[g,y]=P.useState(null),[b,v]=P.useState("grouped"),[m,x]=P.useState("cost"),S=P.useCallback(async()=>{try{const A=await Oe("/positions");A.success&&(t(A.positions||[]),n(A.grouped||[]),i(A.summary||{}))}catch{}l(!1)},[]);P.useEffect(()=>{S();const A=setInterval(S,3e4);return()=>clearInterval(A)},[S]);async function j(A,L){const C=`${A}_${L}`;if(!h[C]){y(C);try{const M=await me("/positions/trades",{ticker:A,direction:L,limit:50});M.success&&p(I=>({...I,[C]:M.trades||[]}))}catch{}y(null)}}function w(A){u(L=>L===A?null:A),d(null)}function _(A,L){const C=`${A}_${L}`;f===C?d(null):(d(C),j(A,L))}const O=[...e].sort((A,L)=>m==="pnl"?L.realized_pnl_cents-A.realized_pnl_cents:m==="contracts"?L.open_contracts-A.open_contracts:L.open_cost_cents-A.open_cost_cents),N=e.filter(A=>A.realized_pnl_cents>0).sort((A,L)=>L.realized_pnl_cents-A.realized_pnl_cents),k=e.filter(A=>A.realized_pnl_cents<0).sort((A,L)=>A.realized_pnl_cents-L.realized_pnl_cents),E=e.filter(A=>A.realized_pnl_cents===0),T=e.length>0&&N.length+k.length>0?`${Math.round(N.length/(N.length+k.length)*100)}%`:"—";return s?o.jsx(mZ,{}):o.jsxs("div",{className:"space-y-6 fade-in",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"heading text-3xl",style:{color:"var(--text)"},children:["Positions",o.jsx("span",{className:"badge bg-cyan ml-3 align-middle text-base",children:a.positionCount||0})]}),o.jsxs("p",{className:"section-subtitle mt-1",children:[a.positionCount||0," active positions •"," ",((D=a.totalTrades)==null?void 0:D.toLocaleString())||0," total trades"]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"flex rounded-lg p-0.5 gap-0.5",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[["grouped","Grouped"],["flat","All"],["pnl","P&L"]].map(([A,L])=>o.jsx("button",{onClick:()=>v(A),className:"px-3 py-1 text-xs font-semibold rounded-md transition",style:b===A?{background:"var(--cyan)",color:"var(--bg)",fontFamily:"var(--font-body)"}:{color:"var(--text-muted)",fontFamily:"var(--font-body)"},children:L},A))}),o.jsx("button",{onClick:S,className:"btn btn-o btn-sm",children:"Refresh"})]})]}),o.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[o.jsxs("div",{className:"card card-accent-cyan",children:[o.jsx("p",{className:"stat-label",children:"Positions"}),o.jsx("p",{className:"stat-v mono mt-2",style:{color:"var(--cyan)"},children:a.positionCount||0})]}),o.jsxs("div",{className:"card card-accent-orange",children:[o.jsx("p",{className:"stat-label",children:"Total Cost"}),o.jsx("p",{className:"stat-v mono mt-2",style:{color:"var(--text)"},children:fn(a.totalCost||0)})]}),o.jsxs("div",{className:`card ${(a.totalPnl||0)>=0?"card-accent-green":"card-accent-red"}`,children:[o.jsx("p",{className:"stat-label",children:"Realized P&L"}),o.jsx("p",{className:`stat-v mono mt-2 ${(a.totalPnl||0)>=0?"pnl-positive":"pnl-negative"}`,children:Rr(a.totalPnl||0)})]}),o.jsxs("div",{className:"card card-accent-blue",children:[o.jsx("p",{className:"stat-label",children:"Contracts"}),o.jsx("p",{className:"stat-v mono mt-2",style:{color:"var(--blue)"},children:(a.totalContracts||0).toLocaleString()})]}),o.jsxs("div",{className:"card card-accent-green",children:[o.jsx("p",{className:"stat-label",children:"Win Rate"}),o.jsx("p",{className:"stat-v mono mt-2 text-green",children:T})]})]}),a.totalPnl!==0&&o.jsxs("div",{className:"card py-3",children:[o.jsxs("div",{className:"flex items-center justify-between text-xs mb-2",children:[o.jsxs("span",{className:"font-semibold text-green",children:[N.length," winners"]}),o.jsxs("span",{style:{color:"var(--text-muted)"},children:[E.length," flat"]}),o.jsxs("span",{className:"font-semibold text-red",children:[k.length," losers"]})]}),o.jsx("div",{className:"progress-bar",style:{height:8},children:(()=>{const A=N.reduce((C,M)=>C+M.realized_pnl_cents,0)+Math.abs(k.reduce((C,M)=>C+M.realized_pnl_cents,0));if(!A)return null;const L=N.reduce((C,M)=>C+M.realized_pnl_cents,0)/A*100;return o.jsxs("div",{className:"flex h-full w-full",children:[o.jsx("div",{className:"bar-win-glow",style:{width:`${L}%`,background:"var(--green)",borderRadius:"2px 0 0 2px"}}),o.jsx("div",{className:"bar-loss-glow",style:{width:`${100-L}%`,background:"var(--red)",borderRadius:"0 2px 2px 0"}})]})})()})]}),o.jsx(pZ,{positions:e}),b==="grouped"&&o.jsx("div",{className:"space-y-3",children:r.map(A=>{const L=c===A.event;return o.jsxs("div",{className:"card p-0 overflow-hidden",style:{padding:0},children:[o.jsxs("button",{onClick:()=>w(A.event),className:"w-full flex items-center gap-3 p-4 text-left transition",style:{background:"transparent"},onMouseEnter:C=>C.currentTarget.style.background="var(--cyan-glow)",onMouseLeave:C=>C.currentTarget.style.background="transparent",children:[o.jsx("span",{className:"text-xs inline-block transition-transform",style:{color:"var(--cyan)",transform:L?"rotate(90deg)":"rotate(0deg)"},children:"▶"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"mono text-sm font-bold",style:{color:"var(--orange)"},children:A.event}),o.jsx("span",{className:"badge bg-cyan",children:A.positions.length})]}),o.jsx("p",{className:"text-xs truncate mt-0.5",style:{color:"var(--text-muted)"},children:A.title})]}),o.jsxs("div",{className:"flex items-center gap-6 text-right flex-shrink-0",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Cost"}),o.jsx("p",{className:"mono text-sm",style:{color:"var(--text)"},children:fn(A.totalCost)})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Contracts"}),o.jsx("p",{className:"mono text-sm",style:{color:"var(--blue)"},children:A.totalContracts.toLocaleString()})]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Realized P&L"}),o.jsx("p",{className:`mono text-sm font-bold ${hZ(A.totalPnl)}`,children:Rr(A.totalPnl)})]})]})]}),L&&o.jsx("div",{style:{borderTop:"1px solid var(--border)"},children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{}),o.jsx("th",{children:"Ticker"}),o.jsx("th",{children:"Side"}),o.jsx("th",{children:"Contracts"}),o.jsx("th",{children:"Bought At"}),o.jsx("th",{children:"Sold At"}),o.jsx("th",{children:"Cost"}),o.jsx("th",{children:"Profit"}),o.jsx("th",{children:"Trades"}),o.jsx("th",{children:"Last Trade"})]})}),o.jsx("tbody",{children:A.positions.map(C=>{var Qe,Ae;const M=`${C.ticker}_${C.direction}`,I=f===M,R=h[M]||[],F=g===M,K=(C.realized_pnl_cents||0)>0,z=(C.realized_pnl_cents||0)<0,q=C.ticker.split("").reduce((V,Z)=>V+Z.charCodeAt(0),0),he=oc(q,9,K?"up":z?"down":"flat"),ge=K?"cursor-pointer position-winning":z?"cursor-pointer position-losing":"cursor-pointer";return o.jsxs($.Fragment,{children:[o.jsxs("tr",{className:ge,onClick:()=>_(C.ticker,C.direction),style:{position:"relative"},children:[o.jsx("td",{style:{width:24},children:o.jsx("span",{className:"text-xs inline-block transition-transform",style:{color:"var(--cyan)",transform:I?"rotate(90deg)":"rotate(0deg)"},children:"▶"})}),o.jsx("td",{children:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[o.jsx("a",{href:Ro(C.ticker),target:"_blank",rel:"noopener noreferrer",className:"mono text-sm hover:underline",style:{color:"var(--orange)"},onClick:V=>V.stopPropagation(),children:C.ticker}),o.jsx(sc,{data:he,width:72,height:28})]})}),o.jsx("td",{children:o.jsx("span",{className:`badge ${Ha(C.direction)}`,children:Ka(C.direction)})}),o.jsx("td",{className:"mono",children:(Qe=C.open_contracts)==null?void 0:Qe.toLocaleString()}),o.jsxs("td",{className:"mono",style:{color:"var(--orange)",fontFamily:"'JetBrains Mono', monospace"},children:[C.avg_entry_price,"¢"]}),o.jsx("td",{className:"mono",style:{fontFamily:"'JetBrains Mono', monospace"},children:(()=>{const V=parseInt(C.closed_trades)||0,Z=parseInt(C.open_trades)||0;if(V>0&&Z===0){const re=Ho(C.avg_entry_price,C.realized_pnl_cents,parseInt(C.open_contracts)||parseInt(C.total_trades)||1);return o.jsxs("span",{style:{color:"var(--text-dim)"},children:[re,"¢"]})}return o.jsx("span",{className:"badge bg-blue",style:{fontSize:"0.65rem"},children:"Open"})})()}),o.jsx("td",{className:"mono",style:{color:"var(--text)"},children:fn(C.open_cost_cents)}),o.jsx("td",{className:"mono",style:{fontFamily:"'JetBrains Mono', monospace",fontWeight:700,color:C.realized_pnl_cents>0?"var(--green)":C.realized_pnl_cents<0?"var(--red)":"var(--text-muted)"},children:C.realized_pnl_cents!==0?Rr(C.realized_pnl_cents):"—"}),o.jsx("td",{className:"mono",style:{color:"var(--text-muted)"},children:(Ae=C.total_trades)==null?void 0:Ae.toLocaleString()}),o.jsx("td",{className:"text-xs",style:{color:"var(--text-muted)"},children:Pj(C.last_trade_at)})]}),I&&o.jsx("tr",{children:o.jsx("td",{colSpan:10,style:{padding:0},children:o.jsx(Aj,{p:C,trades:R,loading:F})})})]},M)})})]})})]},A.event)})}),b==="flat"&&o.jsxs("div",{className:"card overflow-x-auto",style:{padding:0},children:[o.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",style:{borderBottom:"1px solid var(--border)"},children:[o.jsx("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Sort by:"}),[["cost","Cost"],["pnl","P&L"],["contracts","Contracts"]].map(([A,L])=>o.jsx("button",{onClick:()=>x(A),className:"text-xs font-semibold px-2.5 py-1 rounded-md transition",style:m===A?{background:"var(--cyan-dim)",color:"var(--cyan)"}:{color:"var(--text-muted)"},children:L},A))]}),o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"#"}),o.jsx("th",{children:"Ticker"}),o.jsx("th",{children:"Market"}),o.jsx("th",{children:"Side"}),o.jsx("th",{children:"Contracts"}),o.jsx("th",{children:"Bought At"}),o.jsx("th",{children:"Sold At"}),o.jsx("th",{children:"Cost"}),o.jsx("th",{children:"Profit"}),o.jsx("th",{children:"Trades"}),o.jsx("th",{children:"Last Trade"})]})}),o.jsx("tbody",{children:O.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:11,className:"text-center py-12",style:{color:"var(--text-muted)"},children:"No open positions"})}):O.map((A,L)=>{var ge,Qe;const C=`${A.ticker}_${A.direction}`,M=f===C,I=h[C]||[],R=g===C,F=(A.realized_pnl_cents||0)>0,K=(A.realized_pnl_cents||0)<0,z=A.ticker.split("").reduce((Ae,V)=>Ae+V.charCodeAt(0),0),q=F?"up":K?"down":"flat",ie=oc(z+100,9,q),he=F?"cursor-pointer position-winning":K?"cursor-pointer position-losing":"cursor-pointer";return o.jsxs($.Fragment,{children:[o.jsxs("tr",{className:he,onClick:()=>_(A.ticker,A.direction),style:{position:"relative"},children:[o.jsx("td",{style:{color:"var(--text-muted)"},children:L+1}),o.jsx("td",{children:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[o.jsx("a",{href:Ro(A.ticker),target:"_blank",rel:"noopener noreferrer",className:"mono text-sm hover:underline",style:{color:"var(--orange)"},onClick:Ae=>Ae.stopPropagation(),children:A.ticker}),o.jsx(sc,{data:ie,width:72,height:28})]})}),o.jsx("td",{className:"text-xs max-w-[192px] truncate",style:{color:"var(--text-dim)"},children:A.title}),o.jsx("td",{children:o.jsx("span",{className:`badge ${Ha(A.direction)}`,children:Ka(A.direction)})}),o.jsx("td",{className:"mono",children:(ge=A.open_contracts)==null?void 0:ge.toLocaleString()}),o.jsxs("td",{className:"mono",style:{color:"var(--orange)",fontFamily:"'JetBrains Mono', monospace"},children:[A.avg_entry_price,"¢"]}),o.jsx("td",{className:"mono",style:{fontFamily:"'JetBrains Mono', monospace"},children:(()=>{const Ae=parseInt(A.closed_trades)||0,V=parseInt(A.open_trades)||0;if(Ae>0&&V===0){const Z=Ho(A.avg_entry_price,A.realized_pnl_cents,parseInt(A.open_contracts)||parseInt(A.total_trades)||1);return o.jsxs("span",{style:{color:"var(--text-dim)"},children:[Z,"¢"]})}return o.jsx("span",{className:"badge bg-blue",style:{fontSize:"0.65rem"},children:"Open"})})()}),o.jsx("td",{className:"mono",style:{color:"var(--text)"},children:fn(A.open_cost_cents)}),o.jsx("td",{className:"mono",style:{fontFamily:"'JetBrains Mono', monospace",fontWeight:700,color:A.realized_pnl_cents>0?"var(--green)":A.realized_pnl_cents<0?"var(--red)":"var(--text-muted)"},children:A.realized_pnl_cents!==0?Rr(A.realized_pnl_cents):"—"}),o.jsx("td",{className:"mono",style:{color:"var(--text-muted)"},children:(Qe=A.total_trades)==null?void 0:Qe.toLocaleString()}),o.jsx("td",{className:"text-xs",style:{color:"var(--text-muted)"},children:Pj(A.last_trade_at)})]}),M&&o.jsx("tr",{children:o.jsx("td",{colSpan:11,style:{padding:0},children:o.jsx(Aj,{p:A,trades:I,loading:R})})})]},C)})})]})]}),b==="pnl"&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"card overflow-hidden",style:{padding:0},children:[o.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",style:{background:"rgba(0,195,137,0.06)",borderBottom:"1px solid rgba(0,195,137,0.2)",borderLeft:"4px solid var(--green)"},children:[o.jsx("span",{className:"text-sm font-bold text-green",style:{textShadow:"0 0 10px rgba(0,195,137,0.4)"},children:"Winners"}),o.jsx("span",{className:"badge bg-green",children:N.length}),o.jsx("div",{className:"flex-1"}),o.jsx("span",{className:"mono font-bold pnl-positive",children:Rr(N.reduce((A,L)=>A+L.realized_pnl_cents,0))})]}),o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Ticker"}),o.jsx("th",{children:"Market"}),o.jsx("th",{children:"Side"}),o.jsx("th",{children:"Contracts"}),o.jsx("th",{children:"Bought At"}),o.jsx("th",{children:"Sold At"}),o.jsx("th",{children:"Cost"}),o.jsx("th",{children:"Profit"}),o.jsx("th",{children:"ROI"})]})}),o.jsx("tbody",{children:N.map(A=>{var K;const L=A.open_cost_cents>0?`${(A.realized_pnl_cents/A.open_cost_cents*100).toFixed(0)}%`:"∞",C=A.ticker.split("").reduce((z,q)=>z+q.charCodeAt(0),0),M=oc(C+200,9,"up"),I=parseInt(A.closed_trades)||0,R=parseInt(A.open_trades)||0,F=I>0&&R===0?Ho(A.avg_entry_price,A.realized_pnl_cents,parseInt(A.open_contracts)||parseInt(A.total_trades)||1):null;return o.jsxs("tr",{className:"position-winning",style:{position:"relative"},children:[o.jsx("td",{children:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[o.jsx("a",{href:Ro(A.ticker),target:"_blank",rel:"noopener",className:"mono text-sm hover:underline",style:{color:"var(--orange)"},children:A.ticker}),o.jsx(sc,{data:M,width:64,height:26})]})}),o.jsx("td",{className:"text-xs max-w-[192px] truncate",style:{color:"var(--text-dim)"},children:A.title}),o.jsx("td",{children:o.jsx("span",{className:`badge ${Ha(A.direction)}`,children:Ka(A.direction)})}),o.jsx("td",{className:"mono",children:(K=A.open_contracts)==null?void 0:K.toLocaleString()}),o.jsxs("td",{className:"mono",style:{color:"var(--orange)",fontFamily:"'JetBrains Mono', monospace"},children:[A.avg_entry_price,"¢"]}),o.jsx("td",{className:"mono",style:{fontFamily:"'JetBrains Mono', monospace",color:F!=null?"var(--text-dim)":"var(--text-muted)"},children:F!=null?`${F}¢`:o.jsx("span",{className:"badge bg-blue",style:{fontSize:"0.65rem"},children:"Open"})}),o.jsx("td",{className:"mono",style:{color:"var(--text-dim)"},children:fn(A.open_cost_cents)}),o.jsx("td",{className:"mono font-bold pnl-positive",style:{fontFamily:"'JetBrains Mono', monospace"},children:Rr(A.realized_pnl_cents)}),o.jsx("td",{className:"mono pnl-positive",children:L})]},`${A.ticker}_${A.direction}`)})})]})]}),o.jsxs("div",{className:"card overflow-hidden",style:{padding:0},children:[o.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",style:{background:"rgba(255,92,92,0.06)",borderBottom:"1px solid rgba(255,92,92,0.2)",borderLeft:"4px solid var(--red)"},children:[o.jsx("span",{className:"text-sm font-bold text-red",style:{textShadow:"0 0 10px rgba(255,92,92,0.4)"},children:"Losers"}),o.jsx("span",{className:"badge bg-red",children:k.length}),o.jsx("div",{className:"flex-1"}),o.jsx("span",{className:"mono font-bold pnl-negative",children:Rr(k.reduce((A,L)=>A+L.realized_pnl_cents,0))})]}),o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Ticker"}),o.jsx("th",{children:"Market"}),o.jsx("th",{children:"Side"}),o.jsx("th",{children:"Contracts"}),o.jsx("th",{children:"Bought At"}),o.jsx("th",{children:"Sold At"}),o.jsx("th",{children:"Cost"}),o.jsx("th",{children:"Profit"}),o.jsx("th",{children:"ROI"})]})}),o.jsx("tbody",{children:k.map(A=>{var K;const L=A.open_cost_cents>0?`${(A.realized_pnl_cents/A.open_cost_cents*100).toFixed(0)}%`:"—",C=A.ticker.split("").reduce((z,q)=>z+q.charCodeAt(0),0),M=oc(C+300,9,"down"),I=parseInt(A.closed_trades)||0,R=parseInt(A.open_trades)||0,F=I>0&&R===0?Ho(A.avg_entry_price,A.realized_pnl_cents,parseInt(A.open_contracts)||parseInt(A.total_trades)||1):null;return o.jsxs("tr",{className:"position-losing",style:{position:"relative"},children:[o.jsx("td",{children:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[o.jsx("a",{href:Ro(A.ticker),target:"_blank",rel:"noopener",className:"mono text-sm hover:underline",style:{color:"var(--orange)"},children:A.ticker}),o.jsx(sc,{data:M,width:64,height:26})]})}),o.jsx("td",{className:"text-xs max-w-[192px] truncate",style:{color:"var(--text-dim)"},children:A.title}),o.jsx("td",{children:o.jsx("span",{className:`badge ${Ha(A.direction)}`,children:Ka(A.direction)})}),o.jsx("td",{className:"mono",children:(K=A.open_contracts)==null?void 0:K.toLocaleString()}),o.jsxs("td",{className:"mono",style:{color:"var(--orange)",fontFamily:"'JetBrains Mono', monospace"},children:[A.avg_entry_price,"¢"]}),o.jsx("td",{className:"mono",style:{fontFamily:"'JetBrains Mono', monospace",color:F!=null?"var(--text-dim)":"var(--text-muted)"},children:F!=null?`${F}¢`:o.jsx("span",{className:"badge bg-blue",style:{fontSize:"0.65rem"},children:"Open"})}),o.jsx("td",{className:"mono",style:{color:"var(--text-dim)"},children:fn(A.open_cost_cents)}),o.jsx("td",{className:"mono font-bold pnl-negative",style:{fontFamily:"'JetBrains Mono', monospace"},children:Rr(A.realized_pnl_cents)}),o.jsx("td",{className:"mono pnl-negative",children:L})]},`${A.ticker}_${A.direction}`)})})]})]}),E.length>0&&o.jsxs("div",{className:"card overflow-hidden",style:{padding:0},children:[o.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",style:{background:"var(--surface-el)",borderBottom:"1px solid var(--border)"},children:[o.jsx("span",{className:"text-sm font-bold",style:{color:"var(--text-dim)"},children:"Flat (No Realized P&L)"}),o.jsx("span",{className:"badge bg-orange",children:E.length})]}),o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Ticker"}),o.jsx("th",{children:"Market"}),o.jsx("th",{children:"Side"}),o.jsx("th",{children:"Contracts"}),o.jsx("th",{children:"Cost"})]})}),o.jsx("tbody",{children:E.map(A=>{var L;return o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx("a",{href:Ro(A.ticker),target:"_blank",rel:"noopener",className:"mono text-sm hover:underline",style:{color:"var(--orange)"},children:A.ticker})}),o.jsx("td",{className:"text-xs max-w-[192px] truncate",style:{color:"var(--text-dim)"},children:A.title}),o.jsx("td",{children:o.jsx("span",{className:`badge ${Ha(A.direction)}`,children:Ka(A.direction)})}),o.jsx("td",{className:"mono",children:(L=A.open_contracts)==null?void 0:L.toLocaleString()}),o.jsx("td",{className:"mono",style:{color:"var(--text-dim)"},children:fn(A.open_cost_cents)})]},`${A.ticker}_${A.direction}`)})})]})]})]})]})}function yZ(e){return e==="filled"?"bg-green":e==="resting"?"bg-orange":e==="canceled"?"bg-red":"bg-blue"}function Cj({label:e}){return o.jsx("tr",{children:o.jsx("td",{colSpan:20,children:o.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-3",children:[o.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--text-muted)"},children:[o.jsx("path",{d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2"}),o.jsx("rect",{x:"9",y:"3",width:"6",height:"4",rx:"1"}),o.jsx("path",{d:"M9 12h6M9 16h4"})]}),o.jsx("p",{style:{color:"var(--text-muted)",fontFamily:"var(--font-body)",fontSize:"0.875rem"},children:e})]})})})}function gZ(){return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"w-9 h-9 rounded-full border-2 animate-spin",style:{borderColor:"var(--border)",borderTopColor:"var(--cyan)"}})})}function xZ(){const[e,t]=P.useState([]),[r,n]=P.useState([]),[a,i]=P.useState(!0),[s,l]=P.useState("orders");P.useEffect(()=>{c()},[]);async function c(){i(!0);try{const[f,d]=await Promise.all([me("/kalshi",{action:"get_orders"}),me("/kalshi",{action:"get_fills"})]);t(f.orders||[]),n(d.fills||[])}catch{}i(!1)}async function u(f){try{await me("/kalshi",{action:"cancel_order",order_id:f}),c()}catch{}}return a?o.jsx(gZ,{}):o.jsxs("div",{className:"space-y-6 fade-in",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-xl",style:{background:"var(--cyan-dim)",color:"var(--cyan)"},children:o.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M7 16V4m0 0L3 8m4-4l4 4"}),o.jsx("path",{d:"M17 8v12m0 0l4-4m-4 4l-4-4"})]})}),o.jsxs("div",{children:[o.jsx("h1",{className:"heading text-3xl",style:{color:"var(--text)"},children:"Orders"}),o.jsxs("p",{className:"section-subtitle mt-0.5",children:[e.length," orders • ",r.length," fills"]})]})]}),o.jsx("button",{onClick:c,className:"btn btn-o btn-sm",children:"Refresh"})]}),o.jsxs("div",{className:"flex rounded-xl p-1 gap-1 w-fit",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[o.jsxs("button",{onClick:()=>l("orders"),className:"btn btn-sm",style:s==="orders"?{background:"var(--cyan)",color:"var(--bg)"}:{background:"transparent",color:"var(--text-muted)",border:"none"},children:["Orders",o.jsx("span",{className:"badge ml-1",style:s==="orders"?{background:"rgba(0,0,0,0.2)",color:"var(--bg)",fontSize:"0.65rem"}:{background:"var(--surface)",color:"var(--text-muted)",fontSize:"0.65rem"},children:e.length})]}),o.jsxs("button",{onClick:()=>l("fills"),className:"btn btn-sm",style:s==="fills"?{background:"var(--cyan)",color:"var(--bg)"}:{background:"transparent",color:"var(--text-muted)",border:"none"},children:["Fills",o.jsx("span",{className:"badge ml-1",style:s==="fills"?{background:"rgba(0,0,0,0.2)",color:"var(--bg)",fontSize:"0.65rem"}:{background:"var(--surface)",color:"var(--text-muted)",fontSize:"0.65rem"},children:r.length})]})]}),s==="orders"&&o.jsx("div",{className:"card overflow-x-auto",style:{padding:0},children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Ticker"}),o.jsx("th",{children:"Side"}),o.jsx("th",{children:"Action"}),o.jsx("th",{children:"Type"}),o.jsx("th",{children:"Price"}),o.jsx("th",{children:"Qty"}),o.jsx("th",{children:"Filled"}),o.jsx("th",{children:"Status"}),o.jsx("th",{children:"Action"})]})}),o.jsx("tbody",{children:e.length===0?o.jsx(Cj,{label:"No orders yet"}):e.map((f,d)=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent((f.ticker||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"mono text-xs hover:underline transition",style:{color:"var(--orange)"},children:f.ticker})}),o.jsx("td",{children:o.jsx("span",{className:`badge ${f.side==="yes"?"bg-green":"bg-red"}`,children:(f.side||"").toUpperCase()})}),o.jsx("td",{className:"text-xs",style:{color:"var(--text-dim)"},children:(f.action||"").toUpperCase()}),o.jsx("td",{className:"text-xs",style:{color:"var(--text-muted)"},children:f.type}),o.jsxs("td",{className:"mono",style:{color:"var(--cyan)"},children:[f.yes_price||f.no_price||"—","¢"]}),o.jsx("td",{className:"mono",children:f.count||f.remaining_count||0}),o.jsx("td",{className:"mono text-green",children:f.count-(f.remaining_count||0)}),o.jsx("td",{children:o.jsx("span",{className:`badge ${yZ(f.status)}`,children:f.status})}),o.jsx("td",{children:f.status==="resting"&&o.jsx("button",{onClick:()=>u(f.order_id),className:"btn btn-d btn-sm",children:"Cancel"})})]},d))})]})}),s==="fills"&&o.jsx("div",{className:"card overflow-x-auto",style:{padding:0},children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Ticker"}),o.jsx("th",{children:"Side"}),o.jsx("th",{children:"Action"}),o.jsx("th",{children:"Price"}),o.jsx("th",{children:"Qty"}),o.jsx("th",{children:"Maker/Taker"}),o.jsx("th",{children:"Time"})]})}),o.jsx("tbody",{children:r.length===0?o.jsx(Cj,{label:"No fills yet"}):r.map((f,d)=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent((f.ticker||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"mono text-xs hover:underline transition",style:{color:"var(--orange)"},children:f.ticker})}),o.jsx("td",{children:o.jsx("span",{className:`badge ${f.side==="yes"?"bg-green":"bg-red"}`,children:(f.side||"").toUpperCase()})}),o.jsx("td",{className:"text-xs",style:{color:"var(--text-dim)"},children:(f.action||"").toUpperCase()}),o.jsxs("td",{className:"mono",style:{color:"var(--cyan)"},children:[f.yes_price||f.no_price||"—","¢"]}),o.jsx("td",{className:"mono",children:f.count}),o.jsx("td",{children:f.is_taker?o.jsx("span",{className:"badge bg-orange",children:"TAKER"}):o.jsx("span",{className:"badge bg-green",children:"MAKER"})}),o.jsx("td",{className:"mono text-xs",style:{color:"var(--text-muted)"},children:f.created_time?new Date(f.created_time).toLocaleString():"—"})]},d))})]})})]})}function bZ(){const[e,t]=P.useState(null),[r,n]=P.useState(!0);P.useEffect(()=>{a()},[]);async function a(){n(!0);try{const l=await me("/weather",{action:"get_data"});t(l)}catch{}n(!1)}async function i(){n(!0);try{const l=await me("/weather",{action:"fetch_all"});t(l)}catch{}n(!1)}if(r)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})});const s=[{label:"Stations",key:"stations",icon:"📍",color:"var(--cyan)"},{label:"Forecasts",key:"forecasts",icon:"🔮",color:"var(--blue)"},{label:"Observations",key:"observations",icon:"📊",color:"var(--green)"},{label:"Metrics",key:"metrics",icon:"📏",color:"var(--purple)"}];return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"heading text-2xl font-bold flex items-center gap-2",children:[o.jsx("span",{style:{color:"var(--cyan)"},children:"☁"}),o.jsx("span",{className:"gradient-cyan",children:"Weather Markets"})]}),o.jsx("p",{className:"section-subtitle mt-1",children:"NWS settlement data for Ken weather contracts"})]}),o.jsxs("button",{onClick:i,className:"btn btn-p",children:["↻"," Fetch Latest"]})]}),o.jsx("div",{className:"grid grid-cols-4 gap-4",children:s.map(({label:l,key:c,icon:u,color:f})=>o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[o.jsx("span",{className:"text-lg",children:u}),o.jsx("p",{className:"stat-label",children:l})]}),o.jsx("p",{className:"stat-v",style:{color:f},children:(e==null?void 0:e[c])??"—"})]},l))}),o.jsxs("div",{className:"card",children:[o.jsx("h2",{className:"section-title mb-4",children:"Settlement Rule Reference"}),o.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[o.jsxs("div",{className:"rounded-lg p-4",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[o.jsx("p",{className:"stat-label mb-3",children:"Temperature Contracts"}),o.jsx("ul",{className:"space-y-2",children:["Source: NWS Daily Climate Report (final)","Station: Market-specified (e.g. KORD, KLGA)","Values: Tmax/Tmin in degrees F","Missing data: treated as 0"].map((l,c)=>o.jsxs("li",{className:"flex items-start gap-2 text-xs",style:{color:"var(--text-dim)"},children:[o.jsx("span",{style:{color:"var(--cyan)",flexShrink:0},children:"‣"}),l]},c))})]}),o.jsxs("div",{className:"rounded-lg p-4",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[o.jsx("p",{className:"stat-label mb-3",children:"Precipitation Contracts"}),o.jsx("ul",{className:"space-y-2",children:["Source: NWS Daily Climate Report (first complete)","Trace: counted as 0.00 inches","Missing: counted as 0.00 inches","Revisions: do NOT change settlement"].map((l,c)=>o.jsxs("li",{className:"flex items-start gap-2 text-xs",style:{color:"var(--text-dim)"},children:[o.jsx("span",{style:{color:"var(--blue)",flexShrink:0},children:"‣"}),l]},c))})]})]})]}),((e==null?void 0:e.outcomes)||[]).length>0&&o.jsxs("div",{className:"card overflow-x-auto",children:[o.jsx("h2",{className:"section-title mb-4",children:"Recent Observations"}),o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Station"}),o.jsx("th",{children:"Metric"}),o.jsx("th",{children:"Value"}),o.jsx("th",{children:"Source"}),o.jsx("th",{children:"Date"})]})}),o.jsx("tbody",{children:e.outcomes.map((l,c)=>o.jsxs("tr",{className:"fade-in",children:[o.jsx("td",{className:"mono text-sm",style:{color:"var(--cyan)"},children:l.station_id}),o.jsx("td",{children:o.jsx("span",{className:"badge bg-blue",children:l.metric})}),o.jsxs("td",{className:"mono font-bold",style:{color:"var(--text)"},children:[l.value,l.units]}),o.jsx("td",{className:"text-xs",style:{color:"var(--text-muted)"},children:l.source}),o.jsx("td",{className:"text-xs mono",style:{color:"var(--text-muted)"},children:l.period_end})]},c))})]})]}),((e==null?void 0:e.outcomes)||[]).length===0&&o.jsxs("div",{className:"card text-center py-12",style:{border:"1px dashed var(--border)"},children:[o.jsx("p",{className:"text-4xl mb-3",children:"⛅"}),o.jsx("p",{className:"heading text-sm font-semibold mb-1",style:{color:"var(--text-dim)"},children:"No observations loaded"}),o.jsx("p",{className:"text-xs mb-4",style:{color:"var(--text-muted)"},children:'Click "Fetch Latest" to pull current NWS settlement data'}),o.jsx("button",{onClick:i,className:"btn btn-p btn-sm",children:"Fetch Latest"})]})]})}const jZ={aggressive:"#ef4444",conservative:"#3b82f6",weather:"#06b6d4",momentum:"#f59e0b",contrarian:"#a855f7",ai_enhanced:"#ec4899",mc_validated:"#8b5cf6",scalper:"#10b981",patient:"#6366f1",random:"#f97316",penny_pincher:"#84cc16",spray_pray:"#14b8a6",nickel_slots:"#eab308",degen_lite:"#e11d48",politics_junkie:"#7c3aed",double_down:"#dc2626",volatility_rider:"#0ea5e9",whale:"#1d4ed8",yolo:"#be123c",full_send:"#ea580c",kelly_criterion:"#4f46e5",sharpe_sniper:"#059669",bayesian_blend:"#7c3aed",ensemble_lock:"#0891b2",mean_revert:"#4338ca",info_ratio:"#b45309",anti_fomo:"#64748b",nightcrawler:"#334155",heatseeker:"#dc2626",quant_core:"#2563eb"},wZ="#F7931A";function ZO(e){return e.startsWith("etf_")?wZ:jZ[e]||"#6b7280"}function SZ({won:e,lost:t,total:r}){if(!r)return o.jsx("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:"no trades"});const n=e/r*100,a=t/r*100;return o.jsxs("div",{className:"flex h-1.5 rounded-full overflow-hidden w-full",style:{background:"var(--border)"},children:[e>0&&o.jsx("div",{style:{width:`${n}%`,background:"var(--green)"}}),t>0&&o.jsx("div",{style:{width:`${a}%`,background:"var(--red)"}})]})}function _Z({streak:e}){if(e===0)return o.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.7rem"},children:"—"});const t=e>0;return o.jsxs("span",{className:"mono font-bold text-xs",style:{color:t?"var(--green)":"var(--red)"},children:[t?"+":"",e]})}const kZ=e=>e==="BUY_YES"?"YES":"NO",OZ=e=>e==="BUY_YES"?"bg-green":"bg-red",NZ=e=>e>=0?"var(--green)":"var(--red)";function Ej({trades:e,loading:t}){return t?o.jsx("div",{className:"flex justify-center py-4",children:o.jsx("div",{className:"w-5 h-5 rounded-full border-2 animate-spin",style:{borderColor:"var(--border)",borderTopColor:"var(--cyan)"}})}):!e||e.length===0?o.jsx("p",{className:"text-xs text-center py-3",style:{color:"var(--text-muted)"},children:"No trades found for this portfolio"}):o.jsx("div",{className:"overflow-x-auto",style:{maxHeight:240,overflowY:"auto"},children:o.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"0.7rem"},children:[o.jsx("thead",{children:o.jsx("tr",{style:{borderBottom:"1px solid var(--border)"},children:["Market","Dir","Entry","Qty","Cost","P&L","Status"].map(r=>o.jsx("th",{style:{padding:"4px 6px",textAlign:"left",color:"var(--text-muted)",fontWeight:600,fontFamily:"var(--font-body)",fontSize:"0.65rem",whiteSpace:"nowrap"},children:r},r))})}),o.jsx("tbody",{children:e.map((r,n)=>{const a=parseInt(r.pnl_cents)||0,i=parseInt(r.cost_cents)||0,s=parseInt(r.entry_price_cents)||0,l=parseInt(r.contracts)||0,c=r.status||"open";return o.jsxs("tr",{style:{borderBottom:"1px solid var(--border)",background:n%2===0?"transparent":"rgba(255,255,255,0.01)"},children:[o.jsxs("td",{style:{padding:"4px 6px",maxWidth:140,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--text-dim)",fontFamily:"var(--font-body)"},title:r.market_title||r.market_id,children:[(r.market_title||r.market_id||"").substring(0,28),(r.market_title||r.market_id||"").length>28?"...":""]}),o.jsx("td",{style:{padding:"4px 6px"},children:o.jsx("span",{className:`badge ${OZ(r.direction)}`,style:{fontSize:"0.6rem",padding:"1px 5px"},children:kZ(r.direction)})}),o.jsxs("td",{style:{padding:"4px 6px",fontFamily:"'JetBrains Mono', monospace",color:"var(--orange)"},children:[s,"¢"]}),o.jsx("td",{style:{padding:"4px 6px",fontFamily:"'JetBrains Mono', monospace",color:"var(--text-dim)"},children:l}),o.jsxs("td",{style:{padding:"4px 6px",fontFamily:"'JetBrains Mono', monospace",color:"var(--text-dim)"},children:["$",(i/100).toFixed(2)]}),o.jsx("td",{style:{padding:"4px 6px",fontFamily:"'JetBrains Mono', monospace",fontWeight:700,color:NZ(a)},children:a!==0?`${a>=0?"+":""}$${(a/100).toFixed(2)}`:"—"}),o.jsx("td",{style:{padding:"4px 6px"},children:o.jsx("span",{className:`badge ${c==="open"?"bg-blue":c==="closed"?"bg-green":"bg-orange"}`,style:{fontSize:"0.6rem",padding:"1px 5px"},children:c})})]},r.id||n)})})]})})}function PZ({p:e,dailyPnl:t,expanded:r,onToggle:n,pfTrades:a,pfTradesLoading:i}){const s=(e.total_returned_cents-e.total_invested_cents)/100,l=e.trades_won+e.trades_lost+e.trades_expired,c=e.total_invested_cents/100,u=e.total_returned_cents/100,f=l>0,d=ZO(e.strategy),h=Math.min(100,e.daily_budget_cents/Math.max(1,1e5)*100);return o.jsxs("div",{className:"card cursor-pointer transition-all",style:r?{borderColor:"var(--cyan)",boxShadow:"0 0 20px var(--cyan-glow)",opacity:1}:f?{opacity:1}:{opacity:.5},onClick:n,children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx("div",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{background:d}}),o.jsx("span",{className:"heading font-semibold text-sm truncate",style:{color:"var(--text)"},children:e.name}),o.jsxs("span",{className:"mono text-xs flex-shrink-0",style:{color:"var(--text-muted)"},children:["#",e.id]}),l>0&&o.jsxs("span",{className:"text-xs flex-shrink-0 px-1.5 py-0.5 rounded",style:{background:"var(--surface-el)",color:"var(--text-muted)",fontSize:"0.65rem"},children:[l," trade",l!==1?"s":""]})]}),o.jsxs("span",{className:"mono text-sm font-bold flex-shrink-0 ml-2",style:{color:s>=0?"var(--green)":"var(--red)"},children:[s>=0?"+":"","$",s.toFixed(2)]})]}),o.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[o.jsx("span",{className:"mono px-1.5 py-0.5 rounded text-xs flex-shrink-0",style:{background:`${d}15`,color:d,border:`1px solid ${d}30`},children:e.strategy}),o.jsx(_Z,{streak:e.streak}),o.jsx("div",{className:"flex-1"}),o.jsx("span",{className:"badge flex-shrink-0",style:f?{background:"var(--green-dim)",color:"var(--green)"}:{background:"var(--border)",color:"var(--text-muted)"},children:f?"Active":"Dormant"})]}),o.jsxs("div",{className:"mb-3",children:[o.jsx(SZ,{won:e.trades_won,lost:e.trades_lost,total:l}),o.jsxs("div",{className:"flex justify-between mt-1",children:[o.jsxs("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:[e.trades_won,"W / ",e.trades_lost,"L"]}),o.jsxs("span",{className:"mono text-xs",style:{color:"var(--text-dim)"},children:[e.win_rate||0,"%"]})]})]}),o.jsxs("div",{className:"mb-3",children:[o.jsxs("div",{className:"flex justify-between text-xs mb-1",style:{color:"var(--text-muted)"},children:[o.jsx("span",{children:"Daily Budget"}),o.jsxs("span",{className:"mono",style:{color:"var(--text-dim)"},children:["$",(e.daily_budget_cents/100).toFixed(2)]})]}),o.jsx("div",{className:"progress-bar",children:o.jsx("div",{className:"progress-fill",style:{width:`${h}%`,background:`linear-gradient(90deg, ${d}, ${d}99)`}})})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-x-3 gap-y-1",style:{fontSize:"0.7rem"},children:[o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"Invested"}),o.jsxs("span",{className:"mono",style:{color:"var(--text-dim)"},children:["$",c.toFixed(2)]})]}),o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"Returned"}),o.jsxs("span",{className:"mono",style:{color:"var(--text-dim)"},children:["$",u.toFixed(2)]})]}),o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"Trades Today"}),o.jsx("span",{className:"mono",style:{color:"var(--cyan)"},children:e.trades_today})]}),o.jsxs("div",{className:"flex justify-between",children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"Total"}),o.jsx("span",{className:"mono",style:{color:"var(--text-dim)"},children:l})]})]}),r&&t&&t.length>0&&o.jsxs("div",{className:"mt-3 pt-3",style:{borderTop:"1px solid var(--border)"},children:[o.jsx("p",{className:"text-xs mb-1",style:{color:"var(--text-muted)"},children:"Cumulative P&L"}),o.jsx(tr,{width:"100%",height:80,children:o.jsxs(Jy,{data:t,children:[o.jsx(or,{dataKey:"date",hide:!0}),o.jsx(sr,{hide:!0,domain:["dataMin","dataMax"]}),o.jsx(Ge,{contentStyle:{background:"var(--surface-el)",border:"1px solid var(--border)",borderRadius:8,fontSize:11,fontFamily:"var(--font-mono)"},formatter:p=>[`$${(p/100).toFixed(2)}`,"P&L"],labelFormatter:p=>p}),o.jsx(Lr,{type:"monotone",dataKey:"cumulative",stroke:d,fill:d,fillOpacity:.1,strokeWidth:1.5,dot:!1})]})}),e.description&&o.jsx("p",{className:"text-xs mt-1",style:{color:"var(--text-muted)"},children:e.description}),o.jsxs("div",{className:"mt-3 pt-3",style:{borderTop:"1px solid var(--border)"},children:[o.jsx("p",{className:"text-xs mb-2 font-semibold",style:{color:"var(--cyan)"},children:"Individual Trades"}),o.jsx(Ej,{trades:a,loading:i})]})]}),r&&(!t||t.length===0)&&o.jsxs("div",{className:"mt-3 pt-3",style:{borderTop:"1px solid var(--border)"},children:[o.jsx("p",{className:"text-xs mb-2 font-semibold",style:{color:"var(--cyan)"},children:"Individual Trades"}),o.jsx(Ej,{trades:a,loading:i})]})]})}function AZ(){return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"w-9 h-9 rounded-full border-2 animate-spin",style:{borderColor:"var(--border)",borderTopColor:"var(--cyan)"}})})}function CZ(){const[e,t]=P.useState([]),[r,n]=P.useState({}),[a,i]=P.useState(!0),[s,l]=P.useState("all"),[c,u]=P.useState("pnl"),[f,d]=P.useState(null),[h,p]=P.useState({}),[g,y]=P.useState(null);P.useEffect(()=>{b()},[]);async function b(){try{const[N,k]=await Promise.all([Oe("/portfolios"),Oe("/portfolio-trades?include_history=true").catch(()=>({}))]);t(N||[]),k!=null&&k.byPortfolio&&n(k.byPortfolio)}catch{}i(!1)}async function v(N){if(!h[N]){y(N);try{const k=await Oe(`/portfolio-trades?portfolio_id=${N}`);p(E=>({...E,[N]:Array.isArray(k)?k:[]}))}catch{p(k=>({...k,[N]:[]}))}y(null)}}function m(N){f===N?d(null):(d(N),v(N))}const x=P.useMemo(()=>{let N=[...e];return s==="active"&&(N=N.filter(k=>k.trades_won+k.trades_lost>0)),s==="dormant"&&(N=N.filter(k=>k.trades_won+k.trades_lost===0)),s==="etf"&&(N=N.filter(k=>k.strategy.startsWith("etf_"))),s==="core"&&(N=N.filter(k=>!k.strategy.startsWith("etf_"))),c==="pnl"&&N.sort((k,E)=>E.total_returned_cents-E.total_invested_cents-(k.total_returned_cents-k.total_invested_cents)),c==="winrate"&&N.sort((k,E)=>(E.win_rate||0)-(k.win_rate||0)),c==="invested"&&N.sort((k,E)=>E.total_invested_cents-k.total_invested_cents),c==="name"&&N.sort((k,E)=>k.name.localeCompare(E.name)),c==="id"&&N.sort((k,E)=>k.id-E.id),N},[e,s,c]),S=P.useMemo(()=>{const N=e.reduce((M,I)=>M+I.total_invested_cents,0),k=e.reduce((M,I)=>M+I.total_returned_cents,0),E=e.reduce((M,I)=>M+I.trades_won,0),T=e.reduce((M,I)=>M+I.trades_lost,0),D=e.filter(M=>M.trades_won+M.trades_lost>0).length,A=e.length-D,L=[...e].sort((M,I)=>I.total_returned_cents-I.total_invested_cents-(M.total_returned_cents-M.total_invested_cents))[0],C=[...e].sort((M,I)=>M.total_returned_cents-M.total_invested_cents-(I.total_returned_cents-I.total_invested_cents))[0];return{totalInvested:N,totalReturned:k,totalWins:E,totalLosses:T,active:D,dormant:A,bestPf:L,worstPf:C}},[e]),j=P.useMemo(()=>[...e].map(N=>({name:N.name,pnl:(N.total_returned_cents-N.total_invested_cents)/100,strategy:N.strategy})).filter(N=>N.pnl!==0).sort((N,k)=>k.pnl-N.pnl).slice(0,20),[e]),w=P.useMemo(()=>{const N={};return e.forEach(k=>{const E=k.strategy.startsWith("etf_")?"ETF Baskets":k.strategy;N[E]||(N[E]={name:E,value:0}),N[E].value+=k.total_invested_cents}),Object.values(N).filter(k=>k.value>0).sort((k,E)=>E.value-k.value)},[e]);if(a)return o.jsx(AZ,{});const _=(S.totalReturned-S.totalInvested)/100,O=S.totalWins+S.totalLosses;return o.jsxs("div",{className:"space-y-6 fade-in",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"heading text-3xl",style:{color:"var(--text)"},children:["Portfauxlios",o.jsx("span",{className:"badge bg-cyan ml-3 align-middle text-base",children:e.length})]}),o.jsxs("p",{className:"section-subtitle mt-1",children:["All ",e.length," portfolios — performance, P&L, and strategy breakdown"]})]}),o.jsx("button",{onClick:b,className:"btn btn-o btn-sm",children:"Refresh"})]}),o.jsx("div",{className:"grid grid-cols-3 md:grid-cols-6 gap-3",children:[{label:"Total P&L",value:`${_>=0?"+":""}$${_.toFixed(2)}`,color:_>=0?"var(--green)":"var(--red)"},{label:"Invested",value:`$${(S.totalInvested/100).toFixed(2)}`,color:"var(--orange)"},{label:"Returned",value:`$${(S.totalReturned/100).toFixed(2)}`,color:"var(--blue)"},{label:"Win Rate",value:O?`${(S.totalWins/O*100).toFixed(1)}%`:"0%",color:"var(--purple)"},{label:"Active",value:S.active,color:"var(--green)"},{label:"Dormant",value:S.dormant,color:"var(--text-muted)"}].map(N=>o.jsxs("div",{className:"card text-center",style:{padding:"1rem"},children:[o.jsx("div",{className:"stat-v",style:{color:N.color,fontSize:"1.4rem"},children:N.value}),o.jsx("div",{className:"stat-label mt-1",children:N.label})]},N.label))}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[o.jsxs("div",{className:"card md:col-span-2",children:[o.jsx("h2",{className:"heading text-sm mb-3",style:{color:"var(--text-dim)"},children:"P&L by Portfolio"}),j.length>0?o.jsx(tr,{width:"100%",height:220,children:o.jsxs(_l,{data:j,margin:{left:10,right:10},children:[o.jsx(or,{dataKey:"name",tick:{fill:"var(--text-muted)",fontSize:9,fontFamily:"var(--font-mono)"},angle:-45,textAnchor:"end",height:60}),o.jsx(sr,{tick:{fill:"var(--text-muted)",fontSize:10,fontFamily:"var(--font-mono)"},tickFormatter:N=>`$${N}`}),o.jsx(Ge,{contentStyle:{background:"var(--surface-el)",border:"1px solid var(--border)",borderRadius:8,fontSize:11,fontFamily:"var(--font-mono)"},formatter:N=>[`$${N.toFixed(2)}`,"P&L"]}),o.jsx(nr,{dataKey:"pnl",radius:[4,4,0,0],children:j.map((N,k)=>o.jsx(xr,{fill:N.pnl>=0?"var(--green)":"var(--red)",fillOpacity:.8},k))})]})}):o.jsx("div",{className:"text-center py-10 text-sm",style:{color:"var(--text-muted)"},children:"No P&L data yet"})]}),o.jsxs("div",{className:"card",children:[o.jsx("h2",{className:"heading text-sm mb-3",style:{color:"var(--text-dim)"},children:"Capital Allocation"}),w.length>0?o.jsx(tr,{width:"100%",height:220,children:o.jsxs(Qy,{children:[o.jsx(wr,{data:w,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",innerRadius:40,outerRadius:75,paddingAngle:2,strokeWidth:0,children:w.map((N,k)=>o.jsx(xr,{fill:ZO(N.name==="ETF Baskets"?"etf_":N.name),fillOpacity:.85},k))}),o.jsx(Ge,{contentStyle:{background:"var(--surface-el)",border:"1px solid var(--border)",borderRadius:8,fontSize:11,fontFamily:"var(--font-mono)"},formatter:N=>[`$${(N/100).toFixed(2)}`,"Invested"]})]})}):o.jsx("div",{className:"text-center py-10 text-sm",style:{color:"var(--text-muted)"},children:"No allocations yet"})]})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[S.bestPf&&o.jsxs("div",{className:"card",style:{borderColor:"rgba(0,195,137,0.25)",background:"var(--green-dim)"},children:[o.jsx("div",{className:"flex items-center gap-2 mb-2",children:o.jsx("span",{className:"badge",style:{background:"var(--green-dim)",color:"var(--green)"},children:"Best Performer"})}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"heading font-bold",style:{color:"var(--text)"},children:S.bestPf.name}),o.jsxs("span",{className:"mono font-bold text-green",children:["+$",((S.bestPf.total_returned_cents-S.bestPf.total_invested_cents)/100).toFixed(2)]})]}),o.jsxs("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:[S.bestPf.strategy," — ",S.bestPf.win_rate||0,"% win rate"]})]}),S.worstPf&&o.jsxs("div",{className:"card",style:{borderColor:"rgba(255,92,92,0.25)",background:"var(--red-dim)"},children:[o.jsx("div",{className:"flex items-center gap-2 mb-2",children:o.jsx("span",{className:"badge",style:{background:"var(--red-dim)",color:"var(--red)"},children:"Worst Performer"})}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"heading font-bold",style:{color:"var(--text)"},children:S.worstPf.name}),o.jsxs("span",{className:"mono font-bold text-red",children:["$",((S.worstPf.total_returned_cents-S.worstPf.total_invested_cents)/100).toFixed(2)]})]}),o.jsxs("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:[S.worstPf.strategy," — ",S.worstPf.win_rate||0,"% win rate"]})]})]}),o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[o.jsx("div",{className:"flex flex-wrap gap-2",children:["all","active","dormant","etf","core"].map(N=>o.jsx("button",{onClick:()=>l(N),className:"px-3 py-1.5 rounded-lg text-xs font-semibold transition",style:s===N?{background:"var(--cyan-dim)",color:"var(--cyan)",border:"1px solid rgba(0,240,255,0.3)"}:{background:"var(--surface-el)",color:"var(--text-muted)",border:"1px solid var(--border)"},children:N==="all"?`All (${e.length})`:N==="active"?`Active (${S.active})`:N==="dormant"?`Dormant (${S.dormant})`:N==="etf"?"ETF Baskets":"Core Strategies"},N))}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Sort:"}),["pnl","winrate","invested","name","id"].map(N=>o.jsx("button",{onClick:()=>u(N),className:"px-2 py-1 rounded text-xs font-medium transition",style:c===N?{color:"var(--cyan)",background:"var(--cyan-dim)"}:{color:"var(--text-muted)"},children:N==="pnl"?"P&L":N==="winrate"?"Win%":N.charAt(0).toUpperCase()+N.slice(1)},N))]})]}),x.length===0?o.jsx("div",{className:"text-center py-16 text-sm",style:{color:"var(--text-muted)"},children:"No portfolios match this filter"}):o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3",children:x.map(N=>{var k;return o.jsx(PZ,{p:N,dailyPnl:((k=r[N.id])==null?void 0:k.daily)||[],expanded:f===N.id,onToggle:()=>m(N.id),pfTrades:h[N.id]||null,pfTradesLoading:g===N.id},N.id)})})]})}const EZ=[{label:"30s",ms:3e4},{label:"1m",ms:6e4},{label:"2m",ms:12e4},{label:"5m",ms:3e5},{label:"8m",ms:48e4},{label:"10m",ms:6e5},{label:"15m",ms:9e5},{label:"30m",ms:18e5},{label:"60m",ms:36e5}];function $Z(e){return e>=36e5?`${e/36e5}h`:e>=6e4?`${e/6e4}m`:`${e/1e3}s`}function TZ(){return o.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"3"}),o.jsx("path",{d:"M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z"})]})}function yh({title:e,children:t}){return o.jsxs("div",{className:"card space-y-4",children:[o.jsx("h2",{className:"heading font-semibold text-base pb-3",style:{color:"var(--text)",borderBottom:"1px solid var(--border)"},children:e}),t]})}function Hm({label:e,description:t,children:r}){return o.jsxs("div",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm font-medium",style:{color:"var(--text)"},children:e}),t&&o.jsx("p",{className:"text-xs mt-0.5",style:{color:"var(--text-muted)"},children:t})]}),o.jsx("div",{className:"flex-shrink-0",children:r})]})}function lc({label:e,value:t,onChange:r,description:n}){return o.jsxs("div",{className:"space-y-2",children:[o.jsx(Hm,{label:e,description:n,children:o.jsx("span",{className:"mono font-bold text-lg",style:{color:"var(--cyan)"},children:$Z(t)})}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:EZ.map(a=>o.jsx("button",{onClick:()=>r(a.ms),className:"px-2.5 py-1 rounded text-xs font-medium transition",style:t===a.ms?{background:"var(--cyan-dim)",color:"var(--cyan)",border:"1px solid rgba(0,240,255,0.4)"}:{background:"var(--surface-el)",color:"var(--text-muted)",border:"1px solid var(--border)"},children:a.label},a.ms))})]})}function $j({msg:e}){return e?o.jsx("p",{className:"text-xs px-3 py-2 rounded-lg",style:e.type==="ok"?{background:"var(--green-dim)",color:"var(--green)"}:{background:"var(--red-dim)",color:"var(--red)"},children:e.text}):null}function MZ(){return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"w-9 h-9 rounded-full border-2 animate-spin",style:{borderColor:"var(--border)",borderTopColor:"var(--cyan)"}})})}function IZ(){const[e,t]=P.useState(null),[r,n]=P.useState(!0),[a,i]=P.useState(""),[s,l]=P.useState(""),[c,u]=P.useState("demo"),[f,d]=P.useState(!1),[h,p]=P.useState(null),[g,y]=P.useState(null),[b,v]=P.useState(null),[m,x]=P.useState(!1);P.useEffect(()=>{S(),j();const k=setInterval(j,3e4);return()=>clearInterval(k)},[]);async function S(){try{const k=await me("/kalshi",{action:"status"});t(k),k.env&&u(k.env)}catch{}n(!1)}async function j(){try{const k=await Oe("/scan-config");y(k)}catch{}}async function w(k,E){x(!0),v(null);try{const T=await Oe("/scan-config",{method:"POST",body:JSON.stringify({[k]:E})});T.success?(y(T),v({type:"ok",text:`Updated ${k.replace(/_/g," ")}`})):v({type:"err",text:T.error||"Failed"})}catch{v({type:"err",text:"Connection error"})}x(!1),setTimeout(()=>v(null),3e3)}async function _(){d(!0),p(null);try{const k=await me("/kalshi",{action:"save_keys",api_key:a,private_key:s,env:c});k.success?(p({type:"ok",text:"Keys saved and connected"}),S(),i(""),l("")):p({type:"err",text:k.error||"Failed"})}catch{p({type:"err",text:"Connection error"})}d(!1)}async function O(){try{await me("/kalshi",{action:"disconnect"}),S()}catch{}}async function N(){p(null);try{const k=await me("/kalshi",{action:"test_connection"});p({type:k.success?"ok":"err",text:k.success?`Connected. Exchange: ${k.exchange_status}`:"Connection failed"})}catch{p({type:"err",text:"Connection error"})}}return r?o.jsx(MZ,{}):o.jsxs("div",{className:"space-y-6 fade-in",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-xl",style:{background:"var(--cyan-dim)",color:"var(--cyan)"},children:o.jsx(TZ,{})}),o.jsxs("div",{children:[o.jsx("h1",{className:"heading text-3xl",style:{color:"var(--text)"},children:"Settings"}),o.jsx("p",{className:"section-subtitle mt-0.5",children:"Configure scan pipeline, API keys, and risk parameters"})]})]}),g&&o.jsxs(yh,{title:"Scan & Pipeline Configuration",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"Adjust intervals, thresholds, and risk parameters in real-time"}),m&&o.jsx("span",{className:"text-xs animate-pulse",style:{color:"var(--orange)"},children:"Saving..."})]}),o.jsx($j,{msg:b}),o.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[o.jsx("span",{className:"stat-label",children:"Cached Markets"}),o.jsx("span",{className:"mono font-bold text-xl",style:{color:"var(--cyan)"},children:g.cached_markets||0}),o.jsx("div",{className:"w-2 h-2 rounded-full pulse-cyan ml-auto",style:{background:"var(--cyan)"}})]}),o.jsxs("div",{className:"space-y-5 pt-2 pb-1",style:{borderTop:"1px solid var(--border)"},children:[o.jsx("h3",{className:"text-sm font-semibold pt-3",style:{color:"var(--text-dim)"},children:"Pipeline Intervals"}),o.jsx(lc,{label:"Market Scan",description:"How often to fetch and analyze all active Kalshi markets",value:g.scan_interval_ms,onChange:k=>w("scan_interval_ms",k)}),o.jsx(lc,{label:"Signal Pipeline",description:"News sentiment + probability + Monte Carlo signal generation",value:g.signal_pipeline_ms,onChange:k=>w("signal_pipeline_ms",k)}),o.jsx(lc,{label:"Intelligence Sweep",description:"Reddit, news feeds, Bluesky, Mastodon, Lemmy + 20 more sources",value:g.reddit_interval_ms,onChange:k=>w("reddit_interval_ms",k)}),o.jsx(lc,{label:"Trade Resolution",description:"Take-profit / stop-loss check on open portfolio positions",value:g.resolve_interval_ms,onChange:k=>w("resolve_interval_ms",k)})]}),o.jsxs("div",{className:"space-y-5",style:{borderTop:"1px solid var(--border)",paddingTop:"1rem"},children:[o.jsx("h3",{className:"text-sm font-semibold",style:{color:"var(--text-dim)"},children:"Risk Parameters"}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Hm,{label:"Min Edge Threshold",description:"Minimum statistical edge required to approve a signal",children:o.jsxs("span",{className:"mono font-bold text-lg",style:{color:"var(--cyan)"},children:[(g.min_edge_threshold*100).toFixed(1),"%"]})}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:[.01,.02,.03,.05,.08,.1,.15,.2].map(k=>o.jsxs("button",{onClick:()=>w("min_edge_threshold",k),className:"px-2.5 py-1 rounded text-xs font-medium transition",style:Math.abs(g.min_edge_threshold-k)<.001?{background:"var(--cyan-dim)",color:"var(--cyan)",border:"1px solid rgba(0,240,255,0.4)"}:{background:"var(--surface-el)",color:"var(--text-muted)",border:"1px solid var(--border)"},children:[(k*100).toFixed(0),"%"]},k))})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Hm,{label:"Min Liquidity (24h Vol)",description:"Minimum 24-hour trading volume to consider a market",children:o.jsx("span",{className:"mono font-bold text-lg",style:{color:"var(--cyan)"},children:g.min_liquidity})}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:[0,10,25,50,100,250,500,1e3].map(k=>o.jsx("button",{onClick:()=>w("min_liquidity",k),className:"px-2.5 py-1 rounded text-xs font-medium transition",style:g.min_liquidity===k?{background:"var(--cyan-dim)",color:"var(--cyan)",border:"1px solid rgba(0,240,255,0.4)"}:{background:"var(--surface-el)",color:"var(--text-muted)",border:"1px solid var(--border)"},children:k===0?"None":k},k))})]})]})]}),o.jsxs(yh,{title:"API Configuration",children:[o.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[o.jsx("div",{className:`w-2.5 h-2.5 rounded-full ${e!=null&&e.connected?"pulse-cyan":""}`,style:{background:e!=null&&e.connected?"var(--cyan)":"var(--text-muted)"}}),o.jsx("span",{className:"text-sm font-semibold",style:{color:e!=null&&e.connected?"var(--cyan)":"var(--text-muted)"},children:e!=null&&e.connected?"Connected":"Not Connected"})]}),e!=null&&e.connected?o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"rounded-xl px-4 py-3 space-y-2",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[o.jsxs("div",{className:"flex justify-between text-sm",children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"API Key"}),o.jsx("span",{className:"mono",style:{color:"var(--text)"},children:e.api_key_masked||"•••••"})]}),o.jsxs("div",{className:"flex justify-between text-sm",children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"Environment"}),o.jsx("span",{className:"mono font-bold",style:{color:e.env==="prod"?"var(--green)":"var(--orange)"},children:(e.env||"demo").toUpperCase()})]})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("button",{onClick:N,className:"btn btn-o btn-sm",children:"Test Connection"}),o.jsx("button",{onClick:O,className:"btn btn-d btn-sm",children:"Disconnect"})]})]}):o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex gap-2",children:[o.jsx("button",{onClick:()=>u("demo"),className:"flex-1 py-2 rounded-xl text-sm font-semibold transition",style:c==="demo"?{background:"var(--orange-dim)",color:"var(--orange)",border:"1px solid rgba(247,147,26,0.4)"}:{background:"var(--surface-el)",color:"var(--text-muted)",border:"1px solid var(--border)"},children:"Demo"}),o.jsx("button",{onClick:()=>u("prod"),className:"flex-1 py-2 rounded-xl text-sm font-semibold transition",style:c==="prod"?{background:"var(--green-dim)",color:"var(--green)",border:"1px solid rgba(0,195,137,0.4)"}:{background:"var(--surface-el)",color:"var(--text-muted)",border:"1px solid var(--border)"},children:"Production"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"stat-label block mb-1.5",children:"API Key ID"}),o.jsx("input",{type:"text",value:a,onChange:k=>i(k.target.value),placeholder:"Your API key",className:"input mono"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"stat-label block mb-1.5",children:"Private Key (PEM)"}),o.jsx("textarea",{value:s,onChange:k=>l(k.target.value),placeholder:"-----BEGIN RSA PRIVATE KEY-----",rows:4,className:"input mono text-xs",style:{resize:"vertical"}})]}),o.jsx("button",{onClick:_,disabled:f||!a,className:"btn btn-p w-full",style:f||!a?{opacity:.5,cursor:"not-allowed"}:{},children:f?"Saving...":"Save & Connect"})]}),o.jsx($j,{msg:h})]}),o.jsx(yh,{title:"Ken API Reference",children:o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 text-xs",style:{color:"var(--text-muted)"},children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"stat-label mb-2",children:"Environments"}),o.jsxs("div",{className:"space-y-1",children:[o.jsxs("div",{className:"flex gap-2",children:[o.jsx("span",{children:"Demo:"}),o.jsx("span",{className:"mono",style:{color:"var(--orange)"},children:"demo-api.kalshi.co"})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("span",{children:"Prod:"}),o.jsx("span",{className:"mono",style:{color:"var(--green)"},children:"api.elections.kalshi.com"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"stat-label mb-2",children:"Authentication"}),o.jsxs("div",{className:"space-y-1",children:[o.jsxs("div",{className:"flex gap-2",children:[o.jsx("span",{children:"Method:"}),o.jsx("span",{className:"mono",style:{color:"var(--text-dim)"},children:"RSA-PSS + SHA-256"})]}),o.jsxs("div",{children:[o.jsx("span",{children:"Headers: "}),o.jsx("span",{className:"mono",style:{color:"var(--text-dim)"},children:"KALSHI-ACCESS-KEY, TIMESTAMP, SIGNATURE"})]})]})]})]})})]})}const LZ={BUY_YES:"bg-green",BUY_NO:"bg-red"};function DZ(e){if(!e)return null;const t=e.match(/on\s+"([^"]+)"/);return t?t[1]:null}function RZ({value:e}){const t=Math.max(0,Math.min(100,e*100)),r=e>.7?"var(--green)":e>.5?"var(--orange)":"var(--red)";return o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"progress-bar flex-1",style:{minWidth:64},children:o.jsx("div",{className:"progress-fill",style:{width:`${t}%`,background:`linear-gradient(90deg, ${r}, ${r}cc)`}})}),o.jsxs("span",{className:"mono text-xs",style:{color:"var(--text-dim)"},children:[t.toFixed(0),"%"]})]})}function BZ({s:e}){const[t,r]=P.useState(!1),n=DZ(e.reasoning)||e.market_id,a=parseFloat(e.expected_edge)||0,i=parseFloat(e.confidence)||0;return o.jsxs(o.Fragment,{children:[o.jsxs("tr",{className:"cursor-pointer transition",onClick:()=>r(!t),style:{background:t?"rgba(0,240,255,0.04)":void 0},children:[o.jsx("td",{className:"whitespace-nowrap",children:o.jsx("span",{className:"mono text-xs",style:{color:"var(--text-muted)"},children:new Date(e.created_at).toLocaleTimeString()})}),o.jsxs("td",{className:"max-w-[280px]",children:[o.jsx("a",{href:e.kalshi_url||`https://kalshi.com/search?query=${encodeURIComponent((e.market_id||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"text-sm truncate block hover:underline transition heading",style:{color:"var(--cyan)"},onClick:s=>s.stopPropagation(),children:n}),o.jsx("span",{className:"mono text-[10px]",style:{color:"var(--text-muted)"},children:e.market_id})]}),o.jsx("td",{children:o.jsx("span",{className:`badge ${LZ[e.direction]||"bg-yellow"}`,children:e.direction})}),o.jsx("td",{children:o.jsxs("span",{className:"mono font-bold text-base",style:{color:a>0?"var(--cyan)":"var(--red)"},children:[a>0?"+":"",(a*100).toFixed(1),"%"]})}),o.jsx("td",{children:o.jsx("span",{className:"mono text-sm",style:{color:"var(--text-dim)"},children:e.size_recommendation||"—"})}),o.jsx("td",{style:{minWidth:140},children:o.jsx(RZ,{value:i})}),o.jsx("td",{children:o.jsx("span",{className:`badge ${e.risk_approved?"bg-green":"bg-red"}`,children:e.risk_approved?"APPROVED":"BLOCKED"})}),o.jsx("td",{children:o.jsx("span",{style:{color:"var(--text-muted)"},children:t?"▾":"▸"})})]}),t&&o.jsx("tr",{style:{background:"rgba(0,240,255,0.02)"},children:o.jsxs("td",{colSpan:8,className:"px-4 py-3",children:[o.jsx("p",{className:"text-xs leading-relaxed fade-in",style:{color:"var(--text-dim)"},children:e.reasoning}),e.sources&&o.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:(typeof e.sources=="string"?e.sources.split(","):Array.isArray(e.sources)?e.sources:[]).map((s,l)=>o.jsx("span",{className:"badge bg-blue text-[10px]",children:s.trim()},l))})]})})]})}function FZ({s:e}){const t=parseFloat(e.edge)||0,r=parseFloat(e.sentiment_impact)||0,n=e.market_title||e.market_id;return o.jsxs("tr",{children:[o.jsx("td",{className:"whitespace-nowrap",children:o.jsx("span",{className:"mono text-xs",style:{color:"var(--text-muted)"},children:new Date(e.created_at).toLocaleTimeString()})}),o.jsxs("td",{className:"max-w-[250px]",children:[o.jsx("a",{href:e.kalshi_url||`https://kalshi.com/search?query=${encodeURIComponent((e.market_id||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"text-sm truncate block hover:underline transition heading",style:{color:"var(--cyan)"},children:n}),o.jsx("span",{className:"mono text-[10px]",style:{color:"var(--text-muted)"},children:e.market_id})]}),o.jsx("td",{children:o.jsxs("span",{className:"mono text-sm",style:{color:"var(--text-dim)"},children:[(parseFloat(e.prior_probability)*100).toFixed(1),"%"]})}),o.jsx("td",{children:o.jsxs("span",{className:"mono text-sm font-semibold",style:{color:r>0?"var(--green)":"var(--red)"},children:[r>0?"+":"",(r*100).toFixed(2),"%"]})}),o.jsx("td",{children:o.jsxs("span",{className:"mono text-sm",style:{color:"var(--orange)"},children:[(parseFloat(e.adjusted_probability)*100).toFixed(1),"%"]})}),o.jsx("td",{children:o.jsxs("span",{className:"mono text-sm",style:{color:"var(--text-dim)"},children:[(parseFloat(e.market_probability)*100).toFixed(1),"%"]})}),o.jsx("td",{children:o.jsxs("span",{className:"mono text-sm font-bold",style:{color:t>0?"var(--green)":t<0?"var(--red)":"var(--text-muted)"},children:[t>0?"+":"",(t*100).toFixed(1),"%"]})}),o.jsx("td",{children:o.jsx("span",{className:"mono text-xs",style:{color:"var(--text-muted)"},children:e.num_articles})})]})}function zZ({s:e}){const t=parseFloat(e.avg_sent)||0;return o.jsxs("div",{className:"card flex items-center justify-between",style:{padding:"0.75rem 1rem"},children:[o.jsx("span",{className:"text-sm font-medium heading",children:e.source}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("span",{className:"mono text-xs",style:{color:"var(--text-muted)"},children:[e.cnt," items"]}),o.jsxs("span",{className:"mono text-xs font-bold",style:{color:t>.05?"var(--green)":t<-.05?"var(--red)":"var(--text-muted)"},children:[t>0?"+":"",(t*100).toFixed(0),"%"]})]})]})}function za({label:e,value:t,color:r}){return o.jsxs("div",{className:"card",children:[o.jsx("p",{className:"stat-label mb-2",children:e}),o.jsx("p",{className:"stat-v",style:{color:r},children:t})]})}function gh({active:e,onClick:t,children:r}){return o.jsx("button",{onClick:t,className:"btn btn-sm transition",style:{background:e?"var(--cyan-dim)":"transparent",color:e?"var(--cyan)":"var(--text-muted)",border:e?"1px solid rgba(0,240,255,0.3)":"1px solid transparent",borderRadius:"var(--radius-md)"},children:r})}function WZ(){var p,g,y,b,v,m;const[e,t]=P.useState(null),[r,n]=P.useState(null),[a,i]=P.useState(!0),[s,l]=P.useState("signals");P.useEffect(()=>{c();const x=setInterval(c,3e4);return()=>clearInterval(x)},[]);async function c(){try{const[x,S]=await Promise.all([Oe("/signals"),Oe("/signals/dashboard")]);t(x),n(S)}catch{}i(!1)}if(a)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-t-transparent rounded-full pulse-cyan",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})});const u=(r==null?void 0:r.stats)||{},f=(e==null?void 0:e.signals)||[],d=(e==null?void 0:e.probabilityShifts)||[],h=(r==null?void 0:r.sourceBreakdown)||[];return o.jsxs("div",{className:"space-y-6 fade-in",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"text-2xl",style:{color:"var(--cyan)"},children:"⚡"}),o.jsx("h1",{className:"heading text-3xl font-bold",style:{color:"var(--text)"},children:"Signals"}),o.jsxs("span",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"inline-block w-2 h-2 rounded-full pulse-cyan",style:{background:"var(--cyan)"}}),o.jsx("span",{className:"text-xs",style:{color:"var(--cyan)"},children:"LIVE"})]})]}),o.jsxs("p",{className:"section-subtitle mt-1",children:["News → Sentiment → Probability → Signals → Risk · ",((p=e==null?void 0:e.pipeline)==null?void 0:p.cachedMarkets)||0," markets tracked"]})]}),o.jsx("button",{onClick:c,className:"btn btn-o btn-sm",children:"↻ Refresh"})]}),o.jsxs("div",{className:"grid grid-cols-6 gap-3",children:[o.jsx(za,{label:"Signals 24h",value:u.total_signals||0,color:"var(--orange)"}),o.jsx(za,{label:"Approved",value:u.approved_signals||0,color:"var(--green)"}),o.jsx(za,{label:"BUY YES",value:u.buy_yes||0,color:"var(--green)"}),o.jsx(za,{label:"BUY NO",value:u.buy_no||0,color:"var(--red)"}),o.jsx(za,{label:"Avg Edge",value:u.avg_edge?`${(u.avg_edge*100).toFixed(1)}%`:"—",color:"var(--cyan)"}),o.jsx(za,{label:"Avg Confidence",value:u.avg_confidence?`${(u.avg_confidence*100).toFixed(0)}%`:"—",color:"var(--blue)"})]}),o.jsxs("div",{className:"flex gap-2 pb-3",style:{borderBottom:"1px solid var(--border)"},children:[o.jsxs(gh,{active:s==="signals",onClick:()=>l("signals"),children:["Strategy Signals (",f.length,")"]}),o.jsxs(gh,{active:s==="shifts",onClick:()=>l("shifts"),children:["Probability Shifts (",d.length,")"]}),o.jsxs(gh,{active:s==="sources",onClick:()=>l("sources"),children:["Source Breakdown (",h.length,")"]})]}),s==="signals"&&o.jsx("div",{className:"card overflow-x-auto fade-in",style:{padding:0},children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Time"}),o.jsx("th",{children:"Market"}),o.jsx("th",{children:"Direction"}),o.jsx("th",{children:"Edge"}),o.jsx("th",{children:"Size"}),o.jsx("th",{children:"Confidence"}),o.jsx("th",{children:"Risk"}),o.jsx("th",{})]})}),o.jsx("tbody",{children:f.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:8,className:"text-center py-12",style:{color:"var(--text-muted)"},children:o.jsxs("div",{className:"flex flex-col items-center gap-2",children:[o.jsx("span",{className:"text-2xl",children:"⚡"}),o.jsx("span",{className:"text-sm",children:"No signals generated yet"})]})})}):f.map(x=>o.jsx(BZ,{s:x},x.id))})]})}),s==="shifts"&&o.jsx("div",{className:"card overflow-x-auto fade-in",style:{padding:0},children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Time"}),o.jsx("th",{children:"Market"}),o.jsx("th",{children:"Prior"}),o.jsx("th",{children:"Impact"}),o.jsx("th",{children:"Adjusted"}),o.jsx("th",{children:"Market Price"}),o.jsx("th",{children:"Edge"}),o.jsx("th",{children:"Articles"})]})}),o.jsx("tbody",{children:d.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:8,className:"text-center py-12",style:{color:"var(--text-muted)"},children:o.jsxs("div",{className:"flex flex-col items-center gap-2",children:[o.jsx("span",{className:"text-2xl",children:"📊"}),o.jsx("span",{className:"text-sm",children:"No probability shifts yet"})]})})}):d.map((x,S)=>o.jsx(FZ,{s:x},S))})]})}),s==="sources"&&o.jsxs("div",{className:"grid grid-cols-2 gap-4 fade-in",children:[o.jsxs("div",{children:[o.jsxs("p",{className:"section-title mb-3",style:{fontSize:"1rem"},children:["Active Sources",o.jsx("span",{className:"badge bg-cyan ml-2",children:h.length})]}),o.jsx("div",{className:"space-y-2",children:h.length===0?o.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"No recent source data"}):h.map((x,S)=>o.jsx(zZ,{s:x},S))})]}),o.jsxs("div",{children:[o.jsx("p",{className:"section-title mb-3",style:{fontSize:"1rem"},children:"Pipeline Config"}),o.jsx("div",{className:"card space-y-2",children:[{label:"Market Scan",value:"Every 15 min"},{label:"Signal Pipeline",value:"Every 5 min"},{label:"Intelligence Sweep",value:"Every 30 min"},{label:"Min Edge Threshold",value:`${((((y=(g=e==null?void 0:e.pipeline)==null?void 0:g.riskLimits)==null?void 0:y.minEdgeThreshold)||.05)*100).toFixed(0)}%`,highlight:!0},{label:"Min Liquidity",value:`${((v=(b=e==null?void 0:e.pipeline)==null?void 0:b.riskLimits)==null?void 0:v.minLiquidity)||100} vol`,highlight:!0},{label:"Cached Markets",value:((m=e==null?void 0:e.pipeline)==null?void 0:m.cachedMarkets)||0,highlight:!0}].map(x=>o.jsxs("div",{className:"flex justify-between items-center p-2 rounded",style:{background:"var(--surface-el)"},children:[o.jsx("span",{className:"text-sm",style:{color:"var(--text-muted)"},children:x.label}),o.jsx("span",{className:"mono text-sm font-semibold",style:{color:x.highlight?"var(--cyan)":"var(--text)"},children:x.value})]},x.label))})]})]})]})}const Tj={reddit_hot:"🔴",reddit:"📋",google_news:"📰",hackernews:"🟠",metaculus:"🔮",manifold:"📊",gdelt_tv:"📺",youtube:"▶️",lemmy:"🟢",lobsters:"🦞",tildes:"~",bluesky:"🦋",mastodon:"🐘",predictit:"💰",fred:"📈",nws:"⛈️",govtrack:"🏛️",discord:"💬"};function UZ(e){return["reddit_hot","reddit","lemmy"].includes(e)?"bg-red":["google_news","govtrack","nws"].includes(e)?"bg-blue":["metaculus","manifold","predictit"].includes(e)?"bg-purple":["hackernews","lobsters","tildes"].includes(e)?"bg-orange":["fred"].includes(e)?"bg-green":["bluesky","mastodon","discord"].includes(e)?"bg-cyan":"bg-blue"}function HZ({value:e}){const t=parseFloat(e)||0;return t>.1?o.jsxs("span",{className:"badge bg-cyan",children:["+",(t*100).toFixed(0),"%"]}):t<-.1?o.jsxs("span",{className:"badge bg-red",children:[(t*100).toFixed(0),"%"]}):o.jsxs("span",{className:"badge bg-orange",children:[(t*100).toFixed(0),"%"]})}function Wa({col:e,label:t,sortCol:r,sortDir:n,onSort:a}){const i=r===e;return o.jsx("th",{onClick:()=>a(e),className:"cursor-pointer select-none transition",style:{color:i?"var(--cyan)":void 0},children:o.jsxs("span",{className:"flex items-center gap-1",children:[t,i?o.jsx("span",{style:{color:"var(--cyan)"},children:n==="asc"?"▲":"▼"}):o.jsx("span",{style:{color:"var(--border-light)"},children:"⇅"})]})})}function cc({label:e,value:t,color:r}){return o.jsxs("div",{className:"card",children:[o.jsx("p",{className:"stat-label mb-2",children:e}),o.jsx("p",{className:"stat-v",style:{color:r},children:t})]})}function KZ(){const[e,t]=P.useState(null),[r,n]=P.useState(!0),[a,i]=P.useState(""),[s,l]=P.useState("captured_at"),[c,u]=P.useState("desc");P.useEffect(()=>{f();const S=setInterval(f,6e4);return()=>clearInterval(S)},[]);async function f(){try{const S=await Oe("/intelligence");t(S)}catch{}n(!1)}function d(S){s===S?u(j=>j==="asc"?"desc":"asc"):(l(S),u(S==="captured_at"?"desc":"asc"))}if(r)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-t-transparent rounded-full pulse-cyan",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})});const h=(e==null?void 0:e.totals)||{},p=(e==null?void 0:e.sourceCounts)||[],g=((e==null?void 0:e.recent)||[]).filter(S=>!a||S.source.toLowerCase().includes(a.toLowerCase())||(S.post_title||"").toLowerCase().includes(a.toLowerCase())||(S.keyword||"").toLowerCase().includes(a.toLowerCase()));function y(S,j){let w,_;switch(s){case"captured_at":w=new Date(S.captured_at),_=new Date(j.captured_at);break;case"source":w=S.source||"",_=j.source||"";break;case"keyword":w=S.keyword||S.subreddit||"",_=j.keyword||j.subreddit||"";break;case"post_title":w=(S.post_title||"").toLowerCase(),_=(j.post_title||"").toLowerCase();break;case"score":w=Number(S.score||0),_=Number(j.score||0);break;case"sentiment":w=parseFloat(S.sentiment_score||0),_=parseFloat(j.sentiment_score||0);break;default:return 0}return w<_?c==="asc"?-1:1:w>_?c==="asc"?1:-1:0}const b=[...g].sort(y),v=parseFloat(h.avg_sentiment_1h)||0,m=v>0?"var(--green)":v<0?"var(--red)":"var(--text-muted)",x={sortCol:s,sortDir:c,onSort:d};return o.jsxs("div",{className:"space-y-6 fade-in",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"text-2xl",style:{color:"var(--cyan)"},children:"⚗"}),o.jsx("h1",{className:"heading text-3xl font-bold",style:{color:"var(--text)"},children:"Intel Feed"}),o.jsxs("span",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"inline-block w-2 h-2 rounded-full pulse-cyan",style:{background:"var(--cyan)"}}),o.jsx("span",{className:"text-xs",style:{color:"var(--cyan)"},children:"LIVE"})]})]}),o.jsx("p",{className:"section-subtitle mt-1",children:"Real-time data from 20+ sources"})]}),o.jsx("button",{onClick:f,className:"btn btn-o btn-sm",children:"↻ Refresh"})]}),o.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[o.jsx(cc,{label:"Total Items",value:Number(h.total_items||0).toLocaleString(),color:"var(--orange)"}),o.jsx(cc,{label:"Last Hour",value:h.last_hour||0,color:"var(--green)"}),o.jsx(cc,{label:"Last 4 Hours",value:h.last_4h||0,color:"var(--blue)"}),o.jsx(cc,{label:"Avg Sentiment 1h",value:h.avg_sentiment_1h?`${(v*100).toFixed(1)}%`:"—",color:m})]}),o.jsxs("div",{className:"card",style:{padding:"1rem"},children:[o.jsx("p",{className:"section-title mb-3",style:{fontSize:"0.9rem"},children:"Active Sources"}),o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsx("button",{onClick:()=>i(""),className:"badge transition cursor-pointer",style:{background:a?"rgba(42,42,53,0.6)":"var(--cyan-dim)",color:a?"var(--text-muted)":"var(--cyan)",border:a?"1px solid var(--border)":"1px solid rgba(0,240,255,0.3)"},children:"All"}),p.map((S,j)=>{const w=a===S.source,_=parseFloat(S.avg_sent)||0;return o.jsxs("button",{onClick:()=>i(w?"":S.source),className:"badge transition cursor-pointer",style:{background:w?"var(--cyan-dim)":"rgba(42,42,53,0.6)",color:w?"var(--cyan)":"var(--text-muted)",border:w?"1px solid rgba(0,240,255,0.3)":"1px solid var(--border)"},children:[o.jsx("span",{children:Tj[S.source]||"📡"}),o.jsx("span",{className:"font-medium",children:S.source}),o.jsx("span",{style:{color:"var(--text-muted)",opacity:.7},children:S.cnt}),o.jsxs("span",{className:"mono",style:{color:_>.05?"var(--green)":_<-.05?"var(--red)":"var(--text-muted)"},children:[_>0?"+":"",(_*100).toFixed(0),"%"]})]},j)})]})]}),o.jsxs("div",{className:"relative",children:[o.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm pointer-events-none",style:{color:"var(--text-muted)"},children:"⌕"}),o.jsx("input",{type:"text",value:a,onChange:S=>i(S.target.value),placeholder:"Filter by source, keyword, or title...",className:"input pl-8"})]}),o.jsxs("div",{className:"card overflow-x-auto",style:{padding:0},children:[o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx(Wa,{col:"captured_at",label:"Time",...x}),o.jsx(Wa,{col:"source",label:"Source",...x}),o.jsx(Wa,{col:"keyword",label:"Topic",...x}),o.jsx(Wa,{col:"post_title",label:"Headline",...x}),o.jsx(Wa,{col:"score",label:"Score",...x}),o.jsx(Wa,{col:"sentiment",label:"Sentiment",...x})]})}),o.jsx("tbody",{children:b.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:6,className:"text-center py-12",style:{color:"var(--text-muted)"},children:o.jsxs("div",{className:"flex flex-col items-center gap-2",children:[o.jsx("span",{className:"text-2xl",children:"⚗"}),o.jsx("span",{className:"text-sm",children:"No items match your filter"})]})})}):b.slice(0,50).map((S,j)=>(parseFloat(S.sentiment_score),o.jsxs("tr",{children:[o.jsx("td",{className:"whitespace-nowrap",children:o.jsx("span",{className:"mono text-xs",style:{color:"var(--text-muted)"},children:new Date(S.captured_at).toLocaleTimeString()})}),o.jsx("td",{children:o.jsxs("span",{className:`badge ${UZ(S.source)}`,children:[Tj[S.source]||"📡"," ",S.source]})}),o.jsx("td",{children:o.jsx("span",{className:"text-xs",style:{color:"var(--text-dim)"},children:S.keyword||S.subreddit||"—"})}),o.jsx("td",{className:"max-w-[400px]",children:S.post_url?o.jsx("a",{href:S.post_url,target:"_blank",rel:"noopener noreferrer",className:"text-sm truncate block hover:underline transition heading",style:{color:"var(--text)"},children:S.post_title}):o.jsx("span",{className:"text-sm truncate block heading",style:{color:"var(--text)"},children:S.post_title})}),o.jsx("td",{children:o.jsxs("span",{className:"mono text-xs",style:{color:"var(--text-dim)"},children:[S.score||0,S.num_comments?o.jsxs("span",{style:{color:"var(--text-muted)"},children:[" / ",S.num_comments,"c"]}):null]})}),o.jsx("td",{children:o.jsx(HZ,{value:S.sentiment_score})})]},j)))})]}),b.length>0&&o.jsxs("div",{className:"px-4 py-3 text-xs",style:{color:"var(--text-muted)",borderTop:"1px solid var(--border)"},children:["Showing ",Math.min(50,b.length)," of ",b.length," items",a&&` matching "${a}"`]})]})]})}function Ua({label:e,value:t,color:r}){return o.jsxs("div",{className:"card",children:[o.jsx("p",{className:"stat-label mb-2",children:e}),o.jsx("p",{className:"stat-v",style:{color:r},children:t})]})}function kt({label:e,value:t,highlight:r}){return o.jsxs("div",{className:"flex justify-between items-center px-3 py-2 rounded",style:{background:"var(--surface-el)"},children:[o.jsx("span",{className:"text-sm",style:{color:"var(--text-muted)"},children:e}),o.jsx("span",{className:"mono text-sm font-semibold",style:{color:r||"var(--text)"},children:t})]})}function Mj({label:e,active:t,color:r,onClick:n,disabled:a}){return o.jsx("button",{onClick:n,disabled:a,className:"flex-1 py-2 rounded-lg text-sm font-bold transition",style:{background:t?`${r}22`:"var(--surface-el)",color:t?r:"var(--text-muted)",border:`1px solid ${t?r+"55":"var(--border)"}`},children:e})}function VZ(){const[e,t]=P.useState(null),[r,n]=P.useState(null),[a,i]=P.useState(null),[s,l]=P.useState(!0),[c,u]=P.useState("");P.useEffect(()=>{f();const x=setInterval(f,15e3);return()=>clearInterval(x)},[]);async function f(){try{const[x,S,j]=await Promise.all([me("/trading/mode",{action:"get"}),Oe("/trading/history"),Oe("/system")]);t(x),n(S),i(j)}catch{}l(!1)}async function d(x,S={}){u(x);try{await me("/trading/mode",{action:x,...S}),await f()}catch{}u("")}if(s)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"animate-spin w-8 h-8 border-2 border-t-transparent rounded-full pulse-cyan",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})});const h=(e==null?void 0:e.trade_config)||{},p=(e==null?void 0:e.trader_state)||{},g=(r==null?void 0:r.summary)||{},y=(r==null?void 0:r.trades)||[],b=(a==null?void 0:a.memory)||{},v=parseInt(g.total_pnl||0),m=v>0?"var(--green)":v<0?"var(--red)":"var(--text-muted)";return o.jsxs("div",{className:"space-y-6 fade-in",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"text-2xl",style:{color:"var(--green)"},children:"$"}),o.jsx("h1",{className:"heading text-3xl font-bold",style:{color:"var(--text)"},children:"Trading"}),o.jsx("span",{className:`badge ${(e==null?void 0:e.env)==="prod"?"bg-green":"bg-orange"}`,children:((e==null?void 0:e.env)||"demo").toUpperCase()}),(e==null?void 0:e.safe_mode)&&o.jsx("span",{className:"badge bg-orange",children:"SAFE MODE"}),(e==null?void 0:e.auto_trader_enabled)&&o.jsx("span",{className:"badge bg-green",children:"AUTO ON"})]}),o.jsx("p",{className:"section-subtitle mt-1",children:"Mode control, execution, and P&L"})]}),o.jsx("button",{onClick:f,className:"btn btn-o btn-sm",children:"↻ Refresh"})]}),o.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[o.jsxs("div",{className:"card-glow",children:[o.jsx("p",{className:"stat-label mb-3",children:"Environment"}),o.jsxs("div",{className:"flex gap-2 mb-3",children:[o.jsx(Mj,{label:"DEMO",active:(e==null?void 0:e.env)==="demo",color:"var(--orange)",onClick:()=>d("switch_env",{env:"demo"}),disabled:c==="switch_env"}),o.jsx(Mj,{label:"PROD",active:(e==null?void 0:e.env)==="prod",color:"var(--green)",onClick:()=>d("switch_env",{env:"prod"}),disabled:c==="switch_env"})]}),o.jsxs("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:["API keys: ",e!=null&&e.kalshi_connected?o.jsx("span",{style:{color:"var(--green)"},children:"Configured"}):o.jsx("span",{style:{color:"var(--red)"},children:"Not set"})]})]}),o.jsxs("div",{className:"card-glow",children:[o.jsx("p",{className:"stat-label mb-3",children:"Safe Mode"}),o.jsx("button",{onClick:()=>d("toggle_safe_mode"),disabled:c==="toggle_safe_mode",className:"btn w-full btn-lg font-bold transition",style:{background:e!=null&&e.safe_mode?"rgba(247,147,26,0.15)":"var(--red-dim)",color:e!=null&&e.safe_mode?"var(--orange)":"var(--red)",border:`1px solid ${e!=null&&e.safe_mode?"rgba(247,147,26,0.4)":"rgba(255,92,92,0.4)"}`},children:c==="toggle_safe_mode"?"...":e!=null&&e.safe_mode?"SAFE MODE — ON":"SAFE MODE — OFF"}),o.jsx("p",{className:"text-xs mt-2",style:{color:"var(--text-muted)"},children:e!=null&&e.safe_mode?"No real orders will be placed":o.jsx("span",{style:{color:"var(--red)"},children:"Real orders will be executed!"})})]}),o.jsxs("div",{className:"card-glow",children:[o.jsx("p",{className:"stat-label mb-3",children:"Auto Trader"}),o.jsx("button",{onClick:()=>d("toggle_auto_trader"),disabled:c==="toggle_auto_trader",className:"btn w-full btn-lg font-bold transition",style:{background:e!=null&&e.auto_trader_enabled?"var(--green-dim)":"var(--surface-el)",color:e!=null&&e.auto_trader_enabled?"var(--green)":"var(--text-muted)",border:`1px solid ${e!=null&&e.auto_trader_enabled?"rgba(0,195,137,0.4)":"var(--border)"}`},children:c==="toggle_auto_trader"?"...":e!=null&&e.auto_trader_enabled?"AUTO TRADER: ON":"AUTO TRADER: OFF"}),o.jsxs("p",{className:"text-xs mt-2",style:{color:"var(--text-muted)"},children:["Min confidence: ",o.jsxs("span",{className:"mono",children:[h.min_confidence,"%"]})," · Budget: ",o.jsxs("span",{className:"mono",children:["$",(h.budget_cents/100).toFixed(0)]})]})]})]}),o.jsxs("div",{className:"grid grid-cols-6 gap-3",children:[o.jsx(Ua,{label:"Total Trades",value:g.total_trades||0,color:"var(--orange)"}),o.jsx(Ua,{label:"Open",value:g.open_trades||0,color:"var(--blue)"}),o.jsx(Ua,{label:"Wins",value:g.winning_trades||0,color:"var(--green)"}),o.jsx(Ua,{label:"Losses",value:g.losing_trades||0,color:"var(--red)"}),o.jsx(Ua,{label:"Total P&L",value:g.total_pnl?`$${(v/100).toFixed(2)}`:"$0.00",color:m}),o.jsx(Ua,{label:"Exposure",value:`$${(parseInt(g.open_exposure||0)/100).toFixed(2)}`,color:"var(--purple)"})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"card",children:[o.jsxs("p",{className:"section-title mb-3",style:{fontSize:"1rem"},children:[o.jsx("span",{style:{color:"var(--cyan)"},children:"⚙"})," Trade Config"]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(kt,{label:"Budget",value:`$${(h.budget_cents/100).toFixed(0)}`,highlight:"var(--cyan)"}),o.jsx(kt,{label:"Max per trade",value:`$${(h.max_position_cents/100).toFixed(0)}`}),o.jsx(kt,{label:"Max positions",value:h.max_open_positions}),o.jsx(kt,{label:"Daily loss limit",value:`$${(h.daily_loss_limit_cents/100).toFixed(0)}`,highlight:"var(--red)"}),o.jsx(kt,{label:"Min confidence",value:`${h.min_confidence}%`,highlight:"var(--orange)"}),o.jsx(kt,{label:"Take profit",value:`${h.take_profit_pct}%`,highlight:"var(--green)"}),o.jsx(kt,{label:"Stop loss",value:`${h.stop_loss_pct}%`,highlight:"var(--red)"})]})]}),o.jsxs("div",{className:"card",children:[o.jsxs("p",{className:"section-title mb-3",style:{fontSize:"1rem"},children:[o.jsx("span",{style:{color:"var(--cyan)"},children:"♥"})," System Health"]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(kt,{label:"Memory (RSS)",value:`${b.rss_mb||"?"} MB`}),o.jsx(kt,{label:"Heap Used",value:`${b.heapUsed_mb||"?"} MB`}),o.jsx(kt,{label:"Heap Total",value:`${b.heapTotal_mb||"?"} MB`}),o.jsx(kt,{label:"Uptime",value:`${(a==null?void 0:a.uptime_hours)||"?"}h`,highlight:"var(--blue)"}),o.jsx(kt,{label:"Cached Markets",value:(a==null?void 0:a.cachedMarkets)||0,highlight:"var(--cyan)"}),o.jsx(kt,{label:"PID",value:(a==null?void 0:a.pid)||"?"}),o.jsx(kt,{label:"Available Budget",value:`$${((p.available||0)/100).toFixed(2)}`,highlight:"var(--green)"})]})]})]}),o.jsxs("div",{className:"card overflow-x-auto",style:{padding:0},children:[o.jsxs("div",{className:"flex items-center justify-between px-5 py-4",style:{borderBottom:"1px solid var(--border)"},children:[o.jsxs("p",{className:"section-title",style:{fontSize:"1rem"},children:[o.jsx("span",{style:{color:"var(--orange)"},children:"◈"})," Trade History"]}),y.length>0&&o.jsxs("span",{className:"badge bg-orange",children:[y.length," trades"]})]}),o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Time"}),o.jsx("th",{children:"Market"}),o.jsx("th",{children:"Side"}),o.jsx("th",{children:"Qty"}),o.jsx("th",{children:"Entry"}),o.jsx("th",{children:"Exit"}),o.jsx("th",{children:"P&L"}),o.jsx("th",{children:"Type"}),o.jsx("th",{children:"Status"})]})}),o.jsx("tbody",{children:y.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:9,className:"text-center py-12",style:{color:"var(--text-muted)"},children:o.jsxs("div",{className:"flex flex-col items-center gap-2",children:[o.jsx("span",{className:"text-2xl",style:{color:"var(--text-muted)"},children:"$"}),o.jsx("span",{className:"text-sm",children:"No trades yet — signals are generating, waiting for execution"})]})})}):y.map((x,S)=>{const j=parseInt(x.pnl_cents)||0,w=j>0?"var(--green)":j<0?"var(--red)":"var(--text-muted)",_=x.status==="open"?"bg-blue":x.status==="profit"?"bg-green":x.status==="stopped"?"bg-red":"bg-orange";return o.jsxs("tr",{children:[o.jsx("td",{className:"whitespace-nowrap",children:o.jsxs("span",{className:"mono text-xs",style:{color:"var(--text-muted)"},children:[new Date(x.created_at).toLocaleDateString()," ",new Date(x.created_at).toLocaleTimeString()]})}),o.jsx("td",{className:"max-w-[200px]",children:o.jsx("a",{href:`https://kalshi.com/search?query=${encodeURIComponent((x.ticker||"").split("-")[0])}`,target:"_blank",rel:"noopener noreferrer",className:"text-sm truncate block hover:underline transition heading",style:{color:"var(--cyan)"},children:x.title||x.ticker})}),o.jsx("td",{children:o.jsx("span",{className:`badge ${x.side==="yes"?"bg-green":"bg-red"}`,children:(x.side||"").toUpperCase()})}),o.jsx("td",{children:o.jsx("span",{className:"mono text-sm",style:{color:"var(--text-dim)"},children:x.count})}),o.jsx("td",{children:o.jsxs("span",{className:"mono text-sm",style:{color:"var(--text-dim)"},children:[x.price_cents,"c"]})}),o.jsx("td",{children:o.jsx("span",{className:"mono text-sm",style:{color:x.exit_price?"var(--text-dim)":"var(--text-muted)"},children:x.exit_price?`${x.exit_price}c`:"—"})}),o.jsx("td",{children:o.jsx("span",{className:"mono text-sm font-bold",style:{color:w},children:j!==0?`${j>0?"+":""}$${(j/100).toFixed(2)}`:"—"})}),o.jsx("td",{children:o.jsx("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:x.signal_type})}),o.jsx("td",{children:o.jsx("span",{className:`badge ${_}`,children:x.status})})]},S)})})]})]})]})}function Ij({value:e=0,size:t=48,strokeWidth:r=4,color:n="var(--cyan)",label:a,showValue:i=!0}){const[s,l]=P.useState(0),c=P.useRef(null),u=P.useRef(null),f=900;P.useEffect(()=>{const b=Math.min(100,Math.max(0,e)),v=s,m=x=>{u.current||(u.current=x);const S=x-u.current,j=Math.min(1,S/f),w=1-Math.pow(1-j,3);l(v+(b-v)*w),j<1&&(c.current=requestAnimationFrame(m))};return u.current=null,c.current=requestAnimationFrame(m),()=>cancelAnimationFrame(c.current)},[e]);const d=(t-r)/2,h=2*Math.PI*d,p=h-s/100*h,g=t/2,y=t<=40?t*.22:t*.2;return o.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:4},children:[o.jsxs("div",{style:{position:"relative",width:t,height:t},children:[o.jsxs("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,style:{display:"block"},children:[o.jsx("circle",{cx:g,cy:g,r:d,fill:"none",stroke:"var(--border)",strokeWidth:r}),o.jsx("circle",{cx:g,cy:g,r:d,fill:"none",stroke:n,strokeWidth:r,strokeLinecap:"round",strokeDasharray:h,strokeDashoffset:p,style:{transformOrigin:`${g}px ${g}px`,transform:"rotate(-90deg)",filter:`drop-shadow(0 0 3px ${n}80)`}})]}),i&&o.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontWeight:700,fontSize:y,color:n,lineHeight:1,letterSpacing:"-0.03em"},children:[Math.round(s),"%"]})})]}),a&&o.jsx("span",{style:{fontFamily:"var(--font-body)",fontSize:"0.6rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em",color:"var(--text-muted)"},children:a})]})}function GZ({categories:e}){const t=Object.entries(e||{});if(!t.length)return null;const r=t.map(([s,l],c)=>{const f=(Array.isArray(l)?l:[]).reduce((d,h)=>d+(h.pnl||0),0);return{name:s,value:Math.max(Math.abs(f),1),rawPnl:f,color:_j[c%_j.length]}}).filter(s=>Math.abs(s.rawPnl)>0).sort((s,l)=>l.value-s.value),n=t.reduce((s,[,l])=>{const c=Array.isArray(l)?l:[];return s+c.reduce((u,f)=>u+(f.pnl||0),0)},0),a=({active:s,payload:l})=>{var u;if(!s||!(l!=null&&l.length))return null;const c=((u=l[0])==null?void 0:u.payload)||{};return o.jsxs("div",{style:{background:"#1C1C24",border:"1px solid #2A2A35",borderRadius:8,padding:"8px 12px",fontSize:12,fontFamily:"'Inter', sans-serif"},children:[o.jsx("p",{style:{color:c.color,fontWeight:700,marginBottom:4},children:c.name}),o.jsxs("p",{className:"mono",style:{color:c.rawPnl>=0?"#00C389":"#FF5C5C",fontWeight:700},children:[c.rawPnl>=0?"+":"","$",(c.rawPnl/100).toFixed(2)]})]})},i=()=>o.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px 14px",justifyContent:"center",marginTop:8},children:r.map(s=>o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5},children:[o.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:s.color,flexShrink:0}}),o.jsx("span",{style:{fontSize:11,color:"#A8A8A8",fontFamily:"'Inter', sans-serif"},children:s.name})]},s.name))});return o.jsxs("div",{className:"card",style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[o.jsx("h3",{className:"section-title",style:{fontSize:"1rem",marginBottom:4,alignSelf:"flex-start"},children:"P&L by Category"}),o.jsxs("div",{style:{position:"relative",width:"100%",height:220},children:[o.jsx(tr,{width:"100%",height:"100%",children:o.jsxs(Qy,{children:[o.jsx("defs",{children:r.map(s=>o.jsxs("radialGradient",{id:`donut-grad-${s.name}`,cx:"50%",cy:"50%",r:"50%",children:[o.jsx("stop",{offset:"0%",stopColor:s.color,stopOpacity:.9}),o.jsx("stop",{offset:"100%",stopColor:s.color,stopOpacity:.6})]},s.name))}),o.jsx(wr,{data:r,cx:"50%",cy:"50%",innerRadius:65,outerRadius:95,paddingAngle:2,dataKey:"value",startAngle:90,endAngle:-270,children:r.map((s,l)=>o.jsx(xr,{fill:s.color,fillOpacity:.85,stroke:"transparent"},s.name))}),o.jsx(Ge,{content:o.jsx(a,{})})]})}),o.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:[o.jsx("span",{style:{fontSize:10,color:"#6B7280",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em"},children:"Total P&L"}),o.jsxs("span",{className:"mono",style:{fontSize:20,fontWeight:700,lineHeight:1.2,color:n>=0?"#00C389":"#FF5C5C",textShadow:`0 0 10px ${n>=0?"rgba(0,195,137,0.4)":"rgba(255,92,92,0.4)"}`},children:[n>=0?"+":"","$",Math.abs(n/100).toFixed(0)]})]})]}),o.jsx(i,{})]})}function YZ({categories:e}){const t=Object.entries(e||{});if(!t.length)return null;const r=t.map(([a,i])=>{const s=Array.isArray(i)?i:[],l=s.reduce((d,h)=>d+(h.wins||0),0),c=s.reduce((d,h)=>d+(h.losses||0),0),u=l+c,f=u>0?(l/u*100).toFixed(1):0;return{name:a,wins:l,losses:c,total:u,wr:Number(f)}}).filter(a=>a.total>0).sort((a,i)=>i.total-a.total),n=({active:a,payload:i,label:s})=>{var c;if(!a||!(i!=null&&i.length))return null;const l=((c=i[0])==null?void 0:c.payload)||{};return o.jsxs("div",{style:{background:"#1C1C24",border:"1px solid #2A2A35",borderRadius:8,padding:"10px 14px",fontSize:12,fontFamily:"'Inter', sans-serif",minWidth:150},children:[o.jsx("p",{style:{color:"#E0E0E0",fontWeight:700,marginBottom:6},children:s}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[o.jsx("span",{style:{color:"#6B7280"},children:"Wins"}),o.jsx("span",{className:"mono",style:{color:"#00C389",fontWeight:700},children:l.wins})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[o.jsx("span",{style:{color:"#6B7280"},children:"Losses"}),o.jsx("span",{className:"mono",style:{color:"#FF5C5C",fontWeight:700},children:l.losses})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[o.jsx("span",{style:{color:"#6B7280"},children:"Win Rate"}),o.jsxs("span",{className:"mono",style:{color:l.wr>=50?"#00C389":"#FF5C5C",fontWeight:700},children:[l.wr,"%"]})]})]})]})};return o.jsxs("div",{className:"card",children:[o.jsx("h3",{className:"section-title",style:{fontSize:"1rem",marginBottom:16},children:"Category Win / Loss"}),o.jsx(tr,{width:"100%",height:220,children:o.jsxs(_l,{data:r,margin:{top:4,right:16,left:0,bottom:4},children:[o.jsx(Ia,{strokeDasharray:"3 3",stroke:"#2A2A35",strokeOpacity:.6,vertical:!1}),o.jsx(or,{dataKey:"name",stroke:"#2A2A35",tick:{fill:"#6B7280",fontSize:10,fontFamily:"'Inter', sans-serif"},tickLine:!1,axisLine:{stroke:"#2A2A35"}}),o.jsx(sr,{stroke:"#2A2A35",tick:{fill:"#6B7280",fontSize:11,fontFamily:"'Inter', sans-serif"},tickLine:!1,axisLine:!1,allowDecimals:!1}),o.jsx(Ge,{content:o.jsx(n,{}),cursor:{fill:"rgba(0,240,255,0.04)"}}),o.jsx(nr,{dataKey:"wins",stackId:"a",fill:"#00C389",fillOpacity:.85,radius:[0,0,0,0],maxBarSize:40,name:"Wins"}),o.jsx(nr,{dataKey:"losses",stackId:"a",fill:"#FF5C5C",fillOpacity:.85,radius:[4,4,0,0],maxBarSize:40,name:"Losses"})]})}),o.jsxs("div",{style:{display:"flex",justifyContent:"center",gap:20,marginTop:8},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[o.jsx("div",{style:{width:10,height:10,borderRadius:2,background:"#00C389"}}),o.jsx("span",{style:{fontSize:11,color:"#A8A8A8"},children:"Wins"})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[o.jsx("div",{style:{width:10,height:10,borderRadius:2,background:"#FF5C5C"}}),o.jsx("span",{style:{fontSize:11,color:"#A8A8A8"},children:"Losses"})]})]})]})}const qZ={trump:"Politics",president:"Politics",impeach:"Politics",congress:"Politics",senate:"Politics",house:"Politics",governor:"Politics",election:"Politics",democrat:"Politics",republican:"Politics",vote:"Politics",biden:"Politics",vance:"Politics",cabinet:"Politics",scotus:"Politics",supreme:"Politics",pardon:"Politics",approval:"Politics",poll:"Politics",secretary:"Politics",defense:"Politics",attorney:"Politics",gdp:"Economy",inflation:"Economy",cpi:"Economy",fed:"Economy","interest rate":"Economy",unemployment:"Economy",jobs:"Economy",payroll:"Economy",recession:"Economy",stock:"Economy",sp500:"Economy","s&p":"Economy",nasdaq:"Economy",dow:"Economy",treasury:"Economy",bond:"Economy",debt:"Economy",trade:"Economy",tariff:"Economy",deficit:"Economy",temperature:"Weather",rain:"Weather",snow:"Weather",hurricane:"Weather",weather:"Weather",tornado:"Weather",flood:"Weather",heat:"Weather",cold:"Weather",storm:"Weather",wind:"Weather",precipitation:"Weather",climate:"Weather",bitcoin:"Crypto",btc:"Crypto",ethereum:"Crypto",eth:"Crypto",crypto:"Crypto",token:"Crypto",blockchain:"Crypto",defi:"Crypto",nfl:"Sports",nba:"Sports",mlb:"Sports",nhl:"Sports",soccer:"Sports",tennis:"Sports","super bowl":"Sports",championship:"Sports",game:"Sports",match:"Sports",playoff:"Sports","world series":"Sports",ai:"Tech",spacex:"Tech",tesla:"Tech",apple:"Tech",google:"Tech",meta:"Tech",openai:"Tech",chatgpt:"Tech",tech:"Tech",rocket:"Tech",launch:"Tech",oscar:"Culture",movie:"Culture",tv:"Culture",celebrity:"Culture",grammy:"Culture",award:"Culture",music:"Culture",entertainment:"Culture",oil:"Energy",gas:"Energy",energy:"Energy",solar:"Energy",opec:"Energy",crude:"Energy",coal:"Energy",renewable:"Energy"},_n={Politics:{bg:"var(--blue)",glow:"rgba(59,130,246,0.3)",hex:"#3B82F6"},Economy:{bg:"var(--green)",glow:"rgba(0,195,137,0.3)",hex:"#00C389"},Weather:{bg:"var(--cyan)",glow:"rgba(0,240,255,0.3)",hex:"#00F0FF"},Crypto:{bg:"var(--orange)",glow:"rgba(247,147,26,0.3)",hex:"#F7931A"},Sports:{bg:"var(--purple)",glow:"rgba(168,85,247,0.3)",hex:"#A855F7"},Tech:{bg:"var(--cyan)",glow:"rgba(0,240,255,0.3)",hex:"#00F0FF"},Culture:{bg:"var(--orange)",glow:"rgba(247,147,26,0.3)",hex:"#F7931A"},Energy:{bg:"var(--orange)",glow:"rgba(247,147,26,0.3)",hex:"#F7931A"},Other:{bg:"var(--text-muted)",glow:"rgba(107,114,128,0.3)",hex:"#6B7280"}};function Lj(e){const t=(e||"").toLowerCase();for(const[r,n]of Object.entries(qZ))if(t.includes(r))return n;return"Other"}function Dj(e){return e>5e4?"var(--green)":e>1e4?"#4ade80":e>1e3?"#86efac":e>0?"#bbf7d0":e===0?"var(--text-muted)":e>-1e3?"#fecaca":e>-1e4?"#f87171":"var(--red)"}function uc(e){return e>5e4?"rgba(0,195,137,0.35)":e>1e4?"rgba(0,195,137,0.25)":e>1e3?"rgba(0,195,137,0.15)":e>0?"rgba(0,195,137,0.08)":e===0?"rgba(107,114,128,0.15)":e>-1e3?"rgba(255,92,92,0.08)":e>-1e4?"rgba(255,92,92,0.15)":"rgba(255,92,92,0.30)"}function da(e,t,r,n,a){if(!e.length)return[];if(e.length===1)return[{...e[0],x:t,y:r,w:n,h:a}];const i=e.reduce((p,g)=>p+g.size,0);if(i===0)return e.map(p=>({...p,x:t,y:r,w:0,h:0}));let s=0,l=0;const c=i*.5;for(let p=0;p<e.length;p++)if(s+=e[p].size,s>=c){l=p+1;break}l===0&&(l=1),l>=e.length&&(l=e.length-1);const u=e.slice(0,l),f=e.slice(l),h=u.reduce((p,g)=>p+g.size,0)/i;if(n>=a){const p=n*h;return[...da(u,t,r,p,a),...da(f,t+p,r,n-p,a)]}else{const p=a*h;return[...da(u,t,r,n,p),...da(f,t,r+p,n,a-p)]}}function eN({item:e,onClick:t,isSelected:r}){const n=(e.pnl/100).toFixed(2),a=e.trades>0?(e.wins/e.trades*100).toFixed(0):"0",i=e.w<120||e.h<80,s=e.w<80||e.h<50;return o.jsxs("div",{onClick:()=>t(e),className:"absolute cursor-pointer overflow-hidden group",style:{left:e.x,top:e.y,width:e.w,height:e.h,backgroundColor:uc(e.pnl),border:r?"2px solid var(--cyan)":"1px solid var(--border)",borderRadius:6,zIndex:r?10:1,transition:"all 150ms ease",boxShadow:r?"0 0 16px rgba(0,240,255,0.4)":void 0},children:[o.jsx("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 pointer-events-none",style:{background:`radial-gradient(circle at center, ${uc(e.pnl).replace(")",", transparent)").replace("rgba","radial-gradient").includes("radial"),uc(e.pnl)}, transparent)`,boxShadow:`inset 0 0 12px ${e.pnl>=0?"rgba(0,195,137,0.3)":"rgba(255,92,92,0.3)"}`,transition:"opacity 200ms ease"}}),o.jsxs("div",{className:"relative h-full p-1.5 flex flex-col justify-between z-10",children:[!s&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"truncate text-[10px] font-medium leading-tight",style:{color:"var(--text-dim)"},children:e.shortTitle}),o.jsxs("div",{className:"flex items-end justify-between mt-auto",children:[o.jsxs("span",{className:"mono font-bold text-xs",style:{color:Dj(e.pnl)},children:[e.pnl>=0?"+":"",n>999?`$${(e.pnl/100/1e3).toFixed(1)}k`:`$${n}`]}),!i&&o.jsxs("span",{className:"text-[9px] font-bold mono",style:{color:Number(a)>=80?"var(--green)":Number(a)>=50?"var(--orange)":"var(--red)"},children:[a,"%"]})]})]}),s&&o.jsx("div",{className:"flex items-center justify-center h-full",children:o.jsxs("span",{className:"mono font-bold text-[10px]",style:{color:Dj(e.pnl)},children:[e.pnl>=0?"+":"",(e.pnl/100).toFixed(0)]})})]})]})}function XZ({category:e,items:t,x:r,y:n,w:a,h:i,onTileClick:s,selectedTicker:l}){const c=_n[e]||_n.Other,u=t.reduce((p,g)=>p+g.pnl,0),f=t.reduce((p,g)=>p+g.trades,0),d=Math.min(28,i*.15),h=da(t,0,0,a,i-d);return o.jsxs("div",{className:"absolute overflow-hidden",style:{left:r,top:n,width:a,height:i,borderRadius:8,border:`1px solid ${c.hex}40`},children:[o.jsxs("div",{className:"flex items-center justify-between px-2 relative z-20",style:{height:d,background:`linear-gradient(135deg, ${c.hex}25, ${c.hex}0D)`,borderBottom:`1px solid ${c.hex}40`},children:[o.jsx("span",{className:"text-xs font-bold tracking-wide heading",style:{color:c.hex},children:e}),o.jsxs("span",{className:"text-[10px] mono",style:{color:u>=0?"var(--green)":"var(--red)"},children:[u>=0?"+":"","$",(u/100).toFixed(0)," | ",f," trades"]})]}),o.jsx("div",{className:"relative",style:{height:i-d},children:h.map(p=>o.jsx(eN,{item:{...p,y:p.y},onClick:s,isSelected:l===p.ticker},p.ticker))})]})}function QZ({market:e,onClose:t}){if(!e)return null;const r=(e.pnl/100).toFixed(2),n=e.trades>0?(e.wins/e.trades*100).toFixed(1):"0",a=_n[e.category]||_n.Other;return o.jsxs("div",{className:"card-glow fade-in",children:[o.jsxs("div",{className:"flex items-start justify-between mb-4",children:[o.jsxs("div",{className:"flex-1 min-w-0 mr-4",children:[o.jsx("h3",{className:"heading text-sm font-bold truncate",style:{color:"var(--text)"},children:e.title}),o.jsx("p",{className:"mono text-xs mt-1",style:{color:"var(--text-muted)"},children:e.ticker})]}),o.jsx("button",{onClick:t,className:"btn btn-ghost text-lg leading-none",style:{padding:"0 6px"},children:"×"})]}),o.jsx("div",{className:"grid grid-cols-4 gap-3 text-center",children:[{label:"P&L",value:`${e.pnl>=0?"+":""}$${r}`,color:e.pnl>=0?"var(--green)":"var(--red)"},{label:"Win Rate",value:`${n}%`,color:Number(n)>=80?"var(--green)":Number(n)>=50?"var(--orange)":"var(--red)"},{label:"Trades",value:e.trades.toLocaleString(),color:"var(--orange)"},{label:"Record",valueEl:o.jsxs("p",{className:"text-lg font-bold",children:[o.jsx("span",{style:{color:"var(--green)"},children:e.wins}),o.jsx("span",{style:{color:"var(--border-light)"},className:"mx-0.5",children:"-"}),o.jsx("span",{style:{color:"var(--red)"},children:e.losses})]})}].map(i=>o.jsxs("div",{className:"rounded-lg p-2.5 text-center",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[o.jsx("p",{className:"stat-label mb-1",children:i.label}),i.valueEl||o.jsx("p",{className:"stat-v text-lg",style:{color:i.color},children:i.value})]},i.label))}),o.jsxs("div",{className:"mt-3 flex items-center justify-between text-xs",children:[o.jsxs("span",{style:{color:"var(--text-muted)"},children:["Category:"," ",o.jsx("span",{style:{color:a.hex},className:"font-semibold",children:e.category})]}),e.url&&o.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-cyan transition-colors",style:{color:"var(--cyan)"},children:"View on Kalshi →"})]}),e.edge&&o.jsx("div",{className:"mt-2 text-[11px] rounded-lg px-3 py-2",style:{color:"var(--text-dim)",background:"var(--surface-el)",border:"1px solid var(--border)"},children:e.edge})]})}function JZ(){const e=[{label:"> $500",bg:"rgba(0,195,137,0.35)"},{label:"$100-500",bg:"rgba(0,195,137,0.25)"},{label:"$10-100",bg:"rgba(0,195,137,0.15)"},{label:"$0-10",bg:"rgba(0,195,137,0.08)"},{label:"$0",bg:"rgba(107,114,128,0.15)"},{label:"-$10",bg:"rgba(255,92,92,0.08)"},{label:"-$100",bg:"rgba(255,92,92,0.15)"},{label:"< -$100",bg:"rgba(255,92,92,0.30)"}];return o.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[o.jsx("span",{className:"stat-label mr-1",children:"P&L Scale:"}),e.map(t=>o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("div",{className:"w-3 h-3 rounded-sm",style:{backgroundColor:t.bg,border:"1px solid var(--border)"}}),o.jsx("span",{className:"text-[9px]",style:{color:"var(--text-muted)"},children:t.label})]},t.label))]})}function ZZ(){var _;const[e,t]=P.useState(null),[r,n]=P.useState(null),[a,i]=P.useState(!0),[s,l]=P.useState(null),[c,u]=P.useState("category"),[f,d]=P.useState("pnl");P.useEffect(()=>{h();const O=setInterval(h,3e4);return()=>clearInterval(O)},[]);async function h(){try{const[O,N]=await Promise.all([Oe("/dashboard"),Oe("/signals")]);t(O),n(N)}catch{}i(!1)}const{categories:p,allMarkets:g,summary:y}=P.useMemo(()=>{if(!e)return{categories:{},allMarkets:[],summary:{}};const O=[],N=new Set;for(const C of e.top_markets||[])if(!N.has(C.ticker)){N.add(C.ticker);const M=Lj(C.title);O.push({...C,category:M,trades:(C.wins||0)+(C.losses||0),shortTitle:(C.title||C.ticker).split("?")[0].substring(0,40),size:Math.max(Math.abs(C.pnl||1),100)})}for(const C of e.worst_markets||[])if(!N.has(C.ticker)){N.add(C.ticker);const M=Lj(C.title);O.push({...C,category:M,trades:(C.wins||0)+(C.losses||0),shortTitle:(C.title||C.ticker).split("?")[0].substring(0,40),size:Math.max(Math.abs(C.pnl||1),100)})}for(const C of e.strategies||[]){const M=`strategy-${C.strategy||C.name}`;N.has(M)||(N.add(M),O.push({ticker:M,title:`Strategy: ${C.name}`,shortTitle:C.name,category:"Other",wins:C.wins||0,losses:C.losses||0,trades:(C.wins||0)+(C.losses||0),pnl:C.pnl||0,edge:`Win Rate: ${C.win_rate||0}%`,size:Math.max(Math.abs(C.pnl||1),100)}))}f==="pnl"?O.sort((C,M)=>M.pnl-C.pnl):f==="trades"?O.sort((C,M)=>M.trades-C.trades):f==="winrate"&&O.sort((C,M)=>{const I=C.trades>0?C.wins/C.trades:0;return(M.trades>0?M.wins/M.trades:0)-I});const k={};for(const C of O)k[C.category]||(k[C.category]=[]),k[C.category].push(C);const E=O.reduce((C,M)=>C+M.pnl,0),T=O.reduce((C,M)=>C+M.trades,0),D=O.reduce((C,M)=>C+M.wins,0),A=O.reduce((C,M)=>C+M.losses,0),L=O.filter(C=>C.pnl>0).length;return{categories:k,allMarkets:O,summary:{totalPnl:E,totalTrades:T,totalWins:D,totalLosses:A,profitableCount:L,totalMarkets:O.length}}},[e,f]),b=g.find(O=>O.ticker===s);if(a)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})});const v=1200,m=700,x=Object.entries(p).sort((O,N)=>{const k=O[1].reduce((T,D)=>T+Math.abs(D.pnl),0);return N[1].reduce((T,D)=>T+Math.abs(D.pnl),0)-k}),S=da(x.map(([O,N])=>({name:O,size:N.reduce((k,E)=>k+Math.abs(E.pnl||1),0)+N.length*100,items:N})),0,0,v,m),j=c==="flat"?da(g.map(O=>({...O,size:Math.max(Math.abs(O.pnl||1),200)})),0,0,v,m):[],w=[{label:"Total P&L",value:`${y.totalPnl>=0?"+":""}$${(y.totalPnl/100).toLocaleString(void 0,{minimumFractionDigits:0})}`,color:y.totalPnl>=0?"var(--green)":"var(--red)"},{label:"Total Trades",value:((_=y.totalTrades)==null?void 0:_.toLocaleString())||"0",color:"var(--orange)"},{label:"Win Rate",value:y.totalTrades>0?`${(y.totalWins/y.totalTrades*100).toFixed(1)}%`:"0%",color:"var(--blue)"},{label:"Markets",value:y.totalMarkets||0,color:"var(--purple)"},{label:"Profitable",value:y.profitableCount||0,color:"var(--green)"},{label:"Categories",value:Object.keys(p).length,color:"var(--cyan)"}];return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsx("h1",{className:"heading text-2xl font-bold kalshi-gradient",children:"Market Heatmap"}),o.jsx("p",{className:"section-subtitle mt-1",children:"Treemap visualization of trading activity and P&L by market category"})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex items-center gap-0.5 rounded-lg p-0.5",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:["category","flat"].map(O=>o.jsx("button",{onClick:()=>u(O),className:"btn btn-sm",style:c===O?{background:"var(--cyan)",color:"var(--bg)",fontWeight:700}:{background:"transparent",color:"var(--text-muted)"},children:O==="category"?"By Category":"All Markets"},O))}),o.jsxs("select",{value:f,onChange:O=>d(O.target.value),className:"input",style:{width:"auto",paddingRight:"1.5rem"},children:[o.jsx("option",{value:"pnl",children:"Sort by P&L"}),o.jsx("option",{value:"trades",children:"Sort by Trades"}),o.jsx("option",{value:"winrate",children:"Sort by Win Rate"})]}),o.jsx("button",{onClick:h,className:"btn btn-o btn-sm",children:"Refresh"})]})]}),o.jsx("div",{className:"grid grid-cols-6 gap-3",children:w.map((O,N)=>{var E;const k=["card-accent-green","card-accent-orange","card-accent-blue","card-accent-purple","card-accent-green","card-accent-cyan"];if(O.label==="Win Rate"){const T=parseFloat(O.value)||0;return o.jsxs("div",{className:`card ${k[N]||"card-accent-cyan"}`,style:{display:"flex",alignItems:"center",gap:12},children:[o.jsx(Ij,{value:T,size:52,strokeWidth:4,color:T>=80?"var(--green)":T>=50?"var(--orange)":"var(--red)"}),o.jsxs("div",{children:[o.jsx("p",{className:"stat-label mb-0.5",children:O.label}),o.jsx("p",{className:"stat-v mono text-lg",style:{color:O.color},children:O.value})]})]},O.label)}if(O.label==="Profitable"){const T=((E=w.find(A=>A.label==="Markets"))==null?void 0:E.value)||1,D=T>0?Math.round(Number(O.value)/Number(T)*100):0;return o.jsxs("div",{className:`card ${k[N]||"card-accent-cyan"}`,style:{display:"flex",alignItems:"center",gap:12},children:[o.jsx(Ij,{value:D,size:52,strokeWidth:4,color:"var(--green)"}),o.jsxs("div",{children:[o.jsx("p",{className:"stat-label mb-0.5",children:O.label}),o.jsx("p",{className:"stat-v mono text-lg",style:{color:O.color},children:O.value})]})]},O.label)}return o.jsxs("div",{className:`card ${k[N]||"card-accent-cyan"}`,children:[o.jsx("p",{className:"stat-label mb-1",children:O.label}),o.jsx("p",{className:"stat-v mono text-xl",style:{color:O.color},children:O.value})]},O.label)})}),Object.keys(p).length>0&&o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 2fr",gap:16},children:[o.jsx(GZ,{categories:p}),o.jsx(YZ,{categories:p})]}),o.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:Object.entries(p).map(([O,N])=>{const k=_n[O]||_n.Other,E=N.reduce((T,D)=>T+D.pnl,0);return o.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full",style:{backgroundColor:`${k.hex}18`,border:`1px solid ${k.hex}40`},children:[o.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:k.hex}}),o.jsx("span",{className:"text-xs font-semibold heading",style:{color:k.hex},children:O}),o.jsx("span",{className:"text-[10px]",style:{color:"var(--text-muted)"},children:N.length}),o.jsxs("span",{className:"text-[10px] mono font-bold",style:{color:E>=0?"var(--green)":"var(--red)"},children:[E>=0?"+":"","$",(E/100).toFixed(0)]})]},O)})}),o.jsxs("div",{className:"card p-2 relative overflow-hidden",style:{minHeight:m+20},children:[o.jsx("div",{className:"relative",style:{width:v,height:m,margin:"0 auto",maxWidth:"100%"},children:c==="category"?S.map(O=>o.jsx(XZ,{category:O.name,items:O.items,x:O.x,y:O.y,w:O.w,h:O.h,onTileClick:N=>l(N.ticker===s?null:N.ticker),selectedTicker:s},O.name)):j.map(O=>o.jsx(eN,{item:O,onClick:N=>l(N.ticker===s?null:N.ticker),isSelected:s===O.ticker},O.ticker))}),o.jsx("div",{className:"mt-3 px-2",children:o.jsx(JZ,{})})]}),b&&o.jsx(QZ,{market:b,onClose:()=>l(null)}),o.jsxs("div",{className:"card",children:[o.jsx("div",{className:"flex items-center gap-2 mb-4",children:o.jsx("h2",{className:"section-title",children:"Category Breakdown"})}),o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Category"}),o.jsx("th",{children:"Markets"}),o.jsx("th",{children:"Total Trades"}),o.jsx("th",{children:"Win Rate"}),o.jsx("th",{children:"P&L"}),o.jsx("th",{children:"Best Market"})]})}),o.jsx("tbody",{children:x.map(([O,N])=>{const k=_n[O]||_n.Other,E=N.reduce((C,M)=>C+M.pnl,0),T=N.reduce((C,M)=>C+M.trades,0),D=N.reduce((C,M)=>C+M.wins,0),A=T>0?(D/T*100).toFixed(1):"0",L=N.reduce((C,M)=>M.pnl>((C==null?void 0:C.pnl)||-1/0)?M:C,N[0]);return o.jsxs("tr",{children:[o.jsx("td",{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:k.hex}}),o.jsx("span",{className:"font-semibold heading",style:{color:k.hex},children:O})]})}),o.jsx("td",{style:{color:"var(--text-dim)"},children:N.length}),o.jsx("td",{className:"mono",style:{color:"var(--text-dim)"},children:T.toLocaleString()}),o.jsxs("td",{className:"mono font-bold",style:{color:Number(A)>=80?"var(--green)":Number(A)>=50?"var(--orange)":"var(--red)"},children:[A,"%"]}),o.jsxs("td",{className:"mono font-bold",style:{color:E>=0?"var(--green)":"var(--red)"},children:[E>=0?"+":"","$",(E/100).toFixed(2)]}),o.jsx("td",{className:"text-xs truncate max-w-[200px]",style:{color:"var(--text-muted)"},children:(L==null?void 0:L.shortTitle)||"--"})]},O)})})]})]})]})}const Ko=[{radius:80,label:"Core",color:"#00F0FF",opacity:.5,description:"Highest confidence"},{radius:160,label:"Inner",color:"#00C389",opacity:.35,description:"Strong signals"},{radius:240,label:"Mid",color:"#3B82F6",opacity:.25,description:"Moderate signals"},{radius:320,label:"Outer",color:"#A855F7",opacity:.18,description:"Weak signals"},{radius:400,label:"Edge",color:"#FF5C5C",opacity:.12,description:"Speculative"}],Zi={BUY_YES:{fill:"#00C389",stroke:"#009E6F",glow:"rgba(0,195,137,0.5)"},BUY_NO:{fill:"#FF5C5C",stroke:"#CC4A4A",glow:"rgba(255,92,92,0.5)"},YES:{fill:"#00C389",stroke:"#009E6F",glow:"rgba(0,195,137,0.5)"},NO:{fill:"#FF5C5C",stroke:"#CC4A4A",glow:"rgba(255,92,92,0.5)"}};function Zy(e){return e>=.9?"#00C389":e>=.7?"#F7931A":e>=.5?"#3B82F6":e>=.3?"#A855F7":"#FF5C5C"}function tN(e){return e>=.9?0:e>=.75?1:e>=.6?2:e>=.4?3:4}function eee({width:e,height:t}){const r=P.useMemo(()=>{const n=[];for(let a=0;a<80;a++)n.push({x:Math.random()*e,y:Math.random()*t,r:Math.random()*1.2+.3,opacity:Math.random()*.4+.05,delay:Math.random()*3});return n},[e,t]);return o.jsx(o.Fragment,{children:r.map((n,a)=>o.jsx("circle",{cx:n.x,cy:n.y,r:n.r,fill:"white",opacity:n.opacity,className:"animate-pulse",style:{animationDelay:`${n.delay}s`,animationDuration:`${2+Math.random()*3}s`}},a))})}function tee({market:e,cx:t,cy:r,size:n,isSelected:a,onSelect:i,animate:s}){var h;const l=Zi[e.direction]||Zi.BUY_YES,c=parseFloat(e.confidence)||0,u=Zy(c),f=n+4,d=`gradient-${(h=e.ticker)==null?void 0:h.replace(/[^a-zA-Z0-9]/g,"")}`;return o.jsxs("g",{onClick:()=>i(e),className:"cursor-pointer",style:{transition:"all 0.5s ease-out"},children:[o.jsx("circle",{cx:t,cy:r,r:f,fill:"none",stroke:l.glow,strokeWidth:1.5,opacity:a?.9:.3,className:s?"animate-ping":"",style:{animationDuration:"2s",transformOrigin:`${t}px ${r}px`}}),o.jsx("circle",{cx:t,cy:r,r:n+2,fill:"none",stroke:u,strokeWidth:2,opacity:.65,strokeDasharray:`${c*20} ${(1-c)*20}`}),o.jsx("circle",{cx:t,cy:r,r:n,fill:`url(#${d})`,stroke:a?"#00F0FF":l.stroke,strokeWidth:a?2.5:1,className:"transition-all duration-300"}),o.jsx("defs",{children:o.jsxs("radialGradient",{id:d,children:[o.jsx("stop",{offset:"0%",stopColor:l.fill,stopOpacity:"0.9"}),o.jsx("stop",{offset:"70%",stopColor:l.fill,stopOpacity:"0.6"}),o.jsx("stop",{offset:"100%",stopColor:l.stroke,stopOpacity:"0.4"})]})}),n>=8&&o.jsx("text",{x:t,y:r+1,textAnchor:"middle",dominantBaseline:"middle",fill:"white",fontSize:Math.max(7,n*.6),fontWeight:"bold",fontFamily:"'JetBrains Mono', monospace",style:{pointerEvents:"none"},children:e.edge_display||""}),n>=10&&o.jsx("text",{x:t,y:r+n+12,textAnchor:"middle",fill:"#A8A8A8",fontSize:8,fontFamily:"'JetBrains Mono', monospace",style:{pointerEvents:"none"},children:(e.shortTitle||"").substring(0,18)})]})}function ree({market:e,onClose:t}){var s;if(!e)return null;const r=parseFloat(e.confidence)||0,n=parseFloat(e.expected_edge)||0,a=Zi[e.direction]||Zi.BUY_YES,i=((s=Ko[tN(r)])==null?void 0:s.label)||"Edge";return o.jsxs("div",{className:"card-glow fade-in",children:[o.jsxs("div",{className:"flex items-start justify-between mb-4",children:[o.jsxs("div",{className:"flex-1 min-w-0 mr-4",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[o.jsx("span",{className:"inline-block w-3 h-3 rounded-full",style:{backgroundColor:a.fill}}),o.jsx("span",{className:"badge",style:e.direction==="BUY_YES"||e.direction==="YES"?{background:"var(--green-dim)",color:"var(--green)"}:{background:"var(--red-dim)",color:"var(--red)"},children:e.direction}),e.risk_approved?o.jsx("span",{className:"badge bg-green",children:"APPROVED"}):o.jsx("span",{className:"badge bg-red",children:"BLOCKED"})]}),o.jsx("h3",{className:"heading text-sm font-bold",style:{color:"var(--text)"},children:e.title||e.ticker}),o.jsx("p",{className:"mono text-xs mt-1",style:{color:"var(--text-muted)"},children:e.ticker})]}),o.jsx("button",{onClick:t,className:"btn btn-ghost text-lg leading-none",style:{padding:"0 6px"},children:"×"})]}),o.jsx("div",{className:"grid grid-cols-3 gap-3 mb-4",children:[{label:"Edge",value:`${(n*100).toFixed(1)}%`,color:"var(--orange)"},{label:"Confidence",value:`${(r*100).toFixed(0)}%`,color:Zy(r)},{label:"Orbit Ring",value:i,color:"var(--purple)"}].map(l=>o.jsxs("div",{className:"rounded-lg p-2.5 text-center",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[o.jsx("p",{className:"stat-label mb-1",children:l.label}),o.jsx("p",{className:"stat-v text-lg",style:{color:l.color},children:l.value})]},l.label))}),e.reasoning&&o.jsx("div",{className:"text-[11px] rounded-lg px-3 py-2 mb-3 leading-relaxed",style:{color:"var(--text-dim)",background:"var(--surface-el)",border:"1px solid var(--border)"},children:e.reasoning}),e.sources&&e.sources.length>0&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("p",{className:"stat-label mb-1",children:"Signal Sources"}),e.sources.map((l,c)=>{var u;return o.jsxs("div",{className:"flex items-center gap-2 text-xs rounded-lg px-3 py-2",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[o.jsx("span",{className:"badge bg-blue",children:l.source}),o.jsx("span",{className:"truncate flex-1",style:{color:"var(--text-dim)"},children:l.headline}),o.jsxs("span",{className:"mono text-[10px]",style:{color:l.sentiment>0?"var(--green)":l.sentiment<0?"var(--red)":"var(--text-muted)"},children:[l.sentiment>0?"+":"",(u=l.sentiment)==null?void 0:u.toFixed(2)]})]},c)})]}),o.jsxs("div",{className:"mt-3 text-[10px]",style:{color:"var(--text-muted)"},children:["Signal created:"," ",e.created_at?new Date(e.created_at).toLocaleString("en-US",{timeZone:"America/Los_Angeles",hour:"2-digit",minute:"2-digit",month:"short",day:"numeric"}):"Unknown"]})]})}function nee(){const[e,t]=P.useState(null),[r,n]=P.useState(null),[a,i]=P.useState(!0),[s,l]=P.useState(null),[c,u]=P.useState("all"),[f,d]=P.useState(!0),h=P.useRef(null);P.useEffect(()=>{p();const k=setInterval(p,3e4);return()=>clearInterval(k)},[]);async function p(){try{const[k,E,T]=await Promise.all([Oe("/dashboard"),Oe("/signals"),Oe("/signals/dashboard")]);t(k),n({signals:(E==null?void 0:E.signals)||[],dashboard:T})}catch{}i(!1)}const{orbitalMarkets:g,stats:y}=P.useMemo(()=>{if(!(r!=null&&r.signals))return{orbitalMarkets:[],stats:{}};let k=r.signals.map(C=>{var z,q;const M=parseFloat(C.confidence)||0,I=parseFloat(C.expected_edge)||0,R=tN(M),K=((z=(C.ticker||"").split("-")[0])==null?void 0:z.replace("KX","").substring(0,12))||C.ticker;return{...C,shortTitle:K,title:((q=C.reasoning)==null?void 0:q.split('"')[1])||C.ticker,ring:R,conf:M,edge:I,edge_display:`${(I*100).toFixed(0)}%`,size:Math.max(6,Math.min(22,I*120+6))}});c==="approved"&&(k=k.filter(C=>C.risk_approved)),c==="yes"&&(k=k.filter(C=>C.direction==="BUY_YES")),c==="no"&&(k=k.filter(C=>C.direction==="BUY_NO")),k.sort((C,M)=>M.edge-C.edge),k=k.slice(0,60);const E=k.filter(C=>C.risk_approved).length,T=k.filter(C=>C.direction==="BUY_YES").length,D=k.filter(C=>C.direction==="BUY_NO").length,A=k.length>0?k.reduce((C,M)=>C+M.conf,0)/k.length:0,L=k.length>0?k.reduce((C,M)=>C+M.edge,0)/k.length:0;return{orbitalMarkets:k,stats:{total:k.length,approved:E,buyYes:T,buyNo:D,avgConf:A,avgEdge:L}}},[r,c]),b=g.find(k=>k.ticker===s);if(a)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})});const v=450,m=430,x=900,S=860,j={};g.forEach(k=>{j[k.ring]=(j[k.ring]||0)+1});const w={},_=g.map(k=>{const E=Ko[k.ring];w[k.ring]||(w[k.ring]=0);const T=w[k.ring]++,D=j[k.ring],L=2*Math.PI/D*T+k.ring*.4,C=Math.sin(T*7.3)*.15,M=L+C,I=E.radius+Math.cos(T*3.7)*15;return{...k,cx:v+I*Math.cos(M),cy:m+I*Math.sin(M)}}),O=[{key:"all",label:"All"},{key:"approved",label:"Approved"},{key:"yes",label:"BUY YES"},{key:"no",label:"BUY NO"}],N=[{label:"Active Signals",value:y.total||0,color:"var(--cyan)"},{label:"Risk Approved",value:y.approved||0,color:"var(--green)"},{label:"BUY YES",value:y.buyYes||0,color:"var(--green)"},{label:"BUY NO",value:y.buyNo||0,color:"var(--red)"},{label:"Avg Confidence",value:`${((y.avgConf||0)*100).toFixed(0)}%`,color:"var(--blue)"},{label:"Avg Edge",value:`${((y.avgEdge||0)*100).toFixed(1)}%`,color:"var(--purple)"}];return o.jsxs("div",{className:"space-y-6",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"heading text-2xl font-bold flex items-center gap-2",children:[o.jsx("span",{style:{color:"var(--cyan)"},children:"◐"}),o.jsx("span",{className:"gradient-cyan",children:"Signal Orbit"})]}),o.jsx("p",{className:"section-subtitle mt-1",children:"Radial visualization — distance from center = confidence, size = edge strength"})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex items-center gap-0.5 rounded-lg p-0.5",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:O.map(k=>o.jsx("button",{onClick:()=>u(k.key),className:"btn btn-sm",style:c===k.key?{background:"var(--cyan)",color:"var(--bg)",fontWeight:700}:{background:"transparent",color:"var(--text-muted)"},children:k.label},k.key))}),o.jsxs("label",{className:"flex items-center gap-2 text-xs cursor-pointer",style:{color:"var(--text-dim)"},children:[o.jsx("input",{type:"checkbox",checked:f,onChange:k=>d(k.target.checked),className:"rounded",style:{accentColor:"var(--cyan)"}}),"Animate"]}),o.jsx("button",{onClick:p,className:"btn btn-o btn-sm",children:"Refresh"})]})]}),o.jsx("div",{className:"grid grid-cols-6 gap-3",children:N.map(k=>o.jsxs("div",{className:"card",children:[o.jsx("p",{className:"stat-label mb-1",children:k.label}),o.jsx("p",{className:"stat-v",style:{color:k.color},children:k.value})]},k.label))}),o.jsxs("div",{className:"card p-0 overflow-hidden relative",style:{background:"radial-gradient(ellipse at center, #0D1B2E 0%, #080D14 60%, var(--bg) 100%)"},children:[o.jsxs("svg",{ref:h,viewBox:`0 0 ${x} ${S}`,className:"w-full",style:{maxHeight:"75vh"},children:[o.jsx(eee,{width:x,height:S}),Ko.map((k,E)=>o.jsxs("g",{children:[o.jsx("circle",{cx:v,cy:m,r:k.radius,fill:"none",stroke:k.color,strokeWidth:.8,opacity:k.opacity,strokeDasharray:"4 4"}),o.jsx("text",{x:v+k.radius+6,y:m-4,fill:k.color,fontSize:9,opacity:k.opacity+.2,fontFamily:"'JetBrains Mono', monospace",children:k.label})]},E)),o.jsxs("defs",{children:[o.jsxs("radialGradient",{id:"sun-gradient",children:[o.jsx("stop",{offset:"0%",stopColor:"#00F0FF",stopOpacity:"1"}),o.jsx("stop",{offset:"50%",stopColor:"#00B8C8",stopOpacity:"0.8"}),o.jsx("stop",{offset:"100%",stopColor:"#006070",stopOpacity:"0.4"})]}),o.jsxs("filter",{id:"sun-glow",children:[o.jsx("feGaussianBlur",{stdDeviation:"10",result:"blur"}),o.jsxs("feMerge",{children:[o.jsx("feMergeNode",{in:"blur"}),o.jsx("feMergeNode",{in:"SourceGraphic"})]})]})]}),o.jsx("circle",{cx:v,cy:m,r:40,fill:"url(#sun-gradient)",filter:"url(#sun-glow)",opacity:.55}),o.jsx("circle",{cx:v,cy:m,r:25,fill:"url(#sun-gradient)"}),o.jsx("text",{x:v,y:m-4,textAnchor:"middle",fill:"#0E0E10",fontSize:12,fontWeight:"bold",fontFamily:"'JetBrains Mono', monospace",children:"KEN"}),o.jsx("text",{x:v,y:m+10,textAnchor:"middle",fill:"#0E0E10",fontSize:7,fontFamily:"'JetBrains Mono', monospace",opacity:.7,children:"TRADER"}),_.map(k=>{const E=Zi[k.direction]||Zi.BUY_YES;return o.jsx("line",{x1:v,y1:m,x2:k.cx,y2:k.cy,stroke:E.fill,strokeWidth:.4,opacity:s===k.ticker?.6:.1},`line-${k.ticker}`)}),_.map(k=>o.jsx(tee,{market:k,cx:k.cx,cy:k.cy,size:k.size,isSelected:s===k.ticker,onSelect:E=>l(E.ticker===s?null:E.ticker),animate:f&&k.risk_approved},k.ticker))]}),o.jsx("div",{className:"absolute bottom-3 left-3 rounded-lg p-3",style:{background:"rgba(14,14,16,0.85)",backdropFilter:"blur(8px)",border:"1px solid var(--border)"},children:o.jsxs("div",{className:"flex items-center gap-4 text-[10px]",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:"var(--green)"}}),o.jsx("span",{style:{color:"var(--text-dim)"},children:"BUY YES"})]}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:"var(--red)"}}),o.jsx("span",{style:{color:"var(--text-dim)"},children:"BUY NO"})]}),o.jsx("span",{style:{color:"var(--border-light)"},children:"|"}),o.jsx("span",{style:{color:"var(--text-muted)"},children:"Closer to center = higher confidence"}),o.jsx("span",{style:{color:"var(--text-muted)"},children:"Larger = bigger edge"})]})}),o.jsxs("div",{className:"absolute top-3 right-3 rounded-lg p-2.5",style:{background:"rgba(14,14,16,0.85)",backdropFilter:"blur(8px)",border:"1px solid var(--border)"},children:[o.jsx("p",{className:"stat-label mb-1.5",children:"Orbit Rings"}),o.jsx("div",{className:"space-y-1",children:Ko.map((k,E)=>o.jsxs("div",{className:"flex items-center gap-2 text-[10px]",children:[o.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:k.color,opacity:k.opacity+.3}}),o.jsx("span",{style:{color:k.color},children:k.label}),o.jsx("span",{style:{color:"var(--text-muted)"},children:k.description})]},E))})]})]}),b&&o.jsx(ree,{market:b,onClose:()=>l(null)}),o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[o.jsx("h2",{className:"section-title",children:"Orbital Signal Registry"}),o.jsxs("span",{className:"text-xs",style:{color:"var(--text-muted)"},children:[g.length," signals in orbit"]})]}),o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Ring"}),o.jsx("th",{children:"Ticker"}),o.jsx("th",{children:"Direction"}),o.jsx("th",{children:"Edge"}),o.jsx("th",{children:"Confidence"}),o.jsx("th",{children:"Risk"}),o.jsx("th",{children:"Sources"})]})}),o.jsx("tbody",{children:g.slice(0,20).map(k=>{var T;const E=Ko[k.ring];return o.jsxs("tr",{onClick:()=>l(k.ticker===s?null:k.ticker),className:"cursor-pointer",style:s===k.ticker?{background:"var(--cyan-glow)"}:{},children:[o.jsx("td",{children:o.jsx("span",{className:"text-xs font-bold heading",style:{color:E.color},children:E.label})}),o.jsx("td",{className:"mono text-xs",style:{color:"var(--text-dim)"},children:k.ticker}),o.jsx("td",{children:o.jsx("span",{className:"badge",style:k.direction==="BUY_YES"?{background:"var(--green-dim)",color:"var(--green)"}:{background:"var(--red-dim)",color:"var(--red)"},children:k.direction})}),o.jsxs("td",{className:"mono font-bold text-sm",style:{color:"var(--orange)"},children:[(k.edge*100).toFixed(1),"%"]}),o.jsxs("td",{className:"mono text-sm",style:{color:Zy(k.conf)},children:[(k.conf*100).toFixed(0),"%"]}),o.jsx("td",{children:k.risk_approved?o.jsx("span",{className:"text-xs font-bold",style:{color:"var(--green)"},children:"OK"}):o.jsx("span",{className:"text-xs font-bold",style:{color:"var(--red)"},children:"BLOCKED"})}),o.jsx("td",{className:"text-xs",style:{color:"var(--text-muted)"},children:((T=k.sources)==null?void 0:T.length)||0})]},k.ticker)})})]})})]})]})}const kc=[{name:"Economy",icon:"💰",subcategories:["GDP","Inflation","Jobs","Fed Rate","Recession","Trade","Debt","Markets"],keywords:["gdp","inflation","cpi","unemployment","jobs","payroll","fed","interest rate","recession","stock","sp500","nasdaq","dow","treasury","bond","debt","trade","tariff","deficit"],cssColor:"var(--green)",dimColor:"var(--green-dim)",rgbColor:[0,195,137]},{name:"Politics",icon:"🏛",subcategories:["White House","Congress","Elections","SCOTUS","Cabinet","Polls","Policy","Foreign"],keywords:["trump","president","impeach","congress","senate","house","governor","election","democrat","republican","vote","biden","vance","cabinet","scotus","supreme","pardon","approval","poll","secretary","defense","attorney"],cssColor:"var(--blue)",dimColor:"var(--blue-dim)",rgbColor:[59,130,246]},{name:"Weather",icon:"⛈",subcategories:["Temperature","Storms","Snow","Rain","Hurricanes","Heat","Wind","Climate"],keywords:["temperature","rain","snow","hurricane","weather","tornado","flood","heat","cold","storm","wind","precipitation","climate"],cssColor:"var(--cyan)",dimColor:"var(--cyan-dim)",rgbColor:[0,240,255]},{name:"Technology",icon:"💻",subcategories:["AI","SpaceX","Tesla","Big Tech","Startups","Chips","Cyber","Social"],keywords:["ai","spacex","tesla","apple","google","meta","openai","chatgpt","tech","rocket","launch"],cssColor:"var(--cyan)",dimColor:"var(--cyan-dim)",rgbColor:[0,240,255]},{name:"Crypto",icon:"🪙",subcategories:["Bitcoin","Ethereum","DeFi","NFTs","Regulation","Mining","Stablecoins","Altcoins"],keywords:["bitcoin","btc","ethereum","eth","crypto","token","blockchain","defi"],cssColor:"var(--orange)",dimColor:"var(--orange-dim)",rgbColor:[247,147,26]},{name:"Sports",icon:"🏈",subcategories:["NFL","NBA","MLB","Soccer","Tennis","UFC","Olympics","Playoffs"],keywords:["nfl","nba","mlb","nhl","soccer","tennis","super bowl","championship","game","match","playoff","world series"],cssColor:"var(--purple)",dimColor:"var(--purple-dim)",rgbColor:[168,85,247]},{name:"Energy",icon:"⚡",subcategories:["Oil","Gas","Solar","Nuclear","OPEC","EVs","Grid","Coal"],keywords:["oil","gas","energy","solar","opec","crude","coal","renewable"],cssColor:"var(--orange)",dimColor:"var(--orange-dim)",rgbColor:[247,147,26]},{name:"Culture",icon:"🎬",subcategories:["Movies","Music","Awards","TV","Social Media","Trends","Celebrity","Gaming"],keywords:["oscar","movie","tv","celebrity","grammy","award","music","entertainment"],cssColor:"var(--orange)",dimColor:"var(--orange-dim)",rgbColor:[247,147,26]}];kc.forEach((e,t)=>{e.baseColor=e.rgbColor});function aee(e,t){const[r,n,a]=t,i=Math.max(.05,Math.min(.9,e));return`rgba(${r},${n},${a},${i})`}function iee(e,t){const[r,n,a]=t,i=Math.max(.1,Math.min(.6,e*.8));return`rgba(${r},${n},${a},${i})`}function oee(e,t){const[r,n,a]=t;return e>.5?`rgb(${Math.min(255,r+60)},${Math.min(255,n+60)},${Math.min(255,a+60)})`:e>.2?`rgb(${r},${n},${a})`:"var(--text-muted)"}function see({subcategory:e,intensity:t,signalCount:r,sentiment:n,baseColor:a,onClick:i,isSelected:s}){const l=aee(t,a),c=iee(t,a),u=oee(t,a),f=t>.3;return o.jsxs("div",{onClick:i,className:`relative overflow-hidden rounded-lg cursor-pointer group ${s?"z-10":""}`,style:{backgroundColor:l,border:s?"2px solid var(--cyan)":`1px solid ${c}`,minHeight:70,transform:s?"scale(1.05)":void 0,transition:"all 200ms ease",boxShadow:s?"0 0 16px rgba(0,240,255,0.2)":void 0},children:[f&&o.jsx("div",{className:"absolute inset-0 opacity-10 pointer-events-none",style:{backgroundImage:"repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.03) 2px, rgba(255,255,255,0.03) 4px)"}}),t>.6&&o.jsx("div",{className:"absolute inset-0 animate-pulse opacity-30 pointer-events-none",style:{background:`radial-gradient(circle at center, rgba(${a.join(",")},0.4), transparent 70%)`,animationDuration:`${3-t*2}s`}}),o.jsx("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 pointer-events-none",style:{background:`radial-gradient(circle at center, rgba(${a.join(",")},0.08), transparent)`,transition:"opacity 150ms ease"}}),o.jsxs("div",{className:"relative p-2.5 h-full flex flex-col justify-between z-10",children:[o.jsx("div",{children:o.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider",style:{color:u},children:e})}),o.jsxs("div",{className:"flex items-end justify-between mt-1",children:[o.jsx("div",{children:r>0?o.jsx("p",{className:"text-lg font-bold mono",style:{color:u},children:r}):o.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"--"})}),n!==0&&o.jsxs("div",{className:"text-[9px] mono font-bold px-1.5 py-0.5 rounded",style:n>0?{background:"var(--green-dim)",color:"var(--green)"}:{background:"var(--red-dim)",color:"var(--red)"},children:[n>0?"+":"",n.toFixed(2)]})]})]}),o.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5",style:{background:`linear-gradient(90deg, transparent, rgba(${a.join(",")},${t}), transparent)`}})]})}function lee({category:e,subcategoryData:t,onCellClick:r,selectedCell:n}){const a=t.reduce((l,c)=>l+c.signalCount,0),i=Math.max(...t.map(l=>l.intensity),0),s=t.reduce((l,c)=>l+c.sentiment,0)/t.length;return o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-lg",children:e.icon}),o.jsx("h3",{className:"text-sm font-bold heading",style:{color:e.cssColor},children:e.name}),o.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-muted)"},children:[a," signals"]})]}),o.jsxs("div",{className:"flex items-center gap-3 text-[10px]",children:[o.jsxs("span",{style:{color:"var(--text-muted)"},children:["Peak:"," ",o.jsxs("span",{className:"font-bold",style:{color:e.cssColor},children:[(i*100).toFixed(0),"%"]})]}),o.jsxs("span",{className:"mono",style:{color:s>0?"var(--green)":s<0?"var(--red)":"var(--text-muted)"},children:["Sentiment: ",s>0?"+":"",s.toFixed(3)]})]})]}),o.jsx("div",{className:"grid grid-cols-8 gap-2",children:t.map(l=>o.jsx(see,{subcategory:l.name,intensity:l.intensity,signalCount:l.signalCount,sentiment:l.sentiment,baseColor:e.baseColor,onClick:()=>r({category:e.name,subcategory:l.name,...l}),isSelected:(n==null?void 0:n.category)===e.name&&(n==null?void 0:n.subcategory)===l.name},l.name))})]})}function cee(){return o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"stat-label",children:"Low"}),o.jsx("div",{className:"flex gap-px",children:Array.from({length:10}).map((t,r)=>o.jsx("div",{className:"w-5 h-3 rounded-sm",style:{backgroundColor:`rgba(0,240,255,${(r+1)/10*.7+.05})`}},r))}),o.jsx("span",{className:"stat-label",children:"High"})]})}function uee({cell:e,signals:t,onClose:r}){if(!e)return null;const n=t.filter(a=>{var s;const i=(a.reasoning||a.ticker||"").toLowerCase();return(s=e.matchingKeywords)==null?void 0:s.some(l=>i.includes(l))}).slice(0,10);return o.jsxs("div",{className:"card-glow fade-in",children:[o.jsxs("div",{className:"flex items-start justify-between mb-3",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx("span",{className:"text-lg",children:e.categoryIcon}),o.jsxs("h3",{className:"heading text-sm font-bold",style:{color:"var(--text)"},children:[e.category," / ",e.subcategory]})]}),o.jsxs("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:[e.signalCount," signals | Intensity: ",(e.intensity*100).toFixed(0),"% | Sentiment:"," ",o.jsxs("span",{style:{color:e.sentiment>0?"var(--green)":e.sentiment<0?"var(--red)":"var(--text-dim)"},children:[e.sentiment>0?"+":"",e.sentiment.toFixed(3)]})]})]}),o.jsx("button",{onClick:r,className:"btn btn-ghost text-lg leading-none",style:{padding:"0 6px"},children:"×"})]}),n.length>0?o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"stat-label mb-1",children:"Related Signals"}),n.map((a,i)=>o.jsxs("div",{className:"flex items-center gap-3 text-xs rounded-lg px-3 py-2",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[o.jsx("span",{className:"badge",style:a.direction==="BUY_YES"?{background:"var(--green-dim)",color:"var(--green)"}:{background:"var(--red-dim)",color:"var(--red)"},children:a.direction}),o.jsx("span",{className:"mono truncate flex-1",style:{color:"var(--text-dim)"},children:a.ticker}),o.jsxs("span",{className:"mono font-bold",style:{color:"var(--orange)"},children:[(parseFloat(a.expected_edge)*100).toFixed(1),"%"]}),o.jsxs("span",{className:"mono",style:{color:"var(--blue)"},children:[(parseFloat(a.confidence)*100).toFixed(0),"%"]}),a.risk_approved?o.jsx("span",{className:"text-[9px] font-bold",style:{color:"var(--green)"},children:"OK"}):o.jsx("span",{className:"text-[9px] font-bold",style:{color:"var(--red)"},children:"BLOCKED"})]},i))]}):o.jsx("p",{className:"text-sm text-center py-4",style:{color:"var(--text-muted)"},children:"No matching signals for this subcategory"})]})}function dee({categoryStats:e}){const t=Math.max(...e.map(r=>r.totalSignals),1);return o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[o.jsx("h2",{className:"section-title",children:"National Activity Overview"}),o.jsx("span",{className:"section-subtitle",children:"Signal density across categories"})]}),o.jsx("div",{className:"space-y-2",children:e.sort((r,n)=>n.totalSignals-r.totalSignals).map(r=>{const n=r.totalSignals/t*100;return o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"text-sm w-5",children:r.icon}),o.jsx("span",{className:"text-xs font-medium w-20 heading",style:{color:r.cssColor||`rgb(${r.baseColor.join(",")})`},children:r.name}),o.jsxs("div",{className:"flex-1 h-5 rounded-full overflow-hidden relative",style:{background:"var(--surface-el)"},children:[o.jsx("div",{className:"h-full rounded-full transition-all duration-1000 relative overflow-hidden",style:{width:`${Math.max(n,2)}%`,background:`linear-gradient(90deg, rgba(${r.baseColor.join(",")},0.3), rgba(${r.baseColor.join(",")},0.6))`},children:o.jsx("div",{className:"absolute inset-0",style:{background:"linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%)",animation:"shimmer 2s infinite"}})}),o.jsx("span",{className:"absolute right-2 top-0 bottom-0 flex items-center text-[10px] mono",style:{color:"var(--text-dim)"},children:r.totalSignals})]}),o.jsxs("span",{className:"text-[10px] mono w-12 text-right",style:{color:r.avgSentiment>0?"var(--green)":r.avgSentiment<0?"var(--red)":"var(--text-muted)"},children:[r.avgSentiment>0?"+":"",r.avgSentiment.toFixed(2)]})]},r.name)})})]})}function fee(){const[e,t]=P.useState(null),[r,n]=P.useState(null),[a,i]=P.useState(null),[s,l]=P.useState(!0),[c,u]=P.useState(null),[f,d]=P.useState("24h");P.useEffect(()=>{h();const v=setInterval(h,3e4);return()=>clearInterval(v)},[]);async function h(){try{const[v,m,x]=await Promise.all([Oe("/dashboard"),Oe("/signals"),Oe("/signals/dashboard")]);t(v),n((m==null?void 0:m.signals)||[]),i(x)}catch{}l(!1)}const{categoryData:p,categoryStats:g,overallStats:y}=P.useMemo(()=>{var w;if(!r)return{categoryData:[],categoryStats:[],overallStats:{}};const v=r||[],m=Math.max(...kc.flatMap(_=>_.subcategories.map(O=>(_.keywords.filter(k=>O.toLowerCase().includes(k.split(" ")[0])||k.includes(O.toLowerCase())),v.filter(k=>{const E=(k.reasoning||k.ticker||"").toLowerCase();return _.keywords.some(T=>E.includes(T))}).length))),1),x=kc.map(_=>{const O=v.filter(k=>{const E=(k.reasoning||k.ticker||"").toLowerCase();return _.keywords.some(T=>E.includes(T))});O.length,O.length>0&&O.reduce((k,E)=>{const T=(E.sources||[]).reduce((D,A)=>D+(A.sentiment||0),0);return k+T},0)/Math.max(O.length,1);const N=_.subcategories.map(k=>{const E=_.keywords.filter(C=>{const M=k.toLowerCase();return C.includes(M)||M.includes(C.split(" ")[0])});let T;if(E.length>0)T=v.filter(C=>{const M=(C.reasoning||C.ticker||"").toLowerCase();return E.some(I=>M.includes(I))});else{const C=k.split("").reduce((M,I)=>(M<<5)-M+I.charCodeAt(0)|0,0);T=O.filter((M,I)=>I%_.subcategories.length===Math.abs(C)%_.subcategories.length)}const D=T.length,A=T.reduce((C,M)=>{const I=(M.sources||[]).reduce((R,F)=>R+(F.sentiment||0),0);return C+I},0)/Math.max(T.length,1),L=Math.min(1,D/Math.max(m*.5,1));return{name:k,signalCount:D,sentiment:A,intensity:L,matchingKeywords:E.length>0?E:_.keywords,categoryIcon:_.icon}});return{category:_,subcategoryData:N}}),S=kc.map(_=>{const O=v.filter(N=>{const k=(N.reasoning||N.ticker||"").toLowerCase();return _.keywords.some(E=>k.includes(E))});return{name:_.name,icon:_.icon,baseColor:_.baseColor,cssColor:_.cssColor,totalSignals:O.length,avgSentiment:O.length>0?O.reduce((N,k)=>N+(k.sources||[]).reduce((E,T)=>E+(T.sentiment||0),0),0)/O.length:0}}),j={totalSignals:v.length,buyYes:v.filter(_=>_.direction==="BUY_YES").length,buyNo:v.filter(_=>_.direction==="BUY_NO").length,approved:v.filter(_=>_.risk_approved).length,avgEdge:v.length>0?v.reduce((_,O)=>_+parseFloat(O.expected_edge||0),0)/v.length:0,avgConf:v.length>0?v.reduce((_,O)=>_+parseFloat(O.confidence||0),0)/v.length:0,hottest:((w=[...S].sort((_,O)=>O.totalSignals-_.totalSignals)[0])==null?void 0:w.name)||"None"};return{categoryData:x,categoryStats:S,overallStats:j}},[r]);if(s)return o.jsx("div",{className:"flex items-center justify-center h-64",children:o.jsx("div",{className:"w-8 h-8 rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"var(--cyan)",borderTopColor:"transparent"}})});const b=[{label:"Total Signals",value:y.totalSignals||0,color:"var(--cyan)"},{label:"BUY YES",value:y.buyYes||0,color:"var(--green)"},{label:"BUY NO",value:y.buyNo||0,color:"var(--red)"},{label:"Approved",value:y.approved||0,color:"var(--green)"},{label:"Avg Edge",value:`${((y.avgEdge||0)*100).toFixed(1)}%`,color:"var(--orange)"},{label:"Avg Confidence",value:`${((y.avgConf||0)*100).toFixed(0)}%`,color:"var(--blue)"},{label:"Hottest Sector",value:y.hottest,color:"var(--red)"}];return o.jsxs("div",{className:"space-y-6",children:[o.jsx("style",{children:`
+ @keyframes shimmer {
+ 0% { transform: translateX(-100%); }
+ 100% { transform: translateX(200%); }
+ }
+ `}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"heading text-2xl font-bold flex items-center gap-3",children:[o.jsx("span",{className:"inline-flex items-center justify-center w-3 h-3 rounded-full pulse-cyan",style:{backgroundColor:"var(--cyan)",flexShrink:0}}),o.jsx("span",{className:"gradient-cyan",children:"Pulse of America"})]}),o.jsx("p",{className:"section-subtitle mt-1",children:"Sentiment and activity heatmap across American prediction markets"})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{className:"flex items-center gap-0.5 rounded-lg p-0.5",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:["24h","7d","30d"].map(v=>o.jsx("button",{onClick:()=>d(v),className:"btn btn-sm",style:f===v?{background:"var(--cyan)",color:"var(--bg)",fontWeight:700}:{background:"transparent",color:"var(--text-muted)"},children:v},v))}),o.jsx("button",{onClick:h,className:"btn btn-o btn-sm",children:"Refresh"})]})]}),o.jsx("div",{className:"grid grid-cols-7 gap-3",children:b.map(v=>o.jsxs("div",{className:"card",children:[o.jsx("p",{className:"stat-label mb-1",children:v.label}),o.jsx("p",{className:"stat-v text-lg",style:{color:v.color},children:v.value})]},v.label))}),o.jsx(dee,{categoryStats:g}),o.jsxs("div",{className:"card p-4",children:[o.jsxs("div",{className:"flex items-center justify-between mb-5",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"w-2 h-2 rounded-full animate-pulse",style:{backgroundColor:"var(--red)"}}),o.jsx("h2",{className:"section-title",children:"Live Signal Heatmap"})]}),o.jsx(cee,{})]}),o.jsx("div",{className:"space-y-5",children:p.map(({category:v,subcategoryData:m})=>o.jsx(lee,{category:v,subcategoryData:m,onCellClick:x=>u((c==null?void 0:c.category)===x.category&&(c==null?void 0:c.subcategory)===x.subcategory?null:x),selectedCell:c},v.name))})]}),c&&o.jsx(uee,{cell:c,signals:r||[],onClose:()=>u(null)}),o.jsxs("div",{className:"card",children:[o.jsx("div",{className:"flex items-center gap-2 mb-4",children:o.jsx("h2",{className:"section-title",children:"Signal Source Breakdown"})}),o.jsx("div",{className:"grid grid-cols-4 gap-3",children:((a==null?void 0:a.sourceBreakdown)||[]).slice(0,8).map(v=>{const m=parseFloat(v.avg_sent)||0,x=parseInt(v.cnt)||0;return o.jsxs("div",{className:"rounded-lg p-3",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsx("span",{className:"text-xs font-bold heading",style:{color:"var(--text-dim)"},children:v.source.replace("_"," ").toUpperCase()}),o.jsx("span",{className:"mono text-xs font-bold",style:{color:"var(--orange)"},children:x})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"progress-bar flex-1",children:o.jsx("div",{className:"progress-fill",style:{width:`${Math.min(100,Math.abs(m)*5e3+10)}%`,background:m>0?"var(--green)":m<0?"var(--red)":"var(--text-muted)"}})}),o.jsxs("span",{className:"text-[10px] mono",style:{color:m>0?"var(--green)":m<0?"var(--red)":"var(--text-muted)"},children:[m>0?"+":"",m.toFixed(3)]})]})]},v.source)})})]}),e&&o.jsxs("div",{className:"card",children:[o.jsx("div",{className:"flex items-center gap-2 mb-4",children:o.jsx("h2",{className:"section-title",children:"Market Pulse Metrics"})}),o.jsx("div",{className:"grid grid-cols-5 gap-3 text-center",children:[{label:"Balance",value:`$${e.balance?(e.balance/100).toLocaleString(void 0,{minimumFractionDigits:0}):"0"}`,color:"var(--green)"},{label:"Today's P&L",value:`${(e.daily_pnl||0)>=0?"+":""}$${((e.daily_pnl||0)/100).toFixed(2)}`,color:(e.daily_pnl||0)>=0?"var(--green)":"var(--red)"},{label:"Today's Trades",value:(e.today_trades||0).toLocaleString(),color:"var(--orange)"},{label:"Win Rate",value:`${e.today_trades>0?(e.today_wins/e.today_trades*100).toFixed(1):"0"}%`,color:e.today_trades>0&&e.today_wins/e.today_trades*100>=50?"var(--green)":"var(--red)"},{label:"Markets Tracked",value:e.markets_tracked||0,color:"var(--purple)"}].map(v=>o.jsxs("div",{className:"rounded-lg p-3",style:{background:"var(--surface-el)",border:"1px solid var(--border)"},children:[o.jsx("p",{className:"stat-label mb-1",children:v.label}),o.jsx("p",{className:"stat-v text-lg",style:{color:v.color},children:v.value})]},v.label))})]})]})}function hee(){return o.jsx(EC,{children:o.jsxs(_C,{children:[o.jsx(it,{path:"/login",element:o.jsx(WC,{})}),o.jsx(it,{path:"/setup",element:o.jsx(oE,{})}),o.jsxs(it,{path:"/",element:o.jsx(YC,{}),children:[o.jsx(it,{index:!0,element:o.jsx(cZ,{})}),o.jsx(it,{path:"markets",element:o.jsx(fZ,{})}),o.jsx(it,{path:"positions",element:o.jsx(vZ,{})}),o.jsx(it,{path:"orders",element:o.jsx(xZ,{})}),o.jsx(it,{path:"signals",element:o.jsx(WZ,{})}),o.jsx(it,{path:"intelligence",element:o.jsx(KZ,{})}),o.jsx(it,{path:"trading",element:o.jsx(VZ,{})}),o.jsx(it,{path:"heatmap",element:o.jsx(ZZ,{})}),o.jsx(it,{path:"orbit",element:o.jsx(nee,{})}),o.jsx(it,{path:"pulse",element:o.jsx(fee,{})}),o.jsx(it,{path:"weather",element:o.jsx(bZ,{})}),o.jsx(it,{path:"risk",element:o.jsx(CZ,{})}),o.jsx(it,{path:"settings",element:o.jsx(IZ,{})})]})]})})}xh.createRoot(document.getElementById("root")).render(o.jsx(hee,{}));
diff --git a/kalshi-dash/dist/index.html b/kalshi-dash/dist/index.html
index a98a040..f507deb 100644
--- a/kalshi-dash/dist/index.html
+++ b/kalshi-dash/dist/index.html
@@ -7,7 +7,7 @@
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
- <script type="module" crossorigin src="/assets/index-C4YFWfm7.js"></script>
+ <script type="module" crossorigin src="/assets/index-_K_ynK5-.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-BXhqt972.css">
</head>
<body>
diff --git a/kalshi-dash/src/pages/Dashboard.jsx b/kalshi-dash/src/pages/Dashboard.jsx
index 49de76a..d4a9f97 100644
--- a/kalshi-dash/src/pages/Dashboard.jsx
+++ b/kalshi-dash/src/pages/Dashboard.jsx
@@ -1211,6 +1211,58 @@ function AnimatedStatCard({ label, rawValue, displayValue, color, accent, icon,
}
/* ══ Main Dashboard ══ */
+/* ── Collapsible Section Wrapper ── */
+function CollapsibleSection({ title, defaultOpen = true, children }) {
+ const key = `ken-sec-${title.toLowerCase().replace(/[^a-z0-9]/g, '-')}`;
+ const [open, setOpen] = useState(() => {
+ try { return localStorage.getItem(key) !== 'false'; } catch { return defaultOpen; }
+ });
+ const toggle = () => setOpen(v => {
+ const next = !v;
+ try { localStorage.setItem(key, String(next)); } catch {}
+ return next;
+ });
+ return (
+ <div>
+ <button
+ onClick={toggle}
+ style={{
+ display: 'flex', alignItems: 'center', gap: 8,
+ padding: '2px 0 8px', width: '100%',
+ background: 'transparent', border: 'none', cursor: 'pointer',
+ }}
+ onMouseEnter={e => { e.currentTarget.style.opacity = '0.7'; }}
+ onMouseLeave={e => { e.currentTarget.style.opacity = '1'; }}
+ >
+ <svg
+ style={{
+ width: 12, height: 12, color: 'var(--text-muted)', flexShrink: 0,
+ transition: 'transform 220ms ease',
+ transform: open ? 'rotate(0deg)' : 'rotate(-90deg)',
+ }}
+ fill="none" stroke="currentColor" viewBox="0 0 24 24"
+ >
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M19 9l-7 7-7-7" />
+ </svg>
+ <span style={{
+ fontSize: 10, fontWeight: 700, fontFamily: 'var(--font-body)',
+ color: 'var(--text-muted)', textTransform: 'uppercase', letterSpacing: '0.1em',
+ }}>
+ {title}
+ </span>
+ </button>
+ <div style={{
+ maxHeight: open ? '3500px' : 0,
+ overflow: 'hidden',
+ opacity: open ? 1 : 0,
+ transition: 'max-height 0.4s cubic-bezier(0.4,0,0.2,1), opacity 0.3s ease',
+ }}>
+ {children}
+ </div>
+ </div>
+ );
+}
+
export default function Dashboard() {
const [data, setData] = useState(null);
const [loading, setLoading] = useState(true);
@@ -1330,23 +1382,30 @@ export default function Dashboard() {
</div>
{/* ── 5 Stat Cards with Sparklines + Animated Values ── */}
- <div style={{ display: 'grid', gridTemplateColumns: 'repeat(5,1fr)', gap: 14 }}>
- {statCards.map((s, i) => (
- <AnimatedStatCard key={s.label} {...s} hero={i === 0} />
- ))}
- </div>
+ <CollapsibleSection title="Overview">
+ <div style={{ display: 'grid', gridTemplateColumns: 'repeat(5,1fr)', gap: 14 }}>
+ {statCards.map((s, i) => (
+ <AnimatedStatCard key={s.label} {...s} hero={i === 0} />
+ ))}
+ </div>
+ </CollapsibleSection>
{/* ── Chart 1: Daily P&L Area Chart (Portfolio Performance) ── */}
- <DailyPnlChart dailyPnl={d.daily_pnl_history || d.dailyPnl || []} />
+ <CollapsibleSection title="Portfolio Performance">
+ <DailyPnlChart dailyPnl={d.daily_pnl_history || d.dailyPnl || []} />
+ </CollapsibleSection>
{/* ── Charts 2+3: Strategy Breakdown + Win Rate Radial ── */}
- <div style={{ display: 'grid', gridTemplateColumns: '2fr 1fr', gap: 16 }}>
- <StrategyBreakdownChart strategies={d.strategies} />
- <WinRateRadial winRate={d.win_rate || (d.today_trades > 0 ? d.today_wins / d.today_trades : 0)} />
- </div>
+ <CollapsibleSection title="Strategy Breakdown">
+ <div style={{ display: 'grid', gridTemplateColumns: '2fr 1fr', gap: 16 }}>
+ <StrategyBreakdownChart strategies={d.strategies} />
+ <WinRateRadial winRate={d.win_rate || (d.today_trades > 0 ? d.today_wins / d.today_trades : 0)} />
+ </div>
+ </CollapsibleSection>
{/* ── Capital & Economics ── */}
{d.seed_money > 0 && (
+ <CollapsibleSection title="Capital & Economics">
<div
className="card"
style={{
@@ -1414,12 +1473,16 @@ export default function Dashboard() {
</div>
)}
</div>
+ </CollapsibleSection>
)}
{/* ── Best Opportunities ── */}
- <TopOpportunities opportunities={d.top_opportunities} />
+ <CollapsibleSection title="Best Opportunities">
+ <TopOpportunities opportunities={d.top_opportunities} />
+ </CollapsibleSection>
{/* ── Today's Lessons ── */}
+ <CollapsibleSection title="Today's Performance">
<div
className="card"
style={{
@@ -1471,18 +1534,24 @@ export default function Dashboard() {
))}
</div>
</div>
+ </CollapsibleSection>
{/* ── Strategy Flow + Win Rate Donut ── */}
- <div style={{ display: 'grid', gridTemplateColumns: '2fr 1fr', gap: 16 }}>
- <StrategyFlowDiagram topMarkets={d.top_markets} seedMoney={d.seed_money} balance={d.balance} />
- <WinRateDonut todayWins={d.today_wins} todayLosses={d.today_losses} />
- </div>
+ <CollapsibleSection title="Strategy Flow">
+ <div style={{ display: 'grid', gridTemplateColumns: '2fr 1fr', gap: 16 }}>
+ <StrategyFlowDiagram topMarkets={d.top_markets} seedMoney={d.seed_money} balance={d.balance} />
+ <WinRateDonut todayWins={d.today_wins} todayLosses={d.today_losses} />
+ </div>
+ </CollapsibleSection>
{/* ── What To Do Next ── */}
- <NextActions topMarkets={d.top_markets} worstMarkets={d.worst_markets} strategies={d.strategies} />
+ <CollapsibleSection title="Action Plan">
+ <NextActions topMarkets={d.top_markets} worstMarkets={d.worst_markets} strategies={d.strategies} />
+ </CollapsibleSection>
{/* ── Top Markets Table ── */}
{(d.top_markets || []).length > 0 && (
+ <CollapsibleSection title="Top Markets">
<div className="card">
<div className="section-title" style={{ marginBottom: 14 }}>
<svg style={{ width: 18, height: 18, color: 'var(--green)' }} fill="none" stroke="currentColor" viewBox="0 0 24 24">
@@ -1549,10 +1618,12 @@ export default function Dashboard() {
</table>
</div>
</div>
+ </CollapsibleSection>
)}
{/* ── Worst Markets Table ── */}
{(d.worst_markets || []).length > 0 && (
+ <CollapsibleSection title="Bleeding Markets">
<div className="card" style={{ border: '1px solid rgba(255,92,92,0.12)' }}>
<div className="section-title" style={{ marginBottom: 14, color: 'var(--red)' }}>
<svg style={{ width: 18, height: 18 }} fill="none" stroke="currentColor" viewBox="0 0 24 24">
@@ -1610,10 +1681,12 @@ export default function Dashboard() {
</table>
</div>
</div>
+ </CollapsibleSection>
)}
{/* ── P&L History Chart ── */}
{pnlData.length > 0 && (
+ <CollapsibleSection title="P&L History">
<div className="card">
<div className="section-title" style={{ marginBottom: 14 }}>
<svg style={{ width: 18, height: 18, color: 'var(--cyan)' }} fill="none" stroke="currentColor" viewBox="0 0 24 24">
@@ -1639,12 +1712,16 @@ export default function Dashboard() {
</AreaChart>
</ResponsiveContainer>
</div>
+ </CollapsibleSection>
)}
{/* ── Strategy P&L Bar Chart ── */}
- <StrategyBars strategies={d.strategies} />
+ <CollapsibleSection title="Strategy P&L">
+ <StrategyBars strategies={d.strategies} />
+ </CollapsibleSection>
{/* ── Strategy Leaderboard ── */}
+ <CollapsibleSection title="Strategy Leaderboard">
<div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 16 }}>
{/* Top Strategies */}
<div className="card">
@@ -1718,11 +1795,15 @@ export default function Dashboard() {
</div>
</div>
</div>
+ </CollapsibleSection>
{/* ── Strategy Deep Dive ── */}
- <StrategyDeepDive />
+ <CollapsibleSection title="Strategy Deep Dive" defaultOpen={false}>
+ <StrategyDeepDive />
+ </CollapsibleSection>
{/* ── Recent Fills + Quick Actions ── */}
+ <CollapsibleSection title="Recent Activity">
<div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 16 }}>
{/* Recent Fills */}
<div className="card">
@@ -1813,6 +1894,7 @@ export default function Dashboard() {
</div>
</div>
</div>
+ </CollapsibleSection>
</div>
);
}
← 2671dca chore(alshi-dash,kalshi-dash): update 9 files (.css) [+918/-
·
back to Bertha
·
chore(alshi-dash): update 1 file (.js) [+12/-12] 8acefa6 →