@betterdb/monitor 0.4.2 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,312 @@
1
+ var l$=Object.defineProperty;var c$=(e,t,r)=>t in e?l$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Fo=(e,t,r)=>c$(e,typeof t!="symbol"?t+"":t,r);function u$(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(n,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>n[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();function li(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Jv={exports:{}},Sc={},eg={exports:{}},Be={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var _S;function d$(){if(_S)return Be;_S=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function v(I){return I===null||typeof I!="object"?null:(I=p&&I[p]||I["@@iterator"],typeof I=="function"?I:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,b={};function w(I,H,oe){this.props=I,this.context=H,this.refs=b,this.updater=oe||g}w.prototype.isReactComponent={},w.prototype.setState=function(I,H){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,H,"setState")},w.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function N(){}N.prototype=w.prototype;function P(I,H,oe){this.props=I,this.context=H,this.refs=b,this.updater=oe||g}var E=P.prototype=new N;E.constructor=P,j(E,w.prototype),E.isPureReactComponent=!0;var k=Array.isArray,C=Object.prototype.hasOwnProperty,T={current:null},A={key:!0,ref:!0,__self:!0,__source:!0};function M(I,H,oe){var se,be={},Ae=null,de=null;if(H!=null)for(se in H.ref!==void 0&&(de=H.ref),H.key!==void 0&&(Ae=""+H.key),H)C.call(H,se)&&!A.hasOwnProperty(se)&&(be[se]=H[se]);var Se=arguments.length-2;if(Se===1)be.children=oe;else if(1<Se){for(var J=Array(Se),pe=0;pe<Se;pe++)J[pe]=arguments[pe+2];be.children=J}if(I&&I.defaultProps)for(se in Se=I.defaultProps,Se)be[se]===void 0&&(be[se]=Se[se]);return{$$typeof:e,type:I,key:Ae,ref:de,props:be,_owner:T.current}}function z(I,H){return{$$typeof:e,type:I.type,key:H,ref:I.ref,props:I.props,_owner:I._owner}}function V(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function L(I){var H={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(oe){return H[oe]})}var K=/\/+/g;function te(I,H){return typeof I=="object"&&I!==null&&I.key!=null?L(""+I.key):H.toString(36)}function R(I,H,oe,se,be){var Ae=typeof I;(Ae==="undefined"||Ae==="boolean")&&(I=null);var de=!1;if(I===null)de=!0;else switch(Ae){case"string":case"number":de=!0;break;case"object":switch(I.$$typeof){case e:case t:de=!0}}if(de)return de=I,be=be(de),I=se===""?"."+te(de,0):se,k(be)?(oe="",I!=null&&(oe=I.replace(K,"$&/")+"/"),R(be,H,oe,"",function(pe){return pe})):be!=null&&(V(be)&&(be=z(be,oe+(!be.key||de&&de.key===be.key?"":(""+be.key).replace(K,"$&/")+"/")+I)),H.push(be)),1;if(de=0,se=se===""?".":se+":",k(I))for(var Se=0;Se<I.length;Se++){Ae=I[Se];var J=se+te(Ae,Se);de+=R(Ae,H,oe,J,be)}else if(J=v(I),typeof J=="function")for(I=J.call(I),Se=0;!(Ae=I.next()).done;)Ae=Ae.value,J=se+te(Ae,Se++),de+=R(Ae,H,oe,J,be);else if(Ae==="object")throw H=String(I),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.");return de}function U(I,H,oe){if(I==null)return I;var se=[],be=0;return R(I,se,"","",function(Ae){return H.call(oe,Ae,be++)}),se}function F(I){if(I._status===-1){var H=I._result;H=H(),H.then(function(oe){(I._status===0||I._status===-1)&&(I._status=1,I._result=oe)},function(oe){(I._status===0||I._status===-1)&&(I._status=2,I._result=oe)}),I._status===-1&&(I._status=0,I._result=H)}if(I._status===1)return I._result.default;throw I._result}var X={current:null},$={transition:null},Y={ReactCurrentDispatcher:X,ReactCurrentBatchConfig:$,ReactCurrentOwner:T};function W(){throw Error("act(...) is not supported in production builds of React.")}return Be.Children={map:U,forEach:function(I,H,oe){U(I,function(){H.apply(this,arguments)},oe)},count:function(I){var H=0;return U(I,function(){H++}),H},toArray:function(I){return U(I,function(H){return H})||[]},only:function(I){if(!V(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},Be.Component=w,Be.Fragment=r,Be.Profiler=i,Be.PureComponent=P,Be.StrictMode=n,Be.Suspense=d,Be.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y,Be.act=W,Be.cloneElement=function(I,H,oe){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var se=j({},I.props),be=I.key,Ae=I.ref,de=I._owner;if(H!=null){if(H.ref!==void 0&&(Ae=H.ref,de=T.current),H.key!==void 0&&(be=""+H.key),I.type&&I.type.defaultProps)var Se=I.type.defaultProps;for(J in H)C.call(H,J)&&!A.hasOwnProperty(J)&&(se[J]=H[J]===void 0&&Se!==void 0?Se[J]:H[J])}var J=arguments.length-2;if(J===1)se.children=oe;else if(1<J){Se=Array(J);for(var pe=0;pe<J;pe++)Se[pe]=arguments[pe+2];se.children=Se}return{$$typeof:e,type:I.type,key:be,ref:Ae,props:se,_owner:de}},Be.createContext=function(I){return I={$$typeof:s,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},I.Provider={$$typeof:a,_context:I},I.Consumer=I},Be.createElement=M,Be.createFactory=function(I){var H=M.bind(null,I);return H.type=I,H},Be.createRef=function(){return{current:null}},Be.forwardRef=function(I){return{$$typeof:u,render:I}},Be.isValidElement=V,Be.lazy=function(I){return{$$typeof:h,_payload:{_status:-1,_result:I},_init:F}},Be.memo=function(I,H){return{$$typeof:f,type:I,compare:H===void 0?null:H}},Be.startTransition=function(I){var H=$.transition;$.transition={};try{I()}finally{$.transition=H}},Be.unstable_act=W,Be.useCallback=function(I,H){return X.current.useCallback(I,H)},Be.useContext=function(I){return X.current.useContext(I)},Be.useDebugValue=function(){},Be.useDeferredValue=function(I){return X.current.useDeferredValue(I)},Be.useEffect=function(I,H){return X.current.useEffect(I,H)},Be.useId=function(){return X.current.useId()},Be.useImperativeHandle=function(I,H,oe){return X.current.useImperativeHandle(I,H,oe)},Be.useInsertionEffect=function(I,H){return X.current.useInsertionEffect(I,H)},Be.useLayoutEffect=function(I,H){return X.current.useLayoutEffect(I,H)},Be.useMemo=function(I,H){return X.current.useMemo(I,H)},Be.useReducer=function(I,H,oe){return X.current.useReducer(I,H,oe)},Be.useRef=function(I){return X.current.useRef(I)},Be.useState=function(I){return X.current.useState(I)},Be.useSyncExternalStore=function(I,H,oe){return X.current.useSyncExternalStore(I,H,oe)},Be.useTransition=function(){return X.current.useTransition()},Be.version="18.3.1",Be}var ES;function bl(){return ES||(ES=1,eg.exports=d$()),eg.exports}/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var CS;function f$(){if(CS)return Sc;CS=1;var e=bl(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(u,d,f){var h,p={},v=null,g=null;f!==void 0&&(v=""+f),d.key!==void 0&&(v=""+d.key),d.ref!==void 0&&(g=d.ref);for(h in d)n.call(d,h)&&!a.hasOwnProperty(h)&&(p[h]=d[h]);if(u&&u.defaultProps)for(h in d=u.defaultProps,d)p[h]===void 0&&(p[h]=d[h]);return{$$typeof:t,type:u,key:v,ref:g,props:p,_owner:i.current}}return Sc.Fragment=r,Sc.jsx=s,Sc.jsxs=s,Sc}var OS;function h$(){return OS||(OS=1,Jv.exports=f$()),Jv.exports}var l=h$(),y=bl();const xr=li(y),_0=u$({__proto__:null,default:xr},[y]);var af={},tg={exports:{}},Hr={},rg={exports:{}},ng={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var AS;function m$(){return AS||(AS=1,(function(e){function t($,Y){var W=$.length;$.push(Y);e:for(;0<W;){var I=W-1>>>1,H=$[I];if(0<i(H,Y))$[I]=Y,$[W]=H,W=I;else break e}}function r($){return $.length===0?null:$[0]}function n($){if($.length===0)return null;var Y=$[0],W=$.pop();if(W!==Y){$[0]=W;e:for(var I=0,H=$.length,oe=H>>>1;I<oe;){var se=2*(I+1)-1,be=$[se],Ae=se+1,de=$[Ae];if(0>i(be,W))Ae<H&&0>i(de,be)?($[I]=de,$[Ae]=W,I=Ae):($[I]=be,$[se]=W,I=se);else if(Ae<H&&0>i(de,W))$[I]=de,$[Ae]=W,I=Ae;else break e}}return Y}function i($,Y){var W=$.sortIndex-Y.sortIndex;return W!==0?W:$.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var s=Date,u=s.now();e.unstable_now=function(){return s.now()-u}}var d=[],f=[],h=1,p=null,v=3,g=!1,j=!1,b=!1,w=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E($){for(var Y=r(f);Y!==null;){if(Y.callback===null)n(f);else if(Y.startTime<=$)n(f),Y.sortIndex=Y.expirationTime,t(d,Y);else break;Y=r(f)}}function k($){if(b=!1,E($),!j)if(r(d)!==null)j=!0,F(C);else{var Y=r(f);Y!==null&&X(k,Y.startTime-$)}}function C($,Y){j=!1,b&&(b=!1,N(M),M=-1),g=!0;var W=v;try{for(E(Y),p=r(d);p!==null&&(!(p.expirationTime>Y)||$&&!L());){var I=p.callback;if(typeof I=="function"){p.callback=null,v=p.priorityLevel;var H=I(p.expirationTime<=Y);Y=e.unstable_now(),typeof H=="function"?p.callback=H:p===r(d)&&n(d),E(Y)}else n(d);p=r(d)}if(p!==null)var oe=!0;else{var se=r(f);se!==null&&X(k,se.startTime-Y),oe=!1}return oe}finally{p=null,v=W,g=!1}}var T=!1,A=null,M=-1,z=5,V=-1;function L(){return!(e.unstable_now()-V<z)}function K(){if(A!==null){var $=e.unstable_now();V=$;var Y=!0;try{Y=A(!0,$)}finally{Y?te():(T=!1,A=null)}}else T=!1}var te;if(typeof P=="function")te=function(){P(K)};else if(typeof MessageChannel<"u"){var R=new MessageChannel,U=R.port2;R.port1.onmessage=K,te=function(){U.postMessage(null)}}else te=function(){w(K,0)};function F($){A=$,T||(T=!0,te())}function X($,Y){M=w(function(){$(e.unstable_now())},Y)}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($){$.callback=null},e.unstable_continueExecution=function(){j||g||(j=!0,F(C))},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return r(d)},e.unstable_next=function($){switch(v){case 1:case 2:case 3:var Y=3;break;default:Y=v}var W=v;v=Y;try{return $()}finally{v=W}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,Y){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var W=v;v=$;try{return Y()}finally{v=W}},e.unstable_scheduleCallback=function($,Y,W){var I=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?I+W:I):W=I,$){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=W+H,$={id:h++,callback:Y,priorityLevel:$,startTime:W,expirationTime:H,sortIndex:-1},W>I?($.sortIndex=W,t(f,$),r(d)===null&&$===r(f)&&(b?(N(M),M=-1):b=!0,X(k,W-I))):($.sortIndex=H,t(d,$),j||g||(j=!0,F(C))),$},e.unstable_shouldYield=L,e.unstable_wrapCallback=function($){var Y=v;return function(){var W=v;v=Y;try{return $.apply(this,arguments)}finally{v=W}}}})(ng)),ng}var TS;function p$(){return TS||(TS=1,rg.exports=m$()),rg.exports}/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var MS;function v$(){if(MS)return Hr;MS=1;var e=bl(),t=p$();function r(o){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+o,m=1;m<arguments.length;m++)c+="&args[]="+encodeURIComponent(arguments[m]);return"Minified React error #"+o+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,i={};function a(o,c){s(o,c),s(o+"Capture",c)}function s(o,c){for(i[o]=c,o=0;o<c.length;o++)n.add(c[o])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,f=/^[: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]*$/,h={},p={};function v(o){return d.call(p,o)?!0:d.call(h,o)?!1:f.test(o)?p[o]=!0:(h[o]=!0,!1)}function g(o,c,m,x){if(m!==null&&m.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return x?!1:m!==null?!m.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function j(o,c,m,x){if(c===null||typeof c>"u"||g(o,c,m,x))return!0;if(x)return!1;if(m!==null)switch(m.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function b(o,c,m,x,S,_,O){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=x,this.attributeNamespace=S,this.mustUseProperty=m,this.propertyName=o,this.type=c,this.sanitizeURL=_,this.removeEmptyString=O}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){w[o]=new b(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var c=o[0];w[c]=new b(c,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){w[o]=new b(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){w[o]=new b(o,2,!1,o,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(o){w[o]=new b(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){w[o]=new b(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){w[o]=new b(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){w[o]=new b(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){w[o]=new b(o,5,!1,o.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function P(o){return o[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(o){var c=o.replace(N,P);w[c]=new b(c,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var c=o.replace(N,P);w[c]=new b(c,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var c=o.replace(N,P);w[c]=new b(c,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){w[o]=new b(o,1,!1,o.toLowerCase(),null,!1,!1)}),w.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){w[o]=new b(o,1,!1,o.toLowerCase(),null,!0,!0)});function E(o,c,m,x){var S=w.hasOwnProperty(c)?w[c]:null;(S!==null?S.type!==0:x||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(j(c,m,S,x)&&(m=null),x||S===null?v(c)&&(m===null?o.removeAttribute(c):o.setAttribute(c,""+m)):S.mustUseProperty?o[S.propertyName]=m===null?S.type===3?!1:"":m:(c=S.attributeName,x=S.attributeNamespace,m===null?o.removeAttribute(c):(S=S.type,m=S===3||S===4&&m===!0?"":""+m,x?o.setAttributeNS(x,c,m):o.setAttribute(c,m))))}var k=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,C=Symbol.for("react.element"),T=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),V=Symbol.for("react.provider"),L=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),te=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),X=Symbol.for("react.offscreen"),$=Symbol.iterator;function Y(o){return o===null||typeof o!="object"?null:(o=$&&o[$]||o["@@iterator"],typeof o=="function"?o:null)}var W=Object.assign,I;function H(o){if(I===void 0)try{throw Error()}catch(m){var c=m.stack.trim().match(/\n( *(at )?)/);I=c&&c[1]||""}return`
34
+ `+I+o}var oe=!1;function se(o,c){if(!o||oe)return"";oe=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(ee){var x=ee}Reflect.construct(o,[],c)}else{try{c.call()}catch(ee){x=ee}o.call(c.prototype)}else{try{throw Error()}catch(ee){x=ee}o()}}catch(ee){if(ee&&x&&typeof ee.stack=="string"){for(var S=ee.stack.split(`
35
+ `),_=x.stack.split(`
36
+ `),O=S.length-1,D=_.length-1;1<=O&&0<=D&&S[O]!==_[D];)D--;for(;1<=O&&0<=D;O--,D--)if(S[O]!==_[D]){if(O!==1||D!==1)do if(O--,D--,0>D||S[O]!==_[D]){var B=`
37
+ `+S[O].replace(" at new "," at ");return o.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",o.displayName)),B}while(1<=O&&0<=D);break}}}finally{oe=!1,Error.prepareStackTrace=m}return(o=o?o.displayName||o.name:"")?H(o):""}function be(o){switch(o.tag){case 5:return H(o.type);case 16:return H("Lazy");case 13:return H("Suspense");case 19:return H("SuspenseList");case 0:case 2:case 15:return o=se(o.type,!1),o;case 11:return o=se(o.type.render,!1),o;case 1:return o=se(o.type,!0),o;default:return""}}function Ae(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case A:return"Fragment";case T:return"Portal";case z:return"Profiler";case M:return"StrictMode";case te:return"Suspense";case R:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case L:return(o.displayName||"Context")+".Consumer";case V:return(o._context.displayName||"Context")+".Provider";case K:var c=o.render;return o=o.displayName,o||(o=c.displayName||c.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case U:return c=o.displayName||null,c!==null?c:Ae(o.type)||"Memo";case F:c=o._payload,o=o._init;try{return Ae(o(c))}catch{}}return null}function de(o){var c=o.type;switch(o.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=c.render,o=o.displayName||o.name||"",c.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ae(c);case 8:return c===M?"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 c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function Se(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function J(o){var c=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function pe(o){var c=J(o)?"checked":"value",m=Object.getOwnPropertyDescriptor(o.constructor.prototype,c),x=""+o[c];if(!o.hasOwnProperty(c)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var S=m.get,_=m.set;return Object.defineProperty(o,c,{configurable:!0,get:function(){return S.call(this)},set:function(O){x=""+O,_.call(this,O)}}),Object.defineProperty(o,c,{enumerable:m.enumerable}),{getValue:function(){return x},setValue:function(O){x=""+O},stopTracking:function(){o._valueTracker=null,delete o[c]}}}}function Le(o){o._valueTracker||(o._valueTracker=pe(o))}function re(o){if(!o)return!1;var c=o._valueTracker;if(!c)return!0;var m=c.getValue(),x="";return o&&(x=J(o)?o.checked?"true":"false":o.value),o=x,o!==m?(c.setValue(o),!0):!1}function ot(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function We(o,c){var m=c.checked;return W({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??o._wrapperState.initialChecked})}function jt(o,c){var m=c.defaultValue==null?"":c.defaultValue,x=c.checked!=null?c.checked:c.defaultChecked;m=Se(c.value!=null?c.value:m),o._wrapperState={initialChecked:x,initialValue:m,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function zt(o,c){c=c.checked,c!=null&&E(o,"checked",c,!1)}function mt(o,c){zt(o,c);var m=Se(c.value),x=c.type;if(m!=null)x==="number"?(m===0&&o.value===""||o.value!=m)&&(o.value=""+m):o.value!==""+m&&(o.value=""+m);else if(x==="submit"||x==="reset"){o.removeAttribute("value");return}c.hasOwnProperty("value")?di(o,c.type,m):c.hasOwnProperty("defaultValue")&&di(o,c.type,Se(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(o.defaultChecked=!!c.defaultChecked)}function Un(o,c,m){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var x=c.type;if(!(x!=="submit"&&x!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+o._wrapperState.initialValue,m||c===o.value||(o.value=c),o.defaultValue=c}m=o.name,m!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,m!==""&&(o.name=m)}function di(o,c,m){(c!=="number"||ot(o.ownerDocument)!==o)&&(m==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+m&&(o.defaultValue=""+m))}var $r=Array.isArray;function st(o,c,m,x){if(o=o.options,c){c={};for(var S=0;S<m.length;S++)c["$"+m[S]]=!0;for(m=0;m<o.length;m++)S=c.hasOwnProperty("$"+o[m].value),o[m].selected!==S&&(o[m].selected=S),S&&x&&(o[m].defaultSelected=!0)}else{for(m=""+Se(m),c=null,S=0;S<o.length;S++){if(o[S].value===m){o[S].selected=!0,x&&(o[S].defaultSelected=!0);return}c!==null||o[S].disabled||(c=o[S])}c!==null&&(c.selected=!0)}}function fi(o,c){if(c.dangerouslySetInnerHTML!=null)throw Error(r(91));return W({},c,{value:void 0,defaultValue:void 0,children:""+o._wrapperState.initialValue})}function Po(o,c){var m=c.value;if(m==null){if(m=c.children,c=c.defaultValue,m!=null){if(c!=null)throw Error(r(92));if($r(m)){if(1<m.length)throw Error(r(93));m=m[0]}c=m}c==null&&(c=""),m=c}o._wrapperState={initialValue:Se(m)}}function Bi(o,c){var m=Se(c.value),x=Se(c.defaultValue);m!=null&&(m=""+m,m!==o.value&&(o.value=m),c.defaultValue==null&&o.defaultValue!==m&&(o.defaultValue=m)),x!=null&&(o.defaultValue=""+x)}function ko(o){var c=o.textContent;c===o._wrapperState.initialValue&&c!==""&&c!==null&&(o.value=c)}function Ia(o){switch(o){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 Wi(o,c){return o==null||o==="http://www.w3.org/1999/xhtml"?Ia(c):o==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":o}var Jr,Ra=(function(o){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,m,x,S){MSApp.execUnsafeLocalFunction(function(){return o(c,m,x,S)})}:o})(function(o,c){if(o.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in o)o.innerHTML=c;else{for(Jr=Jr||document.createElement("div"),Jr.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=Jr.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;c.firstChild;)o.appendChild(c.firstChild)}});function en(o,c){if(c){var m=o.firstChild;if(m&&m===o.lastChild&&m.nodeType===3){m.nodeValue=c;return}}o.textContent=c}var bn={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},ws=["Webkit","ms","Moz","O"];Object.keys(bn).forEach(function(o){ws.forEach(function(c){c=c+o.charAt(0).toUpperCase()+o.substring(1),bn[c]=bn[o]})});function Da(o,c,m){return c==null||typeof c=="boolean"||c===""?"":m||typeof c!="number"||c===0||bn.hasOwnProperty(o)&&bn[o]?(""+c).trim():c+"px"}function hi(o,c){o=o.style;for(var m in c)if(c.hasOwnProperty(m)){var x=m.indexOf("--")===0,S=Da(m,c[m],x);m==="float"&&(m="cssFloat"),x?o.setProperty(m,S):o[m]=S}}var Ht=W({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 ir(o,c){if(c){if(Ht[o]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(r(137,o));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(r(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(r(61))}if(c.style!=null&&typeof c.style!="object")throw Error(r(62))}}function Ui(o,c){if(o.indexOf("-")===-1)return typeof c.is=="string";switch(o){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 Ki=null;function mi(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var qi=null,tn=null,rn=null;function Hi(o){if(o=lc(o)){if(typeof qi!="function")throw Error(r(280));var c=o.stateNode;c&&(c=xd(c),qi(o.stateNode,o.type,c))}}function La(o){tn?rn?rn.push(o):rn=[o]:tn=o}function _o(){if(tn){var o=tn,c=rn;if(rn=tn=null,Hi(o),c)for(o=0;o<c.length;o++)Hi(c[o])}}function _t(o,c){return o(c)}function ar(){}var Ie=!1;function Ue(o,c,m){if(Ie)return o(c,m);Ie=!0;try{return _t(o,c,m)}finally{Ie=!1,(tn!==null||rn!==null)&&(ar(),_o())}}function Vt(o,c){var m=o.stateNode;if(m===null)return null;var x=xd(m);if(x===null)return null;m=x[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(x=!x.disabled)||(o=o.type,x=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!x;break e;default:o=!1}if(o)return null;if(m&&typeof m!="function")throw Error(r(231,c,typeof m));return m}var Kn=!1;if(u)try{var me={};Object.defineProperty(me,"passive",{get:function(){Kn=!0}}),window.addEventListener("test",me,me),window.removeEventListener("test",me,me)}catch{Kn=!1}function Te(o,c,m,x,S,_,O,D,B){var ee=Array.prototype.slice.call(arguments,3);try{c.apply(m,ee)}catch(ie){this.onError(ie)}}var Ee=!1,Ye=null,Et=!1,zr=null,wn={onError:function(o){Ee=!0,Ye=o}};function mr(o,c,m,x,S,_,O,D,B){Ee=!1,Ye=null,Te.apply(wn,arguments)}function Fr(o,c,m,x,S,_,O,D,B){if(mr.apply(this,arguments),Ee){if(Ee){var ee=Ye;Ee=!1,Ye=null}else throw Error(r(198));Et||(Et=!0,zr=ee)}}function Xe(o){var c=o,m=o;if(o.alternate)for(;c.return;)c=c.return;else{o=c;do c=o,(c.flags&4098)!==0&&(m=c.return),o=c.return;while(o)}return c.tag===3?m:null}function Vi(o){if(o.tag===13){var c=o.memoizedState;if(c===null&&(o=o.alternate,o!==null&&(c=o.memoizedState)),c!==null)return c.dehydrated}return null}function Qu(o){if(Xe(o)!==o)throw Error(r(188))}function xp(o){var c=o.alternate;if(!c){if(c=Xe(o),c===null)throw Error(r(188));return c!==o?null:o}for(var m=o,x=c;;){var S=m.return;if(S===null)break;var _=S.alternate;if(_===null){if(x=S.return,x!==null){m=x;continue}break}if(S.child===_.child){for(_=S.child;_;){if(_===m)return Qu(S),o;if(_===x)return Qu(S),c;_=_.sibling}throw Error(r(188))}if(m.return!==x.return)m=S,x=_;else{for(var O=!1,D=S.child;D;){if(D===m){O=!0,m=S,x=_;break}if(D===x){O=!0,x=S,m=_;break}D=D.sibling}if(!O){for(D=_.child;D;){if(D===m){O=!0,m=_,x=S;break}if(D===x){O=!0,x=_,m=S;break}D=D.sibling}if(!O)throw Error(r(189))}}if(m.alternate!==x)throw Error(r(190))}if(m.tag!==3)throw Error(r(188));return m.stateNode.current===m?o:c}function zl(o){return o=xp(o),o!==null?Fl(o):null}function Fl(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var c=Fl(o);if(c!==null)return c;o=o.sibling}return null}var Bl=t.unstable_scheduleCallback,Wl=t.unstable_cancelCallback,Zu=t.unstable_shouldYield,et=t.unstable_requestPaint,tt=t.unstable_now,Ul=t.unstable_getCurrentPriorityLevel,Yi=t.unstable_ImmediatePriority,Ju=t.unstable_UserBlockingPriority,$a=t.unstable_NormalPriority,jD=t.unstable_LowPriority,n1=t.unstable_IdlePriority,ed=null,pi=null;function SD(o){if(pi&&typeof pi.onCommitFiberRoot=="function")try{pi.onCommitFiberRoot(ed,o,void 0,(o.current.flags&128)===128)}catch{}}var qn=Math.clz32?Math.clz32:kD,ND=Math.log,PD=Math.LN2;function kD(o){return o>>>=0,o===0?32:31-(ND(o)/PD|0)|0}var td=64,rd=4194304;function Kl(o){switch(o&-o){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 o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function nd(o,c){var m=o.pendingLanes;if(m===0)return 0;var x=0,S=o.suspendedLanes,_=o.pingedLanes,O=m&268435455;if(O!==0){var D=O&~S;D!==0?x=Kl(D):(_&=O,_!==0&&(x=Kl(_)))}else O=m&~S,O!==0?x=Kl(O):_!==0&&(x=Kl(_));if(x===0)return 0;if(c!==0&&c!==x&&(c&S)===0&&(S=x&-x,_=c&-c,S>=_||S===16&&(_&4194240)!==0))return c;if((x&4)!==0&&(x|=m&16),c=o.entangledLanes,c!==0)for(o=o.entanglements,c&=x;0<c;)m=31-qn(c),S=1<<m,x|=o[m],c&=~S;return x}function _D(o,c){switch(o){case 1:case 2:case 4:return c+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 c+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 ED(o,c){for(var m=o.suspendedLanes,x=o.pingedLanes,S=o.expirationTimes,_=o.pendingLanes;0<_;){var O=31-qn(_),D=1<<O,B=S[O];B===-1?((D&m)===0||(D&x)!==0)&&(S[O]=_D(D,c)):B<=c&&(o.expiredLanes|=D),_&=~D}}function bp(o){return o=o.pendingLanes&-1073741825,o!==0?o:o&1073741824?1073741824:0}function i1(){var o=td;return td<<=1,(td&4194240)===0&&(td=64),o}function wp(o){for(var c=[],m=0;31>m;m++)c.push(o);return c}function ql(o,c,m){o.pendingLanes|=c,c!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,c=31-qn(c),o[c]=m}function CD(o,c){var m=o.pendingLanes&~c;o.pendingLanes=c,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=c,o.mutableReadLanes&=c,o.entangledLanes&=c,c=o.entanglements;var x=o.eventTimes;for(o=o.expirationTimes;0<m;){var S=31-qn(m),_=1<<S;c[S]=0,x[S]=-1,o[S]=-1,m&=~_}}function jp(o,c){var m=o.entangledLanes|=c;for(o=o.entanglements;m;){var x=31-qn(m),S=1<<x;S&c|o[x]&c&&(o[x]|=c),m&=~S}}var lt=0;function a1(o){return o&=-o,1<o?4<o?(o&268435455)!==0?16:536870912:4:1}var o1,Sp,s1,l1,c1,Np=!1,id=[],za=null,Fa=null,Ba=null,Hl=new Map,Vl=new Map,Wa=[],OD="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 u1(o,c){switch(o){case"focusin":case"focusout":za=null;break;case"dragenter":case"dragleave":Fa=null;break;case"mouseover":case"mouseout":Ba=null;break;case"pointerover":case"pointerout":Hl.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vl.delete(c.pointerId)}}function Yl(o,c,m,x,S,_){return o===null||o.nativeEvent!==_?(o={blockedOn:c,domEventName:m,eventSystemFlags:x,nativeEvent:_,targetContainers:[S]},c!==null&&(c=lc(c),c!==null&&Sp(c)),o):(o.eventSystemFlags|=x,c=o.targetContainers,S!==null&&c.indexOf(S)===-1&&c.push(S),o)}function AD(o,c,m,x,S){switch(c){case"focusin":return za=Yl(za,o,c,m,x,S),!0;case"dragenter":return Fa=Yl(Fa,o,c,m,x,S),!0;case"mouseover":return Ba=Yl(Ba,o,c,m,x,S),!0;case"pointerover":var _=S.pointerId;return Hl.set(_,Yl(Hl.get(_)||null,o,c,m,x,S)),!0;case"gotpointercapture":return _=S.pointerId,Vl.set(_,Yl(Vl.get(_)||null,o,c,m,x,S)),!0}return!1}function d1(o){var c=Eo(o.target);if(c!==null){var m=Xe(c);if(m!==null){if(c=m.tag,c===13){if(c=Vi(m),c!==null){o.blockedOn=c,c1(o.priority,function(){s1(m)});return}}else if(c===3&&m.stateNode.current.memoizedState.isDehydrated){o.blockedOn=m.tag===3?m.stateNode.containerInfo:null;return}}}o.blockedOn=null}function ad(o){if(o.blockedOn!==null)return!1;for(var c=o.targetContainers;0<c.length;){var m=kp(o.domEventName,o.eventSystemFlags,c[0],o.nativeEvent);if(m===null){m=o.nativeEvent;var x=new m.constructor(m.type,m);Ki=x,m.target.dispatchEvent(x),Ki=null}else return c=lc(m),c!==null&&Sp(c),o.blockedOn=m,!1;c.shift()}return!0}function f1(o,c,m){ad(o)&&m.delete(c)}function TD(){Np=!1,za!==null&&ad(za)&&(za=null),Fa!==null&&ad(Fa)&&(Fa=null),Ba!==null&&ad(Ba)&&(Ba=null),Hl.forEach(f1),Vl.forEach(f1)}function Gl(o,c){o.blockedOn===c&&(o.blockedOn=null,Np||(Np=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,TD)))}function Xl(o){function c(S){return Gl(S,o)}if(0<id.length){Gl(id[0],o);for(var m=1;m<id.length;m++){var x=id[m];x.blockedOn===o&&(x.blockedOn=null)}}for(za!==null&&Gl(za,o),Fa!==null&&Gl(Fa,o),Ba!==null&&Gl(Ba,o),Hl.forEach(c),Vl.forEach(c),m=0;m<Wa.length;m++)x=Wa[m],x.blockedOn===o&&(x.blockedOn=null);for(;0<Wa.length&&(m=Wa[0],m.blockedOn===null);)d1(m),m.blockedOn===null&&Wa.shift()}var js=k.ReactCurrentBatchConfig,od=!0;function MD(o,c,m,x){var S=lt,_=js.transition;js.transition=null;try{lt=1,Pp(o,c,m,x)}finally{lt=S,js.transition=_}}function ID(o,c,m,x){var S=lt,_=js.transition;js.transition=null;try{lt=4,Pp(o,c,m,x)}finally{lt=S,js.transition=_}}function Pp(o,c,m,x){if(od){var S=kp(o,c,m,x);if(S===null)Up(o,c,x,sd,m),u1(o,x);else if(AD(S,o,c,m,x))x.stopPropagation();else if(u1(o,x),c&4&&-1<OD.indexOf(o)){for(;S!==null;){var _=lc(S);if(_!==null&&o1(_),_=kp(o,c,m,x),_===null&&Up(o,c,x,sd,m),_===S)break;S=_}S!==null&&x.stopPropagation()}else Up(o,c,x,null,m)}}var sd=null;function kp(o,c,m,x){if(sd=null,o=mi(x),o=Eo(o),o!==null)if(c=Xe(o),c===null)o=null;else if(m=c.tag,m===13){if(o=Vi(c),o!==null)return o;o=null}else if(m===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;o=null}else c!==o&&(o=null);return sd=o,null}function h1(o){switch(o){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(Ul()){case Yi:return 1;case Ju:return 4;case $a:case jD:return 16;case n1:return 536870912;default:return 16}default:return 16}}var Ua=null,_p=null,ld=null;function m1(){if(ld)return ld;var o,c=_p,m=c.length,x,S="value"in Ua?Ua.value:Ua.textContent,_=S.length;for(o=0;o<m&&c[o]===S[o];o++);var O=m-o;for(x=1;x<=O&&c[m-x]===S[_-x];x++);return ld=S.slice(o,1<x?1-x:void 0)}function cd(o){var c=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&c===13&&(o=13)):o=c,o===10&&(o=13),32<=o||o===13?o:0}function ud(){return!0}function p1(){return!1}function nn(o){function c(m,x,S,_,O){this._reactName=m,this._targetInst=S,this.type=x,this.nativeEvent=_,this.target=O,this.currentTarget=null;for(var D in o)o.hasOwnProperty(D)&&(m=o[D],this[D]=m?m(_):_[D]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?ud:p1,this.isPropagationStopped=p1,this}return W(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=ud)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=ud)},persist:function(){},isPersistent:ud}),c}var Ss={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ep=nn(Ss),Ql=W({},Ss,{view:0,detail:0}),RD=nn(Ql),Cp,Op,Zl,dd=W({},Ql,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Tp,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==Zl&&(Zl&&o.type==="mousemove"?(Cp=o.screenX-Zl.screenX,Op=o.screenY-Zl.screenY):Op=Cp=0,Zl=o),Cp)},movementY:function(o){return"movementY"in o?o.movementY:Op}}),v1=nn(dd),DD=W({},dd,{dataTransfer:0}),LD=nn(DD),$D=W({},Ql,{relatedTarget:0}),Ap=nn($D),zD=W({},Ss,{animationName:0,elapsedTime:0,pseudoElement:0}),FD=nn(zD),BD=W({},Ss,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),WD=nn(BD),UD=W({},Ss,{data:0}),g1=nn(UD),KD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qD={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"},HD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function VD(o){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(o):(o=HD[o])?!!c[o]:!1}function Tp(){return VD}var YD=W({},Ql,{key:function(o){if(o.key){var c=KD[o.key]||o.key;if(c!=="Unidentified")return c}return o.type==="keypress"?(o=cd(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?qD[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Tp,charCode:function(o){return o.type==="keypress"?cd(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?cd(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),GD=nn(YD),XD=W({},dd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),y1=nn(XD),QD=W({},Ql,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Tp}),ZD=nn(QD),JD=W({},Ss,{propertyName:0,elapsedTime:0,pseudoElement:0}),eL=nn(JD),tL=W({},dd,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),rL=nn(tL),nL=[9,13,27,32],Mp=u&&"CompositionEvent"in window,Jl=null;u&&"documentMode"in document&&(Jl=document.documentMode);var iL=u&&"TextEvent"in window&&!Jl,x1=u&&(!Mp||Jl&&8<Jl&&11>=Jl),b1=" ",w1=!1;function j1(o,c){switch(o){case"keyup":return nL.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function S1(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Ns=!1;function aL(o,c){switch(o){case"compositionend":return S1(c);case"keypress":return c.which!==32?null:(w1=!0,b1);case"textInput":return o=c.data,o===b1&&w1?null:o;default:return null}}function oL(o,c){if(Ns)return o==="compositionend"||!Mp&&j1(o,c)?(o=m1(),ld=_p=Ua=null,Ns=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return x1&&c.locale!=="ko"?null:c.data;default:return null}}var sL={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 N1(o){var c=o&&o.nodeName&&o.nodeName.toLowerCase();return c==="input"?!!sL[o.type]:c==="textarea"}function P1(o,c,m,x){La(x),c=vd(c,"onChange"),0<c.length&&(m=new Ep("onChange","change",null,m,x),o.push({event:m,listeners:c}))}var ec=null,tc=null;function lL(o){U1(o,0)}function fd(o){var c=Cs(o);if(re(c))return o}function cL(o,c){if(o==="change")return c}var k1=!1;if(u){var Ip;if(u){var Rp="oninput"in document;if(!Rp){var _1=document.createElement("div");_1.setAttribute("oninput","return;"),Rp=typeof _1.oninput=="function"}Ip=Rp}else Ip=!1;k1=Ip&&(!document.documentMode||9<document.documentMode)}function E1(){ec&&(ec.detachEvent("onpropertychange",C1),tc=ec=null)}function C1(o){if(o.propertyName==="value"&&fd(tc)){var c=[];P1(c,tc,o,mi(o)),Ue(lL,c)}}function uL(o,c,m){o==="focusin"?(E1(),ec=c,tc=m,ec.attachEvent("onpropertychange",C1)):o==="focusout"&&E1()}function dL(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return fd(tc)}function fL(o,c){if(o==="click")return fd(c)}function hL(o,c){if(o==="input"||o==="change")return fd(c)}function mL(o,c){return o===c&&(o!==0||1/o===1/c)||o!==o&&c!==c}var Hn=typeof Object.is=="function"?Object.is:mL;function rc(o,c){if(Hn(o,c))return!0;if(typeof o!="object"||o===null||typeof c!="object"||c===null)return!1;var m=Object.keys(o),x=Object.keys(c);if(m.length!==x.length)return!1;for(x=0;x<m.length;x++){var S=m[x];if(!d.call(c,S)||!Hn(o[S],c[S]))return!1}return!0}function O1(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function A1(o,c){var m=O1(o);o=0;for(var x;m;){if(m.nodeType===3){if(x=o+m.textContent.length,o<=c&&x>=c)return{node:m,offset:c-o};o=x}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=O1(m)}}function T1(o,c){return o&&c?o===c?!0:o&&o.nodeType===3?!1:c&&c.nodeType===3?T1(o,c.parentNode):"contains"in o?o.contains(c):o.compareDocumentPosition?!!(o.compareDocumentPosition(c)&16):!1:!1}function M1(){for(var o=window,c=ot();c instanceof o.HTMLIFrameElement;){try{var m=typeof c.contentWindow.location.href=="string"}catch{m=!1}if(m)o=c.contentWindow;else break;c=ot(o.document)}return c}function Dp(o){var c=o&&o.nodeName&&o.nodeName.toLowerCase();return c&&(c==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||c==="textarea"||o.contentEditable==="true")}function pL(o){var c=M1(),m=o.focusedElem,x=o.selectionRange;if(c!==m&&m&&m.ownerDocument&&T1(m.ownerDocument.documentElement,m)){if(x!==null&&Dp(m)){if(c=x.start,o=x.end,o===void 0&&(o=c),"selectionStart"in m)m.selectionStart=c,m.selectionEnd=Math.min(o,m.value.length);else if(o=(c=m.ownerDocument||document)&&c.defaultView||window,o.getSelection){o=o.getSelection();var S=m.textContent.length,_=Math.min(x.start,S);x=x.end===void 0?_:Math.min(x.end,S),!o.extend&&_>x&&(S=x,x=_,_=S),S=A1(m,_);var O=A1(m,x);S&&O&&(o.rangeCount!==1||o.anchorNode!==S.node||o.anchorOffset!==S.offset||o.focusNode!==O.node||o.focusOffset!==O.offset)&&(c=c.createRange(),c.setStart(S.node,S.offset),o.removeAllRanges(),_>x?(o.addRange(c),o.extend(O.node,O.offset)):(c.setEnd(O.node,O.offset),o.addRange(c)))}}for(c=[],o=m;o=o.parentNode;)o.nodeType===1&&c.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<c.length;m++)o=c[m],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var vL=u&&"documentMode"in document&&11>=document.documentMode,Ps=null,Lp=null,nc=null,$p=!1;function I1(o,c,m){var x=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;$p||Ps==null||Ps!==ot(x)||(x=Ps,"selectionStart"in x&&Dp(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),nc&&rc(nc,x)||(nc=x,x=vd(Lp,"onSelect"),0<x.length&&(c=new Ep("onSelect","select",null,c,m),o.push({event:c,listeners:x}),c.target=Ps)))}function hd(o,c){var m={};return m[o.toLowerCase()]=c.toLowerCase(),m["Webkit"+o]="webkit"+c,m["Moz"+o]="moz"+c,m}var ks={animationend:hd("Animation","AnimationEnd"),animationiteration:hd("Animation","AnimationIteration"),animationstart:hd("Animation","AnimationStart"),transitionend:hd("Transition","TransitionEnd")},zp={},R1={};u&&(R1=document.createElement("div").style,"AnimationEvent"in window||(delete ks.animationend.animation,delete ks.animationiteration.animation,delete ks.animationstart.animation),"TransitionEvent"in window||delete ks.transitionend.transition);function md(o){if(zp[o])return zp[o];if(!ks[o])return o;var c=ks[o],m;for(m in c)if(c.hasOwnProperty(m)&&m in R1)return zp[o]=c[m];return o}var D1=md("animationend"),L1=md("animationiteration"),$1=md("animationstart"),z1=md("transitionend"),F1=new Map,B1="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 Ka(o,c){F1.set(o,c),a(c,[o])}for(var Fp=0;Fp<B1.length;Fp++){var Bp=B1[Fp],gL=Bp.toLowerCase(),yL=Bp[0].toUpperCase()+Bp.slice(1);Ka(gL,"on"+yL)}Ka(D1,"onAnimationEnd"),Ka(L1,"onAnimationIteration"),Ka($1,"onAnimationStart"),Ka("dblclick","onDoubleClick"),Ka("focusin","onFocus"),Ka("focusout","onBlur"),Ka(z1,"onTransitionEnd"),s("onMouseEnter",["mouseout","mouseover"]),s("onMouseLeave",["mouseout","mouseover"]),s("onPointerEnter",["pointerout","pointerover"]),s("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ic="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(" "),xL=new Set("cancel close invalid load scroll toggle".split(" ").concat(ic));function W1(o,c,m){var x=o.type||"unknown-event";o.currentTarget=m,Fr(x,c,void 0,o),o.currentTarget=null}function U1(o,c){c=(c&4)!==0;for(var m=0;m<o.length;m++){var x=o[m],S=x.event;x=x.listeners;e:{var _=void 0;if(c)for(var O=x.length-1;0<=O;O--){var D=x[O],B=D.instance,ee=D.currentTarget;if(D=D.listener,B!==_&&S.isPropagationStopped())break e;W1(S,D,ee),_=B}else for(O=0;O<x.length;O++){if(D=x[O],B=D.instance,ee=D.currentTarget,D=D.listener,B!==_&&S.isPropagationStopped())break e;W1(S,D,ee),_=B}}}if(Et)throw o=zr,Et=!1,zr=null,o}function gt(o,c){var m=c[Gp];m===void 0&&(m=c[Gp]=new Set);var x=o+"__bubble";m.has(x)||(K1(c,o,2,!1),m.add(x))}function Wp(o,c,m){var x=0;c&&(x|=4),K1(m,o,x,c)}var pd="_reactListening"+Math.random().toString(36).slice(2);function ac(o){if(!o[pd]){o[pd]=!0,n.forEach(function(m){m!=="selectionchange"&&(xL.has(m)||Wp(m,!1,o),Wp(m,!0,o))});var c=o.nodeType===9?o:o.ownerDocument;c===null||c[pd]||(c[pd]=!0,Wp("selectionchange",!1,c))}}function K1(o,c,m,x){switch(h1(c)){case 1:var S=MD;break;case 4:S=ID;break;default:S=Pp}m=S.bind(null,c,m,o),S=void 0,!Kn||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(S=!0),x?S!==void 0?o.addEventListener(c,m,{capture:!0,passive:S}):o.addEventListener(c,m,!0):S!==void 0?o.addEventListener(c,m,{passive:S}):o.addEventListener(c,m,!1)}function Up(o,c,m,x,S){var _=x;if((c&1)===0&&(c&2)===0&&x!==null)e:for(;;){if(x===null)return;var O=x.tag;if(O===3||O===4){var D=x.stateNode.containerInfo;if(D===S||D.nodeType===8&&D.parentNode===S)break;if(O===4)for(O=x.return;O!==null;){var B=O.tag;if((B===3||B===4)&&(B=O.stateNode.containerInfo,B===S||B.nodeType===8&&B.parentNode===S))return;O=O.return}for(;D!==null;){if(O=Eo(D),O===null)return;if(B=O.tag,B===5||B===6){x=_=O;continue e}D=D.parentNode}}x=x.return}Ue(function(){var ee=_,ie=mi(m),le=[];e:{var ne=F1.get(o);if(ne!==void 0){var ge=Ep,Ne=o;switch(o){case"keypress":if(cd(m)===0)break e;case"keydown":case"keyup":ge=GD;break;case"focusin":Ne="focus",ge=Ap;break;case"focusout":Ne="blur",ge=Ap;break;case"beforeblur":case"afterblur":ge=Ap;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ge=v1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=LD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=ZD;break;case D1:case L1:case $1:ge=FD;break;case z1:ge=eL;break;case"scroll":ge=RD;break;case"wheel":ge=rL;break;case"copy":case"cut":case"paste":ge=WD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=y1}var _e=(c&4)!==0,Ft=!_e&&o==="scroll",G=_e?ne!==null?ne+"Capture":null:ne;_e=[];for(var q=ee,Z;q!==null;){Z=q;var ue=Z.stateNode;if(Z.tag===5&&ue!==null&&(Z=ue,G!==null&&(ue=Vt(q,G),ue!=null&&_e.push(oc(q,ue,Z)))),Ft)break;q=q.return}0<_e.length&&(ne=new ge(ne,Ne,null,m,ie),le.push({event:ne,listeners:_e}))}}if((c&7)===0){e:{if(ne=o==="mouseover"||o==="pointerover",ge=o==="mouseout"||o==="pointerout",ne&&m!==Ki&&(Ne=m.relatedTarget||m.fromElement)&&(Eo(Ne)||Ne[Gi]))break e;if((ge||ne)&&(ne=ie.window===ie?ie:(ne=ie.ownerDocument)?ne.defaultView||ne.parentWindow:window,ge?(Ne=m.relatedTarget||m.toElement,ge=ee,Ne=Ne?Eo(Ne):null,Ne!==null&&(Ft=Xe(Ne),Ne!==Ft||Ne.tag!==5&&Ne.tag!==6)&&(Ne=null)):(ge=null,Ne=ee),ge!==Ne)){if(_e=v1,ue="onMouseLeave",G="onMouseEnter",q="mouse",(o==="pointerout"||o==="pointerover")&&(_e=y1,ue="onPointerLeave",G="onPointerEnter",q="pointer"),Ft=ge==null?ne:Cs(ge),Z=Ne==null?ne:Cs(Ne),ne=new _e(ue,q+"leave",ge,m,ie),ne.target=Ft,ne.relatedTarget=Z,ue=null,Eo(ie)===ee&&(_e=new _e(G,q+"enter",Ne,m,ie),_e.target=Z,_e.relatedTarget=Ft,ue=_e),Ft=ue,ge&&Ne)t:{for(_e=ge,G=Ne,q=0,Z=_e;Z;Z=_s(Z))q++;for(Z=0,ue=G;ue;ue=_s(ue))Z++;for(;0<q-Z;)_e=_s(_e),q--;for(;0<Z-q;)G=_s(G),Z--;for(;q--;){if(_e===G||G!==null&&_e===G.alternate)break t;_e=_s(_e),G=_s(G)}_e=null}else _e=null;ge!==null&&q1(le,ne,ge,_e,!1),Ne!==null&&Ft!==null&&q1(le,Ft,Ne,_e,!0)}}e:{if(ne=ee?Cs(ee):window,ge=ne.nodeName&&ne.nodeName.toLowerCase(),ge==="select"||ge==="input"&&ne.type==="file")var Ce=cL;else if(N1(ne))if(k1)Ce=hL;else{Ce=dL;var Re=uL}else(ge=ne.nodeName)&&ge.toLowerCase()==="input"&&(ne.type==="checkbox"||ne.type==="radio")&&(Ce=fL);if(Ce&&(Ce=Ce(o,ee))){P1(le,Ce,m,ie);break e}Re&&Re(o,ne,ee),o==="focusout"&&(Re=ne._wrapperState)&&Re.controlled&&ne.type==="number"&&di(ne,"number",ne.value)}switch(Re=ee?Cs(ee):window,o){case"focusin":(N1(Re)||Re.contentEditable==="true")&&(Ps=Re,Lp=ee,nc=null);break;case"focusout":nc=Lp=Ps=null;break;case"mousedown":$p=!0;break;case"contextmenu":case"mouseup":case"dragend":$p=!1,I1(le,m,ie);break;case"selectionchange":if(vL)break;case"keydown":case"keyup":I1(le,m,ie)}var De;if(Mp)e:{switch(o){case"compositionstart":var $e="onCompositionStart";break e;case"compositionend":$e="onCompositionEnd";break e;case"compositionupdate":$e="onCompositionUpdate";break e}$e=void 0}else Ns?j1(o,m)&&($e="onCompositionEnd"):o==="keydown"&&m.keyCode===229&&($e="onCompositionStart");$e&&(x1&&m.locale!=="ko"&&(Ns||$e!=="onCompositionStart"?$e==="onCompositionEnd"&&Ns&&(De=m1()):(Ua=ie,_p="value"in Ua?Ua.value:Ua.textContent,Ns=!0)),Re=vd(ee,$e),0<Re.length&&($e=new g1($e,o,null,m,ie),le.push({event:$e,listeners:Re}),De?$e.data=De:(De=S1(m),De!==null&&($e.data=De)))),(De=iL?aL(o,m):oL(o,m))&&(ee=vd(ee,"onBeforeInput"),0<ee.length&&(ie=new g1("onBeforeInput","beforeinput",null,m,ie),le.push({event:ie,listeners:ee}),ie.data=De))}U1(le,c)})}function oc(o,c,m){return{instance:o,listener:c,currentTarget:m}}function vd(o,c){for(var m=c+"Capture",x=[];o!==null;){var S=o,_=S.stateNode;S.tag===5&&_!==null&&(S=_,_=Vt(o,m),_!=null&&x.unshift(oc(o,_,S)),_=Vt(o,c),_!=null&&x.push(oc(o,_,S))),o=o.return}return x}function _s(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5);return o||null}function q1(o,c,m,x,S){for(var _=c._reactName,O=[];m!==null&&m!==x;){var D=m,B=D.alternate,ee=D.stateNode;if(B!==null&&B===x)break;D.tag===5&&ee!==null&&(D=ee,S?(B=Vt(m,_),B!=null&&O.unshift(oc(m,B,D))):S||(B=Vt(m,_),B!=null&&O.push(oc(m,B,D)))),m=m.return}O.length!==0&&o.push({event:c,listeners:O})}var bL=/\r\n?/g,wL=/\u0000|\uFFFD/g;function H1(o){return(typeof o=="string"?o:""+o).replace(bL,`
38
+ `).replace(wL,"")}function gd(o,c,m){if(c=H1(c),H1(o)!==c&&m)throw Error(r(425))}function yd(){}var Kp=null,qp=null;function Hp(o,c){return o==="textarea"||o==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Vp=typeof setTimeout=="function"?setTimeout:void 0,jL=typeof clearTimeout=="function"?clearTimeout:void 0,V1=typeof Promise=="function"?Promise:void 0,SL=typeof queueMicrotask=="function"?queueMicrotask:typeof V1<"u"?function(o){return V1.resolve(null).then(o).catch(NL)}:Vp;function NL(o){setTimeout(function(){throw o})}function Yp(o,c){var m=c,x=0;do{var S=m.nextSibling;if(o.removeChild(m),S&&S.nodeType===8)if(m=S.data,m==="/$"){if(x===0){o.removeChild(S),Xl(c);return}x--}else m!=="$"&&m!=="$?"&&m!=="$!"||x++;m=S}while(m);Xl(c)}function qa(o){for(;o!=null;o=o.nextSibling){var c=o.nodeType;if(c===1||c===3)break;if(c===8){if(c=o.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return o}function Y1(o){o=o.previousSibling;for(var c=0;o;){if(o.nodeType===8){var m=o.data;if(m==="$"||m==="$!"||m==="$?"){if(c===0)return o;c--}else m==="/$"&&c++}o=o.previousSibling}return null}var Es=Math.random().toString(36).slice(2),vi="__reactFiber$"+Es,sc="__reactProps$"+Es,Gi="__reactContainer$"+Es,Gp="__reactEvents$"+Es,PL="__reactListeners$"+Es,kL="__reactHandles$"+Es;function Eo(o){var c=o[vi];if(c)return c;for(var m=o.parentNode;m;){if(c=m[Gi]||m[vi]){if(m=c.alternate,c.child!==null||m!==null&&m.child!==null)for(o=Y1(o);o!==null;){if(m=o[vi])return m;o=Y1(o)}return c}o=m,m=o.parentNode}return null}function lc(o){return o=o[vi]||o[Gi],!o||o.tag!==5&&o.tag!==6&&o.tag!==13&&o.tag!==3?null:o}function Cs(o){if(o.tag===5||o.tag===6)return o.stateNode;throw Error(r(33))}function xd(o){return o[sc]||null}var Xp=[],Os=-1;function Ha(o){return{current:o}}function yt(o){0>Os||(o.current=Xp[Os],Xp[Os]=null,Os--)}function pt(o,c){Os++,Xp[Os]=o.current,o.current=c}var Va={},wr=Ha(Va),Br=Ha(!1),Co=Va;function As(o,c){var m=o.type.contextTypes;if(!m)return Va;var x=o.stateNode;if(x&&x.__reactInternalMemoizedUnmaskedChildContext===c)return x.__reactInternalMemoizedMaskedChildContext;var S={},_;for(_ in m)S[_]=c[_];return x&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=c,o.__reactInternalMemoizedMaskedChildContext=S),S}function Wr(o){return o=o.childContextTypes,o!=null}function bd(){yt(Br),yt(wr)}function G1(o,c,m){if(wr.current!==Va)throw Error(r(168));pt(wr,c),pt(Br,m)}function X1(o,c,m){var x=o.stateNode;if(c=c.childContextTypes,typeof x.getChildContext!="function")return m;x=x.getChildContext();for(var S in x)if(!(S in c))throw Error(r(108,de(o)||"Unknown",S));return W({},m,x)}function wd(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||Va,Co=wr.current,pt(wr,o),pt(Br,Br.current),!0}function Q1(o,c,m){var x=o.stateNode;if(!x)throw Error(r(169));m?(o=X1(o,c,Co),x.__reactInternalMemoizedMergedChildContext=o,yt(Br),yt(wr),pt(wr,o)):yt(Br),pt(Br,m)}var Xi=null,jd=!1,Qp=!1;function Z1(o){Xi===null?Xi=[o]:Xi.push(o)}function _L(o){jd=!0,Z1(o)}function Ya(){if(!Qp&&Xi!==null){Qp=!0;var o=0,c=lt;try{var m=Xi;for(lt=1;o<m.length;o++){var x=m[o];do x=x(!0);while(x!==null)}Xi=null,jd=!1}catch(S){throw Xi!==null&&(Xi=Xi.slice(o+1)),Bl(Yi,Ya),S}finally{lt=c,Qp=!1}}return null}var Ts=[],Ms=0,Sd=null,Nd=0,jn=[],Sn=0,Oo=null,Qi=1,Zi="";function Ao(o,c){Ts[Ms++]=Nd,Ts[Ms++]=Sd,Sd=o,Nd=c}function J1(o,c,m){jn[Sn++]=Qi,jn[Sn++]=Zi,jn[Sn++]=Oo,Oo=o;var x=Qi;o=Zi;var S=32-qn(x)-1;x&=~(1<<S),m+=1;var _=32-qn(c)+S;if(30<_){var O=S-S%5;_=(x&(1<<O)-1).toString(32),x>>=O,S-=O,Qi=1<<32-qn(c)+S|m<<S|x,Zi=_+o}else Qi=1<<_|m<<S|x,Zi=o}function Zp(o){o.return!==null&&(Ao(o,1),J1(o,1,0))}function Jp(o){for(;o===Sd;)Sd=Ts[--Ms],Ts[Ms]=null,Nd=Ts[--Ms],Ts[Ms]=null;for(;o===Oo;)Oo=jn[--Sn],jn[Sn]=null,Zi=jn[--Sn],jn[Sn]=null,Qi=jn[--Sn],jn[Sn]=null}var an=null,on=null,St=!1,Vn=null;function ej(o,c){var m=_n(5,null,null,0);m.elementType="DELETED",m.stateNode=c,m.return=o,c=o.deletions,c===null?(o.deletions=[m],o.flags|=16):c.push(m)}function tj(o,c){switch(o.tag){case 5:var m=o.type;return c=c.nodeType!==1||m.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(o.stateNode=c,an=o,on=qa(c.firstChild),!0):!1;case 6:return c=o.pendingProps===""||c.nodeType!==3?null:c,c!==null?(o.stateNode=c,an=o,on=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(m=Oo!==null?{id:Qi,overflow:Zi}:null,o.memoizedState={dehydrated:c,treeContext:m,retryLane:1073741824},m=_n(18,null,null,0),m.stateNode=c,m.return=o,o.child=m,an=o,on=null,!0):!1;default:return!1}}function ev(o){return(o.mode&1)!==0&&(o.flags&128)===0}function tv(o){if(St){var c=on;if(c){var m=c;if(!tj(o,c)){if(ev(o))throw Error(r(418));c=qa(m.nextSibling);var x=an;c&&tj(o,c)?ej(x,m):(o.flags=o.flags&-4097|2,St=!1,an=o)}}else{if(ev(o))throw Error(r(418));o.flags=o.flags&-4097|2,St=!1,an=o}}}function rj(o){for(o=o.return;o!==null&&o.tag!==5&&o.tag!==3&&o.tag!==13;)o=o.return;an=o}function Pd(o){if(o!==an)return!1;if(!St)return rj(o),St=!0,!1;var c;if((c=o.tag!==3)&&!(c=o.tag!==5)&&(c=o.type,c=c!=="head"&&c!=="body"&&!Hp(o.type,o.memoizedProps)),c&&(c=on)){if(ev(o))throw nj(),Error(r(418));for(;c;)ej(o,c),c=qa(c.nextSibling)}if(rj(o),o.tag===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));e:{for(o=o.nextSibling,c=0;o;){if(o.nodeType===8){var m=o.data;if(m==="/$"){if(c===0){on=qa(o.nextSibling);break e}c--}else m!=="$"&&m!=="$!"&&m!=="$?"||c++}o=o.nextSibling}on=null}}else on=an?qa(o.stateNode.nextSibling):null;return!0}function nj(){for(var o=on;o;)o=qa(o.nextSibling)}function Is(){on=an=null,St=!1}function rv(o){Vn===null?Vn=[o]:Vn.push(o)}var EL=k.ReactCurrentBatchConfig;function cc(o,c,m){if(o=m.ref,o!==null&&typeof o!="function"&&typeof o!="object"){if(m._owner){if(m=m._owner,m){if(m.tag!==1)throw Error(r(309));var x=m.stateNode}if(!x)throw Error(r(147,o));var S=x,_=""+o;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===_?c.ref:(c=function(O){var D=S.refs;O===null?delete D[_]:D[_]=O},c._stringRef=_,c)}if(typeof o!="string")throw Error(r(284));if(!m._owner)throw Error(r(290,o))}return o}function kd(o,c){throw o=Object.prototype.toString.call(c),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":o))}function ij(o){var c=o._init;return c(o._payload)}function aj(o){function c(G,q){if(o){var Z=G.deletions;Z===null?(G.deletions=[q],G.flags|=16):Z.push(q)}}function m(G,q){if(!o)return null;for(;q!==null;)c(G,q),q=q.sibling;return null}function x(G,q){for(G=new Map;q!==null;)q.key!==null?G.set(q.key,q):G.set(q.index,q),q=q.sibling;return G}function S(G,q){return G=ro(G,q),G.index=0,G.sibling=null,G}function _(G,q,Z){return G.index=Z,o?(Z=G.alternate,Z!==null?(Z=Z.index,Z<q?(G.flags|=2,q):Z):(G.flags|=2,q)):(G.flags|=1048576,q)}function O(G){return o&&G.alternate===null&&(G.flags|=2),G}function D(G,q,Z,ue){return q===null||q.tag!==6?(q=Vv(Z,G.mode,ue),q.return=G,q):(q=S(q,Z),q.return=G,q)}function B(G,q,Z,ue){var Ce=Z.type;return Ce===A?ie(G,q,Z.props.children,ue,Z.key):q!==null&&(q.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===F&&ij(Ce)===q.type)?(ue=S(q,Z.props),ue.ref=cc(G,q,Z),ue.return=G,ue):(ue=Xd(Z.type,Z.key,Z.props,null,G.mode,ue),ue.ref=cc(G,q,Z),ue.return=G,ue)}function ee(G,q,Z,ue){return q===null||q.tag!==4||q.stateNode.containerInfo!==Z.containerInfo||q.stateNode.implementation!==Z.implementation?(q=Yv(Z,G.mode,ue),q.return=G,q):(q=S(q,Z.children||[]),q.return=G,q)}function ie(G,q,Z,ue,Ce){return q===null||q.tag!==7?(q=zo(Z,G.mode,ue,Ce),q.return=G,q):(q=S(q,Z),q.return=G,q)}function le(G,q,Z){if(typeof q=="string"&&q!==""||typeof q=="number")return q=Vv(""+q,G.mode,Z),q.return=G,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case C:return Z=Xd(q.type,q.key,q.props,null,G.mode,Z),Z.ref=cc(G,null,q),Z.return=G,Z;case T:return q=Yv(q,G.mode,Z),q.return=G,q;case F:var ue=q._init;return le(G,ue(q._payload),Z)}if($r(q)||Y(q))return q=zo(q,G.mode,Z,null),q.return=G,q;kd(G,q)}return null}function ne(G,q,Z,ue){var Ce=q!==null?q.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number")return Ce!==null?null:D(G,q,""+Z,ue);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case C:return Z.key===Ce?B(G,q,Z,ue):null;case T:return Z.key===Ce?ee(G,q,Z,ue):null;case F:return Ce=Z._init,ne(G,q,Ce(Z._payload),ue)}if($r(Z)||Y(Z))return Ce!==null?null:ie(G,q,Z,ue,null);kd(G,Z)}return null}function ge(G,q,Z,ue,Ce){if(typeof ue=="string"&&ue!==""||typeof ue=="number")return G=G.get(Z)||null,D(q,G,""+ue,Ce);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case C:return G=G.get(ue.key===null?Z:ue.key)||null,B(q,G,ue,Ce);case T:return G=G.get(ue.key===null?Z:ue.key)||null,ee(q,G,ue,Ce);case F:var Re=ue._init;return ge(G,q,Z,Re(ue._payload),Ce)}if($r(ue)||Y(ue))return G=G.get(Z)||null,ie(q,G,ue,Ce,null);kd(q,ue)}return null}function Ne(G,q,Z,ue){for(var Ce=null,Re=null,De=q,$e=q=0,lr=null;De!==null&&$e<Z.length;$e++){De.index>$e?(lr=De,De=null):lr=De.sibling;var Qe=ne(G,De,Z[$e],ue);if(Qe===null){De===null&&(De=lr);break}o&&De&&Qe.alternate===null&&c(G,De),q=_(Qe,q,$e),Re===null?Ce=Qe:Re.sibling=Qe,Re=Qe,De=lr}if($e===Z.length)return m(G,De),St&&Ao(G,$e),Ce;if(De===null){for(;$e<Z.length;$e++)De=le(G,Z[$e],ue),De!==null&&(q=_(De,q,$e),Re===null?Ce=De:Re.sibling=De,Re=De);return St&&Ao(G,$e),Ce}for(De=x(G,De);$e<Z.length;$e++)lr=ge(De,G,$e,Z[$e],ue),lr!==null&&(o&&lr.alternate!==null&&De.delete(lr.key===null?$e:lr.key),q=_(lr,q,$e),Re===null?Ce=lr:Re.sibling=lr,Re=lr);return o&&De.forEach(function(no){return c(G,no)}),St&&Ao(G,$e),Ce}function _e(G,q,Z,ue){var Ce=Y(Z);if(typeof Ce!="function")throw Error(r(150));if(Z=Ce.call(Z),Z==null)throw Error(r(151));for(var Re=Ce=null,De=q,$e=q=0,lr=null,Qe=Z.next();De!==null&&!Qe.done;$e++,Qe=Z.next()){De.index>$e?(lr=De,De=null):lr=De.sibling;var no=ne(G,De,Qe.value,ue);if(no===null){De===null&&(De=lr);break}o&&De&&no.alternate===null&&c(G,De),q=_(no,q,$e),Re===null?Ce=no:Re.sibling=no,Re=no,De=lr}if(Qe.done)return m(G,De),St&&Ao(G,$e),Ce;if(De===null){for(;!Qe.done;$e++,Qe=Z.next())Qe=le(G,Qe.value,ue),Qe!==null&&(q=_(Qe,q,$e),Re===null?Ce=Qe:Re.sibling=Qe,Re=Qe);return St&&Ao(G,$e),Ce}for(De=x(G,De);!Qe.done;$e++,Qe=Z.next())Qe=ge(De,G,$e,Qe.value,ue),Qe!==null&&(o&&Qe.alternate!==null&&De.delete(Qe.key===null?$e:Qe.key),q=_(Qe,q,$e),Re===null?Ce=Qe:Re.sibling=Qe,Re=Qe);return o&&De.forEach(function(s$){return c(G,s$)}),St&&Ao(G,$e),Ce}function Ft(G,q,Z,ue){if(typeof Z=="object"&&Z!==null&&Z.type===A&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case C:e:{for(var Ce=Z.key,Re=q;Re!==null;){if(Re.key===Ce){if(Ce=Z.type,Ce===A){if(Re.tag===7){m(G,Re.sibling),q=S(Re,Z.props.children),q.return=G,G=q;break e}}else if(Re.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===F&&ij(Ce)===Re.type){m(G,Re.sibling),q=S(Re,Z.props),q.ref=cc(G,Re,Z),q.return=G,G=q;break e}m(G,Re);break}else c(G,Re);Re=Re.sibling}Z.type===A?(q=zo(Z.props.children,G.mode,ue,Z.key),q.return=G,G=q):(ue=Xd(Z.type,Z.key,Z.props,null,G.mode,ue),ue.ref=cc(G,q,Z),ue.return=G,G=ue)}return O(G);case T:e:{for(Re=Z.key;q!==null;){if(q.key===Re)if(q.tag===4&&q.stateNode.containerInfo===Z.containerInfo&&q.stateNode.implementation===Z.implementation){m(G,q.sibling),q=S(q,Z.children||[]),q.return=G,G=q;break e}else{m(G,q);break}else c(G,q);q=q.sibling}q=Yv(Z,G.mode,ue),q.return=G,G=q}return O(G);case F:return Re=Z._init,Ft(G,q,Re(Z._payload),ue)}if($r(Z))return Ne(G,q,Z,ue);if(Y(Z))return _e(G,q,Z,ue);kd(G,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"?(Z=""+Z,q!==null&&q.tag===6?(m(G,q.sibling),q=S(q,Z),q.return=G,G=q):(m(G,q),q=Vv(Z,G.mode,ue),q.return=G,G=q),O(G)):m(G,q)}return Ft}var Rs=aj(!0),oj=aj(!1),_d=Ha(null),Ed=null,Ds=null,nv=null;function iv(){nv=Ds=Ed=null}function av(o){var c=_d.current;yt(_d),o._currentValue=c}function ov(o,c,m){for(;o!==null;){var x=o.alternate;if((o.childLanes&c)!==c?(o.childLanes|=c,x!==null&&(x.childLanes|=c)):x!==null&&(x.childLanes&c)!==c&&(x.childLanes|=c),o===m)break;o=o.return}}function Ls(o,c){Ed=o,nv=Ds=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&c)!==0&&(Ur=!0),o.firstContext=null)}function Nn(o){var c=o._currentValue;if(nv!==o)if(o={context:o,memoizedValue:c,next:null},Ds===null){if(Ed===null)throw Error(r(308));Ds=o,Ed.dependencies={lanes:0,firstContext:o}}else Ds=Ds.next=o;return c}var To=null;function sv(o){To===null?To=[o]:To.push(o)}function sj(o,c,m,x){var S=c.interleaved;return S===null?(m.next=m,sv(c)):(m.next=S.next,S.next=m),c.interleaved=m,Ji(o,x)}function Ji(o,c){o.lanes|=c;var m=o.alternate;for(m!==null&&(m.lanes|=c),m=o,o=o.return;o!==null;)o.childLanes|=c,m=o.alternate,m!==null&&(m.childLanes|=c),m=o,o=o.return;return m.tag===3?m.stateNode:null}var Ga=!1;function lv(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lj(o,c){o=o.updateQueue,c.updateQueue===o&&(c.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function ea(o,c){return{eventTime:o,lane:c,tag:0,payload:null,callback:null,next:null}}function Xa(o,c,m){var x=o.updateQueue;if(x===null)return null;if(x=x.shared,(Ge&2)!==0){var S=x.pending;return S===null?c.next=c:(c.next=S.next,S.next=c),x.pending=c,Ji(o,m)}return S=x.interleaved,S===null?(c.next=c,sv(x)):(c.next=S.next,S.next=c),x.interleaved=c,Ji(o,m)}function Cd(o,c,m){if(c=c.updateQueue,c!==null&&(c=c.shared,(m&4194240)!==0)){var x=c.lanes;x&=o.pendingLanes,m|=x,c.lanes=m,jp(o,m)}}function cj(o,c){var m=o.updateQueue,x=o.alternate;if(x!==null&&(x=x.updateQueue,m===x)){var S=null,_=null;if(m=m.firstBaseUpdate,m!==null){do{var O={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};_===null?S=_=O:_=_.next=O,m=m.next}while(m!==null);_===null?S=_=c:_=_.next=c}else S=_=c;m={baseState:x.baseState,firstBaseUpdate:S,lastBaseUpdate:_,shared:x.shared,effects:x.effects},o.updateQueue=m;return}o=m.lastBaseUpdate,o===null?m.firstBaseUpdate=c:o.next=c,m.lastBaseUpdate=c}function Od(o,c,m,x){var S=o.updateQueue;Ga=!1;var _=S.firstBaseUpdate,O=S.lastBaseUpdate,D=S.shared.pending;if(D!==null){S.shared.pending=null;var B=D,ee=B.next;B.next=null,O===null?_=ee:O.next=ee,O=B;var ie=o.alternate;ie!==null&&(ie=ie.updateQueue,D=ie.lastBaseUpdate,D!==O&&(D===null?ie.firstBaseUpdate=ee:D.next=ee,ie.lastBaseUpdate=B))}if(_!==null){var le=S.baseState;O=0,ie=ee=B=null,D=_;do{var ne=D.lane,ge=D.eventTime;if((x&ne)===ne){ie!==null&&(ie=ie.next={eventTime:ge,lane:0,tag:D.tag,payload:D.payload,callback:D.callback,next:null});e:{var Ne=o,_e=D;switch(ne=c,ge=m,_e.tag){case 1:if(Ne=_e.payload,typeof Ne=="function"){le=Ne.call(ge,le,ne);break e}le=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=_e.payload,ne=typeof Ne=="function"?Ne.call(ge,le,ne):Ne,ne==null)break e;le=W({},le,ne);break e;case 2:Ga=!0}}D.callback!==null&&D.lane!==0&&(o.flags|=64,ne=S.effects,ne===null?S.effects=[D]:ne.push(D))}else ge={eventTime:ge,lane:ne,tag:D.tag,payload:D.payload,callback:D.callback,next:null},ie===null?(ee=ie=ge,B=le):ie=ie.next=ge,O|=ne;if(D=D.next,D===null){if(D=S.shared.pending,D===null)break;ne=D,D=ne.next,ne.next=null,S.lastBaseUpdate=ne,S.shared.pending=null}}while(!0);if(ie===null&&(B=le),S.baseState=B,S.firstBaseUpdate=ee,S.lastBaseUpdate=ie,c=S.shared.interleaved,c!==null){S=c;do O|=S.lane,S=S.next;while(S!==c)}else _===null&&(S.shared.lanes=0);Ro|=O,o.lanes=O,o.memoizedState=le}}function uj(o,c,m){if(o=c.effects,c.effects=null,o!==null)for(c=0;c<o.length;c++){var x=o[c],S=x.callback;if(S!==null){if(x.callback=null,x=m,typeof S!="function")throw Error(r(191,S));S.call(x)}}}var uc={},gi=Ha(uc),dc=Ha(uc),fc=Ha(uc);function Mo(o){if(o===uc)throw Error(r(174));return o}function cv(o,c){switch(pt(fc,c),pt(dc,o),pt(gi,uc),o=c.nodeType,o){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:Wi(null,"");break;default:o=o===8?c.parentNode:c,c=o.namespaceURI||null,o=o.tagName,c=Wi(c,o)}yt(gi),pt(gi,c)}function $s(){yt(gi),yt(dc),yt(fc)}function dj(o){Mo(fc.current);var c=Mo(gi.current),m=Wi(c,o.type);c!==m&&(pt(dc,o),pt(gi,m))}function uv(o){dc.current===o&&(yt(gi),yt(dc))}var Ct=Ha(0);function Ad(o){for(var c=o;c!==null;){if(c.tag===13){var m=c.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||m.data==="$?"||m.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===o)break;for(;c.sibling===null;){if(c.return===null||c.return===o)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var dv=[];function fv(){for(var o=0;o<dv.length;o++)dv[o]._workInProgressVersionPrimary=null;dv.length=0}var Td=k.ReactCurrentDispatcher,hv=k.ReactCurrentBatchConfig,Io=0,Ot=null,Yt=null,or=null,Md=!1,hc=!1,mc=0,CL=0;function jr(){throw Error(r(321))}function mv(o,c){if(c===null)return!1;for(var m=0;m<c.length&&m<o.length;m++)if(!Hn(o[m],c[m]))return!1;return!0}function pv(o,c,m,x,S,_){if(Io=_,Ot=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Td.current=o===null||o.memoizedState===null?ML:IL,o=m(x,S),hc){_=0;do{if(hc=!1,mc=0,25<=_)throw Error(r(301));_+=1,or=Yt=null,c.updateQueue=null,Td.current=RL,o=m(x,S)}while(hc)}if(Td.current=Dd,c=Yt!==null&&Yt.next!==null,Io=0,or=Yt=Ot=null,Md=!1,c)throw Error(r(300));return o}function vv(){var o=mc!==0;return mc=0,o}function yi(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return or===null?Ot.memoizedState=or=o:or=or.next=o,or}function Pn(){if(Yt===null){var o=Ot.alternate;o=o!==null?o.memoizedState:null}else o=Yt.next;var c=or===null?Ot.memoizedState:or.next;if(c!==null)or=c,Yt=o;else{if(o===null)throw Error(r(310));Yt=o,o={memoizedState:Yt.memoizedState,baseState:Yt.baseState,baseQueue:Yt.baseQueue,queue:Yt.queue,next:null},or===null?Ot.memoizedState=or=o:or=or.next=o}return or}function pc(o,c){return typeof c=="function"?c(o):c}function gv(o){var c=Pn(),m=c.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=o;var x=Yt,S=x.baseQueue,_=m.pending;if(_!==null){if(S!==null){var O=S.next;S.next=_.next,_.next=O}x.baseQueue=S=_,m.pending=null}if(S!==null){_=S.next,x=x.baseState;var D=O=null,B=null,ee=_;do{var ie=ee.lane;if((Io&ie)===ie)B!==null&&(B=B.next={lane:0,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),x=ee.hasEagerState?ee.eagerState:o(x,ee.action);else{var le={lane:ie,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null};B===null?(D=B=le,O=x):B=B.next=le,Ot.lanes|=ie,Ro|=ie}ee=ee.next}while(ee!==null&&ee!==_);B===null?O=x:B.next=D,Hn(x,c.memoizedState)||(Ur=!0),c.memoizedState=x,c.baseState=O,c.baseQueue=B,m.lastRenderedState=x}if(o=m.interleaved,o!==null){S=o;do _=S.lane,Ot.lanes|=_,Ro|=_,S=S.next;while(S!==o)}else S===null&&(m.lanes=0);return[c.memoizedState,m.dispatch]}function yv(o){var c=Pn(),m=c.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=o;var x=m.dispatch,S=m.pending,_=c.memoizedState;if(S!==null){m.pending=null;var O=S=S.next;do _=o(_,O.action),O=O.next;while(O!==S);Hn(_,c.memoizedState)||(Ur=!0),c.memoizedState=_,c.baseQueue===null&&(c.baseState=_),m.lastRenderedState=_}return[_,x]}function fj(){}function hj(o,c){var m=Ot,x=Pn(),S=c(),_=!Hn(x.memoizedState,S);if(_&&(x.memoizedState=S,Ur=!0),x=x.queue,xv(vj.bind(null,m,x,o),[o]),x.getSnapshot!==c||_||or!==null&&or.memoizedState.tag&1){if(m.flags|=2048,vc(9,pj.bind(null,m,x,S,c),void 0,null),sr===null)throw Error(r(349));(Io&30)!==0||mj(m,c,S)}return S}function mj(o,c,m){o.flags|=16384,o={getSnapshot:c,value:m},c=Ot.updateQueue,c===null?(c={lastEffect:null,stores:null},Ot.updateQueue=c,c.stores=[o]):(m=c.stores,m===null?c.stores=[o]:m.push(o))}function pj(o,c,m,x){c.value=m,c.getSnapshot=x,gj(c)&&yj(o)}function vj(o,c,m){return m(function(){gj(c)&&yj(o)})}function gj(o){var c=o.getSnapshot;o=o.value;try{var m=c();return!Hn(o,m)}catch{return!0}}function yj(o){var c=Ji(o,1);c!==null&&Qn(c,o,1,-1)}function xj(o){var c=yi();return typeof o=="function"&&(o=o()),c.memoizedState=c.baseState=o,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:pc,lastRenderedState:o},c.queue=o,o=o.dispatch=TL.bind(null,Ot,o),[c.memoizedState,o]}function vc(o,c,m,x){return o={tag:o,create:c,destroy:m,deps:x,next:null},c=Ot.updateQueue,c===null?(c={lastEffect:null,stores:null},Ot.updateQueue=c,c.lastEffect=o.next=o):(m=c.lastEffect,m===null?c.lastEffect=o.next=o:(x=m.next,m.next=o,o.next=x,c.lastEffect=o)),o}function bj(){return Pn().memoizedState}function Id(o,c,m,x){var S=yi();Ot.flags|=o,S.memoizedState=vc(1|c,m,void 0,x===void 0?null:x)}function Rd(o,c,m,x){var S=Pn();x=x===void 0?null:x;var _=void 0;if(Yt!==null){var O=Yt.memoizedState;if(_=O.destroy,x!==null&&mv(x,O.deps)){S.memoizedState=vc(c,m,_,x);return}}Ot.flags|=o,S.memoizedState=vc(1|c,m,_,x)}function wj(o,c){return Id(8390656,8,o,c)}function xv(o,c){return Rd(2048,8,o,c)}function jj(o,c){return Rd(4,2,o,c)}function Sj(o,c){return Rd(4,4,o,c)}function Nj(o,c){if(typeof c=="function")return o=o(),c(o),function(){c(null)};if(c!=null)return o=o(),c.current=o,function(){c.current=null}}function Pj(o,c,m){return m=m!=null?m.concat([o]):null,Rd(4,4,Nj.bind(null,c,o),m)}function bv(){}function kj(o,c){var m=Pn();c=c===void 0?null:c;var x=m.memoizedState;return x!==null&&c!==null&&mv(c,x[1])?x[0]:(m.memoizedState=[o,c],o)}function _j(o,c){var m=Pn();c=c===void 0?null:c;var x=m.memoizedState;return x!==null&&c!==null&&mv(c,x[1])?x[0]:(o=o(),m.memoizedState=[o,c],o)}function Ej(o,c,m){return(Io&21)===0?(o.baseState&&(o.baseState=!1,Ur=!0),o.memoizedState=m):(Hn(m,c)||(m=i1(),Ot.lanes|=m,Ro|=m,o.baseState=!0),c)}function OL(o,c){var m=lt;lt=m!==0&&4>m?m:4,o(!0);var x=hv.transition;hv.transition={};try{o(!1),c()}finally{lt=m,hv.transition=x}}function Cj(){return Pn().memoizedState}function AL(o,c,m){var x=eo(o);if(m={lane:x,action:m,hasEagerState:!1,eagerState:null,next:null},Oj(o))Aj(c,m);else if(m=sj(o,c,m,x),m!==null){var S=Or();Qn(m,o,x,S),Tj(m,c,x)}}function TL(o,c,m){var x=eo(o),S={lane:x,action:m,hasEagerState:!1,eagerState:null,next:null};if(Oj(o))Aj(c,S);else{var _=o.alternate;if(o.lanes===0&&(_===null||_.lanes===0)&&(_=c.lastRenderedReducer,_!==null))try{var O=c.lastRenderedState,D=_(O,m);if(S.hasEagerState=!0,S.eagerState=D,Hn(D,O)){var B=c.interleaved;B===null?(S.next=S,sv(c)):(S.next=B.next,B.next=S),c.interleaved=S;return}}catch{}finally{}m=sj(o,c,S,x),m!==null&&(S=Or(),Qn(m,o,x,S),Tj(m,c,x))}}function Oj(o){var c=o.alternate;return o===Ot||c!==null&&c===Ot}function Aj(o,c){hc=Md=!0;var m=o.pending;m===null?c.next=c:(c.next=m.next,m.next=c),o.pending=c}function Tj(o,c,m){if((m&4194240)!==0){var x=c.lanes;x&=o.pendingLanes,m|=x,c.lanes=m,jp(o,m)}}var Dd={readContext:Nn,useCallback:jr,useContext:jr,useEffect:jr,useImperativeHandle:jr,useInsertionEffect:jr,useLayoutEffect:jr,useMemo:jr,useReducer:jr,useRef:jr,useState:jr,useDebugValue:jr,useDeferredValue:jr,useTransition:jr,useMutableSource:jr,useSyncExternalStore:jr,useId:jr,unstable_isNewReconciler:!1},ML={readContext:Nn,useCallback:function(o,c){return yi().memoizedState=[o,c===void 0?null:c],o},useContext:Nn,useEffect:wj,useImperativeHandle:function(o,c,m){return m=m!=null?m.concat([o]):null,Id(4194308,4,Nj.bind(null,c,o),m)},useLayoutEffect:function(o,c){return Id(4194308,4,o,c)},useInsertionEffect:function(o,c){return Id(4,2,o,c)},useMemo:function(o,c){var m=yi();return c=c===void 0?null:c,o=o(),m.memoizedState=[o,c],o},useReducer:function(o,c,m){var x=yi();return c=m!==void 0?m(c):c,x.memoizedState=x.baseState=c,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:c},x.queue=o,o=o.dispatch=AL.bind(null,Ot,o),[x.memoizedState,o]},useRef:function(o){var c=yi();return o={current:o},c.memoizedState=o},useState:xj,useDebugValue:bv,useDeferredValue:function(o){return yi().memoizedState=o},useTransition:function(){var o=xj(!1),c=o[0];return o=OL.bind(null,o[1]),yi().memoizedState=o,[c,o]},useMutableSource:function(){},useSyncExternalStore:function(o,c,m){var x=Ot,S=yi();if(St){if(m===void 0)throw Error(r(407));m=m()}else{if(m=c(),sr===null)throw Error(r(349));(Io&30)!==0||mj(x,c,m)}S.memoizedState=m;var _={value:m,getSnapshot:c};return S.queue=_,wj(vj.bind(null,x,_,o),[o]),x.flags|=2048,vc(9,pj.bind(null,x,_,m,c),void 0,null),m},useId:function(){var o=yi(),c=sr.identifierPrefix;if(St){var m=Zi,x=Qi;m=(x&~(1<<32-qn(x)-1)).toString(32)+m,c=":"+c+"R"+m,m=mc++,0<m&&(c+="H"+m.toString(32)),c+=":"}else m=CL++,c=":"+c+"r"+m.toString(32)+":";return o.memoizedState=c},unstable_isNewReconciler:!1},IL={readContext:Nn,useCallback:kj,useContext:Nn,useEffect:xv,useImperativeHandle:Pj,useInsertionEffect:jj,useLayoutEffect:Sj,useMemo:_j,useReducer:gv,useRef:bj,useState:function(){return gv(pc)},useDebugValue:bv,useDeferredValue:function(o){var c=Pn();return Ej(c,Yt.memoizedState,o)},useTransition:function(){var o=gv(pc)[0],c=Pn().memoizedState;return[o,c]},useMutableSource:fj,useSyncExternalStore:hj,useId:Cj,unstable_isNewReconciler:!1},RL={readContext:Nn,useCallback:kj,useContext:Nn,useEffect:xv,useImperativeHandle:Pj,useInsertionEffect:jj,useLayoutEffect:Sj,useMemo:_j,useReducer:yv,useRef:bj,useState:function(){return yv(pc)},useDebugValue:bv,useDeferredValue:function(o){var c=Pn();return Yt===null?c.memoizedState=o:Ej(c,Yt.memoizedState,o)},useTransition:function(){var o=yv(pc)[0],c=Pn().memoizedState;return[o,c]},useMutableSource:fj,useSyncExternalStore:hj,useId:Cj,unstable_isNewReconciler:!1};function Yn(o,c){if(o&&o.defaultProps){c=W({},c),o=o.defaultProps;for(var m in o)c[m]===void 0&&(c[m]=o[m]);return c}return c}function wv(o,c,m,x){c=o.memoizedState,m=m(x,c),m=m==null?c:W({},c,m),o.memoizedState=m,o.lanes===0&&(o.updateQueue.baseState=m)}var Ld={isMounted:function(o){return(o=o._reactInternals)?Xe(o)===o:!1},enqueueSetState:function(o,c,m){o=o._reactInternals;var x=Or(),S=eo(o),_=ea(x,S);_.payload=c,m!=null&&(_.callback=m),c=Xa(o,_,S),c!==null&&(Qn(c,o,S,x),Cd(c,o,S))},enqueueReplaceState:function(o,c,m){o=o._reactInternals;var x=Or(),S=eo(o),_=ea(x,S);_.tag=1,_.payload=c,m!=null&&(_.callback=m),c=Xa(o,_,S),c!==null&&(Qn(c,o,S,x),Cd(c,o,S))},enqueueForceUpdate:function(o,c){o=o._reactInternals;var m=Or(),x=eo(o),S=ea(m,x);S.tag=2,c!=null&&(S.callback=c),c=Xa(o,S,x),c!==null&&(Qn(c,o,x,m),Cd(c,o,x))}};function Mj(o,c,m,x,S,_,O){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(x,_,O):c.prototype&&c.prototype.isPureReactComponent?!rc(m,x)||!rc(S,_):!0}function Ij(o,c,m){var x=!1,S=Va,_=c.contextType;return typeof _=="object"&&_!==null?_=Nn(_):(S=Wr(c)?Co:wr.current,x=c.contextTypes,_=(x=x!=null)?As(o,S):Va),c=new c(m,_),o.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Ld,o.stateNode=c,c._reactInternals=o,x&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=S,o.__reactInternalMemoizedMaskedChildContext=_),c}function Rj(o,c,m,x){o=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(m,x),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(m,x),c.state!==o&&Ld.enqueueReplaceState(c,c.state,null)}function jv(o,c,m,x){var S=o.stateNode;S.props=m,S.state=o.memoizedState,S.refs={},lv(o);var _=c.contextType;typeof _=="object"&&_!==null?S.context=Nn(_):(_=Wr(c)?Co:wr.current,S.context=As(o,_)),S.state=o.memoizedState,_=c.getDerivedStateFromProps,typeof _=="function"&&(wv(o,c,_,m),S.state=o.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(c=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),c!==S.state&&Ld.enqueueReplaceState(S,S.state,null),Od(o,m,S,x),S.state=o.memoizedState),typeof S.componentDidMount=="function"&&(o.flags|=4194308)}function zs(o,c){try{var m="",x=c;do m+=be(x),x=x.return;while(x);var S=m}catch(_){S=`
39
+ Error generating stack: `+_.message+`
40
+ `+_.stack}return{value:o,source:c,stack:S,digest:null}}function Sv(o,c,m){return{value:o,source:null,stack:m??null,digest:c??null}}function Nv(o,c){try{console.error(c.value)}catch(m){setTimeout(function(){throw m})}}var DL=typeof WeakMap=="function"?WeakMap:Map;function Dj(o,c,m){m=ea(-1,m),m.tag=3,m.payload={element:null};var x=c.value;return m.callback=function(){Kd||(Kd=!0,zv=x),Nv(o,c)},m}function Lj(o,c,m){m=ea(-1,m),m.tag=3;var x=o.type.getDerivedStateFromError;if(typeof x=="function"){var S=c.value;m.payload=function(){return x(S)},m.callback=function(){Nv(o,c)}}var _=o.stateNode;return _!==null&&typeof _.componentDidCatch=="function"&&(m.callback=function(){Nv(o,c),typeof x!="function"&&(Za===null?Za=new Set([this]):Za.add(this));var O=c.stack;this.componentDidCatch(c.value,{componentStack:O!==null?O:""})}),m}function $j(o,c,m){var x=o.pingCache;if(x===null){x=o.pingCache=new DL;var S=new Set;x.set(c,S)}else S=x.get(c),S===void 0&&(S=new Set,x.set(c,S));S.has(m)||(S.add(m),o=XL.bind(null,o,c,m),c.then(o,o))}function zj(o){do{var c;if((c=o.tag===13)&&(c=o.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return o;o=o.return}while(o!==null);return null}function Fj(o,c,m,x,S){return(o.mode&1)===0?(o===c?o.flags|=65536:(o.flags|=128,m.flags|=131072,m.flags&=-52805,m.tag===1&&(m.alternate===null?m.tag=17:(c=ea(-1,1),c.tag=2,Xa(m,c,1))),m.lanes|=1),o):(o.flags|=65536,o.lanes=S,o)}var LL=k.ReactCurrentOwner,Ur=!1;function Cr(o,c,m,x){c.child=o===null?oj(c,null,m,x):Rs(c,o.child,m,x)}function Bj(o,c,m,x,S){m=m.render;var _=c.ref;return Ls(c,S),x=pv(o,c,m,x,_,S),m=vv(),o!==null&&!Ur?(c.updateQueue=o.updateQueue,c.flags&=-2053,o.lanes&=~S,ta(o,c,S)):(St&&m&&Zp(c),c.flags|=1,Cr(o,c,x,S),c.child)}function Wj(o,c,m,x,S){if(o===null){var _=m.type;return typeof _=="function"&&!Hv(_)&&_.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(c.tag=15,c.type=_,Uj(o,c,_,x,S)):(o=Xd(m.type,null,x,c,c.mode,S),o.ref=c.ref,o.return=c,c.child=o)}if(_=o.child,(o.lanes&S)===0){var O=_.memoizedProps;if(m=m.compare,m=m!==null?m:rc,m(O,x)&&o.ref===c.ref)return ta(o,c,S)}return c.flags|=1,o=ro(_,x),o.ref=c.ref,o.return=c,c.child=o}function Uj(o,c,m,x,S){if(o!==null){var _=o.memoizedProps;if(rc(_,x)&&o.ref===c.ref)if(Ur=!1,c.pendingProps=x=_,(o.lanes&S)!==0)(o.flags&131072)!==0&&(Ur=!0);else return c.lanes=o.lanes,ta(o,c,S)}return Pv(o,c,m,x,S)}function Kj(o,c,m){var x=c.pendingProps,S=x.children,_=o!==null?o.memoizedState:null;if(x.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},pt(Bs,sn),sn|=m;else{if((m&1073741824)===0)return o=_!==null?_.baseLanes|m:m,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:o,cachePool:null,transitions:null},c.updateQueue=null,pt(Bs,sn),sn|=o,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},x=_!==null?_.baseLanes:m,pt(Bs,sn),sn|=x}else _!==null?(x=_.baseLanes|m,c.memoizedState=null):x=m,pt(Bs,sn),sn|=x;return Cr(o,c,S,m),c.child}function qj(o,c){var m=c.ref;(o===null&&m!==null||o!==null&&o.ref!==m)&&(c.flags|=512,c.flags|=2097152)}function Pv(o,c,m,x,S){var _=Wr(m)?Co:wr.current;return _=As(c,_),Ls(c,S),m=pv(o,c,m,x,_,S),x=vv(),o!==null&&!Ur?(c.updateQueue=o.updateQueue,c.flags&=-2053,o.lanes&=~S,ta(o,c,S)):(St&&x&&Zp(c),c.flags|=1,Cr(o,c,m,S),c.child)}function Hj(o,c,m,x,S){if(Wr(m)){var _=!0;wd(c)}else _=!1;if(Ls(c,S),c.stateNode===null)zd(o,c),Ij(c,m,x),jv(c,m,x,S),x=!0;else if(o===null){var O=c.stateNode,D=c.memoizedProps;O.props=D;var B=O.context,ee=m.contextType;typeof ee=="object"&&ee!==null?ee=Nn(ee):(ee=Wr(m)?Co:wr.current,ee=As(c,ee));var ie=m.getDerivedStateFromProps,le=typeof ie=="function"||typeof O.getSnapshotBeforeUpdate=="function";le||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(D!==x||B!==ee)&&Rj(c,O,x,ee),Ga=!1;var ne=c.memoizedState;O.state=ne,Od(c,x,O,S),B=c.memoizedState,D!==x||ne!==B||Br.current||Ga?(typeof ie=="function"&&(wv(c,m,ie,x),B=c.memoizedState),(D=Ga||Mj(c,m,D,x,ne,B,ee))?(le||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(c.flags|=4194308)):(typeof O.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=x,c.memoizedState=B),O.props=x,O.state=B,O.context=ee,x=D):(typeof O.componentDidMount=="function"&&(c.flags|=4194308),x=!1)}else{O=c.stateNode,lj(o,c),D=c.memoizedProps,ee=c.type===c.elementType?D:Yn(c.type,D),O.props=ee,le=c.pendingProps,ne=O.context,B=m.contextType,typeof B=="object"&&B!==null?B=Nn(B):(B=Wr(m)?Co:wr.current,B=As(c,B));var ge=m.getDerivedStateFromProps;(ie=typeof ge=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(D!==le||ne!==B)&&Rj(c,O,x,B),Ga=!1,ne=c.memoizedState,O.state=ne,Od(c,x,O,S);var Ne=c.memoizedState;D!==le||ne!==Ne||Br.current||Ga?(typeof ge=="function"&&(wv(c,m,ge,x),Ne=c.memoizedState),(ee=Ga||Mj(c,m,ee,x,ne,Ne,B)||!1)?(ie||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(x,Ne,B),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(x,Ne,B)),typeof O.componentDidUpdate=="function"&&(c.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof O.componentDidUpdate!="function"||D===o.memoizedProps&&ne===o.memoizedState||(c.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||D===o.memoizedProps&&ne===o.memoizedState||(c.flags|=1024),c.memoizedProps=x,c.memoizedState=Ne),O.props=x,O.state=Ne,O.context=B,x=ee):(typeof O.componentDidUpdate!="function"||D===o.memoizedProps&&ne===o.memoizedState||(c.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||D===o.memoizedProps&&ne===o.memoizedState||(c.flags|=1024),x=!1)}return kv(o,c,m,x,_,S)}function kv(o,c,m,x,S,_){qj(o,c);var O=(c.flags&128)!==0;if(!x&&!O)return S&&Q1(c,m,!1),ta(o,c,_);x=c.stateNode,LL.current=c;var D=O&&typeof m.getDerivedStateFromError!="function"?null:x.render();return c.flags|=1,o!==null&&O?(c.child=Rs(c,o.child,null,_),c.child=Rs(c,null,D,_)):Cr(o,c,D,_),c.memoizedState=x.state,S&&Q1(c,m,!0),c.child}function Vj(o){var c=o.stateNode;c.pendingContext?G1(o,c.pendingContext,c.pendingContext!==c.context):c.context&&G1(o,c.context,!1),cv(o,c.containerInfo)}function Yj(o,c,m,x,S){return Is(),rv(S),c.flags|=256,Cr(o,c,m,x),c.child}var _v={dehydrated:null,treeContext:null,retryLane:0};function Ev(o){return{baseLanes:o,cachePool:null,transitions:null}}function Gj(o,c,m){var x=c.pendingProps,S=Ct.current,_=!1,O=(c.flags&128)!==0,D;if((D=O)||(D=o!==null&&o.memoizedState===null?!1:(S&2)!==0),D?(_=!0,c.flags&=-129):(o===null||o.memoizedState!==null)&&(S|=1),pt(Ct,S&1),o===null)return tv(c),o=c.memoizedState,o!==null&&(o=o.dehydrated,o!==null)?((c.mode&1)===0?c.lanes=1:o.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(O=x.children,o=x.fallback,_?(x=c.mode,_=c.child,O={mode:"hidden",children:O},(x&1)===0&&_!==null?(_.childLanes=0,_.pendingProps=O):_=Qd(O,x,0,null),o=zo(o,x,m,null),_.return=c,o.return=c,_.sibling=o,c.child=_,c.child.memoizedState=Ev(m),c.memoizedState=_v,o):Cv(c,O));if(S=o.memoizedState,S!==null&&(D=S.dehydrated,D!==null))return $L(o,c,O,x,D,S,m);if(_){_=x.fallback,O=c.mode,S=o.child,D=S.sibling;var B={mode:"hidden",children:x.children};return(O&1)===0&&c.child!==S?(x=c.child,x.childLanes=0,x.pendingProps=B,c.deletions=null):(x=ro(S,B),x.subtreeFlags=S.subtreeFlags&14680064),D!==null?_=ro(D,_):(_=zo(_,O,m,null),_.flags|=2),_.return=c,x.return=c,x.sibling=_,c.child=x,x=_,_=c.child,O=o.child.memoizedState,O=O===null?Ev(m):{baseLanes:O.baseLanes|m,cachePool:null,transitions:O.transitions},_.memoizedState=O,_.childLanes=o.childLanes&~m,c.memoizedState=_v,x}return _=o.child,o=_.sibling,x=ro(_,{mode:"visible",children:x.children}),(c.mode&1)===0&&(x.lanes=m),x.return=c,x.sibling=null,o!==null&&(m=c.deletions,m===null?(c.deletions=[o],c.flags|=16):m.push(o)),c.child=x,c.memoizedState=null,x}function Cv(o,c){return c=Qd({mode:"visible",children:c},o.mode,0,null),c.return=o,o.child=c}function $d(o,c,m,x){return x!==null&&rv(x),Rs(c,o.child,null,m),o=Cv(c,c.pendingProps.children),o.flags|=2,c.memoizedState=null,o}function $L(o,c,m,x,S,_,O){if(m)return c.flags&256?(c.flags&=-257,x=Sv(Error(r(422))),$d(o,c,O,x)):c.memoizedState!==null?(c.child=o.child,c.flags|=128,null):(_=x.fallback,S=c.mode,x=Qd({mode:"visible",children:x.children},S,0,null),_=zo(_,S,O,null),_.flags|=2,x.return=c,_.return=c,x.sibling=_,c.child=x,(c.mode&1)!==0&&Rs(c,o.child,null,O),c.child.memoizedState=Ev(O),c.memoizedState=_v,_);if((c.mode&1)===0)return $d(o,c,O,null);if(S.data==="$!"){if(x=S.nextSibling&&S.nextSibling.dataset,x)var D=x.dgst;return x=D,_=Error(r(419)),x=Sv(_,x,void 0),$d(o,c,O,x)}if(D=(O&o.childLanes)!==0,Ur||D){if(x=sr,x!==null){switch(O&-O){case 4:S=2;break;case 16:S=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:S=32;break;case 536870912:S=268435456;break;default:S=0}S=(S&(x.suspendedLanes|O))!==0?0:S,S!==0&&S!==_.retryLane&&(_.retryLane=S,Ji(o,S),Qn(x,o,S,-1))}return qv(),x=Sv(Error(r(421))),$d(o,c,O,x)}return S.data==="$?"?(c.flags|=128,c.child=o.child,c=QL.bind(null,o),S._reactRetry=c,null):(o=_.treeContext,on=qa(S.nextSibling),an=c,St=!0,Vn=null,o!==null&&(jn[Sn++]=Qi,jn[Sn++]=Zi,jn[Sn++]=Oo,Qi=o.id,Zi=o.overflow,Oo=c),c=Cv(c,x.children),c.flags|=4096,c)}function Xj(o,c,m){o.lanes|=c;var x=o.alternate;x!==null&&(x.lanes|=c),ov(o.return,c,m)}function Ov(o,c,m,x,S){var _=o.memoizedState;_===null?o.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:x,tail:m,tailMode:S}:(_.isBackwards=c,_.rendering=null,_.renderingStartTime=0,_.last=x,_.tail=m,_.tailMode=S)}function Qj(o,c,m){var x=c.pendingProps,S=x.revealOrder,_=x.tail;if(Cr(o,c,x.children,m),x=Ct.current,(x&2)!==0)x=x&1|2,c.flags|=128;else{if(o!==null&&(o.flags&128)!==0)e:for(o=c.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&Xj(o,m,c);else if(o.tag===19)Xj(o,m,c);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===c)break e;for(;o.sibling===null;){if(o.return===null||o.return===c)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}x&=1}if(pt(Ct,x),(c.mode&1)===0)c.memoizedState=null;else switch(S){case"forwards":for(m=c.child,S=null;m!==null;)o=m.alternate,o!==null&&Ad(o)===null&&(S=m),m=m.sibling;m=S,m===null?(S=c.child,c.child=null):(S=m.sibling,m.sibling=null),Ov(c,!1,S,m,_);break;case"backwards":for(m=null,S=c.child,c.child=null;S!==null;){if(o=S.alternate,o!==null&&Ad(o)===null){c.child=S;break}o=S.sibling,S.sibling=m,m=S,S=o}Ov(c,!0,m,null,_);break;case"together":Ov(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function zd(o,c){(c.mode&1)===0&&o!==null&&(o.alternate=null,c.alternate=null,c.flags|=2)}function ta(o,c,m){if(o!==null&&(c.dependencies=o.dependencies),Ro|=c.lanes,(m&c.childLanes)===0)return null;if(o!==null&&c.child!==o.child)throw Error(r(153));if(c.child!==null){for(o=c.child,m=ro(o,o.pendingProps),c.child=m,m.return=c;o.sibling!==null;)o=o.sibling,m=m.sibling=ro(o,o.pendingProps),m.return=c;m.sibling=null}return c.child}function zL(o,c,m){switch(c.tag){case 3:Vj(c),Is();break;case 5:dj(c);break;case 1:Wr(c.type)&&wd(c);break;case 4:cv(c,c.stateNode.containerInfo);break;case 10:var x=c.type._context,S=c.memoizedProps.value;pt(_d,x._currentValue),x._currentValue=S;break;case 13:if(x=c.memoizedState,x!==null)return x.dehydrated!==null?(pt(Ct,Ct.current&1),c.flags|=128,null):(m&c.child.childLanes)!==0?Gj(o,c,m):(pt(Ct,Ct.current&1),o=ta(o,c,m),o!==null?o.sibling:null);pt(Ct,Ct.current&1);break;case 19:if(x=(m&c.childLanes)!==0,(o.flags&128)!==0){if(x)return Qj(o,c,m);c.flags|=128}if(S=c.memoizedState,S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),pt(Ct,Ct.current),x)break;return null;case 22:case 23:return c.lanes=0,Kj(o,c,m)}return ta(o,c,m)}var Zj,Av,Jj,eS;Zj=function(o,c){for(var m=c.child;m!==null;){if(m.tag===5||m.tag===6)o.appendChild(m.stateNode);else if(m.tag!==4&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===c)break;for(;m.sibling===null;){if(m.return===null||m.return===c)return;m=m.return}m.sibling.return=m.return,m=m.sibling}},Av=function(){},Jj=function(o,c,m,x){var S=o.memoizedProps;if(S!==x){o=c.stateNode,Mo(gi.current);var _=null;switch(m){case"input":S=We(o,S),x=We(o,x),_=[];break;case"select":S=W({},S,{value:void 0}),x=W({},x,{value:void 0}),_=[];break;case"textarea":S=fi(o,S),x=fi(o,x),_=[];break;default:typeof S.onClick!="function"&&typeof x.onClick=="function"&&(o.onclick=yd)}ir(m,x);var O;m=null;for(ee in S)if(!x.hasOwnProperty(ee)&&S.hasOwnProperty(ee)&&S[ee]!=null)if(ee==="style"){var D=S[ee];for(O in D)D.hasOwnProperty(O)&&(m||(m={}),m[O]="")}else ee!=="dangerouslySetInnerHTML"&&ee!=="children"&&ee!=="suppressContentEditableWarning"&&ee!=="suppressHydrationWarning"&&ee!=="autoFocus"&&(i.hasOwnProperty(ee)?_||(_=[]):(_=_||[]).push(ee,null));for(ee in x){var B=x[ee];if(D=S!=null?S[ee]:void 0,x.hasOwnProperty(ee)&&B!==D&&(B!=null||D!=null))if(ee==="style")if(D){for(O in D)!D.hasOwnProperty(O)||B&&B.hasOwnProperty(O)||(m||(m={}),m[O]="");for(O in B)B.hasOwnProperty(O)&&D[O]!==B[O]&&(m||(m={}),m[O]=B[O])}else m||(_||(_=[]),_.push(ee,m)),m=B;else ee==="dangerouslySetInnerHTML"?(B=B?B.__html:void 0,D=D?D.__html:void 0,B!=null&&D!==B&&(_=_||[]).push(ee,B)):ee==="children"?typeof B!="string"&&typeof B!="number"||(_=_||[]).push(ee,""+B):ee!=="suppressContentEditableWarning"&&ee!=="suppressHydrationWarning"&&(i.hasOwnProperty(ee)?(B!=null&&ee==="onScroll"&&gt("scroll",o),_||D===B||(_=[])):(_=_||[]).push(ee,B))}m&&(_=_||[]).push("style",m);var ee=_;(c.updateQueue=ee)&&(c.flags|=4)}},eS=function(o,c,m,x){m!==x&&(c.flags|=4)};function gc(o,c){if(!St)switch(o.tailMode){case"hidden":c=o.tail;for(var m=null;c!==null;)c.alternate!==null&&(m=c),c=c.sibling;m===null?o.tail=null:m.sibling=null;break;case"collapsed":m=o.tail;for(var x=null;m!==null;)m.alternate!==null&&(x=m),m=m.sibling;x===null?c||o.tail===null?o.tail=null:o.tail.sibling=null:x.sibling=null}}function Sr(o){var c=o.alternate!==null&&o.alternate.child===o.child,m=0,x=0;if(c)for(var S=o.child;S!==null;)m|=S.lanes|S.childLanes,x|=S.subtreeFlags&14680064,x|=S.flags&14680064,S.return=o,S=S.sibling;else for(S=o.child;S!==null;)m|=S.lanes|S.childLanes,x|=S.subtreeFlags,x|=S.flags,S.return=o,S=S.sibling;return o.subtreeFlags|=x,o.childLanes=m,c}function FL(o,c,m){var x=c.pendingProps;switch(Jp(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Sr(c),null;case 1:return Wr(c.type)&&bd(),Sr(c),null;case 3:return x=c.stateNode,$s(),yt(Br),yt(wr),fv(),x.pendingContext&&(x.context=x.pendingContext,x.pendingContext=null),(o===null||o.child===null)&&(Pd(c)?c.flags|=4:o===null||o.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,Vn!==null&&(Wv(Vn),Vn=null))),Av(o,c),Sr(c),null;case 5:uv(c);var S=Mo(fc.current);if(m=c.type,o!==null&&c.stateNode!=null)Jj(o,c,m,x,S),o.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!x){if(c.stateNode===null)throw Error(r(166));return Sr(c),null}if(o=Mo(gi.current),Pd(c)){x=c.stateNode,m=c.type;var _=c.memoizedProps;switch(x[vi]=c,x[sc]=_,o=(c.mode&1)!==0,m){case"dialog":gt("cancel",x),gt("close",x);break;case"iframe":case"object":case"embed":gt("load",x);break;case"video":case"audio":for(S=0;S<ic.length;S++)gt(ic[S],x);break;case"source":gt("error",x);break;case"img":case"image":case"link":gt("error",x),gt("load",x);break;case"details":gt("toggle",x);break;case"input":jt(x,_),gt("invalid",x);break;case"select":x._wrapperState={wasMultiple:!!_.multiple},gt("invalid",x);break;case"textarea":Po(x,_),gt("invalid",x)}ir(m,_),S=null;for(var O in _)if(_.hasOwnProperty(O)){var D=_[O];O==="children"?typeof D=="string"?x.textContent!==D&&(_.suppressHydrationWarning!==!0&&gd(x.textContent,D,o),S=["children",D]):typeof D=="number"&&x.textContent!==""+D&&(_.suppressHydrationWarning!==!0&&gd(x.textContent,D,o),S=["children",""+D]):i.hasOwnProperty(O)&&D!=null&&O==="onScroll"&&gt("scroll",x)}switch(m){case"input":Le(x),Un(x,_,!0);break;case"textarea":Le(x),ko(x);break;case"select":case"option":break;default:typeof _.onClick=="function"&&(x.onclick=yd)}x=S,c.updateQueue=x,x!==null&&(c.flags|=4)}else{O=S.nodeType===9?S:S.ownerDocument,o==="http://www.w3.org/1999/xhtml"&&(o=Ia(m)),o==="http://www.w3.org/1999/xhtml"?m==="script"?(o=O.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild)):typeof x.is=="string"?o=O.createElement(m,{is:x.is}):(o=O.createElement(m),m==="select"&&(O=o,x.multiple?O.multiple=!0:x.size&&(O.size=x.size))):o=O.createElementNS(o,m),o[vi]=c,o[sc]=x,Zj(o,c,!1,!1),c.stateNode=o;e:{switch(O=Ui(m,x),m){case"dialog":gt("cancel",o),gt("close",o),S=x;break;case"iframe":case"object":case"embed":gt("load",o),S=x;break;case"video":case"audio":for(S=0;S<ic.length;S++)gt(ic[S],o);S=x;break;case"source":gt("error",o),S=x;break;case"img":case"image":case"link":gt("error",o),gt("load",o),S=x;break;case"details":gt("toggle",o),S=x;break;case"input":jt(o,x),S=We(o,x),gt("invalid",o);break;case"option":S=x;break;case"select":o._wrapperState={wasMultiple:!!x.multiple},S=W({},x,{value:void 0}),gt("invalid",o);break;case"textarea":Po(o,x),S=fi(o,x),gt("invalid",o);break;default:S=x}ir(m,S),D=S;for(_ in D)if(D.hasOwnProperty(_)){var B=D[_];_==="style"?hi(o,B):_==="dangerouslySetInnerHTML"?(B=B?B.__html:void 0,B!=null&&Ra(o,B)):_==="children"?typeof B=="string"?(m!=="textarea"||B!=="")&&en(o,B):typeof B=="number"&&en(o,""+B):_!=="suppressContentEditableWarning"&&_!=="suppressHydrationWarning"&&_!=="autoFocus"&&(i.hasOwnProperty(_)?B!=null&&_==="onScroll"&&gt("scroll",o):B!=null&&E(o,_,B,O))}switch(m){case"input":Le(o),Un(o,x,!1);break;case"textarea":Le(o),ko(o);break;case"option":x.value!=null&&o.setAttribute("value",""+Se(x.value));break;case"select":o.multiple=!!x.multiple,_=x.value,_!=null?st(o,!!x.multiple,_,!1):x.defaultValue!=null&&st(o,!!x.multiple,x.defaultValue,!0);break;default:typeof S.onClick=="function"&&(o.onclick=yd)}switch(m){case"button":case"input":case"select":case"textarea":x=!!x.autoFocus;break e;case"img":x=!0;break e;default:x=!1}}x&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Sr(c),null;case 6:if(o&&c.stateNode!=null)eS(o,c,o.memoizedProps,x);else{if(typeof x!="string"&&c.stateNode===null)throw Error(r(166));if(m=Mo(fc.current),Mo(gi.current),Pd(c)){if(x=c.stateNode,m=c.memoizedProps,x[vi]=c,(_=x.nodeValue!==m)&&(o=an,o!==null))switch(o.tag){case 3:gd(x.nodeValue,m,(o.mode&1)!==0);break;case 5:o.memoizedProps.suppressHydrationWarning!==!0&&gd(x.nodeValue,m,(o.mode&1)!==0)}_&&(c.flags|=4)}else x=(m.nodeType===9?m:m.ownerDocument).createTextNode(x),x[vi]=c,c.stateNode=x}return Sr(c),null;case 13:if(yt(Ct),x=c.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(St&&on!==null&&(c.mode&1)!==0&&(c.flags&128)===0)nj(),Is(),c.flags|=98560,_=!1;else if(_=Pd(c),x!==null&&x.dehydrated!==null){if(o===null){if(!_)throw Error(r(318));if(_=c.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(r(317));_[vi]=c}else Is(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Sr(c),_=!1}else Vn!==null&&(Wv(Vn),Vn=null),_=!0;if(!_)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=m,c):(x=x!==null,x!==(o!==null&&o.memoizedState!==null)&&x&&(c.child.flags|=8192,(c.mode&1)!==0&&(o===null||(Ct.current&1)!==0?Gt===0&&(Gt=3):qv())),c.updateQueue!==null&&(c.flags|=4),Sr(c),null);case 4:return $s(),Av(o,c),o===null&&ac(c.stateNode.containerInfo),Sr(c),null;case 10:return av(c.type._context),Sr(c),null;case 17:return Wr(c.type)&&bd(),Sr(c),null;case 19:if(yt(Ct),_=c.memoizedState,_===null)return Sr(c),null;if(x=(c.flags&128)!==0,O=_.rendering,O===null)if(x)gc(_,!1);else{if(Gt!==0||o!==null&&(o.flags&128)!==0)for(o=c.child;o!==null;){if(O=Ad(o),O!==null){for(c.flags|=128,gc(_,!1),x=O.updateQueue,x!==null&&(c.updateQueue=x,c.flags|=4),c.subtreeFlags=0,x=m,m=c.child;m!==null;)_=m,o=x,_.flags&=14680066,O=_.alternate,O===null?(_.childLanes=0,_.lanes=o,_.child=null,_.subtreeFlags=0,_.memoizedProps=null,_.memoizedState=null,_.updateQueue=null,_.dependencies=null,_.stateNode=null):(_.childLanes=O.childLanes,_.lanes=O.lanes,_.child=O.child,_.subtreeFlags=0,_.deletions=null,_.memoizedProps=O.memoizedProps,_.memoizedState=O.memoizedState,_.updateQueue=O.updateQueue,_.type=O.type,o=O.dependencies,_.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),m=m.sibling;return pt(Ct,Ct.current&1|2),c.child}o=o.sibling}_.tail!==null&&tt()>Ws&&(c.flags|=128,x=!0,gc(_,!1),c.lanes=4194304)}else{if(!x)if(o=Ad(O),o!==null){if(c.flags|=128,x=!0,m=o.updateQueue,m!==null&&(c.updateQueue=m,c.flags|=4),gc(_,!0),_.tail===null&&_.tailMode==="hidden"&&!O.alternate&&!St)return Sr(c),null}else 2*tt()-_.renderingStartTime>Ws&&m!==1073741824&&(c.flags|=128,x=!0,gc(_,!1),c.lanes=4194304);_.isBackwards?(O.sibling=c.child,c.child=O):(m=_.last,m!==null?m.sibling=O:c.child=O,_.last=O)}return _.tail!==null?(c=_.tail,_.rendering=c,_.tail=c.sibling,_.renderingStartTime=tt(),c.sibling=null,m=Ct.current,pt(Ct,x?m&1|2:m&1),c):(Sr(c),null);case 22:case 23:return Kv(),x=c.memoizedState!==null,o!==null&&o.memoizedState!==null!==x&&(c.flags|=8192),x&&(c.mode&1)!==0?(sn&1073741824)!==0&&(Sr(c),c.subtreeFlags&6&&(c.flags|=8192)):Sr(c),null;case 24:return null;case 25:return null}throw Error(r(156,c.tag))}function BL(o,c){switch(Jp(c),c.tag){case 1:return Wr(c.type)&&bd(),o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 3:return $s(),yt(Br),yt(wr),fv(),o=c.flags,(o&65536)!==0&&(o&128)===0?(c.flags=o&-65537|128,c):null;case 5:return uv(c),null;case 13:if(yt(Ct),o=c.memoizedState,o!==null&&o.dehydrated!==null){if(c.alternate===null)throw Error(r(340));Is()}return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 19:return yt(Ct),null;case 4:return $s(),null;case 10:return av(c.type._context),null;case 22:case 23:return Kv(),null;case 24:return null;default:return null}}var Fd=!1,Nr=!1,WL=typeof WeakSet=="function"?WeakSet:Set,we=null;function Fs(o,c){var m=o.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(x){Rt(o,c,x)}else m.current=null}function Tv(o,c,m){try{m()}catch(x){Rt(o,c,x)}}var tS=!1;function UL(o,c){if(Kp=od,o=M1(),Dp(o)){if("selectionStart"in o)var m={start:o.selectionStart,end:o.selectionEnd};else e:{m=(m=o.ownerDocument)&&m.defaultView||window;var x=m.getSelection&&m.getSelection();if(x&&x.rangeCount!==0){m=x.anchorNode;var S=x.anchorOffset,_=x.focusNode;x=x.focusOffset;try{m.nodeType,_.nodeType}catch{m=null;break e}var O=0,D=-1,B=-1,ee=0,ie=0,le=o,ne=null;t:for(;;){for(var ge;le!==m||S!==0&&le.nodeType!==3||(D=O+S),le!==_||x!==0&&le.nodeType!==3||(B=O+x),le.nodeType===3&&(O+=le.nodeValue.length),(ge=le.firstChild)!==null;)ne=le,le=ge;for(;;){if(le===o)break t;if(ne===m&&++ee===S&&(D=O),ne===_&&++ie===x&&(B=O),(ge=le.nextSibling)!==null)break;le=ne,ne=le.parentNode}le=ge}m=D===-1||B===-1?null:{start:D,end:B}}else m=null}m=m||{start:0,end:0}}else m=null;for(qp={focusedElem:o,selectionRange:m},od=!1,we=c;we!==null;)if(c=we,o=c.child,(c.subtreeFlags&1028)!==0&&o!==null)o.return=c,we=o;else for(;we!==null;){c=we;try{var Ne=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(Ne!==null){var _e=Ne.memoizedProps,Ft=Ne.memoizedState,G=c.stateNode,q=G.getSnapshotBeforeUpdate(c.elementType===c.type?_e:Yn(c.type,_e),Ft);G.__reactInternalSnapshotBeforeUpdate=q}break;case 3:var Z=c.stateNode.containerInfo;Z.nodeType===1?Z.textContent="":Z.nodeType===9&&Z.documentElement&&Z.removeChild(Z.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(ue){Rt(c,c.return,ue)}if(o=c.sibling,o!==null){o.return=c.return,we=o;break}we=c.return}return Ne=tS,tS=!1,Ne}function yc(o,c,m){var x=c.updateQueue;if(x=x!==null?x.lastEffect:null,x!==null){var S=x=x.next;do{if((S.tag&o)===o){var _=S.destroy;S.destroy=void 0,_!==void 0&&Tv(c,m,_)}S=S.next}while(S!==x)}}function Bd(o,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var m=c=c.next;do{if((m.tag&o)===o){var x=m.create;m.destroy=x()}m=m.next}while(m!==c)}}function Mv(o){var c=o.ref;if(c!==null){var m=o.stateNode;switch(o.tag){case 5:o=m;break;default:o=m}typeof c=="function"?c(o):c.current=o}}function rS(o){var c=o.alternate;c!==null&&(o.alternate=null,rS(c)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(c=o.stateNode,c!==null&&(delete c[vi],delete c[sc],delete c[Gp],delete c[PL],delete c[kL])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function nS(o){return o.tag===5||o.tag===3||o.tag===4}function iS(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||nS(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Iv(o,c,m){var x=o.tag;if(x===5||x===6)o=o.stateNode,c?m.nodeType===8?m.parentNode.insertBefore(o,c):m.insertBefore(o,c):(m.nodeType===8?(c=m.parentNode,c.insertBefore(o,m)):(c=m,c.appendChild(o)),m=m._reactRootContainer,m!=null||c.onclick!==null||(c.onclick=yd));else if(x!==4&&(o=o.child,o!==null))for(Iv(o,c,m),o=o.sibling;o!==null;)Iv(o,c,m),o=o.sibling}function Rv(o,c,m){var x=o.tag;if(x===5||x===6)o=o.stateNode,c?m.insertBefore(o,c):m.appendChild(o);else if(x!==4&&(o=o.child,o!==null))for(Rv(o,c,m),o=o.sibling;o!==null;)Rv(o,c,m),o=o.sibling}var pr=null,Gn=!1;function Qa(o,c,m){for(m=m.child;m!==null;)aS(o,c,m),m=m.sibling}function aS(o,c,m){if(pi&&typeof pi.onCommitFiberUnmount=="function")try{pi.onCommitFiberUnmount(ed,m)}catch{}switch(m.tag){case 5:Nr||Fs(m,c);case 6:var x=pr,S=Gn;pr=null,Qa(o,c,m),pr=x,Gn=S,pr!==null&&(Gn?(o=pr,m=m.stateNode,o.nodeType===8?o.parentNode.removeChild(m):o.removeChild(m)):pr.removeChild(m.stateNode));break;case 18:pr!==null&&(Gn?(o=pr,m=m.stateNode,o.nodeType===8?Yp(o.parentNode,m):o.nodeType===1&&Yp(o,m),Xl(o)):Yp(pr,m.stateNode));break;case 4:x=pr,S=Gn,pr=m.stateNode.containerInfo,Gn=!0,Qa(o,c,m),pr=x,Gn=S;break;case 0:case 11:case 14:case 15:if(!Nr&&(x=m.updateQueue,x!==null&&(x=x.lastEffect,x!==null))){S=x=x.next;do{var _=S,O=_.destroy;_=_.tag,O!==void 0&&((_&2)!==0||(_&4)!==0)&&Tv(m,c,O),S=S.next}while(S!==x)}Qa(o,c,m);break;case 1:if(!Nr&&(Fs(m,c),x=m.stateNode,typeof x.componentWillUnmount=="function"))try{x.props=m.memoizedProps,x.state=m.memoizedState,x.componentWillUnmount()}catch(D){Rt(m,c,D)}Qa(o,c,m);break;case 21:Qa(o,c,m);break;case 22:m.mode&1?(Nr=(x=Nr)||m.memoizedState!==null,Qa(o,c,m),Nr=x):Qa(o,c,m);break;default:Qa(o,c,m)}}function oS(o){var c=o.updateQueue;if(c!==null){o.updateQueue=null;var m=o.stateNode;m===null&&(m=o.stateNode=new WL),c.forEach(function(x){var S=ZL.bind(null,o,x);m.has(x)||(m.add(x),x.then(S,S))})}}function Xn(o,c){var m=c.deletions;if(m!==null)for(var x=0;x<m.length;x++){var S=m[x];try{var _=o,O=c,D=O;e:for(;D!==null;){switch(D.tag){case 5:pr=D.stateNode,Gn=!1;break e;case 3:pr=D.stateNode.containerInfo,Gn=!0;break e;case 4:pr=D.stateNode.containerInfo,Gn=!0;break e}D=D.return}if(pr===null)throw Error(r(160));aS(_,O,S),pr=null,Gn=!1;var B=S.alternate;B!==null&&(B.return=null),S.return=null}catch(ee){Rt(S,c,ee)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)sS(c,o),c=c.sibling}function sS(o,c){var m=o.alternate,x=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(Xn(c,o),xi(o),x&4){try{yc(3,o,o.return),Bd(3,o)}catch(_e){Rt(o,o.return,_e)}try{yc(5,o,o.return)}catch(_e){Rt(o,o.return,_e)}}break;case 1:Xn(c,o),xi(o),x&512&&m!==null&&Fs(m,m.return);break;case 5:if(Xn(c,o),xi(o),x&512&&m!==null&&Fs(m,m.return),o.flags&32){var S=o.stateNode;try{en(S,"")}catch(_e){Rt(o,o.return,_e)}}if(x&4&&(S=o.stateNode,S!=null)){var _=o.memoizedProps,O=m!==null?m.memoizedProps:_,D=o.type,B=o.updateQueue;if(o.updateQueue=null,B!==null)try{D==="input"&&_.type==="radio"&&_.name!=null&&zt(S,_),Ui(D,O);var ee=Ui(D,_);for(O=0;O<B.length;O+=2){var ie=B[O],le=B[O+1];ie==="style"?hi(S,le):ie==="dangerouslySetInnerHTML"?Ra(S,le):ie==="children"?en(S,le):E(S,ie,le,ee)}switch(D){case"input":mt(S,_);break;case"textarea":Bi(S,_);break;case"select":var ne=S._wrapperState.wasMultiple;S._wrapperState.wasMultiple=!!_.multiple;var ge=_.value;ge!=null?st(S,!!_.multiple,ge,!1):ne!==!!_.multiple&&(_.defaultValue!=null?st(S,!!_.multiple,_.defaultValue,!0):st(S,!!_.multiple,_.multiple?[]:"",!1))}S[sc]=_}catch(_e){Rt(o,o.return,_e)}}break;case 6:if(Xn(c,o),xi(o),x&4){if(o.stateNode===null)throw Error(r(162));S=o.stateNode,_=o.memoizedProps;try{S.nodeValue=_}catch(_e){Rt(o,o.return,_e)}}break;case 3:if(Xn(c,o),xi(o),x&4&&m!==null&&m.memoizedState.isDehydrated)try{Xl(c.containerInfo)}catch(_e){Rt(o,o.return,_e)}break;case 4:Xn(c,o),xi(o);break;case 13:Xn(c,o),xi(o),S=o.child,S.flags&8192&&(_=S.memoizedState!==null,S.stateNode.isHidden=_,!_||S.alternate!==null&&S.alternate.memoizedState!==null||($v=tt())),x&4&&oS(o);break;case 22:if(ie=m!==null&&m.memoizedState!==null,o.mode&1?(Nr=(ee=Nr)||ie,Xn(c,o),Nr=ee):Xn(c,o),xi(o),x&8192){if(ee=o.memoizedState!==null,(o.stateNode.isHidden=ee)&&!ie&&(o.mode&1)!==0)for(we=o,ie=o.child;ie!==null;){for(le=we=ie;we!==null;){switch(ne=we,ge=ne.child,ne.tag){case 0:case 11:case 14:case 15:yc(4,ne,ne.return);break;case 1:Fs(ne,ne.return);var Ne=ne.stateNode;if(typeof Ne.componentWillUnmount=="function"){x=ne,m=ne.return;try{c=x,Ne.props=c.memoizedProps,Ne.state=c.memoizedState,Ne.componentWillUnmount()}catch(_e){Rt(x,m,_e)}}break;case 5:Fs(ne,ne.return);break;case 22:if(ne.memoizedState!==null){uS(le);continue}}ge!==null?(ge.return=ne,we=ge):uS(le)}ie=ie.sibling}e:for(ie=null,le=o;;){if(le.tag===5){if(ie===null){ie=le;try{S=le.stateNode,ee?(_=S.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none"):(D=le.stateNode,B=le.memoizedProps.style,O=B!=null&&B.hasOwnProperty("display")?B.display:null,D.style.display=Da("display",O))}catch(_e){Rt(o,o.return,_e)}}}else if(le.tag===6){if(ie===null)try{le.stateNode.nodeValue=ee?"":le.memoizedProps}catch(_e){Rt(o,o.return,_e)}}else if((le.tag!==22&&le.tag!==23||le.memoizedState===null||le===o)&&le.child!==null){le.child.return=le,le=le.child;continue}if(le===o)break e;for(;le.sibling===null;){if(le.return===null||le.return===o)break e;ie===le&&(ie=null),le=le.return}ie===le&&(ie=null),le.sibling.return=le.return,le=le.sibling}}break;case 19:Xn(c,o),xi(o),x&4&&oS(o);break;case 21:break;default:Xn(c,o),xi(o)}}function xi(o){var c=o.flags;if(c&2){try{e:{for(var m=o.return;m!==null;){if(nS(m)){var x=m;break e}m=m.return}throw Error(r(160))}switch(x.tag){case 5:var S=x.stateNode;x.flags&32&&(en(S,""),x.flags&=-33);var _=iS(o);Rv(o,_,S);break;case 3:case 4:var O=x.stateNode.containerInfo,D=iS(o);Iv(o,D,O);break;default:throw Error(r(161))}}catch(B){Rt(o,o.return,B)}o.flags&=-3}c&4096&&(o.flags&=-4097)}function KL(o,c,m){we=o,lS(o)}function lS(o,c,m){for(var x=(o.mode&1)!==0;we!==null;){var S=we,_=S.child;if(S.tag===22&&x){var O=S.memoizedState!==null||Fd;if(!O){var D=S.alternate,B=D!==null&&D.memoizedState!==null||Nr;D=Fd;var ee=Nr;if(Fd=O,(Nr=B)&&!ee)for(we=S;we!==null;)O=we,B=O.child,O.tag===22&&O.memoizedState!==null?dS(S):B!==null?(B.return=O,we=B):dS(S);for(;_!==null;)we=_,lS(_),_=_.sibling;we=S,Fd=D,Nr=ee}cS(o)}else(S.subtreeFlags&8772)!==0&&_!==null?(_.return=S,we=_):cS(o)}}function cS(o){for(;we!==null;){var c=we;if((c.flags&8772)!==0){var m=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:Nr||Bd(5,c);break;case 1:var x=c.stateNode;if(c.flags&4&&!Nr)if(m===null)x.componentDidMount();else{var S=c.elementType===c.type?m.memoizedProps:Yn(c.type,m.memoizedProps);x.componentDidUpdate(S,m.memoizedState,x.__reactInternalSnapshotBeforeUpdate)}var _=c.updateQueue;_!==null&&uj(c,_,x);break;case 3:var O=c.updateQueue;if(O!==null){if(m=null,c.child!==null)switch(c.child.tag){case 5:m=c.child.stateNode;break;case 1:m=c.child.stateNode}uj(c,O,m)}break;case 5:var D=c.stateNode;if(m===null&&c.flags&4){m=D;var B=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":B.autoFocus&&m.focus();break;case"img":B.src&&(m.src=B.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var ee=c.alternate;if(ee!==null){var ie=ee.memoizedState;if(ie!==null){var le=ie.dehydrated;le!==null&&Xl(le)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Nr||c.flags&512&&Mv(c)}catch(ne){Rt(c,c.return,ne)}}if(c===o){we=null;break}if(m=c.sibling,m!==null){m.return=c.return,we=m;break}we=c.return}}function uS(o){for(;we!==null;){var c=we;if(c===o){we=null;break}var m=c.sibling;if(m!==null){m.return=c.return,we=m;break}we=c.return}}function dS(o){for(;we!==null;){var c=we;try{switch(c.tag){case 0:case 11:case 15:var m=c.return;try{Bd(4,c)}catch(B){Rt(c,m,B)}break;case 1:var x=c.stateNode;if(typeof x.componentDidMount=="function"){var S=c.return;try{x.componentDidMount()}catch(B){Rt(c,S,B)}}var _=c.return;try{Mv(c)}catch(B){Rt(c,_,B)}break;case 5:var O=c.return;try{Mv(c)}catch(B){Rt(c,O,B)}}}catch(B){Rt(c,c.return,B)}if(c===o){we=null;break}var D=c.sibling;if(D!==null){D.return=c.return,we=D;break}we=c.return}}var qL=Math.ceil,Wd=k.ReactCurrentDispatcher,Dv=k.ReactCurrentOwner,kn=k.ReactCurrentBatchConfig,Ge=0,sr=null,Wt=null,vr=0,sn=0,Bs=Ha(0),Gt=0,xc=null,Ro=0,Ud=0,Lv=0,bc=null,Kr=null,$v=0,Ws=1/0,ra=null,Kd=!1,zv=null,Za=null,qd=!1,Ja=null,Hd=0,wc=0,Fv=null,Vd=-1,Yd=0;function Or(){return(Ge&6)!==0?tt():Vd!==-1?Vd:Vd=tt()}function eo(o){return(o.mode&1)===0?1:(Ge&2)!==0&&vr!==0?vr&-vr:EL.transition!==null?(Yd===0&&(Yd=i1()),Yd):(o=lt,o!==0||(o=window.event,o=o===void 0?16:h1(o.type)),o)}function Qn(o,c,m,x){if(50<wc)throw wc=0,Fv=null,Error(r(185));ql(o,m,x),((Ge&2)===0||o!==sr)&&(o===sr&&((Ge&2)===0&&(Ud|=m),Gt===4&&to(o,vr)),qr(o,x),m===1&&Ge===0&&(c.mode&1)===0&&(Ws=tt()+500,jd&&Ya()))}function qr(o,c){var m=o.callbackNode;ED(o,c);var x=nd(o,o===sr?vr:0);if(x===0)m!==null&&Wl(m),o.callbackNode=null,o.callbackPriority=0;else if(c=x&-x,o.callbackPriority!==c){if(m!=null&&Wl(m),c===1)o.tag===0?_L(hS.bind(null,o)):Z1(hS.bind(null,o)),SL(function(){(Ge&6)===0&&Ya()}),m=null;else{switch(a1(x)){case 1:m=Yi;break;case 4:m=Ju;break;case 16:m=$a;break;case 536870912:m=n1;break;default:m=$a}m=wS(m,fS.bind(null,o))}o.callbackPriority=c,o.callbackNode=m}}function fS(o,c){if(Vd=-1,Yd=0,(Ge&6)!==0)throw Error(r(327));var m=o.callbackNode;if(Us()&&o.callbackNode!==m)return null;var x=nd(o,o===sr?vr:0);if(x===0)return null;if((x&30)!==0||(x&o.expiredLanes)!==0||c)c=Gd(o,x);else{c=x;var S=Ge;Ge|=2;var _=pS();(sr!==o||vr!==c)&&(ra=null,Ws=tt()+500,Lo(o,c));do try{YL();break}catch(D){mS(o,D)}while(!0);iv(),Wd.current=_,Ge=S,Wt!==null?c=0:(sr=null,vr=0,c=Gt)}if(c!==0){if(c===2&&(S=bp(o),S!==0&&(x=S,c=Bv(o,S))),c===1)throw m=xc,Lo(o,0),to(o,x),qr(o,tt()),m;if(c===6)to(o,x);else{if(S=o.current.alternate,(x&30)===0&&!HL(S)&&(c=Gd(o,x),c===2&&(_=bp(o),_!==0&&(x=_,c=Bv(o,_))),c===1))throw m=xc,Lo(o,0),to(o,x),qr(o,tt()),m;switch(o.finishedWork=S,o.finishedLanes=x,c){case 0:case 1:throw Error(r(345));case 2:$o(o,Kr,ra);break;case 3:if(to(o,x),(x&130023424)===x&&(c=$v+500-tt(),10<c)){if(nd(o,0)!==0)break;if(S=o.suspendedLanes,(S&x)!==x){Or(),o.pingedLanes|=o.suspendedLanes&S;break}o.timeoutHandle=Vp($o.bind(null,o,Kr,ra),c);break}$o(o,Kr,ra);break;case 4:if(to(o,x),(x&4194240)===x)break;for(c=o.eventTimes,S=-1;0<x;){var O=31-qn(x);_=1<<O,O=c[O],O>S&&(S=O),x&=~_}if(x=S,x=tt()-x,x=(120>x?120:480>x?480:1080>x?1080:1920>x?1920:3e3>x?3e3:4320>x?4320:1960*qL(x/1960))-x,10<x){o.timeoutHandle=Vp($o.bind(null,o,Kr,ra),x);break}$o(o,Kr,ra);break;case 5:$o(o,Kr,ra);break;default:throw Error(r(329))}}}return qr(o,tt()),o.callbackNode===m?fS.bind(null,o):null}function Bv(o,c){var m=bc;return o.current.memoizedState.isDehydrated&&(Lo(o,c).flags|=256),o=Gd(o,c),o!==2&&(c=Kr,Kr=m,c!==null&&Wv(c)),o}function Wv(o){Kr===null?Kr=o:Kr.push.apply(Kr,o)}function HL(o){for(var c=o;;){if(c.flags&16384){var m=c.updateQueue;if(m!==null&&(m=m.stores,m!==null))for(var x=0;x<m.length;x++){var S=m[x],_=S.getSnapshot;S=S.value;try{if(!Hn(_(),S))return!1}catch{return!1}}}if(m=c.child,c.subtreeFlags&16384&&m!==null)m.return=c,c=m;else{if(c===o)break;for(;c.sibling===null;){if(c.return===null||c.return===o)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function to(o,c){for(c&=~Lv,c&=~Ud,o.suspendedLanes|=c,o.pingedLanes&=~c,o=o.expirationTimes;0<c;){var m=31-qn(c),x=1<<m;o[m]=-1,c&=~x}}function hS(o){if((Ge&6)!==0)throw Error(r(327));Us();var c=nd(o,0);if((c&1)===0)return qr(o,tt()),null;var m=Gd(o,c);if(o.tag!==0&&m===2){var x=bp(o);x!==0&&(c=x,m=Bv(o,x))}if(m===1)throw m=xc,Lo(o,0),to(o,c),qr(o,tt()),m;if(m===6)throw Error(r(345));return o.finishedWork=o.current.alternate,o.finishedLanes=c,$o(o,Kr,ra),qr(o,tt()),null}function Uv(o,c){var m=Ge;Ge|=1;try{return o(c)}finally{Ge=m,Ge===0&&(Ws=tt()+500,jd&&Ya())}}function Do(o){Ja!==null&&Ja.tag===0&&(Ge&6)===0&&Us();var c=Ge;Ge|=1;var m=kn.transition,x=lt;try{if(kn.transition=null,lt=1,o)return o()}finally{lt=x,kn.transition=m,Ge=c,(Ge&6)===0&&Ya()}}function Kv(){sn=Bs.current,yt(Bs)}function Lo(o,c){o.finishedWork=null,o.finishedLanes=0;var m=o.timeoutHandle;if(m!==-1&&(o.timeoutHandle=-1,jL(m)),Wt!==null)for(m=Wt.return;m!==null;){var x=m;switch(Jp(x),x.tag){case 1:x=x.type.childContextTypes,x!=null&&bd();break;case 3:$s(),yt(Br),yt(wr),fv();break;case 5:uv(x);break;case 4:$s();break;case 13:yt(Ct);break;case 19:yt(Ct);break;case 10:av(x.type._context);break;case 22:case 23:Kv()}m=m.return}if(sr=o,Wt=o=ro(o.current,null),vr=sn=c,Gt=0,xc=null,Lv=Ud=Ro=0,Kr=bc=null,To!==null){for(c=0;c<To.length;c++)if(m=To[c],x=m.interleaved,x!==null){m.interleaved=null;var S=x.next,_=m.pending;if(_!==null){var O=_.next;_.next=S,x.next=O}m.pending=x}To=null}return o}function mS(o,c){do{var m=Wt;try{if(iv(),Td.current=Dd,Md){for(var x=Ot.memoizedState;x!==null;){var S=x.queue;S!==null&&(S.pending=null),x=x.next}Md=!1}if(Io=0,or=Yt=Ot=null,hc=!1,mc=0,Dv.current=null,m===null||m.return===null){Gt=1,xc=c,Wt=null;break}e:{var _=o,O=m.return,D=m,B=c;if(c=vr,D.flags|=32768,B!==null&&typeof B=="object"&&typeof B.then=="function"){var ee=B,ie=D,le=ie.tag;if((ie.mode&1)===0&&(le===0||le===11||le===15)){var ne=ie.alternate;ne?(ie.updateQueue=ne.updateQueue,ie.memoizedState=ne.memoizedState,ie.lanes=ne.lanes):(ie.updateQueue=null,ie.memoizedState=null)}var ge=zj(O);if(ge!==null){ge.flags&=-257,Fj(ge,O,D,_,c),ge.mode&1&&$j(_,ee,c),c=ge,B=ee;var Ne=c.updateQueue;if(Ne===null){var _e=new Set;_e.add(B),c.updateQueue=_e}else Ne.add(B);break e}else{if((c&1)===0){$j(_,ee,c),qv();break e}B=Error(r(426))}}else if(St&&D.mode&1){var Ft=zj(O);if(Ft!==null){(Ft.flags&65536)===0&&(Ft.flags|=256),Fj(Ft,O,D,_,c),rv(zs(B,D));break e}}_=B=zs(B,D),Gt!==4&&(Gt=2),bc===null?bc=[_]:bc.push(_),_=O;do{switch(_.tag){case 3:_.flags|=65536,c&=-c,_.lanes|=c;var G=Dj(_,B,c);cj(_,G);break e;case 1:D=B;var q=_.type,Z=_.stateNode;if((_.flags&128)===0&&(typeof q.getDerivedStateFromError=="function"||Z!==null&&typeof Z.componentDidCatch=="function"&&(Za===null||!Za.has(Z)))){_.flags|=65536,c&=-c,_.lanes|=c;var ue=Lj(_,D,c);cj(_,ue);break e}}_=_.return}while(_!==null)}gS(m)}catch(Ce){c=Ce,Wt===m&&m!==null&&(Wt=m=m.return);continue}break}while(!0)}function pS(){var o=Wd.current;return Wd.current=Dd,o===null?Dd:o}function qv(){(Gt===0||Gt===3||Gt===2)&&(Gt=4),sr===null||(Ro&268435455)===0&&(Ud&268435455)===0||to(sr,vr)}function Gd(o,c){var m=Ge;Ge|=2;var x=pS();(sr!==o||vr!==c)&&(ra=null,Lo(o,c));do try{VL();break}catch(S){mS(o,S)}while(!0);if(iv(),Ge=m,Wd.current=x,Wt!==null)throw Error(r(261));return sr=null,vr=0,Gt}function VL(){for(;Wt!==null;)vS(Wt)}function YL(){for(;Wt!==null&&!Zu();)vS(Wt)}function vS(o){var c=bS(o.alternate,o,sn);o.memoizedProps=o.pendingProps,c===null?gS(o):Wt=c,Dv.current=null}function gS(o){var c=o;do{var m=c.alternate;if(o=c.return,(c.flags&32768)===0){if(m=FL(m,c,sn),m!==null){Wt=m;return}}else{if(m=BL(m,c),m!==null){m.flags&=32767,Wt=m;return}if(o!==null)o.flags|=32768,o.subtreeFlags=0,o.deletions=null;else{Gt=6,Wt=null;return}}if(c=c.sibling,c!==null){Wt=c;return}Wt=c=o}while(c!==null);Gt===0&&(Gt=5)}function $o(o,c,m){var x=lt,S=kn.transition;try{kn.transition=null,lt=1,GL(o,c,m,x)}finally{kn.transition=S,lt=x}return null}function GL(o,c,m,x){do Us();while(Ja!==null);if((Ge&6)!==0)throw Error(r(327));m=o.finishedWork;var S=o.finishedLanes;if(m===null)return null;if(o.finishedWork=null,o.finishedLanes=0,m===o.current)throw Error(r(177));o.callbackNode=null,o.callbackPriority=0;var _=m.lanes|m.childLanes;if(CD(o,_),o===sr&&(Wt=sr=null,vr=0),(m.subtreeFlags&2064)===0&&(m.flags&2064)===0||qd||(qd=!0,wS($a,function(){return Us(),null})),_=(m.flags&15990)!==0,(m.subtreeFlags&15990)!==0||_){_=kn.transition,kn.transition=null;var O=lt;lt=1;var D=Ge;Ge|=4,Dv.current=null,UL(o,m),sS(m,o),pL(qp),od=!!Kp,qp=Kp=null,o.current=m,KL(m),et(),Ge=D,lt=O,kn.transition=_}else o.current=m;if(qd&&(qd=!1,Ja=o,Hd=S),_=o.pendingLanes,_===0&&(Za=null),SD(m.stateNode),qr(o,tt()),c!==null)for(x=o.onRecoverableError,m=0;m<c.length;m++)S=c[m],x(S.value,{componentStack:S.stack,digest:S.digest});if(Kd)throw Kd=!1,o=zv,zv=null,o;return(Hd&1)!==0&&o.tag!==0&&Us(),_=o.pendingLanes,(_&1)!==0?o===Fv?wc++:(wc=0,Fv=o):wc=0,Ya(),null}function Us(){if(Ja!==null){var o=a1(Hd),c=kn.transition,m=lt;try{if(kn.transition=null,lt=16>o?16:o,Ja===null)var x=!1;else{if(o=Ja,Ja=null,Hd=0,(Ge&6)!==0)throw Error(r(331));var S=Ge;for(Ge|=4,we=o.current;we!==null;){var _=we,O=_.child;if((we.flags&16)!==0){var D=_.deletions;if(D!==null){for(var B=0;B<D.length;B++){var ee=D[B];for(we=ee;we!==null;){var ie=we;switch(ie.tag){case 0:case 11:case 15:yc(8,ie,_)}var le=ie.child;if(le!==null)le.return=ie,we=le;else for(;we!==null;){ie=we;var ne=ie.sibling,ge=ie.return;if(rS(ie),ie===ee){we=null;break}if(ne!==null){ne.return=ge,we=ne;break}we=ge}}}var Ne=_.alternate;if(Ne!==null){var _e=Ne.child;if(_e!==null){Ne.child=null;do{var Ft=_e.sibling;_e.sibling=null,_e=Ft}while(_e!==null)}}we=_}}if((_.subtreeFlags&2064)!==0&&O!==null)O.return=_,we=O;else e:for(;we!==null;){if(_=we,(_.flags&2048)!==0)switch(_.tag){case 0:case 11:case 15:yc(9,_,_.return)}var G=_.sibling;if(G!==null){G.return=_.return,we=G;break e}we=_.return}}var q=o.current;for(we=q;we!==null;){O=we;var Z=O.child;if((O.subtreeFlags&2064)!==0&&Z!==null)Z.return=O,we=Z;else e:for(O=q;we!==null;){if(D=we,(D.flags&2048)!==0)try{switch(D.tag){case 0:case 11:case 15:Bd(9,D)}}catch(Ce){Rt(D,D.return,Ce)}if(D===O){we=null;break e}var ue=D.sibling;if(ue!==null){ue.return=D.return,we=ue;break e}we=D.return}}if(Ge=S,Ya(),pi&&typeof pi.onPostCommitFiberRoot=="function")try{pi.onPostCommitFiberRoot(ed,o)}catch{}x=!0}return x}finally{lt=m,kn.transition=c}}return!1}function yS(o,c,m){c=zs(m,c),c=Dj(o,c,1),o=Xa(o,c,1),c=Or(),o!==null&&(ql(o,1,c),qr(o,c))}function Rt(o,c,m){if(o.tag===3)yS(o,o,m);else for(;c!==null;){if(c.tag===3){yS(c,o,m);break}else if(c.tag===1){var x=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(Za===null||!Za.has(x))){o=zs(m,o),o=Lj(c,o,1),c=Xa(c,o,1),o=Or(),c!==null&&(ql(c,1,o),qr(c,o));break}}c=c.return}}function XL(o,c,m){var x=o.pingCache;x!==null&&x.delete(c),c=Or(),o.pingedLanes|=o.suspendedLanes&m,sr===o&&(vr&m)===m&&(Gt===4||Gt===3&&(vr&130023424)===vr&&500>tt()-$v?Lo(o,0):Lv|=m),qr(o,c)}function xS(o,c){c===0&&((o.mode&1)===0?c=1:(c=rd,rd<<=1,(rd&130023424)===0&&(rd=4194304)));var m=Or();o=Ji(o,c),o!==null&&(ql(o,c,m),qr(o,m))}function QL(o){var c=o.memoizedState,m=0;c!==null&&(m=c.retryLane),xS(o,m)}function ZL(o,c){var m=0;switch(o.tag){case 13:var x=o.stateNode,S=o.memoizedState;S!==null&&(m=S.retryLane);break;case 19:x=o.stateNode;break;default:throw Error(r(314))}x!==null&&x.delete(c),xS(o,m)}var bS;bS=function(o,c,m){if(o!==null)if(o.memoizedProps!==c.pendingProps||Br.current)Ur=!0;else{if((o.lanes&m)===0&&(c.flags&128)===0)return Ur=!1,zL(o,c,m);Ur=(o.flags&131072)!==0}else Ur=!1,St&&(c.flags&1048576)!==0&&J1(c,Nd,c.index);switch(c.lanes=0,c.tag){case 2:var x=c.type;zd(o,c),o=c.pendingProps;var S=As(c,wr.current);Ls(c,m),S=pv(null,c,x,o,S,m);var _=vv();return c.flags|=1,typeof S=="object"&&S!==null&&typeof S.render=="function"&&S.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Wr(x)?(_=!0,wd(c)):_=!1,c.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,lv(c),S.updater=Ld,c.stateNode=S,S._reactInternals=c,jv(c,x,o,m),c=kv(null,c,x,!0,_,m)):(c.tag=0,St&&_&&Zp(c),Cr(null,c,S,m),c=c.child),c;case 16:x=c.elementType;e:{switch(zd(o,c),o=c.pendingProps,S=x._init,x=S(x._payload),c.type=x,S=c.tag=e$(x),o=Yn(x,o),S){case 0:c=Pv(null,c,x,o,m);break e;case 1:c=Hj(null,c,x,o,m);break e;case 11:c=Bj(null,c,x,o,m);break e;case 14:c=Wj(null,c,x,Yn(x.type,o),m);break e}throw Error(r(306,x,""))}return c;case 0:return x=c.type,S=c.pendingProps,S=c.elementType===x?S:Yn(x,S),Pv(o,c,x,S,m);case 1:return x=c.type,S=c.pendingProps,S=c.elementType===x?S:Yn(x,S),Hj(o,c,x,S,m);case 3:e:{if(Vj(c),o===null)throw Error(r(387));x=c.pendingProps,_=c.memoizedState,S=_.element,lj(o,c),Od(c,x,null,m);var O=c.memoizedState;if(x=O.element,_.isDehydrated)if(_={element:x,isDehydrated:!1,cache:O.cache,pendingSuspenseBoundaries:O.pendingSuspenseBoundaries,transitions:O.transitions},c.updateQueue.baseState=_,c.memoizedState=_,c.flags&256){S=zs(Error(r(423)),c),c=Yj(o,c,x,m,S);break e}else if(x!==S){S=zs(Error(r(424)),c),c=Yj(o,c,x,m,S);break e}else for(on=qa(c.stateNode.containerInfo.firstChild),an=c,St=!0,Vn=null,m=oj(c,null,x,m),c.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(Is(),x===S){c=ta(o,c,m);break e}Cr(o,c,x,m)}c=c.child}return c;case 5:return dj(c),o===null&&tv(c),x=c.type,S=c.pendingProps,_=o!==null?o.memoizedProps:null,O=S.children,Hp(x,S)?O=null:_!==null&&Hp(x,_)&&(c.flags|=32),qj(o,c),Cr(o,c,O,m),c.child;case 6:return o===null&&tv(c),null;case 13:return Gj(o,c,m);case 4:return cv(c,c.stateNode.containerInfo),x=c.pendingProps,o===null?c.child=Rs(c,null,x,m):Cr(o,c,x,m),c.child;case 11:return x=c.type,S=c.pendingProps,S=c.elementType===x?S:Yn(x,S),Bj(o,c,x,S,m);case 7:return Cr(o,c,c.pendingProps,m),c.child;case 8:return Cr(o,c,c.pendingProps.children,m),c.child;case 12:return Cr(o,c,c.pendingProps.children,m),c.child;case 10:e:{if(x=c.type._context,S=c.pendingProps,_=c.memoizedProps,O=S.value,pt(_d,x._currentValue),x._currentValue=O,_!==null)if(Hn(_.value,O)){if(_.children===S.children&&!Br.current){c=ta(o,c,m);break e}}else for(_=c.child,_!==null&&(_.return=c);_!==null;){var D=_.dependencies;if(D!==null){O=_.child;for(var B=D.firstContext;B!==null;){if(B.context===x){if(_.tag===1){B=ea(-1,m&-m),B.tag=2;var ee=_.updateQueue;if(ee!==null){ee=ee.shared;var ie=ee.pending;ie===null?B.next=B:(B.next=ie.next,ie.next=B),ee.pending=B}}_.lanes|=m,B=_.alternate,B!==null&&(B.lanes|=m),ov(_.return,m,c),D.lanes|=m;break}B=B.next}}else if(_.tag===10)O=_.type===c.type?null:_.child;else if(_.tag===18){if(O=_.return,O===null)throw Error(r(341));O.lanes|=m,D=O.alternate,D!==null&&(D.lanes|=m),ov(O,m,c),O=_.sibling}else O=_.child;if(O!==null)O.return=_;else for(O=_;O!==null;){if(O===c){O=null;break}if(_=O.sibling,_!==null){_.return=O.return,O=_;break}O=O.return}_=O}Cr(o,c,S.children,m),c=c.child}return c;case 9:return S=c.type,x=c.pendingProps.children,Ls(c,m),S=Nn(S),x=x(S),c.flags|=1,Cr(o,c,x,m),c.child;case 14:return x=c.type,S=Yn(x,c.pendingProps),S=Yn(x.type,S),Wj(o,c,x,S,m);case 15:return Uj(o,c,c.type,c.pendingProps,m);case 17:return x=c.type,S=c.pendingProps,S=c.elementType===x?S:Yn(x,S),zd(o,c),c.tag=1,Wr(x)?(o=!0,wd(c)):o=!1,Ls(c,m),Ij(c,x,S),jv(c,x,S,m),kv(null,c,x,!0,o,m);case 19:return Qj(o,c,m);case 22:return Kj(o,c,m)}throw Error(r(156,c.tag))};function wS(o,c){return Bl(o,c)}function JL(o,c,m,x){this.tag=o,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _n(o,c,m,x){return new JL(o,c,m,x)}function Hv(o){return o=o.prototype,!(!o||!o.isReactComponent)}function e$(o){if(typeof o=="function")return Hv(o)?1:0;if(o!=null){if(o=o.$$typeof,o===K)return 11;if(o===U)return 14}return 2}function ro(o,c){var m=o.alternate;return m===null?(m=_n(o.tag,c,o.key,o.mode),m.elementType=o.elementType,m.type=o.type,m.stateNode=o.stateNode,m.alternate=o,o.alternate=m):(m.pendingProps=c,m.type=o.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=o.flags&14680064,m.childLanes=o.childLanes,m.lanes=o.lanes,m.child=o.child,m.memoizedProps=o.memoizedProps,m.memoizedState=o.memoizedState,m.updateQueue=o.updateQueue,c=o.dependencies,m.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},m.sibling=o.sibling,m.index=o.index,m.ref=o.ref,m}function Xd(o,c,m,x,S,_){var O=2;if(x=o,typeof o=="function")Hv(o)&&(O=1);else if(typeof o=="string")O=5;else e:switch(o){case A:return zo(m.children,S,_,c);case M:O=8,S|=8;break;case z:return o=_n(12,m,c,S|2),o.elementType=z,o.lanes=_,o;case te:return o=_n(13,m,c,S),o.elementType=te,o.lanes=_,o;case R:return o=_n(19,m,c,S),o.elementType=R,o.lanes=_,o;case X:return Qd(m,S,_,c);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case V:O=10;break e;case L:O=9;break e;case K:O=11;break e;case U:O=14;break e;case F:O=16,x=null;break e}throw Error(r(130,o==null?o:typeof o,""))}return c=_n(O,m,c,S),c.elementType=o,c.type=x,c.lanes=_,c}function zo(o,c,m,x){return o=_n(7,o,x,c),o.lanes=m,o}function Qd(o,c,m,x){return o=_n(22,o,x,c),o.elementType=X,o.lanes=m,o.stateNode={isHidden:!1},o}function Vv(o,c,m){return o=_n(6,o,null,c),o.lanes=m,o}function Yv(o,c,m){return c=_n(4,o.children!==null?o.children:[],o.key,c),c.lanes=m,c.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},c}function t$(o,c,m,x,S){this.tag=c,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=wp(0),this.expirationTimes=wp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wp(0),this.identifierPrefix=x,this.onRecoverableError=S,this.mutableSourceEagerHydrationData=null}function Gv(o,c,m,x,S,_,O,D,B){return o=new t$(o,c,m,D,B),c===1?(c=1,_===!0&&(c|=8)):c=0,_=_n(3,null,null,c),o.current=_,_.stateNode=o,_.memoizedState={element:x,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},lv(_),o}function r$(o,c,m){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:x==null?null:""+x,children:o,containerInfo:c,implementation:m}}function jS(o){if(!o)return Va;o=o._reactInternals;e:{if(Xe(o)!==o||o.tag!==1)throw Error(r(170));var c=o;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(Wr(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(r(171))}if(o.tag===1){var m=o.type;if(Wr(m))return X1(o,m,c)}return c}function SS(o,c,m,x,S,_,O,D,B){return o=Gv(m,x,!0,o,S,_,O,D,B),o.context=jS(null),m=o.current,x=Or(),S=eo(m),_=ea(x,S),_.callback=c??null,Xa(m,_,S),o.current.lanes=S,ql(o,S,x),qr(o,x),o}function Zd(o,c,m,x){var S=c.current,_=Or(),O=eo(S);return m=jS(m),c.context===null?c.context=m:c.pendingContext=m,c=ea(_,O),c.payload={element:o},x=x===void 0?null:x,x!==null&&(c.callback=x),o=Xa(S,c,O),o!==null&&(Qn(o,S,O,_),Cd(o,S,O)),O}function Jd(o){if(o=o.current,!o.child)return null;switch(o.child.tag){case 5:return o.child.stateNode;default:return o.child.stateNode}}function NS(o,c){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var m=o.retryLane;o.retryLane=m!==0&&m<c?m:c}}function Xv(o,c){NS(o,c),(o=o.alternate)&&NS(o,c)}function n$(){return null}var PS=typeof reportError=="function"?reportError:function(o){console.error(o)};function Qv(o){this._internalRoot=o}ef.prototype.render=Qv.prototype.render=function(o){var c=this._internalRoot;if(c===null)throw Error(r(409));Zd(o,c,null,null)},ef.prototype.unmount=Qv.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var c=o.containerInfo;Do(function(){Zd(null,o,null,null)}),c[Gi]=null}};function ef(o){this._internalRoot=o}ef.prototype.unstable_scheduleHydration=function(o){if(o){var c=l1();o={blockedOn:null,target:o,priority:c};for(var m=0;m<Wa.length&&c!==0&&c<Wa[m].priority;m++);Wa.splice(m,0,o),m===0&&d1(o)}};function Zv(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function tf(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11&&(o.nodeType!==8||o.nodeValue!==" react-mount-point-unstable "))}function kS(){}function i$(o,c,m,x,S){if(S){if(typeof x=="function"){var _=x;x=function(){var ee=Jd(O);_.call(ee)}}var O=SS(c,x,o,0,null,!1,!1,"",kS);return o._reactRootContainer=O,o[Gi]=O.current,ac(o.nodeType===8?o.parentNode:o),Do(),O}for(;S=o.lastChild;)o.removeChild(S);if(typeof x=="function"){var D=x;x=function(){var ee=Jd(B);D.call(ee)}}var B=Gv(o,0,!1,null,null,!1,!1,"",kS);return o._reactRootContainer=B,o[Gi]=B.current,ac(o.nodeType===8?o.parentNode:o),Do(function(){Zd(c,B,m,x)}),B}function rf(o,c,m,x,S){var _=m._reactRootContainer;if(_){var O=_;if(typeof S=="function"){var D=S;S=function(){var B=Jd(O);D.call(B)}}Zd(c,O,o,S)}else O=i$(m,c,o,S,x);return Jd(O)}o1=function(o){switch(o.tag){case 3:var c=o.stateNode;if(c.current.memoizedState.isDehydrated){var m=Kl(c.pendingLanes);m!==0&&(jp(c,m|1),qr(c,tt()),(Ge&6)===0&&(Ws=tt()+500,Ya()))}break;case 13:Do(function(){var x=Ji(o,1);if(x!==null){var S=Or();Qn(x,o,1,S)}}),Xv(o,1)}},Sp=function(o){if(o.tag===13){var c=Ji(o,134217728);if(c!==null){var m=Or();Qn(c,o,134217728,m)}Xv(o,134217728)}},s1=function(o){if(o.tag===13){var c=eo(o),m=Ji(o,c);if(m!==null){var x=Or();Qn(m,o,c,x)}Xv(o,c)}},l1=function(){return lt},c1=function(o,c){var m=lt;try{return lt=o,c()}finally{lt=m}},qi=function(o,c,m){switch(c){case"input":if(mt(o,m),c=m.name,m.type==="radio"&&c!=null){for(m=o;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<m.length;c++){var x=m[c];if(x!==o&&x.form===o.form){var S=xd(x);if(!S)throw Error(r(90));re(x),mt(x,S)}}}break;case"textarea":Bi(o,m);break;case"select":c=m.value,c!=null&&st(o,!!m.multiple,c,!1)}},_t=Uv,ar=Do;var a$={usingClientEntryPoint:!1,Events:[lc,Cs,xd,La,_o,Uv]},jc={findFiberByHostInstance:Eo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},o$={bundleType:jc.bundleType,version:jc.version,rendererPackageName:jc.rendererPackageName,rendererConfig:jc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:k.ReactCurrentDispatcher,findHostInstanceByFiber:function(o){return o=zl(o),o===null?null:o.stateNode},findFiberByHostInstance:jc.findFiberByHostInstance||n$,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 nf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nf.isDisabled&&nf.supportsFiber)try{ed=nf.inject(o$),pi=nf}catch{}}return Hr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=a$,Hr.createPortal=function(o,c){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Zv(c))throw Error(r(200));return r$(o,c,null,m)},Hr.createRoot=function(o,c){if(!Zv(o))throw Error(r(299));var m=!1,x="",S=PS;return c!=null&&(c.unstable_strictMode===!0&&(m=!0),c.identifierPrefix!==void 0&&(x=c.identifierPrefix),c.onRecoverableError!==void 0&&(S=c.onRecoverableError)),c=Gv(o,1,!1,null,null,m,!1,x,S),o[Gi]=c.current,ac(o.nodeType===8?o.parentNode:o),new Qv(c)},Hr.findDOMNode=function(o){if(o==null)return null;if(o.nodeType===1)return o;var c=o._reactInternals;if(c===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=zl(c),o=o===null?null:o.stateNode,o},Hr.flushSync=function(o){return Do(o)},Hr.hydrate=function(o,c,m){if(!tf(c))throw Error(r(200));return rf(null,o,c,!0,m)},Hr.hydrateRoot=function(o,c,m){if(!Zv(o))throw Error(r(405));var x=m!=null&&m.hydratedSources||null,S=!1,_="",O=PS;if(m!=null&&(m.unstable_strictMode===!0&&(S=!0),m.identifierPrefix!==void 0&&(_=m.identifierPrefix),m.onRecoverableError!==void 0&&(O=m.onRecoverableError)),c=SS(c,null,o,1,m??null,S,!1,_,O),o[Gi]=c.current,ac(o),x)for(o=0;o<x.length;o++)m=x[o],S=m._getVersion,S=S(m._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[m,S]:c.mutableSourceEagerHydrationData.push(m,S);return new ef(c)},Hr.render=function(o,c,m){if(!tf(c))throw Error(r(200));return rf(null,o,c,!1,m)},Hr.unmountComponentAtNode=function(o){if(!tf(o))throw Error(r(40));return o._reactRootContainer?(Do(function(){rf(null,null,o,!1,function(){o._reactRootContainer=null,o[Gi]=null})}),!0):!1},Hr.unstable_batchedUpdates=Uv,Hr.unstable_renderSubtreeIntoContainer=function(o,c,m,x){if(!tf(m))throw Error(r(200));if(o==null||o._reactInternals===void 0)throw Error(r(38));return rf(o,c,m,!1,x)},Hr.version="18.3.1-next-f1338f8080-20240426",Hr}var IS;function JC(){if(IS)return tg.exports;IS=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),tg.exports=v$(),tg.exports}var RS;function g$(){if(RS)return af;RS=1;var e=JC();return af.createRoot=e.createRoot,af.hydrateRoot=e.hydrateRoot,af}var y$=g$();const x$=li(y$);/**
41
+ * react-router v7.12.0
42
+ *
43
+ * Copyright (c) Remix Software Inc.
44
+ *
45
+ * This source code is licensed under the MIT license found in the
46
+ * LICENSE.md file in the root directory of this source tree.
47
+ *
48
+ * @license MIT
49
+ */var DS="popstate";function b$(e={}){function t(n,i){let{pathname:a,search:s,hash:u}=n.location;return ix("",{pathname:a,search:s,hash:u},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(n,i){return typeof i=="string"?i:Vc(i)}return j$(t,r,null,e)}function At(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ln(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function w$(){return Math.random().toString(36).substring(2,10)}function LS(e,t){return{usr:e.state,key:e.key,idx:t}}function ix(e,t,r=null,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?wl(t):t,state:r,key:t&&t.key||n||w$()}}function Vc({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function wl(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function j$(e,t,r,n={}){let{window:i=document.defaultView,v5Compat:a=!1}=n,s=i.history,u="POP",d=null,f=h();f==null&&(f=0,s.replaceState({...s.state,idx:f},""));function h(){return(s.state||{idx:null}).idx}function p(){u="POP";let w=h(),N=w==null?null:w-f;f=w,d&&d({action:u,location:b.location,delta:N})}function v(w,N){u="PUSH";let P=ix(b.location,w,N);f=h()+1;let E=LS(P,f),k=b.createHref(P);try{s.pushState(E,"",k)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;i.location.assign(k)}a&&d&&d({action:u,location:b.location,delta:1})}function g(w,N){u="REPLACE";let P=ix(b.location,w,N);f=h();let E=LS(P,f),k=b.createHref(P);s.replaceState(E,"",k),a&&d&&d({action:u,location:b.location,delta:0})}function j(w){return S$(w)}let b={get action(){return u},get location(){return e(i,s)},listen(w){if(d)throw new Error("A history only accepts one active listener");return i.addEventListener(DS,p),d=w,()=>{i.removeEventListener(DS,p),d=null}},createHref(w){return t(i,w)},createURL:j,encodeLocation(w){let N=j(w);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:v,replace:g,go(w){return s.go(w)}};return b}function S$(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),At(r,"No window.location.(origin|href) available to create URL");let n=typeof e=="string"?e:Vc(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}function eO(e,t,r="/"){return N$(e,t,r,!1)}function N$(e,t,r,n){let i=typeof t=="string"?wl(t):t,a=ga(i.pathname||"/",r);if(a==null)return null;let s=tO(e);P$(s);let u=null;for(let d=0;u==null&&d<s.length;++d){let f=D$(a);u=I$(s[d],f,n)}return u}function tO(e,t=[],r=[],n="",i=!1){let a=(s,u,d=i,f)=>{let h={relativePath:f===void 0?s.path||"":f,caseSensitive:s.caseSensitive===!0,childrenIndex:u,route:s};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(n)&&d)return;At(h.relativePath.startsWith(n),`Absolute route path "${h.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(n.length)}let p=ha([n,h.relativePath]),v=r.concat(h);s.children&&s.children.length>0&&(At(s.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),tO(s.children,t,v,p,d)),!(s.path==null&&!s.index)&&t.push({path:p,score:T$(p,s.index),routesMeta:v})};return e.forEach((s,u)=>{var d;if(s.path===""||!((d=s.path)!=null&&d.includes("?")))a(s,u);else for(let f of rO(s.path))a(s,u,!0,f)}),t}function rO(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return i?[a,""]:[a];let s=rO(n.join("/")),u=[];return u.push(...s.map(d=>d===""?a:[a,d].join("/"))),i&&u.push(...s),u.map(d=>e.startsWith("/")&&d===""?"/":d)}function P$(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:M$(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var k$=/^:[\w-]+$/,_$=3,E$=2,C$=1,O$=10,A$=-2,$S=e=>e==="*";function T$(e,t){let r=e.split("/"),n=r.length;return r.some($S)&&(n+=A$),t&&(n+=E$),r.filter(i=>!$S(i)).reduce((i,a)=>i+(k$.test(a)?_$:a===""?C$:O$),n)}function M$(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function I$(e,t,r=!1){let{routesMeta:n}=e,i={},a="/",s=[];for(let u=0;u<n.length;++u){let d=n[u],f=u===n.length-1,h=a==="/"?t:t.slice(a.length)||"/",p=Zf({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},h),v=d.route;if(!p&&f&&r&&!n[n.length-1].route.index&&(p=Zf({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},h)),!p)return null;Object.assign(i,p.params),s.push({params:i,pathname:ha([a,p.pathname]),pathnameBase:F$(ha([a,p.pathnameBase])),route:v}),p.pathnameBase!=="/"&&(a=ha([a,p.pathnameBase]))}return s}function Zf(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=R$(e.path,e.caseSensitive,e.end),i=t.match(r);if(!i)return null;let a=i[0],s=a.replace(/(.)\/+$/,"$1"),u=i.slice(1);return{params:n.reduce((f,{paramName:h,isOptional:p},v)=>{if(h==="*"){let j=u[v]||"";s=a.slice(0,a.length-j.length).replace(/(.)\/+$/,"$1")}const g=u[v];return p&&!g?f[h]=void 0:f[h]=(g||"").replace(/%2F/g,"/"),f},{}),pathname:a,pathnameBase:s,pattern:e}}function R$(e,t=!1,r=!0){Ln(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=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,u,d)=>(n.push({paramName:u,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function D$(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ln(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ga(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)||"/"}var nO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,L$=e=>nO.test(e);function $$(e,t="/"){let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?wl(e):e,a;if(r)if(L$(r))a=r;else{if(r.includes("//")){let s=r;r=r.replace(/\/\/+/g,"/"),Ln(!1,`Pathnames cannot have embedded double slashes - normalizing ${s} -> ${r}`)}r.startsWith("/")?a=zS(r.substring(1),"/"):a=zS(r,t)}else a=t;return{pathname:a,search:B$(n),hash:W$(i)}}function zS(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function ig(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 z$(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function iO(e){let t=z$(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function aO(e,t,r,n=!1){let i;typeof e=="string"?i=wl(e):(i={...e},At(!i.pathname||!i.pathname.includes("?"),ig("?","pathname","search",i)),At(!i.pathname||!i.pathname.includes("#"),ig("#","pathname","hash",i)),At(!i.search||!i.search.includes("#"),ig("#","search","hash",i)));let a=e===""||i.pathname==="",s=a?"/":i.pathname,u;if(s==null)u=r;else{let p=t.length-1;if(!n&&s.startsWith("..")){let v=s.split("/");for(;v[0]==="..";)v.shift(),p-=1;i.pathname=v.join("/")}u=p>=0?t[p]:"/"}let d=$$(i,u),f=s&&s!=="/"&&s.endsWith("/"),h=(a||s===".")&&r.endsWith("/");return!d.pathname.endsWith("/")&&(f||h)&&(d.pathname+="/"),d}var ha=e=>e.join("/").replace(/\/\/+/g,"/"),F$=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),B$=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,W$=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,U$=class{constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function K$(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function q$(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var oO=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function sO(e,t){let r=e;if(typeof r!="string"||!nO.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,i=!1;if(oO)try{let a=new URL(window.location.href),s=r.startsWith("//")?new URL(a.protocol+r):new URL(r),u=ga(s.pathname,t);s.origin===a.origin&&u!=null?r=u+s.search+s.hash:i=!0}catch{Ln(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:i,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var lO=["POST","PUT","PATCH","DELETE"];new Set(lO);var H$=["GET",...lO];new Set(H$);var jl=y.createContext(null);jl.displayName="DataRouter";var um=y.createContext(null);um.displayName="DataRouterState";var V$=y.createContext(!1),cO=y.createContext({isTransitioning:!1});cO.displayName="ViewTransition";var Y$=y.createContext(new Map);Y$.displayName="Fetchers";var G$=y.createContext(null);G$.displayName="Await";var Bn=y.createContext(null);Bn.displayName="Navigation";var vu=y.createContext(null);vu.displayName="Location";var _a=y.createContext({outlet:null,matches:[],isDataRoute:!1});_a.displayName="Route";var E0=y.createContext(null);E0.displayName="RouteError";var uO="REACT_ROUTER_ERROR",X$="REDIRECT",Q$="ROUTE_ERROR_RESPONSE";function Z$(e){if(e.startsWith(`${uO}:${X$}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function J$(e){if(e.startsWith(`${uO}:${Q$}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new U$(t.status,t.statusText,t.data)}catch{}}function e3(e,{relative:t}={}){At(gu(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=y.useContext(Bn),{hash:i,pathname:a,search:s}=yu(e,{relative:t}),u=a;return r!=="/"&&(u=a==="/"?r:ha([r,a])),n.createHref({pathname:u,search:s,hash:i})}function gu(){return y.useContext(vu)!=null}function Ea(){return At(gu(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(vu).location}var dO="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function fO(e){y.useContext(Bn).static||y.useLayoutEffect(e)}function hO(){let{isDataRoute:e}=y.useContext(_a);return e?h3():t3()}function t3(){At(gu(),"useNavigate() may be used only in the context of a <Router> component.");let e=y.useContext(jl),{basename:t,navigator:r}=y.useContext(Bn),{matches:n}=y.useContext(_a),{pathname:i}=Ea(),a=JSON.stringify(iO(n)),s=y.useRef(!1);return fO(()=>{s.current=!0}),y.useCallback((d,f={})=>{if(Ln(s.current,dO),!s.current)return;if(typeof d=="number"){r.go(d);return}let h=aO(d,JSON.parse(a),i,f.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:ha([t,h.pathname])),(f.replace?r.replace:r.push)(h,f.state,f)},[t,r,a,i,e])}y.createContext(null);function yu(e,{relative:t}={}){let{matches:r}=y.useContext(_a),{pathname:n}=Ea(),i=JSON.stringify(iO(r));return y.useMemo(()=>aO(e,JSON.parse(i),n,t==="path"),[e,i,n,t])}function r3(e,t){return mO(e,t)}function mO(e,t,r,n,i){var P;At(gu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=y.useContext(Bn),{matches:s}=y.useContext(_a),u=s[s.length-1],d=u?u.params:{},f=u?u.pathname:"/",h=u?u.pathnameBase:"/",p=u&&u.route;{let E=p&&p.path||"";vO(f,!p||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
50
+
51
+ Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let v=Ea(),g;if(t){let E=typeof t=="string"?wl(t):t;At(h==="/"||((P=E.pathname)==null?void 0:P.startsWith(h)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${E.pathname}" was given in the \`location\` prop.`),g=E}else g=v;let j=g.pathname||"/",b=j;if(h!=="/"){let E=h.replace(/^\//,"").split("/");b="/"+j.replace(/^\//,"").split("/").slice(E.length).join("/")}let w=eO(e,{pathname:b});Ln(p||w!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Ln(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let N=s3(w&&w.map(E=>Object.assign({},E,{params:Object.assign({},d,E.params),pathname:ha([h,a.encodeLocation?a.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?h:ha([h,a.encodeLocation?a.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),s,r,n,i);return t&&N?y.createElement(vu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...g},navigationType:"POP"}},N):N}function n3(){let e=f3(),t=K$(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:n},a={padding:"2px 4px",backgroundColor:n},s=null;return console.error("Error handled by React Router default ErrorBoundary:",e),s=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:a},"ErrorBoundary")," or"," ",y.createElement("code",{style:a},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),r?y.createElement("pre",{style:i},r):null,s)}var i3=y.createElement(n3,null),pO=class extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=J$(e.digest);r&&(e=r)}let t=e!==void 0?y.createElement(_a.Provider,{value:this.props.routeContext},y.createElement(E0.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?y.createElement(a3,{error:e},t):t}};pO.contextType=V$;var ag=new WeakMap;function a3({children:e,error:t}){let{basename:r}=y.useContext(Bn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let n=Z$(t.digest);if(n){let i=ag.get(t);if(i)throw i;let a=sO(n.location,r);if(oO&&!ag.get(t))if(a.isExternal||n.reloadDocument)window.location.href=a.absoluteURL||a.to;else{const s=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:n.replace}));throw ag.set(t,s),s}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${a.absoluteURL||a.to}`})}}return e}function o3({routeContext:e,match:t,children:r}){let n=y.useContext(jl);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(_a.Provider,{value:e},r)}function s3(e,t=[],r=null,n=null,i=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let a=e,s=r==null?void 0:r.errors;if(s!=null){let h=a.findIndex(p=>p.route.id&&(s==null?void 0:s[p.route.id])!==void 0);At(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),a=a.slice(0,Math.min(a.length,h+1))}let u=!1,d=-1;if(r)for(let h=0;h<a.length;h++){let p=a[h];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(d=h),p.route.id){let{loaderData:v,errors:g}=r,j=p.route.loader&&!v.hasOwnProperty(p.route.id)&&(!g||g[p.route.id]===void 0);if(p.route.lazy||j){u=!0,d>=0?a=a.slice(0,d+1):a=[a[0]];break}}}let f=r&&n?(h,p)=>{var v,g;n(h,{location:r.location,params:((g=(v=r.matches)==null?void 0:v[0])==null?void 0:g.params)??{},unstable_pattern:q$(r.matches),errorInfo:p})}:void 0;return a.reduceRight((h,p,v)=>{let g,j=!1,b=null,w=null;r&&(g=s&&p.route.id?s[p.route.id]:void 0,b=p.route.errorElement||i3,u&&(d<0&&v===0?(vO("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),j=!0,w=null):d===v&&(j=!0,w=p.route.hydrateFallbackElement||null)));let N=t.concat(a.slice(0,v+1)),P=()=>{let E;return g?E=b:j?E=w:p.route.Component?E=y.createElement(p.route.Component,null):p.route.element?E=p.route.element:E=h,y.createElement(o3,{match:p,routeContext:{outlet:h,matches:N,isDataRoute:r!=null},children:E})};return r&&(p.route.ErrorBoundary||p.route.errorElement||v===0)?y.createElement(pO,{location:r.location,revalidation:r.revalidation,component:b,error:g,children:P(),routeContext:{outlet:null,matches:N,isDataRoute:!0},onError:f}):P()},null)}function C0(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function l3(e){let t=y.useContext(jl);return At(t,C0(e)),t}function c3(e){let t=y.useContext(um);return At(t,C0(e)),t}function u3(e){let t=y.useContext(_a);return At(t,C0(e)),t}function O0(e){let t=u3(e),r=t.matches[t.matches.length-1];return At(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function d3(){return O0("useRouteId")}function f3(){var n;let e=y.useContext(E0),t=c3("useRouteError"),r=O0("useRouteError");return e!==void 0?e:(n=t.errors)==null?void 0:n[r]}function h3(){let{router:e}=l3("useNavigate"),t=O0("useNavigate"),r=y.useRef(!1);return fO(()=>{r.current=!0}),y.useCallback(async(i,a={})=>{Ln(r.current,dO),r.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...a}))},[e,t])}var FS={};function vO(e,t,r){!t&&!FS[e]&&(FS[e]=!0,Ln(!1,r))}y.memo(m3);function m3({routes:e,future:t,state:r,onError:n}){return mO(e,void 0,r,n,t)}function Yr(e){At(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function p3({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:i,static:a=!1,unstable_useTransitions:s}){At(!gu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),d=y.useMemo(()=>({basename:u,navigator:i,static:a,unstable_useTransitions:s,future:{}}),[u,i,a,s]);typeof r=="string"&&(r=wl(r));let{pathname:f="/",search:h="",hash:p="",state:v=null,key:g="default"}=r,j=y.useMemo(()=>{let b=ga(f,u);return b==null?null:{location:{pathname:b,search:h,hash:p,state:v,key:g},navigationType:n}},[u,f,h,p,v,g,n]);return Ln(j!=null,`<Router basename="${u}"> is not able to match the URL "${f}${h}${p}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:y.createElement(Bn.Provider,{value:d},y.createElement(vu.Provider,{children:t,value:j}))}function v3({children:e,location:t}){return r3(ax(e),t)}function ax(e,t=[]){let r=[];return y.Children.forEach(e,(n,i)=>{if(!y.isValidElement(n))return;let a=[...t,i];if(n.type===y.Fragment){r.push.apply(r,ax(n.props.children,a));return}At(n.type===Yr,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),At(!n.props.index||!n.props.children,"An index route cannot have child routes.");let s={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||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=ax(n.props.children,a)),r.push(s)}),r}var zf="get",Ff="application/x-www-form-urlencoded";function dm(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function g3(e){return dm(e)&&e.tagName.toLowerCase()==="button"}function y3(e){return dm(e)&&e.tagName.toLowerCase()==="form"}function x3(e){return dm(e)&&e.tagName.toLowerCase()==="input"}function b3(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function w3(e,t){return e.button===0&&(!t||t==="_self")&&!b3(e)}function ox(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(i=>[r,i]):[[r,n]])},[]))}function j3(e,t){let r=ox(e);return t&&t.forEach((n,i)=>{r.has(i)||t.getAll(i).forEach(a=>{r.append(i,a)})}),r}var of=null;function S3(){if(of===null)try{new FormData(document.createElement("form"),0),of=!1}catch{of=!0}return of}var N3=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function og(e){return e!=null&&!N3.has(e)?(Ln(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ff}"`),null):e}function P3(e,t){let r,n,i,a,s;if(y3(e)){let u=e.getAttribute("action");n=u?ga(u,t):null,r=e.getAttribute("method")||zf,i=og(e.getAttribute("enctype"))||Ff,a=new FormData(e)}else if(g3(e)||x3(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=e.getAttribute("formaction")||u.getAttribute("action");if(n=d?ga(d,t):null,r=e.getAttribute("formmethod")||u.getAttribute("method")||zf,i=og(e.getAttribute("formenctype"))||og(u.getAttribute("enctype"))||Ff,a=new FormData(u,e),!S3()){let{name:f,type:h,value:p}=e;if(h==="image"){let v=f?`${f}.`:"";a.append(`${v}x`,"0"),a.append(`${v}y`,"0")}else f&&a.append(f,p)}}else{if(dm(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=zf,n=null,i=Ff,s=e}return a&&i==="text/plain"&&(s=a,a=void 0),{action:n,method:r.toLowerCase(),encType:i,formData:a,body:s}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function A0(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function k3(e,t,r,n){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${n}`:i.pathname=`${i.pathname}.${n}`:i.pathname==="/"?i.pathname=`_root.${n}`:t&&ga(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${n}`,i}async function _3(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function E3(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function C3(e,t,r){let n=await Promise.all(e.map(async i=>{let a=t.routes[i.route.id];if(a){let s=await _3(a,r);return s.links?s.links():[]}return[]}));return M3(n.flat(1).filter(E3).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function BS(e,t,r,n,i,a){let s=(d,f)=>r[f]?d.route.id!==r[f].route.id:!0,u=(d,f)=>{var h;return r[f].pathname!==d.pathname||((h=r[f].route.path)==null?void 0:h.endsWith("*"))&&r[f].params["*"]!==d.params["*"]};return a==="assets"?t.filter((d,f)=>s(d,f)||u(d,f)):a==="data"?t.filter((d,f)=>{var p;let h=n.routes[d.route.id];if(!h||!h.hasLoader)return!1;if(s(d,f)||u(d,f))return!0;if(d.route.shouldRevalidate){let v=d.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((p=r[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function O3(e,t,{includeHydrateFallback:r}={}){return A3(e.map(n=>{let i=t.routes[n.route.id];if(!i)return[];let a=[i.module];return i.clientActionModule&&(a=a.concat(i.clientActionModule)),i.clientLoaderModule&&(a=a.concat(i.clientLoaderModule)),r&&i.hydrateFallbackModule&&(a=a.concat(i.hydrateFallbackModule)),i.imports&&(a=a.concat(i.imports)),a}).flat(1))}function A3(e){return[...new Set(e)]}function T3(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}function M3(e,t){let r=new Set;return new Set(t),e.reduce((n,i)=>{let a=JSON.stringify(T3(i));return r.has(a)||(r.add(a),n.push({key:a,link:i})),n},[])}function gO(){let e=y.useContext(jl);return A0(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function I3(){let e=y.useContext(um);return A0(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var T0=y.createContext(void 0);T0.displayName="FrameworkContext";function yO(){let e=y.useContext(T0);return A0(e,"You must render this element inside a <HydratedRouter> element"),e}function R3(e,t){let r=y.useContext(T0),[n,i]=y.useState(!1),[a,s]=y.useState(!1),{onFocus:u,onBlur:d,onMouseEnter:f,onMouseLeave:h,onTouchStart:p}=t,v=y.useRef(null);y.useEffect(()=>{if(e==="render"&&s(!0),e==="viewport"){let b=N=>{N.forEach(P=>{s(P.isIntersecting)})},w=new IntersectionObserver(b,{threshold:.5});return v.current&&w.observe(v.current),()=>{w.disconnect()}}},[e]),y.useEffect(()=>{if(n){let b=setTimeout(()=>{s(!0)},100);return()=>{clearTimeout(b)}}},[n]);let g=()=>{i(!0)},j=()=>{i(!1),s(!1)};return r?e!=="intent"?[a,v,{}]:[a,v,{onFocus:Nc(u,g),onBlur:Nc(d,j),onMouseEnter:Nc(f,g),onMouseLeave:Nc(h,j),onTouchStart:Nc(p,g)}]:[!1,v,{}]}function Nc(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function D3({page:e,...t}){let{router:r}=gO(),n=y.useMemo(()=>eO(r.routes,e,r.basename),[r.routes,e,r.basename]);return n?y.createElement($3,{page:e,matches:n,...t}):null}function L3(e){let{manifest:t,routeModules:r}=yO(),[n,i]=y.useState([]);return y.useEffect(()=>{let a=!1;return C3(e,t,r).then(s=>{a||i(s)}),()=>{a=!0}},[e,t,r]),n}function $3({page:e,matches:t,...r}){let n=Ea(),{future:i,manifest:a,routeModules:s}=yO(),{basename:u}=gO(),{loaderData:d,matches:f}=I3(),h=y.useMemo(()=>BS(e,t,f,a,n,"data"),[e,t,f,a,n]),p=y.useMemo(()=>BS(e,t,f,a,n,"assets"),[e,t,f,a,n]),v=y.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let b=new Set,w=!1;if(t.forEach(P=>{var k;let E=a.routes[P.route.id];!E||!E.hasLoader||(!h.some(C=>C.route.id===P.route.id)&&P.route.id in d&&((k=s[P.route.id])!=null&&k.shouldRevalidate)||E.hasClientLoader?w=!0:b.add(P.route.id))}),b.size===0)return[];let N=k3(e,u,i.unstable_trailingSlashAwareDataRequests,"data");return w&&b.size>0&&N.searchParams.set("_routes",t.filter(P=>b.has(P.route.id)).map(P=>P.route.id).join(",")),[N.pathname+N.search]},[u,i.unstable_trailingSlashAwareDataRequests,d,n,a,h,t,e,s]),g=y.useMemo(()=>O3(p,a),[p,a]),j=L3(p);return y.createElement(y.Fragment,null,v.map(b=>y.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...r})),g.map(b=>y.createElement("link",{key:b,rel:"modulepreload",href:b,...r})),j.map(({key:b,link:w})=>y.createElement("link",{key:b,nonce:r.nonce,...w})))}function z3(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var F3=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{F3&&(window.__reactRouterVersion="7.12.0")}catch{}function B3({basename:e,children:t,unstable_useTransitions:r,window:n}){let i=y.useRef();i.current==null&&(i.current=b$({window:n,v5Compat:!0}));let a=i.current,[s,u]=y.useState({action:a.action,location:a.location}),d=y.useCallback(f=>{r===!1?u(f):y.startTransition(()=>u(f))},[r]);return y.useLayoutEffect(()=>a.listen(d),[a,d]),y.createElement(p3,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:a,unstable_useTransitions:r})}var xO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ll=y.forwardRef(function({onClick:t,discover:r="render",prefetch:n="none",relative:i,reloadDocument:a,replace:s,state:u,target:d,to:f,preventScrollReset:h,viewTransition:p,unstable_defaultShouldRevalidate:v,...g},j){let{basename:b,unstable_useTransitions:w}=y.useContext(Bn),N=typeof f=="string"&&xO.test(f),P=sO(f,b);f=P.to;let E=e3(f,{relative:i}),[k,C,T]=R3(n,g),A=q3(f,{replace:s,state:u,target:d,preventScrollReset:h,relative:i,viewTransition:p,unstable_defaultShouldRevalidate:v,unstable_useTransitions:w});function M(V){t&&t(V),V.defaultPrevented||A(V)}let z=y.createElement("a",{...g,...T,href:P.absoluteURL||E,onClick:P.isExternal||a?t:M,ref:z3(j,C),target:d,"data-discover":!N&&r==="render"?"true":void 0});return k&&!N?y.createElement(y.Fragment,null,z,y.createElement(D3,{page:E})):z});ll.displayName="Link";var W3=y.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:i=!1,style:a,to:s,viewTransition:u,children:d,...f},h){let p=yu(s,{relative:f.relative}),v=Ea(),g=y.useContext(um),{navigator:j,basename:b}=y.useContext(Bn),w=g!=null&&X3(p)&&u===!0,N=j.encodeLocation?j.encodeLocation(p).pathname:p.pathname,P=v.pathname,E=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;r||(P=P.toLowerCase(),E=E?E.toLowerCase():null,N=N.toLowerCase()),E&&b&&(E=ga(E,b)||E);const k=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let C=P===N||!i&&P.startsWith(N)&&P.charAt(k)==="/",T=E!=null&&(E===N||!i&&E.startsWith(N)&&E.charAt(N.length)==="/"),A={isActive:C,isPending:T,isTransitioning:w},M=C?t:void 0,z;typeof n=="function"?z=n(A):z=[n,C?"active":null,T?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let V=typeof a=="function"?a(A):a;return y.createElement(ll,{...f,"aria-current":M,className:z,ref:h,style:V,to:s,viewTransition:u},typeof d=="function"?d(A):d)});W3.displayName="NavLink";var U3=y.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:i,state:a,method:s=zf,action:u,onSubmit:d,relative:f,preventScrollReset:h,viewTransition:p,unstable_defaultShouldRevalidate:v,...g},j)=>{let{unstable_useTransitions:b}=y.useContext(Bn),w=Y3(),N=G3(u,{relative:f}),P=s.toLowerCase()==="get"?"get":"post",E=typeof u=="string"&&xO.test(u),k=C=>{if(d&&d(C),C.defaultPrevented)return;C.preventDefault();let T=C.nativeEvent.submitter,A=(T==null?void 0:T.getAttribute("formmethod"))||s,M=()=>w(T||C.currentTarget,{fetcherKey:t,method:A,navigate:r,replace:i,state:a,relative:f,preventScrollReset:h,viewTransition:p,unstable_defaultShouldRevalidate:v});b&&r!==!1?y.startTransition(()=>M()):M()};return y.createElement("form",{ref:j,method:P,action:N,onSubmit:n?d:k,...g,"data-discover":!E&&e==="render"?"true":void 0})});U3.displayName="Form";function K3(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function bO(e){let t=y.useContext(jl);return At(t,K3(e)),t}function q3(e,{target:t,replace:r,state:n,preventScrollReset:i,relative:a,viewTransition:s,unstable_defaultShouldRevalidate:u,unstable_useTransitions:d}={}){let f=hO(),h=Ea(),p=yu(e,{relative:a});return y.useCallback(v=>{if(w3(v,t)){v.preventDefault();let g=r!==void 0?r:Vc(h)===Vc(p),j=()=>f(e,{replace:g,state:n,preventScrollReset:i,relative:a,viewTransition:s,unstable_defaultShouldRevalidate:u});d?y.startTransition(()=>j()):j()}},[h,f,p,r,n,t,e,i,a,s,u,d])}function M0(e){Ln(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=y.useRef(ox(e)),r=y.useRef(!1),n=Ea(),i=y.useMemo(()=>j3(n.search,r.current?null:t.current),[n.search]),a=hO(),s=y.useCallback((u,d)=>{const f=ox(typeof u=="function"?u(new URLSearchParams(i)):u);r.current=!0,a("?"+f,d)},[a,i]);return[i,s]}var H3=0,V3=()=>`__${String(++H3)}__`;function Y3(){let{router:e}=bO("useSubmit"),{basename:t}=y.useContext(Bn),r=d3(),n=e.fetch,i=e.navigate;return y.useCallback(async(a,s={})=>{let{action:u,method:d,encType:f,formData:h,body:p}=P3(a,t);if(s.navigate===!1){let v=s.fetcherKey||V3();await n(v,r,s.action||u,{unstable_defaultShouldRevalidate:s.unstable_defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:h,body:p,formMethod:s.method||d,formEncType:s.encType||f,flushSync:s.flushSync})}else await i(s.action||u,{unstable_defaultShouldRevalidate:s.unstable_defaultShouldRevalidate,preventScrollReset:s.preventScrollReset,formData:h,body:p,formMethod:s.method||d,formEncType:s.encType||f,replace:s.replace,state:s.state,fromRouteId:r,flushSync:s.flushSync,viewTransition:s.viewTransition})},[n,i,t,r])}function G3(e,{relative:t}={}){let{basename:r}=y.useContext(Bn),n=y.useContext(_a);At(n,"useFormAction must be used inside a RouteContext");let[i]=n.matches.slice(-1),a={...yu(e||".",{relative:t})},s=Ea();if(e==null){a.search=s.search;let u=new URLSearchParams(a.search),d=u.getAll("index");if(d.some(h=>h==="")){u.delete("index"),d.filter(p=>p).forEach(p=>u.append("index",p));let h=u.toString();a.search=h?`?${h}`:""}}return(!e||e===".")&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(a.pathname=a.pathname==="/"?r:ha([r,a.pathname])),Vc(a)}function X3(e,{relative:t}={}){let r=y.useContext(cO);At(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=bO("useViewTransitionState"),i=yu(e,{relative:t});if(!r.isTransitioning)return!1;let a=ga(r.currentLocation.pathname,n)||r.currentLocation.pathname,s=ga(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Zf(i.pathname,s)!=null||Zf(i.pathname,a)!=null}var I0=JC();const cl=Math.min,Zo=Math.max,Jf=Math.round,sf=Math.floor,Ni=e=>({x:e,y:e}),Q3={left:"right",right:"left",bottom:"top",top:"bottom"},Z3={start:"end",end:"start"};function sx(e,t,r){return Zo(e,cl(t,r))}function xu(e,t){return typeof e=="function"?e(t):e}function as(e){return e.split("-")[0]}function bu(e){return e.split("-")[1]}function wO(e){return e==="x"?"y":"x"}function R0(e){return e==="y"?"height":"width"}const J3=new Set(["top","bottom"]);function uo(e){return J3.has(as(e))?"y":"x"}function D0(e){return wO(uo(e))}function e4(e,t,r){r===void 0&&(r=!1);const n=bu(e),i=D0(e),a=R0(i);let s=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(s=eh(s)),[s,eh(s)]}function t4(e){const t=eh(e);return[lx(e),t,lx(t)]}function lx(e){return e.replace(/start|end/g,t=>Z3[t])}const WS=["left","right"],US=["right","left"],r4=["top","bottom"],n4=["bottom","top"];function i4(e,t,r){switch(e){case"top":case"bottom":return r?t?US:WS:t?WS:US;case"left":case"right":return t?r4:n4;default:return[]}}function a4(e,t,r,n){const i=bu(e);let a=i4(as(e),r==="start",n);return i&&(a=a.map(s=>s+"-"+i),t&&(a=a.concat(a.map(lx)))),a}function eh(e){return e.replace(/left|right|bottom|top/g,t=>Q3[t])}function o4(e){return{top:0,right:0,bottom:0,left:0,...e}}function jO(e){return typeof e!="number"?o4(e):{top:e,right:e,bottom:e,left:e}}function th(e){const{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function KS(e,t,r){let{reference:n,floating:i}=e;const a=uo(t),s=D0(t),u=R0(s),d=as(t),f=a==="y",h=n.x+n.width/2-i.width/2,p=n.y+n.height/2-i.height/2,v=n[u]/2-i[u]/2;let g;switch(d){case"top":g={x:h,y:n.y-i.height};break;case"bottom":g={x:h,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:p};break;case"left":g={x:n.x-i.width,y:p};break;default:g={x:n.x,y:n.y}}switch(bu(t)){case"start":g[s]-=v*(r&&f?-1:1);break;case"end":g[s]+=v*(r&&f?-1:1);break}return g}const s4=async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:a=[],platform:s}=r,u=a.filter(Boolean),d=await(s.isRTL==null?void 0:s.isRTL(t));let f=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:h,y:p}=KS(f,n,d),v=n,g={},j=0;for(let b=0;b<u.length;b++){const{name:w,fn:N}=u[b],{x:P,y:E,data:k,reset:C}=await N({x:h,y:p,initialPlacement:n,placement:v,strategy:i,middlewareData:g,rects:f,platform:s,elements:{reference:e,floating:t}});h=P??h,p=E??p,g={...g,[w]:{...g[w],...k}},C&&j<=50&&(j++,typeof C=="object"&&(C.placement&&(v=C.placement),C.rects&&(f=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:h,y:p}=KS(f,v,d)),b=-1)}return{x:h,y:p,placement:v,strategy:i,middlewareData:g}};async function SO(e,t){var r;t===void 0&&(t={});const{x:n,y:i,platform:a,rects:s,elements:u,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:v=!1,padding:g=0}=xu(t,e),j=jO(g),w=u[v?p==="floating"?"reference":"floating":p],N=th(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(w)))==null||r?w:w.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(u.floating)),boundary:f,rootBoundary:h,strategy:d})),P=p==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u.floating)),k=await(a.isElement==null?void 0:a.isElement(E))?await(a.getScale==null?void 0:a.getScale(E))||{x:1,y:1}:{x:1,y:1},C=th(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:P,offsetParent:E,strategy:d}):P);return{top:(N.top-C.top+j.top)/k.y,bottom:(C.bottom-N.bottom+j.bottom)/k.y,left:(N.left-C.left+j.left)/k.x,right:(C.right-N.right+j.right)/k.x}}const l4=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:i,rects:a,platform:s,elements:u,middlewareData:d}=t,{element:f,padding:h=0}=xu(e,t)||{};if(f==null)return{};const p=jO(h),v={x:r,y:n},g=D0(i),j=R0(g),b=await s.getDimensions(f),w=g==="y",N=w?"top":"left",P=w?"bottom":"right",E=w?"clientHeight":"clientWidth",k=a.reference[j]+a.reference[g]-v[g]-a.floating[j],C=v[g]-a.reference[g],T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(f));let A=T?T[E]:0;(!A||!await(s.isElement==null?void 0:s.isElement(T)))&&(A=u.floating[E]||a.floating[j]);const M=k/2-C/2,z=A/2-b[j]/2-1,V=cl(p[N],z),L=cl(p[P],z),K=V,te=A-b[j]-L,R=A/2-b[j]/2+M,U=sx(K,R,te),F=!d.arrow&&bu(i)!=null&&R!==U&&a.reference[j]/2-(R<K?V:L)-b[j]/2<0,X=F?R<K?R-K:R-te:0;return{[g]:v[g]+X,data:{[g]:U,centerOffset:R-U-X,...F&&{alignmentOffset:X}},reset:F}}}),c4=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:i,middlewareData:a,rects:s,initialPlacement:u,platform:d,elements:f}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:v,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:b=!0,...w}=xu(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const N=as(i),P=uo(u),E=as(u)===u,k=await(d.isRTL==null?void 0:d.isRTL(f.floating)),C=v||(E||!b?[eh(u)]:t4(u)),T=j!=="none";!v&&T&&C.push(...a4(u,b,j,k));const A=[u,...C],M=await SO(t,w),z=[];let V=((n=a.flip)==null?void 0:n.overflows)||[];if(h&&z.push(M[N]),p){const R=e4(i,s,k);z.push(M[R[0]],M[R[1]])}if(V=[...V,{placement:i,overflows:z}],!z.every(R=>R<=0)){var L,K;const R=(((L=a.flip)==null?void 0:L.index)||0)+1,U=A[R];if(U&&(!(p==="alignment"?P!==uo(U):!1)||V.every($=>uo($.placement)===P?$.overflows[0]>0:!0)))return{data:{index:R,overflows:V},reset:{placement:U}};let F=(K=V.filter(X=>X.overflows[0]<=0).sort((X,$)=>X.overflows[1]-$.overflows[1])[0])==null?void 0:K.placement;if(!F)switch(g){case"bestFit":{var te;const X=(te=V.filter($=>{if(T){const Y=uo($.placement);return Y===P||Y==="y"}return!0}).map($=>[$.placement,$.overflows.filter(Y=>Y>0).reduce((Y,W)=>Y+W,0)]).sort(($,Y)=>$[1]-Y[1])[0])==null?void 0:te[0];X&&(F=X);break}case"initialPlacement":F=u;break}if(i!==F)return{reset:{placement:F}}}return{}}}},u4=new Set(["left","top"]);async function d4(e,t){const{placement:r,platform:n,elements:i}=e,a=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=as(r),u=bu(r),d=uo(r)==="y",f=u4.has(s)?-1:1,h=a&&d?-1:1,p=xu(t,e);let{mainAxis:v,crossAxis:g,alignmentAxis:j}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof j=="number"&&(g=u==="end"?j*-1:j),d?{x:g*h,y:v*f}:{x:v*f,y:g*h}}const f4=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:i,y:a,placement:s,middlewareData:u}=t,d=await d4(t,e);return s===((r=u.offset)==null?void 0:r.placement)&&(n=u.arrow)!=null&&n.alignmentOffset?{}:{x:i+d.x,y:a+d.y,data:{...d,placement:s}}}}},h4=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:u={fn:w=>{let{x:N,y:P}=w;return{x:N,y:P}}},...d}=xu(e,t),f={x:r,y:n},h=await SO(t,d),p=uo(as(i)),v=wO(p);let g=f[v],j=f[p];if(a){const w=v==="y"?"top":"left",N=v==="y"?"bottom":"right",P=g+h[w],E=g-h[N];g=sx(P,g,E)}if(s){const w=p==="y"?"top":"left",N=p==="y"?"bottom":"right",P=j+h[w],E=j-h[N];j=sx(P,j,E)}const b=u.fn({...t,[v]:g,[p]:j});return{...b,data:{x:b.x-r,y:b.y-n,enabled:{[v]:a,[p]:s}}}}}};function fm(){return typeof window<"u"}function Sl(e){return NO(e)?(e.nodeName||"").toLowerCase():"#document"}function pn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ii(e){var t;return(t=(NO(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function NO(e){return fm()?e instanceof Node||e instanceof pn(e).Node:!1}function ai(e){return fm()?e instanceof Element||e instanceof pn(e).Element:!1}function ki(e){return fm()?e instanceof HTMLElement||e instanceof pn(e).HTMLElement:!1}function qS(e){return!fm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof pn(e).ShadowRoot}const m4=new Set(["inline","contents"]);function wu(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=oi(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!m4.has(i)}const p4=new Set(["table","td","th"]);function v4(e){return p4.has(Sl(e))}const g4=[":popover-open",":modal"];function hm(e){return g4.some(t=>{try{return e.matches(t)}catch{return!1}})}const y4=["transform","translate","scale","rotate","perspective"],x4=["transform","translate","scale","rotate","perspective","filter"],b4=["paint","layout","strict","content"];function L0(e){const t=$0(),r=ai(e)?oi(e):e;return y4.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||x4.some(n=>(r.willChange||"").includes(n))||b4.some(n=>(r.contain||"").includes(n))}function w4(e){let t=vo(e);for(;ki(t)&&!ul(t);){if(L0(t))return t;if(hm(t))return null;t=vo(t)}return null}function $0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const j4=new Set(["html","body","#document"]);function ul(e){return j4.has(Sl(e))}function oi(e){return pn(e).getComputedStyle(e)}function mm(e){return ai(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vo(e){if(Sl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qS(e)&&e.host||Ii(e);return qS(t)?t.host:t}function PO(e){const t=vo(e);return ul(t)?e.ownerDocument?e.ownerDocument.body:e.body:ki(t)&&wu(t)?t:PO(t)}function Yc(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const i=PO(e),a=i===((n=e.ownerDocument)==null?void 0:n.body),s=pn(i);if(a){const u=cx(s);return t.concat(s,s.visualViewport||[],wu(i)?i:[],u&&r?Yc(u):[])}return t.concat(i,Yc(i,[],r))}function cx(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function kO(e){const t=oi(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=ki(e),a=i?e.offsetWidth:r,s=i?e.offsetHeight:n,u=Jf(r)!==a||Jf(n)!==s;return u&&(r=a,n=s),{width:r,height:n,$:u}}function z0(e){return ai(e)?e:e.contextElement}function rl(e){const t=z0(e);if(!ki(t))return Ni(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:a}=kO(t);let s=(a?Jf(r.width):r.width)/n,u=(a?Jf(r.height):r.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!u||!Number.isFinite(u))&&(u=1),{x:s,y:u}}const S4=Ni(0);function _O(e){const t=pn(e);return!$0()||!t.visualViewport?S4:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function N4(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==pn(e)?!1:t}function os(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),a=z0(e);let s=Ni(1);t&&(n?ai(n)&&(s=rl(n)):s=rl(e));const u=N4(a,r,n)?_O(a):Ni(0);let d=(i.left+u.x)/s.x,f=(i.top+u.y)/s.y,h=i.width/s.x,p=i.height/s.y;if(a){const v=pn(a),g=n&&ai(n)?pn(n):n;let j=v,b=cx(j);for(;b&&n&&g!==j;){const w=rl(b),N=b.getBoundingClientRect(),P=oi(b),E=N.left+(b.clientLeft+parseFloat(P.paddingLeft))*w.x,k=N.top+(b.clientTop+parseFloat(P.paddingTop))*w.y;d*=w.x,f*=w.y,h*=w.x,p*=w.y,d+=E,f+=k,j=pn(b),b=cx(j)}}return th({width:h,height:p,x:d,y:f})}function pm(e,t){const r=mm(e).scrollLeft;return t?t.left+r:os(Ii(e)).left+r}function EO(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-pm(e,r),i=r.top+t.scrollTop;return{x:n,y:i}}function P4(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e;const a=i==="fixed",s=Ii(n),u=t?hm(t.floating):!1;if(n===s||u&&a)return r;let d={scrollLeft:0,scrollTop:0},f=Ni(1);const h=Ni(0),p=ki(n);if((p||!p&&!a)&&((Sl(n)!=="body"||wu(s))&&(d=mm(n)),ki(n))){const g=os(n);f=rl(n),h.x=g.x+n.clientLeft,h.y=g.y+n.clientTop}const v=s&&!p&&!a?EO(s,d):Ni(0);return{width:r.width*f.x,height:r.height*f.y,x:r.x*f.x-d.scrollLeft*f.x+h.x+v.x,y:r.y*f.y-d.scrollTop*f.y+h.y+v.y}}function k4(e){return Array.from(e.getClientRects())}function _4(e){const t=Ii(e),r=mm(e),n=e.ownerDocument.body,i=Zo(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=Zo(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+pm(e);const u=-r.scrollTop;return oi(n).direction==="rtl"&&(s+=Zo(t.clientWidth,n.clientWidth)-i),{width:i,height:a,x:s,y:u}}const HS=25;function E4(e,t){const r=pn(e),n=Ii(e),i=r.visualViewport;let a=n.clientWidth,s=n.clientHeight,u=0,d=0;if(i){a=i.width,s=i.height;const h=$0();(!h||h&&t==="fixed")&&(u=i.offsetLeft,d=i.offsetTop)}const f=pm(n);if(f<=0){const h=n.ownerDocument,p=h.body,v=getComputedStyle(p),g=h.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,j=Math.abs(n.clientWidth-p.clientWidth-g);j<=HS&&(a-=j)}else f<=HS&&(a+=f);return{width:a,height:s,x:u,y:d}}const C4=new Set(["absolute","fixed"]);function O4(e,t){const r=os(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,a=ki(e)?rl(e):Ni(1),s=e.clientWidth*a.x,u=e.clientHeight*a.y,d=i*a.x,f=n*a.y;return{width:s,height:u,x:d,y:f}}function VS(e,t,r){let n;if(t==="viewport")n=E4(e,r);else if(t==="document")n=_4(Ii(e));else if(ai(t))n=O4(t,r);else{const i=_O(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return th(n)}function CO(e,t){const r=vo(e);return r===t||!ai(r)||ul(r)?!1:oi(r).position==="fixed"||CO(r,t)}function A4(e,t){const r=t.get(e);if(r)return r;let n=Yc(e,[],!1).filter(u=>ai(u)&&Sl(u)!=="body"),i=null;const a=oi(e).position==="fixed";let s=a?vo(e):e;for(;ai(s)&&!ul(s);){const u=oi(s),d=L0(s);!d&&u.position==="fixed"&&(i=null),(a?!d&&!i:!d&&u.position==="static"&&!!i&&C4.has(i.position)||wu(s)&&!d&&CO(e,s))?n=n.filter(h=>h!==s):i=u,s=vo(s)}return t.set(e,n),n}function T4(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const s=[...r==="clippingAncestors"?hm(t)?[]:A4(t,this._c):[].concat(r),n],u=s[0],d=s.reduce((f,h)=>{const p=VS(t,h,i);return f.top=Zo(p.top,f.top),f.right=cl(p.right,f.right),f.bottom=cl(p.bottom,f.bottom),f.left=Zo(p.left,f.left),f},VS(t,u,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function M4(e){const{width:t,height:r}=kO(e);return{width:t,height:r}}function I4(e,t,r){const n=ki(t),i=Ii(t),a=r==="fixed",s=os(e,!0,a,t);let u={scrollLeft:0,scrollTop:0};const d=Ni(0);function f(){d.x=pm(i)}if(n||!n&&!a)if((Sl(t)!=="body"||wu(i))&&(u=mm(t)),n){const g=os(t,!0,a,t);d.x=g.x+t.clientLeft,d.y=g.y+t.clientTop}else i&&f();a&&!n&&i&&f();const h=i&&!n&&!a?EO(i,u):Ni(0),p=s.left+u.scrollLeft-d.x-h.x,v=s.top+u.scrollTop-d.y-h.y;return{x:p,y:v,width:s.width,height:s.height}}function sg(e){return oi(e).position==="static"}function YS(e,t){if(!ki(e)||oi(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ii(e)===r&&(r=r.ownerDocument.body),r}function OO(e,t){const r=pn(e);if(hm(e))return r;if(!ki(e)){let i=vo(e);for(;i&&!ul(i);){if(ai(i)&&!sg(i))return i;i=vo(i)}return r}let n=YS(e,t);for(;n&&v4(n)&&sg(n);)n=YS(n,t);return n&&ul(n)&&sg(n)&&!L0(n)?r:n||w4(e)||r}const R4=async function(e){const t=this.getOffsetParent||OO,r=this.getDimensions,n=await r(e.floating);return{reference:I4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function D4(e){return oi(e).direction==="rtl"}const L4={convertOffsetParentRelativeRectToViewportRelativeRect:P4,getDocumentElement:Ii,getClippingRect:T4,getOffsetParent:OO,getElementRects:R4,getClientRects:k4,getDimensions:M4,getScale:rl,isElement:ai,isRTL:D4};function AO(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $4(e,t){let r=null,n;const i=Ii(e);function a(){var u;clearTimeout(n),(u=r)==null||u.disconnect(),r=null}function s(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),a();const f=e.getBoundingClientRect(),{left:h,top:p,width:v,height:g}=f;if(u||t(),!v||!g)return;const j=sf(p),b=sf(i.clientWidth-(h+v)),w=sf(i.clientHeight-(p+g)),N=sf(h),E={rootMargin:-j+"px "+-b+"px "+-w+"px "+-N+"px",threshold:Zo(0,cl(1,d))||1};let k=!0;function C(T){const A=T[0].intersectionRatio;if(A!==d){if(!k)return s();A?s(!1,A):n=setTimeout(()=>{s(!1,1e-7)},1e3)}A===1&&!AO(f,e.getBoundingClientRect())&&s(),k=!1}try{r=new IntersectionObserver(C,{...E,root:i.ownerDocument})}catch{r=new IntersectionObserver(C,E)}r.observe(e)}return s(!0),a}function z4(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=n,f=z0(e),h=i||a?[...f?Yc(f):[],...Yc(t)]:[];h.forEach(N=>{i&&N.addEventListener("scroll",r,{passive:!0}),a&&N.addEventListener("resize",r)});const p=f&&u?$4(f,r):null;let v=-1,g=null;s&&(g=new ResizeObserver(N=>{let[P]=N;P&&P.target===f&&g&&(g.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var E;(E=g)==null||E.observe(t)})),r()}),f&&!d&&g.observe(f),g.observe(t));let j,b=d?os(e):null;d&&w();function w(){const N=os(e);b&&!AO(b,N)&&r(),b=N,j=requestAnimationFrame(w)}return r(),()=>{var N;h.forEach(P=>{i&&P.removeEventListener("scroll",r),a&&P.removeEventListener("resize",r)}),p==null||p(),(N=g)==null||N.disconnect(),g=null,d&&cancelAnimationFrame(j)}}const F4=f4,B4=h4,W4=c4,U4=l4,GS=(e,t,r)=>{const n=new Map,i={platform:L4,...r},a={...i.platform,_c:n};return s4(e,t,{...i,platform:a})};var lg={exports:{}};/*!
52
+ Copyright (c) 2018 Jed Watson.
53
+ Licensed under the MIT License (MIT), see
54
+ http://jedwatson.github.io/classnames
55
+ */var XS;function K4(){return XS||(XS=1,(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var a="",s=0;s<arguments.length;s++){var u=arguments[s];u&&(a=i(a,n(u)))}return a}function n(a){if(typeof a=="string"||typeof a=="number")return a;if(typeof a!="object")return"";if(Array.isArray(a))return r.apply(null,a);if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]"))return a.toString();var s="";for(var u in a)t.call(a,u)&&a[u]&&(s=i(s,u));return s}function i(a,s){return s?a?a+" "+s:a+s:a}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(lg)),lg.exports}var q4=K4();const ux=li(q4);var QS={};const H4="react-tooltip-core-styles",V4="react-tooltip-base-styles",ZS={core:!1,base:!1};function JS({css:e,id:t=V4,type:r="base",ref:n}){var i,a;if(!e||typeof document>"u"||ZS[r]||r==="core"&&typeof process<"u"&&(!((i=process==null?void 0:QS)===null||i===void 0)&&i.REACT_TOOLTIP_DISABLE_CORE_STYLES)||r!=="base"&&typeof process<"u"&&(!((a=process==null?void 0:QS)===null||a===void 0)&&a.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;r==="core"&&(t=H4),n||(n={});const{insertAt:s}=n;if(document.getElementById(t))return;const u=document.head||document.getElementsByTagName("head")[0],d=document.createElement("style");d.id=t,d.type="text/css",s==="top"&&u.firstChild?u.insertBefore(d,u.firstChild):u.appendChild(d),d.styleSheet?d.styleSheet.cssText=e:d.appendChild(document.createTextNode(e)),ZS[r]=!0}const eN=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:r=null,place:n="top",offset:i=10,strategy:a="absolute",middlewares:s=[F4(Number(i)),W4({fallbackAxisSideDirection:"start"}),B4({padding:5})],border:u,arrowSize:d=8})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:n};if(t===null)return{tooltipStyles:{},tooltipArrowStyles:{},place:n};const f=s;return r?(f.push(U4({element:r,padding:5})),GS(e,t,{placement:n,strategy:a,middleware:f}).then((({x:h,y:p,placement:v,middlewareData:g})=>{var j,b;const w={left:`${h}px`,top:`${p}px`,border:u},{x:N,y:P}=(j=g.arrow)!==null&&j!==void 0?j:{x:0,y:0},E=(b={top:"bottom",right:"left",bottom:"top",left:"right"}[v.split("-")[0]])!==null&&b!==void 0?b:"bottom",k=u&&{borderBottom:u,borderRight:u};let C=0;if(u){const T=`${u}`.match(/(\d+)px/);C=T!=null&&T[1]?Number(T[1]):1}return{tooltipStyles:w,tooltipArrowStyles:{left:N!=null?`${N}px`:"",top:P!=null?`${P}px`:"",right:"",bottom:"",...k,[E]:`-${d/2+C}px`},place:v}}))):GS(e,t,{placement:"bottom",strategy:a,middleware:f}).then((({x:h,y:p,placement:v})=>({tooltipStyles:{left:`${h}px`,top:`${p}px`},tooltipArrowStyles:{},place:v})))},tN=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),rN=(e,t,r)=>{let n=null;const i=function(...a){const s=()=>{n=null};!n&&(e.apply(this,a),n=setTimeout(s,t))};return i.cancel=()=>{n&&(clearTimeout(n),n=null)},i},nN=e=>e!==null&&!Array.isArray(e)&&typeof e=="object",dx=(e,t)=>{if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every(((i,a)=>dx(i,t[a])));if(Array.isArray(e)!==Array.isArray(t))return!1;if(!nN(e)||!nN(t))return e===t;const r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every((i=>dx(e[i],t[i])))},Y4=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some((r=>{const n=t.getPropertyValue(r);return n==="auto"||n==="scroll"}))},iN=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(Y4(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},G4=typeof window<"u"?y.useLayoutEffect:y.useEffect,En=e=>{e.current&&(clearTimeout(e.current),e.current=null)},X4="DEFAULT_TOOLTIP_ID",Q4={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},Z4=y.createContext({getTooltipData:()=>Q4});function TO(e=X4){return y.useContext(Z4).getTooltipData(e)}var Ks={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},cg={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const J4=({forwardRef:e,id:t,className:r,classNameArrow:n,variant:i="dark",anchorId:a,anchorSelect:s,place:u="top",offset:d=10,events:f=["hover"],openOnClick:h=!1,positionStrategy:p="absolute",middlewares:v,wrapper:g,delayShow:j=0,delayHide:b=0,float:w=!1,hidden:N=!1,noArrow:P=!1,clickable:E=!1,closeOnEsc:k=!1,closeOnScroll:C=!1,closeOnResize:T=!1,openEvents:A,closeEvents:M,globalCloseEvents:z,imperativeModeOnly:V,style:L,position:K,afterShow:te,afterHide:R,disableTooltip:U,content:F,contentWrapperRef:X,isOpen:$,defaultIsOpen:Y=!1,setIsOpen:W,previousActiveAnchor:I,activeAnchor:H,setActiveAnchor:oe,border:se,opacity:be,arrowColor:Ae,arrowSize:de=8,role:Se="tooltip"})=>{var J;const pe=y.useRef(null),Le=y.useRef(null),re=y.useRef(null),ot=y.useRef(null),We=y.useRef(null),[jt,zt]=y.useState({tooltipStyles:{},tooltipArrowStyles:{},place:u}),[mt,Un]=y.useState(!1),[di,$r]=y.useState(!1),[st,fi]=y.useState(null),Po=y.useRef(!1),Bi=y.useRef(null),{anchorRefs:ko,setActiveAnchor:Ia}=TO(t),Wi=y.useRef(!1),[Jr,Ra]=y.useState([]),en=y.useRef(!1),bn=h||f.includes("click"),ws=bn||(A==null?void 0:A.click)||(A==null?void 0:A.dblclick)||(A==null?void 0:A.mousedown),Da=A?{...A}:{mouseover:!0,focus:!0,mouseenter:!1,click:!1,dblclick:!1,mousedown:!1};!A&&bn&&Object.assign(Da,{mouseenter:!1,focus:!1,mouseover:!1,click:!0});const hi=M?{...M}:{mouseout:!0,blur:!0,mouseleave:!1,click:!1,dblclick:!1,mouseup:!1};!M&&bn&&Object.assign(hi,{mouseleave:!1,blur:!1,mouseout:!1});const Ht=z?{...z}:{escape:k||!1,scroll:C||!1,resize:T||!1,clickOutsideAnchor:ws||!1};V&&(Object.assign(Da,{mouseover:!1,focus:!1,mouseenter:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(hi,{mouseout:!1,blur:!1,mouseleave:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(Ht,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),G4((()=>(en.current=!0,()=>{en.current=!1})),[]);const ir=me=>{en.current&&(me&&$r(!0),setTimeout((()=>{en.current&&(W==null||W(me),$===void 0&&Un(me))}),10))};y.useEffect((()=>{if(t){if(mt){Te(I);const Ee=me(H),Ye=[...new Set([...Ee,t])].filter(Boolean).join(" ");H==null||H.setAttribute("aria-describedby",Ye)}else Te(H);return()=>{Te(H),Te(I)}}function me(Ee){var Ye;return((Ye=Ee==null?void 0:Ee.getAttribute("aria-describedby"))===null||Ye===void 0?void 0:Ye.split(" "))||[]}function Te(Ee){const Ye=me(Ee).filter((Et=>Et!==t));Ye.length?Ee==null||Ee.setAttribute("aria-describedby",Ye.join(" ")):Ee==null||Ee.removeAttribute("aria-describedby")}}),[H,mt,t,I]),y.useEffect((()=>{if($===void 0)return()=>null;$&&$r(!0);const me=setTimeout((()=>{Un($)}),10);return()=>{clearTimeout(me)}}),[$]),y.useEffect((()=>{if(mt!==Po.current)if(En(We),Po.current=mt,mt)te==null||te();else{const me=(Te=>{const Ee=Te.match(/^([\d.]+)(ms|s)$/);if(!Ee)return 0;const[,Ye,Et]=Ee;return Number(Ye)*(Et==="ms"?1:1e3)})(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));We.current=setTimeout((()=>{$r(!1),fi(null),R==null||R()}),me+25)}}),[mt]);const Ui=me=>{zt((Te=>dx(Te,me)?Te:me))},Ki=(me=j)=>{En(re),di?ir(!0):re.current=setTimeout((()=>{ir(!0)}),me)},mi=(me=b)=>{En(ot),ot.current=setTimeout((()=>{Wi.current||ir(!1)}),me)},qi=me=>{var Te;if(!me)return;const Ee=(Te=me.currentTarget)!==null&&Te!==void 0?Te:me.target;if(!(Ee!=null&&Ee.isConnected))return oe(null),void Ia({current:null});j?Ki():ir(!0),oe(Ee),Ia({current:Ee}),En(ot)},tn=()=>{E?mi(b||100):b?mi():ir(!1),En(re)},rn=({x:me,y:Te})=>{var Ee;const Ye={getBoundingClientRect:()=>({x:me,y:Te,width:0,height:0,top:Te,left:me,right:me,bottom:Te})};eN({place:(Ee=st==null?void 0:st.place)!==null&&Ee!==void 0?Ee:u,offset:d,elementReference:Ye,tooltipReference:pe.current,tooltipArrowReference:Le.current,strategy:p,middlewares:v,border:se,arrowSize:de}).then((Et=>{Ui(Et)}))},Hi=me=>{if(!me)return;const Te=me,Ee={x:Te.clientX,y:Te.clientY};rn(Ee),Bi.current=Ee},La=me=>{var Te;if(!mt)return;const Ee=me.target;Ee.isConnected&&(!((Te=pe.current)===null||Te===void 0)&&Te.contains(Ee)||[document.querySelector(`[id='${a}']`),...Jr].some((Ye=>Ye==null?void 0:Ye.contains(Ee)))||(ir(!1),En(re)))},_o=rN(qi,50),_t=rN(tn,50),ar=me=>{_t.cancel(),_o(me)},Ie=()=>{_o.cancel(),_t()},Ue=y.useCallback((()=>{var me,Te;const Ee=(me=st==null?void 0:st.position)!==null&&me!==void 0?me:K;Ee?rn(Ee):w?Bi.current&&rn(Bi.current):H!=null&&H.isConnected&&eN({place:(Te=st==null?void 0:st.place)!==null&&Te!==void 0?Te:u,offset:d,elementReference:H,tooltipReference:pe.current,tooltipArrowReference:Le.current,strategy:p,middlewares:v,border:se,arrowSize:de}).then((Ye=>{en.current&&Ui(Ye)}))}),[mt,H,F,L,u,st==null?void 0:st.place,d,p,K,st==null?void 0:st.position,w,de]);y.useEffect((()=>{var me,Te;const Ee=new Set(ko);Jr.forEach((et=>{U!=null&&U(et)||Ee.add({current:et})}));const Ye=document.querySelector(`[id='${a}']`);Ye&&!(U!=null&&U(Ye))&&Ee.add({current:Ye});const Et=()=>{ir(!1)},zr=iN(H),wn=iN(pe.current);Ht.scroll&&(window.addEventListener("scroll",Et),zr==null||zr.addEventListener("scroll",Et),wn==null||wn.addEventListener("scroll",Et));let mr=null;Ht.resize?window.addEventListener("resize",Et):H&&pe.current&&(mr=z4(H,pe.current,Ue,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const Fr=et=>{et.key==="Escape"&&ir(!1)};Ht.escape&&window.addEventListener("keydown",Fr),Ht.clickOutsideAnchor&&window.addEventListener("click",La);const Xe=[],Vi=et=>!!(et!=null&&et.target&&(H!=null&&H.contains(et.target))),Qu=et=>{mt&&Vi(et)||qi(et)},xp=et=>{mt&&Vi(et)&&tn()},zl=["mouseover","mouseout","mouseenter","mouseleave","focus","blur"],Fl=["click","dblclick","mousedown","mouseup"];Object.entries(Da).forEach((([et,tt])=>{tt&&(zl.includes(et)?Xe.push({event:et,listener:ar}):Fl.includes(et)&&Xe.push({event:et,listener:Qu}))})),Object.entries(hi).forEach((([et,tt])=>{tt&&(zl.includes(et)?Xe.push({event:et,listener:Ie}):Fl.includes(et)&&Xe.push({event:et,listener:xp}))})),w&&Xe.push({event:"pointermove",listener:Hi});const Bl=()=>{Wi.current=!0},Wl=()=>{Wi.current=!1,tn()},Zu=E&&(hi.mouseout||hi.mouseleave);return Zu&&((me=pe.current)===null||me===void 0||me.addEventListener("mouseover",Bl),(Te=pe.current)===null||Te===void 0||Te.addEventListener("mouseout",Wl)),Xe.forEach((({event:et,listener:tt})=>{Ee.forEach((Ul=>{var Yi;(Yi=Ul.current)===null||Yi===void 0||Yi.addEventListener(et,tt)}))})),()=>{var et,tt;Ht.scroll&&(window.removeEventListener("scroll",Et),zr==null||zr.removeEventListener("scroll",Et),wn==null||wn.removeEventListener("scroll",Et)),Ht.resize?window.removeEventListener("resize",Et):mr==null||mr(),Ht.clickOutsideAnchor&&window.removeEventListener("click",La),Ht.escape&&window.removeEventListener("keydown",Fr),Zu&&((et=pe.current)===null||et===void 0||et.removeEventListener("mouseover",Bl),(tt=pe.current)===null||tt===void 0||tt.removeEventListener("mouseout",Wl)),Xe.forEach((({event:Ul,listener:Yi})=>{Ee.forEach((Ju=>{var $a;($a=Ju.current)===null||$a===void 0||$a.removeEventListener(Ul,Yi)}))}))}}),[H,Ue,di,ko,Jr,A,M,z,bn,j,b]),y.useEffect((()=>{var me,Te;let Ee=(Te=(me=st==null?void 0:st.anchorSelect)!==null&&me!==void 0?me:s)!==null&&Te!==void 0?Te:"";!Ee&&t&&(Ee=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`);const Ye=new MutationObserver((Et=>{const zr=[],wn=[];Et.forEach((mr=>{if(mr.type==="attributes"&&mr.attributeName==="data-tooltip-id"&&(mr.target.getAttribute("data-tooltip-id")===t?zr.push(mr.target):mr.oldValue===t&&wn.push(mr.target)),mr.type==="childList"){if(H){const Fr=[...mr.removedNodes].filter((Xe=>Xe.nodeType===1));if(Ee)try{wn.push(...Fr.filter((Xe=>Xe.matches(Ee)))),wn.push(...Fr.flatMap((Xe=>[...Xe.querySelectorAll(Ee)])))}catch{}Fr.some((Xe=>{var Vi;return!!(!((Vi=Xe==null?void 0:Xe.contains)===null||Vi===void 0)&&Vi.call(Xe,H))&&($r(!1),ir(!1),oe(null),En(re),En(ot),!0)}))}if(Ee)try{const Fr=[...mr.addedNodes].filter((Xe=>Xe.nodeType===1));zr.push(...Fr.filter((Xe=>Xe.matches(Ee)))),zr.push(...Fr.flatMap((Xe=>[...Xe.querySelectorAll(Ee)])))}catch{}}})),(zr.length||wn.length)&&Ra((mr=>[...mr.filter((Fr=>!wn.includes(Fr))),...zr]))}));return Ye.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}),()=>{Ye.disconnect()}}),[t,s,st==null?void 0:st.anchorSelect,H]),y.useEffect((()=>{Ue()}),[Ue]),y.useEffect((()=>{if(!(X!=null&&X.current))return()=>null;const me=new ResizeObserver((()=>{setTimeout((()=>Ue()))}));return me.observe(X.current),()=>{me.disconnect()}}),[F,X==null?void 0:X.current]),y.useEffect((()=>{var me;const Te=document.querySelector(`[id='${a}']`),Ee=[...Jr,Te];H&&Ee.includes(H)||oe((me=Jr[0])!==null&&me!==void 0?me:Te)}),[a,Jr,H]),y.useEffect((()=>(Y&&ir(!0),()=>{En(re),En(ot)})),[]),y.useEffect((()=>{var me;let Te=(me=st==null?void 0:st.anchorSelect)!==null&&me!==void 0?me:s;if(!Te&&t&&(Te=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`),Te)try{const Ee=Array.from(document.querySelectorAll(Te));Ra(Ee)}catch{Ra([])}}),[t,s,st==null?void 0:st.anchorSelect]),y.useEffect((()=>{re.current&&(En(re),Ki(j))}),[j]);const Vt=(J=st==null?void 0:st.content)!==null&&J!==void 0?J:F,Kn=mt&&Object.keys(jt.tooltipStyles).length>0;return y.useImperativeHandle(e,(()=>({open:me=>{if(me!=null&&me.anchorSelect)try{document.querySelector(me.anchorSelect)}catch{return void console.warn(`[react-tooltip] "${me.anchorSelect}" is not a valid CSS selector`)}fi(me??null),me!=null&&me.delay?Ki(me.delay):ir(!0)},close:me=>{me!=null&&me.delay?mi(me.delay):ir(!1)},activeAnchor:H,place:jt.place,isOpen:!!(di&&!N&&Vt&&Kn)}))),di&&!N&&Vt?xr.createElement(g,{id:t,role:Se,className:ux("react-tooltip",Ks.tooltip,cg.tooltip,cg[i],r,`react-tooltip__place-${jt.place}`,Ks[Kn?"show":"closing"],Kn?"react-tooltip__show":"react-tooltip__closing",p==="fixed"&&Ks.fixed,E&&Ks.clickable),onTransitionEnd:me=>{En(We),mt||me.propertyName!=="opacity"||($r(!1),fi(null),R==null||R())},style:{...L,...jt.tooltipStyles,opacity:be!==void 0&&Kn?be:void 0},ref:pe},Vt,xr.createElement(g,{className:ux("react-tooltip-arrow",Ks.arrow,cg.arrow,n,P&&Ks.noArrow),style:{...jt.tooltipArrowStyles,background:Ae?`linear-gradient(to right bottom, transparent 50%, ${Ae} 50%)`:void 0,"--rt-arrow-size":`${de}px`},ref:Le})):null},e5=({content:e})=>xr.createElement("span",{dangerouslySetInnerHTML:{__html:e}}),MO=xr.forwardRef((({id:e,anchorId:t,anchorSelect:r,content:n,html:i,render:a,className:s,classNameArrow:u,variant:d="dark",place:f="top",offset:h=10,wrapper:p="div",children:v=null,events:g=["hover"],openOnClick:j=!1,positionStrategy:b="absolute",middlewares:w,delayShow:N=0,delayHide:P=0,float:E=!1,hidden:k=!1,noArrow:C=!1,clickable:T=!1,closeOnEsc:A=!1,closeOnScroll:M=!1,closeOnResize:z=!1,openEvents:V,closeEvents:L,globalCloseEvents:K,imperativeModeOnly:te=!1,style:R,position:U,isOpen:F,defaultIsOpen:X=!1,disableStyleInjection:$=!1,border:Y,opacity:W,arrowColor:I,arrowSize:H,setIsOpen:oe,afterShow:se,afterHide:be,disableTooltip:Ae,role:de="tooltip"},Se)=>{const[J,pe]=y.useState(n),[Le,re]=y.useState(i),[ot,We]=y.useState(f),[jt,zt]=y.useState(d),[mt,Un]=y.useState(h),[di,$r]=y.useState(N),[st,fi]=y.useState(P),[Po,Bi]=y.useState(E),[ko,Ia]=y.useState(k),[Wi,Jr]=y.useState(p),[Ra,en]=y.useState(g),[bn,ws]=y.useState(b),[Da,hi]=y.useState(null),[Ht,ir]=y.useState(null),Ui=y.useRef(null),Ki=y.useRef($),{anchorRefs:mi,activeAnchor:qi}=TO(e),tn=_t=>_t==null?void 0:_t.getAttributeNames().reduce(((ar,Ie)=>{var Ue;return Ie.startsWith("data-tooltip-")&&(ar[Ie.replace(/^data-tooltip-/,"")]=(Ue=_t==null?void 0:_t.getAttribute(Ie))!==null&&Ue!==void 0?Ue:null),ar}),{}),rn=_t=>{const ar={place:Ie=>{var Ue;We((Ue=Ie)!==null&&Ue!==void 0?Ue:f)},content:Ie=>{pe(Ie??n)},html:Ie=>{re(Ie??i)},variant:Ie=>{var Ue;zt((Ue=Ie)!==null&&Ue!==void 0?Ue:d)},offset:Ie=>{Un(Ie===null?h:Number(Ie))},wrapper:Ie=>{var Ue;Jr((Ue=Ie)!==null&&Ue!==void 0?Ue:p)},events:Ie=>{const Ue=Ie==null?void 0:Ie.split(" ");en(Ue??g)},"position-strategy":Ie=>{var Ue;ws((Ue=Ie)!==null&&Ue!==void 0?Ue:b)},"delay-show":Ie=>{$r(Ie===null?N:Number(Ie))},"delay-hide":Ie=>{fi(Ie===null?P:Number(Ie))},float:Ie=>{Bi(Ie===null?E:Ie==="true")},hidden:Ie=>{Ia(Ie===null?k:Ie==="true")},"class-name":Ie=>{hi(Ie)}};Object.values(ar).forEach((Ie=>Ie(null))),Object.entries(_t).forEach((([Ie,Ue])=>{var Vt;(Vt=ar[Ie])===null||Vt===void 0||Vt.call(ar,Ue)}))};y.useEffect((()=>{pe(n)}),[n]),y.useEffect((()=>{re(i)}),[i]),y.useEffect((()=>{We(f)}),[f]),y.useEffect((()=>{zt(d)}),[d]),y.useEffect((()=>{Un(h)}),[h]),y.useEffect((()=>{$r(N)}),[N]),y.useEffect((()=>{fi(P)}),[P]),y.useEffect((()=>{Bi(E)}),[E]),y.useEffect((()=>{Ia(k)}),[k]),y.useEffect((()=>{ws(b)}),[b]),y.useEffect((()=>{Ki.current!==$&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")}),[$]),y.useEffect((()=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:$==="core",disableBase:$}}))}),[]),y.useEffect((()=>{var _t;const ar=new Set(mi);let Ie=r;if(!Ie&&e&&(Ie=`[data-tooltip-id='${e.replace(/'/g,"\\'")}']`),Ie)try{document.querySelectorAll(Ie).forEach((Te=>{ar.add({current:Te})}))}catch{console.warn(`[react-tooltip] "${Ie}" is not a valid CSS selector`)}const Ue=document.querySelector(`[id='${t}']`);if(Ue&&ar.add({current:Ue}),!ar.size)return()=>null;const Vt=(_t=Ht??Ue)!==null&&_t!==void 0?_t:qi.current,Kn=new MutationObserver((Te=>{Te.forEach((Ee=>{var Ye;if(!Vt||Ee.type!=="attributes"||!(!((Ye=Ee.attributeName)===null||Ye===void 0)&&Ye.startsWith("data-tooltip-")))return;const Et=tn(Vt);rn(Et)}))})),me={attributes:!0,childList:!1,subtree:!1};if(Vt){const Te=tn(Vt);rn(Te),Kn.observe(Vt,me)}return()=>{Kn.disconnect()}}),[mi,qi,Ht,t,r]),y.useEffect((()=>{R!=null&&R.border&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),Y&&!tN("border",`${Y}`)&&console.warn(`[react-tooltip] "${Y}" is not a valid \`border\`.`),R!=null&&R.opacity&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),W&&!tN("opacity",`${W}`)&&console.warn(`[react-tooltip] "${W}" is not a valid \`opacity\`.`)}),[]);let Hi=v;const La=y.useRef(null);if(a){const _t=a({content:(Ht==null?void 0:Ht.getAttribute("data-tooltip-content"))||J||null,activeAnchor:Ht});Hi=_t?xr.createElement("div",{ref:La,className:"react-tooltip-content-wrapper"},_t):null}else J&&(Hi=J);Le&&(Hi=xr.createElement(e5,{content:Le}));const _o={forwardRef:Se,id:e,anchorId:t,anchorSelect:r,className:ux(s,Da),classNameArrow:u,content:Hi,contentWrapperRef:La,place:ot,variant:jt,offset:mt,wrapper:Wi,events:Ra,openOnClick:j,positionStrategy:bn,middlewares:w,delayShow:di,delayHide:st,float:Po,hidden:ko,noArrow:C,clickable:T,closeOnEsc:A,closeOnScroll:M,closeOnResize:z,openEvents:V,closeEvents:L,globalCloseEvents:K,imperativeModeOnly:te,style:R,position:U,isOpen:F,defaultIsOpen:X,border:Y,opacity:W,arrowColor:I,arrowSize:H,setIsOpen:oe,afterShow:se,afterHide:be,disableTooltip:Ae,activeAnchor:Ht,previousActiveAnchor:Ui.current,setActiveAnchor:_t=>{ir((ar=>(_t!=null&&_t.isSameNode(ar)||(Ui.current=ar),_t)))},role:de};return xr.createElement(J4,{..._o})}));typeof window<"u"&&window.addEventListener("react-tooltip-inject-styles",(e=>{e.detail.disableCore||JS({css:":root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s;--rt-arrow-size:8px}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit;z-index:-1}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}",type:"core"}),e.detail.disableBase||JS({css:`
56
+ .styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:var(--rt-arrow-size);height:var(--rt-arrow-size)}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`,type:"base"})}));const t5="/api",r5="x-connection-id";let fx=null;function ug(e){fx=e}class hx extends Error{constructor(r){super(r.message);Fo(this,"feature");Fo(this,"currentTier");Fo(this,"requiredTier");Fo(this,"upgradeUrl");this.name="PaymentRequiredError",this.feature=r.feature,this.currentTier=r.currentTier,this.requiredTier=r.requiredTier,this.upgradeUrl=r.upgradeUrl}}async function ye(e,t){const r={...t==null?void 0:t.headers};t!=null&&t.body&&(r["Content-Type"]="application/json"),fx&&(r[r5]=fx);const n=await fetch(`${t5}${e}`,{...t,headers:r,signal:t==null?void 0:t.signal});if(!n.ok){if(n.status===402){const i=await n.json();throw new hx(i)}throw new Error(`API error: ${n.status} ${n.statusText}`)}return n.json()}const ze={getHealth:e=>ye("/health",{signal:e}),getInfo:e=>{if(e instanceof AbortSignal)return ye("/metrics/info",{signal:e});const t=e?`?sections=${e.join(",")}`:"";return ye(`/metrics/info${t}`)},getSlowLog:(e=50,t=!0)=>{const r=new URLSearchParams({count:e.toString(),excludeMonitor:t.toString()});return ye(`/metrics/slowlog?${r}`)},getStoredSlowLog:e=>{const t=new URLSearchParams;e!=null&&e.startTime&&t.set("startTime",e.startTime.toString()),e!=null&&e.endTime&&t.set("endTime",e.endTime.toString()),e!=null&&e.command&&t.set("command",e.command),e!=null&&e.clientName&&t.set("clientName",e.clientName),e!=null&&e.minDuration&&t.set("minDuration",e.minDuration.toString()),e!=null&&e.limit&&t.set("limit",e.limit.toString()),e!=null&&e.offset&&t.set("offset",e.offset.toString());const r=t.toString();return ye(`/slowlog-analytics/entries${r?`?${r}`:""}`)},getStoredCommandLog:e=>{const t=new URLSearchParams;e!=null&&e.startTime&&t.set("startTime",e.startTime.toString()),e!=null&&e.endTime&&t.set("endTime",e.endTime.toString()),e!=null&&e.command&&t.set("command",e.command),e!=null&&e.clientName&&t.set("clientName",e.clientName),e!=null&&e.type&&t.set("type",e.type),e!=null&&e.minDuration&&t.set("minDuration",e.minDuration.toString()),e!=null&&e.limit&&t.set("limit",e.limit.toString()),e!=null&&e.offset&&t.set("offset",e.offset.toString());const r=t.toString();return ye(`/commandlog-analytics/entries${r?`?${r}`:""}`)},getStoredCommandLogPatternAnalysis:e=>{const t=new URLSearchParams;e!=null&&e.startTime&&t.set("startTime",e.startTime.toString()),e!=null&&e.endTime&&t.set("endTime",e.endTime.toString()),e!=null&&e.type&&t.set("type",e.type),e!=null&&e.limit&&t.set("limit",e.limit.toString());const r=t.toString();return ye(`/commandlog-analytics/patterns${r?`?${r}`:""}`)},getSlowLogPatternAnalysis:e=>{const t=e?`?count=${e}`:"";return ye(`/metrics/slowlog/patterns${t}`)},getCommandLog:(e=50,t)=>{const r=t?`?count=${e}&type=${t}`:`?count=${e}`;return ye(`/metrics/commandlog${r}`)},getCommandLogPatternAnalysis:(e,t)=>{const r=new URLSearchParams;e&&r.set("count",e.toString()),t&&r.set("type",t);const n=r.toString();return ye(`/metrics/commandlog/patterns${n?`?${n}`:""}`)},getLatencyLatest:()=>ye("/metrics/latency/latest"),getLatencyHistory:e=>ye(`/metrics/latency/history/${e}`),getLatencyHistogram:e=>{const t=e!=null&&e.length?`?commands=${e.join(",")}`:"";return ye(`/metrics/latency/histogram${t}`)},getMemoryStats:()=>ye("/metrics/memory/stats"),getClients:()=>ye("/metrics/clients"),getAclLog:(e=50)=>ye(`/metrics/acl/log?count=${e}`),getClusterInfo:()=>ye("/metrics/cluster/info"),getClusterNodes:()=>ye("/metrics/cluster/nodes"),getSlotStats:(e="key-count",t=100)=>ye(`/metrics/cluster/slot-stats?orderBy=${e}&limit=${t}`),discoverClusterNodes:e=>ye("/metrics/cluster/nodes/discover",{signal:e}),getClusterNodeStats:e=>ye("/metrics/cluster/node-stats",{signal:e}),getClusterSlowlog:(e=100,t)=>ye(`/metrics/cluster/slowlog?limit=${e}`,{signal:t}),getClusterClients:e=>ye("/metrics/cluster/clients",{signal:e}),getSlotMigrations:e=>ye("/metrics/cluster/migrations",{signal:e}),getNodeInfo:(e,t)=>ye(`/metrics/cluster/nodes/${e}/info`,{signal:t}),getDbSize:()=>ye("/metrics/dbsize"),getRole:()=>ye("/metrics/role"),getLatencyDoctor:()=>ye("/metrics/latency/doctor"),getMemoryDoctor:()=>ye("/metrics/memory/doctor"),getAuditEntries:e=>{const t=new URLSearchParams;e!=null&&e.username&&t.set("username",e.username),e!=null&&e.reason&&t.set("reason",e.reason),e!=null&&e.startTime&&t.set("startTime",e.startTime.toString()),e!=null&&e.endTime&&t.set("endTime",e.endTime.toString()),e!=null&&e.limit&&t.set("limit",e.limit.toString()),e!=null&&e.offset&&t.set("offset",e.offset.toString());const r=t.toString();return ye(`/audit/entries${r?`?${r}`:""}`)},getAuditStats:(e,t)=>{const r=new URLSearchParams;e&&r.set("startTime",e.toString()),t&&r.set("endTime",t.toString());const n=r.toString();return ye(`/audit/stats${n?`?${n}`:""}`)},getAuditFailedAuth:(e,t,r=100,n=0)=>{const i=new URLSearchParams;return e&&i.set("startTime",e.toString()),t&&i.set("endTime",t.toString()),i.set("limit",r.toString()),i.set("offset",n.toString()),ye(`/audit/failed-auth?${i.toString()}`)},getAuditByUser:(e,t,r,n=100,i=0)=>{const a=new URLSearchParams({username:e});return t&&a.set("startTime",t.toString()),r&&a.set("endTime",r.toString()),a.set("limit",n.toString()),a.set("offset",i.toString()),ye(`/audit/by-user?${a.toString()}`)},getClientTimeSeries:(e,t,r)=>{const n=new URLSearchParams({startTime:e.toString(),endTime:t.toString(),...r&&{bucketSize:r.toString()}});return ye(`/client-analytics/timeseries?${n}`)},getClientAnalyticsStats:(e,t)=>{const r=new URLSearchParams;e&&r.append("startTime",e.toString()),t&&r.append("endTime",t.toString());const n=r.toString();return ye(`/client-analytics/stats${n?`?${n}`:""}`)},getClientConnectionHistory:(e,t,r)=>{const n=new URLSearchParams;return e.name&&n.append("name",e.name),e.user&&n.append("user",e.user),e.addr&&n.append("addr",e.addr),t&&n.append("startTime",t.toString()),r&&n.append("endTime",r.toString()),ye(`/client-analytics/history?${n}`)},getCommandDistribution:e=>{const t=new URLSearchParams;e!=null&&e.startTime&&t.append("startTime",e.startTime.toString()),e!=null&&e.endTime&&t.append("endTime",e.endTime.toString()),e!=null&&e.groupBy&&t.append("groupBy",e.groupBy);const r=t.toString();return ye(`/client-analytics/command-distribution${r?`?${r}`:""}`)},getIdleConnections:e=>{const t=new URLSearchParams;e!=null&&e.idleThresholdSeconds&&t.append("idleThresholdSeconds",e.idleThresholdSeconds.toString()),e!=null&&e.minOccurrences&&t.append("minOccurrences",e.minOccurrences.toString());const r=t.toString();return ye(`/client-analytics/idle-connections${r?`?${r}`:""}`)},getBufferAnomalies:e=>{const t=new URLSearchParams;e!=null&&e.startTime&&t.append("startTime",e.startTime.toString()),e!=null&&e.endTime&&t.append("endTime",e.endTime.toString()),e!=null&&e.qbufThreshold&&t.append("qbufThreshold",e.qbufThreshold.toString()),e!=null&&e.omemThreshold&&t.append("omemThreshold",e.omemThreshold.toString());const r=t.toString();return ye(`/client-analytics/buffer-anomalies${r?`?${r}`:""}`)},getActivityTimeline:e=>{const t=new URLSearchParams;e!=null&&e.startTime&&t.append("startTime",e.startTime.toString()),e!=null&&e.endTime&&t.append("endTime",e.endTime.toString()),e!=null&&e.bucketSizeMinutes&&t.append("bucketSizeMinutes",e.bucketSizeMinutes.toString()),e!=null&&e.client&&t.append("client",e.client);const r=t.toString();return ye(`/client-analytics/activity-timeline${r?`?${r}`:""}`)},detectSpikes:e=>{const t=new URLSearchParams;e!=null&&e.startTime&&t.append("startTime",e.startTime.toString()),e!=null&&e.endTime&&t.append("endTime",e.endTime.toString()),e!=null&&e.sensitivityMultiplier&&t.append("sensitivityMultiplier",e.sensitivityMultiplier.toString());const r=t.toString();return ye(`/client-analytics/spike-detection${r?`?${r}`:""}`)},getAnomalyEvents:e=>{const t=new URLSearchParams;e!=null&&e.limit&&t.append("limit",e.limit.toString()),e!=null&&e.metricType&&t.append("metricType",e.metricType),e!=null&&e.startTime&&t.append("startTime",e.startTime.toString());const r=t.toString();return ye(`/anomaly/events${r?`?${r}`:""}`)},getAnomalyGroups:e=>{const t=new URLSearchParams;e!=null&&e.limit&&t.append("limit",e.limit.toString()),e!=null&&e.pattern&&t.append("pattern",e.pattern),e!=null&&e.startTime&&t.append("startTime",e.startTime.toString());const r=t.toString();return ye(`/anomaly/groups${r?`?${r}`:""}`)},getAnomalySummary:()=>ye("/anomaly/summary"),getAnomalyBuffers:()=>ye("/anomaly/buffers")},IO=y.createContext(null);function F0(){const e=y.useContext(IO);return{capabilities:e,isValkey:(e==null?void 0:e.dbType)==="valkey",hasCommandLog:(e==null?void 0:e.hasCommandLog)??!1,hasSlotStats:(e==null?void 0:e.hasSlotStats)??!1,hasClusterSlotStats:(e==null?void 0:e.hasClusterSlotStats)??!1,hasAclLog:(e==null?void 0:e.hasAclLog)??!1}}const RO={async getStatus(){return ye("/license/status")}},DO=y.createContext(null);function LO(){const e=y.useContext(DO);return{license:e,tier:(e==null?void 0:e.tier)||"community",hasFeature:t=>{var r;return((r=e==null?void 0:e.features)==null?void 0:r.includes(t))??!1}}}function n5(){const[e,t]=y.useState(null),[r,n]=y.useState(!0),[i,a]=y.useState(null);return y.useEffect(()=>{RO.getStatus().then(t).catch(a).finally(()=>n(!1))},[]),{license:e,loading:r,error:i}}const $O=y.createContext({error:null,showUpgradePrompt:()=>{},dismissUpgradePrompt:()=>{}});function i5(){return y.useContext($O)}function a5(){const[e,t]=y.useState(null);return{error:e,showUpgradePrompt:i=>{t(i)},dismissUpgradePrompt:()=>{t(null)}}}const zO=y.createContext(null);function Qr(){const e=y.useContext(zO);if(!e)throw new Error("useConnection must be used within a ConnectionProvider");return e}function o5(){const[e,t]=y.useState([]),[r,n]=y.useState(null),[i,a]=y.useState(!0),[s,u]=y.useState(null),d=y.useCallback(async()=>{try{a(!0),u(null);const h=await ye("/connections"),p=h.connections||[];if(t(p),!r&&p.length>0){const v=h.currentId&&p.find(g=>g.id===h.currentId)||p.find(g=>g.isConnected)||p[0];n(v),ug(v.id)}}catch(h){u(h instanceof Error?h.message:"Failed to fetch connections"),console.error("Failed to fetch connections:",h)}finally{a(!1)}},[r]),f=y.useCallback(h=>{const p=e.find(v=>v.id===h);p&&(n(p),ug(p.id))},[e]);return y.useEffect(()=>{ug((r==null?void 0:r.id)??null)},[r==null?void 0:r.id]),y.useEffect(()=>{d()},[]),{currentConnection:r,connections:e,loading:i,error:s,setConnection:f,refreshConnections:d}}const s5={async getVersion(){return ye("/version")}},FO={current:"unknown",latest:null,updateAvailable:!1,releaseUrl:null,checkedAt:null,loading:!0,error:null,dismissed:!1},BO=y.createContext({...FO,dismiss:()=>{},refresh:async()=>{}}),dg="betterdb_update_dismissed_version";function l5(){const[e,t]=y.useState(()=>{const a=localStorage.getItem(dg);return{...FO,dismissed:!!a}}),r=y.useCallback(async()=>{t(a=>({...a,loading:!0,error:null}));try{const a=await s5.getVersion(),u=localStorage.getItem(dg)===a.latest;t({...a,loading:!1,error:null,dismissed:u})}catch(a){t(s=>({...s,loading:!1,error:a instanceof Error?a:new Error("Failed to fetch version")}))}},[]),n=y.useCallback(()=>{t(a=>(a.latest&&localStorage.setItem(dg,a.latest),{...a,dismissed:!0}))},[]),i=y.useCallback(async()=>{await r()},[r]);return y.useEffect(()=>{r();const a=setInterval(r,360*60*1e3);return()=>clearInterval(a)},[r]),{...e,dismiss:n,refresh:i}}function c5(){return y.useContext(BO)}function WO(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=WO(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function He(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=WO(e))&&(n&&(n+=" "),n+=t);return n}const u5=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},d5=(e,t)=>({classGroupId:e,validator:t}),UO=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),rh="-",aN=[],f5="arbitrary..",h5=e=>{const t=p5(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return m5(s);const u=s.split(rh),d=u[0]===""&&u.length>1?1:0;return KO(u,d,t)},getConflictingClassGroupIds:(s,u)=>{if(u){const d=n[s],f=r[s];return d?f?u5(f,d):d:f||aN}return r[s]||aN}}},KO=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const i=e[t],a=r.nextPart.get(i);if(a){const f=KO(e,t+1,a);if(f)return f}const s=r.validators;if(s===null)return;const u=t===0?e.join(rh):e.slice(t).join(rh),d=s.length;for(let f=0;f<d;f++){const h=s[f];if(h.validator(u))return h.classGroupId}},m5=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?f5+n:void 0})(),p5=e=>{const{theme:t,classGroups:r}=e;return v5(r,t)},v5=(e,t)=>{const r=UO();for(const n in e){const i=e[n];B0(i,r,n,t)}return r},B0=(e,t,r,n)=>{const i=e.length;for(let a=0;a<i;a++){const s=e[a];g5(s,t,r,n)}},g5=(e,t,r,n)=>{if(typeof e=="string"){y5(e,t,r);return}if(typeof e=="function"){x5(e,t,r,n);return}b5(e,t,r,n)},y5=(e,t,r)=>{const n=e===""?t:qO(t,e);n.classGroupId=r},x5=(e,t,r,n)=>{if(w5(e)){B0(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(d5(r,e))},b5=(e,t,r,n)=>{const i=Object.entries(e),a=i.length;for(let s=0;s<a;s++){const[u,d]=i[s];B0(d,qO(t,u),r,n)}},qO=(e,t)=>{let r=e;const n=t.split(rh),i=n.length;for(let a=0;a<i;a++){const s=n[a];let u=r.nextPart.get(s);u||(u=UO(),r.nextPart.set(s,u)),r=u}return r},w5=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,j5=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const i=(a,s)=>{r[a]=s,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(a){let s=r[a];if(s!==void 0)return s;if((s=n[a])!==void 0)return i(a,s),s},set(a,s){a in r?r[a]=s:i(a,s)}}},mx="!",oN=":",S5=[],sN=(e,t,r,n,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:i}),N5=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=i=>{const a=[];let s=0,u=0,d=0,f;const h=i.length;for(let b=0;b<h;b++){const w=i[b];if(s===0&&u===0){if(w===oN){a.push(i.slice(d,b)),d=b+1;continue}if(w==="/"){f=b;continue}}w==="["?s++:w==="]"?s--:w==="("?u++:w===")"&&u--}const p=a.length===0?i:i.slice(d);let v=p,g=!1;p.endsWith(mx)?(v=p.slice(0,-1),g=!0):p.startsWith(mx)&&(v=p.slice(1),g=!0);const j=f&&f>d?f-d:void 0;return sN(a,g,v,j)};if(t){const i=t+oN,a=n;n=s=>s.startsWith(i)?a(s.slice(i.length)):sN(S5,!1,s,void 0,!0)}if(r){const i=n;n=a=>r({className:a,parseClassName:i})}return n},P5=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let i=[];for(let a=0;a<r.length;a++){const s=r[a],u=s[0]==="[",d=t.has(s);u||d?(i.length>0&&(i.sort(),n.push(...i),i=[]),n.push(s)):i.push(s)}return i.length>0&&(i.sort(),n.push(...i)),n}},k5=e=>({cache:j5(e.cacheSize),parseClassName:N5(e),sortModifiers:P5(e),...h5(e)}),_5=/\s+/,E5=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:a}=t,s=[],u=e.trim().split(_5);let d="";for(let f=u.length-1;f>=0;f-=1){const h=u[f],{isExternal:p,modifiers:v,hasImportantModifier:g,baseClassName:j,maybePostfixModifierPosition:b}=r(h);if(p){d=h+(d.length>0?" "+d:d);continue}let w=!!b,N=n(w?j.substring(0,b):j);if(!N){if(!w){d=h+(d.length>0?" "+d:d);continue}if(N=n(j),!N){d=h+(d.length>0?" "+d:d);continue}w=!1}const P=v.length===0?"":v.length===1?v[0]:a(v).join(":"),E=g?P+mx:P,k=E+N;if(s.indexOf(k)>-1)continue;s.push(k);const C=i(N,w);for(let T=0;T<C.length;++T){const A=C[T];s.push(E+A)}d=h+(d.length>0?" "+d:d)}return d},C5=(...e)=>{let t=0,r,n,i="";for(;t<e.length;)(r=e[t++])&&(n=HO(r))&&(i&&(i+=" "),i+=n);return i},HO=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=HO(e[n]))&&(r&&(r+=" "),r+=t);return r},O5=(e,...t)=>{let r,n,i,a;const s=d=>{const f=t.reduce((h,p)=>p(h),e());return r=k5(f),n=r.cache.get,i=r.cache.set,a=u,u(d)},u=d=>{const f=n(d);if(f)return f;const h=E5(d,r);return i(d,h),h};return a=s,(...d)=>a(C5(...d))},A5=[],Xt=e=>{const t=r=>r[e]||A5;return t.isThemeGetter=!0,t},VO=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,YO=/^\((?:(\w[\w-]*):)?(.+)\)$/i,T5=/^\d+\/\d+$/,M5=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,I5=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,R5=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,D5=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,L5=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qs=e=>T5.test(e),Fe=e=>!!e&&!Number.isNaN(Number(e)),io=e=>!!e&&Number.isInteger(Number(e)),fg=e=>e.endsWith("%")&&Fe(e.slice(0,-1)),na=e=>M5.test(e),$5=()=>!0,z5=e=>I5.test(e)&&!R5.test(e),GO=()=>!1,F5=e=>D5.test(e),B5=e=>L5.test(e),W5=e=>!Pe(e)&&!ke(e),U5=e=>Nl(e,ZO,GO),Pe=e=>VO.test(e),Bo=e=>Nl(e,JO,z5),hg=e=>Nl(e,Y5,Fe),lN=e=>Nl(e,XO,GO),K5=e=>Nl(e,QO,B5),lf=e=>Nl(e,eA,F5),ke=e=>YO.test(e),Pc=e=>Pl(e,JO),q5=e=>Pl(e,G5),cN=e=>Pl(e,XO),H5=e=>Pl(e,ZO),V5=e=>Pl(e,QO),cf=e=>Pl(e,eA,!0),Nl=(e,t,r)=>{const n=VO.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Pl=(e,t,r=!1)=>{const n=YO.exec(e);return n?n[1]?t(n[1]):r:!1},XO=e=>e==="position"||e==="percentage",QO=e=>e==="image"||e==="url",ZO=e=>e==="length"||e==="size"||e==="bg-size",JO=e=>e==="length",Y5=e=>e==="number",G5=e=>e==="family-name",eA=e=>e==="shadow",X5=()=>{const e=Xt("color"),t=Xt("font"),r=Xt("text"),n=Xt("font-weight"),i=Xt("tracking"),a=Xt("leading"),s=Xt("breakpoint"),u=Xt("container"),d=Xt("spacing"),f=Xt("radius"),h=Xt("shadow"),p=Xt("inset-shadow"),v=Xt("text-shadow"),g=Xt("drop-shadow"),j=Xt("blur"),b=Xt("perspective"),w=Xt("aspect"),N=Xt("ease"),P=Xt("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...k(),ke,Pe],T=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],M=()=>[ke,Pe,d],z=()=>[qs,"full","auto",...M()],V=()=>[io,"none","subgrid",ke,Pe],L=()=>["auto",{span:["full",io,ke,Pe]},io,ke,Pe],K=()=>[io,"auto",ke,Pe],te=()=>["auto","min","max","fr",ke,Pe],R=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...M()],X=()=>[qs,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],$=()=>[e,ke,Pe],Y=()=>[...k(),cN,lN,{position:[ke,Pe]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",H5,U5,{size:[ke,Pe]}],H=()=>[fg,Pc,Bo],oe=()=>["","none","full",f,ke,Pe],se=()=>["",Fe,Pc,Bo],be=()=>["solid","dashed","dotted","double"],Ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],de=()=>[Fe,fg,cN,lN],Se=()=>["","none",j,ke,Pe],J=()=>["none",Fe,ke,Pe],pe=()=>["none",Fe,ke,Pe],Le=()=>[Fe,ke,Pe],re=()=>[qs,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[na],breakpoint:[na],color:[$5],container:[na],"drop-shadow":[na],ease:["in","out","in-out"],font:[W5],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[na],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[na],shadow:[na],spacing:["px",Fe],text:[na],"text-shadow":[na],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",qs,Pe,ke,w]}],container:["container"],columns:[{columns:[Fe,Pe,ke,u]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:z()}],"inset-x":[{"inset-x":z()}],"inset-y":[{"inset-y":z()}],start:[{start:z()}],end:[{end:z()}],top:[{top:z()}],right:[{right:z()}],bottom:[{bottom:z()}],left:[{left:z()}],visibility:["visible","invisible","collapse"],z:[{z:[io,"auto",ke,Pe]}],basis:[{basis:[qs,"full","auto",u,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Fe,qs,"auto","initial","none",Pe]}],grow:[{grow:["",Fe,ke,Pe]}],shrink:[{shrink:["",Fe,ke,Pe]}],order:[{order:[io,"first","last","none",ke,Pe]}],"grid-cols":[{"grid-cols":V()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":V()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...R(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...R()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":R()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],w:[{w:[u,"screen",...X()]}],"min-w":[{"min-w":[u,"screen","none",...X()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[s]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",r,Pc,Bo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,ke,hg]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",fg,Pe]}],"font-family":[{font:[q5,Pe,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,ke,Pe]}],"line-clamp":[{"line-clamp":[Fe,"none",ke,hg]}],leading:[{leading:[a,...M()]}],"list-image":[{"list-image":["none",ke,Pe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ke,Pe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...be(),"wavy"]}],"text-decoration-thickness":[{decoration:[Fe,"from-font","auto",ke,Bo]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[Fe,"auto",ke,Pe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke,Pe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ke,Pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Y()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},io,ke,Pe],radial:["",ke,Pe],conic:[io,ke,Pe]},V5,K5]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:H()}],"gradient-via-pos":[{via:H()}],"gradient-to-pos":[{to:H()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":se()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...be(),"hidden","none"]}],"divide-style":[{divide:[...be(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...be(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Fe,ke,Pe]}],"outline-w":[{outline:["",Fe,Pc,Bo]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",h,cf,lf]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",p,cf,lf]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[Fe,Bo]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",v,cf,lf]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[Fe,ke,Pe]}],"mix-blend":[{"mix-blend":[...Ae(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ae()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Fe]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[ke,Pe]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[Fe]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Y()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ke,Pe]}],filter:[{filter:["","none",ke,Pe]}],blur:[{blur:Se()}],brightness:[{brightness:[Fe,ke,Pe]}],contrast:[{contrast:[Fe,ke,Pe]}],"drop-shadow":[{"drop-shadow":["","none",g,cf,lf]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",Fe,ke,Pe]}],"hue-rotate":[{"hue-rotate":[Fe,ke,Pe]}],invert:[{invert:["",Fe,ke,Pe]}],saturate:[{saturate:[Fe,ke,Pe]}],sepia:[{sepia:["",Fe,ke,Pe]}],"backdrop-filter":[{"backdrop-filter":["","none",ke,Pe]}],"backdrop-blur":[{"backdrop-blur":Se()}],"backdrop-brightness":[{"backdrop-brightness":[Fe,ke,Pe]}],"backdrop-contrast":[{"backdrop-contrast":[Fe,ke,Pe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Fe,ke,Pe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Fe,ke,Pe]}],"backdrop-invert":[{"backdrop-invert":["",Fe,ke,Pe]}],"backdrop-opacity":[{"backdrop-opacity":[Fe,ke,Pe]}],"backdrop-saturate":[{"backdrop-saturate":[Fe,ke,Pe]}],"backdrop-sepia":[{"backdrop-sepia":["",Fe,ke,Pe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ke,Pe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Fe,"initial",ke,Pe]}],ease:[{ease:["linear","initial",N,ke,Pe]}],delay:[{delay:[Fe,ke,Pe]}],animate:[{animate:["none",P,ke,Pe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,ke,Pe]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:J()}],"rotate-x":[{"rotate-x":J()}],"rotate-y":[{"rotate-y":J()}],"rotate-z":[{"rotate-z":J()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:Le()}],"skew-x":[{"skew-x":Le()}],"skew-y":[{"skew-y":Le()}],transform:[{transform:[ke,Pe,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:re()}],"translate-x":[{"translate-x":re()}],"translate-y":[{"translate-y":re()}],"translate-z":[{"translate-z":re()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ke,Pe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ke,Pe]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[Fe,Pc,Bo,hg]}],stroke:[{stroke:["none",...$()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Q5=O5(X5);function Zt(...e){return Q5(He(e))}function Bf(e){if(e===0)return"0 B";const t=1024,r=["B","KB","MB","GB","TB"],n=Math.floor(Math.log(e)/Math.log(t));return`${(e/Math.pow(t,n)).toFixed(2)} ${r[n]}`}const ae=y.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:Zt("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));ae.displayName="Card";const fe=y.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:Zt("flex flex-col space-y-1.5 p-6",e),...t}));fe.displayName="CardHeader";const he=y.forwardRef(({className:e,...t},r)=>l.jsx("h3",{ref:r,className:Zt("text-2xl font-semibold leading-none tracking-tight",e),...t}));he.displayName="CardTitle";const tA=y.forwardRef(({className:e,...t},r)=>l.jsx("p",{ref:r,className:Zt("text-sm text-muted-foreground",e),...t}));tA.displayName="CardDescription";const ce=y.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:Zt("p-6 pt-0",e),...t}));ce.displayName="CardContent";const Z5=y.forwardRef(({className:e,...t},r)=>l.jsx("div",{ref:r,className:Zt("flex items-center p-6 pt-0",e),...t}));Z5.displayName="CardFooter";function J5({error:e,onDismiss:t}){return l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50",children:l.jsxs(ae,{className:"max-w-md p-6 space-y-4",children:[l.jsxs("div",{className:"flex items-start justify-between",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-semibold",children:"Upgrade Required"}),l.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["This feature requires ",e.requiredTier]})]}),l.jsx("button",{onClick:t,className:"text-muted-foreground hover:text-foreground","aria-label":"Close",children:"✕"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{className:"text-sm",children:e.message}),l.jsxs("div",{className:"text-sm text-muted-foreground",children:[l.jsxs("p",{children:["Current tier: ",l.jsx("span",{className:"font-medium",children:e.currentTier})]}),l.jsxs("p",{children:["Required tier: ",l.jsx("span",{className:"font-medium",children:e.requiredTier})]})]})]}),l.jsxs("div",{className:"flex gap-3",children:[l.jsx("a",{href:e.upgradeUrl,target:"_blank",rel:"noopener noreferrer",className:"flex-1 bg-primary text-primary-foreground px-4 py-2 rounded-md text-sm font-medium hover:bg-primary/90 text-center",children:"Upgrade Now"}),l.jsx("button",{onClick:t,className:"px-4 py-2 rounded-md text-sm font-medium hover:bg-muted",children:"Maybe Later"})]})]})})}function ez(){const{updateAvailable:e,current:t,latest:r,releaseUrl:n,dismissed:i,dismiss:a,loading:s}=c5();return s||!e||i?null:l.jsxs("div",{className:"bg-blue-600 text-white px-4 py-2 text-sm flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"font-medium",children:"Update available:"}),l.jsxs("span",{children:["v",t," → v",r]}),n&&l.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"underline hover:no-underline ml-2",children:"View release notes"})]}),l.jsx("button",{onClick:a,className:"text-white/80 hover:text-white px-2 py-1 rounded hover:bg-white/10","aria-label":"Dismiss update notification",children:"Dismiss"})]})}const uf={name:"",host:"localhost",port:6379,username:"",password:"",dbIndex:0,tls:!1};function tz(){const{currentConnection:e,connections:t,loading:r,error:n,setConnection:i,refreshConnections:a}=Qr(),[s,u]=y.useState(!1),[d,f]=y.useState(!1),[h,p]=y.useState(uf),[v,g]=y.useState(null),[j,b]=y.useState(!1),[w,N]=y.useState(!1),P=(A,M)=>{p(z=>({...z,[A]:M})),g(null)},E=async()=>{N(!0),g(null);try{const A=await ye("/connections/test",{method:"POST",body:JSON.stringify({name:h.name||"Test",host:h.host,port:h.port,username:h.username||void 0,password:h.password||void 0,dbIndex:h.dbIndex,tls:h.tls})});g({success:A.success,message:A.success?"Connection successful!":A.error||"Connection failed"})}catch(A){g({success:!1,message:A instanceof Error?A.message:"Connection test failed"})}finally{N(!1)}},k=async()=>{if(!h.name||!h.host){g({success:!1,message:"Name and host are required"});return}b(!0);try{await ye("/connections",{method:"POST",body:JSON.stringify({name:h.name,host:h.host,port:h.port,username:h.username||void 0,password:h.password||void 0,dbIndex:h.dbIndex,tls:h.tls,setAsDefault:t.length===0})}),u(!1),p(uf),g(null),await a()}catch(A){g({success:!1,message:A instanceof Error?A.message:"Failed to save connection"})}finally{b(!1)}},C=async A=>{if(confirm("Are you sure you want to delete this connection?"))try{await ye(`/connections/${A}`,{method:"DELETE"}),await a()}catch(M){alert(M instanceof Error?M.message:"Failed to delete connection")}},T=async A=>{try{await ye(`/connections/${A}/default`,{method:"POST"}),await a()}catch(M){alert(M instanceof Error?M.message:"Failed to set default")}};return r?l.jsx("div",{className:"px-3 py-2 text-sm text-muted-foreground",children:"Loading connections..."}):n?l.jsxs("div",{className:"px-3 py-2",children:[l.jsx("div",{className:"text-sm text-red-500 mb-2",children:n}),l.jsx("button",{onClick:()=>u(!0),className:"text-xs text-primary hover:underline",children:"+ Add Connection"})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"px-3 py-2",children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsx("label",{className:"text-xs text-muted-foreground",children:"Connection"}),l.jsxs("div",{className:"flex gap-1",children:[l.jsx("button",{onClick:()=>u(!0),className:"text-xs text-primary hover:underline",title:"Add connection",children:"+"}),t.length>0&&l.jsx("button",{onClick:()=>f(!0),className:"text-xs text-muted-foreground hover:text-foreground",title:"Manage connections",children:"⚙"})]})]}),t.length===0?l.jsx("button",{onClick:()=>u(!0),className:"w-full px-2 py-1.5 text-sm border border-dashed rounded-md hover:border-primary hover:text-primary transition-colors",children:"+ Add your first connection"}):t.length===1?l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${t[0].isConnected?"bg-green-500":"bg-red-500"}`}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("span",{className:"text-sm font-medium truncate block",children:t[0].name}),l.jsxs("span",{className:"text-xs text-muted-foreground",children:[t[0].host,":",t[0].port]})]})]}):l.jsx("select",{value:(e==null?void 0:e.id)??"",onChange:A=>i(A.target.value),className:"w-full px-2 py-1.5 text-sm bg-background border rounded-md focus:outline-none focus:ring-2 focus:ring-primary",children:t.map(A=>l.jsxs("option",{value:A.id,children:[A.isConnected?"● ":"○ ",A.name," (",A.host,":",A.port,")"]},A.id))})]}),s&&l.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:l.jsxs("div",{className:"bg-background border rounded-lg shadow-lg w-full max-w-md mx-4",children:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b",children:[l.jsx("h2",{className:"text-lg font-semibold",children:"Add Connection"}),l.jsx("button",{onClick:()=>{u(!1),p(uf),g(null)},className:"text-muted-foreground hover:text-foreground",children:"✕"})]}),l.jsxs("div",{className:"p-4 space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium mb-1",children:"Name *"}),l.jsx("input",{type:"text",value:h.name,onChange:A=>P("name",A.target.value),placeholder:"Production Redis",className:"w-full px-3 py-2 border rounded-md bg-background focus:outline-none focus:ring-2 focus:ring-primary"})]}),l.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[l.jsxs("div",{className:"col-span-2",children:[l.jsx("label",{className:"block text-sm font-medium mb-1",children:"Host *"}),l.jsx("input",{type:"text",value:h.host,onChange:A=>P("host",A.target.value),placeholder:"localhost",className:"w-full px-3 py-2 border rounded-md bg-background focus:outline-none focus:ring-2 focus:ring-primary"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium mb-1",children:"Port"}),l.jsx("input",{type:"number",value:h.port,onChange:A=>P("port",parseInt(A.target.value)||6379),className:"w-full px-3 py-2 border rounded-md bg-background focus:outline-none focus:ring-2 focus:ring-primary"})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium mb-1",children:"Username"}),l.jsx("input",{type:"text",value:h.username,onChange:A=>P("username",A.target.value),placeholder:"default",className:"w-full px-3 py-2 border rounded-md bg-background focus:outline-none focus:ring-2 focus:ring-primary"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium mb-1",children:"Password"}),l.jsx("input",{type:"password",value:h.password,onChange:A=>P("password",A.target.value),className:"w-full px-3 py-2 border rounded-md bg-background focus:outline-none focus:ring-2 focus:ring-primary"})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium mb-1",children:"Database Index"}),l.jsx("input",{type:"number",value:h.dbIndex,onChange:A=>P("dbIndex",parseInt(A.target.value)||0),min:"0",max:"15",className:"w-full px-3 py-2 border rounded-md bg-background focus:outline-none focus:ring-2 focus:ring-primary"})]}),l.jsx("div",{className:"flex items-end pb-2",children:l.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[l.jsx("input",{type:"checkbox",checked:h.tls,onChange:A=>P("tls",A.target.checked),className:"rounded"}),l.jsx("span",{className:"text-sm",children:"Use TLS"})]})})]}),v&&l.jsx("div",{className:`p-3 rounded-md text-sm ${v.success?"bg-green-500/10 text-green-500":"bg-red-500/10 text-red-500"}`,children:v.message})]}),l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t bg-muted/30",children:[l.jsx("button",{onClick:E,disabled:w||!h.host,className:"px-4 py-2 text-sm border rounded-md hover:bg-muted disabled:opacity-50",children:w?"Testing...":"Test Connection"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:()=>{u(!1),p(uf),g(null)},className:"px-4 py-2 text-sm border rounded-md hover:bg-muted",children:"Cancel"}),l.jsx("button",{onClick:k,disabled:j||!h.name||!h.host,className:"px-4 py-2 text-sm bg-primary text-primary-foreground rounded-md hover:bg-primary/90 disabled:opacity-50",children:j?"Saving...":"Save"})]})]})]})}),d&&l.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:l.jsxs("div",{className:"bg-background border rounded-lg shadow-lg w-full max-w-lg mx-4",children:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b",children:[l.jsx("h2",{className:"text-lg font-semibold",children:"Manage Connections"}),l.jsx("button",{onClick:()=>f(!1),className:"text-muted-foreground hover:text-foreground",children:"✕"})]}),l.jsx("div",{className:"p-4 space-y-2 max-h-96 overflow-y-auto",children:t.map(A=>l.jsxs("div",{className:`flex items-center justify-between p-3 border rounded-md ${(e==null?void 0:e.id)===A.id?"border-primary bg-primary/5":""}`,children:[l.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[l.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${A.isConnected?"bg-green-500":"bg-red-500"}`}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"font-medium truncate",children:A.name}),l.jsxs("div",{className:"text-xs text-muted-foreground",children:[A.host,":",A.port]})]})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(e==null?void 0:e.id)!==A.id&&l.jsx("button",{onClick:()=>{i(A.id),f(!1)},className:"text-xs px-2 py-1 border rounded hover:bg-muted",children:"Select"}),l.jsx("button",{onClick:()=>T(A.id),className:"text-xs px-2 py-1 border rounded hover:bg-muted",title:"Set as default",children:"★"}),l.jsx("button",{onClick:()=>C(A.id),className:"text-xs px-2 py-1 border border-red-500/50 text-red-500 rounded hover:bg-red-500/10",children:"Delete"})]})]},A.id))}),l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t bg-muted/30",children:[l.jsx("button",{onClick:()=>{f(!1),u(!0)},className:"px-4 py-2 text-sm border rounded-md hover:bg-muted",children:"+ Add Connection"}),l.jsx("button",{onClick:()=>f(!1),className:"px-4 py-2 text-sm bg-primary text-primary-foreground rounded-md hover:bg-primary/90",children:"Done"})]})]})})]})}function Ke({fetcher:e,interval:t=5e3,enabled:r=!0,refetchKey:n}){const[i,a]=y.useState(null),[s,u]=y.useState(null),[d,f]=y.useState(!0),[h,p]=y.useState(null),v=y.useRef(e),g=y.useRef(null),{showUpgradePrompt:j}=i5();return y.useEffect(()=>{v.current=e},[e]),y.useEffect(()=>{if(!r)return;const w=async()=>{g.current&&g.current.abort();const P=new AbortController;g.current=P;try{u(null);const E=await v.current(P.signal);P.signal.aborted||(a(E),p(new Date))}catch(E){if(E instanceof Error&&E.name==="AbortError")return;if(E instanceof hx){j(E),u(E);return}u(E instanceof Error?E:new Error("Unknown error"))}finally{P.signal.aborted||f(!1)}};w();const N=setInterval(w,t);return()=>{clearInterval(N),g.current&&(g.current.abort(),g.current=null)}},[t,r,j,n]),{data:i,error:s,loading:d,lastUpdated:h,refresh:async()=>{try{u(null);const w=await v.current();a(w),p(new Date)}catch(w){if(w instanceof hx){j(w),u(w);return}u(w instanceof Error?w:new Error("Unknown error"))}}}}const uN=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,dN=He,rz=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return dN(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:i,defaultVariants:a}=t,s=Object.keys(i).map(f=>{const h=r==null?void 0:r[f],p=a==null?void 0:a[f];if(h===null)return null;const v=uN(h)||uN(p);return i[f][v]}),u=r&&Object.entries(r).reduce((f,h)=>{let[p,v]=h;return v===void 0||(f[p]=v),f},{}),d=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((f,h)=>{let{class:p,className:v,...g}=h;return Object.entries(g).every(j=>{let[b,w]=j;return Array.isArray(w)?w.includes({...a,...u}[b]):{...a,...u}[b]===w})?[...f,p,v]:f},[]);return dN(e,s,d,r==null?void 0:r.class,r==null?void 0:r.className)},nz=rz("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",success:"border-transparent bg-green-500 text-white hover:bg-green-600",warning:"border-transparent bg-yellow-500 text-yellow-950 hover:bg-yellow-600"}},defaultVariants:{variant:"default"}});function Ve({className:e,variant:t,...r}){return l.jsx("div",{className:Zt(nz({variant:t}),e),...r})}function px({className:e,...t}){return l.jsx("div",{className:Zt("animate-pulse rounded-md bg-muted",e),...t})}function iz({health:e,loading:t}){if(t)return l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"Connection"})}),l.jsx(ce,{children:l.jsx(px,{className:"h-4 w-24"})})]});const r=(e==null?void 0:e.status)==="connected"?"default":"destructive";return l.jsxs(ae,{children:[l.jsxs(fe,{className:"flex flex-row items-center justify-between pb-2",children:[l.jsx(he,{className:"text-sm font-medium",children:"Connection"}),l.jsx(Ve,{variant:r,children:(e==null?void 0:e.status)??"Unknown"})]}),l.jsxs(ce,{children:[l.jsxs("div",{className:"text-2xl font-bold",children:[(e==null?void 0:e.database.type)==="valkey"?"Valkey":"Redis"," ",e==null?void 0:e.database.version]}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:[e==null?void 0:e.database.host,":",e==null?void 0:e.database.port]})]})]})}function az({info:e}){var a,s,u,d,f,h,p,v,g,j;const t=parseInt(((a=e==null?void 0:e.stats)==null?void 0:a.keyspace_hits)??"0",10),r=parseInt(((s=e==null?void 0:e.stats)==null?void 0:s.keyspace_misses)??"0",10),n=t+r>0?(t/(t+r)*100).toFixed(1):"0.0",i=[{title:"Operations/sec",value:((u=e==null?void 0:e.stats)==null?void 0:u.instantaneous_ops_per_sec)??"-",subtitle:`${parseInt(((d=e==null?void 0:e.stats)==null?void 0:d.total_commands_processed)??"0",10).toLocaleString()} total`},{title:"Connected Clients",value:((f=e==null?void 0:e.clients)==null?void 0:f.connected_clients)??"-",subtitle:`${((h=e==null?void 0:e.clients)==null?void 0:h.blocked_clients)??"0"} blocked`},{title:"Memory Used",value:((p=e==null?void 0:e.memory)==null?void 0:p.used_memory_human)??"-",subtitle:`Peak: ${((v=e==null?void 0:e.memory)==null?void 0:v.used_memory_peak_human)??"-"}`},{title:"Hit Rate",value:`${n}%`,subtitle:`${t.toLocaleString()} hits`},{title:"Evicted Keys",value:parseInt(((g=e==null?void 0:e.stats)==null?void 0:g.evicted_keys)??"0",10).toLocaleString(),subtitle:`${parseInt(((j=e==null?void 0:e.stats)==null?void 0:j.expired_keys)??"0",10).toLocaleString()} expired`},{title:"Uptime",value:e!=null&&e.server?`${e.server.uptime_in_days}d`:"-",subtitle:e!=null&&e.server?`${Math.floor(parseInt(e.server.uptime_in_seconds,10)/3600)%24}h`:""}];return l.jsx(l.Fragment,{children:i.map(b=>l.jsxs(ae,{children:[l.jsx(fe,{className:"pb-2",children:l.jsx(he,{className:"text-sm font-medium text-muted-foreground",children:b.title})}),l.jsxs(ce,{children:[l.jsx("div",{className:"text-2xl font-bold",children:b.value}),l.jsx("p",{className:"text-xs text-muted-foreground",children:b.subtitle})]})]},b.title))})}var oz=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function W0(e){if(typeof e!="string")return!1;var t=oz;return t.includes(e)}var sz=["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"],lz=new Set(sz);function rA(e){return typeof e!="string"?!1:lz.has(e)}function nA(e){return typeof e=="string"&&e.startsWith("data-")}function Rr(e){if(typeof e!="object"||e===null)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(rA(r)||nA(r))&&(t[r]=e[r]);return t}function ss(e){if(e==null)return null;if(y.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Rr(t)}return typeof e=="object"&&!Array.isArray(e)?Rr(e):null}function br(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(rA(r)||nA(r)||W0(r))&&(t[r]=e[r]);return t}function cz(e){return e==null?null:y.isValidElement(e)?br(e.props):typeof e=="object"&&!Array.isArray(e)?br(e):null}var uz=["children","width","height","viewBox","className","style","title","desc"];function vx(){return vx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vx.apply(null,arguments)}function dz(e,t){if(e==null)return{};var r,n,i=fz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function fz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var U0=y.forwardRef((e,t)=>{var{children:r,width:n,height:i,viewBox:a,className:s,style:u,title:d,desc:f}=e,h=dz(e,uz),p=a||{width:n,height:i,x:0,y:0},v=He("recharts-surface",s);return y.createElement("svg",vx({},br(h),{className:v,width:n,height:i,style:u,viewBox:"".concat(p.x," ").concat(p.y," ").concat(p.width," ").concat(p.height),ref:t}),y.createElement("title",null,d),y.createElement("desc",null,f),r)}),hz=["children","className"];function gx(){return gx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gx.apply(null,arguments)}function mz(e,t){if(e==null)return{};var r,n,i=pz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function pz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Tt=y.forwardRef((e,t)=>{var{children:r,className:n}=e,i=mz(e,hz),a=He("recharts-layer",n);return y.createElement("g",gx({className:a},br(i),{ref:t}),r)}),iA=y.createContext(null),vz=()=>y.useContext(iA);function vt(e){return function(){return e}}const aA=Math.cos,nh=Math.sin,ci=Math.sqrt,ih=Math.PI,vm=2*ih,yx=Math.PI,xx=2*yx,Wo=1e-6,gz=xx-Wo;function oA(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function yz(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return oA;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;i<a;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}class xz{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?oA:yz(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,i){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,r,n,i,a,s){this._append`C${+t},${+r},${+n},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(t,r,n,i,a){if(t=+t,r=+r,n=+n,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,u=this._y1,d=n-t,f=i-r,h=s-t,p=u-r,v=h*h+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(v>Wo)if(!(Math.abs(p*d-f*h)>Wo)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let g=n-s,j=i-u,b=d*d+f*f,w=g*g+j*j,N=Math.sqrt(b),P=Math.sqrt(v),E=a*Math.tan((yx-Math.acos((b+v-w)/(2*N*P)))/2),k=E/P,C=E/N;Math.abs(k-1)>Wo&&this._append`L${t+k*h},${r+k*p}`,this._append`A${a},${a},0,0,${+(p*g>h*j)},${this._x1=t+C*d},${this._y1=r+C*f}`}}arc(t,r,n,i,a,s){if(t=+t,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(i),d=n*Math.sin(i),f=t+u,h=r+d,p=1^s,v=s?i-a:a-i;this._x1===null?this._append`M${f},${h}`:(Math.abs(this._x1-f)>Wo||Math.abs(this._y1-h)>Wo)&&this._append`L${f},${h}`,n&&(v<0&&(v=v%xx+xx),v>gz?this._append`A${n},${n},0,1,${p},${t-u},${r-d}A${n},${n},0,1,${p},${this._x1=f},${this._y1=h}`:v>Wo&&this._append`A${n},${n},0,${+(v>=yx)},${p},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function K0(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 xz(t)}function q0(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function sA(e){this._context=e}sA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function gm(e){return new sA(e)}function lA(e){return e[0]}function cA(e){return e[1]}function uA(e,t){var r=vt(!0),n=null,i=gm,a=null,s=K0(u);e=typeof e=="function"?e:e===void 0?lA:vt(e),t=typeof t=="function"?t:t===void 0?cA:vt(t);function u(d){var f,h=(d=q0(d)).length,p,v=!1,g;for(n==null&&(a=i(g=s())),f=0;f<=h;++f)!(f<h&&r(p=d[f],f,d))===v&&((v=!v)?a.lineStart():a.lineEnd()),v&&a.point(+e(p,f,d),+t(p,f,d));if(g)return a=null,g+""||null}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:vt(+d),u):e},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:vt(+d),u):t},u.defined=function(d){return arguments.length?(r=typeof d=="function"?d:vt(!!d),u):r},u.curve=function(d){return arguments.length?(i=d,n!=null&&(a=i(n)),u):i},u.context=function(d){return arguments.length?(d==null?n=a=null:a=i(n=d),u):n},u}function df(e,t,r){var n=null,i=vt(!0),a=null,s=gm,u=null,d=K0(f);e=typeof e=="function"?e:e===void 0?lA:vt(+e),t=typeof t=="function"?t:vt(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?cA:vt(+r);function f(p){var v,g,j,b=(p=q0(p)).length,w,N=!1,P,E=new Array(b),k=new Array(b);for(a==null&&(u=s(P=d())),v=0;v<=b;++v){if(!(v<b&&i(w=p[v],v,p))===N)if(N=!N)g=v,u.areaStart(),u.lineStart();else{for(u.lineEnd(),u.lineStart(),j=v-1;j>=g;--j)u.point(E[j],k[j]);u.lineEnd(),u.areaEnd()}N&&(E[v]=+e(w,v,p),k[v]=+t(w,v,p),u.point(n?+n(w,v,p):E[v],r?+r(w,v,p):k[v]))}if(P)return u=null,P+""||null}function h(){return uA().defined(i).curve(s).context(a)}return f.x=function(p){return arguments.length?(e=typeof p=="function"?p:vt(+p),n=null,f):e},f.x0=function(p){return arguments.length?(e=typeof p=="function"?p:vt(+p),f):e},f.x1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:vt(+p),f):n},f.y=function(p){return arguments.length?(t=typeof p=="function"?p:vt(+p),r=null,f):t},f.y0=function(p){return arguments.length?(t=typeof p=="function"?p:vt(+p),f):t},f.y1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:vt(+p),f):r},f.lineX0=f.lineY0=function(){return h().x(e).y(t)},f.lineY1=function(){return h().x(e).y(r)},f.lineX1=function(){return h().x(n).y(t)},f.defined=function(p){return arguments.length?(i=typeof p=="function"?p:vt(!!p),f):i},f.curve=function(p){return arguments.length?(s=p,a!=null&&(u=s(a)),f):s},f.context=function(p){return arguments.length?(p==null?a=u=null:u=s(a=p),f):a},f}class dA{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 bz(e){return new dA(e,!0)}function wz(e){return new dA(e,!1)}const H0={draw(e,t){const r=ci(t/ih);e.moveTo(r,0),e.arc(0,0,r,0,vm)}},jz={draw(e,t){const r=ci(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()}},fA=ci(1/3),Sz=fA*2,Nz={draw(e,t){const r=ci(t/Sz),n=r*fA;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},Pz={draw(e,t){const r=ci(t),n=-r/2;e.rect(n,n,r,r)}},kz=.8908130915292852,hA=nh(ih/10)/nh(7*ih/10),_z=nh(vm/10)*hA,Ez=-aA(vm/10)*hA,Cz={draw(e,t){const r=ci(t*kz),n=_z*r,i=Ez*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const s=vm*a/5,u=aA(s),d=nh(s);e.lineTo(d*r,-u*r),e.lineTo(u*n-d*i,d*n+u*i)}e.closePath()}},mg=ci(3),Oz={draw(e,t){const r=-ci(t/(mg*3));e.moveTo(0,r*2),e.lineTo(-mg*r,-r),e.lineTo(mg*r,-r),e.closePath()}},Cn=-.5,On=ci(3)/2,bx=1/ci(12),Az=(bx/2+1)*3,Tz={draw(e,t){const r=ci(t/Az),n=r/2,i=r*bx,a=n,s=r*bx+r,u=-a,d=s;e.moveTo(n,i),e.lineTo(a,s),e.lineTo(u,d),e.lineTo(Cn*n-On*i,On*n+Cn*i),e.lineTo(Cn*a-On*s,On*a+Cn*s),e.lineTo(Cn*u-On*d,On*u+Cn*d),e.lineTo(Cn*n+On*i,Cn*i-On*n),e.lineTo(Cn*a+On*s,Cn*s-On*a),e.lineTo(Cn*u+On*d,Cn*d-On*u),e.closePath()}};function Mz(e,t){let r=null,n=K0(i);e=typeof e=="function"?e:vt(e||H0),t=typeof t=="function"?t:vt(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:vt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:vt(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function ah(){}function oh(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 mA(e){this._context=e}mA.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:oh(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:oh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Iz(e){return new mA(e)}function pA(e){this._context=e}pA.prototype={areaStart:ah,areaEnd:ah,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:oh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Rz(e){return new pA(e)}function vA(e){this._context=e}vA.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:oh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Dz(e){return new vA(e)}function gA(e){this._context=e}gA.prototype={areaStart:ah,areaEnd:ah,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 Lz(e){return new gA(e)}function fN(e){return e<0?-1:1}function hN(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),s=(r-e._y1)/(i||n<0&&-0),u=(a*i+s*n)/(n+i);return(fN(a)+fN(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(u))||0}function mN(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function pg(e,t,r){var n=e._x0,i=e._y0,a=e._x1,s=e._y1,u=(a-n)/3;e._context.bezierCurveTo(n+u,i+u*t,a-u,s-u*r,a,s)}function sh(e){this._context=e}sh.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:pg(this,this._t0,mN(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,pg(this,mN(this,r=hN(this,e,t)),r);break;default:pg(this,this._t0,r=hN(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function yA(e){this._context=new xA(e)}(yA.prototype=Object.create(sh.prototype)).point=function(e,t){sh.prototype.point.call(this,t,e)};function xA(e){this._context=e}xA.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function $z(e){return new sh(e)}function zz(e){return new yA(e)}function bA(e){this._context=e}bA.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=pN(e),i=pN(t),a=0,s=1;s<r;++a,++s)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],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 pN(e){var t,r=e.length-1,n,i=new Array(r),a=new Array(r),s=new Array(r);for(i[0]=0,a[0]=2,s[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,a[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,a[r-1]=7,s[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/a[t-1],a[t]-=n,s[t]-=n*s[t-1];for(i[r-1]=s[r-1]/a[r-1],t=r-2;t>=0;--t)i[t]=(s[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Fz(e){return new bA(e)}function ym(e,t){this._context=e,this._t=t}ym.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 Bz(e){return new ym(e,.5)}function Wz(e){return new ym(e,0)}function Uz(e){return new ym(e,1)}function ls(e,t){if((s=e.length)>1)for(var r=1,n,i,a=e[t[0]],s,u=a.length;r<s;++r)for(i=a,a=e[t[r]],n=0;n<u;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function wx(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function Kz(e,t){return e[t]}function qz(e){const t=[];return t.key=e,t}function Hz(){var e=vt([]),t=wx,r=ls,n=Kz;function i(a){var s=Array.from(e.apply(this,arguments),qz),u,d=s.length,f=-1,h;for(const p of a)for(u=0,++f;u<d;++u)(s[u][f]=[0,+n(p,s[u].key,f,a)]).data=p;for(u=0,h=q0(t(s));u<d;++u)s[h[u]].index=u;return r(s,h),s}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:vt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(n=typeof a=="function"?a:vt(+a),i):n},i.order=function(a){return arguments.length?(t=a==null?wx:typeof a=="function"?a:vt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(r=a??ls,i):r},i}function Vz(e,t){if((n=e.length)>0){for(var r,n,i=0,a=e[0].length,s;i<a;++i){for(s=r=0;r<n;++r)s+=e[r][i][1]||0;if(s)for(r=0;r<n;++r)e[r][i][1]/=s}ls(e,t)}}function Yz(e,t){if((i=e.length)>0){for(var r=0,n=e[t[0]],i,a=n.length;r<a;++r){for(var s=0,u=0;s<i;++s)u+=e[s][r][1]||0;n[r][1]+=n[r][0]=-u/2}ls(e,t)}}function Gz(e,t){if(!(!((s=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,s;n<a;++n){for(var u=0,d=0,f=0;u<s;++u){for(var h=e[t[u]],p=h[n][1]||0,v=h[n-1][1]||0,g=(p-v)/2,j=0;j<u;++j){var b=e[t[j]],w=b[n][1]||0,N=b[n-1][1]||0;g+=w-N}d+=p,f+=g*p}i[n-1][1]+=i[n-1][0]=r,d&&(r-=f/d)}i[n-1][1]+=i[n-1][0]=r,ls(e,t)}}var vg={},gg={},vN;function Xz(){return vN||(vN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==="__proto__"}e.isUnsafeProperty=t})(gg)),gg}var yg={},gN;function wA(){return gN||(gN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){switch(typeof r){case"number":case"symbol":return!1;case"string":return r.includes(".")||r.includes("[")||r.includes("]")}}e.isDeepKey=t})(yg)),yg}var xg={},yN;function V0(){return yN||(yN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){var n;return typeof r=="string"||typeof r=="symbol"?r:Object.is((n=r==null?void 0:r.valueOf)==null?void 0:n.call(r),-0)?"-0":String(r)}e.toKey=t})(xg)),xg}var bg={},wg={},xN;function Qz(){return xN||(xN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){if(r==null)return"";if(typeof r=="string")return r;if(Array.isArray(r))return r.map(t).join(",");const n=String(r);return n==="0"&&Object.is(Number(r),-0)?"-0":n}e.toString=t})(wg)),wg}var bN;function Y0(){return bN||(bN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Qz(),r=V0();function n(i){if(Array.isArray(i))return i.map(r.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const a=[],s=i.length;if(s===0)return a;let u=0,d="",f="",h=!1;for(i.charCodeAt(0)===46&&(a.push(""),u++);u<s;){const p=i[u];f?p==="\\"&&u+1<s?(u++,d+=i[u]):p===f?f="":d+=p:h?p==='"'||p==="'"?f=p:p==="]"?(h=!1,a.push(d),d=""):d+=p:p==="["?(h=!0,d&&(a.push(d),d="")):p==="."?d&&(a.push(d),d=""):d+=p,u++}return d&&a.push(d),a}e.toPath=n})(bg)),bg}var wN;function G0(){return wN||(wN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Xz(),r=wA(),n=V0(),i=Y0();function a(u,d,f){if(u==null)return f;switch(typeof d){case"string":{if(t.isUnsafeProperty(d))return f;const h=u[d];return h===void 0?r.isDeepKey(d)?a(u,i.toPath(d),f):f:h}case"number":case"symbol":{typeof d=="number"&&(d=n.toKey(d));const h=u[d];return h===void 0?f:h}default:{if(Array.isArray(d))return s(u,d,f);if(Object.is(d==null?void 0:d.valueOf(),-0)?d="-0":d=String(d),t.isUnsafeProperty(d))return f;const h=u[d];return h===void 0?f:h}}}function s(u,d,f){if(d.length===0)return f;let h=u;for(let p=0;p<d.length;p++){if(h==null||t.isUnsafeProperty(d[p]))return f;h=h[d[p]]}return h===void 0?f:h}e.get=a})(vg)),vg}var jg,jN;function Zz(){return jN||(jN=1,jg=G0().get),jg}var Jz=Zz();const cs=li(Jz);var eF=4;function fo(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:eF,r=10**t,n=Math.round(e*r)/r;return Object.is(n,-0)?0:n}function Dt(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return e.reduce((i,a,s)=>{var u=r[s-1];return typeof u=="string"?i+u+a:u!==void 0?i+fo(u)+a:i+a},"")}var fr=e=>e===0?0:e>0?1:-1,Xr=e=>typeof e=="number"&&e!=+e,ya=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,ve=e=>(typeof e=="number"||e instanceof Number)&&!Xr(e),$n=e=>ve(e)||typeof e=="string",tF=0,Gc=e=>{var t=++tF;return"".concat(e||"").concat(t)},_r=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ve(t)&&typeof t!="string")return n;var a;if(ya(t)){if(r==null)return n;var s=t.indexOf("%");a=r*parseFloat(t.slice(0,s))/100}else a=+t;return Xr(a)&&(a=n),i&&r!=null&&a>r&&(a=r),a},jA=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;n<t;n++)if(!r[String(e[n])])r[String(e[n])]=!0;else return!0;return!1};function it(e,t,r){return ve(e)&&ve(t)?fo(e+r*(t-e)):t}function SA(e,t,r){if(!(!e||!e.length))return e.find(n=>n&&(typeof t=="function"?t(n):cs(n,t))===r)}var wt=e=>e===null||typeof e>"u",ju=e=>wt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function rF(e){return e!=null}function Su(){}var nF=["type","size","sizeType"];function jx(){return jx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jx.apply(null,arguments)}function SN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function NN(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?SN(Object(r),!0).forEach(function(n){iF(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):SN(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function iF(e,t,r){return(t=aF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aF(e){var t=oF(e,"string");return typeof t=="symbol"?t:t+""}function oF(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sF(e,t){if(e==null)return{};var r,n,i=lF(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function lF(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var NA={symbolCircle:H0,symbolCross:jz,symbolDiamond:Nz,symbolSquare:Pz,symbolStar:Cz,symbolTriangle:Oz,symbolWye:Tz},cF=Math.PI/180,uF=e=>{var t="symbol".concat(ju(e));return NA[t]||H0},dF=(e,t,r)=>{if(t==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var n=18*cF;return 1.25*e*e*(Math.tan(n)-Math.tan(n*2)*Math.tan(n)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},fF=(e,t)=>{NA["symbol".concat(ju(e))]=t},X0=e=>{var{type:t="circle",size:r=64,sizeType:n="area"}=e,i=sF(e,nF),a=NN(NN({},i),{},{type:t,size:r,sizeType:n}),s="circle";typeof t=="string"&&(s=t);var u=()=>{var v=uF(s),g=Mz().type(v).size(dF(r,n,s)),j=g();if(j!==null)return j},{className:d,cx:f,cy:h}=a,p=br(a);return ve(f)&&ve(h)&&ve(r)?y.createElement("path",jx({},p,{className:He("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(h,")"),d:u()})):null};X0.registerSymbol=fF;var PA=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,Q0=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(y.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(i=>{W0(i)&&(n[i]=(a=>r[i](r,a)))}),n},hF=(e,t,r)=>n=>(e(t,r,n),null),Nu=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var n=null;return Object.keys(e).forEach(i=>{var a=e[i];W0(i)&&typeof a=="function"&&(n||(n={}),n[i]=hF(a,t,r))}),n};function PN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function mF(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?PN(Object(r),!0).forEach(function(n){pF(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):PN(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pF(e,t,r){return(t=vF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vF(e){var t=gF(e,"string");return typeof t=="symbol"?t:t+""}function gF(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Mt(e,t){var r=mF({},e),n=t,i=Object.keys(t),a=i.reduce((s,u)=>(s[u]===void 0&&n[u]!==void 0&&(s[u]=n[u]),s),r);return a}function lh(){return lh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lh.apply(null,arguments)}function kN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function yF(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kN(Object(r),!0).forEach(function(n){xF(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kN(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xF(e,t,r){return(t=bF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bF(e){var t=wF(e,"string");return typeof t=="symbol"?t:t+""}function wF(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Tn=32,jF={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle"};function SF(e){var{data:t,iconType:r,inactiveColor:n}=e,i=Tn/2,a=Tn/6,s=Tn/3,u=t.inactive?n:t.color,d=r??t.type;if(d==="none")return null;if(d==="plainline"){var f;return y.createElement("line",{strokeWidth:4,fill:"none",stroke:u,strokeDasharray:(f=t.payload)===null||f===void 0?void 0:f.strokeDasharray,x1:0,y1:i,x2:Tn,y2:i,className:"recharts-legend-icon"})}if(d==="line")return y.createElement("path",{strokeWidth:4,fill:"none",stroke:u,d:"M0,".concat(i,"h").concat(s,`
57
+ A`).concat(a,",").concat(a,",0,1,1,").concat(2*s,",").concat(i,`
58
+ H`).concat(Tn,"M").concat(2*s,",").concat(i,`
59
+ A`).concat(a,",").concat(a,",0,1,1,").concat(s,",").concat(i),className:"recharts-legend-icon"});if(d==="rect")return y.createElement("path",{stroke:"none",fill:u,d:"M0,".concat(Tn/8,"h").concat(Tn,"v").concat(Tn*3/4,"h").concat(-Tn,"z"),className:"recharts-legend-icon"});if(y.isValidElement(t.legendIcon)){var h=yF({},t);return delete h.legendIcon,y.cloneElement(t.legendIcon,h)}return y.createElement(X0,{fill:u,cx:i,cy:i,size:Tn,sizeType:"diameter",type:d})}function NF(e){var{payload:t,iconSize:r,layout:n,formatter:i,inactiveColor:a,iconType:s}=e,u={x:0,y:0,width:Tn,height:Tn},d={display:n==="horizontal"?"inline-block":"block",marginRight:10},f={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((h,p)=>{var v=h.formatter||i,g=He({"recharts-legend-item":!0,["legend-item-".concat(p)]:!0,inactive:h.inactive});if(h.type==="none")return null;var j=h.inactive?a:h.color,b=v?v(h.value,h,p):h.value;return y.createElement("li",lh({className:g,style:d,key:"legend-item-".concat(p)},Nu(e,h,p)),y.createElement(U0,{width:r,height:r,viewBox:u,style:f,"aria-label":"".concat(b," legend icon")},y.createElement(SF,{data:h,iconType:s,inactiveColor:a})),y.createElement("span",{className:"recharts-legend-item-text",style:{color:j}},b))})}var PF=e=>{var t=Mt(e,jF),{payload:r,layout:n,align:i}=t;if(!r||!r.length)return null;var a={padding:0,margin:0,textAlign:n==="horizontal"?i:"left"};return y.createElement("ul",{className:"recharts-default-legend",style:a},y.createElement(NF,lh({},t,{payload:r})))},Sg={},Ng={},_N;function kF(){return _N||(_N=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){const i=new Map;for(let a=0;a<r.length;a++){const s=r[a],u=n(s);i.has(u)||i.set(u,s)}return Array.from(i.values())}e.uniqBy=t})(Ng)),Ng}var Pg={},EN;function kA(){return EN||(EN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r}e.identity=t})(Pg)),Pg}var kg={},_g={},Eg={},CN;function _F(){return CN||(CN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Number.isSafeInteger(r)&&r>=0}e.isLength=t})(Eg)),Eg}var ON;function Z0(){return ON||(ON=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_F();function r(n){return n!=null&&typeof n!="function"&&t.isLength(n.length)}e.isArrayLike=r})(_g)),_g}var Cg={},AN;function EF(){return AN||(AN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="object"&&r!==null}e.isObjectLike=t})(Cg)),Cg}var TN;function CF(){return TN||(TN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Z0(),r=EF();function n(i){return r.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=n})(kg)),kg}var Og={},Ag={},MN;function OF(){return MN||(MN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=G0();function r(n){return function(i){return t.get(i,n)}}e.property=r})(Ag)),Ag}var Tg={},Mg={},Ig={},Rg={},IN;function _A(){return IN||(IN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r!==null&&(typeof r=="object"||typeof r=="function")}e.isObject=t})(Rg)),Rg}var Dg={},RN;function EA(){return RN||(RN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null||typeof r!="object"&&typeof r!="function"}e.isPrimitive=t})(Dg)),Dg}var Lg={},DN;function CA(){return DN||(DN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){return r===n||Number.isNaN(r)&&Number.isNaN(n)}e.eq=t})(Lg)),Lg}var LN;function AF(){return LN||(LN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_A(),r=EA(),n=CA();function i(h,p,v){return typeof v!="function"?i(h,p,()=>{}):a(h,p,function g(j,b,w,N,P,E){const k=v(j,b,w,N,P,E);return k!==void 0?!!k:a(j,b,g,E)},new Map)}function a(h,p,v,g){if(p===h)return!0;switch(typeof p){case"object":return s(h,p,v,g);case"function":return Object.keys(p).length>0?a(h,{...p},v,g):n.eq(h,p);default:return t.isObject(h)?typeof p=="string"?p==="":!0:n.eq(h,p)}}function s(h,p,v,g){if(p==null)return!0;if(Array.isArray(p))return d(h,p,v,g);if(p instanceof Map)return u(h,p,v,g);if(p instanceof Set)return f(h,p,v,g);const j=Object.keys(p);if(h==null||r.isPrimitive(h))return j.length===0;if(j.length===0)return!0;if(g!=null&&g.has(p))return g.get(p)===h;g==null||g.set(p,h);try{for(let b=0;b<j.length;b++){const w=j[b];if(!r.isPrimitive(h)&&!(w in h)||p[w]===void 0&&h[w]!==void 0||p[w]===null&&h[w]!==null||!v(h[w],p[w],w,h,p,g))return!1}return!0}finally{g==null||g.delete(p)}}function u(h,p,v,g){if(p.size===0)return!0;if(!(h instanceof Map))return!1;for(const[j,b]of p.entries()){const w=h.get(j);if(v(w,b,j,h,p,g)===!1)return!1}return!0}function d(h,p,v,g){if(p.length===0)return!0;if(!Array.isArray(h))return!1;const j=new Set;for(let b=0;b<p.length;b++){const w=p[b];let N=!1;for(let P=0;P<h.length;P++){if(j.has(P))continue;const E=h[P];let k=!1;if(v(E,w,b,h,p,g)&&(k=!0),k){j.add(P),N=!0;break}}if(!N)return!1}return!0}function f(h,p,v,g){return p.size===0?!0:h instanceof Set?d([...h],[...p],v,g):!1}e.isMatchWith=i,e.isSetMatch=f})(Ig)),Ig}var $N;function OA(){return $N||($N=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=AF();function r(n,i){return t.isMatchWith(n,i,()=>{})}e.isMatch=r})(Mg)),Mg}var $g={},zg={},Fg={},zN;function TF(){return zN||(zN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Object.getOwnPropertySymbols(r).filter(n=>Object.prototype.propertyIsEnumerable.call(r,n))}e.getSymbols=t})(Fg)),Fg}var Bg={},FN;function AA(){return FN||(FN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(r)}e.getTag=t})(Bg)),Bg}var Wg={},BN;function TA(){return BN||(BN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",r="[object String]",n="[object Number]",i="[object Boolean]",a="[object Arguments]",s="[object Symbol]",u="[object Date]",d="[object Map]",f="[object Set]",h="[object Array]",p="[object Function]",v="[object ArrayBuffer]",g="[object Object]",j="[object Error]",b="[object DataView]",w="[object Uint8Array]",N="[object Uint8ClampedArray]",P="[object Uint16Array]",E="[object Uint32Array]",k="[object BigUint64Array]",C="[object Int8Array]",T="[object Int16Array]",A="[object Int32Array]",M="[object BigInt64Array]",z="[object Float32Array]",V="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=v,e.arrayTag=h,e.bigInt64ArrayTag=M,e.bigUint64ArrayTag=k,e.booleanTag=i,e.dataViewTag=b,e.dateTag=u,e.errorTag=j,e.float32ArrayTag=z,e.float64ArrayTag=V,e.functionTag=p,e.int16ArrayTag=T,e.int32ArrayTag=A,e.int8ArrayTag=C,e.mapTag=d,e.numberTag=n,e.objectTag=g,e.regexpTag=t,e.setTag=f,e.stringTag=r,e.symbolTag=s,e.uint16ArrayTag=P,e.uint32ArrayTag=E,e.uint8ArrayTag=w,e.uint8ClampedArrayTag=N})(Wg)),Wg}var Ug={},WN;function MF(){return WN||(WN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}e.isTypedArray=t})(Ug)),Ug}var UN;function MA(){return UN||(UN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=TF(),r=AA(),n=TA(),i=EA(),a=MF();function s(h,p){return u(h,void 0,h,new Map,p)}function u(h,p,v,g=new Map,j=void 0){const b=j==null?void 0:j(h,p,v,g);if(b!==void 0)return b;if(i.isPrimitive(h))return h;if(g.has(h))return g.get(h);if(Array.isArray(h)){const w=new Array(h.length);g.set(h,w);for(let N=0;N<h.length;N++)w[N]=u(h[N],N,v,g,j);return Object.hasOwn(h,"index")&&(w.index=h.index),Object.hasOwn(h,"input")&&(w.input=h.input),w}if(h instanceof Date)return new Date(h.getTime());if(h instanceof RegExp){const w=new RegExp(h.source,h.flags);return w.lastIndex=h.lastIndex,w}if(h instanceof Map){const w=new Map;g.set(h,w);for(const[N,P]of h)w.set(N,u(P,N,v,g,j));return w}if(h instanceof Set){const w=new Set;g.set(h,w);for(const N of h)w.add(u(N,void 0,v,g,j));return w}if(typeof Buffer<"u"&&Buffer.isBuffer(h))return h.subarray();if(a.isTypedArray(h)){const w=new(Object.getPrototypeOf(h)).constructor(h.length);g.set(h,w);for(let N=0;N<h.length;N++)w[N]=u(h[N],N,v,g,j);return w}if(h instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&h instanceof SharedArrayBuffer)return h.slice(0);if(h instanceof DataView){const w=new DataView(h.buffer.slice(0),h.byteOffset,h.byteLength);return g.set(h,w),d(w,h,v,g,j),w}if(typeof File<"u"&&h instanceof File){const w=new File([h],h.name,{type:h.type});return g.set(h,w),d(w,h,v,g,j),w}if(typeof Blob<"u"&&h instanceof Blob){const w=new Blob([h],{type:h.type});return g.set(h,w),d(w,h,v,g,j),w}if(h instanceof Error){const w=new h.constructor;return g.set(h,w),w.message=h.message,w.name=h.name,w.stack=h.stack,w.cause=h.cause,d(w,h,v,g,j),w}if(h instanceof Boolean){const w=new Boolean(h.valueOf());return g.set(h,w),d(w,h,v,g,j),w}if(h instanceof Number){const w=new Number(h.valueOf());return g.set(h,w),d(w,h,v,g,j),w}if(h instanceof String){const w=new String(h.valueOf());return g.set(h,w),d(w,h,v,g,j),w}if(typeof h=="object"&&f(h)){const w=Object.create(Object.getPrototypeOf(h));return g.set(h,w),d(w,h,v,g,j),w}return h}function d(h,p,v=h,g,j){const b=[...Object.keys(p),...t.getSymbols(p)];for(let w=0;w<b.length;w++){const N=b[w],P=Object.getOwnPropertyDescriptor(h,N);(P==null||P.writable)&&(h[N]=u(p[N],N,v,g,j))}}function f(h){switch(r.getTag(h)){case n.argumentsTag:case n.arrayTag:case n.arrayBufferTag:case n.dataViewTag:case n.booleanTag:case n.dateTag:case n.float32ArrayTag:case n.float64ArrayTag:case n.int8ArrayTag:case n.int16ArrayTag:case n.int32ArrayTag:case n.mapTag:case n.numberTag:case n.objectTag:case n.regexpTag:case n.setTag:case n.stringTag:case n.symbolTag:case n.uint8ArrayTag:case n.uint8ClampedArrayTag:case n.uint16ArrayTag:case n.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=s,e.cloneDeepWithImpl=u,e.copyProperties=d})(zg)),zg}var KN;function IF(){return KN||(KN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=MA();function r(n){return t.cloneDeepWithImpl(n,void 0,n,new Map,void 0)}e.cloneDeep=r})($g)),$g}var qN;function RF(){return qN||(qN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=OA(),r=IF();function n(i){return i=r.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=n})(Tg)),Tg}var Kg={},qg={},Hg={},HN;function DF(){return HN||(HN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=MA(),r=TA();function n(i,a){return t.cloneDeepWith(i,(s,u,d,f)=>{const h=a==null?void 0:a(s,u,d,f);if(h!==void 0)return h;if(typeof i=="object")switch(Object.prototype.toString.call(i)){case r.numberTag:case r.stringTag:case r.booleanTag:{const p=new i.constructor(i==null?void 0:i.valueOf());return t.copyProperties(p,i),p}case r.argumentsTag:{const p={};return t.copyProperties(p,i),p.length=i.length,p[Symbol.iterator]=i[Symbol.iterator],p}default:return}})}e.cloneDeepWith=n})(Hg)),Hg}var VN;function LF(){return VN||(VN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=DF();function r(n){return t.cloneDeepWith(n)}e.cloneDeep=r})(qg)),qg}var Vg={},Yg={},YN;function IA(){return YN||(YN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function r(n,i=Number.MAX_SAFE_INTEGER){switch(typeof n){case"number":return Number.isInteger(n)&&n>=0&&n<i;case"symbol":return!1;case"string":return t.test(n)}}e.isIndex=r})(Yg)),Yg}var Gg={},GN;function $F(){return GN||(GN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=AA();function r(n){return n!==null&&typeof n=="object"&&t.getTag(n)==="[object Arguments]"}e.isArguments=r})(Gg)),Gg}var XN;function zF(){return XN||(XN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wA(),r=IA(),n=$F(),i=Y0();function a(s,u){let d;if(Array.isArray(u)?d=u:typeof u=="string"&&t.isDeepKey(u)&&(s==null?void 0:s[u])==null?d=i.toPath(u):d=[u],d.length===0)return!1;let f=s;for(let h=0;h<d.length;h++){const p=d[h];if((f==null||!Object.hasOwn(f,p))&&!((Array.isArray(f)||n.isArguments(f))&&r.isIndex(p)&&p<f.length))return!1;f=f[p]}return!0}e.has=a})(Vg)),Vg}var QN;function FF(){return QN||(QN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=OA(),r=V0(),n=LF(),i=G0(),a=zF();function s(u,d){switch(typeof u){case"object":{Object.is(u==null?void 0:u.valueOf(),-0)&&(u="-0");break}case"number":{u=r.toKey(u);break}}return d=n.cloneDeep(d),function(f){const h=i.get(f,u);return h===void 0?a.has(f,u):d===void 0?h===void 0:t.isMatch(h,d)}}e.matchesProperty=s})(Kg)),Kg}var ZN;function BF(){return ZN||(ZN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kA(),r=OF(),n=RF(),i=FF();function a(s){if(s==null)return t.identity;switch(typeof s){case"function":return s;case"object":return Array.isArray(s)&&s.length===2?i.matchesProperty(s[0],s[1]):n.matches(s);case"string":case"symbol":case"number":return r.property(s)}}e.iteratee=a})(Og)),Og}var JN;function WF(){return JN||(JN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kF(),r=kA(),n=CF(),i=BF();function a(s,u=r.identity){return n.isArrayLikeObject(s)?t.uniqBy(Array.from(s),i.iteratee(u)):[]}e.uniqBy=a})(Sg)),Sg}var Xg,eP;function UF(){return eP||(eP=1,Xg=WF().uniqBy),Xg}var KF=UF();const tP=li(KF);function RA(e,t,r){return t===!0?tP(e,r):typeof t=="function"?tP(e,t):e}var Qg={exports:{}},Zg={},Jg={exports:{}},ey={};/**
60
+ * @license React
61
+ * use-sync-external-store-shim.production.js
62
+ *
63
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
64
+ *
65
+ * This source code is licensed under the MIT license found in the
66
+ * LICENSE file in the root directory of this source tree.
67
+ */var rP;function qF(){if(rP)return ey;rP=1;var e=bl();function t(p,v){return p===v&&(p!==0||1/p===1/v)||p!==p&&v!==v}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,i=e.useEffect,a=e.useLayoutEffect,s=e.useDebugValue;function u(p,v){var g=v(),j=n({inst:{value:g,getSnapshot:v}}),b=j[0].inst,w=j[1];return a(function(){b.value=g,b.getSnapshot=v,d(b)&&w({inst:b})},[p,g,v]),i(function(){return d(b)&&w({inst:b}),p(function(){d(b)&&w({inst:b})})},[p]),s(g),g}function d(p){var v=p.getSnapshot;p=p.value;try{var g=v();return!r(p,g)}catch{return!0}}function f(p,v){return v()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return ey.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,ey}var nP;function HF(){return nP||(nP=1,Jg.exports=qF()),Jg.exports}/**
68
+ * @license React
69
+ * use-sync-external-store-shim/with-selector.production.js
70
+ *
71
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
72
+ *
73
+ * This source code is licensed under the MIT license found in the
74
+ * LICENSE file in the root directory of this source tree.
75
+ */var iP;function VF(){if(iP)return Zg;iP=1;var e=bl(),t=HF();function r(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var n=typeof Object.is=="function"?Object.is:r,i=t.useSyncExternalStore,a=e.useRef,s=e.useEffect,u=e.useMemo,d=e.useDebugValue;return Zg.useSyncExternalStoreWithSelector=function(f,h,p,v,g){var j=a(null);if(j.current===null){var b={hasValue:!1,value:null};j.current=b}else b=j.current;j=u(function(){function N(T){if(!P){if(P=!0,E=T,T=v(T),g!==void 0&&b.hasValue){var A=b.value;if(g(A,T))return k=A}return k=T}if(A=k,n(E,T))return A;var M=v(T);return g!==void 0&&g(A,M)?(E=T,A):(E=T,k=M)}var P=!1,E,k,C=p===void 0?null:p;return[function(){return N(h())},C===null?void 0:function(){return N(C())}]},[h,p,v,g]);var w=i(f,j[0],j[1]);return s(function(){b.hasValue=!0,b.value=w},[w]),d(w),w},Zg}var aP;function YF(){return aP||(aP=1,Qg.exports=VF()),Qg.exports}var GF=YF(),J0=y.createContext(null),XF=e=>e,ht=()=>{var e=y.useContext(J0);return e?e.store.dispatch:XF},Wf=()=>{},QF=()=>Wf,ZF=(e,t)=>e===t;function xe(e){var t=y.useContext(J0);return GF.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:QF,t?t.store.getState:Wf,t?t.store.getState:Wf,t?e:Wf,ZF)}function JF(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function eB(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function tB(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var oP=e=>Array.isArray(e)?e:[e];function rB(e){const t=Array.isArray(e[0])?e[0]:e;return tB(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function nB(e,t){const r=[],{length:n}=e;for(let i=0;i<n;i++)r.push(e[i].apply(null,t));return r}var iB=class{constructor(e){this.value=e}deref(){return this.value}},aB=typeof WeakRef<"u"?WeakRef:iB,oB=0,sP=1;function ff(){return{s:oB,v:void 0,o:null,p:null}}function DA(e,t={}){let r=ff();const{resultEqualityCheck:n}=t;let i,a=0;function s(){var p;let u=r;const{length:d}=arguments;for(let v=0,g=d;v<g;v++){const j=arguments[v];if(typeof j=="function"||typeof j=="object"&&j!==null){let b=u.o;b===null&&(u.o=b=new WeakMap);const w=b.get(j);w===void 0?(u=ff(),b.set(j,u)):u=w}else{let b=u.p;b===null&&(u.p=b=new Map);const w=b.get(j);w===void 0?(u=ff(),b.set(j,u)):u=w}}const f=u;let h;if(u.s===sP)h=u.v;else if(h=e.apply(null,arguments),a++,n){const v=((p=i==null?void 0:i.deref)==null?void 0:p.call(i))??i;v!=null&&n(v,h)&&(h=v,a!==0&&a--),i=typeof h=="object"&&h!==null||typeof h=="function"?new aB(h):h}return f.s=sP,f.v=h,h}return s.clearCache=()=>{r=ff(),s.resetResultsCount()},s.resultsCount=()=>a,s.resetResultsCount=()=>{a=0},s}function sB(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...i)=>{let a=0,s=0,u,d={},f=i.pop();typeof f=="object"&&(d=f,f=i.pop()),JF(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const h={...r,...d},{memoize:p,memoizeOptions:v=[],argsMemoize:g=DA,argsMemoizeOptions:j=[]}=h,b=oP(v),w=oP(j),N=rB(i),P=p(function(){return a++,f.apply(null,arguments)},...b),E=g(function(){s++;const C=nB(N,arguments);return u=P.apply(null,C),u},...w);return Object.assign(E,{resultFunc:f,memoizedResultFunc:P,dependencies:N,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>u,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:p,argsMemoize:g})};return Object.assign(n,{withTypes:()=>n}),n}var Q=sB(DA),lB=Object.assign((e,t=Q)=>{eB(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const r=Object.keys(e),n=r.map(a=>e[a]);return t(n,(...a)=>a.reduce((s,u,d)=>(s[r[d]]=u,s),{}))},{withTypes:()=>lB}),ty={},ry={},ny={},lP;function cB(){return lP||(lP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"?1:n===null?2:n===void 0?3:n!==n?4:0}const r=(n,i,a)=>{if(n!==i){const s=t(n),u=t(i);if(s===u&&s===0){if(n<i)return a==="desc"?1:-1;if(n>i)return a==="desc"?-1:1}return a==="desc"?u-s:s-u}return 0};e.compareValues=r})(ny)),ny}var iy={},ay={},cP;function LA(){return cP||(cP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"||r instanceof Symbol}e.isSymbol=t})(ay)),ay}var uP;function uB(){return uP||(uP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=LA(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(a,s){return Array.isArray(a)?!1:typeof a=="number"||typeof a=="boolean"||a==null||t.isSymbol(a)?!0:typeof a=="string"&&(n.test(a)||!r.test(a))||s!=null&&Object.hasOwn(s,a)}e.isKey=i})(iy)),iy}var dP;function dB(){return dP||(dP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=cB(),r=uB(),n=Y0();function i(a,s,u,d){if(a==null)return[];u=d?void 0:u,Array.isArray(a)||(a=Object.values(a)),Array.isArray(s)||(s=s==null?[null]:[s]),s.length===0&&(s=[null]),Array.isArray(u)||(u=u==null?[]:[u]),u=u.map(g=>String(g));const f=(g,j)=>{let b=g;for(let w=0;w<j.length&&b!=null;++w)b=b[j[w]];return b},h=(g,j)=>j==null||g==null?j:typeof g=="object"&&"key"in g?Object.hasOwn(j,g.key)?j[g.key]:f(j,g.path):typeof g=="function"?g(j):Array.isArray(g)?f(j,g):typeof j=="object"?j[g]:j,p=s.map(g=>(Array.isArray(g)&&g.length===1&&(g=g[0]),g==null||typeof g=="function"||Array.isArray(g)||r.isKey(g)?g:{key:g,path:n.toPath(g)}));return a.map(g=>({original:g,criteria:p.map(j=>h(j,g))})).slice().sort((g,j)=>{for(let b=0;b<p.length;b++){const w=t.compareValues(g.criteria[b],j.criteria[b],u[b]);if(w!==0)return w}return 0}).map(g=>g.original)}e.orderBy=i})(ry)),ry}var oy={},fP;function fB(){return fP||(fP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n=1){const i=[],a=Math.floor(n),s=(u,d)=>{for(let f=0;f<u.length;f++){const h=u[f];Array.isArray(h)&&d<a?s(h,d+1):i.push(h)}};return s(r,0),i}e.flatten=t})(oy)),oy}var sy={},hP;function $A(){return hP||(hP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=IA(),r=Z0(),n=_A(),i=CA();function a(s,u,d){return n.isObject(d)&&(typeof u=="number"&&r.isArrayLike(d)&&t.isIndex(u)&&u<d.length||typeof u=="string"&&u in d)?i.eq(d[u],s):!1}e.isIterateeCall=a})(sy)),sy}var mP;function hB(){return mP||(mP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=dB(),r=fB(),n=$A();function i(a,...s){const u=s.length;return u>1&&n.isIterateeCall(a,s[0],s[1])?s=[]:u>2&&n.isIterateeCall(s[0],s[1],s[2])&&(s=[s[0]]),t.orderBy(a,r.flatten(s),["asc"])}e.sortBy=i})(ty)),ty}var ly,pP;function mB(){return pP||(pP=1,ly=hB().sortBy),ly}var pB=mB();const xm=li(pB);var zA=e=>e.legend.settings,vB=e=>e.legend.size,gB=e=>e.legend.payload,yB=Q([gB,zA],(e,t)=>{var{itemSorter:r}=t,n=e.flat(1);return r?xm(n,r):n});function xB(){return xe(yB)}var hf=1;function FA(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,r]=y.useState({height:0,left:0,top:0,width:0}),n=y.useCallback(i=>{if(i!=null){var a=i.getBoundingClientRect(),s={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(s.height-t.height)>hf||Math.abs(s.left-t.left)>hf||Math.abs(s.top-t.top)>hf||Math.abs(s.width-t.width)>hf)&&r({height:s.height,left:s.left,top:s.top,width:s.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,n]}function gr(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var bB=typeof Symbol=="function"&&Symbol.observable||"@@observable",vP=bB,cy=()=>Math.random().toString(36).substring(7).split("").join("."),wB={INIT:`@@redux/INIT${cy()}`,REPLACE:`@@redux/REPLACE${cy()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${cy()}`},ch=wB;function eb(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function BA(e,t,r){if(typeof e!="function")throw new Error(gr(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(gr(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(gr(1));return r(BA)(e,t)}let n=e,i=t,a=new Map,s=a,u=0,d=!1;function f(){s===a&&(s=new Map,a.forEach((w,N)=>{s.set(N,w)}))}function h(){if(d)throw new Error(gr(3));return i}function p(w){if(typeof w!="function")throw new Error(gr(4));if(d)throw new Error(gr(5));let N=!0;f();const P=u++;return s.set(P,w),function(){if(N){if(d)throw new Error(gr(6));N=!1,f(),s.delete(P),a=null}}}function v(w){if(!eb(w))throw new Error(gr(7));if(typeof w.type>"u")throw new Error(gr(8));if(typeof w.type!="string")throw new Error(gr(17));if(d)throw new Error(gr(9));try{d=!0,i=n(i,w)}finally{d=!1}return(a=s).forEach(P=>{P()}),w}function g(w){if(typeof w!="function")throw new Error(gr(10));n=w,v({type:ch.REPLACE})}function j(){const w=p;return{subscribe(N){if(typeof N!="object"||N===null)throw new Error(gr(11));function P(){const k=N;k.next&&k.next(h())}return P(),{unsubscribe:w(P)}},[vP](){return this}}}return v({type:ch.INIT}),{dispatch:v,subscribe:p,getState:h,replaceReducer:g,[vP]:j}}function jB(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:ch.INIT})>"u")throw new Error(gr(12));if(typeof r(void 0,{type:ch.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(gr(13))})}function WA(e){const t=Object.keys(e),r={};for(let a=0;a<t.length;a++){const s=t[a];typeof e[s]=="function"&&(r[s]=e[s])}const n=Object.keys(r);let i;try{jB(r)}catch(a){i=a}return function(s={},u){if(i)throw i;let d=!1;const f={};for(let h=0;h<n.length;h++){const p=n[h],v=r[p],g=s[p],j=v(g,u);if(typeof j>"u")throw u&&u.type,new Error(gr(14));f[p]=j,d=d||j!==g}return d=d||n.length!==Object.keys(s).length,d?f:s}}function uh(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function SB(...e){return t=>(r,n)=>{const i=t(r,n);let a=()=>{throw new Error(gr(15))};const s={getState:i.getState,dispatch:(d,...f)=>a(d,...f)},u=e.map(d=>d(s));return a=uh(...u)(i.dispatch),{...i,dispatch:a}}}function UA(e){return eb(e)&&"type"in e&&typeof e.type=="string"}var KA=Symbol.for("immer-nothing"),gP=Symbol.for("immer-draftable"),Dr=Symbol.for("immer-state");function ei(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var fn=Object,dl=fn.getPrototypeOf,dh="constructor",bm="prototype",Sx="configurable",fh="enumerable",Uf="writable",Xc="value",xa=e=>!!e&&!!e[Dr];function si(e){var t;return e?qA(e)||jm(e)||!!e[gP]||!!((t=e[dh])!=null&&t[gP])||Sm(e)||Nm(e):!1}var NB=fn[bm][dh].toString(),yP=new WeakMap;function qA(e){if(!e||!tb(e))return!1;const t=dl(e);if(t===null||t===fn[bm])return!0;const r=fn.hasOwnProperty.call(t,dh)&&t[dh];if(r===Object)return!0;if(!Zs(r))return!1;let n=yP.get(r);return n===void 0&&(n=Function.toString.call(r),yP.set(r,n)),n===NB}function wm(e,t,r=!0){Pu(e)===0?(r?Reflect.ownKeys(e):fn.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((n,i)=>t(i,n,e))}function Pu(e){const t=e[Dr];return t?t.type_:jm(e)?1:Sm(e)?2:Nm(e)?3:0}var xP=(e,t,r=Pu(e))=>r===2?e.has(t):fn[bm].hasOwnProperty.call(e,t),Nx=(e,t,r=Pu(e))=>r===2?e.get(t):e[t],hh=(e,t,r,n=Pu(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function PB(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var jm=Array.isArray,Sm=e=>e instanceof Map,Nm=e=>e instanceof Set,tb=e=>typeof e=="object",Zs=e=>typeof e=="function",uy=e=>typeof e=="boolean";function kB(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var sa=e=>e.copy_||e.base_,rb=e=>e.modified_?e.copy_:e.base_;function Px(e,t){if(Sm(e))return new Map(e);if(Nm(e))return new Set(e);if(jm(e))return Array[bm].slice.call(e);const r=qA(e);if(t===!0||t==="class_only"&&!r){const n=fn.getOwnPropertyDescriptors(e);delete n[Dr];let i=Reflect.ownKeys(n);for(let a=0;a<i.length;a++){const s=i[a],u=n[s];u[Uf]===!1&&(u[Uf]=!0,u[Sx]=!0),(u.get||u.set)&&(n[s]={[Sx]:!0,[Uf]:!0,[fh]:u[fh],[Xc]:e[s]})}return fn.create(dl(e),n)}else{const n=dl(e);if(n!==null&&r)return{...e};const i=fn.create(n);return fn.assign(i,e)}}function nb(e,t=!1){return Pm(e)||xa(e)||!si(e)||(Pu(e)>1&&fn.defineProperties(e,{set:mf,add:mf,clear:mf,delete:mf}),fn.freeze(e),t&&wm(e,(r,n)=>{nb(n,!0)},!1)),e}function _B(){ei(2)}var mf={[Xc]:_B};function Pm(e){return e===null||!tb(e)?!0:fn.isFrozen(e)}var mh="MapSet",kx="Patches",bP="ArrayMethods",HA={};function us(e){const t=HA[e];return t||ei(0,e),t}var wP=e=>!!HA[e],Qc,VA=()=>Qc,EB=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:wP(mh)?us(mh):void 0,arrayMethodsPlugin_:wP(bP)?us(bP):void 0});function jP(e,t){t&&(e.patchPlugin_=us(kx),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function _x(e){Ex(e),e.drafts_.forEach(CB),e.drafts_=null}function Ex(e){e===Qc&&(Qc=e.parent_)}var SP=e=>Qc=EB(Qc,e);function CB(e){const t=e[Dr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function NP(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[Dr].modified_&&(_x(t),ei(4)),si(e)&&(e=PP(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(r[Dr].base_,e,t)}else e=PP(t,r);return OB(t,e,!0),_x(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==KA?e:void 0}function PP(e,t){if(Pm(t))return t;const r=t[Dr];if(!r)return ph(t,e.handledSet_,e);if(!km(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);XA(r,e)}return r.copy_}function OB(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&nb(t,r)}function YA(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var km=(e,t)=>e.scope_===t,AB=[];function GA(e,t,r,n){const i=sa(e),a=e.type_;if(n!==void 0&&Nx(i,n,a)===t){hh(i,n,r,a);return}if(!e.draftLocations_){const u=e.draftLocations_=new Map;wm(i,(d,f)=>{if(xa(f)){const h=u.get(f)||[];h.push(d),u.set(f,h)}})}const s=e.draftLocations_.get(t)??AB;for(const u of s)hh(i,u,r,a)}function TB(e,t,r){e.callbacks_.push(function(i){var u;const a=t;if(!a||!km(a,i))return;(u=i.mapSetPlugin_)==null||u.fixSetContents(a);const s=rb(a);GA(e,a.draft_??a,s,r),XA(a,i)})}function XA(e,t){var n;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((n=e.assigned_)==null?void 0:n.size)??0)>0)){const{patchPlugin_:i}=t;if(i){const a=i.getPath(e);a&&i.generatePatches_(e,a,t)}YA(e)}}function MB(e,t,r){const{scope_:n}=e;if(xa(r)){const i=r[Dr];km(i,n)&&i.callbacks_.push(function(){Kf(e);const s=rb(i);GA(e,r,s,t)})}else si(r)&&e.callbacks_.push(function(){const a=sa(e);e.type_===3?a.has(r)&&ph(r,n.handledSet_,n):Nx(a,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&ph(Nx(e.copy_,t,e.type_),n.handledSet_,n)})}function ph(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||xa(e)||t.has(e)||!si(e)||Pm(e)||(t.add(e),wm(e,(n,i)=>{if(xa(i)){const a=i[Dr];if(km(a,r)){const s=rb(a);hh(e,n,s,e.type_),YA(a)}}else si(i)&&ph(i,t,r)})),e}function IB(e,t){const r=jm(e),n={type_:r?1:0,scope_:t?t.scope_:VA(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=n,a=vh;r&&(i=[n],a=Zc);const{revoke:s,proxy:u}=Proxy.revocable(i,a);return n.draft_=u,n.revoke_=s,[u,n]}var vh={get(e,t){if(t===Dr)return e;let r=e.scope_.arrayMethodsPlugin_;const n=e.type_===1&&typeof t=="string";if(n&&r!=null&&r.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);const i=sa(e);if(!xP(i,t,e.type_))return RB(e,i,t);const a=i[t];if(e.finalized_||!si(a)||n&&e.operationMethod&&(r!=null&&r.isMutatingArrayMethod(e.operationMethod))&&kB(t))return a;if(a===dy(e.base_,t)){Kf(e);const s=e.type_===1?+t:t,u=Ox(e.scope_,a,e,s);return e.copy_[s]=u}return a},has(e,t){return t in sa(e)},ownKeys(e){return Reflect.ownKeys(sa(e))},set(e,t,r){const n=QA(sa(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const i=dy(sa(e),t),a=i==null?void 0:i[Dr];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(PB(r,i)&&(r!==void 0||xP(e.base_,t,e.type_)))return!0;Kf(e),Cx(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),MB(e,t,r)),!0},deleteProperty(e,t){return Kf(e),dy(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Cx(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=sa(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[Uf]:!0,[Sx]:e.type_!==1||t!=="length",[fh]:n[fh],[Xc]:r[t]}},defineProperty(){ei(11)},getPrototypeOf(e){return dl(e.base_)},setPrototypeOf(){ei(12)}},Zc={};for(let e in vh){let t=vh[e];Zc[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}Zc.deleteProperty=function(e,t){return Zc.set.call(this,e,t,void 0)};Zc.set=function(e,t,r){return vh.set.call(this,e[0],t,r,e[0])};function dy(e,t){const r=e[Dr];return(r?sa(r):e)[t]}function RB(e,t,r){var i;const n=QA(t,r);return n?Xc in n?n[Xc]:(i=n.get)==null?void 0:i.call(e.draft_):void 0}function QA(e,t){if(!(t in e))return;let r=dl(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=dl(r)}}function Cx(e){e.modified_||(e.modified_=!0,e.parent_&&Cx(e.parent_))}function Kf(e){e.copy_||(e.assigned_=new Map,e.copy_=Px(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var DB=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(r,n,i)=>{if(Zs(r)&&!Zs(n)){const s=n;n=r;const u=this;return function(f=s,...h){return u.produce(f,p=>n.call(this,p,...h))}}Zs(n)||ei(6),i!==void 0&&!Zs(i)&&ei(7);let a;if(si(r)){const s=SP(this),u=Ox(s,r,void 0);let d=!0;try{a=n(u),d=!1}finally{d?_x(s):Ex(s)}return jP(s,i),NP(a,s)}else if(!r||!tb(r)){if(a=n(r),a===void 0&&(a=r),a===KA&&(a=void 0),this.autoFreeze_&&nb(a,!0),i){const s=[],u=[];us(kx).generateReplacementPatches_(r,a,{patches_:s,inversePatches_:u}),i(s,u)}return a}else ei(1,r)},this.produceWithPatches=(r,n)=>{if(Zs(r))return(u,...d)=>this.produceWithPatches(u,f=>r(f,...d));let i,a;return[this.produce(r,n,(u,d)=>{i=u,a=d}),i,a]},uy(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),uy(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),uy(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){si(t)||ei(8),xa(t)&&(t=ii(t));const r=SP(this),n=Ox(r,t,void 0);return n[Dr].isManual_=!0,Ex(r),n}finishDraft(t,r){const n=t&&t[Dr];(!n||!n.isManual_)&&ei(9);const{scope_:i}=n;return jP(i,r),NP(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,r){let n;for(n=r.length-1;n>=0;n--){const a=r[n];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}n>-1&&(r=r.slice(n+1));const i=us(kx).applyPatches_;return xa(t)?i(t,r):this.produce(t,a=>i(a,r))}};function Ox(e,t,r,n){const[i,a]=Sm(t)?us(mh).proxyMap_(t,r):Nm(t)?us(mh).proxySet_(t,r):IB(t,r);return((r==null?void 0:r.scope_)??VA()).drafts_.push(i),a.callbacks_=(r==null?void 0:r.callbacks_)??[],a.key_=n,r&&n!==void 0?TB(r,a,n):a.callbacks_.push(function(d){var h;(h=d.mapSetPlugin_)==null||h.fixSetContents(a);const{patchPlugin_:f}=d;a.modified_&&f&&f.generatePatches_(a,[],d)}),i}function ii(e){return xa(e)||ei(10,e),ZA(e)}function ZA(e){if(!si(e)||Pm(e))return e;const t=e[Dr];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Px(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Px(e,!0);return wm(r,(i,a)=>{hh(r,i,ZA(a))},n),t&&(t.finalized_=!1),r}var LB=new DB,JA=LB.produce;function e2(e){return({dispatch:r,getState:n})=>i=>a=>typeof a=="function"?a(r,n,e):i(a)}var $B=e2(),zB=e2,FB=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?uh:uh.apply(null,arguments)};function zn(e,t){function r(...n){if(t){let i=t(...n);if(!i)throw new Error(vn(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>UA(n)&&n.type===e,r}var t2=class Fc extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Fc.prototype)}static get[Symbol.species](){return Fc}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Fc(...t[0].concat(this)):new Fc(...t.concat(this))}};function kP(e){return si(e)?JA(e,()=>{}):e}function pf(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function BB(e){return typeof e=="boolean"}var WB=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let s=new t2;return r&&(BB(r)?s.push($B):s.push(zB(r.extraArgument))),s},r2="RTK_autoBatch",Nt=()=>e=>({payload:e,meta:{[r2]:!0}}),_P=e=>t=>{setTimeout(t,e)},n2=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let i=!0,a=!1,s=!1;const u=new Set,d=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:_P(10):e.type==="callback"?e.queueNotification:_P(e.timeout),f=()=>{s=!1,a&&(a=!1,u.forEach(h=>h()))};return Object.assign({},n,{subscribe(h){const p=()=>i&&h(),v=n.subscribe(p);return u.add(h),()=>{v(),u.delete(h)}},dispatch(h){var p;try{return i=!((p=h==null?void 0:h.meta)!=null&&p[r2]),a=!i,a&&(s||(s=!0,d(f))),n.dispatch(h)}finally{i=!0}}})},UB=e=>function(r){const{autoBatch:n=!0}=r??{};let i=new t2(e);return n&&i.push(n2(typeof n=="object"?n:void 0)),i};function KB(e){const t=WB(),{reducer:r=void 0,middleware:n,devTools:i=!0,preloadedState:a=void 0,enhancers:s=void 0}=e||{};let u;if(typeof r=="function")u=r;else if(eb(r))u=WA(r);else throw new Error(vn(1));let d;typeof n=="function"?d=n(t):d=t();let f=uh;i&&(f=FB({trace:!1,...typeof i=="object"&&i}));const h=SB(...d),p=UB(h);let v=typeof s=="function"?s(p):p();const g=f(...v);return BA(u,a,g)}function i2(e){const t={},r=[];let n;const i={addCase(a,s){const u=typeof a=="string"?a:a.type;if(!u)throw new Error(vn(28));if(u in t)throw new Error(vn(29));return t[u]=s,i},addAsyncThunk(a,s){return s.pending&&(t[a.pending.type]=s.pending),s.rejected&&(t[a.rejected.type]=s.rejected),s.fulfilled&&(t[a.fulfilled.type]=s.fulfilled),s.settled&&r.push({matcher:a.settled,reducer:s.settled}),i},addMatcher(a,s){return r.push({matcher:a,reducer:s}),i},addDefaultCase(a){return n=a,i}};return e(i),[t,r,n]}function qB(e){return typeof e=="function"}function HB(e,t){let[r,n,i]=i2(t),a;if(qB(e))a=()=>kP(e());else{const u=kP(e);a=()=>u}function s(u=a(),d){let f=[r[d.type],...n.filter(({matcher:h})=>h(d)).map(({reducer:h})=>h)];return f.filter(h=>!!h).length===0&&(f=[i]),f.reduce((h,p)=>{if(p)if(xa(h)){const g=p(h,d);return g===void 0?h:g}else{if(si(h))return JA(h,v=>p(v,d));{const v=p(h,d);if(v===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return v}}return h},u)}return s.getInitialState=a,s}var VB="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",YB=(e=21)=>{let t="",r=e;for(;r--;)t+=VB[Math.random()*64|0];return t},GB=Symbol.for("rtk-slice-createasyncthunk");function XB(e,t){return`${e}/${t}`}function QB({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[GB];return function(i){const{name:a,reducerPath:s=a}=i;if(!a)throw new Error(vn(11));const u=(typeof i.reducers=="function"?i.reducers(JB()):i.reducers)||{},d=Object.keys(u),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},h={addCase(k,C){const T=typeof k=="string"?k:k.type;if(!T)throw new Error(vn(12));if(T in f.sliceCaseReducersByType)throw new Error(vn(13));return f.sliceCaseReducersByType[T]=C,h},addMatcher(k,C){return f.sliceMatchers.push({matcher:k,reducer:C}),h},exposeAction(k,C){return f.actionCreators[k]=C,h},exposeCaseReducer(k,C){return f.sliceCaseReducersByName[k]=C,h}};d.forEach(k=>{const C=u[k],T={reducerName:k,type:XB(a,k),createNotation:typeof i.reducers=="function"};t6(C)?n6(T,C,h,t):e6(T,C,h)});function p(){const[k={},C=[],T=void 0]=typeof i.extraReducers=="function"?i2(i.extraReducers):[i.extraReducers],A={...k,...f.sliceCaseReducersByType};return HB(i.initialState,M=>{for(let z in A)M.addCase(z,A[z]);for(let z of f.sliceMatchers)M.addMatcher(z.matcher,z.reducer);for(let z of C)M.addMatcher(z.matcher,z.reducer);T&&M.addDefaultCase(T)})}const v=k=>k,g=new Map,j=new WeakMap;let b;function w(k,C){return b||(b=p()),b(k,C)}function N(){return b||(b=p()),b.getInitialState()}function P(k,C=!1){function T(M){let z=M[k];return typeof z>"u"&&C&&(z=pf(j,T,N)),z}function A(M=v){const z=pf(g,C,()=>new WeakMap);return pf(z,M,()=>{const V={};for(const[L,K]of Object.entries(i.selectors??{}))V[L]=ZB(K,M,()=>pf(j,M,N),C);return V})}return{reducerPath:k,getSelectors:A,get selectors(){return A(T)},selectSlice:T}}const E={name:a,reducer:w,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:N,...P(s),injectInto(k,{reducerPath:C,...T}={}){const A=C??s;return k.inject({reducerPath:A,reducer:w},T),{...E,...P(A,!0)}}};return E}}function ZB(e,t,r,n){function i(a,...s){let u=t(a);return typeof u>"u"&&n&&(u=r()),e(u,...s)}return i.unwrapped=e,i}var Zr=QB();function JB(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function e6({type:e,reducerName:t,createNotation:r},n,i){let a,s;if("reducer"in n){if(r&&!r6(n))throw new Error(vn(17));a=n.reducer,s=n.prepare}else a=n;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,s?zn(e,s):zn(e))}function t6(e){return e._reducerDefinitionType==="asyncThunk"}function r6(e){return e._reducerDefinitionType==="reducerWithPrepare"}function n6({type:e,reducerName:t},r,n,i){if(!i)throw new Error(vn(18));const{payloadCreator:a,fulfilled:s,pending:u,rejected:d,settled:f,options:h}=r,p=i(e,a,h);n.exposeAction(t,p),s&&n.addCase(p.fulfilled,s),u&&n.addCase(p.pending,u),d&&n.addCase(p.rejected,d),f&&n.addMatcher(p.settled,f),n.exposeCaseReducer(t,{fulfilled:s||vf,pending:u||vf,rejected:d||vf,settled:f||vf})}function vf(){}var i6="task",a2="listener",o2="completed",ib="cancelled",a6=`task-${ib}`,o6=`task-${o2}`,Ax=`${a2}-${ib}`,s6=`${a2}-${o2}`,_m=class{constructor(e){Fo(this,"name","TaskAbortError");Fo(this,"message");this.code=e,this.message=`${i6} ${ib} (reason: ${e})`}},ab=(e,t)=>{if(typeof e!="function")throw new TypeError(vn(32))},gh=()=>{},s2=(e,t=gh)=>(e.catch(t),e),l2=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Jo=e=>{if(e.aborted)throw new _m(e.reason)};function c2(e,t){let r=gh;return new Promise((n,i)=>{const a=()=>i(new _m(e.reason));if(e.aborted){a();return}r=l2(e,a),t.finally(()=>r()).then(n,i)}).finally(()=>{r=gh})}var l6=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof _m?"cancelled":"rejected",error:r}}finally{t==null||t()}},yh=e=>t=>s2(c2(e,t).then(r=>(Jo(e),r))),u2=e=>{const t=yh(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:nl}=Object,EP={},Em="listenerMiddleware",c6=(e,t)=>{const r=n=>l2(e,()=>n.abort(e.reason));return(n,i)=>{ab(n);const a=new AbortController;r(a);const s=l6(async()=>{Jo(e),Jo(a.signal);const u=await n({pause:yh(a.signal),delay:u2(a.signal),signal:a.signal});return Jo(a.signal),u},()=>a.abort(o6));return i!=null&&i.autoJoin&&t.push(s.catch(gh)),{result:yh(e)(s),cancel(){a.abort(a6)}}}},u6=(e,t)=>{const r=async(n,i)=>{Jo(t);let a=()=>{};const u=[new Promise((d,f)=>{let h=e({predicate:n,effect:(p,v)=>{v.unsubscribe(),d([p,v.getState(),v.getOriginalState()])}});a=()=>{h(),f()}})];i!=null&&u.push(new Promise(d=>setTimeout(d,i,null)));try{const d=await c2(t,Promise.race(u));return Jo(t),d}finally{a()}};return(n,i)=>s2(r(n,i))},d2=e=>{let{type:t,actionCreator:r,matcher:n,predicate:i,effect:a}=e;if(t)i=zn(t).match;else if(r)t=r.type,i=r.match;else if(n)i=n;else if(!i)throw new Error(vn(21));return ab(a),{predicate:i,type:t,effect:a}},f2=nl(e=>{const{type:t,predicate:r,effect:n}=d2(e);return{id:YB(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(vn(22))}}},{withTypes:()=>f2}),CP=(e,t)=>{const{type:r,effect:n,predicate:i}=d2(t);return Array.from(e.values()).find(a=>(typeof r=="string"?a.type===r:a.predicate===i)&&a.effect===n)},Tx=e=>{e.pending.forEach(t=>{t.abort(Ax)})},d6=(e,t)=>()=>{for(const r of t.keys())Tx(r);e.clear()},OP=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},h2=nl(zn(`${Em}/add`),{withTypes:()=>h2}),f6=zn(`${Em}/removeAll`),m2=nl(zn(`${Em}/remove`),{withTypes:()=>m2}),h6=(...e)=>{console.error(`${Em}/error`,...e)},ku=(e={})=>{const t=new Map,r=new Map,n=g=>{const j=r.get(g)??0;r.set(g,j+1)},i=g=>{const j=r.get(g)??1;j===1?r.delete(g):r.set(g,j-1)},{extra:a,onError:s=h6}=e;ab(s);const u=g=>(g.unsubscribe=()=>t.delete(g.id),t.set(g.id,g),j=>{g.unsubscribe(),j!=null&&j.cancelActive&&Tx(g)}),d=g=>{const j=CP(t,g)??f2(g);return u(j)};nl(d,{withTypes:()=>d});const f=g=>{const j=CP(t,g);return j&&(j.unsubscribe(),g.cancelActive&&Tx(j)),!!j};nl(f,{withTypes:()=>f});const h=async(g,j,b,w)=>{const N=new AbortController,P=u6(d,N.signal),E=[];try{g.pending.add(N),n(g),await Promise.resolve(g.effect(j,nl({},b,{getOriginalState:w,condition:(k,C)=>P(k,C).then(Boolean),take:P,delay:u2(N.signal),pause:yh(N.signal),extra:a,signal:N.signal,fork:c6(N.signal,E),unsubscribe:g.unsubscribe,subscribe:()=>{t.set(g.id,g)},cancelActiveListeners:()=>{g.pending.forEach((k,C,T)=>{k!==N&&(k.abort(Ax),T.delete(k))})},cancel:()=>{N.abort(Ax),g.pending.delete(N)},throwIfCancelled:()=>{Jo(N.signal)}})))}catch(k){k instanceof _m||OP(s,k,{raisedBy:"effect"})}finally{await Promise.all(E),N.abort(s6),i(g),g.pending.delete(N)}},p=d6(t,r);return{middleware:g=>j=>b=>{if(!UA(b))return j(b);if(h2.match(b))return d(b.payload);if(f6.match(b)){p();return}if(m2.match(b))return f(b.payload);let w=g.getState();const N=()=>{if(w===EP)throw new Error(vn(23));return w};let P;try{if(P=j(b),t.size>0){const E=g.getState(),k=Array.from(t.values());for(const C of k){let T=!1;try{T=C.predicate(b,E,w)}catch(A){T=!1,OP(s,A,{raisedBy:"predicate"})}T&&h(C,b,g,N)}}}finally{w=EP}return P},startListening:d,stopListening:f,clearListeners:p}};function vn(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var m6={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},p2=Zr({name:"chartLayout",initialState:m6,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var r,n,i,a;e.margin.top=(r=t.payload.top)!==null&&r!==void 0?r:0,e.margin.right=(n=t.payload.right)!==null&&n!==void 0?n:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(a=t.payload.left)!==null&&a!==void 0?a:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:p6,setLayout:v6,setChartSize:g6,setScale:y6}=p2.actions,x6=p2.reducer;function v2(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function nt(e){return Number.isFinite(e)}function _i(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function AP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Js(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?AP(Object(r),!0).forEach(function(n){b6(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):AP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function b6(e,t,r){return(t=w6(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w6(e){var t=j6(e,"string");return typeof t=="symbol"?t:t+""}function j6(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function at(e,t,r){return wt(e)||wt(t)?r:$n(t)?cs(e,t,r):typeof t=="function"?t(e):r}var S6=(e,t,r)=>{if(t&&r){var{width:n,height:i}=r,{align:a,verticalAlign:s,layout:u}=t;if((u==="vertical"||u==="horizontal"&&s==="middle")&&a!=="center"&&ve(e[a]))return Js(Js({},e),{},{[a]:e[a]+(n||0)});if((u==="horizontal"||u==="vertical"&&a==="center")&&s!=="middle"&&ve(e[s]))return Js(Js({},e),{},{[s]:e[s]+(i||0)})}return e},Ri=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",g2=(e,t,r,n)=>{if(n)return e.map(u=>u.coordinate);var i,a,s=e.map(u=>(u.coordinate===t&&(i=!0),u.coordinate===r&&(a=!0),u.coordinate));return i||s.push(t),a||s.push(r),s},y2=(e,t,r)=>{if(!e)return null;var{duplicateDomain:n,type:i,range:a,scale:s,realScaleType:u,isCategorical:d,categoricalDomain:f,tickCount:h,ticks:p,niceTicks:v,axisType:g}=e;if(!s)return null;var j=u==="scaleBand"&&s.bandwidth?s.bandwidth()/2:2,b=i==="category"&&s.bandwidth?s.bandwidth()/j:0;if(b=g==="angleAxis"&&a&&a.length>=2?fr(a[0]-a[1])*2*b:b,p||v){var w=(p||v||[]).map((N,P)=>{var E=n?n.indexOf(N):N;return{coordinate:s(E)+b,value:N,offset:b,index:P}});return w.filter(N=>!Xr(N.coordinate))}return d&&f?f.map((N,P)=>({coordinate:s(N)+b,value:N,index:P,offset:b})):s.ticks&&h!=null?s.ticks(h).map((N,P)=>({coordinate:s(N)+b,value:N,offset:b,index:P})):s.domain().map((N,P)=>({coordinate:s(N)+b,value:n?n[N]:N,index:P,offset:b}))},TP=1e-4,N6=e=>{var t=e.domain();if(!(!t||t.length<=2)){var r=t.length,n=e.range(),i=Math.min(n[0],n[1])-TP,a=Math.max(n[0],n[1])+TP,s=e(t[0]),u=e(t[r-1]);(s<i||s>a||u<i||u>a)&&e.domain([t[0],t[r-1]])}},P6=(e,t)=>{if(!t||t.length!==2||!ve(t[0])||!ve(t[1]))return e;var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!ve(e[0])||e[0]<r)&&(i[0]=r),(!ve(e[1])||e[1]>n)&&(i[1]=n),i[0]>n&&(i[0]=n),i[1]<r&&(i[1]=r),i},k6=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var i=0;i<n;++i)for(var a=0,s=0,u=0;u<r;++u){var d=e[u],f=d==null?void 0:d[i];if(f!=null){var h=f[1],p=f[0],v=Xr(h)?p:h;v>=0?(f[0]=a,f[1]=a+v,a=h):(f[0]=s,f[1]=s+v,s=h)}}}},_6=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var i=0;i<n;++i)for(var a=0,s=0;s<r;++s){var u=e[s],d=u==null?void 0:u[i];if(d!=null){var f=Xr(d[1])?d[0]:d[1];f>=0?(d[0]=a,d[1]=a+f,a=d[1]):(d[0]=0,d[1]=0)}}}},E6={sign:k6,expand:Vz,none:ls,silhouette:Yz,wiggle:Gz,positive:_6},C6=(e,t,r)=>{var n,i=(n=E6[r])!==null&&n!==void 0?n:ls,a=Hz().keys(t).value((u,d)=>Number(at(u,d,0))).order(wx).offset(i),s=a(e);return s.forEach((u,d)=>{u.forEach((f,h)=>{var p=at(e[h],t[d],0);Array.isArray(p)&&p.length===2&&ve(p[0])&&ve(p[1])&&(f[0]=p[0],f[1]=p[1])})}),s};function x2(e){return e==null?void 0:String(e)}function xh(e){var{axis:t,ticks:r,bandSize:n,entry:i,index:a,dataKey:s}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!wt(i[t.dataKey])){var u=SA(r,"value",i[t.dataKey]);if(u)return u.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var d=at(i,wt(s)?t.dataKey:s);return wt(d)?null:t.scale(d)}var MP=e=>{var{axis:t,ticks:r,offset:n,bandSize:i,entry:a,index:s}=e;if(t.type==="category")return r[s]?r[s].coordinate+n:null;var u=at(a,t.dataKey,t.scale.domain()[s]);return wt(u)?null:t.scale(u)-i/2+n},O6=e=>{var{numericAxis:t}=e,r=t.scale.domain();if(t.type==="number"){var n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return n<=0&&i>=0?0:i<0?i:n}return r[0]},A6=e=>{var t=e.flat(2).filter(ve);return[Math.min(...t),Math.max(...t)]},T6=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],M6=(e,t,r)=>{if(e!=null)return T6(Object.keys(e).reduce((n,i)=>{var a=e[i];if(!a)return n;var{stackedData:s}=a,u=s.reduce((d,f)=>{var h=v2(f,t,r),p=A6(h);return!nt(p[0])||!nt(p[1])?d:[Math.min(d[0],p[0]),Math.max(d[1],p[1])]},[1/0,-1/0]);return[Math.min(u[0],n[0]),Math.max(u[1],n[1])]},[1/0,-1/0]))},IP=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,RP=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,go=(e,t,r)=>{if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();if(!r||n>0)return n}if(e&&t&&t.length>=2){for(var i=xm(t,h=>h.coordinate),a=1/0,s=1,u=i.length;s<u;s++){var d=i[s],f=i[s-1];a=Math.min(((d==null?void 0:d.coordinate)||0)-((f==null?void 0:f.coordinate)||0),a)}return a===1/0?0:a}return r?void 0:0};function DP(e){var{tooltipEntrySettings:t,dataKey:r,payload:n,value:i,name:a}=e;return Js(Js({},t),{},{dataKey:r,payload:n,value:i,name:a})}function wo(e,t){if(e)return String(e);if(typeof t=="string")return t}var I6=(e,t)=>{if(t==="horizontal")return e.chartX;if(t==="vertical")return e.chartY},R6=(e,t)=>t==="centric"?e.angle:e.radius,Ca=e=>e.layout.width,Oa=e=>e.layout.height,D6=e=>e.layout.scale,b2=e=>e.layout.margin,Cm=Q(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Om=Q(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),w2="data-recharts-item-index",j2="data-recharts-item-id",_u=60;function LP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function gf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?LP(Object(r),!0).forEach(function(n){L6(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):LP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function L6(e,t,r){return(t=$6(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $6(e){var t=z6(e,"string");return typeof t=="symbol"?t:t+""}function z6(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var F6=e=>e.brush.height;function B6(e){var t=Om(e);return t.reduce((r,n)=>{if(n.orientation==="left"&&!n.mirror&&!n.hide){var i=typeof n.width=="number"?n.width:_u;return r+i}return r},0)}function W6(e){var t=Om(e);return t.reduce((r,n)=>{if(n.orientation==="right"&&!n.mirror&&!n.hide){var i=typeof n.width=="number"?n.width:_u;return r+i}return r},0)}function U6(e){var t=Cm(e);return t.reduce((r,n)=>n.orientation==="top"&&!n.mirror&&!n.hide?r+n.height:r,0)}function K6(e){var t=Cm(e);return t.reduce((r,n)=>n.orientation==="bottom"&&!n.mirror&&!n.hide?r+n.height:r,0)}var Jt=Q([Ca,Oa,b2,F6,B6,W6,U6,K6,zA,vB],(e,t,r,n,i,a,s,u,d,f)=>{var h={left:(r.left||0)+i,right:(r.right||0)+a},p={top:(r.top||0)+s,bottom:(r.bottom||0)+u},v=gf(gf({},p),h),g=v.bottom;v.bottom+=n,v=S6(v,d,f);var j=e-v.left-v.right,b=t-v.top-v.bottom;return gf(gf({brushBottom:g},v),{},{width:Math.max(j,0),height:Math.max(b,0)})}),q6=Q(Jt,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),ob=Q(Ca,Oa,(e,t)=>({x:0,y:0,width:e,height:t})),H6=y.createContext(null),er=()=>y.useContext(H6)!=null,Am=e=>e.brush,Tm=Q([Am,Jt,b2],(e,t,r)=>({height:e.height,x:ve(e.x)?e.x:t.left,y:ve(e.y)?e.y:t.top+t.height+t.brushBottom-((r==null?void 0:r.bottom)||0),width:ve(e.width)?e.width:t.width})),fy={},hy={},my={},$P;function V6(){return $P||($P=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n,{signal:i,edges:a}={}){let s,u=null;const d=a!=null&&a.includes("leading"),f=a==null||a.includes("trailing"),h=()=>{u!==null&&(r.apply(s,u),s=void 0,u=null)},p=()=>{f&&h(),b()};let v=null;const g=()=>{v!=null&&clearTimeout(v),v=setTimeout(()=>{v=null,p()},n)},j=()=>{v!==null&&(clearTimeout(v),v=null)},b=()=>{j(),s=void 0,u=null},w=()=>{h()},N=function(...P){if(i!=null&&i.aborted)return;s=this,u=P;const E=v==null;g(),d&&E&&h()};return N.schedule=g,N.cancel=b,N.flush=w,i==null||i.addEventListener("abort",b,{once:!0}),N}e.debounce=t})(my)),my}var zP;function Y6(){return zP||(zP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=V6();function r(n,i=0,a={}){typeof a!="object"&&(a={});const{leading:s=!1,trailing:u=!0,maxWait:d}=a,f=Array(2);s&&(f[0]="leading"),u&&(f[1]="trailing");let h,p=null;const v=t.debounce(function(...b){h=n.apply(this,b),p=null},i,{edges:f}),g=function(...b){return d!=null&&(p===null&&(p=Date.now()),Date.now()-p>=d)?(h=n.apply(this,b),p=Date.now(),v.cancel(),v.schedule(),h):(v.apply(this,b),h)},j=()=>(v.flush(),h);return g.cancel=v.cancel,g.flush=j,g}e.debounce=r})(hy)),hy}var FP;function G6(){return FP||(FP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Y6();function r(n,i=0,a={}){const{leading:s=!0,trailing:u=!0}=a;return t.debounce(n,i,{leading:s,maxWait:i,trailing:u})}e.throttle=r})(fy)),fy}var py,BP;function X6(){return BP||(BP=1,py=G6().throttle),py}var Q6=X6();const Z6=li(Q6);var bh=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a];if(typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=0;console.warn(r.replace(/%s/g,()=>i[s++]))}},S2=(e,t,r)=>{var{width:n="100%",height:i="100%",aspect:a,maxHeight:s}=r,u=ya(n)?e:Number(n),d=ya(i)?t:Number(i);return a&&a>0&&(u?d=u/a:d&&(u=d*a),s&&d!=null&&d>s&&(d=s)),{calculatedWidth:u,calculatedHeight:d}},J6={width:0,height:0,overflow:"visible"},e8={width:0,overflowX:"visible"},t8={height:0,overflowY:"visible"},r8={},n8=e=>{var{width:t,height:r}=e,n=ya(t),i=ya(r);return n&&i?J6:n?e8:i?t8:r8};function i8(e){var{width:t,height:r,aspect:n}=e,i=t,a=r;return i===void 0&&a===void 0?(i="100%",a="100%"):i===void 0?i=n&&n>0?void 0:"100%":a===void 0&&(a=n&&n>0?void 0:"100%"),{width:i,height:a}}function Mx(){return Mx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mx.apply(null,arguments)}function WP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function UP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?WP(Object(r),!0).forEach(function(n){a8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):WP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function a8(e,t,r){return(t=o8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o8(e){var t=s8(e,"string");return typeof t=="symbol"?t:t+""}function s8(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var N2=y.createContext({width:-1,height:-1});function l8(e){return _i(e.width)&&_i(e.height)}function P2(e){var{children:t,width:r,height:n}=e,i=y.useMemo(()=>({width:r,height:n}),[r,n]);return l8(i)?y.createElement(N2.Provider,{value:i},t):null}var sb=()=>y.useContext(N2),c8=y.forwardRef((e,t)=>{var{aspect:r,initialDimension:n={width:-1,height:-1},width:i,height:a,minWidth:s=0,minHeight:u,maxHeight:d,children:f,debounce:h=0,id:p,className:v,onResize:g,style:j={}}=e,b=y.useRef(null),w=y.useRef();w.current=g,y.useImperativeHandle(t,()=>b.current);var[N,P]=y.useState({containerWidth:n.width,containerHeight:n.height}),E=y.useCallback((M,z)=>{P(V=>{var L=Math.round(M),K=Math.round(z);return V.containerWidth===L&&V.containerHeight===K?V:{containerWidth:L,containerHeight:K}})},[]);y.useEffect(()=>{if(b.current==null||typeof ResizeObserver>"u")return Su;var M=K=>{var te,{width:R,height:U}=K[0].contentRect;E(R,U),(te=w.current)===null||te===void 0||te.call(w,R,U)};h>0&&(M=Z6(M,h,{trailing:!0,leading:!1}));var z=new ResizeObserver(M),{width:V,height:L}=b.current.getBoundingClientRect();return E(V,L),z.observe(b.current),()=>{z.disconnect()}},[E,h]);var{containerWidth:k,containerHeight:C}=N;bh(!r||r>0,"The aspect(%s) must be greater than zero.",r);var{calculatedWidth:T,calculatedHeight:A}=S2(k,C,{width:i,height:a,aspect:r,maxHeight:d});return bh(T!=null&&T>0||A!=null&&A>0,`The width(%s) and height(%s) of chart should be greater than 0,
76
+ please check the style of container, or the props width(%s) and height(%s),
77
+ or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
78
+ height and width.`,T,A,i,a,s,u,r),y.createElement("div",{id:p?"".concat(p):void 0,className:He("recharts-responsive-container",v),style:UP(UP({},j),{},{width:i,height:a,minWidth:s,minHeight:u,maxHeight:d}),ref:b},y.createElement("div",{style:n8({width:i,height:a})},y.createElement(P2,{width:T,height:A},f)))}),hn=y.forwardRef((e,t)=>{var r=sb();if(_i(r.width)&&_i(r.height))return e.children;var{width:n,height:i}=i8({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:s}=S2(void 0,void 0,{width:n,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return ve(a)&&ve(s)?y.createElement(P2,{width:a,height:s},e.children):y.createElement(c8,Mx({},e,{width:n,height:i,ref:t}))});function k2(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var Eu=()=>{var e,t=er(),r=xe(q6),n=xe(Tm),i=(e=xe(Am))===null||e===void 0?void 0:e.padding;return!t||!n||!i?r:{width:n.width-i.left-i.right,height:n.height-i.top-i.bottom,x:i.left,y:i.top}},u8={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},_2=()=>{var e;return(e=xe(Jt))!==null&&e!==void 0?e:u8},lb=()=>xe(Ca),cb=()=>xe(Oa),d8=()=>xe(e=>e.layout.margin),qe=e=>e.layout.layoutType,jo=()=>xe(qe),f8=()=>{var e=jo();if(e==="horizontal"||e==="vertical")return e},h8=()=>{var e=jo();return e!==void 0},Mm=e=>{var t=ht(),r=er(),{width:n,height:i}=e,a=sb(),s=n,u=i;return a&&(s=a.width>0?a.width:n,u=a.height>0?a.height:i),y.useEffect(()=>{!r&&_i(s)&&_i(u)&&t(g6({width:s,height:u}))},[t,r,s,u]),null},E2=Symbol.for("immer-nothing"),KP=Symbol.for("immer-draftable"),gn=Symbol.for("immer-state");function ti(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Jc=Object.getPrototypeOf;function fl(e){return!!e&&!!e[gn]}function ds(e){var t;return e?C2(e)||Array.isArray(e)||!!e[KP]||!!((t=e.constructor)!=null&&t[KP])||Cu(e)||Rm(e):!1}var m8=Object.prototype.constructor.toString(),qP=new WeakMap;function C2(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=qP.get(r);return n===void 0&&(n=Function.toString.call(r),qP.set(r,n)),n===m8}function wh(e,t,r=!0){Im(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((n,i)=>t(i,n,e))}function Im(e){const t=e[gn];return t?t.type_:Array.isArray(e)?1:Cu(e)?2:Rm(e)?3:0}function Ix(e,t){return Im(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function O2(e,t,r){const n=Im(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function p8(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Cu(e){return e instanceof Map}function Rm(e){return e instanceof Set}function Uo(e){return e.copy_||e.base_}function Rx(e,t){if(Cu(e))return new Map(e);if(Rm(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=C2(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[gn];let i=Reflect.ownKeys(n);for(let a=0;a<i.length;a++){const s=i[a],u=n[s];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(n[s]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[s]})}return Object.create(Jc(e),n)}else{const n=Jc(e);if(n!==null&&r)return{...e};const i=Object.create(n);return Object.assign(i,e)}}function ub(e,t=!1){return Dm(e)||fl(e)||!ds(e)||(Im(e)>1&&Object.defineProperties(e,{set:yf,add:yf,clear:yf,delete:yf}),Object.freeze(e),t&&Object.values(e).forEach(r=>ub(r,!0))),e}function v8(){ti(2)}var yf={value:v8};function Dm(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var g8={};function fs(e){const t=g8[e];return t||ti(0,e),t}var eu;function A2(){return eu}function y8(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function HP(e,t){t&&(fs("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Dx(e){Lx(e),e.drafts_.forEach(x8),e.drafts_=null}function Lx(e){e===eu&&(eu=e.parent_)}function VP(e){return eu=y8(eu,e)}function x8(e){const t=e[gn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function YP(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[gn].modified_&&(Dx(t),ti(4)),ds(e)&&(e=jh(t,e),t.parent_||Sh(t,e)),t.patches_&&fs("Patches").generateReplacementPatches_(r[gn].base_,e,t.patches_,t.inversePatches_)):e=jh(t,r,[]),Dx(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==E2?e:void 0}function jh(e,t,r){if(Dm(t))return t;const n=e.immer_.shouldUseStrictIteration(),i=t[gn];if(!i)return wh(t,(a,s)=>GP(e,i,t,a,s,r),n),t;if(i.scope_!==e)return t;if(!i.modified_)return Sh(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let s=a,u=!1;i.type_===3&&(s=new Set(a),a.clear(),u=!0),wh(s,(d,f)=>GP(e,i,a,d,f,r,u),n),Sh(e,a,!1),r&&e.patches_&&fs("Patches").generatePatches_(i,r,e.patches_,e.inversePatches_)}return i.copy_}function GP(e,t,r,n,i,a,s){if(i==null||typeof i!="object"&&!s)return;const u=Dm(i);if(!(u&&!s)){if(fl(i)){const d=a&&t&&t.type_!==3&&!Ix(t.assigned_,n)?a.concat(n):void 0,f=jh(e,i,d);if(O2(r,n,f),fl(f))e.canAutoFreeze_=!1;else return}else s&&r.add(i);if(ds(i)&&!u){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===i&&u)return;jh(e,i),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(Cu(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&Sh(e,i)}}}function Sh(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ub(t,r)}function b8(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:A2(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=n,a=db;r&&(i=[n],a=tu);const{revoke:s,proxy:u}=Proxy.revocable(i,a);return n.draft_=u,n.revoke_=s,u}var db={get(e,t){if(t===gn)return e;const r=Uo(e);if(!Ix(r,t))return w8(e,r,t);const n=r[t];return e.finalized_||!ds(n)?n:n===vy(e.base_,t)?(gy(e),e.copy_[t]=zx(n,e)):n},has(e,t){return t in Uo(e)},ownKeys(e){return Reflect.ownKeys(Uo(e))},set(e,t,r){const n=T2(Uo(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const i=vy(Uo(e),t),a=i==null?void 0:i[gn];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(p8(r,i)&&(r!==void 0||Ix(e.base_,t)))return!0;gy(e),$x(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return vy(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,gy(e),$x(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Uo(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){ti(11)},getPrototypeOf(e){return Jc(e.base_)},setPrototypeOf(){ti(12)}},tu={};wh(db,(e,t)=>{tu[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});tu.deleteProperty=function(e,t){return tu.set.call(this,e,t,void 0)};tu.set=function(e,t,r){return db.set.call(this,e[0],t,r,e[0])};function vy(e,t){const r=e[gn];return(r?Uo(r):e)[t]}function w8(e,t,r){var i;const n=T2(t,r);return n?"value"in n?n.value:(i=n.get)==null?void 0:i.call(e.draft_):void 0}function T2(e,t){if(!(t in e))return;let r=Jc(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Jc(r)}}function $x(e){e.modified_||(e.modified_=!0,e.parent_&&$x(e.parent_))}function gy(e){e.copy_||(e.copy_=Rx(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var j8=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const a=r;r=t;const s=this;return function(d=a,...f){return s.produce(d,h=>r.call(this,h,...f))}}typeof r!="function"&&ti(6),n!==void 0&&typeof n!="function"&&ti(7);let i;if(ds(t)){const a=VP(this),s=zx(t,void 0);let u=!0;try{i=r(s),u=!1}finally{u?Dx(a):Lx(a)}return HP(a,n),YP(i,a)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===E2&&(i=void 0),this.autoFreeze_&&ub(i,!0),n){const a=[],s=[];fs("Patches").generateReplacementPatches_(t,i,a,s),n(a,s)}return i}else ti(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(s,...u)=>this.produceWithPatches(s,d=>t(d,...u));let n,i;return[this.produce(t,r,(s,u)=>{n=s,i=u}),n,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){ds(e)||ti(8),fl(e)&&(e=S8(e));const t=VP(this),r=zx(e,void 0);return r[gn].isManual_=!0,Lx(t),r}finishDraft(e,t){const r=e&&e[gn];(!r||!r.isManual_)&&ti(9);const{scope_:n}=r;return HP(n,t),YP(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));const n=fs("Patches").applyPatches_;return fl(e)?n(e,t):this.produce(e,i=>n(i,t))}};function zx(e,t){const r=Cu(e)?fs("MapSet").proxyMap_(e,t):Rm(e)?fs("MapSet").proxySet_(e,t):b8(e,t);return(t?t.scope_:A2()).drafts_.push(r),r}function S8(e){return fl(e)||ti(10,e),M2(e)}function M2(e){if(!ds(e)||Dm(e))return e;const t=e[gn];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Rx(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Rx(e,!0);return wh(r,(i,a)=>{O2(r,i,M2(a))},n),t&&(t.finalized_=!1),r}var N8=new j8;N8.produce;var P8={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},I2=Zr({name:"legend",initialState:P8,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:Nt()},replaceLegendPayload:{reducer(e,t){var{prev:r,next:n}=t.payload,i=ii(e).payload.indexOf(r);i>-1&&(e.payload[i]=n)},prepare:Nt()},removeLegendPayload:{reducer(e,t){var r=ii(e).payload.indexOf(t.payload);r>-1&&e.payload.splice(r,1)},prepare:Nt()}}}),{setLegendSize:XP,setLegendSettings:k8,addLegendPayload:R2,replaceLegendPayload:D2,removeLegendPayload:L2}=I2.actions,_8=I2.reducer,E8=["contextPayload"];function Fx(){return Fx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fx.apply(null,arguments)}function QP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function hl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?QP(Object(r),!0).forEach(function(n){C8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):QP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function C8(e,t,r){return(t=O8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function O8(e){var t=A8(e,"string");return typeof t=="symbol"?t:t+""}function A8(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function T8(e,t){if(e==null)return{};var r,n,i=M8(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function M8(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function I8(e){return e.value}function R8(e){var{contextPayload:t}=e,r=T8(e,E8),n=RA(t,e.payloadUniqBy,I8),i=hl(hl({},r),{},{payload:n});return y.isValidElement(e.content)?y.cloneElement(e.content,i):typeof e.content=="function"?y.createElement(e.content,i):y.createElement(PF,i)}function D8(e,t,r,n,i,a){var{layout:s,align:u,verticalAlign:d}=t,f,h;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(u==="center"&&s==="vertical"?f={left:((n||0)-a.width)/2}:f=u==="right"?{right:r&&r.right||0}:{left:r&&r.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(d==="middle"?h={top:((i||0)-a.height)/2}:h=d==="bottom"?{bottom:r&&r.bottom||0}:{top:r&&r.top||0}),hl(hl({},f),h)}function L8(e){var t=ht();return y.useEffect(()=>{t(k8(e))},[t,e]),null}function $8(e){var t=ht();return y.useEffect(()=>(t(XP(e)),()=>{t(XP({width:0,height:0}))}),[t,e]),null}function z8(e,t,r,n){return e==="vertical"&&ve(t)?{height:t}:e==="horizontal"?{width:r||n}:null}var F8={align:"center",iconSize:14,itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function Nh(e){var t=Mt(e,F8),r=xB(),n=vz(),i=d8(),{width:a,height:s,wrapperStyle:u,portal:d}=t,[f,h]=FA([r]),p=lb(),v=cb();if(p==null||v==null)return null;var g=p-((i==null?void 0:i.left)||0)-((i==null?void 0:i.right)||0),j=z8(t.layout,s,a,g),b=d?u:hl(hl({position:"absolute",width:(j==null?void 0:j.width)||a||"auto",height:(j==null?void 0:j.height)||s||"auto"},D8(u,t,i,p,v,f)),u),w=d??n;if(w==null||r==null)return null;var N=y.createElement("div",{className:"recharts-legend-wrapper",style:b,ref:h},y.createElement(L8,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!d&&y.createElement($8,{width:f.width,height:f.height}),y.createElement(R8,Fx({},t,j,{margin:i,chartWidth:p,chartHeight:v,contextPayload:r})));return I0.createPortal(N,w)}Nh.displayName="Legend";function Bx(){return Bx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bx.apply(null,arguments)}function ZP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function yy(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ZP(Object(r),!0).forEach(function(n){B8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function B8(e,t,r){return(t=W8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function W8(e){var t=U8(e,"string");return typeof t=="symbol"?t:t+""}function U8(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function K8(e){return Array.isArray(e)&&$n(e[0])&&$n(e[1])?e.join(" ~ "):e}var q8=e=>{var{separator:t=" : ",contentStyle:r={},itemStyle:n={},labelStyle:i={},payload:a,formatter:s,itemSorter:u,wrapperClassName:d,labelClassName:f,label:h,labelFormatter:p,accessibilityLayer:v=!1}=e,g=()=>{if(a&&a.length){var C={padding:0,margin:0},T=(u?xm(a,u):a).map((A,M)=>{if(A.type==="none")return null;var z=A.formatter||s||K8,{value:V,name:L}=A,K=V,te=L;if(z){var R=z(V,L,A,M,a);if(Array.isArray(R))[K,te]=R;else if(R!=null)K=R;else return null}var U=yy({display:"block",paddingTop:4,paddingBottom:4,color:A.color||"#000"},n);return y.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(M),style:U},$n(te)?y.createElement("span",{className:"recharts-tooltip-item-name"},te):null,$n(te)?y.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,y.createElement("span",{className:"recharts-tooltip-item-value"},K),y.createElement("span",{className:"recharts-tooltip-item-unit"},A.unit||""))});return y.createElement("ul",{className:"recharts-tooltip-item-list",style:C},T)}return null},j=yy({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},r),b=yy({margin:0},i),w=!wt(h),N=w?h:"",P=He("recharts-default-tooltip",d),E=He("recharts-tooltip-label",f);w&&p&&a!==void 0&&a!==null&&(N=p(h,a));var k=v?{role:"status","aria-live":"assertive"}:{};return y.createElement("div",Bx({className:P,style:j},k),y.createElement("p",{className:E,style:b},y.isValidElement(N)?N:"".concat(N)),g())},kc="recharts-tooltip-wrapper",H8={visibility:"hidden"};function V8(e){var{coordinate:t,translateX:r,translateY:n}=e;return He(kc,{["".concat(kc,"-right")]:ve(r)&&t&&ve(t.x)&&r>=t.x,["".concat(kc,"-left")]:ve(r)&&t&&ve(t.x)&&r<t.x,["".concat(kc,"-bottom")]:ve(n)&&t&&ve(t.y)&&n>=t.y,["".concat(kc,"-top")]:ve(n)&&t&&ve(t.y)&&n<t.y})}function JP(e){var{allowEscapeViewBox:t,coordinate:r,key:n,offsetTopLeft:i,position:a,reverseDirection:s,tooltipDimension:u,viewBox:d,viewBoxDimension:f}=e;if(a&&ve(a[n]))return a[n];var h=r[n]-u-(i>0?i:0),p=r[n]+i;if(t[n])return s[n]?h:p;var v=d[n];if(v==null)return 0;if(s[n]){var g=h,j=v;return g<j?Math.max(p,v):Math.max(h,v)}if(f==null)return 0;var b=p+u,w=v+f;return b>w?Math.max(h,v):Math.max(p,v)}function Y8(e){var{translateX:t,translateY:r,useTranslate3d:n}=e;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function G8(e){var{allowEscapeViewBox:t,coordinate:r,offsetTopLeft:n,position:i,reverseDirection:a,tooltipBox:s,useTranslate3d:u,viewBox:d}=e,f,h,p;return s.height>0&&s.width>0&&r?(h=JP({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:s.width,viewBox:d,viewBoxDimension:d.width}),p=JP({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:s.height,viewBox:d,viewBoxDimension:d.height}),f=Y8({translateX:h,translateY:p,useTranslate3d:u})):f=H8,{cssProperties:f,cssClasses:V8({translateX:h,translateY:p,coordinate:r})}}function ek(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function xf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ek(Object(r),!0).forEach(function(n){Wx(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ek(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Wx(e,t,r){return(t=X8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function X8(e){var t=Q8(e,"string");return typeof t=="symbol"?t:t+""}function Q8(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Z8 extends y.PureComponent{constructor(){super(...arguments),Wx(this,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),Wx(this,"handleKeyDown",t=>{if(t.key==="Escape"){var r,n,i,a;this.setState({dismissed:!0,dismissedAtCoordinate:{x:(r=(n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==null&&r!==void 0?r:0,y:(i=(a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==null&&i!==void 0?i:0}})}})}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}componentDidUpdate(){var t,r;this.state.dismissed&&(((t=this.props.coordinate)===null||t===void 0?void 0:t.x)!==this.state.dismissedAtCoordinate.x||((r=this.props.coordinate)===null||r===void 0?void 0:r.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}render(){var{active:t,allowEscapeViewBox:r,animationDuration:n,animationEasing:i,children:a,coordinate:s,hasPayload:u,isAnimationActive:d,offset:f,position:h,reverseDirection:p,useTranslate3d:v,viewBox:g,wrapperStyle:j,lastBoundingBox:b,innerRef:w,hasPortalFromProps:N}=this.props,{cssClasses:P,cssProperties:E}=G8({allowEscapeViewBox:r,coordinate:s,offsetTopLeft:f,position:h,reverseDirection:p,tooltipBox:{height:b.height,width:b.width},useTranslate3d:v,viewBox:g}),k=N?{}:xf(xf({transition:d&&t?"transform ".concat(n,"ms ").concat(i):void 0},E),{},{pointerEvents:"none",visibility:!this.state.dismissed&&t&&u?"visible":"hidden",position:"absolute",top:0,left:0}),C=xf(xf({},k),{},{visibility:!this.state.dismissed&&t&&u?"visible":"hidden"},j);return y.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:P,style:C,ref:w},a)}}var $2=()=>{var e;return(e=xe(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function Ux(){return Ux=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ux.apply(null,arguments)}function tk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function rk(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?tk(Object(r),!0).forEach(function(n){J8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tk(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function J8(e,t,r){return(t=eW(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eW(e){var t=tW(e,"string");return typeof t=="symbol"?t:t+""}function tW(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var nk={curveBasisClosed:Rz,curveBasisOpen:Dz,curveBasis:Iz,curveBumpX:bz,curveBumpY:wz,curveLinearClosed:Lz,curveLinear:gm,curveMonotoneX:$z,curveMonotoneY:zz,curveNatural:Fz,curveStep:Bz,curveStepAfter:Uz,curveStepBefore:Wz},Ph=e=>nt(e.x)&&nt(e.y),ik=e=>e.base!=null&&Ph(e.base)&&Ph(e),_c=e=>e.x,Ec=e=>e.y,rW=(e,t)=>{if(typeof e=="function")return e;var r="curve".concat(ju(e));return(r==="curveMonotone"||r==="curveBump")&&t?nk["".concat(r).concat(t==="vertical"?"Y":"X")]:nk[r]||gm},nW=e=>{var{type:t="linear",points:r=[],baseLine:n,layout:i,connectNulls:a=!1}=e,s=rW(t,i),u=a?r.filter(Ph):r,d;if(Array.isArray(n)){var f=r.map((g,j)=>rk(rk({},g),{},{base:n[j]}));i==="vertical"?d=df().y(Ec).x1(_c).x0(g=>g.base.x):d=df().x(_c).y1(Ec).y0(g=>g.base.y);var h=d.defined(ik).curve(s),p=a?f.filter(ik):f;return h(p)}i==="vertical"&&ve(n)?d=df().y(Ec).x1(_c).x0(n):ve(n)?d=df().x(_c).y1(Ec).y0(n):d=uA().x(_c).y(Ec);var v=d.defined(Ph).curve(s);return v(u)},il=e=>{var{className:t,points:r,path:n,pathRef:i}=e,a=jo();if((!r||!r.length)&&!n)return null;var s={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},u=r&&r.length?nW(s):n;return y.createElement("path",Ux({},Rr(e),Q0(e),{className:He("recharts-curve",t),d:u===null?void 0:u,ref:i}))},iW=["x","y","top","left","width","height","className"];function Kx(){return Kx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kx.apply(null,arguments)}function ak(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function aW(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ak(Object(r),!0).forEach(function(n){oW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ak(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function oW(e,t,r){return(t=sW(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sW(e){var t=lW(e,"string");return typeof t=="symbol"?t:t+""}function lW(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cW(e,t){if(e==null)return{};var r,n,i=uW(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function uW(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var dW=(e,t,r,n,i,a)=>"M".concat(e,",").concat(i,"v").concat(n,"M").concat(a,",").concat(t,"h").concat(r),fW=e=>{var{x:t=0,y:r=0,top:n=0,left:i=0,width:a=0,height:s=0,className:u}=e,d=cW(e,iW),f=aW({x:t,y:r,top:n,left:i,width:a,height:s},d);return!ve(t)||!ve(r)||!ve(a)||!ve(s)||!ve(n)||!ve(i)?null:y.createElement("path",Kx({},br(f),{className:He("recharts-cross",u),d:dW(t,r,a,s,n,i)}))};function hW(e,t,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-i,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function ok(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function sk(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ok(Object(r),!0).forEach(function(n){mW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ok(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function mW(e,t,r){return(t=pW(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pW(e){var t=vW(e,"string");return typeof t=="symbol"?t:t+""}function vW(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gW=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),z2=(e,t,r)=>e.map(n=>"".concat(gW(n)," ").concat(t,"ms ").concat(r)).join(","),yW=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((r,n)=>r.filter(i=>n.includes(i))),ru=(e,t)=>Object.keys(t).reduce((r,n)=>sk(sk({},r),{},{[n]:e(n,t[n])}),{});function lk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Qt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lk(Object(r),!0).forEach(function(n){xW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lk(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xW(e,t,r){return(t=bW(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bW(e){var t=wW(e,"string");return typeof t=="symbol"?t:t+""}function wW(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var kh=(e,t,r)=>e+(t-e)*r,qx=e=>{var{from:t,to:r}=e;return t!==r},F2=(e,t,r)=>{var n=ru((i,a)=>{if(qx(a)){var[s,u]=e(a.from,a.to,a.velocity);return Qt(Qt({},a),{},{from:s,velocity:u})}return a},t);return r<1?ru((i,a)=>qx(a)&&n[i]!=null?Qt(Qt({},a),{},{velocity:kh(a.velocity,n[i].velocity,r),from:kh(a.from,n[i].from,r)}):a,t):F2(e,n,r-1)};function jW(e,t,r,n,i,a){var s,u=n.reduce((v,g)=>Qt(Qt({},v),{},{[g]:{from:e[g],velocity:0,to:t[g]}}),{}),d=()=>ru((v,g)=>g.from,u),f=()=>!Object.values(u).filter(qx).length,h=null,p=v=>{s||(s=v);var g=v-s,j=g/r.dt;u=F2(r,u,j),i(Qt(Qt(Qt({},e),t),d())),s=v,f()||(h=a.setTimeout(p))};return()=>(h=a.setTimeout(p),()=>{var v;(v=h)===null||v===void 0||v()})}function SW(e,t,r,n,i,a,s){var u=null,d=i.reduce((p,v)=>{var g=e[v],j=t[v];return g==null||j==null?p:Qt(Qt({},p),{},{[v]:[g,j]})},{}),f,h=p=>{f||(f=p);var v=(p-f)/n,g=ru((b,w)=>kh(...w,r(v)),d);if(a(Qt(Qt(Qt({},e),t),g)),v<1)u=s.setTimeout(h);else{var j=ru((b,w)=>kh(...w,r(1)),d);a(Qt(Qt(Qt({},e),t),j))}};return()=>(u=s.setTimeout(h),()=>{var p;(p=u)===null||p===void 0||p()})}const NW=(e,t,r,n,i,a)=>{var s=yW(e,t);return r==null?()=>(i(Qt(Qt({},e),t)),()=>{}):r.isStepper===!0?jW(e,t,r,s,i,a):SW(e,t,r,n,s,i,a)};var _h=1e-4,B2=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],W2=(e,t)=>e.map((r,n)=>r*t**n).reduce((r,n)=>r+n),ck=(e,t)=>r=>{var n=B2(e,t);return W2(n,r)},PW=(e,t)=>r=>{var n=B2(e,t),i=[...n.map((a,s)=>a*s).slice(1),0];return W2(i,r)},kW=e=>{var t,r=e.split("(");if(r.length!==2||r[0]!=="cubic-bezier")return null;var n=(t=r[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(n==null||n.length!==4)return null;var i=n.map(a=>parseFloat(a));return[i[0],i[1],i[2],i[3]]},_W=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(r.length===1)switch(r[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:{var i=kW(r[0]);if(i)return i}}return r.length===4?r:[0,0,1,1]},EW=(e,t,r,n)=>{var i=ck(e,r),a=ck(t,n),s=PW(e,r),u=f=>f>1?1:f<0?0:f,d=f=>{for(var h=f>1?1:f,p=h,v=0;v<8;++v){var g=i(p)-h,j=s(p);if(Math.abs(g-h)<_h||j<_h)return a(p);p=u(p-g/j)}return a(p)};return d.isStepper=!1,d},uk=function(){return EW(..._W(...arguments))},CW=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:r=100,damping:n=8,dt:i=17}=t,a=(s,u,d)=>{var f=-(s-u)*r,h=d*n,p=d+(f-h)*i/1e3,v=d*i/1e3+s;return Math.abs(v-u)<_h&&Math.abs(p)<_h?[u,0]:[v,p]};return a.isStepper=!0,a.dt=i,a},OW=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return uk(e);case"spring":return CW();default:if(e.split("(")[0]==="cubic-bezier")return uk(e)}return typeof e=="function"?e:null};function AW(e){var t,r=()=>null,n=!1,i=null,a=s=>{if(!n){if(Array.isArray(s)){if(!s.length)return;var u=s,[d,...f]=u;if(typeof d=="number"){i=e.setTimeout(a.bind(null,f),d);return}a(d),i=e.setTimeout(a.bind(null,f));return}typeof s=="string"&&(t=s,r(t)),typeof s=="object"&&(t=s,r(t)),typeof s=="function"&&s()}};return{stop:()=>{n=!0},start:s=>{n=!1,i&&(i(),i=null),a(s)},subscribe:s=>(r=s,()=>{r=()=>null}),getTimeoutController:()=>e}}class TW{setTimeout(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),i=null,a=s=>{s-n>=r?t(s):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(a))};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function MW(){return AW(new TW)}var IW=y.createContext(MW);function RW(e,t){var r=y.useContext(IW);return y.useMemo(()=>t??r(e),[e,t,r])}var DW=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Ou={isSsr:DW()},LW={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},dk={t:0},xy={t:1};function kl(e){var t=Mt(e,LW),{isActive:r,canBegin:n,duration:i,easing:a,begin:s,onAnimationEnd:u,onAnimationStart:d,children:f}=t,h=r==="auto"?!Ou.isSsr:r,p=RW(t.animationId,t.animationManager),[v,g]=y.useState(h?dk:xy),j=y.useRef(null);return y.useEffect(()=>{h||g(xy)},[h]),y.useEffect(()=>{if(!h||!n)return Su;var b=NW(dk,xy,OW(a),i,g,p.getTimeoutController()),w=()=>{j.current=b()};return p.start([d,s,w,i,u]),()=>{p.stop(),j.current&&j.current(),u()}},[h,n,i,a,s,d,u,p]),f(v.t)}function _l(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",r=y.useRef(Gc(t)),n=y.useRef(e);return n.current!==e&&(r.current=Gc(t),n.current=e),r.current}var $W=["radius"],zW=["radius"],fk,hk,mk,pk,vk,gk,yk,xk,bk,wk;function jk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Sk(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?jk(Object(r),!0).forEach(function(n){FW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jk(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function FW(e,t,r){return(t=BW(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function BW(e){var t=WW(e,"string");return typeof t=="symbol"?t:t+""}function WW(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Eh(){return Eh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Eh.apply(null,arguments)}function Nk(e,t){if(e==null)return{};var r,n,i=UW(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function UW(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function bi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Pk=(e,t,r,n,i)=>{var a=fo(r),s=fo(n),u=Math.min(Math.abs(a)/2,Math.abs(s)/2),d=s>=0?1:-1,f=a>=0?1:-1,h=s>=0&&a>=0||s<0&&a<0?1:0,p;if(u>0&&i instanceof Array){for(var v=[0,0,0,0],g=0,j=4;g<j;g++)v[g]=i[g]>u?u:i[g];p=Dt(fk||(fk=bi(["M",",",""])),e,t+d*v[0]),v[0]>0&&(p+=Dt(hk||(hk=bi(["A ",",",",0,0,",",",",",""])),v[0],v[0],h,e+f*v[0],t)),p+=Dt(mk||(mk=bi(["L ",",",""])),e+r-f*v[1],t),v[1]>0&&(p+=Dt(pk||(pk=bi(["A ",",",",0,0,",`,
79
+ `,",",""])),v[1],v[1],h,e+r,t+d*v[1])),p+=Dt(vk||(vk=bi(["L ",",",""])),e+r,t+n-d*v[2]),v[2]>0&&(p+=Dt(gk||(gk=bi(["A ",",",",0,0,",`,
80
+ `,",",""])),v[2],v[2],h,e+r-f*v[2],t+n)),p+=Dt(yk||(yk=bi(["L ",",",""])),e+f*v[3],t+n),v[3]>0&&(p+=Dt(xk||(xk=bi(["A ",",",",0,0,",`,
81
+ `,",",""])),v[3],v[3],h,e,t+n-d*v[3])),p+="Z"}else if(u>0&&i===+i&&i>0){var b=Math.min(u,i);p=Dt(bk||(bk=bi(["M ",",",`
82
+ A `,",",",0,0,",",",",",`
83
+ L `,",",`
84
+ A `,",",",0,0,",",",",",`
85
+ L `,",",`
86
+ A `,",",",0,0,",",",",",`
87
+ L `,",",`
88
+ A `,",",",0,0,",",",","," Z"])),e,t+d*b,b,b,h,e+f*b,t,e+r-f*b,t,b,b,h,e+r,t+d*b,e+r,t+n-d*b,b,b,h,e+r-f*b,t+n,e+f*b,t+n,b,b,h,e,t+n-d*b)}else p=Dt(wk||(wk=bi(["M ",","," h "," v "," h "," Z"])),e,t,r,n,-r);return p},kk={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},U2=e=>{var t=Mt(e,kk),r=y.useRef(null),[n,i]=y.useState(-1);y.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var X=r.current.getTotalLength();X&&i(X)}catch{}},[]);var{x:a,y:s,width:u,height:d,radius:f,className:h}=t,{animationEasing:p,animationDuration:v,animationBegin:g,isAnimationActive:j,isUpdateAnimationActive:b}=t,w=y.useRef(u),N=y.useRef(d),P=y.useRef(a),E=y.useRef(s),k=y.useMemo(()=>({x:a,y:s,width:u,height:d,radius:f}),[a,s,u,d,f]),C=_l(k,"rectangle-");if(a!==+a||s!==+s||u!==+u||d!==+d||u===0||d===0)return null;var T=He("recharts-rectangle",h);if(!b){var A=br(t),{radius:M}=A,z=Nk(A,$W);return y.createElement("path",Eh({},z,{x:fo(a),y:fo(s),width:fo(u),height:fo(d),radius:typeof f=="number"?f:void 0,className:T,d:Pk(a,s,u,d,f)}))}var V=w.current,L=N.current,K=P.current,te=E.current,R="0px ".concat(n===-1?1:n,"px"),U="".concat(n,"px 0px"),F=z2(["strokeDasharray"],v,typeof p=="string"?p:kk.animationEasing);return y.createElement(kl,{animationId:C,key:C,canBegin:n>0,duration:v,easing:p,isActive:b,begin:g},X=>{var $=it(V,u,X),Y=it(L,d,X),W=it(K,a,X),I=it(te,s,X);r.current&&(w.current=$,N.current=Y,P.current=W,E.current=I);var H;j?X>0?H={transition:F,strokeDasharray:U}:H={strokeDasharray:R}:H={strokeDasharray:U};var oe=br(t),{radius:se}=oe,be=Nk(oe,zW);return y.createElement("path",Eh({},be,{radius:typeof f=="number"?f:void 0,className:T,d:Pk(W,I,$,Y,f),ref:r,style:Sk(Sk({},H),t.style)}))})};function _k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ek(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_k(Object(r),!0).forEach(function(n){KW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_k(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function KW(e,t,r){return(t=qW(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qW(e){var t=HW(e,"string");return typeof t=="symbol"?t:t+""}function HW(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ch=Math.PI/180,VW=e=>e*180/Math.PI,Kt=(e,t,r,n)=>({x:e+Math.cos(-Ch*n)*r,y:t+Math.sin(-Ch*n)*r}),K2=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},YW=(e,t)=>{var{x:r,y:n}=e,{x:i,y:a}=t;return Math.sqrt((r-i)**2+(n-a)**2)},GW=(e,t)=>{var{x:r,y:n}=e,{cx:i,cy:a}=t,s=YW({x:r,y:n},{x:i,y:a});if(s<=0)return{radius:s,angle:0};var u=(r-i)/s,d=Math.acos(u);return n>a&&(d=2*Math.PI-d),{radius:s,angle:VW(d),angleInRadian:d}},XW=e=>{var{startAngle:t,endAngle:r}=e,n=Math.floor(t/360),i=Math.floor(r/360),a=Math.min(n,i);return{startAngle:t-a*360,endAngle:r-a*360}},QW=(e,t)=>{var{startAngle:r,endAngle:n}=t,i=Math.floor(r/360),a=Math.floor(n/360),s=Math.min(i,a);return e+s*360},ZW=(e,t)=>{var{chartX:r,chartY:n}=e,{radius:i,angle:a}=GW({x:r,y:n},t),{innerRadius:s,outerRadius:u}=t;if(i<s||i>u||i===0)return null;var{startAngle:d,endAngle:f}=XW(t),h=a,p;if(d<=f){for(;h>f;)h-=360;for(;h<d;)h+=360;p=h>=d&&h<=f}else{for(;h>d;)h-=360;for(;h<f;)h+=360;p=h>=f&&h<=d}return p?Ek(Ek({},t),{},{radius:i,angle:QW(h,t)}):null};function q2(e){var{cx:t,cy:r,radius:n,startAngle:i,endAngle:a}=e,s=Kt(t,r,n,i),u=Kt(t,r,n,a);return{points:[s,u],cx:t,cy:r,radius:n,startAngle:i,endAngle:a}}var Ck,Ok,Ak,Tk,Mk,Ik,Rk;function Hx(){return Hx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hx.apply(null,arguments)}function Vo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var JW=(e,t)=>{var r=fr(t-e),n=Math.min(Math.abs(t-e),359.999);return r*n},bf=e=>{var{cx:t,cy:r,radius:n,angle:i,sign:a,isExternal:s,cornerRadius:u,cornerIsExternal:d}=e,f=u*(s?1:-1)+n,h=Math.asin(u/f)/Ch,p=d?i:i+a*h,v=Kt(t,r,f,p),g=Kt(t,r,n,p),j=d?i-a*h:i,b=Kt(t,r,f*Math.cos(h*Ch),j);return{center:v,circleTangency:g,lineTangency:b,theta:h}},H2=e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:i,startAngle:a,endAngle:s}=e,u=JW(a,s),d=a+u,f=Kt(t,r,i,a),h=Kt(t,r,i,d),p=Dt(Ck||(Ck=Vo(["M ",",",`
89
+ A `,",",`,0,
90
+ `,",",`,
91
+ `,",",`
92
+ `])),f.x,f.y,i,i,+(Math.abs(u)>180),+(a>d),h.x,h.y);if(n>0){var v=Kt(t,r,n,a),g=Kt(t,r,n,d);p+=Dt(Ok||(Ok=Vo(["L ",",",`
93
+ A `,",",`,0,
94
+ `,",",`,
95
+ `,","," Z"])),g.x,g.y,n,n,+(Math.abs(u)>180),+(a<=d),v.x,v.y)}else p+=Dt(Ak||(Ak=Vo(["L ",","," Z"])),t,r);return p},eU=e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:i,cornerRadius:a,forceCornerRadius:s,cornerIsExternal:u,startAngle:d,endAngle:f}=e,h=fr(f-d),{circleTangency:p,lineTangency:v,theta:g}=bf({cx:t,cy:r,radius:i,angle:d,sign:h,cornerRadius:a,cornerIsExternal:u}),{circleTangency:j,lineTangency:b,theta:w}=bf({cx:t,cy:r,radius:i,angle:f,sign:-h,cornerRadius:a,cornerIsExternal:u}),N=u?Math.abs(d-f):Math.abs(d-f)-g-w;if(N<0)return s?Dt(Tk||(Tk=Vo(["M ",",",`
96
+ a`,",",",0,0,1,",`,0
97
+ a`,",",",0,0,1,",`,0
98
+ `])),v.x,v.y,a,a,a*2,a,a,-a*2):H2({cx:t,cy:r,innerRadius:n,outerRadius:i,startAngle:d,endAngle:f});var P=Dt(Mk||(Mk=Vo(["M ",",",`
99
+ A`,",",",0,0,",",",",",`
100
+ A`,",",",0,",",",",",",",`
101
+ A`,",",",0,0,",",",",",`
102
+ `])),v.x,v.y,a,a,+(h<0),p.x,p.y,i,i,+(N>180),+(h<0),j.x,j.y,a,a,+(h<0),b.x,b.y);if(n>0){var{circleTangency:E,lineTangency:k,theta:C}=bf({cx:t,cy:r,radius:n,angle:d,sign:h,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),{circleTangency:T,lineTangency:A,theta:M}=bf({cx:t,cy:r,radius:n,angle:f,sign:-h,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),z=u?Math.abs(d-f):Math.abs(d-f)-C-M;if(z<0&&a===0)return"".concat(P,"L").concat(t,",").concat(r,"Z");P+=Dt(Ik||(Ik=Vo(["L",",",`
103
+ A`,",",",0,0,",",",",",`
104
+ A`,",",",0,",",",",",",",`
105
+ A`,",",",0,0,",",",",","Z"])),A.x,A.y,a,a,+(h<0),T.x,T.y,n,n,+(z>180),+(h>0),E.x,E.y,a,a,+(h<0),k.x,k.y)}else P+=Dt(Rk||(Rk=Vo(["L",",","Z"])),t,r);return P},tU={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},V2=e=>{var t=Mt(e,tU),{cx:r,cy:n,innerRadius:i,outerRadius:a,cornerRadius:s,forceCornerRadius:u,cornerIsExternal:d,startAngle:f,endAngle:h,className:p}=t;if(a<i||f===h)return null;var v=He("recharts-sector",p),g=a-i,j=_r(s,g,0,!0),b;return j>0&&Math.abs(f-h)<360?b=eU({cx:r,cy:n,innerRadius:i,outerRadius:a,cornerRadius:Math.min(j,g/2),forceCornerRadius:u,cornerIsExternal:d,startAngle:f,endAngle:h}):b=H2({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:f,endAngle:h}),y.createElement("path",Hx({},br(t),{className:v,d:b}))};function rU(e,t,r){if(e==="horizontal")return[{x:t.x,y:r.top},{x:t.x,y:r.top+r.height}];if(e==="vertical")return[{x:r.left,y:t.y},{x:r.left+r.width,y:t.y}];if(PA(t)){if(e==="centric"){var{cx:n,cy:i,innerRadius:a,outerRadius:s,angle:u}=t,d=Kt(n,i,a,u),f=Kt(n,i,s,u);return[{x:d.x,y:d.y},{x:f.x,y:f.y}]}return q2(t)}}var by={},wy={},jy={},Dk;function nU(){return Dk||(Dk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=LA();function r(n){return t.isSymbol(n)?NaN:Number(n)}e.toNumber=r})(jy)),jy}var Lk;function iU(){return Lk||(Lk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=nU();function r(n){return n?(n=t.toNumber(n),n===1/0||n===-1/0?(n<0?-1:1)*Number.MAX_VALUE:n===n?n:0):n===0?n:0}e.toFinite=r})(wy)),wy}var $k;function aU(){return $k||($k=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$A(),r=iU();function n(i,a,s){s&&typeof s!="number"&&t.isIterateeCall(i,a,s)&&(a=s=void 0),i=r.toFinite(i),a===void 0?(a=i,i=0):a=r.toFinite(a),s=s===void 0?i<a?1:-1:r.toFinite(s);const u=Math.max(Math.ceil((a-i)/(s||1)),0),d=new Array(u);for(let f=0;f<u;f++)d[f]=i,i+=s;return d}e.range=n})(by)),by}var Sy,zk;function oU(){return zk||(zk=1,Sy=aU().range),Sy}var sU=oU();const Y2=li(sU);function po(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function lU(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function fb(e){let t,r,n;e.length!==2?(t=po,r=(u,d)=>po(e(u),d),n=(u,d)=>e(u)-d):(t=e===po||e===lU?e:cU,r=e,n=e);function i(u,d,f=0,h=u.length){if(f<h){if(t(d,d)!==0)return h;do{const p=f+h>>>1;r(u[p],d)<0?f=p+1:h=p}while(f<h)}return f}function a(u,d,f=0,h=u.length){if(f<h){if(t(d,d)!==0)return h;do{const p=f+h>>>1;r(u[p],d)<=0?f=p+1:h=p}while(f<h)}return f}function s(u,d,f=0,h=u.length){const p=i(u,d,f,h-1);return p>f&&n(u[p-1],d)>-n(u[p],d)?p-1:p}return{left:i,center:s,right:a}}function cU(){return 0}function G2(e){return e===null?NaN:+e}function*uU(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const dU=fb(po),Au=dU.right;fb(G2).center;class Fk extends Map{constructor(t,r=mU){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(Bk(this,t))}has(t){return super.has(Bk(this,t))}set(t,r){return super.set(fU(this,t),r)}delete(t){return super.delete(hU(this,t))}}function Bk({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function fU({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function hU({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function mU(e){return e!==null&&typeof e=="object"?e.valueOf():e}function pU(e=po){if(e===po)return X2;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 X2(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const vU=Math.sqrt(50),gU=Math.sqrt(10),yU=Math.sqrt(2);function Oh(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),s=a>=vU?10:a>=gU?5:a>=yU?2:1;let u,d,f;return i<0?(f=Math.pow(10,-i)/s,u=Math.round(e*f),d=Math.round(t*f),u/f<e&&++u,d/f>t&&--d,f=-f):(f=Math.pow(10,i)*s,u=Math.round(e/f),d=Math.round(t/f),u*f<e&&++u,d*f>t&&--d),d<u&&.5<=r&&r<2?Oh(e,t,r*2):[u,d,f]}function Vx(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[i,a,s]=n?Oh(t,e,r):Oh(e,t,r);if(!(a>=i))return[];const u=a-i+1,d=new Array(u);if(n)if(s<0)for(let f=0;f<u;++f)d[f]=(a-f)/-s;else for(let f=0;f<u;++f)d[f]=(a-f)*s;else if(s<0)for(let f=0;f<u;++f)d[f]=(i+f)/-s;else for(let f=0;f<u;++f)d[f]=(i+f)*s;return d}function Yx(e,t,r){return t=+t,e=+e,r=+r,Oh(e,t,r)[2]}function Gx(e,t,r){t=+t,e=+e,r=+r;const n=t<e,i=n?Yx(t,e,r):Yx(e,t,r);return(n?-1:1)*(i<0?1/-i:i)}function Wk(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function Uk(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function Q2(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?X2:pU(i);n>r;){if(n-r>600){const d=n-r+1,f=t-r+1,h=Math.log(d),p=.5*Math.exp(2*h/3),v=.5*Math.sqrt(h*p*(d-p)/d)*(f-d/2<0?-1:1),g=Math.max(r,Math.floor(t-f*p/d+v)),j=Math.min(n,Math.floor(t+(d-f)*p/d+v));Q2(e,t,g,j,i)}const a=e[t];let s=r,u=n;for(Cc(e,r,t),i(e[n],a)>0&&Cc(e,r,n);s<u;){for(Cc(e,s,u),++s,--u;i(e[s],a)<0;)++s;for(;i(e[u],a)>0;)--u}i(e[r],a)===0?Cc(e,r,u):(++u,Cc(e,u,n)),u<=t&&(r=u+1),t<=u&&(n=u-1)}return e}function Cc(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function xU(e,t,r){if(e=Float64Array.from(uU(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Uk(e);if(t>=1)return Wk(e);var n,i=(n-1)*t,a=Math.floor(i),s=Wk(Q2(e,a).subarray(0,a+1)),u=Uk(e.subarray(a+1));return s+(u-s)*(i-a)}}function bU(e,t,r=G2){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),s=+r(e[a],a,e),u=+r(e[a+1],a+1,e);return s+(u-s)*(i-a)}}function wU(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n<i;)a[n]=e+n*r;return a}function Wn(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Aa(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 Xx=Symbol("implicit");function hb(){var e=new Fk,t=[],r=[],n=Xx;function i(a){let s=e.get(a);if(s===void 0){if(n!==Xx)return n;e.set(a,s=t.push(a)-1)}return r[s%r.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new Fk;for(const s of a)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(a){return arguments.length?(r=Array.from(a),i):r.slice()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return hb(t,r).unknown(n)},Wn.apply(i,arguments),i}function mb(){var e=hb().unknown(void 0),t=e.domain,r=e.range,n=0,i=1,a,s,u=!1,d=0,f=0,h=.5;delete e.unknown;function p(){var v=t().length,g=i<n,j=g?i:n,b=g?n:i;a=(b-j)/Math.max(1,v-d+f*2),u&&(a=Math.floor(a)),j+=(b-j-a*(v-d))*h,s=a*(1-d),u&&(j=Math.round(j),s=Math.round(s));var w=wU(v).map(function(N){return j+a*N});return r(g?w.reverse():w)}return e.domain=function(v){return arguments.length?(t(v),p()):t()},e.range=function(v){return arguments.length?([n,i]=v,n=+n,i=+i,p()):[n,i]},e.rangeRound=function(v){return[n,i]=v,n=+n,i=+i,u=!0,p()},e.bandwidth=function(){return s},e.step=function(){return a},e.round=function(v){return arguments.length?(u=!!v,p()):u},e.padding=function(v){return arguments.length?(d=Math.min(1,f=+v),p()):d},e.paddingInner=function(v){return arguments.length?(d=Math.min(1,v),p()):d},e.paddingOuter=function(v){return arguments.length?(f=+v,p()):f},e.align=function(v){return arguments.length?(h=Math.max(0,Math.min(1,v)),p()):h},e.copy=function(){return mb(t(),[n,i]).round(u).paddingInner(d).paddingOuter(f).align(h)},Wn.apply(p(),arguments)}function Z2(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Z2(t())},e}function jU(){return Z2(mb.apply(null,arguments).paddingInner(1))}function pb(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function J2(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function Tu(){}var nu=.7,Ah=1/nu,al="\\s*([+-]?\\d+)\\s*",iu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Pi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",SU=/^#([0-9a-f]{3,8})$/,NU=new RegExp(`^rgb\\(${al},${al},${al}\\)$`),PU=new RegExp(`^rgb\\(${Pi},${Pi},${Pi}\\)$`),kU=new RegExp(`^rgba\\(${al},${al},${al},${iu}\\)$`),_U=new RegExp(`^rgba\\(${Pi},${Pi},${Pi},${iu}\\)$`),EU=new RegExp(`^hsl\\(${iu},${Pi},${Pi}\\)$`),CU=new RegExp(`^hsla\\(${iu},${Pi},${Pi},${iu}\\)$`),Kk={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};pb(Tu,hs,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:qk,formatHex:qk,formatHex8:OU,formatHsl:AU,formatRgb:Hk,toString:Hk});function qk(){return this.rgb().formatHex()}function OU(){return this.rgb().formatHex8()}function AU(){return eT(this).formatHsl()}function Hk(){return this.rgb().formatRgb()}function hs(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=SU.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Vk(t):r===3?new Gr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?wf(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?wf(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=NU.exec(e))?new Gr(t[1],t[2],t[3],1):(t=PU.exec(e))?new Gr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=kU.exec(e))?wf(t[1],t[2],t[3],t[4]):(t=_U.exec(e))?wf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=EU.exec(e))?Xk(t[1],t[2]/100,t[3]/100,1):(t=CU.exec(e))?Xk(t[1],t[2]/100,t[3]/100,t[4]):Kk.hasOwnProperty(e)?Vk(Kk[e]):e==="transparent"?new Gr(NaN,NaN,NaN,0):null}function Vk(e){return new Gr(e>>16&255,e>>8&255,e&255,1)}function wf(e,t,r,n){return n<=0&&(e=t=r=NaN),new Gr(e,t,r,n)}function TU(e){return e instanceof Tu||(e=hs(e)),e?(e=e.rgb(),new Gr(e.r,e.g,e.b,e.opacity)):new Gr}function Qx(e,t,r,n){return arguments.length===1?TU(e):new Gr(e,t,r,n??1)}function Gr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}pb(Gr,Qx,J2(Tu,{brighter(e){return e=e==null?Ah:Math.pow(Ah,e),new Gr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?nu:Math.pow(nu,e),new Gr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Gr(es(this.r),es(this.g),es(this.b),Th(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:Yk,formatHex:Yk,formatHex8:MU,formatRgb:Gk,toString:Gk}));function Yk(){return`#${Yo(this.r)}${Yo(this.g)}${Yo(this.b)}`}function MU(){return`#${Yo(this.r)}${Yo(this.g)}${Yo(this.b)}${Yo((isNaN(this.opacity)?1:this.opacity)*255)}`}function Gk(){const e=Th(this.opacity);return`${e===1?"rgb(":"rgba("}${es(this.r)}, ${es(this.g)}, ${es(this.b)}${e===1?")":`, ${e})`}`}function Th(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function es(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Yo(e){return e=es(e),(e<16?"0":"")+e.toString(16)}function Xk(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new ri(e,t,r,n)}function eT(e){if(e instanceof ri)return new ri(e.h,e.s,e.l,e.opacity);if(e instanceof Tu||(e=hs(e)),!e)return new ri;if(e instanceof ri)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),s=NaN,u=a-i,d=(a+i)/2;return u?(t===a?s=(r-n)/u+(r<n)*6:r===a?s=(n-t)/u+2:s=(t-r)/u+4,u/=d<.5?a+i:2-a-i,s*=60):u=d>0&&d<1?0:s,new ri(s,u,d,e.opacity)}function IU(e,t,r,n){return arguments.length===1?eT(e):new ri(e,t,r,n??1)}function ri(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}pb(ri,IU,J2(Tu,{brighter(e){return e=e==null?Ah:Math.pow(Ah,e),new ri(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?nu:Math.pow(nu,e),new ri(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Gr(Ny(e>=240?e-240:e+120,i,n),Ny(e,i,n),Ny(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new ri(Qk(this.h),jf(this.s),jf(this.l),Th(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=Th(this.opacity);return`${e===1?"hsl(":"hsla("}${Qk(this.h)}, ${jf(this.s)*100}%, ${jf(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Qk(e){return e=(e||0)%360,e<0?e+360:e}function jf(e){return Math.max(0,Math.min(1,e||0))}function Ny(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 vb=e=>()=>e;function RU(e,t){return function(r){return e+r*t}}function DU(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 LU(e){return(e=+e)==1?tT:function(t,r){return r-t?DU(t,r,e):vb(isNaN(t)?r:t)}}function tT(e,t){var r=t-e;return r?RU(e,r):vb(isNaN(e)?t:e)}const Mh=(function e(t){var r=LU(t);function n(i,a){var s=r((i=Qx(i)).r,(a=Qx(a)).r),u=r(i.g,a.g),d=r(i.b,a.b),f=tT(i.opacity,a.opacity);return function(h){return i.r=s(h),i.g=u(h),i.b=d(h),i.opacity=f(h),i+""}}return n.gamma=e,n})(1);function $U(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;i<r;++i)n[i]=e[i]*(1-a)+t[i]*a;return n}}function zU(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function FU(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),a=new Array(r),s;for(s=0;s<n;++s)i[s]=El(e[s],t[s]);for(;s<r;++s)a[s]=t[s];return function(u){for(s=0;s<n;++s)a[s]=i[s](u);return a}}function BU(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function Jn(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function WU(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=El(e[i],t[i]):n[i]=t[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var Zx=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Py=new RegExp(Zx.source,"g");function UU(e){return function(){return e}}function KU(e){return function(t){return e(t)+""}}function rT(e,t){var r=Zx.lastIndex=Py.lastIndex=0,n,i,a,s=-1,u=[],d=[];for(e=e+"",t=t+"";(n=Zx.exec(e))&&(i=Py.exec(t));)(a=i.index)>r&&(a=t.slice(r,a),u[s]?u[s]+=a:u[++s]=a),(n=n[0])===(i=i[0])?u[s]?u[s]+=i:u[++s]=i:(u[++s]=null,d.push({i:s,x:Jn(n,i)})),r=Py.lastIndex;return r<t.length&&(a=t.slice(r),u[s]?u[s]+=a:u[++s]=a),u.length<2?d[0]?KU(d[0].x):UU(t):(t=d.length,function(f){for(var h=0,p;h<t;++h)u[(p=d[h]).i]=p.x(f);return u.join("")})}function El(e,t){var r=typeof t,n;return t==null||r==="boolean"?vb(t):(r==="number"?Jn:r==="string"?(n=hs(t))?(t=n,Mh):rT:t instanceof hs?Mh:t instanceof Date?BU:zU(t)?$U:Array.isArray(t)?FU:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?WU:Jn)(e,t)}function gb(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var Zk=180/Math.PI,Jx={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function nT(e,t,r,n,i,a){var s,u,d;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(d=e*r+t*n)&&(r-=e*d,n-=t*d),(u=Math.sqrt(r*r+n*n))&&(r/=u,n/=u,d/=u),e*n<t*r&&(e=-e,t=-t,d=-d,s=-s),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*Zk,skewX:Math.atan(d)*Zk,scaleX:s,scaleY:u}}var Sf;function qU(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Jx:nT(t.a,t.b,t.c,t.d,t.e,t.f)}function HU(e){return e==null||(Sf||(Sf=document.createElementNS("http://www.w3.org/2000/svg","g")),Sf.setAttribute("transform",e),!(e=Sf.transform.baseVal.consolidate()))?Jx:(e=e.matrix,nT(e.a,e.b,e.c,e.d,e.e,e.f))}function iT(e,t,r,n){function i(f){return f.length?f.pop()+" ":""}function a(f,h,p,v,g,j){if(f!==p||h!==v){var b=g.push("translate(",null,t,null,r);j.push({i:b-4,x:Jn(f,p)},{i:b-2,x:Jn(h,v)})}else(p||v)&&g.push("translate("+p+t+v+r)}function s(f,h,p,v){f!==h?(f-h>180?h+=360:h-f>180&&(f+=360),v.push({i:p.push(i(p)+"rotate(",null,n)-2,x:Jn(f,h)})):h&&p.push(i(p)+"rotate("+h+n)}function u(f,h,p,v){f!==h?v.push({i:p.push(i(p)+"skewX(",null,n)-2,x:Jn(f,h)}):h&&p.push(i(p)+"skewX("+h+n)}function d(f,h,p,v,g,j){if(f!==p||h!==v){var b=g.push(i(g)+"scale(",null,",",null,")");j.push({i:b-4,x:Jn(f,p)},{i:b-2,x:Jn(h,v)})}else(p!==1||v!==1)&&g.push(i(g)+"scale("+p+","+v+")")}return function(f,h){var p=[],v=[];return f=e(f),h=e(h),a(f.translateX,f.translateY,h.translateX,h.translateY,p,v),s(f.rotate,h.rotate,p,v),u(f.skewX,h.skewX,p,v),d(f.scaleX,f.scaleY,h.scaleX,h.scaleY,p,v),f=h=null,function(g){for(var j=-1,b=v.length,w;++j<b;)p[(w=v[j]).i]=w.x(g);return p.join("")}}}var VU=iT(qU,"px, ","px)","deg)"),YU=iT(HU,", ",")",")"),GU=1e-12;function Jk(e){return((e=Math.exp(e))+1/e)/2}function XU(e){return((e=Math.exp(e))-1/e)/2}function QU(e){return((e=Math.exp(2*e))-1)/(e+1)}const ZU=(function e(t,r,n){function i(a,s){var u=a[0],d=a[1],f=a[2],h=s[0],p=s[1],v=s[2],g=h-u,j=p-d,b=g*g+j*j,w,N;if(b<GU)N=Math.log(v/f)/t,w=function(A){return[u+A*g,d+A*j,f*Math.exp(t*A*N)]};else{var P=Math.sqrt(b),E=(v*v-f*f+n*b)/(2*f*r*P),k=(v*v-f*f-n*b)/(2*v*r*P),C=Math.log(Math.sqrt(E*E+1)-E),T=Math.log(Math.sqrt(k*k+1)-k);N=(T-C)/t,w=function(A){var M=A*N,z=Jk(C),V=f/(r*P)*(z*QU(t*M+C)-XU(C));return[u+V*g,d+V*j,f*z/Jk(t*M+C)]}}return w.duration=N*1e3*t/Math.SQRT2,w}return i.rho=function(a){var s=Math.max(.001,+a),u=s*s,d=u*u;return e(s,u,d)},i})(Math.SQRT2,2,4);function JU(e,t){t===void 0&&(t=e,e=El);for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r<n;)a[r]=e(i,i=t[++r]);return function(s){var u=Math.max(0,Math.min(n-1,Math.floor(s*=n)));return a[u](s-u)}}function eK(e){return function(){return e}}function Ih(e){return+e}var e_=[0,1];function Ir(e){return e}function e0(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:eK(isNaN(t)?NaN:.5)}function tK(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function rK(e,t,r){var n=e[0],i=e[1],a=t[0],s=t[1];return i<n?(n=e0(i,n),a=r(s,a)):(n=e0(n,i),a=r(a,s)),function(u){return a(n(u))}}function nK(e,t,r){var n=Math.min(e.length,t.length)-1,i=new Array(n),a=new Array(n),s=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<n;)i[s]=e0(e[s],e[s+1]),a[s]=r(t[s],t[s+1]);return function(u){var d=Au(e,u,1,n)-1;return a[d](i[d](u))}}function Mu(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Lm(){var e=e_,t=e_,r=El,n,i,a,s=Ir,u,d,f;function h(){var v=Math.min(e.length,t.length);return s!==Ir&&(s=tK(e[0],e[v-1])),u=v>2?nK:rK,d=f=null,p}function p(v){return v==null||isNaN(v=+v)?a:(d||(d=u(e.map(n),t,r)))(n(s(v)))}return p.invert=function(v){return s(i((f||(f=u(t,e.map(n),Jn)))(v)))},p.domain=function(v){return arguments.length?(e=Array.from(v,Ih),h()):e.slice()},p.range=function(v){return arguments.length?(t=Array.from(v),h()):t.slice()},p.rangeRound=function(v){return t=Array.from(v),r=gb,h()},p.clamp=function(v){return arguments.length?(s=v?!0:Ir,h()):s!==Ir},p.interpolate=function(v){return arguments.length?(r=v,h()):r},p.unknown=function(v){return arguments.length?(a=v,p):a},function(v,g){return n=v,i=g,h()}}function yb(){return Lm()(Ir,Ir)}function iK(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Rh(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function ml(e){return e=Rh(Math.abs(e)),e?e[1]:NaN}function aK(e,t){return function(r,n){for(var i=r.length,a=[],s=0,u=e[0],d=0;i>0&&u>0&&(d+u+1>n&&(u=Math.max(1,n-d)),a.push(r.substring(i-=u,i+u)),!((d+=u+1)>n));)u=e[s=(s+1)%e.length];return a.reverse().join(t)}}function oK(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var sK=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function au(e){if(!(t=sK.exec(e)))throw new Error("invalid format: "+e);var t;return new xb({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]})}au.prototype=xb.prototype;function xb(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+""}xb.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 lK(e){e:for(var t=e.length,r=1,n=-1,i;r<t;++r)switch(e[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var aT;function cK(e,t){var r=Rh(e,t);if(!r)return e+"";var n=r[0],i=r[1],a=i-(aT=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+Rh(e,Math.max(0,t+a-1))[0]}function t_(e,t){var r=Rh(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const r_={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:iK,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)=>t_(e*100,t),r:t_,s:cK,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function n_(e){return e}var i_=Array.prototype.map,a_=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function uK(e){var t=e.grouping===void 0||e.thousands===void 0?n_:aK(i_.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?n_:oK(i_.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(p){p=au(p);var v=p.fill,g=p.align,j=p.sign,b=p.symbol,w=p.zero,N=p.width,P=p.comma,E=p.precision,k=p.trim,C=p.type;C==="n"?(P=!0,C="g"):r_[C]||(E===void 0&&(E=12),k=!0,C="g"),(w||v==="0"&&g==="=")&&(w=!0,v="0",g="=");var T=b==="$"?r:b==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():"",A=b==="$"?n:/[%p]/.test(C)?s:"",M=r_[C],z=/[defgprs%]/.test(C);E=E===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function V(L){var K=T,te=A,R,U,F;if(C==="c")te=M(L)+te,L="";else{L=+L;var X=L<0||1/L<0;if(L=isNaN(L)?d:M(Math.abs(L),E),k&&(L=lK(L)),X&&+L==0&&j!=="+"&&(X=!1),K=(X?j==="("?j:u:j==="-"||j==="("?"":j)+K,te=(C==="s"?a_[8+aT/3]:"")+te+(X&&j==="("?")":""),z){for(R=-1,U=L.length;++R<U;)if(F=L.charCodeAt(R),48>F||F>57){te=(F===46?i+L.slice(R+1):L.slice(R))+te,L=L.slice(0,R);break}}}P&&!w&&(L=t(L,1/0));var $=K.length+L.length+te.length,Y=$<N?new Array(N-$+1).join(v):"";switch(P&&w&&(L=t(Y+L,Y.length?N-te.length:1/0),Y=""),g){case"<":L=K+L+te+Y;break;case"=":L=K+Y+L+te;break;case"^":L=Y.slice(0,$=Y.length>>1)+K+L+te+Y.slice($);break;default:L=Y+K+L+te;break}return a(L)}return V.toString=function(){return p+""},V}function h(p,v){var g=f((p=au(p),p.type="f",p)),j=Math.max(-8,Math.min(8,Math.floor(ml(v)/3)))*3,b=Math.pow(10,-j),w=a_[8+j/3];return function(N){return g(b*N)+w}}return{format:f,formatPrefix:h}}var Nf,bb,oT;dK({thousands:",",grouping:[3],currency:["$",""]});function dK(e){return Nf=uK(e),bb=Nf.format,oT=Nf.formatPrefix,Nf}function fK(e){return Math.max(0,-ml(Math.abs(e)))}function hK(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ml(t)/3)))*3-ml(Math.abs(e)))}function mK(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ml(t)-ml(e))+1}function sT(e,t,r,n){var i=Gx(e,t,r),a;switch(n=au(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=hK(i,s))&&(n.precision=a),oT(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=mK(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=fK(i))&&(n.precision=a-(n.type==="%")*2);break}}return bb(n)}function So(e){var t=e.domain;return e.ticks=function(r){var n=t();return Vx(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return sT(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,s=n[i],u=n[a],d,f,h=10;for(u<s&&(f=s,s=u,u=f,f=i,i=a,a=f);h-- >0;){if(f=Yx(s,u,r),f===d)return n[i]=s,n[a]=u,t(n);if(f>0)s=Math.floor(s/f)*f,u=Math.ceil(u/f)*f;else if(f<0)s=Math.ceil(s*f)/f,u=Math.floor(u*f)/f;else break;d=f}return e},e}function lT(){var e=yb();return e.copy=function(){return Mu(e,lT())},Wn.apply(e,arguments),So(e)}function cT(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,Ih),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return cT(e).unknown(t)},e=arguments.length?Array.from(e,Ih):[0,1],So(r)}function uT(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],s;return a<i&&(s=r,r=n,n=s,s=i,i=a,a=s),e[r]=t.floor(i),e[n]=t.ceil(a),e}function o_(e){return Math.log(e)}function s_(e){return Math.exp(e)}function pK(e){return-Math.log(-e)}function vK(e){return-Math.exp(-e)}function gK(e){return isFinite(e)?+("1e"+e):e<0?0:e}function yK(e){return e===10?gK:e===Math.E?Math.exp:t=>Math.pow(e,t)}function xK(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 l_(e){return(t,r)=>-e(-t,r)}function wb(e){const t=e(o_,s_),r=t.domain;let n=10,i,a;function s(){return i=xK(n),a=yK(n),r()[0]<0?(i=l_(i),a=l_(a),e(pK,vK)):e(o_,s_),t}return t.base=function(u){return arguments.length?(n=+u,s()):n},t.domain=function(u){return arguments.length?(r(u),s()):r()},t.ticks=u=>{const d=r();let f=d[0],h=d[d.length-1];const p=h<f;p&&([f,h]=[h,f]);let v=i(f),g=i(h),j,b;const w=u==null?10:+u;let N=[];if(!(n%1)&&g-v<w){if(v=Math.floor(v),g=Math.ceil(g),f>0){for(;v<=g;++v)for(j=1;j<n;++j)if(b=v<0?j/a(-v):j*a(v),!(b<f)){if(b>h)break;N.push(b)}}else for(;v<=g;++v)for(j=n-1;j>=1;--j)if(b=v>0?j/a(-v):j*a(v),!(b<f)){if(b>h)break;N.push(b)}N.length*2<w&&(N=Vx(f,h,w))}else N=Vx(v,g,Math.min(g-v,w)).map(a);return p?N.reverse():N},t.tickFormat=(u,d)=>{if(u==null&&(u=10),d==null&&(d=n===10?"s":","),typeof d!="function"&&(!(n%1)&&(d=au(d)).precision==null&&(d.trim=!0),d=bb(d)),u===1/0)return d;const f=Math.max(1,n*u/t.ticks().length);return h=>{let p=h/a(Math.round(i(h)));return p*n<n-.5&&(p*=n),p<=f?d(h):""}},t.nice=()=>r(uT(r(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),t}function dT(){const e=wb(Lm()).domain([1,10]);return e.copy=()=>Mu(e,dT()).base(e.base()),Wn.apply(e,arguments),e}function c_(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function u_(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function jb(e){var t=1,r=e(c_(t),u_(t));return r.constant=function(n){return arguments.length?e(c_(t=+n),u_(t)):t},So(r)}function fT(){var e=jb(Lm());return e.copy=function(){return Mu(e,fT()).constant(e.constant())},Wn.apply(e,arguments)}function d_(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function bK(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function wK(e){return e<0?-e*e:e*e}function Sb(e){var t=e(Ir,Ir),r=1;function n(){return r===1?e(Ir,Ir):r===.5?e(bK,wK):e(d_(r),d_(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},So(t)}function Nb(){var e=Sb(Lm());return e.copy=function(){return Mu(e,Nb()).exponent(e.exponent())},Wn.apply(e,arguments),e}function jK(){return Nb.apply(null,arguments).exponent(.5)}function f_(e){return Math.sign(e)*e*e}function SK(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function hT(){var e=yb(),t=[0,1],r=!1,n;function i(a){var s=SK(e(a));return isNaN(s)?n:r?Math.round(s):s}return i.invert=function(a){return e.invert(f_(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,Ih)).map(f_)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return hT(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Wn.apply(i,arguments),So(i)}function mT(){var e=[],t=[],r=[],n;function i(){var s=0,u=Math.max(1,t.length);for(r=new Array(u-1);++s<u;)r[s-1]=bU(e,s/u);return a}function a(s){return s==null||isNaN(s=+s)?n:t[Au(r,s)]}return a.invertExtent=function(s){var u=t.indexOf(s);return u<0?[NaN,NaN]:[u>0?r[u-1]:e[0],u<r.length?r[u]:e[e.length-1]]},a.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let u of s)u!=null&&!isNaN(u=+u)&&e.push(u);return e.sort(po),i()},a.range=function(s){return arguments.length?(t=Array.from(s),i()):t.slice()},a.unknown=function(s){return arguments.length?(n=s,a):n},a.quantiles=function(){return r.slice()},a.copy=function(){return mT().domain(e).range(t).unknown(n)},Wn.apply(a,arguments)}function pT(){var e=0,t=1,r=1,n=[.5],i=[0,1],a;function s(d){return d!=null&&d<=d?i[Au(n,d,0,r)]:a}function u(){var d=-1;for(n=new Array(r);++d<r;)n[d]=((d+1)*t-(d-r)*e)/(r+1);return s}return s.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,u()):[e,t]},s.range=function(d){return arguments.length?(r=(i=Array.from(d)).length-1,u()):i.slice()},s.invertExtent=function(d){var f=i.indexOf(d);return f<0?[NaN,NaN]:f<1?[e,n[0]]:f>=r?[n[r-1],t]:[n[f-1],n[f]]},s.unknown=function(d){return arguments.length&&(a=d),s},s.thresholds=function(){return n.slice()},s.copy=function(){return pT().domain([e,t]).range(i).unknown(a)},Wn.apply(So(s),arguments)}function vT(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[Au(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var s=t.indexOf(a);return[e[s-1],e[s]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return vT().domain(e).range(t).unknown(r)},Wn.apply(i,arguments)}const ky=new Date,_y=new Date;function tr(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const s=i(a),u=i.ceil(a);return a-s<u-a?s:u},i.offset=(a,s)=>(t(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,u)=>{const d=[];if(a=i.ceil(a),u=u==null?1:Math.floor(u),!(a<s)||!(u>0))return d;let f;do d.push(f=new Date(+a)),t(a,u),e(a);while(f<a&&a<s);return d},i.filter=a=>tr(s=>{if(s>=s)for(;e(s),!a(s);)s.setTime(s-1)},(s,u)=>{if(s>=s)if(u<0)for(;++u<=0;)for(;t(s,-1),!a(s););else for(;--u>=0;)for(;t(s,1),!a(s););}),r&&(i.count=(a,s)=>(ky.setTime(+a),_y.setTime(+s),e(ky),e(_y),Math.floor(r(ky,_y))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?s=>n(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const Dh=tr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Dh.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?tr(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Dh);Dh.range;const ua=1e3,Mn=ua*60,da=Mn*60,ba=da*24,Pb=ba*7,h_=ba*30,Ey=ba*365,Go=tr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ua)},(e,t)=>(t-e)/ua,e=>e.getUTCSeconds());Go.range;const kb=tr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ua)},(e,t)=>{e.setTime(+e+t*Mn)},(e,t)=>(t-e)/Mn,e=>e.getMinutes());kb.range;const _b=tr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Mn)},(e,t)=>(t-e)/Mn,e=>e.getUTCMinutes());_b.range;const Eb=tr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ua-e.getMinutes()*Mn)},(e,t)=>{e.setTime(+e+t*da)},(e,t)=>(t-e)/da,e=>e.getHours());Eb.range;const Cb=tr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*da)},(e,t)=>(t-e)/da,e=>e.getUTCHours());Cb.range;const Iu=tr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Mn)/ba,e=>e.getDate()-1);Iu.range;const $m=tr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ba,e=>e.getUTCDate()-1);$m.range;const gT=tr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ba,e=>Math.floor(e/ba));gT.range;function xs(e){return tr(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())*Mn)/Pb)}const zm=xs(0),Lh=xs(1),NK=xs(2),PK=xs(3),pl=xs(4),kK=xs(5),_K=xs(6);zm.range;Lh.range;NK.range;PK.range;pl.range;kK.range;_K.range;function bs(e){return tr(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)/Pb)}const Fm=bs(0),$h=bs(1),EK=bs(2),CK=bs(3),vl=bs(4),OK=bs(5),AK=bs(6);Fm.range;$h.range;EK.range;CK.range;vl.range;OK.range;AK.range;const Ob=tr(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());Ob.range;const Ab=tr(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());Ab.range;const wa=tr(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());wa.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:tr(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)});wa.range;const ja=tr(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());ja.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:tr(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)});ja.range;function yT(e,t,r,n,i,a){const s=[[Go,1,ua],[Go,5,5*ua],[Go,15,15*ua],[Go,30,30*ua],[a,1,Mn],[a,5,5*Mn],[a,15,15*Mn],[a,30,30*Mn],[i,1,da],[i,3,3*da],[i,6,6*da],[i,12,12*da],[n,1,ba],[n,2,2*ba],[r,1,Pb],[t,1,h_],[t,3,3*h_],[e,1,Ey]];function u(f,h,p){const v=h<f;v&&([f,h]=[h,f]);const g=p&&typeof p.range=="function"?p:d(f,h,p),j=g?g.range(f,+h+1):[];return v?j.reverse():j}function d(f,h,p){const v=Math.abs(h-f)/p,g=fb(([,,w])=>w).right(s,v);if(g===s.length)return e.every(Gx(f/Ey,h/Ey,p));if(g===0)return Dh.every(Math.max(Gx(f,h,p),1));const[j,b]=s[v/s[g-1][2]<s[g][2]/v?g-1:g];return j.every(b)}return[u,d]}const[TK,MK]=yT(ja,Ab,Fm,gT,Cb,_b),[IK,RK]=yT(wa,Ob,zm,Iu,Eb,kb);function Cy(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 Oy(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 Oc(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function DK(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,a=e.days,s=e.shortDays,u=e.months,d=e.shortMonths,f=Ac(i),h=Tc(i),p=Ac(a),v=Tc(a),g=Ac(s),j=Tc(s),b=Ac(u),w=Tc(u),N=Ac(d),P=Tc(d),E={a:X,A:$,b:Y,B:W,c:null,d:x_,e:x_,f:a9,g:p9,G:g9,H:r9,I:n9,j:i9,L:xT,m:o9,M:s9,p:I,q:H,Q:j_,s:S_,S:l9,u:c9,U:u9,V:d9,w:f9,W:h9,x:null,X:null,y:m9,Y:v9,Z:y9,"%":w_},k={a:oe,A:se,b:be,B:Ae,c:null,d:b_,e:b_,f:j9,g:T9,G:I9,H:x9,I:b9,j:w9,L:wT,m:S9,M:N9,p:de,q:Se,Q:j_,s:S_,S:P9,u:k9,U:_9,V:E9,w:C9,W:O9,x:null,X:null,y:A9,Y:M9,Z:R9,"%":w_},C={a:V,A:L,b:K,B:te,c:R,d:g_,e:g_,f:ZK,g:v_,G:p_,H:y_,I:y_,j:YK,L:QK,m:VK,M:GK,p:z,q:HK,Q:e9,s:t9,S:XK,u:BK,U:WK,V:UK,w:FK,W:KK,x:U,X:F,y:v_,Y:p_,Z:qK,"%":JK};E.x=T(r,E),E.X=T(n,E),E.c=T(t,E),k.x=T(r,k),k.X=T(n,k),k.c=T(t,k);function T(J,pe){return function(Le){var re=[],ot=-1,We=0,jt=J.length,zt,mt,Un;for(Le instanceof Date||(Le=new Date(+Le));++ot<jt;)J.charCodeAt(ot)===37&&(re.push(J.slice(We,ot)),(mt=m_[zt=J.charAt(++ot)])!=null?zt=J.charAt(++ot):mt=zt==="e"?" ":"0",(Un=pe[zt])&&(zt=Un(Le,mt)),re.push(zt),We=ot+1);return re.push(J.slice(We,ot)),re.join("")}}function A(J,pe){return function(Le){var re=Oc(1900,void 0,1),ot=M(re,J,Le+="",0),We,jt;if(ot!=Le.length)return null;if("Q"in re)return new Date(re.Q);if("s"in re)return new Date(re.s*1e3+("L"in re?re.L:0));if(pe&&!("Z"in re)&&(re.Z=0),"p"in re&&(re.H=re.H%12+re.p*12),re.m===void 0&&(re.m="q"in re?re.q:0),"V"in re){if(re.V<1||re.V>53)return null;"w"in re||(re.w=1),"Z"in re?(We=Oy(Oc(re.y,0,1)),jt=We.getUTCDay(),We=jt>4||jt===0?$h.ceil(We):$h(We),We=$m.offset(We,(re.V-1)*7),re.y=We.getUTCFullYear(),re.m=We.getUTCMonth(),re.d=We.getUTCDate()+(re.w+6)%7):(We=Cy(Oc(re.y,0,1)),jt=We.getDay(),We=jt>4||jt===0?Lh.ceil(We):Lh(We),We=Iu.offset(We,(re.V-1)*7),re.y=We.getFullYear(),re.m=We.getMonth(),re.d=We.getDate()+(re.w+6)%7)}else("W"in re||"U"in re)&&("w"in re||(re.w="u"in re?re.u%7:"W"in re?1:0),jt="Z"in re?Oy(Oc(re.y,0,1)).getUTCDay():Cy(Oc(re.y,0,1)).getDay(),re.m=0,re.d="W"in re?(re.w+6)%7+re.W*7-(jt+5)%7:re.w+re.U*7-(jt+6)%7);return"Z"in re?(re.H+=re.Z/100|0,re.M+=re.Z%100,Oy(re)):Cy(re)}}function M(J,pe,Le,re){for(var ot=0,We=pe.length,jt=Le.length,zt,mt;ot<We;){if(re>=jt)return-1;if(zt=pe.charCodeAt(ot++),zt===37){if(zt=pe.charAt(ot++),mt=C[zt in m_?pe.charAt(ot++):zt],!mt||(re=mt(J,Le,re))<0)return-1}else if(zt!=Le.charCodeAt(re++))return-1}return re}function z(J,pe,Le){var re=f.exec(pe.slice(Le));return re?(J.p=h.get(re[0].toLowerCase()),Le+re[0].length):-1}function V(J,pe,Le){var re=g.exec(pe.slice(Le));return re?(J.w=j.get(re[0].toLowerCase()),Le+re[0].length):-1}function L(J,pe,Le){var re=p.exec(pe.slice(Le));return re?(J.w=v.get(re[0].toLowerCase()),Le+re[0].length):-1}function K(J,pe,Le){var re=N.exec(pe.slice(Le));return re?(J.m=P.get(re[0].toLowerCase()),Le+re[0].length):-1}function te(J,pe,Le){var re=b.exec(pe.slice(Le));return re?(J.m=w.get(re[0].toLowerCase()),Le+re[0].length):-1}function R(J,pe,Le){return M(J,t,pe,Le)}function U(J,pe,Le){return M(J,r,pe,Le)}function F(J,pe,Le){return M(J,n,pe,Le)}function X(J){return s[J.getDay()]}function $(J){return a[J.getDay()]}function Y(J){return d[J.getMonth()]}function W(J){return u[J.getMonth()]}function I(J){return i[+(J.getHours()>=12)]}function H(J){return 1+~~(J.getMonth()/3)}function oe(J){return s[J.getUTCDay()]}function se(J){return a[J.getUTCDay()]}function be(J){return d[J.getUTCMonth()]}function Ae(J){return u[J.getUTCMonth()]}function de(J){return i[+(J.getUTCHours()>=12)]}function Se(J){return 1+~~(J.getUTCMonth()/3)}return{format:function(J){var pe=T(J+="",E);return pe.toString=function(){return J},pe},parse:function(J){var pe=A(J+="",!1);return pe.toString=function(){return J},pe},utcFormat:function(J){var pe=T(J+="",k);return pe.toString=function(){return J},pe},utcParse:function(J){var pe=A(J+="",!0);return pe.toString=function(){return J},pe}}}var m_={"-":"",_:" ",0:"0"},hr=/^\s*\d+/,LK=/^%/,$K=/[\\^$*+?|[\]().{}]/g;function Ze(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(t)+i:i)}function zK(e){return e.replace($K,"\\$&")}function Ac(e){return new RegExp("^(?:"+e.map(zK).join("|")+")","i")}function Tc(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function FK(e,t,r){var n=hr.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function BK(e,t,r){var n=hr.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function WK(e,t,r){var n=hr.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function UK(e,t,r){var n=hr.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function KK(e,t,r){var n=hr.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function p_(e,t,r){var n=hr.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function v_(e,t,r){var n=hr.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function qK(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 HK(e,t,r){var n=hr.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function VK(e,t,r){var n=hr.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function g_(e,t,r){var n=hr.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function YK(e,t,r){var n=hr.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function y_(e,t,r){var n=hr.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function GK(e,t,r){var n=hr.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function XK(e,t,r){var n=hr.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function QK(e,t,r){var n=hr.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function ZK(e,t,r){var n=hr.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function JK(e,t,r){var n=LK.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function e9(e,t,r){var n=hr.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function t9(e,t,r){var n=hr.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function x_(e,t){return Ze(e.getDate(),t,2)}function r9(e,t){return Ze(e.getHours(),t,2)}function n9(e,t){return Ze(e.getHours()%12||12,t,2)}function i9(e,t){return Ze(1+Iu.count(wa(e),e),t,3)}function xT(e,t){return Ze(e.getMilliseconds(),t,3)}function a9(e,t){return xT(e,t)+"000"}function o9(e,t){return Ze(e.getMonth()+1,t,2)}function s9(e,t){return Ze(e.getMinutes(),t,2)}function l9(e,t){return Ze(e.getSeconds(),t,2)}function c9(e){var t=e.getDay();return t===0?7:t}function u9(e,t){return Ze(zm.count(wa(e)-1,e),t,2)}function bT(e){var t=e.getDay();return t>=4||t===0?pl(e):pl.ceil(e)}function d9(e,t){return e=bT(e),Ze(pl.count(wa(e),e)+(wa(e).getDay()===4),t,2)}function f9(e){return e.getDay()}function h9(e,t){return Ze(Lh.count(wa(e)-1,e),t,2)}function m9(e,t){return Ze(e.getFullYear()%100,t,2)}function p9(e,t){return e=bT(e),Ze(e.getFullYear()%100,t,2)}function v9(e,t){return Ze(e.getFullYear()%1e4,t,4)}function g9(e,t){var r=e.getDay();return e=r>=4||r===0?pl(e):pl.ceil(e),Ze(e.getFullYear()%1e4,t,4)}function y9(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ze(t/60|0,"0",2)+Ze(t%60,"0",2)}function b_(e,t){return Ze(e.getUTCDate(),t,2)}function x9(e,t){return Ze(e.getUTCHours(),t,2)}function b9(e,t){return Ze(e.getUTCHours()%12||12,t,2)}function w9(e,t){return Ze(1+$m.count(ja(e),e),t,3)}function wT(e,t){return Ze(e.getUTCMilliseconds(),t,3)}function j9(e,t){return wT(e,t)+"000"}function S9(e,t){return Ze(e.getUTCMonth()+1,t,2)}function N9(e,t){return Ze(e.getUTCMinutes(),t,2)}function P9(e,t){return Ze(e.getUTCSeconds(),t,2)}function k9(e){var t=e.getUTCDay();return t===0?7:t}function _9(e,t){return Ze(Fm.count(ja(e)-1,e),t,2)}function jT(e){var t=e.getUTCDay();return t>=4||t===0?vl(e):vl.ceil(e)}function E9(e,t){return e=jT(e),Ze(vl.count(ja(e),e)+(ja(e).getUTCDay()===4),t,2)}function C9(e){return e.getUTCDay()}function O9(e,t){return Ze($h.count(ja(e)-1,e),t,2)}function A9(e,t){return Ze(e.getUTCFullYear()%100,t,2)}function T9(e,t){return e=jT(e),Ze(e.getUTCFullYear()%100,t,2)}function M9(e,t){return Ze(e.getUTCFullYear()%1e4,t,4)}function I9(e,t){var r=e.getUTCDay();return e=r>=4||r===0?vl(e):vl.ceil(e),Ze(e.getUTCFullYear()%1e4,t,4)}function R9(){return"+0000"}function w_(){return"%"}function j_(e){return+e}function S_(e){return Math.floor(+e/1e3)}var Hs,ST,NT;D9({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 D9(e){return Hs=DK(e),ST=Hs.format,Hs.parse,NT=Hs.utcFormat,Hs.utcParse,Hs}function L9(e){return new Date(e)}function $9(e){return e instanceof Date?+e:+new Date(+e)}function Tb(e,t,r,n,i,a,s,u,d,f){var h=yb(),p=h.invert,v=h.domain,g=f(".%L"),j=f(":%S"),b=f("%I:%M"),w=f("%I %p"),N=f("%a %d"),P=f("%b %d"),E=f("%B"),k=f("%Y");function C(T){return(d(T)<T?g:u(T)<T?j:s(T)<T?b:a(T)<T?w:n(T)<T?i(T)<T?N:P:r(T)<T?E:k)(T)}return h.invert=function(T){return new Date(p(T))},h.domain=function(T){return arguments.length?v(Array.from(T,$9)):v().map(L9)},h.ticks=function(T){var A=v();return e(A[0],A[A.length-1],T??10)},h.tickFormat=function(T,A){return A==null?C:f(A)},h.nice=function(T){var A=v();return(!T||typeof T.range!="function")&&(T=t(A[0],A[A.length-1],T??10)),T?v(uT(A,T)):h},h.copy=function(){return Mu(h,Tb(e,t,r,n,i,a,s,u,d,f))},h}function z9(){return Wn.apply(Tb(IK,RK,wa,Ob,zm,Iu,Eb,kb,Go,ST).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function F9(){return Wn.apply(Tb(TK,MK,ja,Ab,Fm,$m,Cb,_b,Go,NT).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Bm(){var e=0,t=1,r,n,i,a,s=Ir,u=!1,d;function f(p){return p==null||isNaN(p=+p)?d:s(i===0?.5:(p=(a(p)-r)*i,u?Math.max(0,Math.min(1,p)):p))}f.domain=function(p){return arguments.length?([e,t]=p,r=a(e=+e),n=a(t=+t),i=r===n?0:1/(n-r),f):[e,t]},f.clamp=function(p){return arguments.length?(u=!!p,f):u},f.interpolator=function(p){return arguments.length?(s=p,f):s};function h(p){return function(v){var g,j;return arguments.length?([g,j]=v,s=p(g,j),f):[s(0),s(1)]}}return f.range=h(El),f.rangeRound=h(gb),f.unknown=function(p){return arguments.length?(d=p,f):d},function(p){return a=p,r=p(e),n=p(t),i=r===n?0:1/(n-r),f}}function No(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function PT(){var e=So(Bm()(Ir));return e.copy=function(){return No(e,PT())},Aa.apply(e,arguments)}function kT(){var e=wb(Bm()).domain([1,10]);return e.copy=function(){return No(e,kT()).base(e.base())},Aa.apply(e,arguments)}function _T(){var e=jb(Bm());return e.copy=function(){return No(e,_T()).constant(e.constant())},Aa.apply(e,arguments)}function Mb(){var e=Sb(Bm());return e.copy=function(){return No(e,Mb()).exponent(e.exponent())},Aa.apply(e,arguments)}function B9(){return Mb.apply(null,arguments).exponent(.5)}function ET(){var e=[],t=Ir;function r(n){if(n!=null&&!isNaN(n=+n))return t((Au(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let i of n)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(po),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,i)=>t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>xU(e,a/n))},r.copy=function(){return ET(t).domain(e)},Aa.apply(r,arguments)}function Wm(){var e=0,t=.5,r=1,n=1,i,a,s,u,d,f=Ir,h,p=!1,v;function g(b){return isNaN(b=+b)?v:(b=.5+((b=+h(b))-a)*(n*b<n*a?u:d),f(p?Math.max(0,Math.min(1,b)):b))}g.domain=function(b){return arguments.length?([e,t,r]=b,i=h(e=+e),a=h(t=+t),s=h(r=+r),u=i===a?0:.5/(a-i),d=a===s?0:.5/(s-a),n=a<i?-1:1,g):[e,t,r]},g.clamp=function(b){return arguments.length?(p=!!b,g):p},g.interpolator=function(b){return arguments.length?(f=b,g):f};function j(b){return function(w){var N,P,E;return arguments.length?([N,P,E]=w,f=JU(b,[N,P,E]),g):[f(0),f(.5),f(1)]}}return g.range=j(El),g.rangeRound=j(gb),g.unknown=function(b){return arguments.length?(v=b,g):v},function(b){return h=b,i=b(e),a=b(t),s=b(r),u=i===a?0:.5/(a-i),d=a===s?0:.5/(s-a),n=a<i?-1:1,g}}function CT(){var e=So(Wm()(Ir));return e.copy=function(){return No(e,CT())},Aa.apply(e,arguments)}function OT(){var e=wb(Wm()).domain([.1,1,10]);return e.copy=function(){return No(e,OT()).base(e.base())},Aa.apply(e,arguments)}function AT(){var e=jb(Wm());return e.copy=function(){return No(e,AT()).constant(e.constant())},Aa.apply(e,arguments)}function Ib(){var e=Sb(Wm());return e.copy=function(){return No(e,Ib()).exponent(e.exponent())},Aa.apply(e,arguments)}function W9(){return Ib.apply(null,arguments).exponent(.5)}const Bc=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:mb,scaleDiverging:CT,scaleDivergingLog:OT,scaleDivergingPow:Ib,scaleDivergingSqrt:W9,scaleDivergingSymlog:AT,scaleIdentity:cT,scaleImplicit:Xx,scaleLinear:lT,scaleLog:dT,scaleOrdinal:hb,scalePoint:jU,scalePow:Nb,scaleQuantile:mT,scaleQuantize:pT,scaleRadial:hT,scaleSequential:PT,scaleSequentialLog:kT,scaleSequentialPow:Mb,scaleSequentialQuantile:ET,scaleSequentialSqrt:B9,scaleSequentialSymlog:_T,scaleSqrt:jK,scaleSymlog:fT,scaleThreshold:vT,scaleTime:z9,scaleUtc:F9,tickFormat:sT},Symbol.toStringTag,{value:"Module"}));var Ta=e=>e.chartData,Um=Q([Ta],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Rb=(e,t,r,n)=>n?Um(e):Ta(e),TT=(e,t,r)=>r?Um(e):Ta(e);function yo(e){if(Array.isArray(e)&&e.length===2){var[t,r]=e;if(nt(t)&&nt(r))return!0}return!1}function N_(e,t,r){return r?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function MT(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[r,n]=e,i,a;if(nt(r))i=r;else if(typeof r=="function")return;if(nt(n))a=n;else if(typeof n=="function")return;var s=[i,a];if(yo(s))return s}}function U9(e,t,r){if(!(!r&&t==null)){if(typeof e=="function"&&t!=null)try{var n=e(t,r);if(yo(n))return N_(n,t,r)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,s,u;if(i==="auto")t!=null&&(s=Math.min(...t));else if(ve(i))s=i;else if(typeof i=="function")try{t!=null&&(s=i(t==null?void 0:t[0]))}catch{}else if(typeof i=="string"&&IP.test(i)){var d=IP.exec(i);if(d==null||d[1]==null||t==null)s=void 0;else{var f=+d[1];s=t[0]-f}}else s=t==null?void 0:t[0];if(a==="auto")t!=null&&(u=Math.max(...t));else if(ve(a))u=a;else if(typeof a=="function")try{t!=null&&(u=a(t==null?void 0:t[1]))}catch{}else if(typeof a=="string"&&RP.test(a)){var h=RP.exec(a);if(h==null||h[1]==null||t==null)u=void 0;else{var p=+h[1];u=t[1]+p}}else u=t==null?void 0:t[1];var v=[s,u];if(yo(v))return t==null?v:N_(v,t,r)}}}var Cl=1e9,K9={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Lb,Pt=!0,Fn="[DecimalError] ",ts=Fn+"Invalid argument: ",Db=Fn+"Exponent out of range: ",Ol=Math.floor,Ko=Math.pow,q9=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,un,dr=1e7,xt=7,IT=9007199254740991,zh=Ol(IT/xt),je={};je.absoluteValue=je.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};je.comparedTo=je.cmp=function(e){var t,r,n,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=n<i?n:i;t<r;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};je.decimalPlaces=je.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*xt;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};je.dividedBy=je.div=function(e){return ma(this,new this.constructor(e))};je.dividedToIntegerBy=je.idiv=function(e){var t=this,r=t.constructor;return ft(ma(t,new r(e),0,1),r.precision)};je.equals=je.eq=function(e){return!this.cmp(e)};je.exponent=function(){return qt(this)};je.greaterThan=je.gt=function(e){return this.cmp(e)>0};je.greaterThanOrEqualTo=je.gte=function(e){return this.cmp(e)>=0};je.isInteger=je.isint=function(){return this.e>this.d.length-2};je.isNegative=je.isneg=function(){return this.s<0};je.isPositive=je.ispos=function(){return this.s>0};je.isZero=function(){return this.s===0};je.lessThan=je.lt=function(e){return this.cmp(e)<0};je.lessThanOrEqualTo=je.lte=function(e){return this.cmp(e)<1};je.logarithm=je.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(un))throw Error(Fn+"NaN");if(r.s<1)throw Error(Fn+(r.s?"NaN":"-Infinity"));return r.eq(un)?new n(0):(Pt=!1,t=ma(ou(r,a),ou(e,a),a),Pt=!0,ft(t,i))};je.minus=je.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?LT(t,e):RT(t,(e.s=-e.s,e))};je.modulo=je.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(Fn+"NaN");return r.s?(Pt=!1,t=ma(r,e,0,1).times(e),Pt=!0,r.minus(t)):ft(new n(r),i)};je.naturalExponential=je.exp=function(){return DT(this)};je.naturalLogarithm=je.ln=function(){return ou(this)};je.negated=je.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};je.plus=je.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?RT(t,e):LT(t,(e.s=-e.s,e))};je.precision=je.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ts+e);if(t=qt(i)+1,n=i.d.length-1,r=n*xt+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};je.squareRoot=je.sqrt=function(){var e,t,r,n,i,a,s,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(Fn+"NaN")}for(e=qt(u),Pt=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=ji(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Ol((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new d(t)):n=new d(i.toString()),r=d.precision,i=s=r+3;;)if(a=n,n=a.plus(ma(u,a,s+2)).times(.5),ji(a.d).slice(0,s)===(t=ji(n.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(ft(a,r+1,0),a.times(a).eq(u)){n=a;break}}else if(t!="9999")break;s+=4}return Pt=!0,ft(n,r)};je.times=je.mul=function(e){var t,r,n,i,a,s,u,d,f,h=this,p=h.constructor,v=h.d,g=(e=new p(e)).d;if(!h.s||!e.s)return new p(0);for(e.s*=h.s,r=h.e+e.e,d=v.length,f=g.length,d<f&&(a=v,v=g,g=a,s=d,d=f,f=s),a=[],s=d+f,n=s;n--;)a.push(0);for(n=f;--n>=0;){for(t=0,i=d+n;i>n;)u=a[i]+g[n]*v[i-n-1]+t,a[i--]=u%dr|0,t=u/dr|0;a[i]=(a[i]+t)%dr|0}for(;!a[--s];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,Pt?ft(e,p.precision):e};je.toDecimalPlaces=je.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Ei(e,0,Cl),t===void 0?t=n.rounding:Ei(t,0,8),ft(r,e+qt(r)+1,t))};je.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=ms(n,!0):(Ei(e,0,Cl),t===void 0?t=i.rounding:Ei(t,0,8),n=ft(new i(n),e+1,t),r=ms(n,!0,e+1)),r};je.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?ms(i):(Ei(e,0,Cl),t===void 0?t=a.rounding:Ei(t,0,8),n=ft(new a(i),e+qt(i)+1,t),r=ms(n.abs(),!1,e+qt(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};je.toInteger=je.toint=function(){var e=this,t=e.constructor;return ft(new t(e),qt(e)+1,t.rounding)};je.toNumber=function(){return+this};je.toPower=je.pow=function(e){var t,r,n,i,a,s,u=this,d=u.constructor,f=12,h=+(e=new d(e));if(!e.s)return new d(un);if(u=new d(u),!u.s){if(e.s<1)throw Error(Fn+"Infinity");return u}if(u.eq(un))return u;if(n=d.precision,e.eq(un))return ft(u,n);if(t=e.e,r=e.d.length-1,s=t>=r,a=u.s,s){if((r=h<0?-h:h)<=IT){for(i=new d(un),t=Math.ceil(n/xt+4),Pt=!1;r%2&&(i=i.times(u),k_(i.d,t)),r=Ol(r/2),r!==0;)u=u.times(u),k_(u.d,t);return Pt=!0,e.s<0?new d(un).div(i):ft(i,n)}}else if(a<0)throw Error(Fn+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,u.s=1,Pt=!1,i=e.times(ou(u,n+f)),Pt=!0,i=DT(i),i.s=a,i};je.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=qt(i),n=ms(i,r<=a.toExpNeg||r>=a.toExpPos)):(Ei(e,1,Cl),t===void 0?t=a.rounding:Ei(t,0,8),i=ft(new a(i),e,t),r=qt(i),n=ms(i,e<=r||r<=a.toExpNeg,e)),n};je.toSignificantDigits=je.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Ei(e,1,Cl),t===void 0?t=n.rounding:Ei(t,0,8)),ft(new n(r),e,t)};je.toString=je.valueOf=je.val=je.toJSON=je[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=qt(e),r=e.constructor;return ms(e,t<=r.toExpNeg||t>=r.toExpPos)};function RT(e,t){var r,n,i,a,s,u,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),Pt?ft(t,p):t;if(d=e.d,f=t.d,s=e.e,i=t.e,d=d.slice(),a=s-i,a){for(a<0?(n=d,a=-a,u=f.length):(n=f,i=s,u=d.length),s=Math.ceil(p/xt),u=s>u?s+1:u+1,a>u&&(a=u,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(u=d.length,a=f.length,u-a<0&&(a=u,n=f,f=d,d=n),r=0;a;)r=(d[--a]=d[a]+f[a]+r)/dr|0,d[a]%=dr;for(r&&(d.unshift(r),++i),u=d.length;d[--u]==0;)d.pop();return t.d=d,t.e=i,Pt?ft(t,p):t}function Ei(e,t,r){if(e!==~~e||e<t||e>r)throw Error(ts+e)}function ji(e){var t,r,n,i=e.length-1,a="",s=e[0];if(i>0){for(a+=s,t=1;t<i;t++)n=e[t]+"",r=xt-n.length,r&&(a+=so(r)),a+=n;s=e[t],n=s+"",r=xt-n.length,r&&(a+=so(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return a+s}var ma=(function(){function e(n,i){var a,s=0,u=n.length;for(n=n.slice();u--;)a=n[u]*i+s,n[u]=a%dr|0,s=a/dr|0;return s&&n.unshift(s),n}function t(n,i,a,s){var u,d;if(a!=s)d=a>s?1:-1;else for(u=d=0;u<a;u++)if(n[u]!=i[u]){d=n[u]>i[u]?1:-1;break}return d}function r(n,i,a){for(var s=0;a--;)n[a]-=s,s=n[a]<i[a]?1:0,n[a]=s*dr+n[a]-i[a];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,a,s){var u,d,f,h,p,v,g,j,b,w,N,P,E,k,C,T,A,M,z=n.constructor,V=n.s==i.s?1:-1,L=n.d,K=i.d;if(!n.s)return new z(n);if(!i.s)throw Error(Fn+"Division by zero");for(d=n.e-i.e,A=K.length,C=L.length,g=new z(V),j=g.d=[],f=0;K[f]==(L[f]||0);)++f;if(K[f]>(L[f]||0)&&--d,a==null?P=a=z.precision:s?P=a+(qt(n)-qt(i))+1:P=a,P<0)return new z(0);if(P=P/xt+2|0,f=0,A==1)for(h=0,K=K[0],P++;(f<C||h)&&P--;f++)E=h*dr+(L[f]||0),j[f]=E/K|0,h=E%K|0;else{for(h=dr/(K[0]+1)|0,h>1&&(K=e(K,h),L=e(L,h),A=K.length,C=L.length),k=A,b=L.slice(0,A),w=b.length;w<A;)b[w++]=0;M=K.slice(),M.unshift(0),T=K[0],K[1]>=dr/2&&++T;do h=0,u=t(K,b,A,w),u<0?(N=b[0],A!=w&&(N=N*dr+(b[1]||0)),h=N/T|0,h>1?(h>=dr&&(h=dr-1),p=e(K,h),v=p.length,w=b.length,u=t(p,b,v,w),u==1&&(h--,r(p,A<v?M:K,v))):(h==0&&(u=h=1),p=K.slice()),v=p.length,v<w&&p.unshift(0),r(b,p,w),u==-1&&(w=b.length,u=t(K,b,A,w),u<1&&(h++,r(b,A<w?M:K,w))),w=b.length):u===0&&(h++,b=[0]),j[f++]=h,u&&b[0]?b[w++]=L[k]||0:(b=[L[k]],w=1);while((k++<C||b[0]!==void 0)&&P--)}return j[0]||j.shift(),g.e=d,ft(g,s?a+qt(g)+1:a)}})();function DT(e,t){var r,n,i,a,s,u,d=0,f=0,h=e.constructor,p=h.precision;if(qt(e)>16)throw Error(Db+qt(e));if(!e.s)return new h(un);for(Pt=!1,u=p,s=new h(.03125);e.abs().gte(.1);)e=e.times(s),f+=5;for(n=Math.log(Ko(2,f))/Math.LN10*2+5|0,u+=n,r=i=a=new h(un),h.precision=u;;){if(i=ft(i.times(e),u),r=r.times(++d),s=a.plus(ma(i,r,u)),ji(s.d).slice(0,u)===ji(a.d).slice(0,u)){for(;f--;)a=ft(a.times(a),u);return h.precision=p,t==null?(Pt=!0,ft(a,p)):a}a=s}}function qt(e){for(var t=e.e*xt,r=e.d[0];r>=10;r/=10)t++;return t}function Ay(e,t,r){if(t>e.LN10.sd())throw Pt=!0,r&&(e.precision=r),Error(Fn+"LN10 precision limit exceeded");return ft(new e(e.LN10),t)}function so(e){for(var t="";e--;)t+="0";return t}function ou(e,t){var r,n,i,a,s,u,d,f,h,p=1,v=10,g=e,j=g.d,b=g.constructor,w=b.precision;if(g.s<1)throw Error(Fn+(g.s?"NaN":"-Infinity"));if(g.eq(un))return new b(0);if(t==null?(Pt=!1,f=w):f=t,g.eq(10))return t==null&&(Pt=!0),Ay(b,f);if(f+=v,b.precision=f,r=ji(j),n=r.charAt(0),a=qt(g),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)g=g.times(e),r=ji(g.d),n=r.charAt(0),p++;a=qt(g),n>1?(g=new b("0."+r),a++):g=new b(n+"."+r.slice(1))}else return d=Ay(b,f+2,w).times(a+""),g=ou(new b(n+"."+r.slice(1)),f-v).plus(d),b.precision=w,t==null?(Pt=!0,ft(g,w)):g;for(u=s=g=ma(g.minus(un),g.plus(un),f),h=ft(g.times(g),f),i=3;;){if(s=ft(s.times(h),f),d=u.plus(ma(s,new b(i),f)),ji(d.d).slice(0,f)===ji(u.d).slice(0,f))return u=u.times(2),a!==0&&(u=u.plus(Ay(b,f+2,w).times(a+""))),u=ma(u,new b(p),f),b.precision=w,t==null?(Pt=!0,ft(u,w)):u;u=d,i+=2}}function P_(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Ol(r/xt),e.d=[],n=(r+1)%xt,r<0&&(n+=xt),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=xt;n<i;)e.d.push(+t.slice(n,n+=xt));t=t.slice(n),n=xt-t.length}else n-=i;for(;n--;)t+="0";if(e.d.push(+t),Pt&&(e.e>zh||e.e<-zh))throw Error(Db+r)}else e.s=0,e.e=0,e.d=[0];return e}function ft(e,t,r){var n,i,a,s,u,d,f,h,p=e.d;for(s=1,a=p[0];a>=10;a/=10)s++;if(n=t-s,n<0)n+=xt,i=t,f=p[h=0];else{if(h=Math.ceil((n+1)/xt),a=p.length,h>=a)return e;for(f=a=p[h],s=1;a>=10;a/=10)s++;n%=xt,i=n-xt+s}if(r!==void 0&&(a=Ko(10,s-i-1),u=f/a%10|0,d=t<0||p[h+1]!==void 0||f%a,d=r<4?(u||d)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||d||r==6&&(n>0?i>0?f/Ko(10,s-i):0:p[h-1])%10&1||r==(e.s<0?8:7))),t<1||!p[0])return d?(a=qt(e),p.length=1,t=t-a-1,p[0]=Ko(10,(xt-t%xt)%xt),e.e=Ol(-t/xt)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(n==0?(p.length=h,a=1,h--):(p.length=h+1,a=Ko(10,xt-n),p[h]=i>0?(f/Ko(10,s-i)%Ko(10,i)|0)*a:0),d)for(;;)if(h==0){(p[0]+=a)==dr&&(p[0]=1,++e.e);break}else{if(p[h]+=a,p[h]!=dr)break;p[h--]=0,a=1}for(n=p.length;p[--n]===0;)p.pop();if(Pt&&(e.e>zh||e.e<-zh))throw Error(Db+qt(e));return e}function LT(e,t){var r,n,i,a,s,u,d,f,h,p,v=e.constructor,g=v.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new v(e),Pt?ft(t,g):t;if(d=e.d,p=t.d,n=t.e,f=e.e,d=d.slice(),s=f-n,s){for(h=s<0,h?(r=d,s=-s,u=p.length):(r=p,n=f,u=d.length),i=Math.max(Math.ceil(g/xt),u)+2,s>i&&(s=i,r.length=1),r.reverse(),i=s;i--;)r.push(0);r.reverse()}else{for(i=d.length,u=p.length,h=i<u,h&&(u=i),i=0;i<u;i++)if(d[i]!=p[i]){h=d[i]<p[i];break}s=0}for(h&&(r=d,d=p,p=r,t.s=-t.s),u=d.length,i=p.length-u;i>0;--i)d[u++]=0;for(i=p.length;i>s;){if(d[--i]<p[i]){for(a=i;a&&d[--a]===0;)d[a]=dr-1;--d[a],d[i]+=dr}d[i]-=p[i]}for(;d[--u]===0;)d.pop();for(;d[0]===0;d.shift())--n;return d[0]?(t.d=d,t.e=n,Pt?ft(t,g):t):new v(0)}function ms(e,t,r){var n,i=qt(e),a=ji(e.d),s=a.length;return t?(r&&(n=r-s)>0?a=a.charAt(0)+"."+a.slice(1)+so(n):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+so(-i-1)+a,r&&(n=r-s)>0&&(a+=so(n))):i>=s?(a+=so(i+1-s),r&&(n=r-i-1)>0&&(a=a+"."+so(n))):((n=i+1)<s&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-s)>0&&(i+1===s&&(a+="."),a+=so(n))),e.s<0?"-"+a:a}function k_(e,t){if(e.length>t)return e.length=t,!0}function $T(e){var t,r,n;function i(a){var s=this;if(!(s instanceof i))return new i(a);if(s.constructor=i,a instanceof i){s.s=a.s,s.e=a.e,s.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(ts+a);if(a>0)s.s=1;else if(a<0)a=-a,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(a===~~a&&a<1e7){s.e=0,s.d=[a];return}return P_(s,a.toString())}else if(typeof a!="string")throw Error(ts+a);if(a.charCodeAt(0)===45?(a=a.slice(1),s.s=-1):s.s=1,q9.test(a))P_(s,a);else throw Error(ts+a)}if(i.prototype=je,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=$T,i.config=i.set=H9,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function H9(e){if(!e||typeof e!="object")throw Error(Fn+"Object expected");var t,r,n,i=["precision",1,Cl,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((n=e[r=i[t]])!==void 0)if(Ol(n)===n&&n>=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(ts+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(ts+r+": "+n);return this}var Lb=$T(K9);un=new Lb(1);const ut=Lb;var V9=e=>e,zT={},FT=e=>e===zT,__=e=>function t(){return arguments.length===0||arguments.length===1&&FT(arguments.length<=0?void 0:arguments[0])?t:e(...arguments)},BT=(e,t)=>e===1?t:__(function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var a=n.filter(s=>s!==zT).length;return a>=e?t(...n):BT(e-a,__(function(){for(var s=arguments.length,u=new Array(s),d=0;d<s;d++)u[d]=arguments[d];var f=n.map(h=>FT(h)?u.shift():h);return t(...f,...u)}))}),Y9=e=>BT(e.length,e),t0=(e,t)=>{for(var r=[],n=e;n<t;++n)r[n-e]=n;return r},G9=Y9((e,t)=>Array.isArray(t)?t.map(e):Object.keys(t).map(r=>t[r]).map(e)),X9=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(!r.length)return V9;var i=r.reverse(),a=i[0],s=i.slice(1);return function(){return s.reduce((u,d)=>d(u),a(...arguments))}};function WT(e){var t;return e===0?t=1:t=Math.floor(new ut(e).abs().log(10).toNumber())+1,t}function UT(e,t,r){for(var n=new ut(e),i=0,a=[];n.lt(t)&&i<1e5;)a.push(n.toNumber()),n=n.add(r),i++;return a}var KT=e=>{var[t,r]=e,[n,i]=[t,r];return t>r&&([n,i]=[r,t]),[n,i]},qT=(e,t,r)=>{if(e.lte(0))return new ut(0);var n=WT(e.toNumber()),i=new ut(10).pow(n),a=e.div(i),s=n!==1?.05:.1,u=new ut(Math.ceil(a.div(s).toNumber())).add(r).mul(s),d=u.mul(i);return t?new ut(d.toNumber()):new ut(Math.ceil(d.toNumber()))},Q9=(e,t,r)=>{var n=new ut(1),i=new ut(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new ut(10).pow(WT(e)-1),i=new ut(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new ut(Math.floor(e)))}else e===0?i=new ut(Math.floor((t-1)/2)):r||(i=new ut(Math.floor(e)));var s=Math.floor((t-1)/2),u=X9(G9(d=>i.add(new ut(d-s).mul(n)).toNumber()),t0);return u(0,t)},HT=function(t,r,n,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((r-t)/(n-1)))return{step:new ut(0),tickMin:new ut(0),tickMax:new ut(0)};var s=qT(new ut(r).sub(t).div(n-1),i,a),u;t<=0&&r>=0?u=new ut(0):(u=new ut(t).add(r).div(2),u=u.sub(new ut(u).mod(s)));var d=Math.ceil(u.sub(t).div(s).toNumber()),f=Math.ceil(new ut(r).sub(u).div(s).toNumber()),h=d+f+1;return h>n?HT(t,r,n,i,a+1):(h<n&&(f=r>0?f+(n-h):f,d=r>0?d:d+(n-h)),{step:s,tickMin:u.sub(new ut(d).mul(s)),tickMax:u.add(new ut(f).mul(s))})},Z9=function(t){var[r,n]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(i,2),[u,d]=KT([r,n]);if(u===-1/0||d===1/0){var f=d===1/0?[u,...t0(0,i-1).map(()=>1/0)]:[...t0(0,i-1).map(()=>-1/0),d];return r>n?f.reverse():f}if(u===d)return Q9(u,i,a);var{step:h,tickMin:p,tickMax:v}=HT(u,d,s,a,0),g=UT(p,v.add(new ut(.1).mul(h)),h);return r>n?g.reverse():g},J9=function(t,r){var[n,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[s,u]=KT([n,i]);if(s===-1/0||u===1/0)return[n,i];if(s===u)return[s];var d=Math.max(r,2),f=qT(new ut(u).sub(s).div(d-1),a,0),h=[...UT(new ut(s),new ut(u),f),u];return a===!1&&(h=h.map(p=>Math.round(p))),n>i?h.reverse():h},VT=e=>e.rootProps.maxBarSize,eq=e=>e.rootProps.barGap,YT=e=>e.rootProps.barCategoryGap,tq=e=>e.rootProps.barSize,Ru=e=>e.rootProps.stackOffset,GT=e=>e.rootProps.reverseStackOrder,$b=e=>e.options.chartName,zb=e=>e.rootProps.syncId,XT=e=>e.rootProps.syncMethod,Fb=e=>e.options.eventEmitter,rq=e=>e.rootProps.baseValue,$t={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},la={allowDuplicatedCategory:!0,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"category"},cn={allowDataOverflow:!1,allowDuplicatedCategory:!0,radiusAxisId:0,scale:"auto",tick:!0,tickCount:5,type:"number"},Km=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t},nq={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:la.angleAxisId,includeHidden:!1,name:void 0,reversed:la.reversed,scale:la.scale,tick:la.tick,tickCount:void 0,ticks:void 0,type:la.type,unit:void 0},iq={allowDataOverflow:cn.allowDataOverflow,allowDecimals:!1,allowDuplicatedCategory:cn.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:cn.radiusAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:cn.scale,tick:cn.tick,tickCount:cn.tickCount,ticks:void 0,type:cn.type,unit:void 0},aq={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:la.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:la.angleAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:la.scale,tick:la.tick,tickCount:void 0,ticks:void 0,type:"number",unit:void 0},oq={allowDataOverflow:cn.allowDataOverflow,allowDecimals:!1,allowDuplicatedCategory:cn.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:cn.radiusAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:cn.scale,tick:cn.tick,tickCount:cn.tickCount,ticks:void 0,type:"category",unit:void 0},Bb=(e,t)=>e.polarAxis.angleAxis[t]!=null?e.polarAxis.angleAxis[t]:e.layout.layoutType==="radial"?aq:nq,Wb=(e,t)=>e.polarAxis.radiusAxis[t]!=null?e.polarAxis.radiusAxis[t]:e.layout.layoutType==="radial"?oq:iq,qm=e=>e.polarOptions,Ub=Q([Ca,Oa,Jt],K2),QT=Q([qm,Ub],(e,t)=>{if(e!=null)return _r(e.innerRadius,t,0)}),ZT=Q([qm,Ub],(e,t)=>{if(e!=null)return _r(e.outerRadius,t,t*.8)}),sq=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:r}=e;return[t,r]},JT=Q([qm],sq);Q([Bb,JT],Km);var eM=Q([Ub,QT,ZT],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});Q([Wb,eM],Km);var tM=Q([qe,qm,QT,ZT,Ca,Oa],(e,t,r,n,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||r==null||n==null)){var{cx:s,cy:u,startAngle:d,endAngle:f}=t;return{cx:_r(s,i,i/2),cy:_r(u,a,a/2),innerRadius:r,outerRadius:n,startAngle:d,endAngle:f,clockWise:!1}}}),kt=(e,t)=>t,Du=(e,t,r)=>r;function Hm(e){return e==null?void 0:e.id}function rM(e,t,r){var{chartData:n=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=r,s=new Map;return e.forEach(u=>{var d,f=(d=u.data)!==null&&d!==void 0?d:n;if(!(f==null||f.length===0)){var h=Hm(u);f.forEach((p,v)=>{var g=a==null||i?v:String(at(p,a,null)),j=at(p,u.dataKey,0),b;s.has(g)?b=s.get(g):b={},Object.assign(b,{[h]:j}),s.set(g,b)})}}),Array.from(s.values())}function Vm(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Ym=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Gm(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function lq(e,t){if(e.length===t.length){for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return!1}var rr=e=>{var t=qe(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Al=e=>e.tooltip.settings.axisId;function E_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Fh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?E_(Object(r),!0).forEach(function(n){cq(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E_(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cq(e,t,r){return(t=uq(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uq(e){var t=dq(e,"string");return typeof t=="symbol"?t:t+""}function dq(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var r0=[0,"auto"],cr={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0},nM=(e,t)=>e.cartesianAxis.xAxis[t],Di=(e,t)=>{var r=nM(e,t);return r??cr},ur={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:r0,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,width:_u},iM=(e,t)=>e.cartesianAxis.yAxis[t],Li=(e,t)=>{var r=iM(e,t);return r??ur},fq={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},Kb=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??fq},It=(e,t,r)=>{switch(t){case"xAxis":return Di(e,r);case"yAxis":return Li(e,r);case"zAxis":return Kb(e,r);case"angleAxis":return Bb(e,r);case"radiusAxis":return Wb(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},hq=(e,t,r)=>{switch(t){case"xAxis":return Di(e,r);case"yAxis":return Li(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},Lu=(e,t,r)=>{switch(t){case"xAxis":return Di(e,r);case"yAxis":return Li(e,r);case"angleAxis":return Bb(e,r);case"radiusAxis":return Wb(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},aM=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function qb(e,t){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===t;case"yAxis":return"yAxisId"in r&&r.yAxisId===t;case"zAxis":return"zAxisId"in r&&r.zAxisId===t;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===t;default:return!1}}}var $u=e=>e.graphicalItems.cartesianItems,mq=Q([kt,Du],qb),Hb=(e,t,r)=>e.filter(r).filter(n=>(t==null?void 0:t.includeHidden)===!0?!0:!n.hide),zu=Q([$u,It,mq],Hb,{memoizeOptions:{resultEqualityCheck:Gm}}),oM=Q([zu],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Vm)),sM=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),pq=Q([zu],sM),Vb=e=>e.map(t=>t.data).filter(Boolean).flat(1),vq=Q([zu],Vb,{memoizeOptions:{resultEqualityCheck:Gm}}),Yb=(e,t)=>{var{chartData:r=[],dataStartIndex:n,dataEndIndex:i}=t;return e.length>0?e:r.slice(n,i+1)},Gb=Q([vq,Rb],Yb),Xb=(e,t,r)=>(t==null?void 0:t.dataKey)!=null?e.map(n=>({value:at(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(i=>({value:at(i,n)}))):e.map(n=>({value:n})),Xm=Q([Gb,It,zu],Xb);function lM(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function qf(e){if($n(e)||e instanceof Date){var t=Number(e);if(nt(t))return t}}function C_(e){if(Array.isArray(e)){var t=[qf(e[0]),qf(e[1])];return yo(t)?t:void 0}var r=qf(e);if(r!=null)return[r,r]}function Sa(e){return e.map(qf).filter(rF)}function gq(e,t,r){return!r||typeof t!="number"||Xr(t)?[]:r.length?Sa(r.flatMap(n=>{var i=at(e,n.dataKey),a,s;if(Array.isArray(i)?[a,s]=i:a=s=i,!(!nt(a)||!nt(s)))return[t-a,t+s]})):[]}var nr=e=>{var t=rr(e),r=Al(e);return Lu(e,t,r)},Fu=Q([nr],e=>e==null?void 0:e.dataKey),yq=Q([oM,Rb,nr],rM),cM=(e,t,r,n)=>{var i={},a=t.reduce((s,u)=>{if(u.stackId==null)return s;var d=s[u.stackId];return d==null&&(d=[]),d.push(u),s[u.stackId]=d,s},i);return Object.fromEntries(Object.entries(a).map(s=>{var[u,d]=s,f=n?[...d].reverse():d,h=f.map(Hm);return[u,{stackedData:C6(e,h,r),graphicalItems:f}]}))},Bh=Q([yq,oM,Ru,GT],cM),uM=(e,t,r,n)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(n==null&&r!=="zAxis"){var s=M6(e,i,a);if(!(s!=null&&s[0]===0&&s[1]===0))return s}},xq=Q([It],e=>e.allowDataOverflow),Qb=e=>{var t;if(e==null||!("domain"in e))return r0;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=Sa(e.ticks);return[Math.min(...r),Math.max(...r)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:r0},Zb=Q([It],Qb),Jb=Q([Zb,xq],MT),bq=Q([Bh,Ta,kt,Jb],uM,{memoizeOptions:{resultEqualityCheck:Ym}}),Qm=e=>e.errorBars,wq=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>lM(r,n)),Wh=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=r.filter(Boolean);if(i.length!==0){var a=i.flat(),s=Math.min(...a),u=Math.max(...a);return[s,u]}},ew=(e,t,r,n,i)=>{var a,s;if(r.length>0&&e.forEach(u=>{r.forEach(d=>{var f,h,p=(f=n[d.id])===null||f===void 0?void 0:f.filter(N=>lM(i,N)),v=at(u,(h=t.dataKey)!==null&&h!==void 0?h:d.dataKey),g=gq(u,v,p);if(g.length>=2){var j=Math.min(...g),b=Math.max(...g);(a==null||j<a)&&(a=j),(s==null||b>s)&&(s=b)}var w=C_(v);w!=null&&(a=a==null?w[0]:Math.min(a,w[0]),s=s==null?w[1]:Math.max(s,w[1]))})}),(t==null?void 0:t.dataKey)!=null&&e.forEach(u=>{var d=C_(at(u,t.dataKey));d!=null&&(a=a==null?d[0]:Math.min(a,d[0]),s=s==null?d[1]:Math.max(s,d[1]))}),nt(a)&&nt(s))return[a,s]},jq=Q([Gb,It,pq,Qm,kt],ew,{memoizeOptions:{resultEqualityCheck:Ym}});function Sq(e){var{value:t}=e;if($n(t)||t instanceof Date)return t}var Nq=(e,t,r)=>{var n=e.map(Sq).filter(i=>i!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&jA(n))?Y2(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},dM=e=>e.referenceElements.dots,Tl=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),Pq=Q([dM,kt,Du],Tl),fM=e=>e.referenceElements.areas,kq=Q([fM,kt,Du],Tl),hM=e=>e.referenceElements.lines,_q=Q([hM,kt,Du],Tl),mM=(e,t)=>{if(e!=null){var r=Sa(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},Eq=Q(Pq,kt,mM),pM=(e,t)=>{if(e!=null){var r=Sa(e.flatMap(n=>[t==="xAxis"?n.x1:n.y1,t==="xAxis"?n.x2:n.y2]));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},Cq=Q([kq,kt],pM);function Oq(e){var t;if(e.x!=null)return Sa([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.x);return r==null||r.length===0?[]:Sa(r)}function Aq(e){var t;if(e.y!=null)return Sa([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.y);return r==null||r.length===0?[]:Sa(r)}var vM=(e,t)=>{if(e!=null){var r=e.flatMap(n=>t==="xAxis"?Oq(n):Aq(n));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},Tq=Q([_q,kt],vM),Mq=Q(Eq,Tq,Cq,(e,t,r)=>Wh(e,r,t)),tw=(e,t,r,n,i,a,s,u)=>{if(r!=null)return r;var d=s==="vertical"&&u==="xAxis"||s==="horizontal"&&u==="yAxis",f=d?Wh(n,a,i):Wh(a,i);return U9(t,f,e.allowDataOverflow)},Iq=Q([It,Zb,Jb,bq,jq,Mq,qe,kt],tw,{memoizeOptions:{resultEqualityCheck:Ym}}),Rq=[0,1],rw=(e,t,r,n,i,a,s)=>{if(!((e==null||r==null||r.length===0)&&s===void 0)){var{dataKey:u,type:d}=e,f=Ri(t,a);if(f&&u==null){var h;return Y2(0,(h=r==null?void 0:r.length)!==null&&h!==void 0?h:0)}return d==="category"?Nq(n,e,f):i==="expand"?Rq:s}},nw=Q([It,qe,Gb,Xm,Ru,kt,Iq],rw),gM=(e,t,r,n,i)=>{if(e!=null){var{scale:a,type:s}=e;if(a==="auto")return t==="radial"&&i==="radiusAxis"?"band":t==="radial"&&i==="angleAxis"?"linear":s==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?"point":s==="category"?"band":"linear";if(typeof a=="string"){var u="scale".concat(ju(a));return u in Bc?u:"point"}}},Ml=Q([It,qe,aM,$b,kt],gM);function Dq(e){if(e!=null){if(e in Bc)return Bc[e]();var t="scale".concat(ju(e));if(t in Bc)return Bc[t]()}}function iw(e,t,r,n){if(!(r==null||n==null)){if(typeof e.scale=="function")return e.scale.copy().domain(r).range(n);var i=Dq(t);if(i!=null){var a=i.domain(r).range(n);return N6(a),a}}}var aw=(e,t,r)=>{var n=Qb(t);if(!(r!=="auto"&&r!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(n)&&(n[0]==="auto"||n[1]==="auto")&&yo(e))return Z9(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&yo(e))return J9(e,t.tickCount,t.allowDecimals)}},ow=Q([nw,Lu,Ml],aw),sw=(e,t,r,n)=>{if(n!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&yo(t)&&Array.isArray(r)&&r.length>0){var i=t[0],a=r[0],s=t[1],u=r[r.length-1];return[Math.min(i,a),Math.max(s,u)]}return t},Lq=Q([It,nw,ow,kt],sw),$q=Q(Xm,It,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(Sa(e.map(p=>p.value))).sort((p,v)=>p-v),i=n[0],a=n[n.length-1];if(i==null||a==null)return 1/0;var s=a-i;if(s===0)return 1/0;for(var u=0;u<n.length-1;u++){var d=n[u],f=n[u+1];if(!(d==null||f==null)){var h=f-d;r=Math.min(r,h)}}return r/s}}),yM=Q($q,qe,YT,Jt,(e,t,r,n,i)=>i,(e,t,r,n,i)=>{if(!nt(e))return 0;var a=t==="vertical"?n.height:n.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var s=_r(r,e*a),u=e*a/2;return u-s-(u-s)/a*s}return 0}),zq=(e,t,r)=>{var n=Di(e,t);return n==null||typeof n.padding!="string"?0:yM(e,"xAxis",t,r,n.padding)},Fq=(e,t,r)=>{var n=Li(e,t);return n==null||typeof n.padding!="string"?0:yM(e,"yAxis",t,r,n.padding)},Bq=Q(Di,zq,(e,t)=>{var r,n;if(e==null)return{left:0,right:0};var{padding:i}=e;return typeof i=="string"?{left:t,right:t}:{left:((r=i.left)!==null&&r!==void 0?r:0)+t,right:((n=i.right)!==null&&n!==void 0?n:0)+t}}),Wq=Q(Li,Fq,(e,t)=>{var r,n;if(e==null)return{top:0,bottom:0};var{padding:i}=e;return typeof i=="string"?{top:t,bottom:t}:{top:((r=i.top)!==null&&r!==void 0?r:0)+t,bottom:((n=i.bottom)!==null&&n!==void 0?n:0)+t}}),Uq=Q([Jt,Bq,Tm,Am,(e,t,r)=>r],(e,t,r,n,i)=>{var{padding:a}=n;return i?[a.left,r.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),Kq=Q([Jt,qe,Wq,Tm,Am,(e,t,r)=>r],(e,t,r,n,i,a)=>{var{padding:s}=i;return a?[n.height-s.bottom,s.top]:t==="horizontal"?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),Bu=(e,t,r,n)=>{var i;switch(t){case"xAxis":return Uq(e,r,n);case"yAxis":return Kq(e,r,n);case"zAxis":return(i=Kb(e,r))===null||i===void 0?void 0:i.range;case"angleAxis":return JT(e);case"radiusAxis":return eM(e,r);default:return}},xM=Q([It,Bu],Km),gl=Q([It,Ml,Lq,xM],iw);Q([zu,Qm,kt],wq);function bM(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Zm=(e,t)=>t,Jm=(e,t,r)=>r,qq=Q(Cm,Zm,Jm,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(bM)),Hq=Q(Om,Zm,Jm,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(bM)),wM=(e,t)=>({width:e.width,height:t.height}),Vq=(e,t)=>{var r=typeof t.width=="number"?t.width:_u;return{width:r,height:e.height}},jM=Q(Jt,Di,wM),Yq=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},Gq=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},Xq=Q(Oa,Jt,qq,Zm,Jm,(e,t,r,n,i)=>{var a={},s;return r.forEach(u=>{var d=wM(t,u);s==null&&(s=Yq(t,n,e));var f=n==="top"&&!i||n==="bottom"&&i;a[u.id]=s-Number(f)*d.height,s+=(f?-1:1)*d.height}),a}),Qq=Q(Ca,Jt,Hq,Zm,Jm,(e,t,r,n,i)=>{var a={},s;return r.forEach(u=>{var d=Vq(t,u);s==null&&(s=Gq(t,n,e));var f=n==="left"&&!i||n==="right"&&i;a[u.id]=s-Number(f)*d.width,s+=(f?-1:1)*d.width}),a}),Zq=(e,t)=>{var r=Di(e,t);if(r!=null)return Xq(e,r.orientation,r.mirror)},Jq=Q([Jt,Di,Zq,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var i=r==null?void 0:r[n];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),eH=(e,t)=>{var r=Li(e,t);if(r!=null)return Qq(e,r.orientation,r.mirror)},tH=Q([Jt,Li,eH,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var i=r==null?void 0:r[n];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),SM=Q(Jt,Li,(e,t)=>{var r=typeof t.width=="number"?t.width:_u;return{width:r,height:e.height}}),O_=(e,t,r)=>{switch(t){case"xAxis":return jM(e,r).width;case"yAxis":return SM(e,r).height;default:return}},NM=(e,t,r,n)=>{if(r!=null){var{allowDuplicatedCategory:i,type:a,dataKey:s}=r,u=Ri(e,n),d=t.map(f=>f.value);if(s&&u&&a==="category"&&i&&jA(d))return d}},lw=Q([qe,Xm,It,kt],NM),PM=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var{type:i,scale:a}=r,s=Ri(e,n);if(s&&(i==="number"||a!=="auto"))return t.map(u=>u.value)}},cw=Q([qe,Xm,Lu,kt],PM),A_=Q([qe,hq,Ml,gl,lw,cw,Bu,ow,kt],(e,t,r,n,i,a,s,u,d)=>{if(t!=null){var f=Ri(e,d);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:d,categoricalDomain:a,duplicateDomain:i,isCategorical:f,niceTicks:u,range:s,realScaleType:r,scale:n}}}),rH=(e,t,r,n,i,a,s,u,d)=>{if(!(t==null||n==null)){var f=Ri(e,d),{type:h,ticks:p,tickCount:v}=t,g=r==="scaleBand"&&typeof n.bandwidth=="function"?n.bandwidth()/2:2,j=h==="category"&&n.bandwidth?n.bandwidth()/g:0;j=d==="angleAxis"&&a!=null&&a.length>=2?fr(a[0]-a[1])*2*j:j;var b=p||i;if(b){var w=b.map((N,P)=>{var E=s?s.indexOf(N):N;return{index:P,coordinate:n(E)+j,value:N,offset:j}});return w.filter(N=>nt(N.coordinate))}return f&&u?u.map((N,P)=>({coordinate:n(N)+j,value:N,index:P,offset:j})).filter(N=>nt(N.coordinate)):n.ticks?n.ticks(v).map(N=>({coordinate:n(N)+j,value:N,offset:j})):n.domain().map((N,P)=>({coordinate:n(N)+j,value:s?s[N]:N,index:P,offset:j}))}},kM=Q([qe,Lu,Ml,gl,ow,Bu,lw,cw,kt],rH),nH=(e,t,r,n,i,a,s)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var u=Ri(e,s),{tickCount:d}=t,f=0;return f=s==="angleAxis"&&(n==null?void 0:n.length)>=2?fr(n[0]-n[1])*2*f:f,u&&a?a.map((h,p)=>({coordinate:r(h)+f,value:h,index:p,offset:f})):r.ticks?r.ticks(d).map(h=>({coordinate:r(h)+f,value:h,offset:f})):r.domain().map((h,p)=>({coordinate:r(h)+f,value:i?i[h]:h,index:p,offset:f}))}},Ci=Q([qe,Lu,gl,Bu,lw,cw,kt],nH),Oi=Q(It,gl,(e,t)=>{if(!(e==null||t==null))return Fh(Fh({},e),{},{scale:t})}),iH=Q([It,Ml,nw,xM],iw);Q((e,t,r)=>Kb(e,r),iH,(e,t)=>{if(!(e==null||t==null))return Fh(Fh({},e),{},{scale:t})});var aH=Q([qe,Cm,Om],(e,t,r)=>{switch(e){case"horizontal":return t.some(n=>n.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(n=>n.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),_M=e=>e.options.defaultTooltipEventType,EM=e=>e.options.validateTooltipEventTypes;function CM(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function uw(e,t){var r=_M(e),n=EM(e);return CM(t,r,n)}function oH(e){return xe(t=>uw(t,e))}var OM=(e,t)=>{var r,n=Number(t);if(!(Xr(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},sH=e=>e.tooltip.settings,co={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},lH={itemInteraction:{click:co,hover:co},axisInteraction:{click:co,hover:co},keyboardInteraction:co,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},AM=Zr({name:"tooltip",initialState:lH,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:Nt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:r,next:n}=t.payload,i=ii(e).tooltipItemPayloads.indexOf(r);i>-1&&(e.tooltipItemPayloads[i]=n)},prepare:Nt()},removeTooltipEntrySettings:{reducer(e,t){var r=ii(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:Nt()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:cH,replaceTooltipEntrySettings:uH,removeTooltipEntrySettings:dH,setTooltipSettingsState:fH,setActiveMouseOverItemIndex:TM,mouseLeaveItem:hH,mouseLeaveChart:MM,setActiveClickItemIndex:mH,setMouseOverAxisIndex:IM,setMouseClickAxisIndex:pH,setSyncInteraction:n0,setKeyboardInteraction:i0}=AM.actions,vH=AM.reducer;function T_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Pf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?T_(Object(r),!0).forEach(function(n){gH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T_(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gH(e,t,r){return(t=yH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yH(e){var t=xH(e,"string");return typeof t=="symbol"?t:t+""}function xH(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bH(e,t,r){return t==="axis"?r==="click"?e.axisInteraction.click:e.axisInteraction.hover:r==="click"?e.itemInteraction.click:e.itemInteraction.hover}function wH(e){return e.index!=null}var RM=(e,t,r,n)=>{if(t==null)return co;var i=bH(e,t,r);if(i==null)return co;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(wH(i)){if(a)return Pf(Pf({},i),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return Pf(Pf({},co),{},{coordinate:i.coordinate})};function jH(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var r=Number(e);return Number.isFinite(r)?r:void 0}function SH(e,t){var r=jH(e),n=t[0],i=t[1];if(r===void 0)return!1;var a=Math.min(n,i),s=Math.max(n,i);return r>=a&&r<=s}function NH(e,t,r){if(r==null||t==null)return!0;var n=at(e,t);return n==null||!yo(r)?!0:SH(n,r)}var dw=(e,t,r,n)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!nt(a))return i;var s=0,u=1/0;t.length>0&&(u=t.length-1);var d=Math.max(s,Math.min(a,u)),f=t[d];return f==null||NH(f,r,n)?String(d):null},DM=(e,t,r,n,i,a,s,u)=>{if(!(a==null||u==null)){var d=s[0],f=d==null?void 0:u(d.positions,a);if(f!=null)return f;var h=i==null?void 0:i[Number(a)];if(h)switch(r){case"horizontal":return{x:h.coordinate,y:(n.top+t)/2};default:return{x:(n.left+e)/2,y:h.coordinate}}}},LM=(e,t,r,n)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(r==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,i==null&&n!=null){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(s=>{var u;return((u=s.settings)===null||u===void 0?void 0:u.graphicalItemId)===i})},Wu=e=>e.options.tooltipPayloadSearcher,Il=e=>e.tooltip;function M_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function I_(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?M_(Object(r),!0).forEach(function(n){PH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):M_(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function PH(e,t,r){return(t=kH(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kH(e){var t=_H(e,"string");return typeof t=="symbol"?t:t+""}function _H(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function EH(e,t){return e??t}var $M=(e,t,r,n,i,a,s)=>{if(!(t==null||a==null)){var{chartData:u,computedData:d,dataStartIndex:f,dataEndIndex:h}=r,p=[];return e.reduce((v,g)=>{var j,{dataDefinedOnItem:b,settings:w}=g,N=EH(b,u),P=Array.isArray(N)?v2(N,f,h):N,E=(j=w==null?void 0:w.dataKey)!==null&&j!==void 0?j:n,k=w==null?void 0:w.nameKey,C;if(n&&Array.isArray(P)&&!Array.isArray(P[0])&&s==="axis"?C=SA(P,n,i):C=a(P,t,d,k),Array.isArray(C))C.forEach(A=>{var M=I_(I_({},w),{},{name:A.name,unit:A.unit,color:void 0,fill:void 0});v.push(DP({tooltipEntrySettings:M,dataKey:A.dataKey,payload:A.payload,value:at(A.payload,A.dataKey),name:A.name}))});else{var T;v.push(DP({tooltipEntrySettings:w,dataKey:E,payload:C,value:at(C,E),name:(T=at(C,k))!==null&&T!==void 0?T:w==null?void 0:w.name}))}return v},p)}},fw=Q([nr,qe,aM,$b,rr],gM),CH=Q([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),OH=Q([rr,Al],qb),Rl=Q([CH,nr,OH],Hb,{memoizeOptions:{resultEqualityCheck:Gm}}),AH=Q([Rl],e=>e.filter(Vm)),TH=Q([Rl],Vb,{memoizeOptions:{resultEqualityCheck:Gm}}),Dl=Q([TH,Ta],Yb),MH=Q([AH,Ta,nr],rM),hw=Q([Dl,nr,Rl],Xb),zM=Q([nr],Qb),IH=Q([nr],e=>e.allowDataOverflow),FM=Q([zM,IH],MT),RH=Q([Rl],e=>e.filter(Vm)),DH=Q([MH,RH,Ru,GT],cM),LH=Q([DH,Ta,rr,FM],uM),$H=Q([Rl],sM),zH=Q([Dl,nr,$H,Qm,rr],ew,{memoizeOptions:{resultEqualityCheck:Ym}}),FH=Q([dM,rr,Al],Tl),BH=Q([FH,rr],mM),WH=Q([fM,rr,Al],Tl),UH=Q([WH,rr],pM),KH=Q([hM,rr,Al],Tl),qH=Q([KH,rr],vM),HH=Q([BH,qH,UH],Wh),VH=Q([nr,zM,FM,LH,zH,HH,qe,rr],tw),Uu=Q([nr,qe,Dl,hw,Ru,rr,VH],rw),YH=Q([Uu,nr,fw],aw),GH=Q([nr,Uu,YH,rr],sw),BM=e=>{var t=rr(e),r=Al(e),n=!1;return Bu(e,t,r,n)},WM=Q([nr,BM],Km),UM=Q([nr,fw,GH,WM],iw),XH=Q([qe,hw,nr,rr],NM),QH=Q([qe,hw,nr,rr],PM),ZH=(e,t,r,n,i,a,s,u)=>{if(t){var{type:d}=t,f=Ri(e,u);if(n){var h=r==="scaleBand"&&n.bandwidth?n.bandwidth()/2:2,p=d==="category"&&n.bandwidth?n.bandwidth()/h:0;return p=u==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?fr(i[0]-i[1])*2*p:p,f&&s?s.map((v,g)=>({coordinate:n(v)+p,value:v,index:g,offset:p})):n.domain().map((v,g)=>({coordinate:n(v)+p,value:a?a[v]:v,index:g,offset:p}))}}},Ma=Q([qe,nr,fw,UM,BM,XH,QH,rr],ZH),mw=Q([_M,EM,sH],(e,t,r)=>CM(r.shared,e,t)),KM=e=>e.tooltip.settings.trigger,pw=e=>e.tooltip.settings.defaultIndex,Ku=Q([Il,mw,KM,pw],RM),xo=Q([Ku,Dl,Fu,Uu],dw),qM=Q([Ma,xo],OM),vw=Q([Ku],e=>{if(e)return e.dataKey}),JH=Q([Ku],e=>{if(e)return e.graphicalItemId}),HM=Q([Il,mw,KM,pw],LM),eV=Q([Ca,Oa,qe,Jt,Ma,pw,HM,Wu],DM),tV=Q([Ku,eV],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),rV=Q([Ku],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),nV=Q([HM,xo,Ta,Fu,qM,Wu,mw],$M),iV=Q([nV],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function R_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function D_(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?R_(Object(r),!0).forEach(function(n){aV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R_(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function aV(e,t,r){return(t=oV(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oV(e){var t=sV(e,"string");return typeof t=="symbol"?t:t+""}function sV(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lV=()=>xe(nr),cV=()=>{var e=lV(),t=xe(Ma),r=xe(UM);return go(!e||!r?void 0:D_(D_({},e),{},{scale:r}),t)};function L_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Vs(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?L_(Object(r),!0).forEach(function(n){uV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):L_(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uV(e,t,r){return(t=dV(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dV(e){var t=fV(e,"string");return typeof t=="symbol"?t:t+""}function fV(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hV=(e,t,r,n)=>{var i=t.find(a=>a&&a.index===r);if(i){if(e==="horizontal")return{x:i.coordinate,y:n.chartY};if(e==="vertical")return{x:n.chartX,y:i.coordinate}}return{x:0,y:0}},mV=(e,t,r,n)=>{var i=t.find(f=>f&&f.index===r);if(i){if(e==="centric"){var a=i.coordinate,{radius:s}=n;return Vs(Vs(Vs({},n),Kt(n.cx,n.cy,s,a)),{},{angle:a,radius:s})}var u=i.coordinate,{angle:d}=n;return Vs(Vs(Vs({},n),Kt(n.cx,n.cy,u,d)),{},{angle:d,radius:u})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function pV(e,t){var{chartX:r,chartY:n}=e;return r>=t.left&&r<=t.left+t.width&&n>=t.top&&n<=t.top+t.height}var VM=(e,t,r,n,i)=>{var a,s=(a=t==null?void 0:t.length)!==null&&a!==void 0?a:0;if(s<=1||e==null)return 0;if(n==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var u=0;u<s;u++){var d,f,h,p,v,g=u>0?(d=r[u-1])===null||d===void 0?void 0:d.coordinate:(f=r[s-1])===null||f===void 0?void 0:f.coordinate,j=(h=r[u])===null||h===void 0?void 0:h.coordinate,b=u>=s-1?(p=r[0])===null||p===void 0?void 0:p.coordinate:(v=r[u+1])===null||v===void 0?void 0:v.coordinate,w=void 0;if(!(g==null||j==null||b==null))if(fr(j-g)!==fr(b-j)){var N=[];if(fr(b-j)===fr(i[1]-i[0])){w=b;var P=j+i[1]-i[0];N[0]=Math.min(P,(P+g)/2),N[1]=Math.max(P,(P+g)/2)}else{w=g;var E=b+i[1]-i[0];N[0]=Math.min(j,(E+j)/2),N[1]=Math.max(j,(E+j)/2)}var k=[Math.min(j,(w+j)/2),Math.max(j,(w+j)/2)];if(e>k[0]&&e<=k[1]||e>=N[0]&&e<=N[1]){var C;return(C=r[u])===null||C===void 0?void 0:C.index}}else{var T=Math.min(g,b),A=Math.max(g,b);if(e>(T+j)/2&&e<=(A+j)/2){var M;return(M=r[u])===null||M===void 0?void 0:M.index}}}else if(t)for(var z=0;z<s;z++){var V=t[z];if(V!=null){var L=t[z+1],K=t[z-1];if(z===0&&L!=null&&e<=(V.coordinate+L.coordinate)/2||z===s-1&&K!=null&&e>(V.coordinate+K.coordinate)/2||z>0&&z<s-1&&K!=null&&L!=null&&e>(V.coordinate+K.coordinate)/2&&e<=(V.coordinate+L.coordinate)/2)return V.index}}return-1},YM=()=>xe($b),gw=(e,t)=>t,GM=(e,t,r)=>r,yw=(e,t,r,n)=>n,vV=Q(Ma,e=>xm(e,t=>t.coordinate)),xw=Q([Il,gw,GM,yw],RM),bw=Q([xw,Dl,Fu,Uu],dw),gV=(e,t,r)=>{if(t!=null){var n=Il(e);return t==="axis"?r==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:r==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},XM=Q([Il,gw,GM,yw],LM),Uh=Q([Ca,Oa,qe,Jt,Ma,yw,XM,Wu],DM),yV=Q([xw,Uh],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),QM=Q([Ma,bw],OM),xV=Q([XM,bw,Ta,Fu,QM,Wu,gw],$M),bV=Q([xw,bw],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),wV=(e,t,r,n,i,a,s)=>{if(!(!e||!r||!n||!i)&&pV(e,s)){var u=I6(e,t),d=VM(u,a,i,r,n),f=hV(t,i,d,e);return{activeIndex:String(d),activeCoordinate:f}}},jV=(e,t,r,n,i,a,s)=>{if(!(!e||!n||!i||!a||!r)){var u=ZW(e,r);if(u){var d=R6(u,t),f=VM(d,s,a,n,i),h=mV(t,a,f,u);return{activeIndex:String(f),activeCoordinate:h}}}},SV=(e,t,r,n,i,a,s,u)=>{if(!(!e||!t||!n||!i||!a))return t==="horizontal"||t==="vertical"?wV(e,t,n,i,a,s,u):jV(e,t,r,n,i,a,s)},NV=Q(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,r)=>r,(e,t,r)=>{if(t!=null){var n=e[t];if(n!=null)return r?n.panoramaElement:n.element}}),PV=Q(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values($t)),r=Array.from(new Set(t));return r.sort((n,i)=>n-i)},{memoizeOptions:{resultEqualityCheck:lq}});function $_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function z_(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$_(Object(r),!0).forEach(function(n){kV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$_(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function kV(e,t,r){return(t=_V(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _V(e){var t=EV(e,"string");return typeof t=="symbol"?t:t+""}function EV(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var CV={},OV={zIndexMap:Object.values($t).reduce((e,t)=>z_(z_({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),CV)},AV=new Set(Object.values($t));function TV(e){return AV.has(e)}var ZM=Zr({name:"zIndex",initialState:OV,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]?e.zIndexMap[r].consumers+=1:e.zIndexMap[r]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:Nt()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!TV(r)&&delete e.zIndexMap[r])},prepare:Nt()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r,element:n,isPanorama:i}=t.payload;e.zIndexMap[r]?i?e.zIndexMap[r].panoramaElement=n:e.zIndexMap[r].element=n:e.zIndexMap[r]={consumers:0,element:i?void 0:n,panoramaElement:i?n:void 0}},prepare:Nt()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(t.payload.isPanorama?e.zIndexMap[r].panoramaElement=void 0:e.zIndexMap[r].element=void 0)},prepare:Nt()}}}),{registerZIndexPortal:MV,unregisterZIndexPortal:IV,registerZIndexPortalElement:RV,unregisterZIndexPortalElement:DV}=ZM.actions,LV=ZM.reducer;function Er(e){var{zIndex:t,children:r}=e,n=h8(),i=n&&t!==void 0&&t!==0,a=er(),s=ht();y.useLayoutEffect(()=>i?(s(MV({zIndex:t})),()=>{s(IV({zIndex:t}))}):Su,[s,t,i]);var u=xe(d=>NV(d,t,a));return i?u?I0.createPortal(r,u):null:r}function a0(){return a0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a0.apply(null,arguments)}function F_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function kf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?F_(Object(r),!0).forEach(function(n){$V(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F_(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $V(e,t,r){return(t=zV(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zV(e){var t=FV(e,"string");return typeof t=="symbol"?t:t+""}function FV(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function BV(e){var{cursor:t,cursorComp:r,cursorProps:n}=e;return y.isValidElement(t)?y.cloneElement(t,n):y.createElement(r,n)}function WV(e){var t,{coordinate:r,payload:n,index:i,offset:a,tooltipAxisBandSize:s,layout:u,cursor:d,tooltipEventType:f,chartName:h}=e,p=r,v=n,g=i;if(!d||!p||h!=="ScatterChart"&&f!=="axis")return null;var j,b,w;if(h==="ScatterChart")j=p,b=fW,w=$t.cursorLine;else if(h==="BarChart")j=hW(u,p,a,s),b=U2,w=$t.cursorRectangle;else if(u==="radial"&&PA(p)){var{cx:N,cy:P,radius:E,startAngle:k,endAngle:C}=q2(p);j={cx:N,cy:P,startAngle:k,endAngle:C,innerRadius:E,outerRadius:E},b=V2,w=$t.cursorLine}else j={points:rU(u,p,a)},b=il,w=$t.cursorLine;var T=typeof d=="object"&&"className"in d?d.className:void 0,A=kf(kf(kf(kf({stroke:"#ccc",pointerEvents:"none"},a),j),ss(d)),{},{payload:v,payloadIndex:g,className:He("recharts-tooltip-cursor",T)});return y.createElement(Er,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:w},y.createElement(BV,{cursor:d,cursorComp:b,cursorProps:A}))}function UV(e){var t=cV(),r=_2(),n=jo(),i=YM();return t==null||r==null||n==null||i==null?null:y.createElement(WV,a0({},e,{offset:r,layout:n,tooltipAxisBandSize:t,chartName:i}))}var JM=y.createContext(null),KV=()=>y.useContext(JM),Ty={exports:{}},B_;function qV(){return B_||(B_=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(d,f,h){this.fn=d,this.context=f,this.once=h||!1}function a(d,f,h,p,v){if(typeof h!="function")throw new TypeError("The listener must be a function");var g=new i(h,p||d,v),j=r?r+f:f;return d._events[j]?d._events[j].fn?d._events[j]=[d._events[j],g]:d._events[j].push(g):(d._events[j]=g,d._eventsCount++),d}function s(d,f){--d._eventsCount===0?d._events=new n:delete d._events[f]}function u(){this._events=new n,this._eventsCount=0}u.prototype.eventNames=function(){var f=[],h,p;if(this._eventsCount===0)return f;for(p in h=this._events)t.call(h,p)&&f.push(r?p.slice(1):p);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(h)):f},u.prototype.listeners=function(f){var h=r?r+f:f,p=this._events[h];if(!p)return[];if(p.fn)return[p.fn];for(var v=0,g=p.length,j=new Array(g);v<g;v++)j[v]=p[v].fn;return j},u.prototype.listenerCount=function(f){var h=r?r+f:f,p=this._events[h];return p?p.fn?1:p.length:0},u.prototype.emit=function(f,h,p,v,g,j){var b=r?r+f:f;if(!this._events[b])return!1;var w=this._events[b],N=arguments.length,P,E;if(w.fn){switch(w.once&&this.removeListener(f,w.fn,void 0,!0),N){case 1:return w.fn.call(w.context),!0;case 2:return w.fn.call(w.context,h),!0;case 3:return w.fn.call(w.context,h,p),!0;case 4:return w.fn.call(w.context,h,p,v),!0;case 5:return w.fn.call(w.context,h,p,v,g),!0;case 6:return w.fn.call(w.context,h,p,v,g,j),!0}for(E=1,P=new Array(N-1);E<N;E++)P[E-1]=arguments[E];w.fn.apply(w.context,P)}else{var k=w.length,C;for(E=0;E<k;E++)switch(w[E].once&&this.removeListener(f,w[E].fn,void 0,!0),N){case 1:w[E].fn.call(w[E].context);break;case 2:w[E].fn.call(w[E].context,h);break;case 3:w[E].fn.call(w[E].context,h,p);break;case 4:w[E].fn.call(w[E].context,h,p,v);break;default:if(!P)for(C=1,P=new Array(N-1);C<N;C++)P[C-1]=arguments[C];w[E].fn.apply(w[E].context,P)}}return!0},u.prototype.on=function(f,h,p){return a(this,f,h,p,!1)},u.prototype.once=function(f,h,p){return a(this,f,h,p,!0)},u.prototype.removeListener=function(f,h,p,v){var g=r?r+f:f;if(!this._events[g])return this;if(!h)return s(this,g),this;var j=this._events[g];if(j.fn)j.fn===h&&(!v||j.once)&&(!p||j.context===p)&&s(this,g);else{for(var b=0,w=[],N=j.length;b<N;b++)(j[b].fn!==h||v&&!j[b].once||p&&j[b].context!==p)&&w.push(j[b]);w.length?this._events[g]=w.length===1?w[0]:w:s(this,g)}return this},u.prototype.removeAllListeners=function(f){var h;return f?(h=r?r+f:f,this._events[h]&&s(this,h)):(this._events=new n,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=r,u.EventEmitter=u,e.exports=u})(Ty)),Ty.exports}var HV=qV();const VV=li(HV);var su=new VV,o0="recharts.syncEvent.tooltip",W_="recharts.syncEvent.brush";function ep(e,t){if(t){var r=Number.parseInt(t,10);if(!Xr(r))return e==null?void 0:e[r]}}var YV={chartName:"",tooltipPayloadSearcher:void 0,eventEmitter:void 0,defaultTooltipEventType:"axis"},eI=Zr({name:"options",initialState:YV,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),GV=eI.reducer,{createEventEmitter:XV}=eI.actions;function QV(e){return e.tooltip.syncInteraction}var ZV={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},tI=Zr({name:"chartData",initialState:ZV,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:r,endIndex:n}=t.payload;r!=null&&(e.dataStartIndex=r),n!=null&&(e.dataEndIndex=n)}}}),{setChartData:U_,setDataStartEndIndexes:JV,setComputedData:Vle}=tI.actions,e7=tI.reducer,t7=["x","y"];function K_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ys(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?K_(Object(r),!0).forEach(function(n){r7(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):K_(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function r7(e,t,r){return(t=n7(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n7(e){var t=i7(e,"string");return typeof t=="symbol"?t:t+""}function i7(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function a7(e,t){if(e==null)return{};var r,n,i=o7(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function o7(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function s7(){var e=xe(zb),t=xe(Fb),r=ht(),n=xe(XT),i=xe(Ma),a=jo(),s=Eu(),u=xe(d=>d.rootProps.className);y.useEffect(()=>{if(e==null)return Su;var d=(f,h,p)=>{if(t!==p&&e===f){if(n==="index"){var v;if(s&&h!==null&&h!==void 0&&(v=h.payload)!==null&&v!==void 0&&v.coordinate&&h.payload.sourceViewBox){var g=h.payload.coordinate,{x:j,y:b}=g,w=a7(g,t7),{x:N,y:P,width:E,height:k}=h.payload.sourceViewBox,C=Ys(Ys({},w),{},{x:s.x+(E?(j-N)/E:0)*s.width,y:s.y+(k?(b-P)/k:0)*s.height});r(Ys(Ys({},h),{},{payload:Ys(Ys({},h.payload),{},{coordinate:C})}))}else r(h);return}if(i!=null){var T;if(typeof n=="function"){var A={activeTooltipIndex:h.payload.index==null?void 0:Number(h.payload.index),isTooltipActive:h.payload.active,activeIndex:h.payload.index==null?void 0:Number(h.payload.index),activeLabel:h.payload.label,activeDataKey:h.payload.dataKey,activeCoordinate:h.payload.coordinate},M=n(i,A);T=i[M]}else n==="value"&&(T=i.find(F=>String(F.value)===h.payload.label));var{coordinate:z}=h.payload;if(T==null||h.payload.active===!1||z==null||s==null){r(n0({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:V,y:L}=z,K=Math.min(V,s.x+s.width),te=Math.min(L,s.y+s.height),R={x:a==="horizontal"?T.coordinate:K,y:a==="horizontal"?te:T.coordinate},U=n0({active:h.payload.active,coordinate:R,dataKey:h.payload.dataKey,index:String(T.index),label:h.payload.label,sourceViewBox:h.payload.sourceViewBox,graphicalItemId:h.payload.graphicalItemId});r(U)}}};return su.on(o0,d),()=>{su.off(o0,d)}},[u,r,t,e,n,i,a,s])}function l7(){var e=xe(zb),t=xe(Fb),r=ht();y.useEffect(()=>{if(e==null)return Su;var n=(i,a,s)=>{t!==s&&e===i&&r(JV(a))};return su.on(W_,n),()=>{su.off(W_,n)}},[r,t,e])}function c7(){var e=ht();y.useEffect(()=>{e(XV())},[e]),s7(),l7()}function u7(e,t,r,n,i,a){var s=xe(g=>gV(g,e,t)),u=xe(Fb),d=xe(zb),f=xe(XT),h=xe(QV),p=h==null?void 0:h.active,v=Eu();y.useEffect(()=>{if(!p&&d!=null&&u!=null){var g=n0({active:a,coordinate:r,dataKey:s,index:i,label:typeof n=="number"?String(n):n,sourceViewBox:v,graphicalItemId:void 0});su.emit(o0,d,g,u)}},[p,r,s,i,n,u,d,f,a,v])}function q_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function H_(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?q_(Object(r),!0).forEach(function(n){d7(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q_(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function d7(e,t,r){return(t=f7(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f7(e){var t=h7(e,"string");return typeof t=="symbol"?t:t+""}function h7(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function m7(e){return e.dataKey}function p7(e,t){return y.isValidElement(e)?y.cloneElement(e,t):typeof e=="function"?y.createElement(e,t):y.createElement(q8,t)}var V_=[],v7={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function mn(e){var t,r,n=Mt(e,v7),{active:i,allowEscapeViewBox:a,animationDuration:s,animationEasing:u,content:d,filterNull:f,isAnimationActive:h,offset:p,payloadUniqBy:v,position:g,reverseDirection:j,useTranslate3d:b,wrapperStyle:w,cursor:N,shared:P,trigger:E,defaultIndex:k,portal:C,axisId:T}=n,A=ht(),M=typeof k=="number"?String(k):k;y.useEffect(()=>{A(fH({shared:P,trigger:E,axisId:T,active:i,defaultIndex:M}))},[A,P,E,T,i,M]);var z=Eu(),V=$2(),L=oH(P),{activeIndex:K,isActive:te}=(t=xe(de=>bV(de,L,E,M)))!==null&&t!==void 0?t:{},R=xe(de=>xV(de,L,E,M)),U=xe(de=>QM(de,L,E,M)),F=xe(de=>yV(de,L,E,M)),X=R,$=KV(),Y=(r=i??te)!==null&&r!==void 0?r:!1,[W,I]=FA([X,Y]),H=L==="axis"?U:void 0;u7(L,E,F,H,K,Y);var oe=C??$;if(oe==null||z==null||L==null)return null;var se=X??V_;Y||(se=V_),f&&se.length&&(se=RA(se.filter(de=>de.value!=null&&(de.hide!==!0||n.includeHidden)),v,m7));var be=se.length>0,Ae=y.createElement(Z8,{allowEscapeViewBox:a,animationDuration:s,animationEasing:u,isAnimationActive:h,active:Y,coordinate:F,hasPayload:be,offset:p,position:g,reverseDirection:j,useTranslate3d:b,viewBox:z,wrapperStyle:w,lastBoundingBox:W,innerRef:I,hasPortalFromProps:!!C},p7(d,H_(H_({},n),{},{payload:se,label:H,active:Y,activeIndex:K,coordinate:F,accessibilityLayer:V})));return y.createElement(y.Fragment,null,I0.createPortal(Ae,oe),Y&&y.createElement(UV,{cursor:N,tooltipEventType:L,coordinate:F,payload:se,index:K}))}var Ll=e=>null;Ll.displayName="Cell";function g7(e,t,r){return(t=y7(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y7(e){var t=x7(e,"string");return typeof t=="symbol"?t:t+""}function x7(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class b7{constructor(t){g7(this,"cache",new Map),this.maxSize=t}get(t){var r=this.cache.get(t);return r!==void 0&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(t,r)}clear(){this.cache.clear()}size(){return this.cache.size}}function Y_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function w7(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Y_(Object(r),!0).forEach(function(n){j7(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Y_(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function j7(e,t,r){return(t=S7(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function S7(e){var t=N7(e,"string");return typeof t=="symbol"?t:t+""}function N7(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var P7={cacheSize:2e3,enableCache:!0},rI=w7({},P7),G_=new b7(rI.cacheSize),k7={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},X_="recharts_measurement_span";function _7(e,t){var r=t.fontSize||"",n=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",s=t.letterSpacing||"",u=t.textTransform||"";return"".concat(e,"|").concat(r,"|").concat(n,"|").concat(i,"|").concat(a,"|").concat(s,"|").concat(u)}var Q_=(e,t)=>{try{var r=document.getElementById(X_);r||(r=document.createElement("span"),r.setAttribute("id",X_),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,k7,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},Kc=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Ou.isSsr)return{width:0,height:0};if(!rI.enableCache)return Q_(t,r);var n=_7(t,r),i=G_.get(n);if(i)return i;var a=Q_(t,r);return G_.set(n,a),a},nI;function E7(e,t,r){return(t=C7(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function C7(e){var t=O7(e,"string");return typeof t=="symbol"?t:t+""}function O7(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Z_=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,J_=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,A7=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,T7=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,M7={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},I7=["cm","mm","pt","pc","in","Q","px"];function R7(e){return I7.includes(e)}var el="NaN";function D7(e,t){return e*M7[t]}class yr{static parse(t){var r,[,n,i]=(r=T7.exec(t))!==null&&r!==void 0?r:[];return n==null?yr.NaN:new yr(parseFloat(n),i??"")}constructor(t,r){this.num=t,this.unit=r,this.num=t,this.unit=r,Xr(t)&&(this.unit=""),r!==""&&!A7.test(r)&&(this.num=NaN,this.unit=""),R7(r)&&(this.num=D7(t,r),this.unit="px")}add(t){return this.unit!==t.unit?new yr(NaN,""):new yr(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new yr(NaN,""):new yr(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new yr(NaN,""):new yr(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new yr(NaN,""):new yr(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Xr(this.num)}}nI=yr;E7(yr,"NaN",new nI(NaN,""));function iI(e){if(e==null||e.includes(el))return el;for(var t=e;t.includes("*")||t.includes("/");){var r,[,n,i,a]=(r=Z_.exec(t))!==null&&r!==void 0?r:[],s=yr.parse(n??""),u=yr.parse(a??""),d=i==="*"?s.multiply(u):s.divide(u);if(d.isNaN())return el;t=t.replace(Z_,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,[,h,p,v]=(f=J_.exec(t))!==null&&f!==void 0?f:[],g=yr.parse(h??""),j=yr.parse(v??""),b=p==="+"?g.add(j):g.subtract(j);if(b.isNaN())return el;t=t.replace(J_,b.toString())}return t}var eE=/\(([^()]*)\)/;function L7(e){for(var t=e,r;(r=eE.exec(t))!=null;){var[,n]=r;t=t.replace(eE,iI(n))}return t}function $7(e){var t=e.replace(/\s+/g,"");return t=L7(t),t=iI(t),t}function z7(e){try{return $7(e)}catch{return el}}function My(e){var t=z7(e.slice(5,-1));return t===el?"":t}var F7=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],B7=["dx","dy","angle","className","breakAll"];function s0(){return s0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s0.apply(null,arguments)}function tE(e,t){if(e==null)return{};var r,n,i=W7(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function W7(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var aI=/[ \f\n\r\t\v\u2028\u2029]+/,oI=e=>{var{children:t,breakAll:r,style:n}=e;try{var i=[];wt(t)||(r?i=t.toString().split(""):i=t.toString().split(aI));var a=i.map(u=>({word:u,width:Kc(u,n).width})),s=r?0:Kc(" ",n).width;return{wordsWithComputedWidth:a,spaceWidth:s}}catch{return null}};function U7(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var sI=(e,t,r,n)=>e.reduce((i,a)=>{var{word:s,width:u}=a,d=i[i.length-1];if(d&&u!=null&&(t==null||n||d.width+u+r<Number(t)))d.words.push(s),d.width+=u+r;else{var f={words:[s],width:u};i.push(f)}return i},[]),lI=e=>e.reduce((t,r)=>t.width>r.width?t:r),K7="…",rE=(e,t,r,n,i,a,s,u)=>{var d=e.slice(0,t),f=oI({breakAll:r,style:n,children:d+K7});if(!f)return[!1,[]];var h=sI(f.wordsWithComputedWidth,a,s,u),p=h.length>i||lI(h).width>Number(a);return[p,h]},q7=(e,t,r,n,i)=>{var{maxLines:a,children:s,style:u,breakAll:d}=e,f=ve(a),h=String(s),p=sI(t,n,r,i);if(!f||i)return p;var v=p.length>a||lI(p).width>Number(n);if(!v)return p;for(var g=0,j=h.length-1,b=0,w;g<=j&&b<=h.length-1;){var N=Math.floor((g+j)/2),P=N-1,[E,k]=rE(h,P,d,u,a,n,r,i),[C]=rE(h,N,d,u,a,n,r,i);if(!E&&!C&&(g=N+1),E&&C&&(j=N-1),!E&&C){w=k;break}b++}return w||p},nE=e=>{var t=wt(e)?[]:e.toString().split(aI);return[{words:t,width:void 0}]},H7=e=>{var{width:t,scaleToFit:r,children:n,style:i,breakAll:a,maxLines:s}=e;if((t||r)&&!Ou.isSsr){var u,d,f=oI({breakAll:a,children:n,style:i});if(f){var{wordsWithComputedWidth:h,spaceWidth:p}=f;u=h,d=p}else return nE(n);return q7({breakAll:a,children:n,maxLines:s,style:i},u,d,t,!!r)}return nE(n)},cI="#808080",V7={angle:0,breakAll:!1,capHeight:"0.71em",fill:cI,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},tp=y.forwardRef((e,t)=>{var r=Mt(e,V7),{x:n,y:i,lineHeight:a,capHeight:s,fill:u,scaleToFit:d,textAnchor:f,verticalAnchor:h}=r,p=tE(r,F7),v=y.useMemo(()=>H7({breakAll:p.breakAll,children:p.children,maxLines:p.maxLines,scaleToFit:d,style:p.style,width:p.width}),[p.breakAll,p.children,p.maxLines,d,p.style,p.width]),{dx:g,dy:j,angle:b,className:w,breakAll:N}=p,P=tE(p,B7);if(!$n(n)||!$n(i)||v.length===0)return null;var E=Number(n)+(ve(g)?g:0),k=Number(i)+(ve(j)?j:0);if(!nt(E)||!nt(k))return null;var C;switch(h){case"start":C=My("calc(".concat(s,")"));break;case"middle":C=My("calc(".concat((v.length-1)/2," * -").concat(a," + (").concat(s," / 2))"));break;default:C=My("calc(".concat(v.length-1," * -").concat(a,")"));break}var T=[];if(d){var A=v[0].width,{width:M}=p;T.push("scale(".concat(ve(M)&&ve(A)?M/A:1,")"))}return b&&T.push("rotate(".concat(b,", ").concat(E,", ").concat(k,")")),T.length&&(P.transform=T.join(" ")),y.createElement("text",s0({},br(P),{ref:t,x:E,y:k,className:He("recharts-text",w),textAnchor:f,fill:u.includes("url")?cI:u}),v.map((z,V)=>{var L=z.words.join(N?"":" ");return y.createElement("tspan",{x:E,dy:V===0?C:a,key:"".concat(L,"-").concat(V)},L)}))});tp.displayName="Text";var Y7=["labelRef"],G7=["content"];function iE(e,t){if(e==null)return{};var r,n,i=X7(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function X7(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function aE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Bt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?aE(Object(r),!0).forEach(function(n){Q7(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):aE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Q7(e,t,r){return(t=Z7(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Z7(e){var t=J7(e,"string");return typeof t=="symbol"?t:t+""}function J7(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function 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)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ca.apply(null,arguments)}var uI=y.createContext(null),dI=e=>{var{x:t,y:r,upperWidth:n,lowerWidth:i,width:a,height:s,children:u}=e,d=y.useMemo(()=>({x:t,y:r,upperWidth:n,lowerWidth:i,width:a,height:s}),[t,r,n,i,a,s]);return y.createElement(uI.Provider,{value:d},u)},fI=()=>{var e=y.useContext(uI),t=Eu();return e||k2(t)},eY=y.createContext(null),tY=()=>{var e=y.useContext(eY),t=xe(tM);return e||t},rY=e=>{var{value:t,formatter:r}=e,n=wt(e.children)?t:e.children;return typeof r=="function"?r(n):n},ww=e=>e!=null&&typeof e=="function",nY=(e,t)=>{var r=fr(t-e),n=Math.min(Math.abs(t-e),360);return r*n},iY=(e,t,r,n,i)=>{var{offset:a,className:s}=e,{cx:u,cy:d,innerRadius:f,outerRadius:h,startAngle:p,endAngle:v,clockWise:g}=i,j=(f+h)/2,b=nY(p,v),w=b>=0?1:-1,N,P;switch(t){case"insideStart":N=p+w*a,P=g;break;case"insideEnd":N=v-w*a,P=!g;break;case"end":N=v+w*a,P=g;break;default:throw new Error("Unsupported position ".concat(t))}P=b<=0?P:!P;var E=Kt(u,d,j,N),k=Kt(u,d,j,N+(P?1:-1)*359),C="M".concat(E.x,",").concat(E.y,`
106
+ A`).concat(j,",").concat(j,",0,1,").concat(P?0:1,`,
107
+ `).concat(k.x,",").concat(k.y),T=wt(e.id)?Gc("recharts-radial-line-"):e.id;return y.createElement("text",ca({},n,{dominantBaseline:"central",className:He("recharts-radial-bar-label",s)}),y.createElement("defs",null,y.createElement("path",{id:T,d:C})),y.createElement("textPath",{xlinkHref:"#".concat(T)},r))},aY=(e,t,r)=>{var{cx:n,cy:i,innerRadius:a,outerRadius:s,startAngle:u,endAngle:d}=e,f=(u+d)/2;if(r==="outside"){var{x:h,y:p}=Kt(n,i,s+t,f);return{x:h,y:p,textAnchor:h>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"end"};var v=(a+s)/2,{x:g,y:j}=Kt(n,i,v,f);return{x:g,y:j,textAnchor:"middle",verticalAnchor:"middle"}},l0=e=>"cx"in e&&ve(e.cx),oY=(e,t)=>{var{parentViewBox:r,offset:n,position:i}=e,a;r!=null&&!l0(r)&&(a=r);var{x:s,y:u,upperWidth:d,lowerWidth:f,height:h}=t,p=s,v=s+(d-f)/2,g=(p+v)/2,j=(d+f)/2,b=p+d/2,w=h>=0?1:-1,N=w*n,P=w>0?"end":"start",E=w>0?"start":"end",k=d>=0?1:-1,C=k*n,T=k>0?"end":"start",A=k>0?"start":"end";if(i==="top"){var M={x:p+d/2,y:u-N,textAnchor:"middle",verticalAnchor:P};return Bt(Bt({},M),a?{height:Math.max(u-a.y,0),width:d}:{})}if(i==="bottom"){var z={x:v+f/2,y:u+h+N,textAnchor:"middle",verticalAnchor:E};return Bt(Bt({},z),a?{height:Math.max(a.y+a.height-(u+h),0),width:f}:{})}if(i==="left"){var V={x:g-C,y:u+h/2,textAnchor:T,verticalAnchor:"middle"};return Bt(Bt({},V),a?{width:Math.max(V.x-a.x,0),height:h}:{})}if(i==="right"){var L={x:g+j+C,y:u+h/2,textAnchor:A,verticalAnchor:"middle"};return Bt(Bt({},L),a?{width:Math.max(a.x+a.width-L.x,0),height:h}:{})}var K=a?{width:j,height:h}:{};return i==="insideLeft"?Bt({x:g+C,y:u+h/2,textAnchor:A,verticalAnchor:"middle"},K):i==="insideRight"?Bt({x:g+j-C,y:u+h/2,textAnchor:T,verticalAnchor:"middle"},K):i==="insideTop"?Bt({x:p+d/2,y:u+N,textAnchor:"middle",verticalAnchor:E},K):i==="insideBottom"?Bt({x:v+f/2,y:u+h-N,textAnchor:"middle",verticalAnchor:P},K):i==="insideTopLeft"?Bt({x:p+C,y:u+N,textAnchor:A,verticalAnchor:E},K):i==="insideTopRight"?Bt({x:p+d-C,y:u+N,textAnchor:T,verticalAnchor:E},K):i==="insideBottomLeft"?Bt({x:v+C,y:u+h-N,textAnchor:A,verticalAnchor:P},K):i==="insideBottomRight"?Bt({x:v+f-C,y:u+h-N,textAnchor:T,verticalAnchor:P},K):i&&typeof i=="object"&&(ve(i.x)||ya(i.x))&&(ve(i.y)||ya(i.y))?Bt({x:s+_r(i.x,j),y:u+_r(i.y,h),textAnchor:"end",verticalAnchor:"end"},K):Bt({x:b,y:u+h/2,textAnchor:"middle",verticalAnchor:"middle"},K)},sY={angle:0,offset:5,zIndex:$t.label,position:"middle",textBreakAll:!1};function lo(e){var t=Mt(e,sY),{viewBox:r,position:n,value:i,children:a,content:s,className:u="",textBreakAll:d,labelRef:f}=t,h=tY(),p=fI(),v=n==="center"?p:h??p,g,j,b;if(r==null?g=v:l0(r)?g=r:g=k2(r),!g||wt(i)&&wt(a)&&!y.isValidElement(s)&&typeof s!="function")return null;var w=Bt(Bt({},t),{},{viewBox:g});if(y.isValidElement(s)){var{labelRef:N}=w,P=iE(w,Y7);return y.cloneElement(s,P)}if(typeof s=="function"){var{content:E}=w,k=iE(w,G7);if(j=y.createElement(s,k),y.isValidElement(j))return j}else j=rY(t);var C=br(t);if(l0(g)){if(n==="insideStart"||n==="insideEnd"||n==="end")return iY(t,n,j,C,g);b=aY(g,t.offset,t.position)}else b=oY(t,g);return y.createElement(Er,{zIndex:t.zIndex},y.createElement(tp,ca({ref:f,className:He("recharts-label",u)},C,b,{textAnchor:U7(C.textAnchor)?C.textAnchor:b.textAnchor,breakAll:d}),j))}lo.displayName="Label";var lY=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?y.createElement(lo,ca({key:"label-implicit"},n)):$n(e)?y.createElement(lo,ca({key:"label-implicit",value:e},n)):y.isValidElement(e)?e.type===lo?y.cloneElement(e,Bt({key:"label-implicit"},n)):y.createElement(lo,ca({key:"label-implicit",content:e},n)):ww(e)?y.createElement(lo,ca({key:"label-implicit",content:e},n)):e&&typeof e=="object"?y.createElement(lo,ca({},e,{key:"label-implicit"},n)):null};function hI(e){var{label:t,labelRef:r}=e,n=fI();return lY(t,n,r)||null}var Iy={},Ry={},oE;function cY(){return oE||(oE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r[r.length-1]}e.last=t})(Ry)),Ry}var Dy={},sE;function uY(){return sE||(sE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Array.isArray(r)?r:Array.from(r)}e.toArray=t})(Dy)),Dy}var lE;function dY(){return lE||(lE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=cY(),r=uY(),n=Z0();function i(a){if(n.isArrayLike(a))return t.last(r.toArray(a))}e.last=i})(Iy)),Iy}var Ly,cE;function fY(){return cE||(cE=1,Ly=dY().last),Ly}var hY=fY();const mY=li(hY);var pY=["valueAccessor"],vY=["dataKey","clockWise","id","textBreakAll","zIndex"];function Kh(){return Kh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kh.apply(null,arguments)}function uE(e,t){if(e==null)return{};var r,n,i=gY(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function gY(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var yY=e=>Array.isArray(e.value)?mY(e.value):e.value,mI=y.createContext(void 0),jw=mI.Provider,pI=y.createContext(void 0),xY=pI.Provider;function bY(){return y.useContext(mI)}function wY(){return y.useContext(pI)}function Hf(e){var{valueAccessor:t=yY}=e,r=uE(e,pY),{dataKey:n,clockWise:i,id:a,textBreakAll:s,zIndex:u}=r,d=uE(r,vY),f=bY(),h=wY(),p=f||h;return!p||!p.length?null:y.createElement(Er,{zIndex:u??$t.label},y.createElement(Tt,{className:"recharts-label-list"},p.map((v,g)=>{var j,b=wt(n)?t(v,g):at(v&&v.payload,n),w=wt(a)?{}:{id:"".concat(a,"-").concat(g)};return y.createElement(lo,Kh({key:"label-".concat(g)},br(v),d,w,{fill:(j=r.fill)!==null&&j!==void 0?j:v.fill,parentViewBox:v.parentViewBox,value:b,textBreakAll:s,viewBox:v.viewBox,index:g,zIndex:0}))})))}Hf.displayName="LabelList";function rp(e){var{label:t}=e;return t?t===!0?y.createElement(Hf,{key:"labelList-implicit"}):y.isValidElement(t)||ww(t)?y.createElement(Hf,{key:"labelList-implicit",content:t}):typeof t=="object"?y.createElement(Hf,Kh({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function c0(){return c0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},c0.apply(null,arguments)}var vI=e=>{var{cx:t,cy:r,r:n,className:i}=e,a=He("recharts-dot",i);return ve(t)&&ve(r)&&ve(n)?y.createElement("circle",c0({},Rr(e),Q0(e),{className:a,cx:t,cy:r,r:n})):null},gI=e=>e.graphicalItems.polarItems,jY=Q([kt,Du],qb),np=Q([gI,It,jY],Hb),SY=Q([np],Vb),ip=Q([SY,Um],Yb),NY=Q([ip,It,np],Xb);Q([ip,It,np],(e,t,r)=>r.length>0?e.flatMap(n=>r.flatMap(i=>{var a,s=at(n,(a=t.dataKey)!==null&&a!==void 0?a:i.dataKey);return{value:s,errorDomain:[]}})).filter(Boolean):(t==null?void 0:t.dataKey)!=null?e.map(n=>({value:at(n,t.dataKey),errorDomain:[]})):e.map(n=>({value:n,errorDomain:[]})));var dE=()=>{},PY=Q([ip,It,np,Qm,kt],ew),kY=Q([It,Zb,Jb,dE,PY,dE,qe,kt],tw),yI=Q([It,qe,ip,NY,Ru,kt,kY],rw),_Y=Q([yI,It,Ml],aw);Q([It,yI,_Y,kt],sw);var EY={radiusAxis:{},angleAxis:{}},xI=Zr({name:"polarAxis",initialState:EY,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:Yle,removeRadiusAxis:Gle,addAngleAxis:Xle,removeAngleAxis:Qle}=xI.actions,CY=xI.reducer;function fE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function hE(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?fE(Object(r),!0).forEach(function(n){OY(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function OY(e,t,r){return(t=AY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function AY(e){var t=TY(e,"string");return typeof t=="symbol"?t:t+""}function TY(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var MY=(e,t)=>t,Sw=Q([gI,MY],(e,t)=>e.filter(r=>r.type==="pie").find(r=>r.id===t)),IY=[],Nw=(e,t,r)=>(r==null?void 0:r.length)===0?IY:r,bI=Q([Um,Sw,Nw],(e,t,r)=>{var{chartData:n}=e;if(t!=null){var i;if((t==null?void 0:t.data)!=null&&t.data.length>0?i=t.data:i=n,(!i||!i.length)&&r!=null&&(i=r.map(a=>hE(hE({},t.presentationProps),a.props))),i!=null)return i}}),RY=Q([bI,Sw,Nw],(e,t,r)=>{if(!(e==null||t==null))return e.map((n,i)=>{var a,s=at(n,t.nameKey,t.name),u;return r!=null&&(a=r[i])!==null&&a!==void 0&&(a=a.props)!==null&&a!==void 0&&a.fill?u=r[i].props.fill:typeof n=="object"&&n!=null&&"fill"in n?u=n.fill:u=t.fill,{value:wo(s,t.dataKey),color:u,payload:n,type:t.legendType}})}),DY=Q([bI,Sw,Nw,Jt],(e,t,r,n)=>{if(!(t==null||e==null))return $G({offset:n,pieSettings:t,displayedData:e,cells:r})}),$y={exports:{}},dt={};/**
108
+ * @license React
109
+ * react-is.production.js
110
+ *
111
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
112
+ *
113
+ * This source code is licensed under the MIT license found in the
114
+ * LICENSE file in the root directory of this source tree.
115
+ */var mE;function LY(){if(mE)return dt;mE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),s=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),v=Symbol.for("react.view_transition"),g=Symbol.for("react.client.reference");function j(b){if(typeof b=="object"&&b!==null){var w=b.$$typeof;switch(w){case e:switch(b=b.type,b){case r:case i:case n:case d:case f:case v:return b;default:switch(b=b&&b.$$typeof,b){case s:case u:case p:case h:return b;case a:return b;default:return w}}case t:return w}}}return dt.ContextConsumer=a,dt.ContextProvider=s,dt.Element=e,dt.ForwardRef=u,dt.Fragment=r,dt.Lazy=p,dt.Memo=h,dt.Portal=t,dt.Profiler=i,dt.StrictMode=n,dt.Suspense=d,dt.SuspenseList=f,dt.isContextConsumer=function(b){return j(b)===a},dt.isContextProvider=function(b){return j(b)===s},dt.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},dt.isForwardRef=function(b){return j(b)===u},dt.isFragment=function(b){return j(b)===r},dt.isLazy=function(b){return j(b)===p},dt.isMemo=function(b){return j(b)===h},dt.isPortal=function(b){return j(b)===t},dt.isProfiler=function(b){return j(b)===i},dt.isStrictMode=function(b){return j(b)===n},dt.isSuspense=function(b){return j(b)===d},dt.isSuspenseList=function(b){return j(b)===f},dt.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===r||b===i||b===n||b===d||b===f||typeof b=="object"&&b!==null&&(b.$$typeof===p||b.$$typeof===h||b.$$typeof===s||b.$$typeof===a||b.$$typeof===u||b.$$typeof===g||b.getModuleId!==void 0)},dt.typeOf=j,dt}var pE;function $Y(){return pE||(pE=1,$y.exports=LY()),$y.exports}var zY=$Y(),vE=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",gE=null,zy=null,wI=e=>{if(e===gE&&Array.isArray(zy))return zy;var t=[];return y.Children.forEach(e,r=>{wt(r)||(zY.isFragment(r)?t=t.concat(wI(r.props.children)):t.push(r))}),zy=t,gE=e,t};function Pw(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(i=>vE(i)):n=[vE(t)],wI(e).forEach(i=>{var a=cs(i,"type.displayName")||cs(i,"type.name");a&&n.indexOf(a)!==-1&&r.push(i)}),r}var kw=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,Fy={},yE;function FY(){return yE||(yE=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){var i;if(typeof r!="object"||r==null)return!1;if(Object.getPrototypeOf(r)===null)return!0;if(Object.prototype.toString.call(r)!=="[object Object]"){const a=r[Symbol.toStringTag];return a==null||!((i=Object.getOwnPropertyDescriptor(r,Symbol.toStringTag))!=null&&i.writable)?!1:r.toString()===`[object ${a}]`}let n=r;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(r)===n}e.isPlainObject=t})(Fy)),Fy}var By,xE;function BY(){return xE||(xE=1,By=FY().isPlainObject),By}var WY=BY();const UY=li(WY);var bE,wE,jE,SE,NE;function PE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function kE(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?PE(Object(r),!0).forEach(function(n){KY(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):PE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function KY(e,t,r){return(t=qY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qY(e){var t=HY(e,"string");return typeof t=="symbol"?t:t+""}function HY(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qh(){return qh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qh.apply(null,arguments)}function Mc(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var _E=(e,t,r,n,i)=>{var a=r-n,s;return s=Dt(bE||(bE=Mc(["M ",",",""])),e,t),s+=Dt(wE||(wE=Mc(["L ",",",""])),e+r,t),s+=Dt(jE||(jE=Mc(["L ",",",""])),e+r-a/2,t+i),s+=Dt(SE||(SE=Mc(["L ",",",""])),e+r-a/2-n,t+i),s+=Dt(NE||(NE=Mc(["L ",","," Z"])),e,t),s},VY={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},YY=e=>{var t=Mt(e,VY),{x:r,y:n,upperWidth:i,lowerWidth:a,height:s,className:u}=t,{animationEasing:d,animationDuration:f,animationBegin:h,isUpdateAnimationActive:p}=t,v=y.useRef(null),[g,j]=y.useState(-1),b=y.useRef(i),w=y.useRef(a),N=y.useRef(s),P=y.useRef(r),E=y.useRef(n),k=_l(e,"trapezoid-");if(y.useEffect(()=>{if(v.current&&v.current.getTotalLength)try{var R=v.current.getTotalLength();R&&j(R)}catch{}},[]),r!==+r||n!==+n||i!==+i||a!==+a||s!==+s||i===0&&a===0||s===0)return null;var C=He("recharts-trapezoid",u);if(!p)return y.createElement("g",null,y.createElement("path",qh({},br(t),{className:C,d:_E(r,n,i,a,s)})));var T=b.current,A=w.current,M=N.current,z=P.current,V=E.current,L="0px ".concat(g===-1?1:g,"px"),K="".concat(g,"px 0px"),te=z2(["strokeDasharray"],f,d);return y.createElement(kl,{animationId:k,key:k,canBegin:g>0,duration:f,easing:d,isActive:p,begin:h},R=>{var U=it(T,i,R),F=it(A,a,R),X=it(M,s,R),$=it(z,r,R),Y=it(V,n,R);v.current&&(b.current=U,w.current=F,N.current=X,P.current=$,E.current=Y);var W=R>0?{transition:te,strokeDasharray:K}:{strokeDasharray:L};return y.createElement("path",qh({},br(t),{className:C,d:_E($,Y,U,F,X),ref:v,style:kE(kE({},W),t.style)}))})},GY=["option","shapeType","activeClassName"];function XY(e,t){if(e==null)return{};var r,n,i=QY(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function QY(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function EE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Hh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?EE(Object(r),!0).forEach(function(n){ZY(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):EE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ZY(e,t,r){return(t=JY(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function JY(e){var t=eG(e,"string");return typeof t=="symbol"?t:t+""}function eG(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tG(e,t){return Hh(Hh({},t),e)}function rG(e,t){return e==="symbols"}function CE(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return y.createElement(U2,r);case"trapezoid":return y.createElement(YY,r);case"sector":return y.createElement(V2,r);case"symbols":if(rG(t))return y.createElement(X0,r);break;case"curve":return y.createElement(il,r);default:return null}}function nG(e){return y.isValidElement(e)?e.props:e}function _w(e){var{option:t,shapeType:r,activeClassName:n="recharts-active-shape"}=e,i=XY(e,GY),a;if(y.isValidElement(t))a=y.cloneElement(t,Hh(Hh({},i),nG(t)));else if(typeof t=="function")a=t(i,i.index);else if(UY(t)&&typeof t!="boolean"){var s=tG(t,i);a=y.createElement(CE,{shapeType:r,elementProps:s})}else{var u=i;a=y.createElement(CE,{shapeType:r,elementProps:u})}return i.isActive?y.createElement(Tt,{className:n},a):a}var Ew=(e,t,r)=>{var n=ht();return(i,a)=>s=>{e==null||e(i,a,s),n(TM({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:r}))}},Cw=e=>{var t=ht();return(r,n)=>i=>{e==null||e(r,n,i),t(hH())}},Ow=(e,t,r)=>{var n=ht();return(i,a)=>s=>{e==null||e(i,a,s),n(mH({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:r}))}};function ap(e){var{tooltipEntrySettings:t}=e,r=ht(),n=er(),i=y.useRef(null);return y.useLayoutEffect(()=>{n||(i.current===null?r(cH(t)):i.current!==t&&r(uH({prev:i.current,next:t})),i.current=t)},[t,r,n]),y.useLayoutEffect(()=>()=>{i.current&&(r(dH(i.current)),i.current=null)},[r]),null}function Aw(e){var{legendPayload:t}=e,r=ht(),n=er(),i=y.useRef(null);return y.useLayoutEffect(()=>{n||(i.current===null?r(R2(t)):i.current!==t&&r(D2({prev:i.current,next:t})),i.current=t)},[r,n,t]),y.useLayoutEffect(()=>()=>{i.current&&(r(L2(i.current)),i.current=null)},[r]),null}function iG(e){var{legendPayload:t}=e,r=ht(),n=xe(qe),i=y.useRef(null);return y.useLayoutEffect(()=>{n!=="centric"&&n!=="radial"||(i.current===null?r(R2(t)):i.current!==t&&r(D2({prev:i.current,next:t})),i.current=t)},[r,n,t]),y.useLayoutEffect(()=>()=>{i.current&&(r(L2(i.current)),i.current=null)},[r]),null}var Wy,aG=()=>{var[e]=y.useState(()=>Gc("uid-"));return e},oG=(Wy=_0.useId)!==null&&Wy!==void 0?Wy:aG;function sG(e,t){var r=oG();return t||(e?"".concat(e,"-").concat(r):r)}var lG=y.createContext(void 0),op=e=>{var{id:t,type:r,children:n}=e,i=sG("recharts-".concat(r),t);return y.createElement(lG.Provider,{value:i},n(i))},cG={cartesianItems:[],polarItems:[]},jI=Zr({name:"graphicalItems",initialState:cG,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Nt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,i=ii(e).cartesianItems.indexOf(r);i>-1&&(e.cartesianItems[i]=n)},prepare:Nt()},removeCartesianGraphicalItem:{reducer(e,t){var r=ii(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:Nt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Nt()},removePolarGraphicalItem:{reducer(e,t){var r=ii(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:Nt()}}}),{addCartesianGraphicalItem:uG,replaceCartesianGraphicalItem:dG,removeCartesianGraphicalItem:fG,addPolarGraphicalItem:hG,removePolarGraphicalItem:mG}=jI.actions,pG=jI.reducer,vG=e=>{var t=ht(),r=y.useRef(null);return y.useLayoutEffect(()=>{r.current===null?t(uG(e)):r.current!==e&&t(dG({prev:r.current,next:e})),r.current=e},[t,e]),y.useLayoutEffect(()=>()=>{r.current&&(t(fG(r.current)),r.current=null)},[t]),null},Tw=y.memo(vG);function gG(e){var t=ht();return y.useLayoutEffect(()=>(t(hG(e)),()=>{t(mG(e))}),[t,e]),null}var yG=["key"],xG=["onMouseEnter","onClick","onMouseLeave"],bG=["id"],wG=["id"];function OE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Lt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?OE(Object(r),!0).forEach(function(n){jG(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function jG(e,t,r){return(t=SG(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function SG(e){var t=NG(e,"string");return typeof t=="symbol"?t:t+""}function NG(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bo(){return bo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bo.apply(null,arguments)}function sp(e,t){if(e==null)return{};var r,n,i=PG(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function PG(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function kG(e){var t=y.useMemo(()=>Pw(e.children,Ll),[e.children]),r=xe(n=>RY(n,e.id,t));return r==null?null:y.createElement(iG,{legendPayload:r})}var _G=y.memo(e=>{var{dataKey:t,nameKey:r,sectors:n,stroke:i,strokeWidth:a,fill:s,name:u,hide:d,tooltipType:f,id:h}=e,p={dataDefinedOnItem:n.map(v=>v.tooltipPayload),positions:n.map(v=>v.tooltipPosition),settings:{stroke:i,strokeWidth:a,fill:s,dataKey:t,nameKey:r,name:wo(u,t),hide:d,type:f,color:s,unit:"",graphicalItemId:h}};return y.createElement(ap,{tooltipEntrySettings:p})}),EG=(e,t)=>e>t?"start":e<t?"end":"middle",CG=(e,t,r)=>_r(typeof t=="function"?t(e):t,r,r*.8),OG=(e,t,r)=>{var{top:n,left:i,width:a,height:s}=t,u=K2(a,s),d=i+_r(e.cx,a,a/2),f=n+_r(e.cy,s,s/2),h=_r(e.innerRadius,u,0),p=CG(r,e.outerRadius,u),v=e.maxRadius||Math.sqrt(a*a+s*s)/2;return{cx:d,cy:f,innerRadius:h,outerRadius:p,maxRadius:v}},AG=(e,t)=>{var r=fr(t-e),n=Math.min(Math.abs(t-e),360);return r*n};function TG(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var MG=(e,t)=>{if(y.isValidElement(e))return y.cloneElement(e,t);if(typeof e=="function")return e(t);var r=He("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:n}=t,i=sp(t,yG);return y.createElement(il,bo({},i,{type:"linear",className:r}))},IG=(e,t,r)=>{if(y.isValidElement(e))return y.cloneElement(e,t);var n=r;if(typeof e=="function"&&(n=e(t),y.isValidElement(n)))return n;var i=He("recharts-pie-label-text",TG(e));return y.createElement(tp,bo({},t,{alignmentBaseline:"middle",className:i}),n)};function RG(e){var{sectors:t,props:r,showLabels:n}=e,{label:i,labelLine:a,dataKey:s}=r;if(!n||!i||!t)return null;var u=Rr(r),d=ss(i),f=ss(a),h=typeof i=="object"&&"offsetRadius"in i&&typeof i.offsetRadius=="number"&&i.offsetRadius||20,p=t.map((v,g)=>{var j=(v.startAngle+v.endAngle)/2,b=Kt(v.cx,v.cy,v.outerRadius+h,j),w=Lt(Lt(Lt(Lt({},u),v),{},{stroke:"none"},d),{},{index:g,textAnchor:EG(b.x,v.cx)},b),N=Lt(Lt(Lt(Lt({},u),v),{},{fill:"none",stroke:v.fill},f),{},{index:g,points:[Kt(v.cx,v.cy,v.outerRadius,j),b],key:"line"});return y.createElement(Er,{zIndex:$t.label,key:"label-".concat(v.startAngle,"-").concat(v.endAngle,"-").concat(v.midAngle,"-").concat(g)},y.createElement(Tt,null,a&&MG(a,N),IG(i,w,at(v,s))))});return y.createElement(Tt,{className:"recharts-pie-labels"},p)}function DG(e){var{sectors:t,props:r,showLabels:n}=e,{label:i}=r;return typeof i=="object"&&i!=null&&"position"in i?y.createElement(rp,{label:i}):y.createElement(RG,{sectors:t,props:r,showLabels:n})}function LG(e){var{sectors:t,activeShape:r,inactiveShape:n,allOtherPieProps:i,shape:a,id:s}=e,u=xe(xo),d=xe(vw),f=xe(JH),{onMouseEnter:h,onClick:p,onMouseLeave:v}=i,g=sp(i,xG),j=Ew(h,i.dataKey,s),b=Cw(v),w=Ow(p,i.dataKey,s);return t==null||t.length===0?null:y.createElement(y.Fragment,null,t.map((N,P)=>{if((N==null?void 0:N.startAngle)===0&&(N==null?void 0:N.endAngle)===0&&t.length!==1)return null;var E=f==null||f===s,k=String(P)===u&&(d==null||i.dataKey===d)&&E,C=u?n:null,T=r&&k?r:C,A=Lt(Lt({},N),{},{stroke:N.stroke,tabIndex:-1,[w2]:P,[j2]:s});return y.createElement(Tt,bo({key:"sector-".concat(N==null?void 0:N.startAngle,"-").concat(N==null?void 0:N.endAngle,"-").concat(N.midAngle,"-").concat(P),tabIndex:-1,className:"recharts-pie-sector"},Nu(g,N,P),{onMouseEnter:j(N,P),onMouseLeave:b(N,P),onClick:w(N,P)}),y.createElement(_w,bo({option:a??T,index:P,shapeType:"sector",isActive:k},A)))}))}function $G(e){var t,{pieSettings:r,displayedData:n,cells:i,offset:a}=e,{cornerRadius:s,startAngle:u,endAngle:d,dataKey:f,nameKey:h,tooltipType:p}=r,v=Math.abs(r.minAngle),g=AG(u,d),j=Math.abs(g),b=n.length<=1?0:(t=r.paddingAngle)!==null&&t!==void 0?t:0,w=n.filter(T=>at(T,f,0)!==0).length,N=(j>=360?w:w-1)*b,P=j-w*v-N,E=n.reduce((T,A)=>{var M=at(A,f,0);return T+(ve(M)?M:0)},0),k;if(E>0){var C;k=n.map((T,A)=>{var M=at(T,f,0),z=at(T,h,A),V=OG(r,a,T),L=(ve(M)?M:0)/E,K,te=Lt(Lt({},T),i&&i[A]&&i[A].props);A?K=C.endAngle+fr(g)*b*(M!==0?1:0):K=u;var R=K+fr(g)*((M!==0?v:0)+L*P),U=(K+R)/2,F=(V.innerRadius+V.outerRadius)/2,X=[{name:z,value:M,payload:te,dataKey:f,type:p,graphicalItemId:r.id}],$=Kt(V.cx,V.cy,F,U);return C=Lt(Lt(Lt(Lt({},r.presentationProps),{},{percent:L,cornerRadius:typeof s=="string"?parseFloat(s):s,name:z,tooltipPayload:X,midAngle:U,middleRadius:F,tooltipPosition:$},te),V),{},{value:M,dataKey:f,startAngle:K,endAngle:R,payload:te,paddingAngle:fr(g)*b}),C})}return k}function zG(e){var{showLabels:t,sectors:r,children:n}=e,i=y.useMemo(()=>!t||!r?[]:r.map(a=>({value:a.value,payload:a.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:a.cx,cy:a.cy,innerRadius:a.innerRadius,outerRadius:a.outerRadius,startAngle:a.startAngle,endAngle:a.endAngle,clockWise:!1},fill:a.fill})),[r,t]);return y.createElement(xY,{value:t?i:void 0},n)}function FG(e){var{props:t,previousSectorsRef:r,id:n}=e,{sectors:i,isAnimationActive:a,animationBegin:s,animationDuration:u,animationEasing:d,activeShape:f,inactiveShape:h,onAnimationStart:p,onAnimationEnd:v}=t,g=_l(t,"recharts-pie-"),j=r.current,[b,w]=y.useState(!1),N=y.useCallback(()=>{typeof v=="function"&&v(),w(!1)},[v]),P=y.useCallback(()=>{typeof p=="function"&&p(),w(!0)},[p]);return y.createElement(zG,{showLabels:!b,sectors:i},y.createElement(kl,{animationId:g,begin:s,duration:u,isActive:a,easing:d,onAnimationStart:P,onAnimationEnd:N,key:g},E=>{var k=[],C=i&&i[0],T=C==null?void 0:C.startAngle;return i==null||i.forEach((A,M)=>{var z=j&&j[M],V=M>0?cs(A,"paddingAngle",0):0;if(z){var L=it(z.endAngle-z.startAngle,A.endAngle-A.startAngle,E),K=Lt(Lt({},A),{},{startAngle:T+V,endAngle:T+L+V});k.push(K),T=K.endAngle}else{var{endAngle:te,startAngle:R}=A,U=it(0,te-R,E),F=Lt(Lt({},A),{},{startAngle:T+V,endAngle:T+U+V});k.push(F),T=F.endAngle}}),r.current=k,y.createElement(Tt,null,y.createElement(LG,{sectors:k,activeShape:f,inactiveShape:h,allOtherPieProps:t,shape:t.shape,id:n}))}),y.createElement(DG,{showLabels:!b,sectors:i,props:t}),t.children)}var BG={animationBegin:400,animationDuration:1500,animationEasing:"ease",cx:"50%",cy:"50%",dataKey:"value",endAngle:360,fill:"#808080",hide:!1,innerRadius:0,isAnimationActive:"auto",label:!1,labelLine:!0,legendType:"rect",minAngle:0,nameKey:"name",outerRadius:"80%",paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:"#fff",zIndex:$t.area};function WG(e){var{id:t}=e,r=sp(e,bG),{hide:n,className:i,rootTabIndex:a}=e,s=y.useMemo(()=>Pw(e.children,Ll),[e.children]),u=xe(h=>DY(h,t,s)),d=y.useRef(null),f=He("recharts-pie",i);return n||u==null?(d.current=null,y.createElement(Tt,{tabIndex:a,className:f})):y.createElement(Er,{zIndex:e.zIndex},y.createElement(_G,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:u,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t}),y.createElement(Tt,{tabIndex:a,className:f},y.createElement(FG,{props:Lt(Lt({},r),{},{sectors:u}),previousSectorsRef:d,id:t})))}function Mw(e){var t=Mt(e,BG),{id:r}=t,n=sp(t,wG),i=Rr(n);return y.createElement(op,{id:r,type:"pie"},a=>y.createElement(y.Fragment,null,y.createElement(gG,{type:"pie",id:a,data:n.data,dataKey:n.dataKey,hide:n.hide,angleAxisId:0,radiusAxisId:0,name:n.name,nameKey:n.nameKey,tooltipType:n.tooltipType,legendType:n.legendType,fill:n.fill,cx:n.cx,cy:n.cy,startAngle:n.startAngle,endAngle:n.endAngle,paddingAngle:n.paddingAngle,minAngle:n.minAngle,innerRadius:n.innerRadius,outerRadius:n.outerRadius,cornerRadius:n.cornerRadius,presentationProps:i,maxRadius:t.maxRadius}),y.createElement(kG,bo({},n,{id:a})),y.createElement(WG,bo({},n,{id:a}))))}Mw.displayName="Pie";var UG=["points"];function AE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Uy(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?AE(Object(r),!0).forEach(function(n){KG(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):AE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function KG(e,t,r){return(t=qG(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qG(e){var t=HG(e,"string");return typeof t=="symbol"?t:t+""}function HG(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vh(){return Vh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vh.apply(null,arguments)}function VG(e,t){if(e==null)return{};var r,n,i=YG(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function YG(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function GG(e){var{option:t,dotProps:r,className:n}=e;if(y.isValidElement(t))return y.cloneElement(t,r);if(typeof t=="function")return t(r);var i=He(n,typeof t!="boolean"?t.className:""),a=r??{},{points:s}=a,u=VG(a,UG);return y.createElement(vI,Vh({},u,{className:i}))}function XG(e,t){return e==null?!1:t?!0:e.length===1}function SI(e){var{points:t,dot:r,className:n,dotClassName:i,dataKey:a,baseProps:s,needClip:u,clipPathId:d,zIndex:f=$t.scatter}=e;if(!XG(t,r))return null;var h=kw(r),p=cz(r),v=t.map((j,b)=>{var w,N,P=Uy(Uy(Uy({r:3},s),p),{},{index:b,cx:(w=j.x)!==null&&w!==void 0?w:void 0,cy:(N=j.y)!==null&&N!==void 0?N:void 0,dataKey:a,value:j.value,payload:j.payload,points:t});return y.createElement(GG,{key:"dot-".concat(b),option:r,dotProps:P,className:i})}),g={};return u&&d!=null&&(g.clipPath="url(#clipPath-".concat(h?"":"dots-").concat(d,")")),y.createElement(Er,{zIndex:f},y.createElement(Tt,Vh({className:n},g),v))}function TE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ME(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?TE(Object(r),!0).forEach(function(n){QG(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):TE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function QG(e,t,r){return(t=ZG(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ZG(e){var t=JG(e,"string");return typeof t=="symbol"?t:t+""}function JG(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var NI=0,eX={xAxis:{},yAxis:{},zAxis:{}},PI=Zr({name:"cartesianAxis",initialState:eX,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:Nt()},replaceXAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.xAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.xAxis[r.id],e.xAxis[n.id]=n)},prepare:Nt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:Nt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:Nt()},replaceYAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.yAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.yAxis[r.id],e.yAxis[n.id]=n)},prepare:Nt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:Nt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:Nt()},replaceZAxis:{reducer(e,t){var{prev:r,next:n}=t.payload;e.zAxis[r.id]!==void 0&&(r.id!==n.id&&delete e.zAxis[r.id],e.zAxis[n.id]=n)},prepare:Nt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:Nt()},updateYAxisWidth(e,t){var{id:r,width:n}=t.payload,i=e.yAxis[r];if(i){var a=i.widthHistory||[];if(a.length===3&&a[0]===a[2]&&n===a[1]&&n!==i.width&&Math.abs(n-a[0])<=1)return;var s=[...a,n].slice(-3);e.yAxis[r]=ME(ME({},e.yAxis[r]),{},{width:n,widthHistory:s})}}}}),{addXAxis:tX,replaceXAxis:rX,removeXAxis:nX,addYAxis:iX,replaceYAxis:aX,removeYAxis:oX,addZAxis:Zle,replaceZAxis:Jle,removeZAxis:ece,updateYAxisWidth:sX}=PI.actions,lX=PI.reducer,cX=Q([Jt],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),uX=Q([cX,Ca,Oa],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),lp=()=>xe(uX),dX=()=>xe(iV);function IE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ky(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?IE(Object(r),!0).forEach(function(n){fX(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):IE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fX(e,t,r){return(t=hX(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hX(e){var t=mX(e,"string");return typeof t=="symbol"?t:t+""}function mX(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var pX=e=>{var{point:t,childIndex:r,mainColor:n,activeDot:i,dataKey:a,clipPath:s}=e;if(i===!1||t.x==null||t.y==null)return null;var u={index:r,dataKey:a,cx:t.x,cy:t.y,r:4,fill:n??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},d=Ky(Ky(Ky({},u),ss(i)),Q0(i)),f;return y.isValidElement(i)?f=y.cloneElement(i,d):typeof i=="function"?f=i(d):f=y.createElement(vI,d),y.createElement(Tt,{className:"recharts-active-dot",clipPath:s},f)};function u0(e){var{points:t,mainColor:r,activeDot:n,itemDataKey:i,clipPath:a,zIndex:s=$t.activeDot}=e,u=xe(xo),d=dX();if(t==null||d==null)return null;var f=t.find(h=>d.includes(h.payload));return wt(f)?null:y.createElement(Er,{zIndex:s},y.createElement(pX,{point:f,childIndex:Number(u),mainColor:r,dataKey:i,activeDot:n,clipPath:a}))}var RE=(e,t,r)=>{var n=r??e;if(!wt(n))return _r(n,t,0)},vX=(e,t,r)=>{var n={},i=e.filter(Vm),a=e.filter(f=>f.stackId==null),s=i.reduce((f,h)=>(f[h.stackId]||(f[h.stackId]=[]),f[h.stackId].push(h),f),n),u=Object.entries(s).map(f=>{var[h,p]=f,v=p.map(j=>j.dataKey),g=RE(t,r,p[0].barSize);return{stackId:h,dataKeys:v,barSize:g}}),d=a.map(f=>{var h=[f.dataKey].filter(v=>v!=null),p=RE(t,r,f.barSize);return{stackId:void 0,dataKeys:h,barSize:p}});return[...u,...d]};function DE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _f(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?DE(Object(r),!0).forEach(function(n){gX(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gX(e,t,r){return(t=yX(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yX(e){var t=xX(e,"string");return typeof t=="symbol"?t:t+""}function xX(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bX(e,t,r,n,i){var a=n.length;if(!(a<1)){var s=_r(e,r,0,!0),u,d=[];if(nt(n[0].barSize)){var f=!1,h=r/a,p=n.reduce((N,P)=>N+(P.barSize||0),0);p+=(a-1)*s,p>=r&&(p-=(a-1)*s,s=0),p>=r&&h>0&&(f=!0,h*=.9,p=a*h);var v=(r-p)/2>>0,g={offset:v-s,size:0};u=n.reduce((N,P)=>{var E,k={stackId:P.stackId,dataKeys:P.dataKeys,position:{offset:g.offset+g.size+s,size:f?h:(E=P.barSize)!==null&&E!==void 0?E:0}},C=[...N,k];return g=C[C.length-1].position,C},d)}else{var j=_r(t,r,0,!0);r-2*j-(a-1)*s<=0&&(s=0);var b=(r-2*j-(a-1)*s)/a;b>1&&(b>>=0);var w=nt(i)?Math.min(b,i):b;u=n.reduce((N,P,E)=>[...N,{stackId:P.stackId,dataKeys:P.dataKeys,position:{offset:j+(b+s)*E+(b-w)/2,size:w}}],d)}return u}}var wX=(e,t,r,n,i,a,s)=>{var u=wt(s)?t:s,d=bX(r,n,i!==a?i:a,e,u);return i!==a&&d!=null&&(d=d.map(f=>_f(_f({},f),{},{position:_f(_f({},f.position),{},{offset:f.position.offset-i/2})}))),d},jX=(e,t)=>{var r=Hm(t);if(!(!e||r==null||t==null)){var{stackId:n}=t;if(n!=null){var i=e[n];if(i){var{stackedData:a}=i;if(a)return a.find(s=>s.key===r)}}}};function SX(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&nt(e.zIndex)?e.zIndex:t}var kI=e=>{var{chartData:t}=e,r=ht(),n=er();return y.useEffect(()=>n?()=>{}:(r(U_(t)),()=>{r(U_(void 0))}),[t,r,n]),null},LE={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},_I=Zr({name:"brush",initialState:LE,reducers:{setBrushSettings(e,t){return t.payload==null?LE:t.payload}}}),{setBrushSettings:tce}=_I.actions,NX=_I.reducer;function $E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ef(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$E(Object(r),!0).forEach(function(n){EI(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$E(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function EI(e,t,r){return(t=PX(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function PX(e){var t=kX(e,"string");return typeof t=="symbol"?t:t+""}function kX(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _X=(e,t)=>{var{x:r,y:n}=e,{x:i,y:a}=t;return{x:Math.min(r,i),y:Math.min(n,a),width:Math.abs(i-r),height:Math.abs(a-n)}},EX=e=>{var{x1:t,y1:r,x2:n,y2:i}=e;return _X({x:t,y:r},{x:n,y:i})};class cp{static create(t){return new cp(t)}constructor(t){this.scale=t}get domain(){return this.scale.domain}get range(){return this.scale.range}get rangeMin(){return this.range()[0]}get rangeMax(){return this.range()[1]}get bandwidth(){return this.scale.bandwidth}apply(t){var{bandAware:r,position:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t!==void 0){if(n)switch(n){case"start":return this.scale(t);case"middle":{var i=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+i}case"end":{var a=this.bandwidth?this.bandwidth():0;return this.scale(t)+a}default:return this.scale(t)}if(r){var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+s}return this.scale(t)}}isInRange(t){var r=this.range(),n=r[0],i=r[r.length-1];return n<=i?t>=n&&t<=i:t>=i&&t<=n}}EI(cp,"EPS",1e-4);var CX=e=>{var t=Object.keys(e).reduce((r,n)=>Ef(Ef({},r),{},{[n]:cp.create(e[n])}),{});return Ef(Ef({},t),{},{apply(r){var{bandAware:n,position:i}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.fromEntries(Object.entries(r).map(a=>{var[s,u]=a;return[s,t[s].apply(u,{bandAware:n,position:i})]}))},isInRange(r){return Object.keys(r).every(n=>t[n].isInRange(r[n]))}})};function OX(e){return(e%180+180)%180}var AX=function(t){var{width:r,height:n}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=OX(i),s=a*Math.PI/180,u=Math.atan(n/r),d=s>u&&s<Math.PI-u?n/Math.sin(s):r/Math.cos(s);return Math.abs(d)},TX={dots:[],areas:[],lines:[]},CI=Zr({name:"referenceElements",initialState:TX,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=ii(e).dots.findIndex(n=>n===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=ii(e).areas.findIndex(n=>n===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=ii(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),{addDot:rce,removeDot:nce,addArea:ice,removeArea:ace,addLine:MX,removeLine:IX}=CI.actions,RX=CI.reducer,OI=y.createContext(void 0),DX=e=>{var{children:t}=e,[r]=y.useState("".concat(Gc("recharts"),"-clip")),n=lp();if(n==null)return null;var{x:i,y:a,width:s,height:u}=n;return y.createElement(OI.Provider,{value:r},y.createElement("defs",null,y.createElement("clipPath",{id:r},y.createElement("rect",{x:i,y:a,height:u,width:s}))),t)},LX=()=>y.useContext(OI);function zE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function FE(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zE(Object(r),!0).forEach(function(n){$X(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $X(e,t,r){return(t=zX(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zX(e){var t=FX(e,"string");return typeof t=="symbol"?t:t+""}function FX(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Yh(){return Yh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yh.apply(null,arguments)}var BX=(e,t)=>{var r;if(y.isValidElement(e))r=y.cloneElement(e,t);else if(typeof e=="function")r=e(t);else{if(!nt(t.x1)||!nt(t.y1)||!nt(t.x2)||!nt(t.y2))return null;r=y.createElement("line",Yh({},t,{className:"recharts-reference-line-line"}))}return r},WX=(e,t,r,n,i,a)=>{var{x:s,width:u}=a,d=i.y.apply(e,{position:r});if(Xr(d)||t==="discard"&&!i.y.isInRange(d))return null;var f=[{x:s+u,y:d},{x:s,y:d}];return n==="left"?f.reverse():f},UX=(e,t,r,n,i,a)=>{var{y:s,height:u}=a,d=i.x.apply(e,{position:r});if(Xr(d)||t==="discard"&&!i.x.isInRange(d))return null;var f=[{x:d,y:s+u},{x:d,y:s}];return n==="top"?f.reverse():f},KX=(e,t,r,n)=>{var i=e.map(a=>n.apply(a,{position:r}));return t==="discard"&&i.some(a=>!n.isInRange(a))?null:i},qX=(e,t,r,n,i,a)=>{var{x:s,y:u,segment:d,ifOverflow:f}=a,h=$n(s),p=$n(u);return p?WX(u,f,r,i,e,t):h?UX(s,f,r,n,e,t):d!=null&&d.length===2?KX(d,f,r,e):null};function HX(e){var t=ht();return y.useEffect(()=>(t(MX(e)),()=>{t(IX(e))})),null}function VX(e){var{xAxisId:t,yAxisId:r,shape:n,className:i,ifOverflow:a}=e,s=er(),u=LX(),d=xe(T=>Di(T,t)),f=xe(T=>Li(T,r)),h=xe(T=>gl(T,"xAxis",t,s)),p=xe(T=>gl(T,"yAxis",r,s)),v=Eu();if(!u||!v||d==null||f==null||h==null||p==null)return null;var g=CX({x:h,y:p}),j=qX(g,v,e.position,d.orientation,f.orientation,e);if(!j)return null;var[{x:b,y:w},{x:N,y:P}]=j,E=a==="hidden"?"url(#".concat(u,")"):void 0,k=FE(FE({clipPath:E},br(e)),{},{x1:b,y1:w,x2:N,y2:P}),C=EX({x1:b,y1:w,x2:N,y2:P});return y.createElement(Er,{zIndex:e.zIndex},y.createElement(Tt,{className:He("recharts-reference-line",i)},BX(n,k),y.createElement(dI,Yh({},C,{lowerWidth:C.width,upperWidth:C.width}),y.createElement(hI,{label:e.label}),e.children)))}var YX={ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle",zIndex:$t.line};function AI(e){var t=Mt(e,YX);return y.createElement(y.Fragment,null,y.createElement(HX,{yAxisId:t.yAxisId,xAxisId:t.xAxisId,ifOverflow:t.ifOverflow,x:t.x,y:t.y,segment:t.segment}),y.createElement(VX,t))}AI.displayName="ReferenceLine";function TI(e,t){if(t<1)return[];if(t===1)return e;for(var r=[],n=0;n<e.length;n+=t){var i=e[n];i!==void 0&&r.push(i)}return r}function GX(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return AX(n,r)}function XX(e,t,r){var n=r==="width",{x:i,y:a,width:s,height:u}=e;return t===1?{start:n?i:a,end:n?i+s:a+u}:{start:n?i+s:a+u,end:n?i:a}}function lu(e,t,r,n,i){if(e*t<e*n||e*t>e*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function QX(e,t){return TI(e,t+1)}function ZX(e,t,r,n,i){for(var a=(n||[]).slice(),{start:s,end:u}=t,d=0,f=1,h=s,p=function(){var j=n==null?void 0:n[d];if(j===void 0)return{v:TI(n,f)};var b=d,w,N=()=>(w===void 0&&(w=r(j,b)),w),P=j.coordinate,E=d===0||lu(e,P,N,h,u);E||(d=0,h=s,f+=1),E&&(h=P+e*(N()/2+i),d+=f)},v;f<=a.length;)if(v=p(),v)return v.v;return[]}function JX(e,t,r,n,i){var a=(n||[]).slice(),s=a.length;if(s===0)return[];for(var{start:u,end:d}=t,f=1;f<=s;f++){for(var h=(s-1)%f,p=u,v=!0,g=function(){var P=n[j],E=j,k,C=()=>(k===void 0&&(k=r(P,E)),k),T=P.coordinate,A=j===h||lu(e,T,C,p,d);if(!A)return v=!1,1;A&&(p=T+e*(C()/2+i))},j=h;j<s&&!g();j+=f);if(v){for(var b=[],w=h;w<s;w+=f)b.push(n[w]);return b}}return[]}function BE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Pr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?BE(Object(r),!0).forEach(function(n){eQ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):BE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function eQ(e,t,r){return(t=tQ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tQ(e){var t=rQ(e,"string");return typeof t=="symbol"?t:t+""}function rQ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function nQ(e,t,r,n,i){for(var a=(n||[]).slice(),s=a.length,{start:u}=t,{end:d}=t,f=function(v){var g=a[v],j,b=()=>(j===void 0&&(j=r(g,v)),j);if(v===s-1){var w=e*(g.coordinate+e*b()/2-d);a[v]=g=Pr(Pr({},g),{},{tickCoord:w>0?g.coordinate-w*e:g.coordinate})}else a[v]=g=Pr(Pr({},g),{},{tickCoord:g.coordinate});if(g.tickCoord!=null){var N=lu(e,g.tickCoord,b,u,d);N&&(d=g.tickCoord-e*(b()/2+i),a[v]=Pr(Pr({},g),{},{isShow:!0}))}},h=s-1;h>=0;h--)f(h);return a}function iQ(e,t,r,n,i,a){var s=(n||[]).slice(),u=s.length,{start:d,end:f}=t;if(a){var h=n[u-1],p=r(h,u-1),v=e*(h.coordinate+e*p/2-f);if(s[u-1]=h=Pr(Pr({},h),{},{tickCoord:v>0?h.coordinate-v*e:h.coordinate}),h.tickCoord!=null){var g=lu(e,h.tickCoord,()=>p,d,f);g&&(f=h.tickCoord-e*(p/2+i),s[u-1]=Pr(Pr({},h),{},{isShow:!0}))}}for(var j=a?u-1:u,b=function(P){var E=s[P],k,C=()=>(k===void 0&&(k=r(E,P)),k);if(P===0){var T=e*(E.coordinate-e*C()/2-d);s[P]=E=Pr(Pr({},E),{},{tickCoord:T<0?E.coordinate-T*e:E.coordinate})}else s[P]=E=Pr(Pr({},E),{},{tickCoord:E.coordinate});if(E.tickCoord!=null){var A=lu(e,E.tickCoord,C,d,f);A&&(d=E.tickCoord+e*(C()/2+i),s[P]=Pr(Pr({},E),{},{isShow:!0}))}},w=0;w<j;w++)b(w);return s}function Iw(e,t,r){var{tick:n,ticks:i,viewBox:a,minTickGap:s,orientation:u,interval:d,tickFormatter:f,unit:h,angle:p}=e;if(!i||!i.length||!n)return[];if(ve(d)||Ou.isSsr){var v;return(v=QX(i,ve(d)?d:0))!==null&&v!==void 0?v:[]}var g=[],j=u==="top"||u==="bottom"?"width":"height",b=h&&j==="width"?Kc(h,{fontSize:t,letterSpacing:r}):{width:0,height:0},w=(E,k)=>{var C=typeof f=="function"?f(E.value,k):E.value;return j==="width"?GX(Kc(C,{fontSize:t,letterSpacing:r}),b,p):Kc(C,{fontSize:t,letterSpacing:r})[j]},N=i.length>=2?fr(i[1].coordinate-i[0].coordinate):1,P=XX(a,N,j);return d==="equidistantPreserveStart"?ZX(N,P,w,i,s):d==="equidistantPreserveEnd"?JX(N,P,w,i,s):(d==="preserveStart"||d==="preserveStartEnd"?g=iQ(N,P,w,i,s,d==="preserveStartEnd"):g=nQ(N,P,w,i,s),g.filter(E=>E.isShow))}var aQ=e=>{var{ticks:t,label:r,labelGapWithTick:n=5,tickSize:i=0,tickMargin:a=0}=e,s=0;if(t){Array.from(t).forEach(h=>{if(h){var p=h.getBoundingClientRect();p.width>s&&(s=p.width)}});var u=r?r.getBoundingClientRect().width:0,d=i+a,f=s+d+u+(r?n:0);return Math.round(f)}return 0},oQ=["axisLine","width","height","className","hide","ticks","axisType"];function sQ(e,t){if(e==null)return{};var r,n,i=lQ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function lQ(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function ps(){return ps=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ps.apply(null,arguments)}function WE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ut(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?WE(Object(r),!0).forEach(function(n){cQ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):WE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cQ(e,t,r){return(t=uQ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uQ(e){var t=dQ(e,"string");return typeof t=="symbol"?t:t+""}function dQ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var pa={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",zIndex:$t.axis};function fQ(e){var{x:t,y:r,width:n,height:i,orientation:a,mirror:s,axisLine:u,otherSvgProps:d}=e;if(!u)return null;var f=Ut(Ut(Ut({},d),Rr(u)),{},{fill:"none"});if(a==="top"||a==="bottom"){var h=+(a==="top"&&!s||a==="bottom"&&s);f=Ut(Ut({},f),{},{x1:t,y1:r+h*i,x2:t+n,y2:r+h*i})}else{var p=+(a==="left"&&!s||a==="right"&&s);f=Ut(Ut({},f),{},{x1:t+p*n,y1:r,x2:t+p*n,y2:r+i})}return y.createElement("line",ps({},f,{className:He("recharts-cartesian-axis-line",cs(u,"className"))}))}function hQ(e,t,r,n,i,a,s,u,d){var f,h,p,v,g,j,b=u?-1:1,w=e.tickSize||s,N=ve(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":f=h=e.coordinate,v=r+ +!u*i,p=v-b*w,j=p-b*d,g=N;break;case"left":p=v=e.coordinate,h=t+ +!u*n,f=h-b*w,g=f-b*d,j=N;break;case"right":p=v=e.coordinate,h=t+ +u*n,f=h+b*w,g=f+b*d,j=N;break;default:f=h=e.coordinate,v=r+ +u*i,p=v+b*w,j=p+b*d,g=N;break}return{line:{x1:f,y1:p,x2:h,y2:v},tick:{x:g,y:j}}}function mQ(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function pQ(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function vQ(e){var{option:t,tickProps:r,value:n}=e,i,a=He(r.className,"recharts-cartesian-axis-tick-value");if(y.isValidElement(t))i=y.cloneElement(t,Ut(Ut({},r),{},{className:a}));else if(typeof t=="function")i=t(Ut(Ut({},r),{},{className:a}));else{var s="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(s=He(s,t==null?void 0:t.className)),i=y.createElement(tp,ps({},r,{className:s}),n)}return i}var gQ=y.forwardRef((e,t)=>{var{ticks:r=[],tick:n,tickLine:i,stroke:a,tickFormatter:s,unit:u,padding:d,tickTextProps:f,orientation:h,mirror:p,x:v,y:g,width:j,height:b,tickSize:w,tickMargin:N,fontSize:P,letterSpacing:E,getTicksConfig:k,events:C,axisType:T}=e,A=Iw(Ut(Ut({},k),{},{ticks:r}),P,E),M=mQ(h,p),z=pQ(h,p),V=Rr(k),L=ss(n),K={};typeof i=="object"&&(K=i);var te=Ut(Ut({},V),{},{fill:"none"},K),R=A.map(X=>Ut({entry:X},hQ(X,v,g,j,b,h,w,p,N))),U=R.map(X=>{var{entry:$,line:Y}=X;return y.createElement(Tt,{className:"recharts-cartesian-axis-tick",key:"tick-".concat($.value,"-").concat($.coordinate,"-").concat($.tickCoord)},i&&y.createElement("line",ps({},te,Y,{className:He("recharts-cartesian-axis-tick-line",cs(i,"className"))})))}),F=R.map((X,$)=>{var{entry:Y,tick:W}=X,I=Ut(Ut(Ut(Ut({textAnchor:M,verticalAnchor:z},V),{},{stroke:"none",fill:a},L),W),{},{index:$,payload:Y,visibleTicksCount:A.length,tickFormatter:s,padding:d},f);return y.createElement(Tt,ps({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(Y.value,"-").concat(Y.coordinate,"-").concat(Y.tickCoord)},Nu(C,Y,$)),n&&y.createElement(vQ,{option:n,tickProps:I,value:"".concat(typeof s=="function"?s(Y.value,$):Y.value).concat(u||"")}))});return y.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(T,"-ticks")},F.length>0&&y.createElement(Er,{zIndex:$t.label},y.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(T,"-tick-labels"),ref:t},F)),U.length>0&&y.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(T,"-tick-lines")},U))}),yQ=y.forwardRef((e,t)=>{var{axisLine:r,width:n,height:i,className:a,hide:s,ticks:u,axisType:d}=e,f=sQ(e,oQ),[h,p]=y.useState(""),[v,g]=y.useState(""),j=y.useRef(null);y.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var w;return aQ({ticks:j.current,label:(w=e.labelRef)===null||w===void 0?void 0:w.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var b=y.useCallback(w=>{if(w){var N=w.getElementsByClassName("recharts-cartesian-axis-tick-value");j.current=N;var P=N[0];if(P){var E=window.getComputedStyle(P),k=E.fontSize,C=E.letterSpacing;(k!==h||C!==v)&&(p(k),g(C))}}},[h,v]);return s||n!=null&&n<=0||i!=null&&i<=0?null:y.createElement(Er,{zIndex:e.zIndex},y.createElement(Tt,{className:He("recharts-cartesian-axis",a)},y.createElement(fQ,{x:e.x,y:e.y,width:n,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:Rr(e)}),y.createElement(gQ,{ref:b,axisType:d,events:f,fontSize:h,getTicksConfig:e,height:e.height,letterSpacing:v,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:u,unit:e.unit,width:e.width,x:e.x,y:e.y}),y.createElement(dI,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},y.createElement(hI,{label:e.label,labelRef:e.labelRef}),e.children)))}),Rw=y.forwardRef((e,t)=>{var r=Mt(e,pa);return y.createElement(yQ,ps({},r,{ref:t}))});Rw.displayName="CartesianAxis";var xQ=["x1","y1","x2","y2","key"],bQ=["offset"],wQ=["xAxisId","yAxisId"],jQ=["xAxisId","yAxisId"];function UE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function kr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?UE(Object(r),!0).forEach(function(n){SQ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):UE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function SQ(e,t,r){return(t=NQ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function NQ(e){var t=PQ(e,"string");return typeof t=="symbol"?t:t+""}function PQ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xo(){return Xo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xo.apply(null,arguments)}function Gh(e,t){if(e==null)return{};var r,n,i=kQ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function kQ(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var _Q=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:r,x:n,y:i,width:a,height:s,ry:u}=e;return y.createElement("rect",{x:n,y:i,ry:u,width:a,height:s,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function MI(e){var{option:t,lineItemProps:r}=e,n;if(y.isValidElement(t))n=y.cloneElement(t,r);else if(typeof t=="function")n=t(r);else{var i,{x1:a,y1:s,x2:u,y2:d,key:f}=r,h=Gh(r,xQ),p=(i=Rr(h))!==null&&i!==void 0?i:{},{offset:v}=p,g=Gh(p,bQ);n=y.createElement("line",Xo({},g,{x1:a,y1:s,x2:u,y2:d,fill:"none",key:f}))}return n}function EQ(e){var{x:t,width:r,horizontal:n=!0,horizontalPoints:i}=e;if(!n||!i||!i.length)return null;var{xAxisId:a,yAxisId:s}=e,u=Gh(e,wQ),d=i.map((f,h)=>{var p=kr(kr({},u),{},{x1:t,y1:f,x2:t+r,y2:f,key:"line-".concat(h),index:h});return y.createElement(MI,{key:"line-".concat(h),option:n,lineItemProps:p})});return y.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function CQ(e){var{y:t,height:r,vertical:n=!0,verticalPoints:i}=e;if(!n||!i||!i.length)return null;var{xAxisId:a,yAxisId:s}=e,u=Gh(e,jQ),d=i.map((f,h)=>{var p=kr(kr({},u),{},{x1:f,y1:t,x2:f,y2:t+r,key:"line-".concat(h),index:h});return y.createElement(MI,{option:n,lineItemProps:p,key:"line-".concat(h)})});return y.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function OQ(e){var{horizontalFill:t,fillOpacity:r,x:n,y:i,width:a,height:s,horizontalPoints:u,horizontal:d=!0}=e;if(!d||!t||!t.length||u==null)return null;var f=u.map(p=>Math.round(p+i-i)).sort((p,v)=>p-v);i!==f[0]&&f.unshift(0);var h=f.map((p,v)=>{var g=!f[v+1],j=g?i+s-p:f[v+1]-p;if(j<=0)return null;var b=v%t.length;return y.createElement("rect",{key:"react-".concat(v),y:p,x:n,height:j,width:a,stroke:"none",fill:t[b],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return y.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},h)}function AQ(e){var{vertical:t=!0,verticalFill:r,fillOpacity:n,x:i,y:a,width:s,height:u,verticalPoints:d}=e;if(!t||!r||!r.length)return null;var f=d.map(p=>Math.round(p+i-i)).sort((p,v)=>p-v);i!==f[0]&&f.unshift(0);var h=f.map((p,v)=>{var g=!f[v+1],j=g?i+s-p:f[v+1]-p;if(j<=0)return null;var b=v%r.length;return y.createElement("rect",{key:"react-".concat(v),x:p,y:a,width:j,height:u,stroke:"none",fill:r[b],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return y.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},h)}var TQ=(e,t)=>{var{xAxis:r,width:n,height:i,offset:a}=e;return g2(Iw(kr(kr(kr({},pa),r),{},{ticks:y2(r),viewBox:{x:0,y:0,width:n,height:i}})),a.left,a.left+a.width,t)},MQ=(e,t)=>{var{yAxis:r,width:n,height:i,offset:a}=e;return g2(Iw(kr(kr(kr({},pa),r),{},{ticks:y2(r),viewBox:{x:0,y:0,width:n,height:i}})),a.top,a.top+a.height,t)},IQ={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:$t.grid};function Si(e){var t=lb(),r=cb(),n=_2(),i=kr(kr({},Mt(e,IQ)),{},{x:ve(e.x)?e.x:n.left,y:ve(e.y)?e.y:n.top,width:ve(e.width)?e.width:n.width,height:ve(e.height)?e.height:n.height}),{xAxisId:a,yAxisId:s,x:u,y:d,width:f,height:h,syncWithTicks:p,horizontalValues:v,verticalValues:g}=i,j=er(),b=xe(z=>A_(z,"xAxis",a,j)),w=xe(z=>A_(z,"yAxis",s,j));if(!_i(f)||!_i(h)||!ve(u)||!ve(d))return null;var N=i.verticalCoordinatesGenerator||TQ,P=i.horizontalCoordinatesGenerator||MQ,{horizontalPoints:E,verticalPoints:k}=i;if((!E||!E.length)&&typeof P=="function"){var C=v&&v.length,T=P({yAxis:w?kr(kr({},w),{},{ticks:C?v:w.ticks}):void 0,width:t??f,height:r??h,offset:n},C?!0:p);bh(Array.isArray(T),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof T,"]")),Array.isArray(T)&&(E=T)}if((!k||!k.length)&&typeof N=="function"){var A=g&&g.length,M=N({xAxis:b?kr(kr({},b),{},{ticks:A?g:b.ticks}):void 0,width:t??f,height:r??h,offset:n},A?!0:p);bh(Array.isArray(M),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof M,"]")),Array.isArray(M)&&(k=M)}return y.createElement(Er,{zIndex:i.zIndex},y.createElement("g",{className:"recharts-cartesian-grid"},y.createElement(_Q,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),y.createElement(OQ,Xo({},i,{horizontalPoints:E})),y.createElement(AQ,Xo({},i,{verticalPoints:k})),y.createElement(EQ,Xo({},i,{offset:n,horizontalPoints:E,xAxis:b,yAxis:w})),y.createElement(CQ,Xo({},i,{offset:n,verticalPoints:k,xAxis:b,yAxis:w}))))}Si.displayName="CartesianGrid";var RQ={},II=Zr({name:"errorBars",initialState:RQ,reducers:{addErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]||(e[r]=[]),e[r].push(n)},replaceErrorBar:(e,t)=>{var{itemId:r,prev:n,next:i}=t.payload;e[r]&&(e[r]=e[r].map(a=>a.dataKey===n.dataKey&&a.direction===n.direction?i:a))},removeErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]&&(e[r]=e[r].filter(i=>i.dataKey!==n.dataKey||i.direction!==n.direction))}}}),{addErrorBar:oce,replaceErrorBar:sce,removeErrorBar:lce}=II.actions,DQ=II.reducer,LQ=["children"];function $Q(e,t){if(e==null)return{};var r,n,i=zQ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function zQ(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var FQ={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},BQ=y.createContext(FQ);function RI(e){var{children:t}=e,r=$Q(e,LQ);return y.createElement(BQ.Provider,{value:r},t)}function up(e,t){var r,n,i=xe(f=>Di(f,e)),a=xe(f=>Li(f,t)),s=(r=i==null?void 0:i.allowDataOverflow)!==null&&r!==void 0?r:cr.allowDataOverflow,u=(n=a==null?void 0:a.allowDataOverflow)!==null&&n!==void 0?n:ur.allowDataOverflow,d=s||u;return{needClip:d,needClipX:s,needClipY:u}}function Dw(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,i=lp(),{needClipX:a,needClipY:s,needClip:u}=up(t,r);if(!u||!i)return null;var{x:d,y:f,width:h,height:p}=i;return y.createElement("clipPath",{id:"clipPath-".concat(n)},y.createElement("rect",{x:a?d:d-h/2,y:s?f:f-p/2,width:a?h:h*2,height:s?p:p*2}))}var DI=(e,t,r,n)=>Oi(e,"xAxis",t,n),LI=(e,t,r,n)=>Ci(e,"xAxis",t,n),$I=(e,t,r,n)=>Oi(e,"yAxis",r,n),zI=(e,t,r,n)=>Ci(e,"yAxis",r,n),WQ=Q([qe,DI,$I,LI,zI],(e,t,r,n,i)=>Ri(e,"xAxis")?go(t,n,!1):go(r,i,!1)),UQ=(e,t,r,n,i)=>i;function KQ(e){return e.type==="line"}var qQ=Q([$u,UQ],(e,t)=>e.filter(KQ).find(r=>r.id===t)),HQ=Q([qe,DI,$I,LI,zI,qQ,WQ,Rb],(e,t,r,n,i,a,s,u)=>{var{chartData:d,dataStartIndex:f,dataEndIndex:h}=u;if(!(a==null||t==null||r==null||n==null||i==null||n.length===0||i.length===0||s==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:p,data:v}=a,g;if(v!=null&&v.length>0?g=v:g=d==null?void 0:d.slice(f,h+1),g!=null)return OZ({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:i,dataKey:p,bandSize:s,displayedData:g})}});function FI(e){var t=ss(e),r=3,n=2;if(t!=null){var{r:i,strokeWidth:a}=t,s=Number(i),u=Number(a);return(Number.isNaN(s)||s<0)&&(s=r),(Number.isNaN(u)||u<0)&&(u=n),{r:s,strokeWidth:u}}return{r,strokeWidth:n}}var qy={exports:{}},Hy={};/**
116
+ * @license React
117
+ * use-sync-external-store-with-selector.production.js
118
+ *
119
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
120
+ *
121
+ * This source code is licensed under the MIT license found in the
122
+ * LICENSE file in the root directory of this source tree.
123
+ */var KE;function VQ(){if(KE)return Hy;KE=1;var e=bl();function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var r=typeof Object.is=="function"?Object.is:t,n=e.useSyncExternalStore,i=e.useRef,a=e.useEffect,s=e.useMemo,u=e.useDebugValue;return Hy.useSyncExternalStoreWithSelector=function(d,f,h,p,v){var g=i(null);if(g.current===null){var j={hasValue:!1,value:null};g.current=j}else j=g.current;g=s(function(){function w(C){if(!N){if(N=!0,P=C,C=p(C),v!==void 0&&j.hasValue){var T=j.value;if(v(T,C))return E=T}return E=C}if(T=E,r(P,C))return T;var A=p(C);return v!==void 0&&v(T,A)?(P=C,T):(P=C,E=A)}var N=!1,P,E,k=h===void 0?null:h;return[function(){return w(f())},k===null?void 0:function(){return w(k())}]},[f,h,p,v]);var b=n(d,g[0],g[1]);return a(function(){j.hasValue=!0,j.value=b},[b]),u(b),b},Hy}var qE;function YQ(){return qE||(qE=1,qy.exports=VQ()),qy.exports}YQ();function GQ(e){e()}function XQ(){let e=null,t=null;return{clear(){e=null,t=null},notify(){GQ(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const i=t={callback:r,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!n||e===null||(n=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var HE={notify(){},get:()=>[]};function QQ(e,t){let r,n=HE,i=0,a=!1;function s(b){h();const w=n.subscribe(b);let N=!1;return()=>{N||(N=!0,w(),p())}}function u(){n.notify()}function d(){j.onStateChange&&j.onStateChange()}function f(){return a}function h(){i++,r||(r=e.subscribe(d),n=XQ())}function p(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=HE)}function v(){a||(a=!0,h())}function g(){a&&(a=!1,p())}const j={addNestedSub:s,notifyNestedSubs:u,handleChangeWrapper:d,isSubscribed:f,trySubscribe:v,tryUnsubscribe:g,getListeners:()=>n};return j}var ZQ=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",JQ=ZQ(),eZ=()=>typeof navigator<"u"&&navigator.product==="ReactNative",tZ=eZ(),rZ=()=>JQ||tZ?y.useLayoutEffect:y.useEffect,nZ=rZ();function VE(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function iZ(e,t){if(VE(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let i=0;i<r.length;i++)if(!Object.prototype.hasOwnProperty.call(t,r[i])||!VE(e[r[i]],t[r[i]]))return!1;return!0}var Vy=Symbol.for("react-redux-context"),Yy=typeof globalThis<"u"?globalThis:{};function aZ(){if(!y.createContext)return{};const e=Yy[Vy]??(Yy[Vy]=new Map);let t=e.get(y.createContext);return t||(t=y.createContext(null),e.set(y.createContext,t)),t}var oZ=aZ();function sZ(e){const{children:t,context:r,serverState:n,store:i}=e,a=y.useMemo(()=>{const d=QQ(i);return{store:i,subscription:d,getServerState:n?()=>n:void 0}},[i,n]),s=y.useMemo(()=>i.getState(),[i]);nZ(()=>{const{subscription:d}=a;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),s!==i.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[a,s]);const u=r||oZ;return y.createElement(u.Provider,{value:a},t)}var lZ=sZ,cZ=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function uZ(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function qu(e,t){var r=new Set([...Object.keys(e),...Object.keys(t)]);for(var n of r)if(cZ.has(n)){if(e[n]==null&&t[n]==null)continue;if(!iZ(e[n],t[n]))return!1}else if(!uZ(e[n],t[n]))return!1;return!0}var dZ=["id"],fZ=["type","layout","connectNulls","needClip","shape"],hZ=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function cu(){return cu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cu.apply(null,arguments)}function YE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function wi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?YE(Object(r),!0).forEach(function(n){mZ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):YE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function mZ(e,t,r){return(t=pZ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pZ(e){var t=vZ(e,"string");return typeof t=="symbol"?t:t+""}function vZ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Lw(e,t){if(e==null)return{};var r,n,i=gZ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function gZ(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var yZ=e=>{var{dataKey:t,name:r,stroke:n,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:n,value:wo(r,t),payload:e}]},xZ=y.memo(e=>{var{dataKey:t,data:r,stroke:n,strokeWidth:i,fill:a,name:s,hide:u,unit:d,tooltipType:f,id:h}=e,p={dataDefinedOnItem:r,positions:void 0,settings:{stroke:n,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:wo(s,t),hide:u,type:f,color:n,unit:d,graphicalItemId:h}};return y.createElement(ap,{tooltipEntrySettings:p})}),BI=(e,t)=>"".concat(t,"px ").concat(e-t,"px");function bZ(e,t){for(var r=e.length%2!==0?[...e,0]:e,n=[],i=0;i<t;++i)n=[...n,...r];return n}var wZ=(e,t,r)=>{var n=r.reduce((p,v)=>p+v);if(!n)return BI(t,e);for(var i=Math.floor(e/n),a=e%n,s=t-e,u=[],d=0,f=0;d<r.length;f+=r[d],++d)if(f+r[d]>a){u=[...r.slice(0,d),a-f];break}var h=u.length%2===0?[0,s]:[s];return[...bZ(r,i),...u,...h].map(p=>"".concat(p,"px")).join(", ")};function jZ(e){var{clipPathId:t,points:r,props:n}=e,{dot:i,dataKey:a,needClip:s}=n,{id:u}=n,d=Lw(n,dZ),f=Rr(d);return y.createElement(SI,{points:r,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:f,needClip:s,clipPathId:t})}function SZ(e){var{showLabels:t,children:r,points:n}=e,i=y.useMemo(()=>n==null?void 0:n.map(a=>{var s,u,d={x:(s=a.x)!==null&&s!==void 0?s:0,y:(u=a.y)!==null&&u!==void 0?u:0,width:0,lowerWidth:0,upperWidth:0,height:0};return wi(wi({},d),{},{value:a.value,payload:a.payload,viewBox:d,parentViewBox:void 0,fill:void 0})}),[n]);return y.createElement(jw,{value:t?i:void 0},r)}function GE(e){var{clipPathId:t,pathRef:r,points:n,strokeDasharray:i,props:a}=e,{type:s,layout:u,connectNulls:d,needClip:f,shape:h}=a,p=Lw(a,fZ),v=wi(wi({},br(p)),{},{fill:"none",className:"recharts-line-curve",clipPath:f?"url(#clipPath-".concat(t,")"):void 0,points:n,type:s,layout:u,connectNulls:d,strokeDasharray:i??a.strokeDasharray});return y.createElement(y.Fragment,null,(n==null?void 0:n.length)>1&&y.createElement(_w,cu({shapeType:"curve",option:h},v,{pathRef:r})),y.createElement(jZ,{points:n,clipPathId:t,props:a}))}function NZ(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function PZ(e){var{clipPathId:t,props:r,pathRef:n,previousPointsRef:i,longestAnimatedLengthRef:a}=e,{points:s,strokeDasharray:u,isAnimationActive:d,animationBegin:f,animationDuration:h,animationEasing:p,animateNewValues:v,width:g,height:j,onAnimationEnd:b,onAnimationStart:w}=r,N=i.current,P=_l(s,"recharts-line-"),E=y.useRef(P),[k,C]=y.useState(!1),T=!k,A=y.useCallback(()=>{typeof b=="function"&&b(),C(!1)},[b]),M=y.useCallback(()=>{typeof w=="function"&&w(),C(!0)},[w]),z=NZ(n.current),V=y.useRef(0);E.current!==P&&(V.current=a.current,E.current=P);var L=V.current;return y.createElement(SZ,{points:s,showLabels:T},r.children,y.createElement(kl,{animationId:P,begin:f,duration:h,isActive:d,easing:p,onAnimationEnd:A,onAnimationStart:M,key:P},K=>{var te=it(L,z+L,K),R=Math.min(te,z),U;if(d)if(u){var F="".concat(u).split(/[,\s]+/gim).map(Y=>parseFloat(Y));U=wZ(R,z,F)}else U=BI(z,R);else U=u==null?void 0:String(u);if(K>0&&z>0&&(i.current=s,a.current=Math.max(a.current,R)),N){var X=N.length/s.length,$=K===1?s:s.map((Y,W)=>{var I=Math.floor(W*X);if(N[I]){var H=N[I];return wi(wi({},Y),{},{x:it(H.x,Y.x,K),y:it(H.y,Y.y,K)})}return v?wi(wi({},Y),{},{x:it(g*2,Y.x,K),y:it(j/2,Y.y,K)}):wi(wi({},Y),{},{x:Y.x,y:Y.y})});return i.current=$,y.createElement(GE,{props:r,points:$,clipPathId:t,pathRef:n,strokeDasharray:U})}return y.createElement(GE,{props:r,points:s,clipPathId:t,pathRef:n,strokeDasharray:U})}),y.createElement(rp,{label:r.label}))}function kZ(e){var{clipPathId:t,props:r}=e,n=y.useRef(null),i=y.useRef(0),a=y.useRef(null);return y.createElement(PZ,{props:r,clipPathId:t,previousPointsRef:n,longestAnimatedLengthRef:i,pathRef:a})}var _Z=(e,t)=>{var r,n;return{x:(r=e.x)!==null&&r!==void 0?r:void 0,y:(n=e.y)!==null&&n!==void 0?n:void 0,value:e.value,errorVal:at(e.payload,t)}};class EZ extends y.Component{render(){var{hide:t,dot:r,points:n,className:i,xAxisId:a,yAxisId:s,top:u,left:d,width:f,height:h,id:p,needClip:v,zIndex:g}=this.props;if(t)return null;var j=He("recharts-line",i),b=p,{r:w,strokeWidth:N}=FI(r),P=kw(r),E=w*2+N,k=v?"url(#clipPath-".concat(P?"":"dots-").concat(b,")"):void 0;return y.createElement(Er,{zIndex:g},y.createElement(Tt,{className:j},v&&y.createElement("defs",null,y.createElement(Dw,{clipPathId:b,xAxisId:a,yAxisId:s}),!P&&y.createElement("clipPath",{id:"clipPath-dots-".concat(b)},y.createElement("rect",{x:d-E/2,y:u-E/2,width:f+E,height:h+E}))),y.createElement(RI,{xAxisId:a,yAxisId:s,data:n,dataPointFormatter:_Z,errorBarOffset:0},y.createElement(kZ,{props:this.props,clipPathId:b}))),y.createElement(u0,{activeDot:this.props.activeDot,points:n,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:k}))}}var WI={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:$t.line,type:"linear"};function CZ(e){var t=Mt(e,WI),{activeDot:r,animateNewValues:n,animationBegin:i,animationDuration:a,animationEasing:s,connectNulls:u,dot:d,hide:f,isAnimationActive:h,label:p,legendType:v,xAxisId:g,yAxisId:j,id:b}=t,w=Lw(t,hZ),{needClip:N}=up(g,j),P=lp(),E=jo(),k=er(),C=xe(V=>HQ(V,g,j,k,b));if(E!=="horizontal"&&E!=="vertical"||C==null||P==null)return null;var{height:T,width:A,x:M,y:z}=P;return y.createElement(EZ,cu({},w,{id:b,connectNulls:u,dot:d,activeDot:r,animateNewValues:n,animationBegin:i,animationDuration:a,animationEasing:s,isAnimationActive:h,hide:f,label:p,legendType:v,xAxisId:g,yAxisId:j,points:C,layout:E,height:T,width:A,left:M,top:z,needClip:N}))}function OZ(e){var{layout:t,xAxis:r,yAxis:n,xAxisTicks:i,yAxisTicks:a,dataKey:s,bandSize:u,displayedData:d}=e;return d.map((f,h)=>{var p=at(f,s);if(t==="horizontal"){var v=xh({axis:r,ticks:i,bandSize:u,entry:f,index:h}),g=wt(p)?null:n.scale(p);return{x:v,y:g,value:p,payload:f}}var j=wt(p)?null:r.scale(p),b=xh({axis:n,ticks:a,bandSize:u,entry:f,index:h});return j==null||b==null?null:{x:j,y:b,value:p,payload:f}}).filter(Boolean)}function AZ(e){var t=Mt(e,WI),r=er();return y.createElement(op,{id:t.id,type:"line"},n=>y.createElement(y.Fragment,null,y.createElement(Aw,{legendPayload:yZ(t)}),y.createElement(xZ,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:n}),y.createElement(Tw,{type:"line",id:n,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:r}),y.createElement(CZ,cu({},t,{id:n}))))}var $w=y.memo(AZ,qu);$w.displayName="Line";function $i(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||n===void 0?void 0:n.xAxisId)!==null&&r!==void 0?r:NI}function zi(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||n===void 0?void 0:n.yAxisId)!==null&&r!==void 0?r:NI}var UI=(e,t,r)=>Oi(e,"xAxis",$i(e,t),r),KI=(e,t,r)=>Ci(e,"xAxis",$i(e,t),r),qI=(e,t,r)=>Oi(e,"yAxis",zi(e,t),r),HI=(e,t,r)=>Ci(e,"yAxis",zi(e,t),r),TZ=Q([qe,UI,qI,KI,HI],(e,t,r,n,i)=>Ri(e,"xAxis")?go(t,n,!1):go(r,i,!1)),MZ=(e,t)=>t,VI=Q([$u,MZ],(e,t)=>e.filter(r=>r.type==="area").find(r=>r.id===t)),YI=e=>{var t=qe(e),r=Ri(t,"xAxis");return r?"yAxis":"xAxis"},IZ=(e,t)=>{var r=YI(e);return r==="yAxis"?zi(e,t):$i(e,t)},RZ=(e,t,r)=>Bh(e,YI(e),IZ(e,t),r),DZ=Q([VI,RZ],(e,t)=>{var r;if(!(e==null||t==null)){var{stackId:n}=e,i=Hm(e);if(!(n==null||i==null)){var a=(r=t[n])===null||r===void 0?void 0:r.stackedData,s=a==null?void 0:a.find(u=>u.key===i);if(s!=null)return s.map(u=>[u[0],u[1]])}}}),LZ=Q([qe,UI,qI,KI,HI,DZ,TT,TZ,VI,rq],(e,t,r,n,i,a,s,u,d,f)=>{var{chartData:h,dataStartIndex:p,dataEndIndex:v}=s;if(!(d==null||e!=="horizontal"&&e!=="vertical"||t==null||r==null||n==null||i==null||n.length===0||i.length===0||u==null)){var{data:g}=d,j;if(g&&g.length>0?j=g:j=h==null?void 0:h.slice(p,v+1),j!=null)return rJ({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:i,dataStartIndex:p,areaSettings:d,stackedData:a,displayedData:j,chartBaseValue:f,bandSize:u})}}),$Z=["id"],zZ=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function rs(){return rs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rs.apply(null,arguments)}function GI(e,t){if(e==null)return{};var r,n,i=FZ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function FZ(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function XE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function tl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?XE(Object(r),!0).forEach(function(n){BZ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):XE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function BZ(e,t,r){return(t=WZ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WZ(e){var t=UZ(e,"string");return typeof t=="symbol"?t:t+""}function UZ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xh(e,t){return e&&e!=="none"?e:t}var KZ=e=>{var{dataKey:t,name:r,stroke:n,fill:i,legendType:a,hide:s}=e;return[{inactive:s,dataKey:t,type:a,color:Xh(n,i),value:wo(r,t),payload:e}]},qZ=y.memo(e=>{var{dataKey:t,data:r,stroke:n,strokeWidth:i,fill:a,name:s,hide:u,unit:d,tooltipType:f,id:h}=e,p={dataDefinedOnItem:r,positions:void 0,settings:{stroke:n,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:wo(s,t),hide:u,type:f,color:Xh(n,a),unit:d,graphicalItemId:h}};return y.createElement(ap,{tooltipEntrySettings:p})});function HZ(e){var{clipPathId:t,points:r,props:n}=e,{needClip:i,dot:a,dataKey:s}=n,u=Rr(n);return y.createElement(SI,{points:r,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:s,baseProps:u,needClip:i,clipPathId:t})}function VZ(e){var{showLabels:t,children:r,points:n}=e,i=n.map(a=>{var s,u,d={x:(s=a.x)!==null&&s!==void 0?s:0,y:(u=a.y)!==null&&u!==void 0?u:0,width:0,lowerWidth:0,upperWidth:0,height:0};return tl(tl({},d),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return y.createElement(jw,{value:t?i:void 0},r)}function QE(e){var{points:t,baseLine:r,needClip:n,clipPathId:i,props:a}=e,{layout:s,type:u,stroke:d,connectNulls:f,isRange:h}=a,{id:p}=a,v=GI(a,$Z),g=Rr(v),j=br(v);return y.createElement(y.Fragment,null,(t==null?void 0:t.length)>1&&y.createElement(Tt,{clipPath:n?"url(#clipPath-".concat(i,")"):void 0},y.createElement(il,rs({},j,{id:p,points:t,connectNulls:f,type:u,baseLine:r,layout:s,stroke:"none",className:"recharts-area-area"})),d!=="none"&&y.createElement(il,rs({},g,{className:"recharts-area-curve",layout:s,type:u,connectNulls:f,fill:"none",points:t})),d!=="none"&&h&&y.createElement(il,rs({},g,{className:"recharts-area-curve",layout:s,type:u,connectNulls:f,fill:"none",points:r}))),y.createElement(HZ,{points:t,props:v,clipPathId:i}))}function YZ(e){var t,r,{alpha:n,baseLine:i,points:a,strokeWidth:s}=e,u=(t=a[0])===null||t===void 0?void 0:t.y,d=(r=a[a.length-1])===null||r===void 0?void 0:r.y;if(!nt(u)||!nt(d))return null;var f=n*Math.abs(u-d),h=Math.max(...a.map(p=>p.x||0));return ve(i)?h=Math.max(i,h):i&&Array.isArray(i)&&i.length&&(h=Math.max(...i.map(p=>p.x||0),h)),ve(h)?y.createElement("rect",{x:0,y:u<d?u:u-f,width:h+(s?parseInt("".concat(s),10):1),height:Math.floor(f)}):null}function GZ(e){var t,r,{alpha:n,baseLine:i,points:a,strokeWidth:s}=e,u=(t=a[0])===null||t===void 0?void 0:t.x,d=(r=a[a.length-1])===null||r===void 0?void 0:r.x;if(!nt(u)||!nt(d))return null;var f=n*Math.abs(u-d),h=Math.max(...a.map(p=>p.y||0));return ve(i)?h=Math.max(i,h):i&&Array.isArray(i)&&i.length&&(h=Math.max(...i.map(p=>p.y||0),h)),ve(h)?y.createElement("rect",{x:u<d?u:u-f,y:0,width:f,height:Math.floor(h+(s?parseInt("".concat(s),10):1))}):null}function XZ(e){var{alpha:t,layout:r,points:n,baseLine:i,strokeWidth:a}=e;return r==="vertical"?y.createElement(YZ,{alpha:t,points:n,baseLine:i,strokeWidth:a}):y.createElement(GZ,{alpha:t,points:n,baseLine:i,strokeWidth:a})}function QZ(e){var{needClip:t,clipPathId:r,props:n,previousPointsRef:i,previousBaselineRef:a}=e,{points:s,baseLine:u,isAnimationActive:d,animationBegin:f,animationDuration:h,animationEasing:p,onAnimationStart:v,onAnimationEnd:g}=n,j=y.useMemo(()=>({points:s,baseLine:u}),[s,u]),b=_l(j,"recharts-area-"),w=f8(),[N,P]=y.useState(!1),E=!N,k=y.useCallback(()=>{typeof g=="function"&&g(),P(!1)},[g]),C=y.useCallback(()=>{typeof v=="function"&&v(),P(!0)},[v]);if(w==null)return null;var T=i.current,A=a.current;return y.createElement(VZ,{showLabels:E,points:s},n.children,y.createElement(kl,{animationId:b,begin:f,duration:h,isActive:d,easing:p,onAnimationEnd:k,onAnimationStart:C,key:b},M=>{if(T){var z=T.length/s.length,V=M===1?s:s.map((K,te)=>{var R=Math.floor(te*z);if(T[R]){var U=T[R];return tl(tl({},K),{},{x:it(U.x,K.x,M),y:it(U.y,K.y,M)})}return K}),L;return ve(u)?L=it(A,u,M):wt(u)||Xr(u)?L=it(A,0,M):L=u.map((K,te)=>{var R=Math.floor(te*z);if(Array.isArray(A)&&A[R]){var U=A[R];return tl(tl({},K),{},{x:it(U.x,K.x,M),y:it(U.y,K.y,M)})}return K}),M>0&&(i.current=V,a.current=L),y.createElement(QE,{points:V,baseLine:L,needClip:t,clipPathId:r,props:n})}return M>0&&(i.current=s,a.current=u),y.createElement(Tt,null,d&&y.createElement("defs",null,y.createElement("clipPath",{id:"animationClipPath-".concat(r)},y.createElement(XZ,{alpha:M,points:s,baseLine:u,layout:w,strokeWidth:n.strokeWidth}))),y.createElement(Tt,{clipPath:"url(#animationClipPath-".concat(r,")")},y.createElement(QE,{points:s,baseLine:u,needClip:t,clipPathId:r,props:n})))}),y.createElement(rp,{label:n.label}))}function ZZ(e){var{needClip:t,clipPathId:r,props:n}=e,i=y.useRef(null),a=y.useRef();return y.createElement(QZ,{needClip:t,clipPathId:r,props:n,previousPointsRef:i,previousBaselineRef:a})}class JZ extends y.PureComponent{render(){var{hide:t,dot:r,points:n,className:i,top:a,left:s,needClip:u,xAxisId:d,yAxisId:f,width:h,height:p,id:v,baseLine:g,zIndex:j}=this.props;if(t)return null;var b=He("recharts-area",i),w=v,{r:N,strokeWidth:P}=FI(r),E=kw(r),k=N*2+P,C=u?"url(#clipPath-".concat(E?"":"dots-").concat(w,")"):void 0;return y.createElement(Er,{zIndex:j},y.createElement(Tt,{className:b},u&&y.createElement("defs",null,y.createElement(Dw,{clipPathId:w,xAxisId:d,yAxisId:f}),!E&&y.createElement("clipPath",{id:"clipPath-dots-".concat(w)},y.createElement("rect",{x:s-k/2,y:a-k/2,width:h+k,height:p+k}))),y.createElement(ZZ,{needClip:u,clipPathId:w,props:this.props})),y.createElement(u0,{points:n,mainColor:Xh(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:C}),this.props.isRange&&Array.isArray(g)&&y.createElement(u0,{points:g,mainColor:Xh(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:C}))}}var XI={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:$t.area};function eJ(e){var t,r=Mt(e,XI),{activeDot:n,animationBegin:i,animationDuration:a,animationEasing:s,connectNulls:u,dot:d,fill:f,fillOpacity:h,hide:p,isAnimationActive:v,legendType:g,stroke:j,xAxisId:b,yAxisId:w}=r,N=GI(r,zZ),P=jo(),E=YM(),{needClip:k}=up(b,w),C=er(),{points:T,isRange:A,baseLine:M}=(t=xe(R=>LZ(R,e.id,C)))!==null&&t!==void 0?t:{},z=lp();if(P!=="horizontal"&&P!=="vertical"||z==null||E!=="AreaChart"&&E!=="ComposedChart")return null;var{height:V,width:L,x:K,y:te}=z;return!T||!T.length?null:y.createElement(JZ,rs({},N,{activeDot:n,animationBegin:i,animationDuration:a,animationEasing:s,baseLine:M,connectNulls:u,dot:d,fill:f,fillOpacity:h,height:V,hide:p,layout:P,isAnimationActive:v==="auto"?!Ou.isSsr:v,isRange:A,legendType:g,needClip:k,points:T,stroke:j,width:L,left:K,top:te,xAxisId:b,yAxisId:w}))}var tJ=(e,t,r,n,i)=>{var a=r??t;if(ve(a))return a;var s=e==="horizontal"?i:n,u=s.scale.domain();if(s.type==="number"){var d=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return a==="dataMin"?f:a==="dataMax"||d<0?d:Math.max(Math.min(u[0],u[1]),0)}return a==="dataMin"?u[0]:a==="dataMax"?u[1]:u[0]};function rJ(e){var{areaSettings:{connectNulls:t,baseValue:r,dataKey:n},stackedData:i,layout:a,chartBaseValue:s,xAxis:u,yAxis:d,displayedData:f,dataStartIndex:h,xAxisTicks:p,yAxisTicks:v,bandSize:g}=e,j=i&&i.length,b=tJ(a,s,r,u,d),w=a==="horizontal",N=!1,P=f.map((k,C)=>{var T,A,M;if(j)M=i[h+C];else{var z=at(k,n);Array.isArray(z)?(M=z,N=!0):M=[b,z]}var V=(T=(A=M)===null||A===void 0?void 0:A[1])!==null&&T!==void 0?T:null,L=V==null||j&&!t&&at(k,n)==null;return w?{x:xh({axis:u,ticks:p,bandSize:g,entry:k,index:C}),y:L?null:d.scale(V),value:M,payload:k}:{x:L?null:u.scale(V),y:xh({axis:d,ticks:v,bandSize:g,entry:k,index:C}),value:M,payload:k}}),E;return j||N?E=P.map(k=>{var C=Array.isArray(k.value)?k.value[0]:null;return w?{x:k.x,y:C!=null&&k.y!=null?d.scale(C):null,payload:k.payload}:{x:C!=null?u.scale(C):null,y:k.y,payload:k.payload}}):E=w?d.scale(b):u.scale(b),{points:P,baseLine:E,isRange:N}}function nJ(e){var t=Mt(e,XI),r=er();return y.createElement(op,{id:t.id,type:"area"},n=>y.createElement(y.Fragment,null,y.createElement(Aw,{legendPayload:KZ(t)}),y.createElement(qZ,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:n}),y.createElement(Tw,{type:"area",id:n,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:x2(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:r,connectNulls:t.connectNulls}),y.createElement(eJ,rs({},t,{id:n}))))}var Dn=y.memo(nJ,qu);Dn.displayName="Area";var iJ="Invariant failed";function aJ(e,t){throw new Error(iJ)}function d0(){return d0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},d0.apply(null,arguments)}function Qh(e){return y.createElement(_w,d0({shapeType:"rectangle",activeClassName:"recharts-active-bar"},e))}var oJ=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(n,i)=>{if(ve(t))return t;var a=ve(n)||wt(n);return a?t(n,i):(a||aJ(),r)}},sJ=(e,t,r)=>r,lJ=(e,t)=>t,Hu=Q([$u,lJ],(e,t)=>e.filter(r=>r.type==="bar").find(r=>r.id===t)),cJ=Q([Hu],e=>e==null?void 0:e.maxBarSize),uJ=(e,t,r,n)=>n,dJ=Q([qe,$u,$i,zi,sJ],(e,t,r,n,i)=>t.filter(a=>e==="horizontal"?a.xAxisId===r:a.yAxisId===n).filter(a=>a.isPanorama===i).filter(a=>a.hide===!1).filter(a=>a.type==="bar")),fJ=(e,t,r)=>{var n=qe(e),i=$i(e,t),a=zi(e,t);if(!(i==null||a==null))return n==="horizontal"?Bh(e,"yAxis",a,r):Bh(e,"xAxis",i,r)},hJ=(e,t)=>{var r=qe(e),n=$i(e,t),i=zi(e,t);if(!(n==null||i==null))return r==="horizontal"?O_(e,"xAxis",n):O_(e,"yAxis",i)},mJ=Q([dJ,tq,hJ],vX),pJ=(e,t,r)=>{var n,i,a=Hu(e,t);if(a!=null){var s=$i(e,t),u=zi(e,t);if(!(s==null||u==null)){var d=qe(e),f=VT(e),{maxBarSize:h}=a,p=wt(h)?f:h,v,g;return d==="horizontal"?(v=Oi(e,"xAxis",s,r),g=Ci(e,"xAxis",s,r)):(v=Oi(e,"yAxis",u,r),g=Ci(e,"yAxis",u,r)),(n=(i=go(v,g,!0))!==null&&i!==void 0?i:p)!==null&&n!==void 0?n:0}}},QI=(e,t,r)=>{var n=qe(e),i=$i(e,t),a=zi(e,t);if(!(i==null||a==null)){var s,u;return n==="horizontal"?(s=Oi(e,"xAxis",i,r),u=Ci(e,"xAxis",i,r)):(s=Oi(e,"yAxis",a,r),u=Ci(e,"yAxis",a,r)),go(s,u)}},vJ=Q([mJ,VT,eq,YT,pJ,QI,cJ],wX),gJ=(e,t,r)=>{var n=$i(e,t);if(n!=null)return Oi(e,"xAxis",n,r)},yJ=(e,t,r)=>{var n=zi(e,t);if(n!=null)return Oi(e,"yAxis",n,r)},xJ=(e,t,r)=>{var n=$i(e,t);if(n!=null)return Ci(e,"xAxis",n,r)},bJ=(e,t,r)=>{var n=zi(e,t);if(n!=null)return Ci(e,"yAxis",n,r)},wJ=Q([vJ,Hu],(e,t)=>{if(!(e==null||t==null)){var r=e.find(n=>n.stackId===t.stackId&&t.dataKey!=null&&n.dataKeys.includes(t.dataKey));if(r!=null)return r.position}}),jJ=Q([fJ,Hu],jX),SJ=Q([Jt,ob,gJ,yJ,xJ,bJ,wJ,qe,TT,QI,jJ,Hu,uJ],(e,t,r,n,i,a,s,u,d,f,h,p,v)=>{var{chartData:g,dataStartIndex:j,dataEndIndex:b}=d;if(!(p==null||s==null||t==null||u!=="horizontal"&&u!=="vertical"||r==null||n==null||i==null||a==null||f==null)){var{data:w}=p,N;if(w!=null&&w.length>0?N=w:N=g==null?void 0:g.slice(j,b+1),N!=null)return ZJ({layout:u,barSettings:p,pos:s,parentViewBox:t,bandSize:f,xAxis:r,yAxis:n,xAxisTicks:i,yAxisTicks:a,stackedData:h,displayedData:N,offset:e,cells:v,dataStartIndex:j})}}),NJ=["index"];function f0(){return f0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},f0.apply(null,arguments)}function PJ(e,t){if(e==null)return{};var r,n,i=kJ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function kJ(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var ZI=y.createContext(void 0),_J=e=>{var t=y.useContext(ZI);if(t!=null)return t.stackId;if(e!=null)return x2(e)},EJ=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),CJ=e=>{var t=y.useContext(ZI);if(t!=null){var{stackId:r}=t;return"url(#".concat(EJ(r,e),")")}},OJ=e=>{var{index:t}=e,r=PJ(e,NJ),n=CJ(t);return y.createElement(Tt,f0({className:"recharts-bar-stack-layer",clipPath:n},r))},AJ=["onMouseEnter","onMouseLeave","onClick"],TJ=["value","background","tooltipPosition"],MJ=["id"],IJ=["onMouseEnter","onClick","onMouseLeave"];function Na(){return Na=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Na.apply(null,arguments)}function ZE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Tr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ZE(Object(r),!0).forEach(function(n){RJ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function RJ(e,t,r){return(t=DJ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DJ(e){var t=LJ(e,"string");return typeof t=="symbol"?t:t+""}function LJ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zh(e,t){if(e==null)return{};var r,n,i=$J(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function $J(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var zJ=e=>{var{dataKey:t,name:r,fill:n,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:n,value:wo(r,t),payload:e}]},FJ=y.memo(e=>{var{dataKey:t,stroke:r,strokeWidth:n,fill:i,name:a,hide:s,unit:u,tooltipType:d,id:f}=e,h={dataDefinedOnItem:void 0,positions:void 0,settings:{stroke:r,strokeWidth:n,fill:i,dataKey:t,nameKey:void 0,name:wo(a,t),hide:s,type:d,color:i,unit:u,graphicalItemId:f}};return y.createElement(ap,{tooltipEntrySettings:h})});function BJ(e){var t=xe(xo),{data:r,dataKey:n,background:i,allOtherBarProps:a}=e,{onMouseEnter:s,onMouseLeave:u,onClick:d}=a,f=Zh(a,AJ),h=Ew(s,n,a.id),p=Cw(u),v=Ow(d,n,a.id);if(!i||r==null)return null;var g=ss(i);return y.createElement(Er,{zIndex:SX(i,$t.barBackground)},r.map((j,b)=>{var{value:w,background:N,tooltipPosition:P}=j,E=Zh(j,TJ);if(!N)return null;var k=h(j,b),C=p(j,b),T=v(j,b),A=Tr(Tr(Tr(Tr(Tr({option:i,isActive:String(b)===t},E),{},{fill:"#eee"},N),g),Nu(f,j,b)),{},{onMouseEnter:k,onMouseLeave:C,onClick:T,dataKey:n,index:b,className:"recharts-bar-background-rectangle"});return y.createElement(Qh,Na({key:"background-bar-".concat(b)},A))}))}function WJ(e){var{showLabels:t,children:r,rects:n}=e,i=n==null?void 0:n.map(a=>{var s={x:a.x,y:a.y,width:a.width,lowerWidth:a.width,upperWidth:a.width,height:a.height};return Tr(Tr({},s),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:s,fill:a.fill})});return y.createElement(jw,{value:t?i:void 0},r)}function UJ(e){var{shape:t,activeBar:r,baseProps:n,entry:i,index:a,dataKey:s}=e,u=xe(xo),d=xe(vw),f=r&&String(a)===u&&(d==null||s===d),h=f?r:t;return f?y.createElement(Er,{zIndex:$t.activeBar},y.createElement(Qh,Na({},n,{name:String(n.name)},i,{isActive:f,option:h,index:a,dataKey:s}))):y.createElement(Qh,Na({},n,{name:String(n.name)},i,{isActive:f,option:h,index:a,dataKey:s}))}function KJ(e){var{shape:t,baseProps:r,entry:n,index:i,dataKey:a}=e;return y.createElement(Qh,Na({},r,{name:String(r.name)},n,{isActive:!1,option:t,index:i,dataKey:a}))}function qJ(e){var t,{data:r,props:n}=e,i=(t=Rr(n))!==null&&t!==void 0?t:{},{id:a}=i,s=Zh(i,MJ),{shape:u,dataKey:d,activeBar:f}=n,{onMouseEnter:h,onClick:p,onMouseLeave:v}=n,g=Zh(n,IJ),j=Ew(h,d,a),b=Cw(v),w=Ow(p,d,a);return r?y.createElement(y.Fragment,null,r.map((N,P)=>y.createElement(OJ,Na({index:P,key:"rectangle-".concat(N==null?void 0:N.x,"-").concat(N==null?void 0:N.y,"-").concat(N==null?void 0:N.value,"-").concat(P),className:"recharts-bar-rectangle"},Nu(g,N,P),{onMouseEnter:j(N,P),onMouseLeave:b(N,P),onClick:w(N,P)}),f?y.createElement(UJ,{shape:u,activeBar:f,baseProps:s,entry:N,index:P,dataKey:d}):y.createElement(KJ,{shape:u,baseProps:s,entry:N,index:P,dataKey:d})))):null}function HJ(e){var{props:t,previousRectanglesRef:r}=e,{data:n,layout:i,isAnimationActive:a,animationBegin:s,animationDuration:u,animationEasing:d,onAnimationEnd:f,onAnimationStart:h}=t,p=r.current,v=_l(t,"recharts-bar-"),[g,j]=y.useState(!1),b=!g,w=y.useCallback(()=>{typeof f=="function"&&f(),j(!1)},[f]),N=y.useCallback(()=>{typeof h=="function"&&h(),j(!0)},[h]);return y.createElement(WJ,{showLabels:b,rects:n},y.createElement(kl,{animationId:v,begin:s,duration:u,isActive:a,easing:d,onAnimationEnd:w,onAnimationStart:N,key:v},P=>{var E=P===1?n:n==null?void 0:n.map((k,C)=>{var T=p&&p[C];if(T)return Tr(Tr({},k),{},{x:it(T.x,k.x,P),y:it(T.y,k.y,P),width:it(T.width,k.width,P),height:it(T.height,k.height,P)});if(i==="horizontal"){var A=it(0,k.height,P),M=it(k.stackedBarStart,k.y,P);return Tr(Tr({},k),{},{y:M,height:A})}var z=it(0,k.width,P),V=it(k.stackedBarStart,k.x,P);return Tr(Tr({},k),{},{width:z,x:V})});return P>0&&(r.current=E??null),E==null?null:y.createElement(Tt,null,y.createElement(qJ,{props:t,data:E}))}),y.createElement(rp,{label:t.label}),t.children)}function VJ(e){var t=y.useRef(null);return y.createElement(HJ,{previousRectanglesRef:t,props:e})}var JI=0,YJ=(e,t)=>{var r=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:r,errorVal:at(e,t)}};class GJ extends y.PureComponent{render(){var{hide:t,data:r,dataKey:n,className:i,xAxisId:a,yAxisId:s,needClip:u,background:d,id:f}=this.props;if(t||r==null)return null;var h=He("recharts-bar",i),p=f;return y.createElement(Tt,{className:h,id:f},u&&y.createElement("defs",null,y.createElement(Dw,{clipPathId:p,xAxisId:a,yAxisId:s})),y.createElement(Tt,{className:"recharts-bar-rectangles",clipPath:u?"url(#clipPath-".concat(p,")"):void 0},y.createElement(BJ,{data:r,dataKey:n,background:d,allOtherBarProps:this.props}),y.createElement(VJ,this.props)))}}var XJ={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:JI,xAxisId:0,yAxisId:0,zIndex:$t.bar};function QJ(e){var{xAxisId:t,yAxisId:r,hide:n,legendType:i,minPointSize:a,activeBar:s,animationBegin:u,animationDuration:d,animationEasing:f,isAnimationActive:h}=e,{needClip:p}=up(t,r),v=jo(),g=er(),j=Pw(e.children,Ll),b=xe(P=>SJ(P,e.id,g,j));if(v!=="vertical"&&v!=="horizontal")return null;var w,N=b==null?void 0:b[0];return N==null||N.height==null||N.width==null?w=0:w=v==="vertical"?N.height/2:N.width/2,y.createElement(RI,{xAxisId:t,yAxisId:r,data:b,dataPointFormatter:YJ,errorBarOffset:w},y.createElement(GJ,Na({},e,{layout:v,needClip:p,data:b,xAxisId:t,yAxisId:r,hide:n,legendType:i,minPointSize:a,activeBar:s,animationBegin:u,animationDuration:d,animationEasing:f,isAnimationActive:h})))}function ZJ(e){var{layout:t,barSettings:{dataKey:r,minPointSize:n},pos:i,bandSize:a,xAxis:s,yAxis:u,xAxisTicks:d,yAxisTicks:f,stackedData:h,displayedData:p,offset:v,cells:g,parentViewBox:j,dataStartIndex:b}=e,w=t==="horizontal"?u:s,N=h?w.scale.domain():null,P=O6({numericAxis:w}),E=w.scale(P);return p.map((k,C)=>{var T,A,M,z,V,L;if(h){var K=h[C+b];if(K==null)return null;T=P6(K,N)}else T=at(k,r),Array.isArray(T)||(T=[P,T]);var te=oJ(n,JI)(T[1],C);if(t==="horizontal"){var R,[U,F]=[u.scale(T[0]),u.scale(T[1])];A=MP({axis:s,ticks:d,bandSize:a,offset:i.offset,entry:k,index:C}),M=(R=F??U)!==null&&R!==void 0?R:void 0,z=i.size;var X=U-F;if(V=Xr(X)?0:X,L={x:A,y:v.top,width:z,height:v.height},Math.abs(te)>0&&Math.abs(V)<Math.abs(te)){var $=fr(V||te)*(Math.abs(te)-Math.abs(V));M-=$,V+=$}}else{var[Y,W]=[s.scale(T[0]),s.scale(T[1])];if(A=Y,M=MP({axis:u,ticks:f,bandSize:a,offset:i.offset,entry:k,index:C}),z=W-Y,V=i.size,L={x:v.left,y:M,width:v.width,height:V},Math.abs(te)>0&&Math.abs(z)<Math.abs(te)){var I=fr(z||te)*(Math.abs(te)-Math.abs(z));z+=I}}if(A==null||M==null||z==null||V==null)return null;var H=Tr(Tr({},k),{},{stackedBarStart:E,x:A,y:M,width:z,height:V,value:h?T:T[1],payload:k,background:L,tooltipPosition:{x:A+z/2,y:M+V/2},parentViewBox:j},g&&g[C]&&g[C].props);return H}).filter(Boolean)}function JJ(e){var t=Mt(e,XJ),r=_J(t.stackId),n=er();return y.createElement(op,{id:t.id,type:"bar"},i=>y.createElement(y.Fragment,null,y.createElement(Aw,{legendPayload:zJ(t)}),y.createElement(FJ,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:i}),y.createElement(Tw,{type:"bar",id:i,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:r,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:n}),y.createElement(Er,{zIndex:t.zIndex},y.createElement(QJ,Na({},t,{id:i})))))}var Qo=y.memo(JJ,qu);Qo.displayName="Bar";var eee=["domain","range"],tee=["domain","range"];function JE(e,t){if(e==null)return{};var r,n,i=ree(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function ree(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function eC(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function eR(e,t){if(e===t)return!0;var{domain:r,range:n}=e,i=JE(e,eee),{domain:a,range:s}=t,u=JE(t,tee);return!eC(r,a)||!eC(n,s)?!1:qu(i,u)}var nee=["dangerouslySetInnerHTML","ticks","scale"],iee=["id","scale"];function h0(){return h0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},h0.apply(null,arguments)}function tC(e,t){if(e==null)return{};var r,n,i=aee(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function aee(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function oee(e){var t=ht(),r=y.useRef(null);return y.useLayoutEffect(()=>{r.current===null?t(tX(e)):r.current!==e&&t(rX({prev:r.current,next:e})),r.current=e},[e,t]),y.useLayoutEffect(()=>()=>{r.current&&(t(nX(r.current)),r.current=null)},[t]),null}var see=e=>{var{xAxisId:t,className:r}=e,n=xe(ob),i=er(),a="xAxis",s=xe(N=>kM(N,a,t,i)),u=xe(N=>jM(N,t)),d=xe(N=>Jq(N,t)),f=xe(N=>nM(N,t));if(u==null||d==null||f==null)return null;var{dangerouslySetInnerHTML:h,ticks:p,scale:v}=e,g=tC(e,nee),{id:j,scale:b}=f,w=tC(f,iee);return y.createElement(Rw,h0({},g,w,{x:d.x,y:d.y,width:u.width,height:u.height,className:He("recharts-".concat(a," ").concat(a),r),viewBox:n,ticks:s,axisType:a}))},lee={allowDataOverflow:cr.allowDataOverflow,allowDecimals:cr.allowDecimals,allowDuplicatedCategory:cr.allowDuplicatedCategory,angle:cr.angle,axisLine:pa.axisLine,height:cr.height,hide:!1,includeHidden:cr.includeHidden,interval:cr.interval,minTickGap:cr.minTickGap,mirror:cr.mirror,orientation:cr.orientation,padding:cr.padding,reversed:cr.reversed,scale:cr.scale,tick:cr.tick,tickCount:cr.tickCount,tickLine:pa.tickLine,tickSize:pa.tickSize,type:cr.type,xAxisId:0},cee=e=>{var t=Mt(e,lee);return y.createElement(y.Fragment,null,y.createElement(oee,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit}),y.createElement(see,t))},In=y.memo(cee,eR);In.displayName="XAxis";var uee=["dangerouslySetInnerHTML","ticks","scale"],dee=["id","scale"];function m0(){return m0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},m0.apply(null,arguments)}function rC(e,t){if(e==null)return{};var r,n,i=fee(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function fee(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function hee(e){var t=ht(),r=y.useRef(null);return y.useLayoutEffect(()=>{r.current===null?t(iX(e)):r.current!==e&&t(aX({prev:r.current,next:e})),r.current=e},[e,t]),y.useLayoutEffect(()=>()=>{r.current&&(t(oX(r.current)),r.current=null)},[t]),null}var mee=e=>{var{yAxisId:t,className:r,width:n,label:i}=e,a=y.useRef(null),s=y.useRef(null),u=xe(ob),d=er(),f=ht(),h="yAxis",p=xe(T=>SM(T,t)),v=xe(T=>tH(T,t)),g=xe(T=>kM(T,h,t,d)),j=xe(T=>iM(T,t));if(y.useLayoutEffect(()=>{if(!(n!=="auto"||!p||ww(i)||y.isValidElement(i)||j==null)){var T=a.current;if(T){var A=T.getCalculatedWidth();Math.round(p.width)!==Math.round(A)&&f(sX({id:t,width:A}))}}},[g,p,f,i,t,n,j]),p==null||v==null||j==null)return null;var{dangerouslySetInnerHTML:b,ticks:w,scale:N}=e,P=rC(e,uee),{id:E,scale:k}=j,C=rC(j,dee);return y.createElement(Rw,m0({},P,C,{ref:a,labelRef:s,x:v.x,y:v.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:p.width,height:p.height,className:He("recharts-".concat(h," ").concat(h),r),viewBox:u,ticks:g,axisType:h}))},pee={allowDataOverflow:ur.allowDataOverflow,allowDecimals:ur.allowDecimals,allowDuplicatedCategory:ur.allowDuplicatedCategory,angle:ur.angle,axisLine:pa.axisLine,hide:!1,includeHidden:ur.includeHidden,interval:ur.interval,minTickGap:ur.minTickGap,mirror:ur.mirror,orientation:ur.orientation,padding:ur.padding,reversed:ur.reversed,scale:ur.scale,tick:ur.tick,tickCount:ur.tickCount,tickLine:pa.tickLine,tickSize:pa.tickSize,type:ur.type,width:ur.width,yAxisId:0},vee=e=>{var t=Mt(e,pee);return y.createElement(y.Fragment,null,y.createElement(hee,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter}),y.createElement(mee,t))},Rn=y.memo(vee,eR);Rn.displayName="YAxis";var gee=(e,t)=>t,zw=Q([gee,qe,tM,rr,WM,Ma,vV,Jt],SV),Fw=e=>{var t=e.currentTarget.getBoundingClientRect(),r=t.width/e.currentTarget.offsetWidth,n=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/r),chartY:Math.round((e.clientY-t.top)/n)}},tR=zn("mouseClick"),rR=ku();rR.startListening({actionCreator:tR,effect:(e,t)=>{var r=e.payload,n=zw(t.getState(),Fw(r));(n==null?void 0:n.activeIndex)!=null&&t.dispatch(pH({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var p0=zn("mouseMove"),nR=ku(),Cf=null;nR.startListening({actionCreator:p0,effect:(e,t)=>{var r=e.payload;Cf!==null&&cancelAnimationFrame(Cf);var n=Fw(r);Cf=requestAnimationFrame(()=>{var i=t.getState(),a=uw(i,i.tooltip.settings.shared);if(a==="axis"){var s=zw(i,n);(s==null?void 0:s.activeIndex)!=null?t.dispatch(IM({activeIndex:s.activeIndex,activeDataKey:void 0,activeCoordinate:s.activeCoordinate})):t.dispatch(MM())}Cf=null})}});function yee(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var nC={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},iR=Zr({name:"rootProps",initialState:nC,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:nC.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),xee=iR.reducer,{updateOptions:bee}=iR.actions,aR=Zr({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:wee}=aR.actions,jee=aR.reducer,oR=zn("keyDown"),sR=zn("focus"),Bw=ku();Bw.startListening({actionCreator:oR,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip,a=e.payload;if(!(a!=="ArrowRight"&&a!=="ArrowLeft"&&a!=="Enter")){var s=dw(i,Dl(r),Fu(r),Uu(r)),u=s==null?-1:Number(s);if(!(!Number.isFinite(u)||u<0)){var d=Ma(r);if(a==="Enter"){var f=Uh(r,"axis","hover",String(i.index));t.dispatch(i0({active:!i.active,activeIndex:i.index,activeCoordinate:f}));return}var h=aH(r),p=h==="left-to-right"?1:-1,v=a==="ArrowRight"?1:-1,g=u+v*p;if(!(d==null||g>=d.length||g<0)){var j=Uh(r,"axis","hover",String(g));t.dispatch(i0({active:!0,activeIndex:g.toString(),activeCoordinate:j}))}}}}}});Bw.startListening({actionCreator:sR,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip;if(!i.active&&i.index==null){var a="0",s=Uh(r,"axis","hover",String(a));t.dispatch(i0({active:!0,activeIndex:a,activeCoordinate:s}))}}}});var An=zn("externalEvent"),lR=ku(),Gy=new Map;lR.startListening({actionCreator:An,effect:(e,t)=>{var{handler:r,reactEvent:n}=e.payload;if(r!=null){n.persist();var i=n.type,a=Gy.get(i);a!==void 0&&cancelAnimationFrame(a);var s=requestAnimationFrame(()=>{try{var u=t.getState(),d={activeCoordinate:tV(u),activeDataKey:vw(u),activeIndex:xo(u),activeLabel:qM(u),activeTooltipIndex:xo(u),isTooltipActive:rV(u)};r(d,n)}finally{Gy.delete(i)}});Gy.set(i,s)}}});var See=Q([Il],e=>e.tooltipItemPayloads),Nee=Q([See,Wu,(e,t)=>t,(e,t,r)=>r],(e,t,r,n)=>{var i=e.find(u=>u.settings.graphicalItemId===n);if(i!=null){var{positions:a}=i;if(a!=null){var s=t(a,r);return s}}}),cR=zn("touchMove"),uR=ku();uR.startListening({actionCreator:cR,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){var n=t.getState(),i=uw(n,n.tooltip.settings.shared);if(i==="axis"){var a=r.touches[0];if(a==null)return;var s=zw(n,Fw({clientX:a.clientX,clientY:a.clientY,currentTarget:r.currentTarget}));(s==null?void 0:s.activeIndex)!=null&&t.dispatch(IM({activeIndex:s.activeIndex,activeDataKey:void 0,activeCoordinate:s.activeCoordinate}))}else if(i==="item"){var u,d=r.touches[0];if(document.elementFromPoint==null||d==null)return;var f=document.elementFromPoint(d.clientX,d.clientY);if(!f||!f.getAttribute)return;var h=f.getAttribute(w2),p=(u=f.getAttribute(j2))!==null&&u!==void 0?u:void 0,v=Rl(n).find(b=>b.id===p);if(h==null||v==null||p==null)return;var{dataKey:g}=v,j=Nee(n,h,p);t.dispatch(TM({activeDataKey:g,activeIndex:h,activeCoordinate:j,activeGraphicalItemId:p}))}}}});var Pee=WA({brush:NX,cartesianAxis:lX,chartData:e7,errorBars:DQ,graphicalItems:pG,layout:x6,legend:_8,options:GV,polarAxis:CY,polarOptions:jee,referenceElements:RX,rootProps:xee,tooltip:vH,zIndex:LV}),kee=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return KB({reducer:Pee,preloadedState:t,middleware:n=>{var i;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([rR.middleware,nR.middleware,Bw.middleware,lR.middleware,uR.middleware])},enhancers:n=>{var i=n;return typeof n=="function"&&(i=n()),i.concat(n2({type:"raf"}))},devTools:{serialize:{replacer:yee},name:"recharts-".concat(r)}})};function dR(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,i=er(),a=y.useRef(null);if(i)return r;a.current==null&&(a.current=kee(t,n));var s=J0;return y.createElement(lZ,{context:s,store:a.current},r)}function _ee(e){var{layout:t,margin:r}=e,n=ht(),i=er();return y.useEffect(()=>{i||(n(v6(t)),n(p6(r)))},[n,i,t,r]),null}var fR=y.memo(_ee,qu);function hR(e){var t=ht();return y.useEffect(()=>{t(bee(e))},[t,e]),null}function iC(e){var{zIndex:t,isPanorama:r}=e,n=y.useRef(null),i=ht();return y.useLayoutEffect(()=>(n.current&&i(RV({zIndex:t,element:n.current,isPanorama:r})),()=>{i(DV({zIndex:t,isPanorama:r}))}),[i,t,r]),y.createElement("g",{tabIndex:-1,ref:n})}function aC(e){var{children:t,isPanorama:r}=e,n=xe(PV);if(!n||n.length===0)return t;var i=n.filter(s=>s<0),a=n.filter(s=>s>0);return y.createElement(y.Fragment,null,i.map(s=>y.createElement(iC,{key:s,zIndex:s,isPanorama:r})),t,a.map(s=>y.createElement(iC,{key:s,zIndex:s,isPanorama:r})))}var Eee=["children"];function Cee(e,t){if(e==null)return{};var r,n,i=Oee(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Oee(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Jh(){return Jh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jh.apply(null,arguments)}var Aee={width:"100%",height:"100%",display:"block"},Tee=y.forwardRef((e,t)=>{var r=lb(),n=cb(),i=$2();if(!_i(r)||!_i(n))return null;var{children:a,otherAttributes:s,title:u,desc:d}=e,f,h;return s!=null&&(typeof s.tabIndex=="number"?f=s.tabIndex:f=i?0:void 0,typeof s.role=="string"?h=s.role:h=i?"application":void 0),y.createElement(U0,Jh({},s,{title:u,desc:d,role:h,tabIndex:f,width:r,height:n,style:Aee,ref:t}),a)}),Mee=e=>{var{children:t}=e,r=xe(Tm);if(!r)return null;var{width:n,height:i,y:a,x:s}=r;return y.createElement(U0,{width:n,height:i,x:s,y:a},t)},oC=y.forwardRef((e,t)=>{var{children:r}=e,n=Cee(e,Eee),i=er();return i?y.createElement(Mee,null,y.createElement(aC,{isPanorama:!0},r)):y.createElement(Tee,Jh({ref:t},n),y.createElement(aC,{isPanorama:!1},r))});function Iee(){var e=ht(),[t,r]=y.useState(null),n=xe(D6);return y.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;nt(a)&&a!==n&&e(y6(a))}},[t,e,n]),r}function sC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ree(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sC(Object(r),!0).forEach(function(n){Dee(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sC(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Dee(e,t,r){return(t=Lee(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lee(e){var t=$ee(e,"string");return typeof t=="symbol"?t:t+""}function $ee(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vs(){return vs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vs.apply(null,arguments)}var zee=()=>(c7(),null);function em(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var Fee=y.forwardRef((e,t)=>{var r,n,i=y.useRef(null),[a,s]=y.useState({containerWidth:em((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:em((n=e.style)===null||n===void 0?void 0:n.height)}),u=y.useCallback((f,h)=>{s(p=>{var v=Math.round(f),g=Math.round(h);return p.containerWidth===v&&p.containerHeight===g?p:{containerWidth:v,containerHeight:g}})},[]),d=y.useCallback(f=>{if(typeof t=="function"&&t(f),f!=null&&typeof ResizeObserver<"u"){var{width:h,height:p}=f.getBoundingClientRect();u(h,p);var v=j=>{var{width:b,height:w}=j[0].contentRect;u(b,w)},g=new ResizeObserver(v);g.observe(f),i.current=g}},[t,u]);return y.useEffect(()=>()=>{var f=i.current;f!=null&&f.disconnect()},[u]),y.createElement(y.Fragment,null,y.createElement(Mm,{width:a.containerWidth,height:a.containerHeight}),y.createElement("div",vs({ref:d},e)))}),Bee=y.forwardRef((e,t)=>{var{width:r,height:n}=e,[i,a]=y.useState({containerWidth:em(r),containerHeight:em(n)}),s=y.useCallback((d,f)=>{a(h=>{var p=Math.round(d),v=Math.round(f);return h.containerWidth===p&&h.containerHeight===v?h:{containerWidth:p,containerHeight:v}})},[]),u=y.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:f,height:h}=d.getBoundingClientRect();s(f,h)}},[t,s]);return y.createElement(y.Fragment,null,y.createElement(Mm,{width:i.containerWidth,height:i.containerHeight}),y.createElement("div",vs({ref:u},e)))}),Wee=y.forwardRef((e,t)=>{var{width:r,height:n}=e;return y.createElement(y.Fragment,null,y.createElement(Mm,{width:r,height:n}),y.createElement("div",vs({ref:t},e)))}),Uee=y.forwardRef((e,t)=>{var{width:r,height:n}=e;return ya(r)||ya(n)?y.createElement(Bee,vs({},e,{ref:t})):y.createElement(Wee,vs({},e,{ref:t}))});function Kee(e){return e===!0?Fee:Uee}var qee=y.forwardRef((e,t)=>{var{children:r,className:n,height:i,onClick:a,onContextMenu:s,onDoubleClick:u,onMouseDown:d,onMouseEnter:f,onMouseLeave:h,onMouseMove:p,onMouseUp:v,onTouchEnd:g,onTouchMove:j,onTouchStart:b,style:w,width:N,responsive:P,dispatchTouchEvents:E=!0}=e,k=y.useRef(null),C=ht(),[T,A]=y.useState(null),[M,z]=y.useState(null),V=Iee(),L=sb(),K=(L==null?void 0:L.width)>0?L.width:N,te=(L==null?void 0:L.height)>0?L.height:i,R=y.useCallback(J=>{V(J),typeof t=="function"&&t(J),A(J),z(J),J!=null&&(k.current=J)},[V,t,A,z]),U=y.useCallback(J=>{C(tR(J)),C(An({handler:a,reactEvent:J}))},[C,a]),F=y.useCallback(J=>{C(p0(J)),C(An({handler:f,reactEvent:J}))},[C,f]),X=y.useCallback(J=>{C(MM()),C(An({handler:h,reactEvent:J}))},[C,h]),$=y.useCallback(J=>{C(p0(J)),C(An({handler:p,reactEvent:J}))},[C,p]),Y=y.useCallback(()=>{C(sR())},[C]),W=y.useCallback(J=>{C(oR(J.key))},[C]),I=y.useCallback(J=>{C(An({handler:s,reactEvent:J}))},[C,s]),H=y.useCallback(J=>{C(An({handler:u,reactEvent:J}))},[C,u]),oe=y.useCallback(J=>{C(An({handler:d,reactEvent:J}))},[C,d]),se=y.useCallback(J=>{C(An({handler:v,reactEvent:J}))},[C,v]),be=y.useCallback(J=>{C(An({handler:b,reactEvent:J}))},[C,b]),Ae=y.useCallback(J=>{E&&C(cR(J)),C(An({handler:j,reactEvent:J}))},[C,E,j]),de=y.useCallback(J=>{C(An({handler:g,reactEvent:J}))},[C,g]),Se=Kee(P);return y.createElement(JM.Provider,{value:T},y.createElement(iA.Provider,{value:M},y.createElement(Se,{width:K??(w==null?void 0:w.width),height:te??(w==null?void 0:w.height),className:He("recharts-wrapper",n),style:Ree({position:"relative",cursor:"default",width:K,height:te},w),onClick:U,onContextMenu:I,onDoubleClick:H,onFocus:Y,onKeyDown:W,onMouseDown:oe,onMouseEnter:F,onMouseLeave:X,onMouseMove:$,onMouseUp:se,onTouchEnd:de,onTouchMove:Ae,onTouchStart:be,ref:R},y.createElement(zee,null),r)))}),Hee=["width","height","responsive","children","className","style","compact","title","desc"];function Vee(e,t){if(e==null)return{};var r,n,i=Yee(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Yee(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var mR=y.forwardRef((e,t)=>{var{width:r,height:n,responsive:i,children:a,className:s,style:u,compact:d,title:f,desc:h}=e,p=Vee(e,Hee),v=Rr(p);return d?y.createElement(y.Fragment,null,y.createElement(Mm,{width:r,height:n}),y.createElement(oC,{otherAttributes:v,title:f,desc:h},a)):y.createElement(qee,{className:s,style:u,width:r,height:n,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},y.createElement(oC,{otherAttributes:v,title:f,desc:h,ref:t},y.createElement(DX,null,a)))});function v0(){return v0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},v0.apply(null,arguments)}var Gee={top:5,right:5,bottom:5,left:5},Xee={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:Gee,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},Ww=y.forwardRef(function(t,r){var n,i=Mt(t.categoricalChartProps,Xee),{chartName:a,defaultTooltipEventType:s,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,categoricalChartProps:f}=t,h={chartName:a,defaultTooltipEventType:s,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,eventEmitter:void 0};return y.createElement(dR,{preloadedState:{options:h},reduxStoreName:(n=f.id)!==null&&n!==void 0?n:a},y.createElement(kI,{chartData:f.data}),y.createElement(fR,{layout:i.layout,margin:i.margin}),y.createElement(hR,{baseValue:i.baseValue,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),y.createElement(mR,v0({},i,{ref:r})))}),Qee=["axis"],pR=y.forwardRef((e,t)=>y.createElement(Ww,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Qee,tooltipPayloadSearcher:ep,categoricalChartProps:e,ref:t})),Zee=["axis","item"],tm=y.forwardRef((e,t)=>y.createElement(Ww,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Zee,tooltipPayloadSearcher:ep,categoricalChartProps:e,ref:t}));function Jee(e){var t=ht();return y.useEffect(()=>{t(wee(e))},[t,e]),null}var ete=["layout"];function g0(){return g0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},g0.apply(null,arguments)}function tte(e,t){if(e==null)return{};var r,n,i=rte(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function rte(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var nte={top:5,right:5,bottom:5,left:5},vR={accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:nte,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},ite=y.forwardRef(function(t,r){var n,i=Mt(t.categoricalChartProps,vR),{layout:a}=i,s=tte(i,ete),{chartName:u,defaultTooltipEventType:d,validateTooltipEventTypes:f,tooltipPayloadSearcher:h}=t,p={chartName:u,defaultTooltipEventType:d,validateTooltipEventTypes:f,tooltipPayloadSearcher:h,eventEmitter:void 0};return y.createElement(dR,{preloadedState:{options:p},reduxStoreName:(n=i.id)!==null&&n!==void 0?n:u},y.createElement(kI,{chartData:i.data}),y.createElement(fR,{layout:a,margin:i.margin}),y.createElement(hR,{baseValue:void 0,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),y.createElement(Jee,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),y.createElement(mR,g0({},s,{ref:r})))});function lC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function cC(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lC(Object(r),!0).forEach(function(n){ate(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lC(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ate(e,t,r){return(t=ote(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ote(e){var t=ste(e,"string");return typeof t=="symbol"?t:t+""}function ste(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lte=["item"],cte=cC(cC({},vR),{},{layout:"centric",startAngle:0,endAngle:360}),gR=y.forwardRef((e,t)=>{var r=Mt(e,cte);return y.createElement(ite,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:lte,tooltipPayloadSearcher:ep,categoricalChartProps:r,ref:t})}),ute=["axis"],Vu=y.forwardRef((e,t)=>y.createElement(Ww,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:ute,tooltipPayloadSearcher:ep,categoricalChartProps:e,ref:t}));function dte({data:e}){return l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"Memory Usage"})}),l.jsx(ce,{children:l.jsx(hn,{width:"100%",height:300,children:l.jsxs(Vu,{data:e,children:[l.jsx(In,{dataKey:"time",tick:{fontSize:12},tickLine:!1}),l.jsx(Rn,{tick:{fontSize:12},tickLine:!1,tickFormatter:t=>`${(t/1024/1024).toFixed(0)}MB`}),l.jsx(mn,{formatter:t=>[`${((typeof t=="number"?t:0)/1024/1024).toFixed(2)} MB`]}),l.jsx(Dn,{type:"monotone",dataKey:"used",stroke:"#8884d8",fill:"#8884d8",fillOpacity:.3,name:"Used"}),l.jsx(Dn,{type:"monotone",dataKey:"peak",stroke:"#82ca9d",fill:"#82ca9d",fillOpacity:.1,name:"Peak"})]})})})]})}function fte({data:e}){return l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"Operations/sec"})}),l.jsx(ce,{children:l.jsx(hn,{width:"100%",height:300,children:l.jsxs(pR,{data:e,children:[l.jsx(In,{dataKey:"time",tick:{fontSize:12},tickLine:!1}),l.jsx(Rn,{tick:{fontSize:12},tickLine:!1}),l.jsx(mn,{}),l.jsx($w,{type:"monotone",dataKey:"ops",stroke:"#8884d8",strokeWidth:2,dot:!1})]})})})]})}function hte(){const{capabilities:e,isValkey:t,hasCommandLog:r,hasClusterSlotStats:n}=F0();return e?l.jsxs("div",{className:"flex flex-wrap gap-2",children:[l.jsxs(Ve,{variant:t?"default":"secondary",children:[e.dbType," ",e.version]}),r&&l.jsx(Ve,{variant:"outline",children:"COMMANDLOG"}),n&&l.jsx(Ve,{variant:"outline",children:"SLOT-STATS"})]}):null}/**
124
+ * @license lucide-react v0.562.0 - ISC
125
+ *
126
+ * This source code is licensed under the ISC license.
127
+ * See the LICENSE file in the root directory of this source tree.
128
+ */const mte=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),pte=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),uC=e=>{const t=pte(e);return t.charAt(0).toUpperCase()+t.slice(1)},yR=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),vte=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
129
+ * @license lucide-react v0.562.0 - ISC
130
+ *
131
+ * This source code is licensed under the ISC license.
132
+ * See the LICENSE file in the root directory of this source tree.
133
+ */var gte={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
134
+ * @license lucide-react v0.562.0 - ISC
135
+ *
136
+ * This source code is licensed under the ISC license.
137
+ * See the LICENSE file in the root directory of this source tree.
138
+ */const yte=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:a,iconNode:s,...u},d)=>y.createElement("svg",{ref:d,...gte,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:yR("lucide",i),...!a&&!vte(u)&&{"aria-hidden":"true"},...u},[...s.map(([f,h])=>y.createElement(f,h)),...Array.isArray(a)?a:[a]]));/**
139
+ * @license lucide-react v0.562.0 - ISC
140
+ *
141
+ * This source code is licensed under the ISC license.
142
+ * See the LICENSE file in the root directory of this source tree.
143
+ */const Je=(e,t)=>{const r=y.forwardRef(({className:n,...i},a)=>y.createElement(yte,{ref:a,iconNode:t,className:yR(`lucide-${mte(uC(e))}`,`lucide-${e}`,n),...i}));return r.displayName=uC(e),r};/**
144
+ * @license lucide-react v0.562.0 - ISC
145
+ *
146
+ * This source code is licensed under the ISC license.
147
+ * See the LICENSE file in the root directory of this source tree.
148
+ */const xte=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],uu=Je("activity",xte);/**
149
+ * @license lucide-react v0.562.0 - ISC
150
+ *
151
+ * This source code is licensed under the ISC license.
152
+ * See the LICENSE file in the root directory of this source tree.
153
+ */const bte=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],wte=Je("arrow-right",bte);/**
154
+ * @license lucide-react v0.562.0 - ISC
155
+ *
156
+ * This source code is licensed under the ISC license.
157
+ * See the LICENSE file in the root directory of this source tree.
158
+ */const jte=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],Ste=Je("chart-column",jte);/**
159
+ * @license lucide-react v0.562.0 - ISC
160
+ *
161
+ * This source code is licensed under the ISC license.
162
+ * See the LICENSE file in the root directory of this source tree.
163
+ */const Nte=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],dp=Je("chevron-down",Nte);/**
164
+ * @license lucide-react v0.562.0 - ISC
165
+ *
166
+ * This source code is licensed under the ISC license.
167
+ * See the LICENSE file in the root directory of this source tree.
168
+ */const Pte=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Uw=Je("chevron-right",Pte);/**
169
+ * @license lucide-react v0.562.0 - ISC
170
+ *
171
+ * This source code is licensed under the ISC license.
172
+ * See the LICENSE file in the root directory of this source tree.
173
+ */const kte=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],_te=Je("chevron-up",kte);/**
174
+ * @license lucide-react v0.562.0 - ISC
175
+ *
176
+ * This source code is licensed under the ISC license.
177
+ * See the LICENSE file in the root directory of this source tree.
178
+ */const Ete=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],fp=Je("circle-alert",Ete);/**
179
+ * @license lucide-react v0.562.0 - ISC
180
+ *
181
+ * This source code is licensed under the ISC license.
182
+ * See the LICENSE file in the root directory of this source tree.
183
+ */const Cte=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Kw=Je("circle-check-big",Cte);/**
184
+ * @license lucide-react v0.562.0 - ISC
185
+ *
186
+ * This source code is licensed under the ISC license.
187
+ * See the LICENSE file in the root directory of this source tree.
188
+ */const Ote=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],xR=Je("circle-x",Ote);/**
189
+ * @license lucide-react v0.562.0 - ISC
190
+ *
191
+ * This source code is licensed under the ISC license.
192
+ * See the LICENSE file in the root directory of this source tree.
193
+ */const Ate=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],bR=Je("clock",Ate);/**
194
+ * @license lucide-react v0.562.0 - ISC
195
+ *
196
+ * This source code is licensed under the ISC license.
197
+ * See the LICENSE file in the root directory of this source tree.
198
+ */const Tte=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Mte=Je("copy",Tte);/**
199
+ * @license lucide-react v0.562.0 - ISC
200
+ *
201
+ * This source code is licensed under the ISC license.
202
+ * See the LICENSE file in the root directory of this source tree.
203
+ */const Ite=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],qc=Je("database",Ite);/**
204
+ * @license lucide-react v0.562.0 - ISC
205
+ *
206
+ * This source code is licensed under the ISC license.
207
+ * See the LICENSE file in the root directory of this source tree.
208
+ */const Rte=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],dC=Je("git-branch",Rte);/**
209
+ * @license lucide-react v0.562.0 - ISC
210
+ *
211
+ * This source code is licensed under the ISC license.
212
+ * See the LICENSE file in the root directory of this source tree.
213
+ */const Dte=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],Lte=Je("grid-3x3",Dte);/**
214
+ * @license lucide-react v0.562.0 - ISC
215
+ *
216
+ * This source code is licensed under the ISC license.
217
+ * See the LICENSE file in the root directory of this source tree.
218
+ */const $te=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],zte=Je("hard-drive",$te);/**
219
+ * @license lucide-react v0.562.0 - ISC
220
+ *
221
+ * This source code is licensed under the ISC license.
222
+ * See the LICENSE file in the root directory of this source tree.
223
+ */const Fte=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],ns=Je("info",Fte);/**
224
+ * @license lucide-react v0.562.0 - ISC
225
+ *
226
+ * This source code is licensed under the ISC license.
227
+ * See the LICENSE file in the root directory of this source tree.
228
+ */const Bte=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],fC=Je("loader-circle",Bte);/**
229
+ * @license lucide-react v0.562.0 - ISC
230
+ *
231
+ * This source code is licensed under the ISC license.
232
+ * See the LICENSE file in the root directory of this source tree.
233
+ */const Wte=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],Ute=Je("maximize",Wte);/**
234
+ * @license lucide-react v0.562.0 - ISC
235
+ *
236
+ * This source code is licensed under the ISC license.
237
+ * See the LICENSE file in the root directory of this source tree.
238
+ */const Kte=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],qte=Je("message-circle",Kte);/**
239
+ * @license lucide-react v0.562.0 - ISC
240
+ *
241
+ * This source code is licensed under the ISC license.
242
+ * See the LICENSE file in the root directory of this source tree.
243
+ */const Hte=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],wR=Je("network",Hte);/**
244
+ * @license lucide-react v0.562.0 - ISC
245
+ *
246
+ * This source code is licensed under the ISC license.
247
+ * See the LICENSE file in the root directory of this source tree.
248
+ */const Vte=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Yte=Je("refresh-cw",Vte);/**
249
+ * @license lucide-react v0.562.0 - ISC
250
+ *
251
+ * This source code is licensed under the ISC license.
252
+ * See the LICENSE file in the root directory of this source tree.
253
+ */const Gte=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Xte=Je("send",Gte);/**
254
+ * @license lucide-react v0.562.0 - ISC
255
+ *
256
+ * This source code is licensed under the ISC license.
257
+ * See the LICENSE file in the root directory of this source tree.
258
+ */const Qte=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],du=Je("server",Qte);/**
259
+ * @license lucide-react v0.562.0 - ISC
260
+ *
261
+ * This source code is licensed under the ISC license.
262
+ * See the LICENSE file in the root directory of this source tree.
263
+ */const Zte=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Jte=Je("shield",Zte);/**
264
+ * @license lucide-react v0.562.0 - ISC
265
+ *
266
+ * This source code is licensed under the ISC license.
267
+ * See the LICENSE file in the root directory of this source tree.
268
+ */const ere=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],hC=Je("sparkles",ere);/**
269
+ * @license lucide-react v0.562.0 - ISC
270
+ *
271
+ * This source code is licensed under the ISC license.
272
+ * See the LICENSE file in the root directory of this source tree.
273
+ */const tre=[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]],rre=Je("trending-down",tre);/**
274
+ * @license lucide-react v0.562.0 - ISC
275
+ *
276
+ * This source code is licensed under the ISC license.
277
+ * See the LICENSE file in the root directory of this source tree.
278
+ */const nre=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],jR=Je("trending-up",nre);/**
279
+ * @license lucide-react v0.562.0 - ISC
280
+ *
281
+ * This source code is licensed under the ISC license.
282
+ * See the LICENSE file in the root directory of this source tree.
283
+ */const ire=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],gs=Je("triangle-alert",ire);/**
284
+ * @license lucide-react v0.562.0 - ISC
285
+ *
286
+ * This source code is licensed under the ISC license.
287
+ * See the LICENSE file in the root directory of this source tree.
288
+ */const are=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],SR=Je("users",are);/**
289
+ * @license lucide-react v0.562.0 - ISC
290
+ *
291
+ * This source code is licensed under the ISC license.
292
+ * See the LICENSE file in the root directory of this source tree.
293
+ */const ore=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],sre=Je("zap",ore);/**
294
+ * @license lucide-react v0.562.0 - ISC
295
+ *
296
+ * This source code is licensed under the ISC license.
297
+ * See the LICENSE file in the root directory of this source tree.
298
+ */const lre=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],cre=Je("zoom-in",lre);/**
299
+ * @license lucide-react v0.562.0 - ISC
300
+ *
301
+ * This source code is licensed under the ISC license.
302
+ * See the LICENSE file in the root directory of this source tree.
303
+ */const ure=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],dre=Je("zoom-out",ure),mC=/(High fragmentation|latency spikes?|too slow|advices? for you|blocked|blocking|WARNING|ERROR)/gi,pC=/(CONFIG SET [^\n]+)/g;function fre(e){const t=[];let r=e,n=0;for(;r.length>0;){mC.lastIndex=0,pC.lastIndex=0;const i=mC.exec(r),a=pC.exec(r),s=[i,a].filter(Boolean);if(s.length===0){t.push(l.jsx(y.Fragment,{children:r},n));break}const u=s.reduce((f,h)=>f.index<h.index?f:h),d=u===i;u.index>0&&t.push(l.jsx(y.Fragment,{children:r.slice(0,u.index)},n++)),d?t.push(l.jsx("span",{className:"text-red-600 font-semibold",children:u[0]},n++)):t.push(l.jsx("code",{className:"bg-blue-100 text-blue-700 px-1 rounded",children:u[0]},n++)),r=r.slice(u.index+u[0].length)}return t}function NR({title:e,report:t,isLoading:r}){return r?l.jsxs("div",{className:"rounded-lg border border-gray-200 bg-gray-50 p-4 animate-pulse",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"h-5 w-5 bg-gray-300 rounded"}),l.jsx("div",{className:"h-5 w-32 bg-gray-300 rounded"})]}),l.jsxs("div",{className:"mt-2 space-y-2",children:[l.jsx("div",{className:"h-4 bg-gray-300 rounded w-3/4"}),l.jsx("div",{className:"h-4 bg-gray-300 rounded w-1/2"})]})]}):!t||t.includes("I have no latency reports")||t.includes("Sam, I have no advice")||t.trim().length===0?l.jsxs("div",{className:"rounded-lg border border-green-200 bg-green-50 p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-green-700",children:[l.jsx(Kw,{className:"h-5 w-5"}),l.jsx("span",{className:"font-medium",children:e})]}),l.jsx("p",{className:"mt-1 text-sm text-green-600",children:"No issues detected"})]}):l.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-amber-700 mb-2",children:[l.jsx(gs,{className:"h-5 w-5"}),l.jsx("span",{className:"font-medium",children:e})]}),l.jsx("pre",{className:"mt-2 whitespace-pre-wrap text-sm text-gray-700 font-mono overflow-x-auto",children:fre(t)})]})}function hre(){const{currentConnection:e}=Qr(),{data:t,loading:r}=Ke({fetcher:ze.getHealth,interval:5e3,refetchKey:e==null?void 0:e.id}),{data:n}=Ke({fetcher:ze.getInfo,interval:5e3,refetchKey:e==null?void 0:e.id}),[i,a]=y.useState([]),[s,u]=y.useState([]),[d,f]=y.useState(),[h,p]=y.useState(!0);return y.useEffect(()=>{a([]),u([])},[e==null?void 0:e.id]),y.useEffect(()=>{if(!(n!=null&&n.memory)||!(n!=null&&n.stats))return;const v=new Date().toLocaleTimeString();a(g=>[...g,{time:v,used:parseInt(n.memory.used_memory,10),peak:parseInt(n.memory.used_memory_peak,10)}].slice(-60)),u(g=>[...g,{time:v,ops:parseInt(n.stats.instantaneous_ops_per_sec,10)}].slice(-60))},[n]),y.useEffect(()=>{p(!0),ze.getMemoryDoctor().then(v=>f(v.report)).catch(console.error).finally(()=>p(!1))},[e==null?void 0:e.id]),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-3xl font-bold",children:"Dashboard"}),l.jsx(hte,{})]}),l.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4 xl:grid-cols-7",children:[l.jsx(iz,{health:t,loading:r}),l.jsx(az,{info:n})]}),l.jsx(NR,{title:"Memory Doctor",report:d,isLoading:h}),l.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[l.jsx(dte,{data:i}),l.jsx(fte,{data:s})]})]})}const Ai=y.forwardRef(({className:e,...t},r)=>l.jsx("div",{className:"relative w-full overflow-auto",children:l.jsx("table",{ref:r,className:Zt("w-full caption-bottom text-sm",e),...t})}));Ai.displayName="Table";const Ti=y.forwardRef(({className:e,...t},r)=>l.jsx("thead",{ref:r,className:Zt("[&_tr]:border-b",e),...t}));Ti.displayName="TableHeader";const Mi=y.forwardRef(({className:e,...t},r)=>l.jsx("tbody",{ref:r,className:Zt("[&_tr:last-child]:border-0",e),...t}));Mi.displayName="TableBody";const mre=y.forwardRef(({className:e,...t},r)=>l.jsx("tfoot",{ref:r,className:Zt("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));mre.displayName="TableFooter";const bt=y.forwardRef(({className:e,...t},r)=>l.jsx("tr",{ref:r,className:Zt("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));bt.displayName="TableRow";const Me=y.forwardRef(({className:e,...t},r)=>l.jsx("th",{ref:r,className:Zt("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));Me.displayName="TableHead";const Oe=y.forwardRef(({className:e,...t},r)=>l.jsx("td",{ref:r,className:Zt("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Oe.displayName="TableCell";const pre=y.forwardRef(({className:e,...t},r)=>l.jsx("caption",{ref:r,className:Zt("mt-4 text-sm text-muted-foreground",e),...t}));pre.displayName="TableCaption";function vre({entries:e}){const t=n=>n<1e3?`${n}µs`:n<1e6?`${(n/1e3).toFixed(2)}ms`:`${(n/1e6).toFixed(2)}s`,r=n=>new Date(n*1e3).toLocaleString();return l.jsxs(Ai,{children:[l.jsx(Ti,{children:l.jsxs(bt,{children:[l.jsx(Me,{className:"w-[100px]",children:"ID"}),l.jsx(Me,{children:"Time"}),l.jsx(Me,{children:"Duration"}),l.jsx(Me,{children:"Command"}),l.jsx(Me,{children:"Client"})]})}),l.jsxs(Mi,{children:[e.map(n=>l.jsxs(bt,{children:[l.jsx(Oe,{className:"font-mono",children:n.id}),l.jsx(Oe,{children:r(n.timestamp)}),l.jsx(Oe,{className:"font-mono",children:t(n.duration)}),l.jsx(Oe,{className:"font-mono text-sm max-w-md truncate",children:n.command.join(" ")}),l.jsx(Oe,{className:"text-muted-foreground",children:n.clientName||n.clientAddress})]},n.id)),e.length===0&&l.jsx(bt,{children:l.jsx(Oe,{colSpan:5,className:"text-center text-muted-foreground",children:"No slow log entries"})})]})]})}function va(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e==null||e(i),r===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function qw(e,t=[]){let r=[];function n(a,s){const u=y.createContext(s),d=r.length;r=[...r,s];const f=p=>{var N;const{scope:v,children:g,...j}=p,b=((N=v==null?void 0:v[e])==null?void 0:N[d])||u,w=y.useMemo(()=>j,Object.values(j));return l.jsx(b.Provider,{value:w,children:g})};f.displayName=a+"Provider";function h(p,v){var b;const g=((b=v==null?void 0:v[e])==null?void 0:b[d])||u,j=y.useContext(g);if(j)return j;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${a}\``)}return[f,h]}const i=()=>{const a=r.map(s=>y.createContext(s));return function(u){const d=(u==null?void 0:u[e])||a;return y.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return i.scopeName=e,[n,gre(i,...t)]}function gre(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const s=n.reduce((u,{useScope:d,scopeName:f})=>{const p=d(a)[`__scope${f}`];return{...u,...p}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}function vC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function PR(...e){return t=>{let r=!1;const n=e.map(i=>{const a=vC(i,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let i=0;i<n.length;i++){const a=n[i];typeof a=="function"?a():vC(e[i],null)}}}}function rm(...e){return y.useCallback(PR(...e),e)}function y0(e){const t=yre(e),r=y.forwardRef((n,i)=>{const{children:a,...s}=n,u=y.Children.toArray(a),d=u.find(bre);if(d){const f=d.props.children,h=u.map(p=>p===d?y.Children.count(f)>1?y.Children.only(null):y.isValidElement(f)?f.props.children:null:p);return l.jsx(t,{...s,ref:i,children:y.isValidElement(f)?y.cloneElement(f,void 0,h):null})}return l.jsx(t,{...s,ref:i,children:a})});return r.displayName=`${e}.Slot`,r}function yre(e){const t=y.forwardRef((r,n)=>{const{children:i,...a}=r;if(y.isValidElement(i)){const s=jre(i),u=wre(a,i.props);return i.type!==y.Fragment&&(u.ref=n?PR(n,s):s),y.cloneElement(i,u)}return y.Children.count(i)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var xre=Symbol("radix.slottable");function bre(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xre}function wre(e,t){const r={...t};for(const n in t){const i=e[n],a=t[n];/^on[A-Z]/.test(n)?i&&a?r[n]=(...u)=>{const d=a(...u);return i(...u),d}:i&&(r[n]=i):n==="style"?r[n]={...i,...a}:n==="className"&&(r[n]=[i,a].filter(Boolean).join(" "))}return{...e,...r}}function jre(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Sre(e){const t=e+"CollectionProvider",[r,n]=qw(t),[i,a]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=b=>{const{scope:w,children:N}=b,P=xr.useRef(null),E=xr.useRef(new Map).current;return l.jsx(i,{scope:w,itemMap:E,collectionRef:P,children:N})};s.displayName=t;const u=e+"CollectionSlot",d=y0(u),f=xr.forwardRef((b,w)=>{const{scope:N,children:P}=b,E=a(u,N),k=rm(w,E.collectionRef);return l.jsx(d,{ref:k,children:P})});f.displayName=u;const h=e+"CollectionItemSlot",p="data-radix-collection-item",v=y0(h),g=xr.forwardRef((b,w)=>{const{scope:N,children:P,...E}=b,k=xr.useRef(null),C=rm(w,k),T=a(h,N);return xr.useEffect(()=>(T.itemMap.set(k,{ref:k,...E}),()=>void T.itemMap.delete(k))),l.jsx(v,{[p]:"",ref:C,children:P})});g.displayName=h;function j(b){const w=a(e+"CollectionConsumer",b);return xr.useCallback(()=>{const P=w.collectionRef.current;if(!P)return[];const E=Array.from(P.querySelectorAll(`[${p}]`));return Array.from(w.itemMap.values()).sort((T,A)=>E.indexOf(T.ref.current)-E.indexOf(A.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:s,Slot:f,ItemSlot:g},j,n]}var nm=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},Nre=_0[" useId ".trim().toString()]||(()=>{}),Pre=0;function kR(e){const[t,r]=y.useState(Nre());return nm(()=>{r(n=>n??String(Pre++))},[e]),t?`radix-${t}`:""}var kre=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$l=kre.reduce((e,t)=>{const r=y0(`Primitive.${t}`),n=y.forwardRef((i,a)=>{const{asChild:s,...u}=i,d=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(d,{...u,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function _re(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}var Ere=_0[" useInsertionEffect ".trim().toString()]||nm;function _R({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[i,a,s]=Cre({defaultProp:t,onChange:r}),u=e!==void 0,d=u?e:i;{const h=y.useRef(e!==void 0);y.useEffect(()=>{const p=h.current;p!==u&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=u},[u,n])}const f=y.useCallback(h=>{var p;if(u){const v=Ore(h)?h(e):h;v!==e&&((p=s.current)==null||p.call(s,v))}else a(h)},[u,e,a,s]);return[d,f]}function Cre({defaultProp:e,onChange:t}){const[r,n]=y.useState(e),i=y.useRef(r),a=y.useRef(t);return Ere(()=>{a.current=t},[t]),y.useEffect(()=>{var s;i.current!==r&&((s=a.current)==null||s.call(a,r),i.current=r)},[r,i]),[r,n,a]}function Ore(e){return typeof e=="function"}var Are=y.createContext(void 0);function ER(e){const t=y.useContext(Are);return e||t||"ltr"}var Xy="rovingFocusGroup.onEntryFocus",Tre={bubbles:!1,cancelable:!0},Yu="RovingFocusGroup",[x0,CR,Mre]=Sre(Yu),[Ire,OR]=qw(Yu,[Mre]),[Rre,Dre]=Ire(Yu),AR=y.forwardRef((e,t)=>l.jsx(x0.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(x0.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(Lre,{...e,ref:t})})}));AR.displayName=Yu;var Lre=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:h=!1,...p}=e,v=y.useRef(null),g=rm(t,v),j=ER(a),[b,w]=_R({prop:s,defaultProp:u??null,onChange:d,caller:Yu}),[N,P]=y.useState(!1),E=_re(f),k=CR(r),C=y.useRef(!1),[T,A]=y.useState(0);return y.useEffect(()=>{const M=v.current;if(M)return M.addEventListener(Xy,E),()=>M.removeEventListener(Xy,E)},[E]),l.jsx(Rre,{scope:r,orientation:n,dir:j,loop:i,currentTabStopId:b,onItemFocus:y.useCallback(M=>w(M),[w]),onItemShiftTab:y.useCallback(()=>P(!0),[]),onFocusableItemAdd:y.useCallback(()=>A(M=>M+1),[]),onFocusableItemRemove:y.useCallback(()=>A(M=>M-1),[]),children:l.jsx($l.div,{tabIndex:N||T===0?-1:0,"data-orientation":n,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:va(e.onMouseDown,()=>{C.current=!0}),onFocus:va(e.onFocus,M=>{const z=!C.current;if(M.target===M.currentTarget&&z&&!N){const V=new CustomEvent(Xy,Tre);if(M.currentTarget.dispatchEvent(V),!V.defaultPrevented){const L=k().filter(F=>F.focusable),K=L.find(F=>F.active),te=L.find(F=>F.id===b),U=[K,te,...L].filter(Boolean).map(F=>F.ref.current);IR(U,h)}}C.current=!1}),onBlur:va(e.onBlur,()=>P(!1))})})}),TR="RovingFocusGroupItem",MR=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:a,children:s,...u}=e,d=kR(),f=a||d,h=Dre(TR,r),p=h.currentTabStopId===f,v=CR(r),{onFocusableItemAdd:g,onFocusableItemRemove:j,currentTabStopId:b}=h;return y.useEffect(()=>{if(n)return g(),()=>j()},[n,g,j]),l.jsx(x0.ItemSlot,{scope:r,id:f,focusable:n,active:i,children:l.jsx($l.span,{tabIndex:p?0:-1,"data-orientation":h.orientation,...u,ref:t,onMouseDown:va(e.onMouseDown,w=>{n?h.onItemFocus(f):w.preventDefault()}),onFocus:va(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:va(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){h.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const N=Fre(w,h.orientation,h.dir);if(N!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let E=v().filter(k=>k.focusable).map(k=>k.ref.current);if(N==="last")E.reverse();else if(N==="prev"||N==="next"){N==="prev"&&E.reverse();const k=E.indexOf(w.currentTarget);E=h.loop?Bre(E,k+1):E.slice(k+1)}setTimeout(()=>IR(E))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:b!=null}):s})})});MR.displayName=TR;var $re={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function zre(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Fre(e,t,r){const n=zre(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return $re[n]}function IR(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function Bre(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Wre=AR,Ure=MR;function Kre(e,t){return y.useReducer((r,n)=>t[r][n]??r,e)}var RR=e=>{const{present:t,children:r}=e,n=qre(t),i=typeof r=="function"?r({present:n.isPresent}):y.Children.only(r),a=rm(n.ref,Hre(i));return typeof r=="function"||n.isPresent?y.cloneElement(i,{ref:a}):null};RR.displayName="Presence";function qre(e){const[t,r]=y.useState(),n=y.useRef(null),i=y.useRef(e),a=y.useRef("none"),s=e?"mounted":"unmounted",[u,d]=Kre(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const f=Of(n.current);a.current=u==="mounted"?f:"none"},[u]),nm(()=>{const f=n.current,h=i.current;if(h!==e){const v=a.current,g=Of(f);e?d("MOUNT"):g==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(h&&v!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),nm(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,p=g=>{const b=Of(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&b&&(d("ANIMATION_END"),!i.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",f=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},v=g=>{g.target===t&&(a.current=Of(n.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(f),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:y.useCallback(f=>{n.current=f?getComputedStyle(f):null,r(f)},[])}}function Of(e){return(e==null?void 0:e.animationName)||"none"}function Hre(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var hp="Tabs",[Vre]=qw(hp,[OR]),DR=OR(),[Yre,Hw]=Vre(hp),LR=y.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:i,defaultValue:a,orientation:s="horizontal",dir:u,activationMode:d="automatic",...f}=e,h=ER(u),[p,v]=_R({prop:n,onChange:i,defaultProp:a??"",caller:hp});return l.jsx(Yre,{scope:r,baseId:kR(),value:p,onValueChange:v,orientation:s,dir:h,activationMode:d,children:l.jsx($l.div,{dir:h,"data-orientation":s,...f,ref:t})})});LR.displayName=hp;var $R="TabsList",zR=y.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...i}=e,a=Hw($R,r),s=DR(r);return l.jsx(Wre,{asChild:!0,...s,orientation:a.orientation,dir:a.dir,loop:n,children:l.jsx($l.div,{role:"tablist","aria-orientation":a.orientation,...i,ref:t})})});zR.displayName=$R;var FR="TabsTrigger",BR=y.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:i=!1,...a}=e,s=Hw(FR,r),u=DR(r),d=KR(s.baseId,n),f=qR(s.baseId,n),h=n===s.value;return l.jsx(Ure,{asChild:!0,...u,focusable:!i,active:h,children:l.jsx($l.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":f,"data-state":h?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:d,...a,ref:t,onMouseDown:va(e.onMouseDown,p=>{!i&&p.button===0&&p.ctrlKey===!1?s.onValueChange(n):p.preventDefault()}),onKeyDown:va(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&s.onValueChange(n)}),onFocus:va(e.onFocus,()=>{const p=s.activationMode!=="manual";!h&&!i&&p&&s.onValueChange(n)})})})});BR.displayName=FR;var WR="TabsContent",UR=y.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:i,children:a,...s}=e,u=Hw(WR,r),d=KR(u.baseId,n),f=qR(u.baseId,n),h=n===u.value,p=y.useRef(h);return y.useEffect(()=>{const v=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(v)},[]),l.jsx(RR,{present:i||h,children:({present:v})=>l.jsx($l.div,{"data-state":h?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":d,hidden:!v,id:f,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:v&&a})})});UR.displayName=WR;function KR(e,t){return`${e}-trigger-${t}`}function qR(e,t){return`${e}-content-${t}`}var Gre=LR,HR=zR,VR=BR,YR=UR;const Vw=Gre,mp=y.forwardRef(({className:e,...t},r)=>l.jsx(HR,{ref:r,className:Zt("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));mp.displayName=HR.displayName;const ni=y.forwardRef(({className:e,...t},r)=>l.jsx(VR,{ref:r,className:Zt("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));ni.displayName=VR.displayName;const ho=y.forwardRef(({className:e,...t},r)=>l.jsx(YR,{ref:r,className:Zt("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ho.displayName=YR.displayName;function Xre({entries:e,activeTab:t="slow",onTabChange:r,pagination:n}){const i=s=>s<1e3?`${s}µs`:s<1e6?`${(s/1e3).toFixed(2)}ms`:`${(s/1e6).toFixed(2)}s`,a=e[t]||[];return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[l.jsx(Ve,{variant:"outline",children:"Valkey 8.1+"}),l.jsx(Vw,{value:t,onValueChange:s=>r==null?void 0:r(s),children:l.jsxs(mp,{children:[l.jsx(ni,{value:"slow",children:"Slow"}),l.jsx(ni,{value:"large-request",children:"Large Request"}),l.jsx(ni,{value:"large-reply",children:"Large Reply"})]})})]}),l.jsxs(Ai,{children:[l.jsx(Ti,{children:l.jsxs(bt,{children:[l.jsx(Me,{className:"w-[100px]",children:"ID"}),l.jsx(Me,{children:"Time"}),l.jsx(Me,{children:"Duration"}),l.jsx(Me,{children:"Command"}),l.jsx(Me,{children:"Client"})]})}),l.jsxs(Mi,{children:[a.map(s=>l.jsxs(bt,{children:[l.jsx(Oe,{className:"font-mono",children:s.id}),l.jsx(Oe,{children:new Date(s.timestamp*1e3).toLocaleString()}),l.jsx(Oe,{className:"font-mono",children:i(s.duration)}),l.jsx(Oe,{className:"font-mono text-sm max-w-md truncate",children:s.command.join(" ")}),l.jsx(Oe,{className:"text-muted-foreground",children:s.clientName||s.clientAddress})]},s.id)),a.length===0&&l.jsx(bt,{children:l.jsx(Oe,{colSpan:5,className:"text-center text-muted-foreground",children:"No command log entries"})})]})]}),n&&l.jsxs("div",{className:"flex items-center justify-between mt-4 pt-4 border-t",children:[l.jsxs("span",{className:"text-sm text-muted-foreground",children:["Page ",n.page+1," (",a.length," entries)"]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:()=>n.onPageChange(n.page-1),disabled:n.page===0,className:"px-3 py-1 text-sm rounded border border-input bg-background hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),l.jsx("button",{onClick:()=>n.onPageChange(n.page+1),disabled:!n.hasMore,className:"px-3 py-1 text-sm rounded border border-input bg-background hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]})]})}const Gs=["#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899"];function gC({analysis:e}){const[t,r]=y.useState(new Set),n=a=>{r(s=>{const u=new Set(s);return u.has(a)?u.delete(a):u.add(a),u})},i=a=>a<1e3?`${a.toFixed(0)}µs`:a<1e6?`${(a/1e3).toFixed(1)}ms`:`${(a/1e6).toFixed(2)}s`;return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[l.jsx(ae,{children:l.jsxs(ce,{className:"pt-6",children:[l.jsx("div",{className:"text-2xl font-bold",children:e.totalEntries}),l.jsx("div",{className:"text-sm text-muted-foreground",children:"Total Slow Queries"})]})}),l.jsx(ae,{children:l.jsxs(ce,{className:"pt-6",children:[l.jsx("div",{className:"text-2xl font-bold",children:e.patterns.length}),l.jsx("div",{className:"text-sm text-muted-foreground",children:"Unique Patterns"})]})}),l.jsx(ae,{children:l.jsxs(ce,{className:"pt-6",children:[l.jsx("div",{className:"text-2xl font-bold",children:e.byCommand.length}),l.jsx("div",{className:"text-sm text-muted-foreground",children:"Command Types"})]})})]}),e.patterns.length>0&&l.jsx(ae,{children:l.jsxs(ce,{className:"pt-6",children:[l.jsxs("div",{className:"text-lg font-semibold",children:[e.patterns[0].pattern," accounts for"," ",e.patterns[0].percentage.toFixed(1),"% of slow queries"]}),l.jsxs("div",{className:"text-sm text-muted-foreground mt-1",children:["Average duration: ",i(e.patterns[0].avgDuration)," ","• ",e.patterns[0].count," occurrences"]})]})}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"Pattern Distribution"})}),l.jsx(ce,{children:l.jsx("div",{className:"space-y-3",children:e.patterns.slice(0,8).map((a,s)=>l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between text-sm",children:[l.jsxs("span",{className:"font-mono flex items-center gap-2",children:[l.jsx("span",{className:"w-3 h-3 rounded-full flex-shrink-0",style:{backgroundColor:Gs[s%Gs.length]}}),a.pattern]}),l.jsxs("span",{className:"font-semibold",children:[a.percentage.toFixed(1),"%"]})]}),l.jsx("div",{className:"w-full bg-secondary rounded-full h-2",children:l.jsx("div",{className:"h-2 rounded-full transition-all",style:{width:`${a.percentage}%`,backgroundColor:Gs[s%Gs.length]}})}),l.jsxs("div",{className:"text-xs text-muted-foreground",children:[a.count," queries • avg"," ",i(a.avgDuration)]})]},a.pattern))})})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"By Command"})}),l.jsx(ce,{children:l.jsx("div",{className:"flex gap-2 flex-wrap",children:e.byCommand.slice(0,10).map(a=>l.jsxs("div",{className:"px-3 py-2 bg-muted rounded-lg text-sm",children:[l.jsx("span",{className:"font-mono font-semibold",children:a.command}),l.jsxs("span",{className:"text-muted-foreground ml-2",children:[a.percentage.toFixed(1),"% (",a.count,")"]}),l.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["avg ",i(a.avgDuration)]})]},a.command))})})]}),e.byKeyPrefix.length>0&&l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"By Key Prefix"})}),l.jsx(ce,{children:l.jsx("div",{className:"flex gap-2 flex-wrap",children:e.byKeyPrefix.slice(0,10).map(a=>l.jsxs("div",{className:"px-3 py-2 bg-muted rounded-lg text-sm",children:[l.jsx("span",{className:"font-mono font-semibold",children:a.prefix}),l.jsxs("span",{className:"text-muted-foreground ml-2",children:[a.percentage.toFixed(1),"% (",a.count,")"]}),l.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["avg ",i(a.avgDuration)]})]},a.prefix))})})]}),e.byClient&&e.byClient.length>0&&l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"By Client"})}),l.jsx(ce,{children:l.jsx("div",{className:"flex gap-2 flex-wrap",children:e.byClient.slice(0,10).map(a=>l.jsxs("div",{className:"px-3 py-2 bg-muted rounded-lg text-sm",children:[l.jsx("span",{className:"font-mono font-semibold",children:a.clientIdentifier}),l.jsxs("span",{className:"text-muted-foreground ml-2",children:[a.percentage.toFixed(1),"% (",a.count,")"]}),l.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["avg ",i(a.avgDuration)]})]},a.clientIdentifier))})})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"All Patterns"})}),l.jsx(ce,{children:l.jsxs(Ai,{children:[l.jsx(Ti,{children:l.jsxs(bt,{children:[l.jsx(Me,{className:"w-8"}),l.jsx(Me,{children:"Pattern"}),l.jsx(Me,{className:"text-right",children:"Count"}),l.jsx(Me,{className:"text-right",children:"%"}),l.jsx(Me,{className:"text-right",children:"Avg Duration"}),l.jsx(Me,{className:"text-right",children:"Max Duration"}),l.jsx(Me,{className:"text-right",children:"Total Time"})]})}),l.jsx(Mi,{children:e.patterns.map((a,s)=>l.jsxs(xr.Fragment,{children:[l.jsxs(bt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>n(a.pattern),children:[l.jsx(Oe,{children:t.has(a.pattern)?l.jsx(dp,{className:"w-4 h-4"}):l.jsx(Uw,{className:"w-4 h-4"})}),l.jsx(Oe,{className:"font-mono text-sm",children:l.jsxs("span",{className:"inline-flex items-center gap-2",children:[l.jsx("span",{className:"w-3 h-3 rounded-full flex-shrink-0",style:{backgroundColor:Gs[s%Gs.length]}}),a.pattern]})}),l.jsx(Oe,{className:"text-right",children:a.count}),l.jsxs(Oe,{className:"text-right",children:[a.percentage.toFixed(1),"%"]}),l.jsx(Oe,{className:"text-right font-mono",children:i(a.avgDuration)}),l.jsx(Oe,{className:"text-right font-mono",children:i(a.maxDuration)}),l.jsx(Oe,{className:"text-right font-mono",children:i(a.totalDuration)})]}),t.has(a.pattern)&&l.jsx(bt,{children:l.jsx(Oe,{colSpan:7,className:"bg-muted/30 p-0",children:l.jsxs("div",{className:"p-4",children:[l.jsx("h4",{className:"text-sm font-semibold mb-3",children:"Client Breakdown"}),a.clientBreakdown.length>0?l.jsxs(Ai,{children:[l.jsx(Ti,{children:l.jsxs(bt,{children:[l.jsx(Me,{children:"Client"}),l.jsx(Me,{className:"text-right",children:"Count"}),l.jsx(Me,{className:"text-right",children:"% of Pattern"}),l.jsx(Me,{className:"text-right",children:"Avg Duration"}),l.jsx(Me,{className:"text-right",children:"Max Duration"})]})}),l.jsx(Mi,{children:a.clientBreakdown.map(u=>l.jsxs(bt,{children:[l.jsx(Oe,{className:"font-mono text-sm",children:u.clientIdentifier}),l.jsx(Oe,{className:"text-right",children:u.count}),l.jsxs(Oe,{className:"text-right",children:[u.percentage.toFixed(1),"%"]}),l.jsx(Oe,{className:"text-right font-mono",children:i(u.avgDuration)}),l.jsx(Oe,{className:"text-right font-mono",children:i(u.maxDuration)})]},u.clientIdentifier))})]}):l.jsx("p",{className:"text-sm text-muted-foreground",children:"No client breakdown available"})]})})},`${a.pattern}-details`)]},a.pattern))})]})})]})]})}const GR=6048e5,Qre=864e5,yC=Symbol.for("constructDateFrom");function Pa(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&yC in e?e[yC](t):e instanceof Date?new e.constructor(t):new Date(t)}function xn(e,t){return Pa(t||e,e)}function Zre(e,t,r){const n=xn(e,r==null?void 0:r.in);return isNaN(t)?Pa(e,NaN):(t&&n.setDate(n.getDate()+t),n)}let Jre={};function pp(){return Jre}function fu(e,t){var u,d,f,h;const r=pp(),n=(t==null?void 0:t.weekStartsOn)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??r.weekStartsOn??((h=(f=r.locale)==null?void 0:f.options)==null?void 0:h.weekStartsOn)??0,i=xn(e,t==null?void 0:t.in),a=i.getDay(),s=(a<n?7:0)+a-n;return i.setDate(i.getDate()-s),i.setHours(0,0,0,0),i}function im(e,t){return fu(e,{...t,weekStartsOn:1})}function XR(e,t){const r=xn(e,t==null?void 0:t.in),n=r.getFullYear(),i=Pa(r,0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);const a=im(i),s=Pa(r,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const u=im(s);return r.getTime()>=a.getTime()?n+1:r.getTime()>=u.getTime()?n:n-1}function xC(e){const t=xn(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function ene(e,...t){const r=Pa.bind(null,t.find(n=>typeof n=="object"));return t.map(r)}function am(e,t){const r=xn(e,t==null?void 0:t.in);return r.setHours(0,0,0,0),r}function tne(e,t,r){const[n,i]=ene(r==null?void 0:r.in,e,t),a=am(n),s=am(i),u=+a-xC(a),d=+s-xC(s);return Math.round((u-d)/Qre)}function rne(e,t){const r=XR(e,t),n=Pa(e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),im(n)}function nne(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ine(e){return!(!nne(e)&&typeof e!="number"||isNaN(+xn(e)))}function bC(e,t){const r=xn(e,t==null?void 0:t.in);return r.setHours(23,59,59,999),r}function ane(e,t){const r=xn(e,t==null?void 0:t.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}const one={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},sne=(e,t,r)=>{let n;const i=one[e];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function Qy(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const lne={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},cne={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},une={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},dne={date:Qy({formats:lne,defaultWidth:"full"}),time:Qy({formats:cne,defaultWidth:"full"}),dateTime:Qy({formats:une,defaultWidth:"full"})},fne={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},hne=(e,t,r,n)=>fne[e];function Ic(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let i;if(n==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,u=r!=null&&r.width?String(r.width):s;i=e.formattingValues[u]||e.formattingValues[s]}else{const s=e.defaultWidth,u=r!=null&&r.width?String(r.width):e.defaultWidth;i=e.values[u]||e.values[s]}const a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}const mne={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},pne={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},vne={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},gne={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},yne={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},xne={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},bne=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},wne={ordinalNumber:bne,era:Ic({values:mne,defaultWidth:"wide"}),quarter:Ic({values:pne,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ic({values:vne,defaultWidth:"wide"}),day:Ic({values:gne,defaultWidth:"wide"}),dayPeriod:Ic({values:yne,defaultWidth:"wide",formattingValues:xne,defaultFormattingWidth:"wide"})};function Rc(e){return(t,r={})=>{const n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;const s=a[0],u=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(u)?Sne(u,p=>p.test(s)):jne(u,p=>p.test(s));let f;f=e.valueCallback?e.valueCallback(d):d,f=r.valueCallback?r.valueCallback(f):f;const h=t.slice(s.length);return{value:f,rest:h}}}function jne(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function Sne(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function Nne(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const i=n[0],a=t.match(e.parsePattern);if(!a)return null;let s=e.valueCallback?e.valueCallback(a[0]):a[0];s=r.valueCallback?r.valueCallback(s):s;const u=t.slice(i.length);return{value:s,rest:u}}}const Pne=/^(\d+)(th|st|nd|rd)?/i,kne=/\d+/i,_ne={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Ene={any:[/^b/i,/^(a|c)/i]},Cne={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},One={any:[/1/i,/2/i,/3/i,/4/i]},Ane={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Tne={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Mne={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Ine={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Rne={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Dne={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Lne={ordinalNumber:Nne({matchPattern:Pne,parsePattern:kne,valueCallback:e=>parseInt(e,10)}),era:Rc({matchPatterns:_ne,defaultMatchWidth:"wide",parsePatterns:Ene,defaultParseWidth:"any"}),quarter:Rc({matchPatterns:Cne,defaultMatchWidth:"wide",parsePatterns:One,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Rc({matchPatterns:Ane,defaultMatchWidth:"wide",parsePatterns:Tne,defaultParseWidth:"any"}),day:Rc({matchPatterns:Mne,defaultMatchWidth:"wide",parsePatterns:Ine,defaultParseWidth:"any"}),dayPeriod:Rc({matchPatterns:Rne,defaultMatchWidth:"any",parsePatterns:Dne,defaultParseWidth:"any"})},$ne={code:"en-US",formatDistance:sne,formatLong:dne,formatRelative:hne,localize:wne,match:Lne,options:{weekStartsOn:0,firstWeekContainsDate:1}};function zne(e,t){const r=xn(e,t==null?void 0:t.in);return tne(r,ane(r))+1}function Fne(e,t){const r=xn(e,t==null?void 0:t.in),n=+im(r)-+rne(r);return Math.round(n/GR)+1}function QR(e,t){var h,p,v,g;const r=xn(e,t==null?void 0:t.in),n=r.getFullYear(),i=pp(),a=(t==null?void 0:t.firstWeekContainsDate)??((p=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??i.firstWeekContainsDate??((g=(v=i.locale)==null?void 0:v.options)==null?void 0:g.firstWeekContainsDate)??1,s=Pa((t==null?void 0:t.in)||e,0);s.setFullYear(n+1,0,a),s.setHours(0,0,0,0);const u=fu(s,t),d=Pa((t==null?void 0:t.in)||e,0);d.setFullYear(n,0,a),d.setHours(0,0,0,0);const f=fu(d,t);return+r>=+u?n+1:+r>=+f?n:n-1}function Bne(e,t){var u,d,f,h;const r=pp(),n=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(f=r.locale)==null?void 0:f.options)==null?void 0:h.firstWeekContainsDate)??1,i=QR(e,t),a=Pa((t==null?void 0:t.in)||e,0);return a.setFullYear(i,0,n),a.setHours(0,0,0,0),fu(a,t)}function Wne(e,t){const r=xn(e,t==null?void 0:t.in),n=+fu(r,t)-+Bne(r,t);return Math.round(n/GR)+1}function ct(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const ao={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return ct(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):ct(r+1,2)},d(e,t){return ct(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return ct(e.getHours()%12||12,t.length)},H(e,t){return ct(e.getHours(),t.length)},m(e,t){return ct(e.getMinutes(),t.length)},s(e,t){return ct(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),i=Math.trunc(n*Math.pow(10,r-3));return ct(i,t.length)}},Xs={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wC={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return ao.y(e,t)},Y:function(e,t,r,n){const i=QR(e,n),a=i>0?i:1-i;if(t==="YY"){const s=a%100;return ct(s,2)}return t==="Yo"?r.ordinalNumber(a,{unit:"year"}):ct(a,t.length)},R:function(e,t){const r=XR(e);return ct(r,t.length)},u:function(e,t){const r=e.getFullYear();return ct(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return ct(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return ct(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return ao.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return ct(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const i=Wne(e,n);return t==="wo"?r.ordinalNumber(i,{unit:"week"}):ct(i,t.length)},I:function(e,t,r){const n=Fne(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):ct(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):ao.d(e,t)},D:function(e,t,r){const n=zne(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):ct(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const i=e.getDay(),a=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return ct(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const i=e.getDay(),a=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return ct(a,t.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return ct(i,t.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let i;switch(n===12?i=Xs.noon:n===0?i=Xs.midnight:i=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let i;switch(n>=17?i=Xs.evening:n>=12?i=Xs.afternoon:n>=4?i=Xs.morning:i=Xs.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return ao.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):ao.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):ct(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):ct(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):ao.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):ao.s(e,t)},S:function(e,t){return ao.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return SC(n);case"XXXX":case"XX":return qo(n);case"XXXXX":case"XXX":default:return qo(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return SC(n);case"xxxx":case"xx":return qo(n);case"xxxxx":case"xxx":default:return qo(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+jC(n,":");case"OOOO":default:return"GMT"+qo(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+jC(n,":");case"zzzz":default:return"GMT"+qo(n,":")}},t:function(e,t,r){const n=Math.trunc(+e/1e3);return ct(n,t.length)},T:function(e,t,r){return ct(+e,t.length)}};function jC(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=Math.trunc(n/60),a=n%60;return a===0?r+String(i):r+String(i)+t+ct(a,2)}function SC(e,t){return e%60===0?(e>0?"-":"+")+ct(Math.abs(e)/60,2):qo(e,t)}function qo(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),i=ct(Math.trunc(n/60),2),a=ct(n%60,2);return r+i+t+a}const NC=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},ZR=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Une=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return NC(e,t);let a;switch(n){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",NC(n,t)).replace("{{time}}",ZR(i,t))},Kne={p:ZR,P:Une},qne=/^D+$/,Hne=/^Y+$/,Vne=["D","DD","YY","YYYY"];function Yne(e){return qne.test(e)}function Gne(e){return Hne.test(e)}function Xne(e,t,r){const n=Qne(e,t,r);if(console.warn(n),Vne.includes(e))throw new RangeError(n)}function Qne(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Zne=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Jne=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,eie=/^'([^]*?)'?$/,tie=/''/g,rie=/[a-zA-Z]/;function PC(e,t,r){var h,p,v,g;const n=pp(),i=n.locale??$ne,a=n.firstWeekContainsDate??((p=(h=n.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,s=n.weekStartsOn??((g=(v=n.locale)==null?void 0:v.options)==null?void 0:g.weekStartsOn)??0,u=xn(e,r==null?void 0:r.in);if(!ine(u))throw new RangeError("Invalid time value");let d=t.match(Jne).map(j=>{const b=j[0];if(b==="p"||b==="P"){const w=Kne[b];return w(j,i.formatLong)}return j}).join("").match(Zne).map(j=>{if(j==="''")return{isToken:!1,value:"'"};const b=j[0];if(b==="'")return{isToken:!1,value:nie(j)};if(wC[b])return{isToken:!0,value:j};if(b.match(rie))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:j}});i.localize.preprocessor&&(d=i.localize.preprocessor(u,d));const f={firstWeekContainsDate:a,weekStartsOn:s,locale:i};return d.map(j=>{if(!j.isToken)return j.value;const b=j.value;(Gne(b)||Yne(b))&&Xne(b,t,String(e));const w=wC[b[0]];return w(u,b,i.localize,f)}).join("")}function nie(e){const t=e.match(eie);return t?t[1].replace(tie,"'"):e}function iie(e,t,r){return Zre(e,-t,r)}const aie=[{label:"Last 24 hours",days:1},{label:"Last 3 days",days:3},{label:"Last 7 days",days:7},{label:"Last 30 days",days:30}];function kC(e){const[t,r,n]=e.split("-").map(Number);return new Date(t,r-1,n)}function oie({value:e,onChange:t,className:r}){const[n,i]=y.useState(!1),[a,s]=y.useState(""),[u,d]=y.useState(""),f=y.useRef(null);y.useEffect(()=>{const j=b=>{f.current&&!f.current.contains(b.target)&&i(!1)};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[]);const h=j=>{const b=bC(new Date),w=am(iie(new Date,j));t==null||t({from:w,to:b}),i(!1)},p=()=>{a&&u&&(t==null||t({from:am(kC(a)),to:bC(kC(u))}),i(!1))},v=()=>{t==null||t(void 0),s(""),d(""),i(!1)},g=()=>e?`${PC(e.from,"MMM d, yyyy")} – ${PC(e.to,"MMM d, yyyy")}`:"All time";return l.jsxs("div",{ref:f,className:`relative inline-block ${r||""}`,children:[l.jsxs("button",{type:"button",onClick:()=>i(!n),className:`
304
+ inline-flex items-center gap-2 px-3 py-1.5 text-sm border rounded-md
305
+ bg-background hover:bg-muted/50 transition-colors
306
+ ${e?"border-primary/50":"border-input"}
307
+ `,children:[l.jsx("svg",{className:"w-4 h-4 text-muted-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),l.jsx("span",{className:e?"text-foreground":"text-muted-foreground",children:g()}),e&&l.jsx("span",{role:"button",onClick:j=>{j.stopPropagation(),v()},className:"ml-1 text-muted-foreground hover:text-foreground",children:"×"})]}),n&&l.jsxs("div",{className:"absolute top-full left-0 mt-1 z-50 bg-popover border rounded-lg shadow-lg min-w-[280px]",children:[l.jsxs("div",{className:"p-2 border-b",children:[l.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-2 px-2",children:"Quick select"}),l.jsx("div",{className:"space-y-1",children:aie.map(j=>l.jsx("button",{type:"button",onClick:()=>h(j.days),className:"w-full text-left px-2 py-1.5 text-sm rounded hover:bg-muted transition-colors",children:j.label},j.days))})]}),l.jsxs("div",{className:"p-3",children:[l.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Custom range"}),l.jsxs("div",{className:"flex gap-2 items-center",children:[l.jsx("input",{type:"date",value:a,onChange:j=>s(j.target.value),className:"flex-1 px-2 py-1.5 text-sm border rounded bg-background"}),l.jsx("span",{className:"text-muted-foreground",children:"to"}),l.jsx("input",{type:"date",value:u,onChange:j=>d(j.target.value),className:"flex-1 px-2 py-1.5 text-sm border rounded bg-background"})]}),l.jsx("button",{type:"button",onClick:p,disabled:!a||!u,className:"mt-2 w-full px-3 py-1.5 text-sm bg-primary text-primary-foreground rounded hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Apply"})]})]})]})}function sie(e){const t=e.get("tab");return t==="large-request"||t==="large-reply"?t:"slow"}function Af(e,t){if(!t)return e;const r=t.toLowerCase();return e.filter(n=>{var i,a;return((i=n.clientName)==null?void 0:i.toLowerCase().includes(r))||((a=n.clientAddress)==null?void 0:a.toLowerCase().includes(r))})}function lie(){const{currentConnection:e}=Qr(),{hasCommandLog:t,capabilities:r}=F0(),[n,i]=M0(),a=sie(n),s=n.get("client"),[u,d]=y.useState("table"),f=100,[h,p]=y.useState(0),[v,g]=y.useState(void 0),j=Se=>{g(Se),p(0)},b=v!=null&&v.from?Math.floor(v.from.getTime()/1e3):void 0,w=v!=null&&v.to?Math.floor(v.to.getTime()/1e3):void 0,N=Se=>{Se==="slow"?n.delete("tab"):n.set("tab",Se),i(n),p(0)},P=b!==void 0&&w!==void 0,{data:E}=Ke({fetcher:()=>ze.getSlowLog(100,!0),interval:1e4,enabled:!t&&!P,refetchKey:e==null?void 0:e.id}),[k,C]=y.useState(null);y.useEffect(()=>{if(!P||t){C(null);return}let Se=!1;return ze.getStoredSlowLog({startTime:b,endTime:w,limit:100}).then(J=>{Se||C(J)}).catch(J=>{console.error("Failed to fetch stored slow log:",J)}),()=>{Se=!0}},[b,w,P,t]);const T=P?k:E,{data:A}=Ke({fetcher:()=>ze.getCommandLog(100,"slow"),interval:1e4,enabled:t&&a==="slow"&&!P,refetchKey:e==null?void 0:e.id}),{data:M}=Ke({fetcher:()=>ze.getCommandLog(100,"large-request"),interval:1e4,enabled:t&&a==="large-request"&&!P,refetchKey:e==null?void 0:e.id}),{data:z}=Ke({fetcher:()=>ze.getCommandLog(100,"large-reply"),interval:1e4,enabled:t&&a==="large-reply"&&!P,refetchKey:e==null?void 0:e.id}),[V,L]=y.useState({slow:null,"large-request":null,"large-reply":null}),[K,te]=y.useState(!1);y.useEffect(()=>{if(!P||!t){L({slow:null,"large-request":null,"large-reply":null}),te(!1);return}let Se=!1;const J=h*f;return ze.getStoredCommandLog({startTime:b,endTime:w,type:a,limit:f+1,offset:J}).then(pe=>{if(!Se){const Le=pe.length>f;te(Le);const re=Le?pe.slice(0,f):pe;L(ot=>({...ot,[a]:re}))}}).catch(pe=>{console.error("Failed to fetch stored command log:",pe)}),()=>{Se=!0}},[b,w,P,t,a,h]);const R=P?V.slow:A,U=P?V["large-request"]:M,F=P?V["large-reply"]:z,{data:X}=Ke({fetcher:()=>ze.getSlowLogPatternAnalysis(128),interval:3e4,enabled:!t&&u==="patterns"&&!P,refetchKey:e==null?void 0:e.id}),{data:$}=Ke({fetcher:()=>ze.getCommandLogPatternAnalysis(128,a),interval:3e4,enabled:t&&u==="patterns"&&!P,refetchKey:e==null?void 0:e.id}),[Y,W]=y.useState(null);y.useEffect(()=>{if(!P||!t||u!=="patterns"){W(null);return}let Se=!1;return ze.getStoredCommandLogPatternAnalysis({startTime:b,endTime:w,type:a,limit:500}).then(J=>{Se||W(J)}).catch(J=>{console.error("Failed to fetch stored command log pattern analysis:",J)}),()=>{Se=!0}},[b,w,P,t,u,a]);const I=X,H=P?Y:$,oe=y.useMemo(()=>Af(T||[],s),[T,s]),se=y.useMemo(()=>Af(R||[],s),[R,s]),be=y.useMemo(()=>Af(U||[],s),[U,s]),Ae=y.useMemo(()=>Af(F||[],s),[F,s]),de=()=>{n.delete("client"),i(n)};return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-3xl font-bold",children:"Slow Log"}),s&&l.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 bg-muted rounded",children:[l.jsxs("span",{className:"text-sm",children:["Filtered by: ",l.jsx("span",{className:"font-mono",children:s})]}),l.jsx("button",{onClick:de,className:"text-xs px-2 py-0.5 bg-destructive text-destructive-foreground rounded hover:bg-destructive/90",children:"Clear"})]})]}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx(oie,{value:v,onChange:j}),v&&l.jsxs("span",{className:"text-sm text-muted-foreground",children:["Showing stored entries from ",v.from.toLocaleDateString()," to ",v.to.toLocaleDateString()]})]}),t?l.jsxs(ae,{children:[l.jsxs(fe,{className:"flex flex-row items-center justify-between space-y-0 pb-4",children:[l.jsx(he,{children:"Command Log (Valkey)"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:()=>d("table"),className:`px-3 py-1 text-sm rounded transition-colors ${u==="table"?"bg-primary text-primary-foreground":"bg-muted hover:bg-muted/80"}`,children:"Table"}),l.jsx("button",{onClick:()=>d("patterns"),className:`px-3 py-1 text-sm rounded transition-colors ${u==="patterns"?"bg-primary text-primary-foreground":"bg-muted hover:bg-muted/80"}`,children:"Pattern Analysis"})]})]}),l.jsx(ce,{children:u==="patterns"&&H?l.jsx(gC,{analysis:H}):l.jsx(Xre,{entries:{slow:se,"large-request":be,"large-reply":Ae},activeTab:a,onTabChange:N,pagination:P?{page:h,pageSize:f,hasMore:K,onPageChange:p}:void 0})})]}):l.jsxs(ae,{children:[l.jsxs(fe,{className:"flex flex-row items-center justify-between space-y-0 pb-4",children:[l.jsxs(he,{children:["Slow Log (",(r==null?void 0:r.dbType)==="valkey"?"Valkey":"Redis",")"]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:()=>d("table"),className:`px-3 py-1 text-sm rounded transition-colors ${u==="table"?"bg-primary text-primary-foreground":"bg-muted hover:bg-muted/80"}`,children:"Table"}),l.jsx("button",{onClick:()=>d("patterns"),className:`px-3 py-1 text-sm rounded transition-colors ${u==="patterns"?"bg-primary text-primary-foreground":"bg-muted hover:bg-muted/80"}`,children:"Pattern Analysis"})]})]}),l.jsx(ce,{children:u==="patterns"&&I?l.jsx(gC,{analysis:I}):l.jsx(vre,{entries:oe})})]})]})}const cie=1e4,uie=3e4,die=10,Tf={sm:300,md:400},Zn={p50:"#82ca9d",p95:"#8884d8",p99:"#ffc658"},Mf={startOffset:"5%",endOffset:"95%",startOpacity:.3,endOpacity:.1},_C={left:20,right:20,top:20,bottom:20},EC={angle:-90,position:"insideLeft",dx:-12,dy:70},CC={angle:-45,textAnchor:"end",height:100};function fie(){const{currentConnection:e}=Qr(),[t,r]=y.useState(null),[n,i]=y.useState(null),[a,s]=y.useState([]),[u,d]=y.useState(!1),[f,h]=y.useState(null),[p,v]=y.useState(),[g,j]=y.useState(!0),{data:b}=Ke({fetcher:ze.getLatencyLatest,interval:cie,refetchKey:e==null?void 0:e.id}),{data:w}=Ke({fetcher:()=>ze.getLatencyHistogram(),interval:uie,refetchKey:e==null?void 0:e.id});y.useEffect(()=>{t&&(d(!0),h(null),ze.getLatencyHistory(t).then(s).catch(M=>h(M.message||"Failed to fetch history")).finally(()=>d(!1)))},[t]),y.useEffect(()=>{j(!0),ze.getLatencyDoctor().then(M=>v(M.report)).catch(console.error).finally(()=>j(!1))},[e==null?void 0:e.id]);const N=M=>M<1e3?`${M}µs`:M<1e6?`${(M/1e3).toFixed(2)}ms`:`${(M/1e6).toFixed(2)}s`,P=a.map(M=>({time:new Date(M.timestamp*1e3).toLocaleTimeString(),latency:M.latency/1e3})),E=M=>{const z=Object.entries(M).map(([K,te])=>({bucket:parseInt(K),count:te})).sort((K,te)=>K.bucket-te.bucket);if(z.length===0)return{p50:0,p95:0,p99:0};const V=z.reduce((K,te)=>K+te.count,0),L=K=>{const te=V*(K/100);let R=0;for(const{bucket:U,count:F}of z)if(R+=F,R>=te)return U;return z[z.length-1].bucket};return{p50:L(50),p95:L(95),p99:L(99)}},k=w?Object.entries(w).filter(([M])=>!M.startsWith("latency|")&&!M.startsWith("config|")).sort(([,M],[,z])=>z.calls-M.calls).slice(0,die).map(([M,z])=>{const V=E(z.histogram);return{command:M,calls:z.calls,p50:V.p50,p95:V.p95,p99:V.p99}}):[],C=n&&(w==null?void 0:w[n]),T=C?Object.entries(C.histogram).map(([M,z])=>({latency:parseInt(M),count:z})).sort((M,z)=>M.latency-z.latency):[],A=(M,z)=>l.jsxs("linearGradient",{id:M,x1:"0",y1:"0",x2:"0",y2:"1",children:[l.jsx("stop",{offset:Mf.startOffset,stopColor:z,stopOpacity:Mf.startOpacity}),l.jsx("stop",{offset:Mf.endOffset,stopColor:z,stopOpacity:Mf.endOpacity})]});return l.jsxs("div",{className:"space-y-6",children:[l.jsx("h1",{className:"text-3xl font-bold",children:"Latency Monitoring"}),l.jsx(NR,{title:"Latency Doctor",report:p,isLoading:g}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"Latest Latency Events (System-level)"})}),l.jsx(ce,{children:l.jsxs(Ai,{children:[l.jsx(Ti,{children:l.jsxs(bt,{children:[l.jsx(Me,{children:"Event"}),l.jsx(Me,{children:"Latency"}),l.jsx(Me,{children:"Time"})]})}),l.jsx(Mi,{children:b&&b.length>0?b.map(M=>l.jsxs(bt,{onClick:()=>r(M.eventName),className:`cursor-pointer ${t===M.eventName?"bg-muted":""}`,children:[l.jsx(Oe,{className:"font-medium",children:M.eventName}),l.jsx(Oe,{className:"font-mono",children:N(M.latency)}),l.jsx(Oe,{children:new Date(M.timestamp*1e3).toLocaleString()})]},M.eventName)):l.jsx(bt,{children:l.jsx(Oe,{colSpan:3,className:"text-center text-muted-foreground",children:"No system-level events recorded (fork, AOF, etc.)"})})})]})})]}),t&&l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsxs(he,{children:["Latency History: ",t]})}),l.jsx(ce,{children:u?l.jsx("div",{className:"text-center text-muted-foreground py-8",children:"Loading history..."}):f?l.jsx("div",{className:"text-center text-destructive py-8",children:f}):a.length>0?l.jsx(hn,{width:"100%",height:Tf.sm,children:l.jsxs(pR,{data:P,children:[l.jsx(Si,{strokeDasharray:"3 3"}),l.jsx(In,{dataKey:"time"}),l.jsx(Rn,{label:{value:"Latency (ms)",angle:-90,position:"insideLeft"}}),l.jsx(mn,{}),l.jsx($w,{type:"monotone",dataKey:"latency",stroke:Zn.p95,strokeWidth:2})]})}):l.jsx("div",{className:"text-center text-muted-foreground py-8",children:"No history data available for this event"})})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"Command Latency Percentiles - Top 10 Commands by Call Volume"})}),l.jsx(ce,{children:k.length>0?l.jsx(hn,{width:"100%",height:Tf.md,children:l.jsxs(Vu,{data:k,margin:_C,children:[l.jsxs("defs",{children:[A("colorP50",Zn.p50),A("colorP95",Zn.p95),A("colorP99",Zn.p99)]}),l.jsx(Si,{strokeDasharray:"3 3"}),l.jsx(In,{dataKey:"command",...CC}),l.jsx(Rn,{label:{value:"Execution Latency",...EC},tickFormatter:M=>N(M)}),l.jsx(mn,{formatter:M=>M!=null?N(M):"",labelFormatter:M=>`Command: ${M}`}),l.jsx(Nh,{}),l.jsx(Dn,{type:"monotone",dataKey:"p99",stroke:Zn.p99,strokeWidth:2,fill:"url(#colorP99)",name:"99th Percentile"}),l.jsx(Dn,{type:"monotone",dataKey:"p95",stroke:Zn.p95,strokeWidth:2,fill:"url(#colorP95)",name:"95th Percentile"}),l.jsx(Dn,{type:"monotone",dataKey:"p50",stroke:Zn.p50,strokeWidth:2,fill:"url(#colorP50)",name:"50th Percentile (Median)"})]})}):l.jsx("div",{className:"text-center text-muted-foreground py-8",children:"No command data available"})})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"Percentile Comparison by Command"})}),l.jsx(ce,{children:k.length>0?l.jsx(hn,{width:"100%",height:Tf.md,children:l.jsxs(tm,{data:k,layout:"horizontal",margin:_C,children:[l.jsx(Si,{strokeDasharray:"3 3"}),l.jsx(In,{dataKey:"command",...CC}),l.jsx(Rn,{label:{value:"Execution Latency",...EC},tickFormatter:M=>N(M)}),l.jsx(mn,{formatter:M=>M!=null?N(M):"",labelFormatter:M=>`Command: ${M}`}),l.jsx(Nh,{}),l.jsx(Qo,{dataKey:"p50",fill:Zn.p50,name:"50th Percentile (Median)"}),l.jsx(Qo,{dataKey:"p95",fill:Zn.p95,name:"95th Percentile"}),l.jsx(Qo,{dataKey:"p99",fill:Zn.p99,name:"99th Percentile"})]})}):l.jsx("div",{className:"text-center text-muted-foreground py-8",children:"No command data available"})})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"Data Table - Exact Values"})}),l.jsx(ce,{children:k.length>0?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"text-sm text-muted-foreground mb-4",children:"Click a command to see detailed latency distribution"}),l.jsxs(Ai,{children:[l.jsx(Ti,{children:l.jsxs(bt,{children:[l.jsx(Me,{children:"Command"}),l.jsx(Me,{className:"text-right",children:"Calls"}),l.jsx(Me,{className:"text-right",children:"P50"}),l.jsx(Me,{className:"text-right",children:"P95"}),l.jsx(Me,{className:"text-right",children:"P99"})]})}),l.jsx(Mi,{children:k.map(M=>l.jsxs(bt,{onClick:()=>i(M.command),className:`cursor-pointer ${n===M.command?"bg-muted":""}`,children:[l.jsx(Oe,{className:"font-medium",children:M.command}),l.jsx(Oe,{className:"text-right",children:M.calls.toLocaleString()}),l.jsx(Oe,{className:"text-right font-mono",children:N(M.p50)}),l.jsx(Oe,{className:"text-right font-mono",children:N(M.p95)}),l.jsx(Oe,{className:"text-right font-mono",children:N(M.p99)})]},M.command))})]})]}):l.jsx("div",{className:"text-center text-muted-foreground py-8",children:"No command data available"})})]}),n&&C&&l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsxs(he,{children:["Latency Distribution: ",n]})}),l.jsxs(ce,{children:[l.jsx(hn,{width:"100%",height:Tf.sm,children:l.jsxs(tm,{data:T,children:[l.jsx(Si,{strokeDasharray:"3 3"}),l.jsx(In,{dataKey:"latency",label:{value:"Latency (µs)",position:"insideBottom",offset:-5},tickFormatter:M=>N(M)}),l.jsx(Rn,{label:{value:"Cumulative Count",angle:-90,position:"insideLeft"}}),l.jsx(mn,{formatter:(M,z)=>M==null?["",""]:z==="count"?[M.toLocaleString(),"Operations"]:[M,z],labelFormatter:M=>`≤ ${N(M)}`}),l.jsx(Qo,{dataKey:"count",fill:Zn.p95})]})}),l.jsxs("div",{className:"text-sm text-muted-foreground mt-4",children:["Total calls: ",C.calls.toLocaleString()]})]})]})]})}function hie({clients:e}){const t=i=>i<60?`${i}s`:i<3600?`${Math.floor(i/60)}m`:`${Math.floor(i/3600)}h`,r=i=>{if(!i.addr)return null;const a=i.addr.split(":")[0];return`/audit?ip=${encodeURIComponent(a)}`},n=i=>{const a=new URLSearchParams;return i.name?a.set("client",i.name):i.addr&&a.set("client",i.addr),`/slowlog?${a.toString()}`};return l.jsxs(l.Fragment,{children:[l.jsx(MO,{id:"audit-tooltip",style:{zIndex:9999}}),l.jsxs(Ai,{children:[l.jsx(Ti,{children:l.jsxs(bt,{children:[l.jsx(Me,{children:"ID"}),l.jsx(Me,{children:"Address"}),l.jsx(Me,{children:"Name"}),l.jsx(Me,{children:"Age"}),l.jsx(Me,{children:"Idle"}),l.jsx(Me,{children:"DB"}),l.jsx(Me,{children:"Last Cmd"}),l.jsx(Me,{children:"Flags"}),l.jsx(Me,{children:"Actions"})]})}),l.jsxs(Mi,{children:[e.map(i=>l.jsxs(bt,{children:[l.jsx(Oe,{className:"font-mono",children:i.id}),l.jsx(Oe,{className:"font-mono",children:i.addr}),l.jsx(Oe,{children:i.name||"-"}),l.jsx(Oe,{children:t(i.age)}),l.jsx(Oe,{children:t(i.idle)}),l.jsx(Oe,{children:i.db}),l.jsx(Oe,{className:"font-mono",children:i.cmd}),l.jsx(Oe,{children:l.jsx(Ve,{variant:"outline",children:i.flags})}),l.jsx(Oe,{children:l.jsxs("div",{className:"flex gap-1",children:[l.jsx(ll,{to:n(i),className:"text-xs px-2 py-1 bg-primary text-primary-foreground rounded hover:bg-primary/90",children:"Slow Log"}),r(i)&&l.jsx(ll,{to:r(i),className:"text-xs px-2 py-1 bg-muted rounded hover:bg-muted/80","data-tooltip-id":"audit-tooltip","data-tooltip-content":"Filter by IP address",children:"Audit"})]})})]},i.id)),e.length===0&&l.jsx(bt,{children:l.jsx(Oe,{colSpan:9,className:"text-center text-muted-foreground",children:"No connected clients"})})]})]})]})}function mie(){const{currentConnection:e}=Qr(),{data:t}=Ke({fetcher:ze.getClients,interval:1e4,refetchKey:e==null?void 0:e.id});return l.jsxs("div",{className:"space-y-6",children:[l.jsx("h1",{className:"text-3xl font-bold",children:"Connected Clients"}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsxs(he,{children:["Active Connections (",(t==null?void 0:t.length)??0,")"]})}),l.jsx(ce,{children:l.jsx(hie,{clients:t||[]})})]})]})}function If(e){return new Date(e*1e3).toLocaleString()}function pie(e){return e<60?`${e}s ago`:e<3600?`${Math.floor(e/60)}m ago`:e<86400?`${Math.floor(e/3600)}h ago`:`${Math.floor(e/86400)}d ago`}function vie(){const{currentConnection:e}=Qr(),[t,r]=M0(),[n,i]=y.useState(""),a=t.get("ip");y.useEffect(()=>{const g=t.get("user");g&&i(g)},[t]);const s=()=>{t.delete("ip"),r(t)},{data:u}=Ke({fetcher:()=>ze.getAuditStats(),interval:3e4,refetchKey:e==null?void 0:e.id}),{data:d}=Ke({fetcher:()=>ze.getAuditEntries({limit:100}),interval:1e4,refetchKey:e==null?void 0:e.id}),{data:f}=Ke({fetcher:()=>ze.getAuditFailedAuth(void 0,void 0,50),interval:1e4,refetchKey:e==null?void 0:e.id}),h=y.useMemo(()=>{let g=d||[];return n&&(g=g.filter(j=>j.username===n)),a&&(g=g.filter(j=>{var b,w;return((b=j.sourceHost)==null?void 0:b.includes(a))||((w=j.clientInfo)==null?void 0:w.includes(a))})),g},[d,n,a]),p=y.useMemo(()=>!f||!a?f:f.filter(g=>{var j;return(j=g.clientInfo)==null?void 0:j.includes(a)}),[f,a]),v=y.useMemo(()=>{const g=(u==null?void 0:u.entriesByUser)??{},j=new Set((d==null?void 0:d.map(w=>w.username))??[]),b=new Set([...Object.keys(g),...j]);return Array.from(b).sort().map(w=>({user:w,count:g[w]}))},[u==null?void 0:u.entriesByUser,d]);return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-3xl font-bold",children:"Audit Trail"}),a&&l.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 bg-muted rounded",children:[l.jsxs("span",{className:"text-sm",children:["Filtered by IP: ",l.jsx("span",{className:"font-mono",children:a})]}),l.jsx("button",{onClick:s,className:"text-xs px-2 py-0.5 bg-destructive text-destructive-foreground rounded hover:bg-destructive/90",children:"Clear"})]})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"Total Entries"})}),l.jsx(ce,{children:l.jsx("div",{className:"text-3xl font-bold",children:(u==null?void 0:u.totalEntries)??0})})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"Unique Users"})}),l.jsx(ce,{children:l.jsx("div",{className:"text-3xl font-bold",children:(u==null?void 0:u.uniqueUsers)??0})})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"Time Range"})}),l.jsx(ce,{children:u!=null&&u.timeRange?l.jsxs("div",{className:"text-sm",children:[l.jsxs("div",{children:["From: ",If(u.timeRange.earliest)]}),l.jsxs("div",{children:["To: ",If(u.timeRange.latest)]})]}):l.jsx("div",{className:"text-muted-foreground",children:"No data yet"})})]})]}),u&&Object.keys(u.entriesByReason).length>0&&l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"Entries by Reason"})}),l.jsx(ce,{children:l.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:Object.entries(u.entriesByReason).map(([g,j])=>l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-2xl font-bold",children:j}),l.jsx("div",{className:"text-sm text-muted-foreground",children:g})]},g))})})]}),p&&p.length>0&&l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsxs(he,{children:["Recent Authentication Events",a&&l.jsxs("span",{className:"text-sm font-normal text-muted-foreground ml-2",children:["(",p.length," from ",a,")"]})]})}),l.jsx(ce,{children:l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b",children:[l.jsx("th",{className:"text-left p-2",children:"Time"}),l.jsx("th",{className:"text-left p-2",children:"User"}),l.jsx("th",{className:"text-left p-2",children:"Reason"}),l.jsx("th",{className:"text-left p-2",children:"Object"}),l.jsx("th",{className:"text-left p-2",children:"Client"}),l.jsx("th",{className:"text-left p-2",children:"Count"})]})}),l.jsx("tbody",{children:p.slice(0,10).map(g=>l.jsxs("tr",{className:"border-b hover:bg-muted",children:[l.jsx("td",{className:"p-2",children:If(g.capturedAt)}),l.jsx("td",{className:"p-2 font-mono",children:g.username}),l.jsx("td",{className:"p-2",children:g.reason}),l.jsx("td",{className:"p-2 font-mono text-xs",children:g.object}),l.jsx("td",{className:"p-2 font-mono text-xs",children:g.clientInfo}),l.jsx("td",{className:"p-2",children:g.count})]},g.id))})]})})})]}),l.jsxs(ae,{children:[l.jsxs(fe,{children:[l.jsx(he,{children:"All Audit Entries"}),v.length>0&&l.jsx("div",{className:"mt-2",children:l.jsxs("select",{className:"border rounded px-2 py-1 text-sm",value:n,onChange:g=>i(g.target.value),children:[l.jsx("option",{value:"",children:"All Users"}),v.map(({user:g,count:j})=>l.jsxs("option",{value:g,children:[g,j!==void 0?` (${j})`:""]},g))]})})]}),l.jsx(ce,{children:h&&h.length>0?l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b",children:[l.jsx("th",{className:"text-left p-2",children:"Captured"}),l.jsx("th",{className:"text-left p-2",children:"User"}),l.jsx("th",{className:"text-left p-2",children:"Reason"}),l.jsx("th",{className:"text-left p-2",children:"Context"}),l.jsx("th",{className:"text-left p-2",children:"Object"}),l.jsx("th",{className:"text-left p-2",children:"Client"}),l.jsx("th",{className:"text-left p-2",children:"Source"}),l.jsx("th",{className:"text-left p-2",children:"Count"})]})}),l.jsx("tbody",{children:h.map(g=>l.jsxs("tr",{className:"border-b hover:bg-muted",children:[l.jsxs("td",{className:"p-2",children:[l.jsx("div",{children:If(g.capturedAt)}),l.jsx("div",{className:"text-xs text-muted-foreground",children:pie(g.ageSeconds)})]}),l.jsx("td",{className:"p-2 font-mono",children:g.username}),l.jsx("td",{className:"p-2",children:l.jsx("span",{className:`px-2 py-1 rounded text-xs ${g.reason==="auth"?"bg-blue-100 text-blue-700 dark:bg-blue-900 dark:text-blue-300":g.reason==="command"?"bg-destructive/10 text-destructive":"bg-muted"}`,children:g.reason})}),l.jsx("td",{className:"p-2 font-mono text-xs",children:g.context}),l.jsx("td",{className:"p-2 font-mono text-xs",children:g.object}),l.jsx("td",{className:"p-2 font-mono text-xs",children:g.clientInfo}),l.jsxs("td",{className:"p-2 font-mono text-xs",children:[g.sourceHost,":",g.sourcePort]}),l.jsx("td",{className:"p-2",children:g.count})]},g.id))})]})}):l.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No audit entries found. The audit trail will populate as ACL events occur."})})]})]})}const Vf={getSettings:()=>ye("/settings"),updateSettings:e=>ye("/settings",{method:"PUT",body:JSON.stringify(e)}),resetSettings:()=>ye("/settings/reset",{method:"POST"})};function gie(e){return new Date(e).toLocaleString()}function Rf(e){return new Date(e).toLocaleTimeString()}function yie(e){const t=Date.now();switch(e){case"1h":return{start:t-36e5,end:t,bucket:6e4};case"6h":return{start:t-6*36e5,end:t,bucket:3e5};case"24h":return{start:t-24*36e5,end:t,bucket:9e5};case"7d":return{start:t-168*36e5,end:t,bucket:36e5};default:return{start:t-36e5,end:t,bucket:6e4}}}function xie(){const{currentConnection:e}=Qr(),[t]=M0(),[r,n]=y.useState("1h"),[i,a]=y.useState(null);y.useEffect(()=>{const E=t.get("name"),k=t.get("user"),C=t.get("addr");(E||k||C)&&a({...E&&{name:E},...k&&{user:k},...C&&{addr:C}})},[t]);const{start:s,end:u,bucket:d}=yie(r),{data:f}=Ke({fetcher:()=>Vf.getSettings(),interval:3e4,refetchKey:e==null?void 0:e.id}),h=(f==null?void 0:f.settings.clientAnalyticsPollIntervalMs)||1e4,{data:p,loading:v}=Ke({fetcher:()=>ze.getClientAnalyticsStats(s,u),interval:h,refetchKey:e==null?void 0:e.id}),{data:g}=Ke({fetcher:()=>ze.getClientTimeSeries(s,u,d),interval:h,refetchKey:e==null?void 0:e.id}),{data:j,loading:b}=Ke({fetcher:i?()=>ze.getClientConnectionHistory(i,s,u):()=>Promise.resolve([]),interval:h,enabled:!!i,refetchKey:e==null?void 0:e.id}),w=y.useMemo(()=>g?g.map(E=>({time:Rf(E.timestamp),connections:E.totalConnections})):[],[g]),N=y.useMemo(()=>p!=null&&p.connectionsByName?Object.entries(p.connectionsByName).map(([E,k])=>({name:E,...k})).sort((E,k)=>k.peak-E.peak).slice(0,10):[],[p==null?void 0:p.connectionsByName]),P=y.useMemo(()=>p!=null&&p.connectionsByUserAndName?Object.values(p.connectionsByUserAndName).sort((E,k)=>k.peak-E.peak).slice(0,20):[],[p==null?void 0:p.connectionsByUserAndName]);return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsx("h1",{className:"text-3xl font-bold",children:"Client Analytics"}),l.jsx("div",{className:"flex gap-2",children:["1h","6h","24h","7d"].map(E=>l.jsx("button",{onClick:()=>n(E),className:`px-3 py-1 rounded text-sm ${r===E?"bg-primary text-primary-foreground":"bg-muted hover:bg-muted/80"}`,children:E.toUpperCase()},E))})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-6 gap-4",children:[l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-sm",children:"Current Connections"})}),l.jsx(ce,{children:l.jsx("div",{className:"text-2xl font-bold",children:(p==null?void 0:p.currentConnections)??0})})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-sm",children:"Peak Connections"})}),l.jsxs(ce,{children:[l.jsx("div",{className:"text-2xl font-bold",children:(p==null?void 0:p.peakConnections)??0}),(p==null?void 0:p.peakTimestamp)&&l.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:Rf(p.peakTimestamp)})]})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-sm",children:"Unique Clients"})}),l.jsx(ce,{children:l.jsx("div",{className:"text-2xl font-bold",children:(p==null?void 0:p.uniqueClientNames)??0})})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-sm",children:"Unique Users"})}),l.jsx(ce,{children:l.jsx("div",{className:"text-2xl font-bold",children:(p==null?void 0:p.uniqueUsers)??0})})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-sm",children:"Unique IPs"})}),l.jsx(ce,{children:l.jsx("div",{className:"text-2xl font-bold",children:(p==null?void 0:p.uniqueIps)??0})})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-sm",children:"Time Range"})}),l.jsx(ce,{children:p!=null&&p.timeRange?l.jsxs("div",{className:"text-xs",children:[l.jsx("div",{className:"font-mono",children:Rf(p.timeRange.earliest)}),l.jsx("div",{className:"text-muted-foreground",children:"to"}),l.jsx("div",{className:"font-mono",children:Rf(p.timeRange.latest)})]}):l.jsx("div",{className:"text-sm text-muted-foreground",children:"No data"})})]})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"Connection Time Series"})}),l.jsx(ce,{children:w.length>0?l.jsx(hn,{width:"100%",height:300,children:l.jsxs(Vu,{data:w,children:[l.jsx(Si,{strokeDasharray:"3 3"}),l.jsx(In,{dataKey:"time"}),l.jsx(Rn,{}),l.jsx(mn,{}),l.jsx(Dn,{type:"monotone",dataKey:"connections",stroke:"hsl(var(--primary))",fill:"hsl(var(--primary))",fillOpacity:.3})]})}):l.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No time series data available. Data will populate as client snapshots are captured."})})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"Top Clients by Peak Connections"})}),l.jsx(ce,{children:v?l.jsx("div",{className:"text-center py-12",children:l.jsx("div",{className:"inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-current border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]",role:"status",children:l.jsx("span",{className:"!absolute !-m-px !h-px !w-px !overflow-hidden !whitespace-nowrap !border-0 !p-0 ![clip:rect(0,0,0,0)]",children:"Loading..."})})}):N.length>0?l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b",children:[l.jsx("th",{className:"text-left p-2",children:"Client Name"}),l.jsx("th",{className:"text-left p-2",children:"Current"}),l.jsx("th",{className:"text-left p-2",children:"Peak"}),l.jsx("th",{className:"text-left p-2",children:"Avg Age (s)"}),l.jsx("th",{className:"text-left p-2",children:"Actions"})]})}),l.jsx("tbody",{children:N.map(E=>l.jsxs("tr",{className:"border-b hover:bg-muted",children:[l.jsx("td",{className:"p-2 font-mono",children:E.name||"(unnamed)"}),l.jsx("td",{className:"p-2",children:E.current}),l.jsx("td",{className:"p-2 font-bold",children:E.peak}),l.jsx("td",{className:"p-2",children:Math.round(E.avgAge)}),l.jsx("td",{className:"p-2",children:l.jsx("button",{onClick:()=>a({name:E.name}),className:"text-xs px-2 py-1 bg-primary text-primary-foreground rounded hover:bg-primary/90",children:"View History"})})]},E.name))})]})}):l.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No client data available yet."})})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"Connections by User + Client Name"})}),l.jsx(ce,{children:v?l.jsx("div",{className:"text-center py-12",children:l.jsx("div",{className:"inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-current border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]",role:"status",children:l.jsx("span",{className:"!absolute !-m-px !h-px !w-px !overflow-hidden !whitespace-nowrap !border-0 !p-0 ![clip:rect(0,0,0,0)]",children:"Loading..."})})}):P.length>0?l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b",children:[l.jsx("th",{className:"text-left p-2",children:"User"}),l.jsx("th",{className:"text-left p-2",children:"Client Name"}),l.jsx("th",{className:"text-left p-2",children:"Current"}),l.jsx("th",{className:"text-left p-2",children:"Peak"}),l.jsx("th",{className:"text-left p-2",children:"Avg Age (s)"}),l.jsx("th",{className:"text-left p-2",children:"Actions"})]})}),l.jsx("tbody",{children:P.map(E=>l.jsxs("tr",{className:"border-b hover:bg-muted",children:[l.jsx("td",{className:"p-2 font-mono",children:E.user}),l.jsx("td",{className:"p-2 font-mono",children:E.name||"(unnamed)"}),l.jsx("td",{className:"p-2",children:E.current}),l.jsx("td",{className:"p-2 font-bold",children:E.peak}),l.jsx("td",{className:"p-2",children:Math.round(E.avgAge)}),l.jsx("td",{className:"p-2",children:l.jsx("button",{onClick:()=>a({user:E.user,name:E.name}),className:"text-xs px-2 py-1 bg-primary text-primary-foreground rounded hover:bg-primary/90",children:"View History"})})]},`${E.user}:${E.name}`))})]})}):l.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No connection data available yet."})})]}),i&&l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsxs(he,{children:["Connection History",i.name&&` - Client: ${i.name}`,i.user&&` - User: ${i.user}`,i.addr&&` - Address: ${i.addr}`]}),l.jsx("button",{onClick:()=>a(null),className:"text-xs px-2 py-1 bg-muted rounded hover:bg-muted/80",children:"Close"})]})}),l.jsx(ce,{children:b?l.jsx("div",{className:"text-center py-12",children:l.jsx("div",{className:"inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-current border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]",role:"status",children:l.jsx("span",{className:"!absolute !-m-px !h-px !w-px !overflow-hidden !whitespace-nowrap !border-0 !p-0 ![clip:rect(0,0,0,0)]",children:"Loading..."})})}):j&&j.length>0?l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b",children:[l.jsx("th",{className:"text-left p-2",children:"Captured At"}),l.jsx("th",{className:"text-left p-2",children:"Client ID"}),l.jsx("th",{className:"text-left p-2",children:"Address"}),l.jsx("th",{className:"text-left p-2",children:"Name"}),l.jsx("th",{className:"text-left p-2",children:"User"}),l.jsx("th",{className:"text-left p-2",children:"DB"}),l.jsx("th",{className:"text-left p-2",children:"Cmd"}),l.jsx("th",{className:"text-left p-2",children:"Age"}),l.jsx("th",{className:"text-left p-2",children:"Idle"}),l.jsx("th",{className:"text-left p-2",children:"Flags"})]})}),l.jsx("tbody",{children:j.map(E=>l.jsxs("tr",{className:"border-b hover:bg-muted",children:[l.jsx("td",{className:"p-2",children:gie(E.capturedAt)}),l.jsx("td",{className:"p-2 font-mono text-xs",children:E.clientId}),l.jsx("td",{className:"p-2 font-mono text-xs",children:E.addr}),l.jsx("td",{className:"p-2 font-mono",children:E.name||"-"}),l.jsx("td",{className:"p-2 font-mono",children:E.user}),l.jsx("td",{className:"p-2",children:E.db}),l.jsx("td",{className:"p-2 font-mono text-xs",children:E.cmd||"-"}),l.jsxs("td",{className:"p-2",children:[E.age,"s"]}),l.jsxs("td",{className:"p-2",children:[E.idle,"s"]}),l.jsx("td",{className:"p-2 font-mono text-xs",children:E.flags})]},E.id))})]})}):l.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No connection history found for this filter."})})]})]})}var rt=(e=>(e.community="community",e.pro="pro",e.enterprise="enterprise",e))(rt||{}),hu=(e=>(e.KEY_ANALYTICS="keyAnalytics",e.ANOMALY_DETECTION="anomalyDetection",e.ALERTING="alerting",e.WORKSPACES="workspaces",e.MULTI_INSTANCE="multiInstance",e.WEBHOOK_OPERATIONAL_EVENTS="webhookOperationalEvents",e.WEBHOOK_CUSTOM_HEADERS="webhookCustomHeaders",e.WEBHOOK_DELIVERY_PAYLOAD="webhookDeliveryPayload",e.WEBHOOK_CONFIGURABLE_RETRY="webhookConfigurableRetry",e.SSO_SAML="ssoSaml",e.COMPLIANCE_EXPORT="complianceExport",e.RBAC="rbac",e.AI_CLOUD="aiCloud",e.WEBHOOK_COMPLIANCE_EVENTS="webhookComplianceEvents",e.WEBHOOK_DLQ="webhookDlq",e))(hu||{});Object.values(hu);var Ar=(e=>(e.INSTANCE_DOWN="instance.down",e.INSTANCE_UP="instance.up",e.MEMORY_CRITICAL="memory.critical",e.CONNECTION_CRITICAL="connection.critical",e.ANOMALY_DETECTED="anomaly.detected",e.SLOWLOG_THRESHOLD="slowlog.threshold",e.LATENCY_SPIKE="latency.spike",e.CONNECTION_SPIKE="connection.spike",e.CLIENT_BLOCKED="client.blocked",e.ACL_VIOLATION="acl.violation",e.ACL_MODIFIED="acl.modified",e.CONFIG_CHANGED="config.changed",e.REPLICATION_LAG="replication.lag",e.CLUSTER_FAILOVER="cluster.failover",e.AUDIT_POLICY_VIOLATION="audit.policy.violation",e.COMPLIANCE_ALERT="compliance.alert",e))(Ar||{});const b0=["instance.down","instance.up","memory.critical","connection.critical","client.blocked"],w0=[...b0,"anomaly.detected","slowlog.threshold","replication.lag","cluster.failover","latency.spike","connection.spike"],bie=[...w0,"audit.policy.violation","compliance.alert","acl.violation","acl.modified","config.changed"],wie={"instance.down":rt.community,"instance.up":rt.community,"memory.critical":rt.community,"connection.critical":rt.community,"client.blocked":rt.community,"anomaly.detected":rt.pro,"slowlog.threshold":rt.pro,"replication.lag":rt.pro,"cluster.failover":rt.pro,"latency.spike":rt.pro,"connection.spike":rt.pro,"audit.policy.violation":rt.enterprise,"compliance.alert":rt.enterprise,"acl.violation":rt.enterprise,"acl.modified":rt.enterprise,"config.changed":rt.enterprise},OC={[rt.community]:0,[rt.pro]:1,[rt.enterprise]:2};function Zy(e,t){const r=wie[e];return OC[t]>=OC[r]}function jie(){return{[rt.community]:[...b0],[rt.pro]:w0.filter(e=>!b0.includes(e)),[rt.enterprise]:bie.filter(e=>!w0.includes(e))}}const Sie={"1h":36e5,"6h":6*36e5,"24h":24*36e5};function AC(e){return new Date(e).toLocaleTimeString()}function oo(e){if(e===0)return"0 B";const t=1024,r=["B","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(t));return`${(e/Math.pow(t,n)).toFixed(2)} ${r[n]}`}const TC=["hsl(var(--primary))","#8884d8","#82ca9d","#ffc658","#ff8042","#a4de6c","#d0ed57","#ffa07a"];function Nie(){var L,K,te,R;const{currentConnection:e}=Qr(),[t,r]=y.useState("1h"),[n,i]=y.useState("commands"),{hasFeature:a}=LO(),s=a(hu.ANOMALY_DETECTION),u=y.useMemo(()=>{const U=Date.now();return{start:U-Sie[t],end:U}},[t]),d=y.useCallback(()=>ze.getCommandDistribution({startTime:u.start,endTime:u.end}),[u]),f=y.useCallback(()=>ze.getIdleConnections({idleThresholdSeconds:300,minOccurrences:5}),[]),h=y.useCallback(()=>ze.getBufferAnomalies({startTime:u.start,endTime:u.end}),[u]),p=y.useCallback(()=>ze.getActivityTimeline({startTime:u.start,endTime:u.end,bucketSizeMinutes:5}),[u]),v=y.useCallback(()=>ze.detectSpikes({startTime:u.start,endTime:u.end}),[u]),{data:g,loading:j}=Ke({fetcher:p,interval:3e4,refetchKey:e==null?void 0:e.id}),{data:b}=Ke({fetcher:v,interval:6e4,refetchKey:e==null?void 0:e.id}),{data:w}=Ke({fetcher:()=>ze.getAnomalySummary(),interval:5e3,enabled:s,refetchKey:e==null?void 0:e.id}),{data:N,loading:P}=Ke({fetcher:d,interval:3e4,enabled:n==="commands",refetchKey:e==null?void 0:e.id}),{data:E,loading:k}=Ke({fetcher:f,interval:3e4,enabled:n==="idle",refetchKey:e==null?void 0:e.id}),{data:C,loading:T}=Ke({fetcher:h,interval:3e4,enabled:n==="anomalies",refetchKey:e==null?void 0:e.id}),A=y.useMemo(()=>{const U=(N==null?void 0:N.distribution.length)||0,F=(E==null?void 0:E.connections.length)||0,X=(C==null?void 0:C.anomalies.filter(W=>W.severity==="warning").length)||0,$=(C==null?void 0:C.anomalies.filter(W=>W.severity==="critical").length)||0,Y=(b==null?void 0:b.spikes.length)||0;return{activeClients:U,idleCount:F,bufferWarnings:X,bufferCritical:$,todaySpikes:Y}},[N,E,C,b]),M=y.useMemo(()=>{if(!(N!=null&&N.distribution))return[];const U={};return N.distribution.forEach(F=>{Object.entries(F.commands).forEach(([X,$])=>{U[X]=(U[X]||0)+$})}),Object.entries(U).map(([F,X])=>({name:F,value:X})).sort((F,X)=>X.value-F.value).slice(0,8)},[N]),z=y.useMemo(()=>g!=null&&g.buckets?g.buckets.map(U=>({time:AC(U.timestamp),timestamp:U.timestamp,connections:U.totalConnections,uniqueClients:U.uniqueClients,avgIdle:Math.round(U.avgIdleSeconds)})):[],[g]),V=y.useMemo(()=>b!=null&&b.spikes?b.spikes.filter(U=>U.metric==="connections").map(U=>U.timestamp):[],[b]);return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-3xl font-bold",children:"Client Analytics Deep Dive"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Advanced analytics and anomaly detection for client connections"})]}),l.jsx("div",{className:"flex gap-2",children:["1h","6h","24h"].map(U=>l.jsx("button",{onClick:()=>r(U),className:`px-3 py-1 rounded text-sm ${t===U?"bg-primary text-primary-foreground":"bg-muted hover:bg-muted/80"}`,children:U.toUpperCase()},U))})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-4",children:[l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-sm",children:"Active Clients"})}),l.jsxs(ce,{children:[l.jsx("div",{className:"text-2xl font-bold",children:A.activeClients}),l.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"With activity"})]})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-sm",children:"Idle Connections"})}),l.jsxs(ce,{children:[l.jsx("div",{className:"text-2xl font-bold",children:A.idleCount}),l.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:">5 min idle"})]})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-sm",children:"Buffer Warnings"})}),l.jsxs(ce,{children:[l.jsx("div",{className:"text-2xl font-bold text-yellow-600",children:A.bufferWarnings}),l.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Elevated buffers"})]})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-sm",children:"Critical Buffers"})}),l.jsxs(ce,{children:[l.jsx("div",{className:"text-2xl font-bold text-red-600",children:A.bufferCritical}),l.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Needs attention"})]})]}),l.jsxs(ae,{className:((L=w==null?void 0:w.bySeverity)==null?void 0:L.critical)>0?"border-red-500/50":((K=w==null?void 0:w.bySeverity)==null?void 0:K.warning)>0?"border-yellow-500/50":"",children:[l.jsx(fe,{children:l.jsx(he,{className:"text-sm",children:"Anomalies Detected"})}),l.jsxs(ce,{children:[l.jsx("div",{className:"text-2xl font-bold",children:(w==null?void 0:w.totalEvents)??0}),l.jsxs("div",{className:"flex gap-2 mt-1 text-xs",children:[((te=w==null?void 0:w.bySeverity)==null?void 0:te.critical)>0&&l.jsxs("span",{className:"text-red-500",children:[w.bySeverity.critical," critical"]}),((R=w==null?void 0:w.bySeverity)==null?void 0:R.warning)>0&&l.jsxs("span",{className:"text-yellow-500",children:[w.bySeverity.warning," warning"]})]}),l.jsx(ll,{to:"/anomalies",className:"text-xs text-primary hover:underline mt-2 inline-block",children:"View details →"})]})]})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"Activity Timeline"})}),l.jsx(ce,{children:j?l.jsx("div",{className:"h-64 flex items-center justify-center",children:l.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):z.length>0?l.jsx(hn,{width:"100%",height:300,children:l.jsxs(Vu,{data:z,children:[l.jsx(Si,{strokeDasharray:"3 3"}),l.jsx(In,{dataKey:"time"}),l.jsx(Rn,{}),l.jsx(mn,{}),V.map(U=>{const F=z.find(X=>X.timestamp===U);return F?l.jsx(AI,{x:F.time,stroke:"red",strokeDasharray:"3 3",label:{value:"Spike",position:"top",fill:"red",fontSize:10}},U):null}),l.jsx(Dn,{type:"monotone",dataKey:"connections",stroke:"hsl(var(--primary))",fill:"hsl(var(--primary))",fillOpacity:.3,name:"Total Connections"}),l.jsx(Dn,{type:"monotone",dataKey:"uniqueClients",stroke:"#82ca9d",fill:"#82ca9d",fillOpacity:.2,name:"Unique Clients"})]})}):l.jsx("div",{className:"h-64 flex items-center justify-center text-muted-foreground",children:"No timeline data available"})})]}),l.jsxs(Vw,{defaultValue:"commands",className:"w-full",onValueChange:i,children:[l.jsxs(mp,{className:"grid w-full grid-cols-3",children:[l.jsx(ni,{value:"commands",children:"Command Distribution"}),l.jsx(ni,{value:"idle",children:"Idle Connections"}),l.jsx(ni,{value:"anomalies",children:"Buffer Anomalies"})]}),l.jsx(ho,{value:"commands",className:"space-y-4",children:l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"Top Commands by Volume"})}),l.jsx(ce,{children:P?l.jsx("div",{className:"h-64 flex items-center justify-center",children:l.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):M.length>0?l.jsx(hn,{width:"100%",height:300,children:l.jsxs(gR,{children:[l.jsx(Mw,{data:M,cx:"50%",cy:"50%",labelLine:!1,label:({name:U,percent:F})=>`${U} (${((F||0)*100).toFixed(0)}%)`,outerRadius:100,fill:"hsl(var(--primary))",dataKey:"value",children:M.map((U,F)=>l.jsx(Ll,{fill:TC[F%TC.length]},`cell-${F}`))}),l.jsx(mn,{})]})}):l.jsx("div",{className:"h-64 flex items-center justify-center text-muted-foreground",children:"No command data available"})})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"Client Breakdown"})}),l.jsx(ce,{children:l.jsx("div",{className:"max-h-80 overflow-y-auto",children:P?l.jsx("div",{className:"h-64 flex items-center justify-center",children:l.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):N!=null&&N.distribution&&N.distribution.length>0?l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{className:"sticky top-0 bg-background",children:l.jsxs("tr",{className:"border-b",children:[l.jsx("th",{className:"text-left p-2",children:"Client"}),l.jsx("th",{className:"text-left p-2",children:"Top Command"}),l.jsx("th",{className:"text-right p-2",children:"Total"}),l.jsx("th",{className:"text-right p-2",children:"Activity %"})]})}),l.jsx("tbody",{children:N.distribution.slice(0,20).map(U=>l.jsxs("tr",{className:"border-b hover:bg-muted",children:[l.jsx("td",{className:"p-2 font-mono text-xs",children:U.identifier}),l.jsx("td",{className:"p-2",children:l.jsx(Ve,{variant:"outline",children:U.topCommand||"N/A"})}),l.jsx("td",{className:"p-2 text-right",children:U.totalCommands}),l.jsxs("td",{className:"p-2 text-right",children:[U.activityPercentage.toFixed(1),"%"]})]},U.identifier))})]}):l.jsx("div",{className:"h-64 flex items-center justify-center text-muted-foreground",children:"No client data available"})})})]})]})}),l.jsx(ho,{value:"idle",children:l.jsxs(ae,{children:[l.jsxs(fe,{children:[l.jsx(he,{children:"Idle Connections Analysis"}),(E==null?void 0:E.summary)&&l.jsx("p",{className:"text-sm text-muted-foreground",children:E.summary.potentialWastedResources})]}),l.jsx(ce,{children:k?l.jsx("div",{className:"h-64 flex items-center justify-center",children:l.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):E!=null&&E.connections&&E.connections.length>0?l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b",children:[l.jsx("th",{className:"text-left p-2",children:"Client"}),l.jsx("th",{className:"text-left p-2",children:"Address"}),l.jsx("th",{className:"text-left p-2",children:"User"}),l.jsx("th",{className:"text-right p-2",children:"Avg Idle"}),l.jsx("th",{className:"text-right p-2",children:"Max Idle"}),l.jsx("th",{className:"text-right p-2",children:"Occurrences"}),l.jsx("th",{className:"text-left p-2",children:"Recommendation"})]})}),l.jsx("tbody",{children:E.connections.map((U,F)=>l.jsxs("tr",{className:"border-b hover:bg-muted",children:[l.jsx("td",{className:"p-2 font-mono text-xs",children:U.identifier}),l.jsx("td",{className:"p-2 font-mono text-xs",children:U.addr}),l.jsx("td",{className:"p-2 font-mono text-xs",children:U.user}),l.jsxs("td",{className:"p-2 text-right",children:[Math.round(U.avgIdleSeconds),"s"]}),l.jsxs("td",{className:"p-2 text-right",children:[Math.round(U.maxIdleSeconds),"s"]}),l.jsx("td",{className:"p-2 text-right",children:U.occurrences}),l.jsx("td",{className:"p-2",children:l.jsx("span",{className:"text-xs text-muted-foreground",children:U.recommendation})})]},F))})]})}):l.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No idle connections detected"})})]})}),l.jsx(ho,{value:"anomalies",children:l.jsxs("div",{className:"space-y-4",children:[(C==null?void 0:C.stats)&&l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-6 gap-4",children:[l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-xs",children:"Avg Input Buffer"})}),l.jsx(ce,{children:l.jsx("div",{className:"text-sm font-bold",children:oo(C.stats.avgQbuf)})})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-xs",children:"Max Input Buffer"})}),l.jsx(ce,{children:l.jsx("div",{className:"text-sm font-bold",children:oo(C.stats.maxQbuf)})})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-xs",children:"P95 Input Buffer"})}),l.jsx(ce,{children:l.jsx("div",{className:"text-sm font-bold",children:oo(C.stats.p95Qbuf)})})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-xs",children:"Avg Output Buffer"})}),l.jsx(ce,{children:l.jsx("div",{className:"text-sm font-bold",children:oo(C.stats.avgOmem)})})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-xs",children:"Max Output Buffer"})}),l.jsx(ce,{children:l.jsx("div",{className:"text-sm font-bold",children:oo(C.stats.maxOmem)})})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-xs",children:"P95 Output Buffer"})}),l.jsx(ce,{children:l.jsx("div",{className:"text-sm font-bold",children:oo(C.stats.p95Omem)})})]})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"Buffer Anomalies Timeline"})}),l.jsx(ce,{children:T?l.jsx("div",{className:"h-64 flex items-center justify-center",children:l.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):C!=null&&C.anomalies&&C.anomalies.length>0?l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b",children:[l.jsx("th",{className:"text-left p-2",children:"Time"}),l.jsx("th",{className:"text-left p-2",children:"Client"}),l.jsx("th",{className:"text-left p-2",children:"Command"}),l.jsx("th",{className:"text-right p-2",children:"Input Buffer"}),l.jsx("th",{className:"text-right p-2",children:"Output Buffer"}),l.jsx("th",{className:"text-left p-2",children:"Severity"}),l.jsx("th",{className:"text-left p-2",children:"Recommendation"})]})}),l.jsx("tbody",{children:C.anomalies.slice(0,50).map((U,F)=>l.jsxs("tr",{className:"border-b hover:bg-muted",children:[l.jsx("td",{className:"p-2 text-xs",children:AC(U.timestamp)}),l.jsx("td",{className:"p-2 font-mono text-xs",children:U.identifier}),l.jsx("td",{className:"p-2",children:l.jsx(Ve,{variant:"outline",children:U.lastCommand})}),l.jsx("td",{className:"p-2 text-right",children:oo(U.qbuf)}),l.jsx("td",{className:"p-2 text-right",children:oo(U.omem)}),l.jsx("td",{className:"p-2",children:l.jsx(Ve,{variant:U.severity==="critical"?"destructive":"secondary",children:U.severity})}),l.jsx("td",{className:"p-2 text-xs text-muted-foreground",children:U.recommendation})]},F))})]})}):l.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No buffer anomalies detected"})})]})]})})]})]})}const Pie={chat:e=>ye("/ai/chat",{method:"POST",body:JSON.stringify(e)}),health:()=>ye("/ai/health")};function kie(){const{currentConnection:e}=Qr(),[t,r]=y.useState([]),[n,i]=y.useState(""),[a,s]=y.useState(!1),[u,d]=y.useState(null),f=y.useRef(null),h=y.useRef(null),p=()=>{var w;(w=f.current)==null||w.scrollIntoView({behavior:"smooth"})};y.useEffect(()=>{p()},[t]),y.useEffect(()=>{r([]),d(null)},[e==null?void 0:e.id]);const v=["How many clients are connected?","What's the current memory usage?","How many keys are in the database?","Show me server status","Analyze slowlog patterns","Show me the slowest commands","Run a latency diagnosis","Run a memory diagnosis","Show me ACL failures","Show client analytics"],g=async()=>{var N;if(!n.trim()||a)return;const w={id:`user-${Date.now()}`,role:"user",content:n.trim()};r(P=>[...P,w]),i(""),s(!0),d(null);try{const P=await Pie.chat({message:w.content,history:t}),E={id:`assistant-${Date.now()}`,role:"assistant",content:P.response};r(k=>[...k,E])}catch(P){d(P instanceof Error?P.message:"Failed to get response from AI helper"),console.error("Chat error:",P)}finally{s(!1),(N=h.current)==null||N.focus()}},j=w=>{w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),g())},b=w=>{var N;i(w),(N=h.current)==null||N.focus()};return l.jsxs("div",{className:"flex flex-col gap-4 w-full",style:{height:"calc(100vh - 4rem)"},children:[l.jsxs("div",{className:"flex items-center justify-between flex-shrink-0",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-3xl font-bold",children:"AI Helper"}),l.jsx("p",{className:"text-muted-foreground mt-1",children:"Ask questions about your Valkey/Redis metrics and configuration"})]}),l.jsx(hC,{className:"h-8 w-8 text-primary"})]}),l.jsxs("div",{className:"flex items-start gap-2 text-sm text-muted-foreground flex-shrink-0",children:[l.jsx(hC,{className:"h-4 w-4 mt-0.5 flex-shrink-0"}),l.jsx("p",{children:"Best for querying metrics, diagnostics, and server stats. General documentation questions may have limited results."})]}),l.jsxs(ae,{className:"flex-1 flex flex-col min-h-0",children:[l.jsxs(fe,{className:"border-b",children:[l.jsxs(he,{className:"text-lg flex items-center gap-2",children:[l.jsx(qte,{className:"h-5 w-5"}),"Chat"]}),l.jsx(tA,{children:"Powered by Qwen 2.5 7B via Ollama"})]}),l.jsxs(ce,{className:"flex-1 overflow-y-auto p-6 space-y-4",children:[t.length===0&&l.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center space-y-6",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("h3",{className:"text-lg font-semibold",children:"Start a conversation"}),l.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:"Ask me anything about your database metrics, performance, connections, or configuration."})]}),l.jsxs("div",{className:"space-y-2 w-full max-w-md",children:[l.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"Suggested questions:"}),l.jsx("div",{className:"grid gap-2",children:v.map((w,N)=>l.jsx("button",{onClick:()=>b(w),className:"text-left px-4 py-2 text-sm border rounded-md hover:bg-muted transition-colors",children:w},N))})]})]}),t.map(w=>l.jsx("div",{className:`flex ${w.role==="user"?"justify-end":"justify-start"}`,children:l.jsxs("div",{className:`max-w-[80%] rounded-lg px-4 py-2 ${w.role==="user"?"bg-primary text-primary-foreground":"bg-muted"}`,children:[l.jsx("div",{className:"text-sm font-medium mb-1",children:w.role==="user"?"You":"Helper"}),l.jsx("div",{className:"text-sm whitespace-pre-wrap break-words",children:w.content})]})},w.id)),a&&l.jsx("div",{className:"flex justify-start",children:l.jsx("div",{className:"bg-muted rounded-lg px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(fC,{className:"h-4 w-4 animate-spin"}),l.jsx("span",{className:"text-sm",children:"Thinking..."})]})})}),u&&l.jsx("div",{className:"flex justify-center",children:l.jsx("div",{className:"bg-destructive/10 text-destructive rounded-lg px-4 py-2 text-sm",children:u})}),l.jsx("div",{ref:f})]}),l.jsxs("div",{className:"border-t p-4",children:[l.jsxs("div",{className:"flex gap-2",children:[l.jsx("textarea",{ref:h,value:n,onChange:w=>i(w.target.value),onKeyDown:j,placeholder:"Ask a question... (Shift+Enter for new line)",className:"flex-1 min-h-[60px] max-h-[120px] px-3 py-2 text-sm border rounded-md bg-background resize-none focus:outline-none focus:ring-2 focus:ring-primary",disabled:a}),l.jsxs("button",{onClick:g,disabled:a||!n.trim(),className:"px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center gap-2",children:[a?l.jsx(fC,{className:"h-4 w-4 animate-spin"}):l.jsx(Xte,{className:"h-4 w-4"}),"Send"]})]}),l.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["Type ",l.jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px]",children:"help"})," to see example questions · Press Enter to send, Shift+Enter for new line"]})]})]})]})}const MC={critical:{color:"text-red-500",bg:"bg-red-500/10",border:"border-red-500",icon:fp},warning:{color:"text-yellow-500",bg:"bg-yellow-500/10",border:"border-yellow-500",icon:gs},info:{color:"text-blue-500",bg:"bg-blue-500/10",border:"border-blue-500",icon:ns}},IC={traffic_burst:{icon:jR,label:"Traffic Burst",color:"#3b82f6"},batch_job:{icon:qc,label:"Batch Job",color:"#8b5cf6"},memory_pressure:{icon:zte,label:"Memory Pressure",color:"#ef4444"},slow_queries:{icon:bR,label:"Slow Queries",color:"#f59e0b"},auth_attack:{icon:Jte,label:"Auth Anomaly",color:"#dc2626"},connection_leak:{icon:SR,label:"Connection Leak",color:"#f97316"},cache_thrashing:{icon:sre,label:"Cache Thrashing",color:"#eab308"},unknown:{icon:uu,label:"Unknown",color:"#6b7280"}},Jy={connections:"Connections",ops_per_sec:"Ops/sec",memory_used:"Memory",input_kbps:"Input KB/s",output_kbps:"Output KB/s",slowlog_count:"Slow Queries",acl_denied:"ACL Denied",evicted_keys:"Evictions",blocked_clients:"Blocked",keyspace_misses:"Cache Misses",fragmentation_ratio:"Fragmentation"};function ex(e){return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Dc(e,t){return t==="memory_used"?e>1e9?`${(e/1e9).toFixed(2)} GB`:e>1e6?`${(e/1e6).toFixed(1)} MB`:`${(e/1e3).toFixed(0)} KB`:t==="fragmentation_ratio"?e.toFixed(2):e>1e6?`${(e/1e6).toFixed(1)}M`:e>1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function _ie(){var j,b,w,N;const{currentConnection:e}=Qr(),[t,r]=y.useState("1h"),[n,i]=y.useState(new Set),a={"1h":36e5,"6h":216e5,"24h":864e5}[t],s=Date.now()-a,{data:u}=Ke({fetcher:()=>ze.getAnomalySummary(),interval:5e3,refetchKey:e==null?void 0:e.id}),{data:d}=Ke({fetcher:()=>ze.getAnomalyEvents({startTime:s}),interval:5e3,refetchKey:e==null?void 0:e.id}),{data:f}=Ke({fetcher:()=>ze.getAnomalyGroups({startTime:s}),interval:5e3,refetchKey:e==null?void 0:e.id}),{data:h}=Ke({fetcher:()=>ze.getAnomalyBuffers(),interval:1e4,refetchKey:e==null?void 0:e.id}),p=P=>{i(E=>{const k=new Set(E);return k.has(P)?k.delete(P):k.add(P),k})},v=y.useMemo(()=>{if(!(d!=null&&d.length))return[];const P=a/60,E={};for(const k of d){const C=Math.floor(k.timestamp/P)*P;E[C]||(E[C]={critical:0,warning:0,info:0}),E[C][k.severity]++}return Object.entries(E).map(([k,C])=>({time:ex(parseInt(k)),...C})).sort((k,C)=>k.time.localeCompare(C.time))},[d,a]),g=y.useMemo(()=>u!=null&&u.byMetric?Object.entries(u.byMetric).map(([P,E])=>({metric:Jy[P]||P,count:E})).sort((P,E)=>E.count-P.count).slice(0,8):[],[u]);return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-3xl font-bold",children:"Anomaly Detection"}),l.jsx("p",{className:"text-muted-foreground",children:"Real-time monitoring across all metrics"})]}),l.jsx("div",{className:"flex gap-2",children:["1h","6h","24h"].map(P=>l.jsx("button",{onClick:()=>r(P),className:`px-3 py-1.5 rounded text-sm font-medium transition-colors ${t===P?"bg-primary text-primary-foreground":"bg-muted hover:bg-muted/80"}`,children:P.toUpperCase()},P))})]}),l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[l.jsxs(ae,{children:[l.jsx(fe,{className:"pb-2",children:l.jsx(he,{className:"text-sm font-medium text-muted-foreground",children:"Total Anomalies"})}),l.jsxs(ce,{children:[l.jsx("div",{className:"text-3xl font-bold",children:(u==null?void 0:u.totalEvents)??0}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"in selected time range"})]})]}),l.jsxs(ae,{className:(j=u==null?void 0:u.bySeverity)!=null&&j.critical?"border-red-500/50":"",children:[l.jsx(fe,{className:"pb-2",children:l.jsxs(he,{className:"text-sm font-medium text-muted-foreground flex items-center gap-2",children:[l.jsx(fp,{className:"w-4 h-4 text-red-500"}),"Critical"]})}),l.jsxs(ce,{children:[l.jsx("div",{className:"text-3xl font-bold text-red-500",children:((b=u==null?void 0:u.bySeverity)==null?void 0:b.critical)??0}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"require attention"})]})]}),l.jsxs(ae,{className:(w=u==null?void 0:u.bySeverity)!=null&&w.warning?"border-yellow-500/50":"",children:[l.jsx(fe,{className:"pb-2",children:l.jsxs(he,{className:"text-sm font-medium text-muted-foreground flex items-center gap-2",children:[l.jsx(gs,{className:"w-4 h-4 text-yellow-500"}),"Warnings"]})}),l.jsxs(ce,{children:[l.jsx("div",{className:"text-3xl font-bold text-yellow-500",children:((N=u==null?void 0:u.bySeverity)==null?void 0:N.warning)??0}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"above normal"})]})]}),l.jsxs(ae,{children:[l.jsx(fe,{className:"pb-2",children:l.jsxs(he,{className:"text-sm font-medium text-muted-foreground flex items-center gap-2",children:[l.jsx(uu,{className:"w-4 h-4"}),"Correlated Events"]})}),l.jsxs(ce,{children:[l.jsx("div",{className:"text-3xl font-bold",children:(u==null?void 0:u.totalGroups)??0}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"pattern groups"})]})]})]}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-lg",children:"Anomaly Timeline"})}),l.jsx(ce,{children:v.length>0?l.jsx(hn,{width:"100%",height:200,children:l.jsxs(Vu,{data:v,children:[l.jsx(Si,{strokeDasharray:"3 3",className:"stroke-muted"}),l.jsx(In,{dataKey:"time",tick:{fontSize:10}}),l.jsx(Rn,{tick:{fontSize:10}}),l.jsx(mn,{}),l.jsx(Dn,{type:"monotone",dataKey:"critical",stackId:"1",stroke:"#ef4444",fill:"#ef4444",fillOpacity:.6}),l.jsx(Dn,{type:"monotone",dataKey:"warning",stackId:"1",stroke:"#eab308",fill:"#eab308",fillOpacity:.6}),l.jsx(Dn,{type:"monotone",dataKey:"info",stackId:"1",stroke:"#3b82f6",fill:"#3b82f6",fillOpacity:.6})]})}):l.jsx("div",{className:"h-[200px] flex items-center justify-center text-muted-foreground",children:"No anomalies detected in time range"})})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-lg",children:"By Metric Type"})}),l.jsx(ce,{children:g.length>0?l.jsx(hn,{width:"100%",height:200,children:l.jsxs(tm,{data:g,layout:"vertical",children:[l.jsx(Si,{strokeDasharray:"3 3",className:"stroke-muted"}),l.jsx(In,{type:"number",tick:{fontSize:10}}),l.jsx(Rn,{type:"category",dataKey:"metric",tick:{fontSize:10},width:80}),l.jsx(mn,{}),l.jsx(Qo,{dataKey:"count",fill:"hsl(var(--primary))",radius:[0,4,4,0]})]})}):l.jsx("div",{className:"h-[200px] flex items-center justify-center text-muted-foreground",children:"No metric data available"})})]})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-lg",children:"Correlated Events & Diagnoses"})}),l.jsx(ce,{className:"space-y-4",children:f!=null&&f.length?f.map(P=>{const E=n.has(P.correlationId),k=MC[P.severity],C=IC[P.pattern]||IC.unknown,T=C.icon;return l.jsxs("div",{className:`border rounded-lg overflow-hidden ${k.border}`,children:[l.jsx("div",{className:`p-4 cursor-pointer hover:bg-muted/50 transition-colors ${k.bg}`,onClick:()=>p(P.correlationId),children:l.jsxs("div",{className:"flex items-start justify-between",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:`p-2 rounded-lg ${k.bg}`,children:l.jsx(T,{className:`w-5 h-5 ${k.color}`})}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("h3",{className:"font-semibold",children:C.label}),l.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${k.bg} ${k.color}`,children:P.severity.toUpperCase()})]}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:[ex(P.timestamp)," · ",P.anomalies.length," related anomalies"]})]})]}),l.jsx("div",{className:"flex items-center gap-2",children:E?l.jsx(dp,{className:"w-5 h-5"}):l.jsx(Uw,{className:"w-5 h-5"})})]})}),E&&l.jsxs("div",{className:"border-t p-4 space-y-4",children:[l.jsxs("div",{children:[l.jsx("h4",{className:"text-sm font-semibold mb-2",children:"Diagnosis"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:P.diagnosis})]}),l.jsxs("div",{children:[l.jsx("h4",{className:"text-sm font-semibold mb-2",children:"Affected Metrics"}),l.jsx("div",{className:"grid gap-2",children:P.anomalies.map(A=>l.jsxs("div",{className:"flex items-center justify-between p-2 bg-muted/30 rounded text-sm",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[A.anomalyType==="spike"?l.jsx(jR,{className:"w-4 h-4 text-red-500"}):l.jsx(rre,{className:"w-4 h-4 text-blue-500"}),l.jsx("span",{className:"font-medium",children:Jy[A.metricType]||A.metricType})]}),l.jsxs("div",{className:"flex items-center gap-4 text-muted-foreground",children:[l.jsxs("span",{children:[Dc(A.value,A.metricType),l.jsxs("span",{className:"text-xs ml-1",children:["(",A.zScore>0?"+":"",A.zScore.toFixed(1),"σ)"]})]}),l.jsxs("span",{className:"text-xs",children:["baseline: ",Dc(A.baseline,A.metricType)]})]})]},A.id))})]}),l.jsxs("div",{children:[l.jsx("h4",{className:"text-sm font-semibold mb-2",children:"Recommendations"}),l.jsx("ul",{className:"space-y-1",children:P.recommendations.map((A,M)=>l.jsxs("li",{className:"flex items-start gap-2 text-sm",children:[l.jsx("span",{className:"text-primary mt-0.5",children:"•"}),l.jsx("span",{className:"text-muted-foreground",children:A})]},M))})]})]})]},P.correlationId)}):l.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[l.jsx(uu,{className:"w-12 h-12 mx-auto mb-3 opacity-50"}),l.jsx("p",{children:"No correlated anomalies detected"}),l.jsx("p",{className:"text-sm",children:"Events will appear here when patterns are identified"})]})})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-lg",children:"Recent Anomaly Events"})}),l.jsx(ce,{children:d!=null&&d.length?l.jsx("div",{className:"space-y-2 max-h-[400px] overflow-y-auto",children:d.slice(0,50).map(P=>{const E=MC[P.severity],k=E.icon;return l.jsxs("div",{className:`flex items-center justify-between p-3 rounded-lg border ${E.border} ${E.bg}`,children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(k,{className:`w-4 h-4 ${E.color}`}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium",children:P.message}),l.jsx("p",{className:"text-xs text-muted-foreground",children:ex(P.timestamp)})]})]}),l.jsxs("div",{className:"text-right",children:[l.jsx("p",{className:"text-sm font-mono",children:Dc(P.value,P.metricType)}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:[P.zScore>0?"+":"",P.zScore.toFixed(1),"σ from baseline"]})]})]},P.id)})}):l.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[l.jsx(ns,{className:"w-12 h-12 mx-auto mb-3 opacity-50"}),l.jsx("p",{children:"No anomalies detected"}),l.jsx("p",{className:"text-sm",children:"System is operating within normal parameters"})]})})]}),h&&h.length>0&&l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-lg",children:"Metric Baselines (Debug)"})}),l.jsx(ce,{children:l.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4 text-sm",children:h.map(P=>l.jsxs("div",{className:"p-2 bg-muted/30 rounded",children:[l.jsx("p",{className:"font-medium truncate",children:Jy[P.metricType]||P.metricType}),l.jsxs("p",{className:"text-muted-foreground",children:["μ: ",Dc(P.mean,P.metricType)]}),l.jsxs("p",{className:"text-muted-foreground",children:["σ: ",Dc(P.stdDev,P.metricType)]}),l.jsx("p",{className:P.isReady?"text-green-500":"text-yellow-500",children:P.isReady?"● Ready":"○ Warming up"})]},P.metricType))})})]})]})}const tx={getSummary:(e,t)=>{const r=new URLSearchParams;e&&r.append("startTime",e.toString()),t&&r.append("endTime",t.toString());const n=r.toString();return ye(n?`/key-analytics/summary?${n}`:"/key-analytics/summary")},getPatterns:e=>{const t=new URLSearchParams;e!=null&&e.pattern&&t.append("pattern",e.pattern),e!=null&&e.startTime&&t.append("startTime",e.startTime.toString()),e!=null&&e.endTime&&t.append("endTime",e.endTime.toString()),e!=null&&e.limit&&t.append("limit",e.limit.toString());const r=t.toString();return ye(r?`/key-analytics/patterns?${r}`:"/key-analytics/patterns")},getPatternTrends:(e,t,r)=>{const n=new URLSearchParams({pattern:e,startTime:t.toString(),endTime:r.toString()});return ye(`/key-analytics/trends?${n}`)},triggerCollection:()=>ye("/key-analytics/collect",{method:"POST"}),clearOldSnapshots:e=>{const t=new URLSearchParams;e&&t.append("olderThan",e.toString());const r=t.toString();return ye(r?`/key-analytics/snapshots?${r}`:"/key-analytics/snapshots",{method:"DELETE"})}};function ia(e){if(e===0)return"0 B";const t=1024,r=["B","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(t));return`${(e/Math.pow(t,n)).toFixed(2)} ${r[n]}`}function Vr(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(2)}K`:e.toString()}function Lc(e){return e?e<60?`${Math.round(e)}s`:e<3600?`${Math.round(e/60)}m`:e<86400?`${Math.round(e/3600)}h`:`${Math.round(e/86400)}d`:"N/A"}const RC=["hsl(var(--primary))","hsl(var(--secondary))","#82ca9d","#ffc658","#ff8042","#8884d8"];function Eie(){const{currentConnection:e}=Qr(),[t,r]=y.useState("keyCount"),[n,i]=y.useState("desc"),[a,s]=y.useState(null),u=y.useRef(null);y.useEffect(()=>{a&&u.current&&setTimeout(()=>{var k;(k=u.current)==null||k.scrollIntoView({behavior:"smooth",block:"nearest"})},100)},[a]);const{data:d,refresh:f}=Ke({fetcher:()=>tx.getSummary(),interval:6e4,refetchKey:e==null?void 0:e.id}),{data:h,loading:p}=Ke({fetcher:()=>tx.getPatterns({limit:100}),interval:6e4,refetchKey:e==null?void 0:e.id}),[v,g]=y.useState(!1),j=async()=>{g(!0);try{await tx.triggerCollection(),setTimeout(()=>{f(),g(!1)},2e3)}catch(k){console.error("Failed to trigger collection:",k),g(!1)}},b=y.useMemo(()=>h?[...h].sort((C,T)=>{let A,M;switch(t){case"pattern":return n==="asc"?C.pattern.localeCompare(T.pattern):T.pattern.localeCompare(C.pattern);case"keyCount":A=C.keyCount,M=T.keyCount;break;case"memoryBytes":A=C.totalMemoryBytes,M=T.totalMemoryBytes;break;case"staleKeyCount":A=C.staleKeyCount||0,M=T.staleKeyCount||0;break;default:return 0}return n==="asc"?A-M:M-A}):[],[h,t,n]),w=y.useMemo(()=>h?[...h].sort((k,C)=>C.keyCount-k.keyCount).slice(0,10).map(k=>({name:k.pattern.length>20?k.pattern.substring(0,20)+"...":k.pattern,fullName:k.pattern,value:k.keyCount})):[],[h]),N=y.useMemo(()=>h?[...h].sort((k,C)=>C.totalMemoryBytes-k.totalMemoryBytes).slice(0,10).map(k=>({name:k.pattern.length>20?k.pattern.substring(0,20)+"...":k.pattern,fullName:k.pattern,value:k.totalMemoryBytes})):[],[h]),P=k=>{t===k?i(n==="asc"?"desc":"asc"):(r(k),i("desc"))},E=k=>t!==k?"⇅":n==="asc"?"↑":"↓";return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-3xl font-bold",children:"Key Analytics"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Analyze key patterns, memory usage, and identify optimization opportunities"})]}),l.jsx("button",{onClick:j,disabled:v,className:"px-4 py-2 bg-primary text-primary-foreground rounded hover:bg-primary/90 disabled:opacity-50 text-sm",children:v?"Collecting...":"Trigger Collection"})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-sm",children:"Total Keys"})}),l.jsxs(ce,{children:[l.jsx("div",{className:"text-2xl font-bold",children:d?Vr(d.totalKeys):"0"}),l.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["across ",(d==null?void 0:d.totalPatterns)||0," patterns"]})]})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-sm",children:"Total Memory"})}),l.jsxs(ce,{children:[l.jsx("div",{className:"text-2xl font-bold",children:d?ia(d.totalMemoryBytes):"0 B"}),l.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["avg ",d?ia(Math.round(d.totalMemoryBytes/(d.totalKeys||1))):"0 B","/key"]})]})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-sm",children:"Stale Keys"})}),l.jsxs(ce,{children:[l.jsx("div",{className:"text-2xl font-bold text-amber-600",children:d?Vr(d.staleKeyCount):"0"}),l.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"idle > 24 hours"})]})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-sm",children:"Expiring Soon"})}),l.jsxs(ce,{children:[l.jsx("div",{className:"text-2xl font-bold text-red-600",children:d?Vr(d.keysExpiringSoon):"0"}),l.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"TTL < 1 hour"})]})]})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"Top Patterns by Key Count"})}),l.jsx(ce,{children:w.length>0?l.jsx(hn,{width:"100%",height:300,children:l.jsxs(tm,{data:w,children:[l.jsx(Si,{strokeDasharray:"3 3"}),l.jsx(In,{dataKey:"name",angle:-45,textAnchor:"end",height:100}),l.jsx(Rn,{}),l.jsx(mn,{formatter:(k,C,T)=>[Vr(k||0),T.payload.fullName]}),l.jsx(Qo,{dataKey:"value",fill:"hsl(var(--primary))"})]})}):l.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No pattern data available"})})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"Top Patterns by Memory Usage"})}),l.jsx(ce,{children:N.length>0?l.jsx(hn,{width:"100%",height:300,children:l.jsxs(gR,{children:[l.jsx(Mw,{data:N,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,label:k=>`${k.name}: ${ia(k.value)}`,children:N.map((k,C)=>l.jsx(Ll,{fill:RC[C%RC.length]},`cell-${C}`))}),l.jsx(mn,{formatter:k=>ia(k||0)}),l.jsx(Nh,{})]})}):l.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No pattern data available"})})]})]}),l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{children:"Key Patterns"})}),l.jsx(ce,{children:p?l.jsx("div",{className:"text-center py-12",children:l.jsx("div",{className:"inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-current border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]",role:"status",children:l.jsx("span",{className:"!absolute !-m-px !h-px !w-px !overflow-hidden !whitespace-nowrap !border-0 !p-0 ![clip:rect(0,0,0,0)]",children:"Loading..."})})}):b.length>0?l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b",children:[l.jsxs("th",{className:"text-left p-2 cursor-pointer hover:bg-muted",onClick:()=>P("pattern"),children:["Pattern ",E("pattern")]}),l.jsxs("th",{className:"text-left p-2 cursor-pointer hover:bg-muted",onClick:()=>P("keyCount"),children:["Key Count ",E("keyCount")]}),l.jsx("th",{className:"text-left p-2",children:"Sampled"}),l.jsxs("th",{className:"text-left p-2 cursor-pointer hover:bg-muted",onClick:()=>P("memoryBytes"),children:["Total Memory ",E("memoryBytes")]}),l.jsx("th",{className:"text-left p-2",children:"Avg Memory"}),l.jsx("th",{className:"text-left p-2",children:"w/ TTL"}),l.jsx("th",{className:"text-left p-2",children:"Avg Idle"}),l.jsxs("th",{className:"text-left p-2 cursor-pointer hover:bg-muted",onClick:()=>P("staleKeyCount"),children:["Stale ",E("staleKeyCount")]})]})}),l.jsx("tbody",{children:b.map(k=>l.jsxs("tr",{className:`border-b hover:bg-muted cursor-pointer transition-colors ${a===k.pattern?"bg-primary/10 border-l-4 border-l-primary":""}`,onClick:()=>s(k.pattern),children:[l.jsx("td",{className:"p-2 font-mono text-xs",children:k.pattern}),l.jsx("td",{className:"p-2 font-bold",children:Vr(k.keyCount)}),l.jsx("td",{className:"p-2 text-muted-foreground",children:Vr(k.sampledKeyCount)}),l.jsx("td",{className:"p-2",children:ia(k.totalMemoryBytes)}),l.jsx("td",{className:"p-2",children:ia(k.avgMemoryBytes)}),l.jsx("td",{className:"p-2",children:Vr(k.keysWithTtl)}),l.jsx("td",{className:"p-2",children:Lc(k.avgIdleTimeSeconds)}),l.jsx("td",{className:`p-2 ${(k.staleKeyCount||0)>0?"text-amber-600 font-semibold":""}`,children:Vr(k.staleKeyCount||0)})]},k.id))})]})}):l.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'No pattern data available. Click "Trigger Collection" to analyze keys.'})})]}),a&&l.jsxs(ae,{ref:u,className:"animate-in slide-in-from-top-2 duration-300",children:[l.jsx(fe,{className:"bg-primary/5",children:l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsxs(he,{className:"flex items-center gap-2",children:[l.jsx(Ste,{className:"h-5 w-5 text-primary"}),"Pattern Detail: ",l.jsx("span",{className:"font-mono text-sm",children:a})]}),l.jsx("button",{onClick:()=>s(null),className:"text-xs px-3 py-1.5 bg-muted rounded hover:bg-muted/80 transition-colors",children:"Close"})]})}),l.jsx(ce,{children:(()=>{const k=b.find(C=>C.pattern===a);return k?l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Key Count"}),l.jsx("div",{className:"text-lg font-bold",children:Vr(k.keyCount)})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Total Memory"}),l.jsx("div",{className:"text-lg font-bold",children:ia(k.totalMemoryBytes)})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Avg Memory/Key"}),l.jsx("div",{className:"text-lg font-bold",children:ia(k.avgMemoryBytes)})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Max Memory"}),l.jsx("div",{className:"text-lg font-bold",children:ia(k.maxMemoryBytes)})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Keys with TTL"}),l.jsx("div",{className:"text-lg font-bold",children:Vr(k.keysWithTtl)})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Expiring Soon"}),l.jsx("div",{className:"text-lg font-bold text-red-600",children:Vr(k.keysExpiringSoon)})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Avg Idle Time"}),l.jsx("div",{className:"text-lg font-bold",children:Lc(k.avgIdleTimeSeconds)})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Stale Keys"}),l.jsx("div",{className:"text-lg font-bold text-amber-600",children:Vr(k.staleKeyCount||0)})]}),k.avgAccessFrequency!==void 0&&k.avgAccessFrequency!==null&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Avg Access Freq"}),l.jsx("div",{className:"text-lg font-bold",children:k.avgAccessFrequency.toFixed(2)})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Hot Keys"}),l.jsx("div",{className:"text-lg font-bold text-red-600",children:Vr(k.hotKeyCount||0)})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Cold Keys"}),l.jsx("div",{className:"text-lg font-bold text-blue-600",children:Vr(k.coldKeyCount||0)})]})]}),k.avgTtlSeconds!==void 0&&k.avgTtlSeconds!==null&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Avg TTL"}),l.jsx("div",{className:"text-lg font-bold",children:Lc(k.avgTtlSeconds)})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Min TTL"}),l.jsx("div",{className:"text-lg font-bold",children:Lc(k.minTtlSeconds)})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Max TTL"}),l.jsx("div",{className:"text-lg font-bold",children:Lc(k.maxTtlSeconds)})]})]})]}):null})()})]})]})}const ol=16384,Qs=128;function JR(e){return e.map(([t,r])=>t===r?`${t}`:`${t}-${r}`).join(", ")}function Hc(e){return e.reduce((t,[r,n])=>t+(n-r+1),0)}function eD(e){const t=new Map;for(const r of e)if(r.flags.includes("master"))for(const[n,i]of r.slots)for(let a=n;a<=i;a++)t.set(a,r.id);return t}function Cie(){var V;const{capabilities:e}=F0(),{data:t,error:r,loading:n,refresh:i}=Ke({fetcher:()=>ze.getInfo(["cluster"]),interval:3e4,enabled:!0}),a=((V=t==null?void 0:t.cluster)==null?void 0:V.cluster_enabled)==="1",{data:s,error:u,loading:d,refresh:f}=Ke({fetcher:()=>ze.getClusterInfo(),interval:3e4,enabled:a}),{data:h,error:p,loading:v,refresh:g}=Ke({fetcher:()=>ze.getClusterNodes(),interval:3e4,enabled:a}),j=(e==null?void 0:e.hasClusterSlotStats)??!1,{data:b,error:w,refresh:N}=Ke({fetcher:()=>ze.getSlotStats("key-count",ol),interval:3e4,enabled:a&&j}),P=n||a&&(d||v),E={serverInfo:r,clusterInfo:u,nodes:p,slotStats:w},C=Object.values(E).some(L=>L!==null)?r||(a?u||p:null):null,{masters:T,replicas:A}=y.useMemo(()=>{if(!h)return{masters:[],replicas:[]};const L=[],K=[];for(const te of h)te.flags.includes("master")?L.push(te):(te.flags.includes("slave")||te.flags.includes("replica"))&&K.push(te);return{masters:L,replicas:K}},[h]),M=y.useMemo(()=>{if(!s)return{status:"failing",slotsOk:0,slotsFail:0,slotsPfail:0,slotsAssigned:0,totalSlots:ol};const L=parseInt(s.cluster_slots_assigned||"0",10),K=parseInt(s.cluster_slots_fail||"0",10),te=parseInt(s.cluster_slots_pfail||"0",10),R=parseInt(s.cluster_slots_ok||"0",10),U=s.cluster_state||"fail";let F;return U==="ok"&&K===0&&te===0?F="healthy":K>0?F="failing":F="degraded",{status:F,slotsOk:R,slotsFail:K,slotsPfail:te,slotsAssigned:L,totalSlots:ol}},[s]);return{isClusterMode:a,isLoading:P,error:C,errors:E,info:s,nodes:h||[],masters:T,replicas:A,slotStats:b||null,hasSlotStats:j,health:M,refetch:()=>{i(),a&&(f(),g(),j&&N())}}}function Oie({health:e,masterCount:t,replicaCount:r}){const i={healthy:{icon:Kw,color:"text-green-500",bg:"bg-green-500/10",border:"border-green-500",label:"OK"},degraded:{icon:fp,color:"text-yellow-500",bg:"bg-yellow-500/10",border:"border-yellow-500",label:"Degraded"},failing:{icon:xR,color:"text-red-500",bg:"bg-red-500/10",border:"border-red-500",label:"Failing"}}[e.status],a=i.icon,s=e.totalSlots>0?e.slotsAssigned/e.totalSlots*100:0;return l.jsxs(ae,{className:`${e.status!=="healthy"?i.border:""}`,children:[l.jsx(fe,{className:"pb-3",children:l.jsxs(he,{className:"text-lg flex items-center gap-2",children:[l.jsx(a,{className:`w-5 h-5 ${i.color}`}),"Cluster Health"]})}),l.jsxs(ce,{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:"State:"}),l.jsx(Ve,{className:`${i.bg} ${i.color} border-0`,children:i.label})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center justify-between text-sm",children:[l.jsx("span",{className:"text-muted-foreground",children:"Slot Coverage"}),l.jsxs("span",{className:"font-medium",children:[e.slotsAssigned.toLocaleString()," / ",e.totalSlots.toLocaleString()]})]}),l.jsx("div",{className:"w-full bg-muted rounded-full h-2",children:l.jsx("div",{className:`h-2 rounded-full transition-all ${s===100?"bg-green-500":"bg-yellow-500"}`,style:{width:`${s}%`}})}),l.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.toFixed(1),"% covered"]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Masters"}),l.jsx("div",{className:"text-2xl font-bold",children:t})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Replicas"}),l.jsx("div",{className:"text-2xl font-bold",children:r})]})]}),(e.slotsFail>0||e.slotsPfail>0)&&l.jsxs("div",{className:"pt-3 border-t space-y-2",children:[e.slotsFail>0&&l.jsxs("div",{className:"flex items-center justify-between text-sm",children:[l.jsx("span",{className:"text-red-500",children:"Failed Slots"}),l.jsx("span",{className:"font-medium text-red-500",children:e.slotsFail})]}),e.slotsPfail>0&&l.jsxs("div",{className:"flex items-center justify-between text-sm",children:[l.jsx("span",{className:"text-yellow-500",children:"Possibly Failing"}),l.jsx("span",{className:"font-medium text-yellow-500",children:e.slotsPfail})]})]})]})]})}var Aie={value:()=>{}};function Gu(){for(var e=0,t=arguments.length,r={},n;e<t;++e){if(!(n=arguments[e]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new Yf(r)}function Yf(e){this._=e}function Tie(e,t){return e.trim().split(/^|\s+/).map(function(r){var n="",i=r.indexOf(".");if(i>=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}Yf.prototype=Gu.prototype={constructor:Yf,on:function(e,t){var r=this._,n=Tie(e+"",r),i,a=-1,s=n.length;if(arguments.length<2){for(;++a<s;)if((i=(e=n[a]).type)&&(i=Mie(r[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<s;)if(i=(e=n[a]).type)r[i]=DC(r[i],e.name,t);else if(t==null)for(i in r)r[i]=DC(r[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new Yf(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var r=new Array(i),n=0,i,a;n<i;++n)r[n]=arguments[n+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],n=0,i=a.length;n<i;++n)a[n].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var n=this._[e],i=0,a=n.length;i<a;++i)n[i].value.apply(t,r)}};function Mie(e,t){for(var r=0,n=e.length,i;r<n;++r)if((i=e[r]).name===t)return i.value}function DC(e,t,r){for(var n=0,i=e.length;n<i;++n)if(e[n].name===t){e[n]=Aie,e=e.slice(0,n).concat(e.slice(n+1));break}return r!=null&&e.push({name:t,value:r}),e}var j0="http://www.w3.org/1999/xhtml";const LC={svg:"http://www.w3.org/2000/svg",xhtml:j0,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function vp(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),LC.hasOwnProperty(t)?{space:LC[t],local:e}:e}function Iie(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===j0&&t.documentElement.namespaceURI===j0?t.createElement(e):t.createElementNS(r,e)}}function Rie(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function tD(e){var t=vp(e);return(t.local?Rie:Iie)(t)}function Die(){}function Yw(e){return e==null?Die:function(){return this.querySelector(e)}}function Lie(e){typeof e!="function"&&(e=Yw(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var a=t[i],s=a.length,u=n[i]=new Array(s),d,f,h=0;h<s;++h)(d=a[h])&&(f=e.call(d,d.__data__,h,a))&&("__data__"in d&&(f.__data__=d.__data__),u[h]=f);return new yn(n,this._parents)}function $ie(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function zie(){return[]}function rD(e){return e==null?zie:function(){return this.querySelectorAll(e)}}function Fie(e){return function(){return $ie(e.apply(this,arguments))}}function Bie(e){typeof e=="function"?e=Fie(e):e=rD(e);for(var t=this._groups,r=t.length,n=[],i=[],a=0;a<r;++a)for(var s=t[a],u=s.length,d,f=0;f<u;++f)(d=s[f])&&(n.push(e.call(d,d.__data__,f,s)),i.push(d));return new yn(n,i)}function nD(e){return function(){return this.matches(e)}}function iD(e){return function(t){return t.matches(e)}}var Wie=Array.prototype.find;function Uie(e){return function(){return Wie.call(this.children,e)}}function Kie(){return this.firstElementChild}function qie(e){return this.select(e==null?Kie:Uie(typeof e=="function"?e:iD(e)))}var Hie=Array.prototype.filter;function Vie(){return Array.from(this.children)}function Yie(e){return function(){return Hie.call(this.children,e)}}function Gie(e){return this.selectAll(e==null?Vie:Yie(typeof e=="function"?e:iD(e)))}function Xie(e){typeof e!="function"&&(e=nD(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var a=t[i],s=a.length,u=n[i]=[],d,f=0;f<s;++f)(d=a[f])&&e.call(d,d.__data__,f,a)&&u.push(d);return new yn(n,this._parents)}function aD(e){return new Array(e.length)}function Qie(){return new yn(this._enter||this._groups.map(aD),this._parents)}function om(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}om.prototype={constructor:om,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Zie(e){return function(){return e}}function Jie(e,t,r,n,i,a){for(var s=0,u,d=t.length,f=a.length;s<f;++s)(u=t[s])?(u.__data__=a[s],n[s]=u):r[s]=new om(e,a[s]);for(;s<d;++s)(u=t[s])&&(i[s]=u)}function eae(e,t,r,n,i,a,s){var u,d,f=new Map,h=t.length,p=a.length,v=new Array(h),g;for(u=0;u<h;++u)(d=t[u])&&(v[u]=g=s.call(d,d.__data__,u,t)+"",f.has(g)?i[u]=d:f.set(g,d));for(u=0;u<p;++u)g=s.call(e,a[u],u,a)+"",(d=f.get(g))?(n[u]=d,d.__data__=a[u],f.delete(g)):r[u]=new om(e,a[u]);for(u=0;u<h;++u)(d=t[u])&&f.get(v[u])===d&&(i[u]=d)}function tae(e){return e.__data__}function rae(e,t){if(!arguments.length)return Array.from(this,tae);var r=t?eae:Jie,n=this._parents,i=this._groups;typeof e!="function"&&(e=Zie(e));for(var a=i.length,s=new Array(a),u=new Array(a),d=new Array(a),f=0;f<a;++f){var h=n[f],p=i[f],v=p.length,g=nae(e.call(h,h&&h.__data__,f,n)),j=g.length,b=u[f]=new Array(j),w=s[f]=new Array(j),N=d[f]=new Array(v);r(h,p,b,w,N,g,t);for(var P=0,E=0,k,C;P<j;++P)if(k=b[P]){for(P>=E&&(E=P+1);!(C=w[E])&&++E<j;);k._next=C||null}}return s=new yn(s,n),s._enter=u,s._exit=d,s}function nae(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function iae(){return new yn(this._exit||this._groups.map(aD),this._parents)}function aae(e,t,r){var n=this.enter(),i=this,a=this.exit();return typeof e=="function"?(n=e(n),n&&(n=n.selection())):n=n.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),r==null?a.remove():r(a),n&&i?n.merge(i).order():i}function oae(e){for(var t=e.selection?e.selection():e,r=this._groups,n=t._groups,i=r.length,a=n.length,s=Math.min(i,a),u=new Array(i),d=0;d<s;++d)for(var f=r[d],h=n[d],p=f.length,v=u[d]=new Array(p),g,j=0;j<p;++j)(g=f[j]||h[j])&&(v[j]=g);for(;d<i;++d)u[d]=r[d];return new yn(u,this._parents)}function sae(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var n=e[t],i=n.length-1,a=n[i],s;--i>=0;)(s=n[i])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function lae(e){e||(e=cae);function t(p,v){return p&&v?e(p.__data__,v.__data__):!p-!v}for(var r=this._groups,n=r.length,i=new Array(n),a=0;a<n;++a){for(var s=r[a],u=s.length,d=i[a]=new Array(u),f,h=0;h<u;++h)(f=s[h])&&(d[h]=f);d.sort(t)}return new yn(i,this._parents).order()}function cae(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function uae(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function dae(){return Array.from(this)}function fae(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],i=0,a=n.length;i<a;++i){var s=n[i];if(s)return s}return null}function hae(){let e=0;for(const t of this)++e;return e}function mae(){return!this.node()}function pae(e){for(var t=this._groups,r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,s=i.length,u;a<s;++a)(u=i[a])&&e.call(u,u.__data__,a,i);return this}function vae(e){return function(){this.removeAttribute(e)}}function gae(e){return function(){this.removeAttributeNS(e.space,e.local)}}function yae(e,t){return function(){this.setAttribute(e,t)}}function xae(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function bae(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function wae(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function jae(e,t){var r=vp(e);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((t==null?r.local?gae:vae:typeof t=="function"?r.local?wae:bae:r.local?xae:yae)(r,t))}function oD(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Sae(e){return function(){this.style.removeProperty(e)}}function Nae(e,t,r){return function(){this.style.setProperty(e,t,r)}}function Pae(e,t,r){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}function kae(e,t,r){return arguments.length>1?this.each((t==null?Sae:typeof t=="function"?Pae:Nae)(e,t,r??"")):yl(this.node(),e)}function yl(e,t){return e.style.getPropertyValue(t)||oD(e).getComputedStyle(e,null).getPropertyValue(t)}function _ae(e){return function(){delete this[e]}}function Eae(e,t){return function(){this[e]=t}}function Cae(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function Oae(e,t){return arguments.length>1?this.each((t==null?_ae:typeof t=="function"?Cae:Eae)(e,t)):this.node()[e]}function sD(e){return e.trim().split(/^|\s+/)}function Gw(e){return e.classList||new lD(e)}function lD(e){this._node=e,this._names=sD(e.getAttribute("class")||"")}lD.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function cD(e,t){for(var r=Gw(e),n=-1,i=t.length;++n<i;)r.add(t[n])}function uD(e,t){for(var r=Gw(e),n=-1,i=t.length;++n<i;)r.remove(t[n])}function Aae(e){return function(){cD(this,e)}}function Tae(e){return function(){uD(this,e)}}function Mae(e,t){return function(){(t.apply(this,arguments)?cD:uD)(this,e)}}function Iae(e,t){var r=sD(e+"");if(arguments.length<2){for(var n=Gw(this.node()),i=-1,a=r.length;++i<a;)if(!n.contains(r[i]))return!1;return!0}return this.each((typeof t=="function"?Mae:t?Aae:Tae)(r,t))}function Rae(){this.textContent=""}function Dae(e){return function(){this.textContent=e}}function Lae(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function $ae(e){return arguments.length?this.each(e==null?Rae:(typeof e=="function"?Lae:Dae)(e)):this.node().textContent}function zae(){this.innerHTML=""}function Fae(e){return function(){this.innerHTML=e}}function Bae(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Wae(e){return arguments.length?this.each(e==null?zae:(typeof e=="function"?Bae:Fae)(e)):this.node().innerHTML}function Uae(){this.nextSibling&&this.parentNode.appendChild(this)}function Kae(){return this.each(Uae)}function qae(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Hae(){return this.each(qae)}function Vae(e){var t=typeof e=="function"?e:tD(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Yae(){return null}function Gae(e,t){var r=typeof e=="function"?e:tD(e),n=t==null?Yae:typeof t=="function"?t:Yw(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}function Xae(){var e=this.parentNode;e&&e.removeChild(this)}function Qae(){return this.each(Xae)}function Zae(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Jae(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function eoe(e){return this.select(e?Jae:Zae)}function toe(e){return arguments.length?this.property("__data__",e):this.node().__data__}function roe(e){return function(t){e.call(this,t,this.__data__)}}function noe(e){return e.trim().split(/^|\s+/).map(function(t){var r="",n=t.indexOf(".");return n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),{type:t,name:r}})}function ioe(e){return function(){var t=this.__on;if(t){for(var r=0,n=-1,i=t.length,a;r<i;++r)a=t[r],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++n]=a;++n?t.length=n:delete this.__on}}}function aoe(e,t,r){return function(){var n=this.__on,i,a=roe(t);if(n){for(var s=0,u=n.length;s<u;++s)if((i=n[s]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=r),i.value=t;return}}this.addEventListener(e.type,a,r),i={type:e.type,name:e.name,value:t,listener:a,options:r},n?n.push(i):this.__on=[i]}}function ooe(e,t,r){var n=noe(e+""),i,a=n.length,s;if(arguments.length<2){var u=this.node().__on;if(u){for(var d=0,f=u.length,h;d<f;++d)for(i=0,h=u[d];i<a;++i)if((s=n[i]).type===h.type&&s.name===h.name)return h.value}return}for(u=t?aoe:ioe,i=0;i<a;++i)this.each(u(n[i],t,r));return this}function dD(e,t,r){var n=oD(e),i=n.CustomEvent;typeof i=="function"?i=new i(t,r):(i=n.document.createEvent("Event"),r?(i.initEvent(t,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function soe(e,t){return function(){return dD(this,e,t)}}function loe(e,t){return function(){return dD(this,e,t.apply(this,arguments))}}function coe(e,t){return this.each((typeof t=="function"?loe:soe)(e,t))}function*uoe(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],i=0,a=n.length,s;i<a;++i)(s=n[i])&&(yield s)}var fD=[null];function yn(e,t){this._groups=e,this._parents=t}function Xu(){return new yn([[document.documentElement]],fD)}function doe(){return this}yn.prototype=Xu.prototype={constructor:yn,select:Lie,selectAll:Bie,selectChild:qie,selectChildren:Gie,filter:Xie,data:rae,enter:Qie,exit:iae,join:aae,merge:oae,selection:doe,order:sae,sort:lae,call:uae,nodes:dae,node:fae,size:hae,empty:mae,each:pae,attr:jae,style:kae,property:Oae,classed:Iae,text:$ae,html:Wae,raise:Kae,lower:Hae,append:Vae,insert:Gae,remove:Qae,clone:eoe,datum:toe,on:ooe,dispatch:coe,[Symbol.iterator]:uoe};function dn(e){return typeof e=="string"?new yn([[document.querySelector(e)]],[document.documentElement]):new yn([[e]],fD)}function foe(e){let t;for(;t=e.sourceEvent;)e=t;return e}function oa(e,t){if(e=foe(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var n=r.createSVGPoint();return n.x=e.clientX,n.y=e.clientY,n=n.matrixTransform(t.getScreenCTM().inverse()),[n.x,n.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const hoe={passive:!1},mu={capture:!0,passive:!1};function rx(e){e.stopImmediatePropagation()}function sl(e){e.preventDefault(),e.stopImmediatePropagation()}function hD(e){var t=e.document.documentElement,r=dn(e).on("dragstart.drag",sl,mu);"onselectstart"in t?r.on("selectstart.drag",sl,mu):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function mD(e,t){var r=e.document.documentElement,n=dn(e).on("dragstart.drag",null);t&&(n.on("click.drag",sl,mu),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const Df=e=>()=>e;function S0(e,{sourceEvent:t,subject:r,target:n,identifier:i,active:a,x:s,y:u,dx:d,dy:f,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:h}})}S0.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function moe(e){return!e.ctrlKey&&!e.button}function poe(){return this.parentNode}function voe(e,t){return t??{x:e.x,y:e.y}}function goe(){return navigator.maxTouchPoints||"ontouchstart"in this}function yoe(){var e=moe,t=poe,r=voe,n=goe,i={},a=Gu("start","drag","end"),s=0,u,d,f,h,p=0;function v(k){k.on("mousedown.drag",g).filter(n).on("touchstart.drag",w).on("touchmove.drag",N,hoe).on("touchend.drag touchcancel.drag",P).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(k,C){if(!(h||!e.call(this,k,C))){var T=E(this,t.call(this,k,C),k,C,"mouse");T&&(dn(k.view).on("mousemove.drag",j,mu).on("mouseup.drag",b,mu),hD(k.view),rx(k),f=!1,u=k.clientX,d=k.clientY,T("start",k))}}function j(k){if(sl(k),!f){var C=k.clientX-u,T=k.clientY-d;f=C*C+T*T>p}i.mouse("drag",k)}function b(k){dn(k.view).on("mousemove.drag mouseup.drag",null),mD(k.view,f),sl(k),i.mouse("end",k)}function w(k,C){if(e.call(this,k,C)){var T=k.changedTouches,A=t.call(this,k,C),M=T.length,z,V;for(z=0;z<M;++z)(V=E(this,A,k,C,T[z].identifier,T[z]))&&(rx(k),V("start",k,T[z]))}}function N(k){var C=k.changedTouches,T=C.length,A,M;for(A=0;A<T;++A)(M=i[C[A].identifier])&&(sl(k),M("drag",k,C[A]))}function P(k){var C=k.changedTouches,T=C.length,A,M;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),A=0;A<T;++A)(M=i[C[A].identifier])&&(rx(k),M("end",k,C[A]))}function E(k,C,T,A,M,z){var V=a.copy(),L=oa(z||T,C),K,te,R;if((R=r.call(k,new S0("beforestart",{sourceEvent:T,target:v,identifier:M,active:s,x:L[0],y:L[1],dx:0,dy:0,dispatch:V}),A))!=null)return K=R.x-L[0]||0,te=R.y-L[1]||0,function U(F,X,$){var Y=L,W;switch(F){case"start":i[M]=U,W=s++;break;case"end":delete i[M],--s;case"drag":L=oa($||X,C),W=s;break}V.call(F,k,new S0(F,{sourceEvent:X,subject:R,target:v,identifier:M,active:W,x:L[0]+K,y:L[1]+te,dx:L[0]-Y[0],dy:L[1]-Y[1],dispatch:V}),A)}}return v.filter=function(k){return arguments.length?(e=typeof k=="function"?k:Df(!!k),v):e},v.container=function(k){return arguments.length?(t=typeof k=="function"?k:Df(k),v):t},v.subject=function(k){return arguments.length?(r=typeof k=="function"?k:Df(k),v):r},v.touchable=function(k){return arguments.length?(n=typeof k=="function"?k:Df(!!k),v):n},v.on=function(){var k=a.on.apply(a,arguments);return k===a?v:k},v.clickDistance=function(k){return arguments.length?(p=(k=+k)*k,v):Math.sqrt(p)},v}var xl=0,Wc=0,$c=0,pD=1e3,sm,Uc,lm=0,ys=0,gp=0,pu=typeof performance=="object"&&performance.now?performance:Date,vD=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Xw(){return ys||(vD(xoe),ys=pu.now()+gp)}function xoe(){ys=0}function cm(){this._call=this._time=this._next=null}cm.prototype=Qw.prototype={constructor:cm,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?Xw():+r)+(t==null?0:+t),!this._next&&Uc!==this&&(Uc?Uc._next=this:sm=this,Uc=this),this._call=e,this._time=r,N0()},stop:function(){this._call&&(this._call=null,this._time=1/0,N0())}};function Qw(e,t,r){var n=new cm;return n.restart(e,t,r),n}function boe(){Xw(),++xl;for(var e=sm,t;e;)(t=ys-e._time)>=0&&e._call.call(void 0,t),e=e._next;--xl}function $C(){ys=(lm=pu.now())+gp,xl=Wc=0;try{boe()}finally{xl=0,joe(),ys=0}}function woe(){var e=pu.now(),t=e-lm;t>pD&&(gp-=t,lm=e)}function joe(){for(var e,t=sm,r,n=1/0;t;)t._call?(n>t._time&&(n=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:sm=r);Uc=e,N0(n)}function N0(e){if(!xl){Wc&&(Wc=clearTimeout(Wc));var t=e-ys;t>24?(e<1/0&&(Wc=setTimeout($C,e-pu.now()-gp)),$c&&($c=clearInterval($c))):($c||(lm=pu.now(),$c=setInterval(woe,pD)),xl=1,vD($C))}}function zC(e,t,r){var n=new cm;return t=t==null?0:+t,n.restart(i=>{n.stop(),e(i+t)},t,r),n}var Soe=Gu("start","end","cancel","interrupt"),Noe=[],gD=0,FC=1,P0=2,Gf=3,BC=4,k0=5,Xf=6;function yp(e,t,r,n,i,a){var s=e.__transition;if(!s)e.__transition={};else if(r in s)return;Poe(e,r,{name:t,index:n,group:i,on:Soe,tween:Noe,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:gD})}function Zw(e,t){var r=ui(e,t);if(r.state>gD)throw new Error("too late; already scheduled");return r}function Fi(e,t){var r=ui(e,t);if(r.state>Gf)throw new Error("too late; already running");return r}function ui(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function Poe(e,t,r){var n=e.__transition,i;n[t]=r,r.timer=Qw(a,0,r.time);function a(f){r.state=FC,r.timer.restart(s,r.delay,r.time),r.delay<=f&&s(f-r.delay)}function s(f){var h,p,v,g;if(r.state!==FC)return d();for(h in n)if(g=n[h],g.name===r.name){if(g.state===Gf)return zC(s);g.state===BC?(g.state=Xf,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete n[h]):+h<t&&(g.state=Xf,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete n[h])}if(zC(function(){r.state===Gf&&(r.state=BC,r.timer.restart(u,r.delay,r.time),u(f))}),r.state=P0,r.on.call("start",e,e.__data__,r.index,r.group),r.state===P0){for(r.state=Gf,i=new Array(v=r.tween.length),h=0,p=-1;h<v;++h)(g=r.tween[h].value.call(e,e.__data__,r.index,r.group))&&(i[++p]=g);i.length=p+1}}function u(f){for(var h=f<r.duration?r.ease.call(null,f/r.duration):(r.timer.restart(d),r.state=k0,1),p=-1,v=i.length;++p<v;)i[p].call(e,h);r.state===k0&&(r.on.call("end",e,e.__data__,r.index,r.group),d())}function d(){r.state=Xf,r.timer.stop(),delete n[t];for(var f in n)return;delete e.__transition}}function Qf(e,t){var r=e.__transition,n,i,a=!0,s;if(r){t=t==null?null:t+"";for(s in r){if((n=r[s]).name!==t){a=!1;continue}i=n.state>P0&&n.state<k0,n.state=Xf,n.timer.stop(),n.on.call(i?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete r[s]}a&&delete e.__transition}}function koe(e){return this.each(function(){Qf(this,e)})}function _oe(e,t){var r,n;return function(){var i=Fi(this,e),a=i.tween;if(a!==r){n=r=a;for(var s=0,u=n.length;s<u;++s)if(n[s].name===t){n=n.slice(),n.splice(s,1);break}}i.tween=n}}function Eoe(e,t,r){var n,i;if(typeof r!="function")throw new Error;return function(){var a=Fi(this,e),s=a.tween;if(s!==n){i=(n=s).slice();for(var u={name:t,value:r},d=0,f=i.length;d<f;++d)if(i[d].name===t){i[d]=u;break}d===f&&i.push(u)}a.tween=i}}function Coe(e,t){var r=this._id;if(e+="",arguments.length<2){for(var n=ui(this.node(),r).tween,i=0,a=n.length,s;i<a;++i)if((s=n[i]).name===e)return s.value;return null}return this.each((t==null?_oe:Eoe)(r,e,t))}function Jw(e,t,r){var n=e._id;return e.each(function(){var i=Fi(this,n);(i.value||(i.value={}))[t]=r.apply(this,arguments)}),function(i){return ui(i,n).value[t]}}function yD(e,t){var r;return(typeof t=="number"?Jn:t instanceof hs?Mh:(r=hs(t))?(t=r,Mh):rT)(e,t)}function Ooe(e){return function(){this.removeAttribute(e)}}function Aoe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Toe(e,t,r){var n,i=r+"",a;return function(){var s=this.getAttribute(e);return s===i?null:s===n?a:a=t(n=s,r)}}function Moe(e,t,r){var n,i=r+"",a;return function(){var s=this.getAttributeNS(e.space,e.local);return s===i?null:s===n?a:a=t(n=s,r)}}function Ioe(e,t,r){var n,i,a;return function(){var s,u=r(this),d;return u==null?void this.removeAttribute(e):(s=this.getAttribute(e),d=u+"",s===d?null:s===n&&d===i?a:(i=d,a=t(n=s,u)))}}function Roe(e,t,r){var n,i,a;return function(){var s,u=r(this),d;return u==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),d=u+"",s===d?null:s===n&&d===i?a:(i=d,a=t(n=s,u)))}}function Doe(e,t){var r=vp(e),n=r==="transform"?YU:yD;return this.attrTween(e,typeof t=="function"?(r.local?Roe:Ioe)(r,n,Jw(this,"attr."+e,t)):t==null?(r.local?Aoe:Ooe)(r):(r.local?Moe:Toe)(r,n,t))}function Loe(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function $oe(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function zoe(e,t){var r,n;function i(){var a=t.apply(this,arguments);return a!==n&&(r=(n=a)&&$oe(e,a)),r}return i._value=t,i}function Foe(e,t){var r,n;function i(){var a=t.apply(this,arguments);return a!==n&&(r=(n=a)&&Loe(e,a)),r}return i._value=t,i}function Boe(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var n=vp(e);return this.tween(r,(n.local?zoe:Foe)(n,t))}function Woe(e,t){return function(){Zw(this,e).delay=+t.apply(this,arguments)}}function Uoe(e,t){return t=+t,function(){Zw(this,e).delay=t}}function Koe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Woe:Uoe)(t,e)):ui(this.node(),t).delay}function qoe(e,t){return function(){Fi(this,e).duration=+t.apply(this,arguments)}}function Hoe(e,t){return t=+t,function(){Fi(this,e).duration=t}}function Voe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?qoe:Hoe)(t,e)):ui(this.node(),t).duration}function Yoe(e,t){if(typeof t!="function")throw new Error;return function(){Fi(this,e).ease=t}}function Goe(e){var t=this._id;return arguments.length?this.each(Yoe(t,e)):ui(this.node(),t).ease}function Xoe(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;Fi(this,e).ease=r}}function Qoe(e){if(typeof e!="function")throw new Error;return this.each(Xoe(this._id,e))}function Zoe(e){typeof e!="function"&&(e=nD(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var a=t[i],s=a.length,u=n[i]=[],d,f=0;f<s;++f)(d=a[f])&&e.call(d,d.__data__,f,a)&&u.push(d);return new ka(n,this._parents,this._name,this._id)}function Joe(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,n=t.length,i=r.length,a=Math.min(n,i),s=new Array(n),u=0;u<a;++u)for(var d=t[u],f=r[u],h=d.length,p=s[u]=new Array(h),v,g=0;g<h;++g)(v=d[g]||f[g])&&(p[g]=v);for(;u<n;++u)s[u]=t[u];return new ka(s,this._parents,this._name,this._id)}function ese(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function tse(e,t,r){var n,i,a=ese(t)?Zw:Fi;return function(){var s=a(this,e),u=s.on;u!==n&&(i=(n=u).copy()).on(t,r),s.on=i}}function rse(e,t){var r=this._id;return arguments.length<2?ui(this.node(),r).on.on(e):this.each(tse(r,e,t))}function nse(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function ise(){return this.on("end.remove",nse(this._id))}function ase(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Yw(e));for(var n=this._groups,i=n.length,a=new Array(i),s=0;s<i;++s)for(var u=n[s],d=u.length,f=a[s]=new Array(d),h,p,v=0;v<d;++v)(h=u[v])&&(p=e.call(h,h.__data__,v,u))&&("__data__"in h&&(p.__data__=h.__data__),f[v]=p,yp(f[v],t,r,v,f,ui(h,r)));return new ka(a,this._parents,t,r)}function ose(e){var t=this._name,r=this._id;typeof e!="function"&&(e=rD(e));for(var n=this._groups,i=n.length,a=[],s=[],u=0;u<i;++u)for(var d=n[u],f=d.length,h,p=0;p<f;++p)if(h=d[p]){for(var v=e.call(h,h.__data__,p,d),g,j=ui(h,r),b=0,w=v.length;b<w;++b)(g=v[b])&&yp(g,t,r,b,v,j);a.push(v),s.push(h)}return new ka(a,s,t,r)}var sse=Xu.prototype.constructor;function lse(){return new sse(this._groups,this._parents)}function cse(e,t){var r,n,i;return function(){var a=yl(this,e),s=(this.style.removeProperty(e),yl(this,e));return a===s?null:a===r&&s===n?i:i=t(r=a,n=s)}}function xD(e){return function(){this.style.removeProperty(e)}}function use(e,t,r){var n,i=r+"",a;return function(){var s=yl(this,e);return s===i?null:s===n?a:a=t(n=s,r)}}function dse(e,t,r){var n,i,a;return function(){var s=yl(this,e),u=r(this),d=u+"";return u==null&&(d=u=(this.style.removeProperty(e),yl(this,e))),s===d?null:s===n&&d===i?a:(i=d,a=t(n=s,u))}}function fse(e,t){var r,n,i,a="style."+t,s="end."+a,u;return function(){var d=Fi(this,e),f=d.on,h=d.value[a]==null?u||(u=xD(t)):void 0;(f!==r||i!==h)&&(n=(r=f).copy()).on(s,i=h),d.on=n}}function hse(e,t,r){var n=(e+="")=="transform"?VU:yD;return t==null?this.styleTween(e,cse(e,n)).on("end.style."+e,xD(e)):typeof t=="function"?this.styleTween(e,dse(e,n,Jw(this,"style."+e,t))).each(fse(this._id,e)):this.styleTween(e,use(e,n,t),r).on("end.style."+e,null)}function mse(e,t,r){return function(n){this.style.setProperty(e,t.call(this,n),r)}}function pse(e,t,r){var n,i;function a(){var s=t.apply(this,arguments);return s!==i&&(n=(i=s)&&mse(e,s,r)),n}return a._value=t,a}function vse(e,t,r){var n="style."+(e+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,pse(e,t,r??""))}function gse(e){return function(){this.textContent=e}}function yse(e){return function(){var t=e(this);this.textContent=t??""}}function xse(e){return this.tween("text",typeof e=="function"?yse(Jw(this,"text",e)):gse(e==null?"":e+""))}function bse(e){return function(t){this.textContent=e.call(this,t)}}function wse(e){var t,r;function n(){var i=e.apply(this,arguments);return i!==r&&(t=(r=i)&&bse(i)),t}return n._value=e,n}function jse(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,wse(e))}function Sse(){for(var e=this._name,t=this._id,r=bD(),n=this._groups,i=n.length,a=0;a<i;++a)for(var s=n[a],u=s.length,d,f=0;f<u;++f)if(d=s[f]){var h=ui(d,t);yp(d,e,r,f,s,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new ka(n,this._parents,e,r)}function Nse(){var e,t,r=this,n=r._id,i=r.size();return new Promise(function(a,s){var u={value:s},d={value:function(){--i===0&&a()}};r.each(function(){var f=Fi(this,n),h=f.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(u),t._.interrupt.push(u),t._.end.push(d)),f.on=t}),i===0&&a()})}var Pse=0;function ka(e,t,r,n){this._groups=e,this._parents=t,this._name=r,this._id=n}function bD(){return++Pse}var aa=Xu.prototype;ka.prototype={constructor:ka,select:ase,selectAll:ose,selectChild:aa.selectChild,selectChildren:aa.selectChildren,filter:Zoe,merge:Joe,selection:lse,transition:Sse,call:aa.call,nodes:aa.nodes,node:aa.node,size:aa.size,empty:aa.empty,each:aa.each,on:rse,attr:Doe,attrTween:Boe,style:hse,styleTween:vse,text:xse,textTween:jse,remove:ise,tween:Coe,delay:Koe,duration:Voe,ease:Goe,easeVarying:Qoe,end:Nse,[Symbol.iterator]:aa[Symbol.iterator]};function kse(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var _se={time:null,delay:0,duration:250,ease:kse};function Ese(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function Cse(e){var t,r;e instanceof ka?(t=e._id,e=e._name):(t=bD(),(r=_se).time=Xw(),e=e==null?null:e+"");for(var n=this._groups,i=n.length,a=0;a<i;++a)for(var s=n[a],u=s.length,d,f=0;f<u;++f)(d=s[f])&&yp(d,e,t,f,s,r||Ese(d,t));return new ka(n,this._parents,e,t)}Xu.prototype.interrupt=koe;Xu.prototype.transition=Cse;function Ose(e,t){var r,n=1;e==null&&(e=0),t==null&&(t=0);function i(){var a,s=r.length,u,d=0,f=0;for(a=0;a<s;++a)u=r[a],d+=u.x,f+=u.y;for(d=(d/s-e)*n,f=(f/s-t)*n,a=0;a<s;++a)u=r[a],u.x-=d,u.y-=f}return i.initialize=function(a){r=a},i.x=function(a){return arguments.length?(e=+a,i):e},i.y=function(a){return arguments.length?(t=+a,i):t},i.strength=function(a){return arguments.length?(n=+a,i):n},i}function Ase(e){const t=+this._x.call(null,e),r=+this._y.call(null,e);return wD(this.cover(t,r),t,r,e)}function wD(e,t,r,n){if(isNaN(t)||isNaN(r))return e;var i,a=e._root,s={data:n},u=e._x0,d=e._y0,f=e._x1,h=e._y1,p,v,g,j,b,w,N,P;if(!a)return e._root=s,e;for(;a.length;)if((b=t>=(p=(u+f)/2))?u=p:f=p,(w=r>=(v=(d+h)/2))?d=v:h=v,i=a,!(a=a[N=w<<1|b]))return i[N]=s,e;if(g=+e._x.call(null,a.data),j=+e._y.call(null,a.data),t===g&&r===j)return s.next=a,i?i[N]=s:e._root=s,e;do i=i?i[N]=new Array(4):e._root=new Array(4),(b=t>=(p=(u+f)/2))?u=p:f=p,(w=r>=(v=(d+h)/2))?d=v:h=v;while((N=w<<1|b)===(P=(j>=v)<<1|g>=p));return i[P]=a,i[N]=s,e}function Tse(e){var t,r,n=e.length,i,a,s=new Array(n),u=new Array(n),d=1/0,f=1/0,h=-1/0,p=-1/0;for(r=0;r<n;++r)isNaN(i=+this._x.call(null,t=e[r]))||isNaN(a=+this._y.call(null,t))||(s[r]=i,u[r]=a,i<d&&(d=i),i>h&&(h=i),a<f&&(f=a),a>p&&(p=a));if(d>h||f>p)return this;for(this.cover(d,f).cover(h,p),r=0;r<n;++r)wD(this,s[r],u[r],e[r]);return this}function Mse(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var r=this._x0,n=this._y0,i=this._x1,a=this._y1;if(isNaN(r))i=(r=Math.floor(e))+1,a=(n=Math.floor(t))+1;else{for(var s=i-r||1,u=this._root,d,f;r>e||e>=i||n>t||t>=a;)switch(f=(t<n)<<1|e<r,d=new Array(4),d[f]=u,u=d,s*=2,f){case 0:i=r+s,a=n+s;break;case 1:r=i-s,a=n+s;break;case 2:i=r+s,n=a-s;break;case 3:r=i-s,n=a-s;break}this._root&&this._root.length&&(this._root=u)}return this._x0=r,this._y0=n,this._x1=i,this._y1=a,this}function Ise(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function Rse(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Mr(e,t,r,n,i){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=i}function Dse(e,t,r){var n,i=this._x0,a=this._y0,s,u,d,f,h=this._x1,p=this._y1,v=[],g=this._root,j,b;for(g&&v.push(new Mr(g,i,a,h,p)),r==null?r=1/0:(i=e-r,a=t-r,h=e+r,p=t+r,r*=r);j=v.pop();)if(!(!(g=j.node)||(s=j.x0)>h||(u=j.y0)>p||(d=j.x1)<i||(f=j.y1)<a))if(g.length){var w=(s+d)/2,N=(u+f)/2;v.push(new Mr(g[3],w,N,d,f),new Mr(g[2],s,N,w,f),new Mr(g[1],w,u,d,N),new Mr(g[0],s,u,w,N)),(b=(t>=N)<<1|e>=w)&&(j=v[v.length-1],v[v.length-1]=v[v.length-1-b],v[v.length-1-b]=j)}else{var P=e-+this._x.call(null,g.data),E=t-+this._y.call(null,g.data),k=P*P+E*E;if(k<r){var C=Math.sqrt(r=k);i=e-C,a=t-C,h=e+C,p=t+C,n=g.data}}return n}function Lse(e){if(isNaN(h=+this._x.call(null,e))||isNaN(p=+this._y.call(null,e)))return this;var t,r=this._root,n,i,a,s=this._x0,u=this._y0,d=this._x1,f=this._y1,h,p,v,g,j,b,w,N;if(!r)return this;if(r.length)for(;;){if((j=h>=(v=(s+d)/2))?s=v:d=v,(b=p>=(g=(u+f)/2))?u=g:f=g,t=r,!(r=r[w=b<<1|j]))return this;if(!r.length)break;(t[w+1&3]||t[w+2&3]||t[w+3&3])&&(n=t,N=w)}for(;r.data!==e;)if(i=r,!(r=r.next))return this;return(a=r.next)&&delete r.next,i?(a?i.next=a:delete i.next,this):t?(a?t[w]=a:delete t[w],(r=t[0]||t[1]||t[2]||t[3])&&r===(t[3]||t[2]||t[1]||t[0])&&!r.length&&(n?n[N]=r:this._root=r),this):(this._root=a,this)}function $se(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this}function zse(){return this._root}function Fse(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function Bse(e){var t=[],r,n=this._root,i,a,s,u,d;for(n&&t.push(new Mr(n,this._x0,this._y0,this._x1,this._y1));r=t.pop();)if(!e(n=r.node,a=r.x0,s=r.y0,u=r.x1,d=r.y1)&&n.length){var f=(a+u)/2,h=(s+d)/2;(i=n[3])&&t.push(new Mr(i,f,h,u,d)),(i=n[2])&&t.push(new Mr(i,a,h,f,d)),(i=n[1])&&t.push(new Mr(i,f,s,u,h)),(i=n[0])&&t.push(new Mr(i,a,s,f,h))}return this}function Wse(e){var t=[],r=[],n;for(this._root&&t.push(new Mr(this._root,this._x0,this._y0,this._x1,this._y1));n=t.pop();){var i=n.node;if(i.length){var a,s=n.x0,u=n.y0,d=n.x1,f=n.y1,h=(s+d)/2,p=(u+f)/2;(a=i[0])&&t.push(new Mr(a,s,u,h,p)),(a=i[1])&&t.push(new Mr(a,h,u,d,p)),(a=i[2])&&t.push(new Mr(a,s,p,h,f)),(a=i[3])&&t.push(new Mr(a,h,p,d,f))}r.push(n)}for(;n=r.pop();)e(n.node,n.x0,n.y0,n.x1,n.y1);return this}function Use(e){return e[0]}function Kse(e){return arguments.length?(this._x=e,this):this._x}function qse(e){return e[1]}function Hse(e){return arguments.length?(this._y=e,this):this._y}function e1(e,t,r){var n=new t1(t??Use,r??qse,NaN,NaN,NaN,NaN);return e==null?n:n.addAll(e)}function t1(e,t,r,n,i,a){this._x=e,this._y=t,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function WC(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}var Lr=e1.prototype=t1.prototype;Lr.copy=function(){var e=new t1(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,r,n;if(!t)return e;if(!t.length)return e._root=WC(t),e;for(r=[{source:t,target:e._root=new Array(4)}];t=r.pop();)for(var i=0;i<4;++i)(n=t.source[i])&&(n.length?r.push({source:n,target:t.target[i]=new Array(4)}):t.target[i]=WC(n));return e};Lr.add=Ase;Lr.addAll=Tse;Lr.cover=Mse;Lr.data=Ise;Lr.extent=Rse;Lr.find=Dse;Lr.remove=Lse;Lr.removeAll=$se;Lr.root=zse;Lr.size=Fse;Lr.visit=Bse;Lr.visitAfter=Wse;Lr.x=Kse;Lr.y=Hse;function is(e){return function(){return e}}function mo(e){return(e()-.5)*1e-6}function Vse(e){return e.x+e.vx}function Yse(e){return e.y+e.vy}function Gse(e){var t,r,n,i=1,a=1;typeof e!="function"&&(e=is(e==null?1:+e));function s(){for(var f,h=t.length,p,v,g,j,b,w,N=0;N<a;++N)for(p=e1(t,Vse,Yse).visitAfter(u),f=0;f<h;++f)v=t[f],b=r[v.index],w=b*b,g=v.x+v.vx,j=v.y+v.vy,p.visit(P);function P(E,k,C,T,A){var M=E.data,z=E.r,V=b+z;if(M){if(M.index>v.index){var L=g-M.x-M.vx,K=j-M.y-M.vy,te=L*L+K*K;te<V*V&&(L===0&&(L=mo(n),te+=L*L),K===0&&(K=mo(n),te+=K*K),te=(V-(te=Math.sqrt(te)))/te*i,v.vx+=(L*=te)*(V=(z*=z)/(w+z)),v.vy+=(K*=te)*V,M.vx-=L*(V=1-V),M.vy-=K*V)}return}return k>g+V||T<g-V||C>j+V||A<j-V}}function u(f){if(f.data)return f.r=r[f.data.index];for(var h=f.r=0;h<4;++h)f[h]&&f[h].r>f.r&&(f.r=f[h].r)}function d(){if(t){var f,h=t.length,p;for(r=new Array(h),f=0;f<h;++f)p=t[f],r[p.index]=+e(p,f,t)}}return s.initialize=function(f,h){t=f,n=h,d()},s.iterations=function(f){return arguments.length?(a=+f,s):a},s.strength=function(f){return arguments.length?(i=+f,s):i},s.radius=function(f){return arguments.length?(e=typeof f=="function"?f:is(+f),d(),s):e},s}function Xse(e){return e.index}function UC(e,t){var r=e.get(t);if(!r)throw new Error("node not found: "+t);return r}function Qse(e){var t=Xse,r=p,n,i=is(30),a,s,u,d,f,h=1;e==null&&(e=[]);function p(w){return 1/Math.min(u[w.source.index],u[w.target.index])}function v(w){for(var N=0,P=e.length;N<h;++N)for(var E=0,k,C,T,A,M,z,V;E<P;++E)k=e[E],C=k.source,T=k.target,A=T.x+T.vx-C.x-C.vx||mo(f),M=T.y+T.vy-C.y-C.vy||mo(f),z=Math.sqrt(A*A+M*M),z=(z-a[E])/z*w*n[E],A*=z,M*=z,T.vx-=A*(V=d[E]),T.vy-=M*V,C.vx+=A*(V=1-V),C.vy+=M*V}function g(){if(s){var w,N=s.length,P=e.length,E=new Map(s.map((C,T)=>[t(C,T,s),C])),k;for(w=0,u=new Array(N);w<P;++w)k=e[w],k.index=w,typeof k.source!="object"&&(k.source=UC(E,k.source)),typeof k.target!="object"&&(k.target=UC(E,k.target)),u[k.source.index]=(u[k.source.index]||0)+1,u[k.target.index]=(u[k.target.index]||0)+1;for(w=0,d=new Array(P);w<P;++w)k=e[w],d[w]=u[k.source.index]/(u[k.source.index]+u[k.target.index]);n=new Array(P),j(),a=new Array(P),b()}}function j(){if(s)for(var w=0,N=e.length;w<N;++w)n[w]=+r(e[w],w,e)}function b(){if(s)for(var w=0,N=e.length;w<N;++w)a[w]=+i(e[w],w,e)}return v.initialize=function(w,N){s=w,f=N,g()},v.links=function(w){return arguments.length?(e=w,g(),v):e},v.id=function(w){return arguments.length?(t=w,v):t},v.iterations=function(w){return arguments.length?(h=+w,v):h},v.strength=function(w){return arguments.length?(r=typeof w=="function"?w:is(+w),j(),v):r},v.distance=function(w){return arguments.length?(i=typeof w=="function"?w:is(+w),b(),v):i},v}const Zse=1664525,Jse=1013904223,KC=4294967296;function ele(){let e=1;return()=>(e=(Zse*e+Jse)%KC)/KC}function tle(e){return e.x}function rle(e){return e.y}var nle=10,ile=Math.PI*(3-Math.sqrt(5));function ale(e){var t,r=1,n=.001,i=1-Math.pow(n,1/300),a=0,s=.6,u=new Map,d=Qw(p),f=Gu("tick","end"),h=ele();e==null&&(e=[]);function p(){v(),f.call("tick",t),r<n&&(d.stop(),f.call("end",t))}function v(b){var w,N=e.length,P;b===void 0&&(b=1);for(var E=0;E<b;++E)for(r+=(a-r)*i,u.forEach(function(k){k(r)}),w=0;w<N;++w)P=e[w],P.fx==null?P.x+=P.vx*=s:(P.x=P.fx,P.vx=0),P.fy==null?P.y+=P.vy*=s:(P.y=P.fy,P.vy=0);return t}function g(){for(var b=0,w=e.length,N;b<w;++b){if(N=e[b],N.index=b,N.fx!=null&&(N.x=N.fx),N.fy!=null&&(N.y=N.fy),isNaN(N.x)||isNaN(N.y)){var P=nle*Math.sqrt(.5+b),E=b*ile;N.x=P*Math.cos(E),N.y=P*Math.sin(E)}(isNaN(N.vx)||isNaN(N.vy))&&(N.vx=N.vy=0)}}function j(b){return b.initialize&&b.initialize(e,h),b}return g(),t={tick:v,restart:function(){return d.restart(p),t},stop:function(){return d.stop(),t},nodes:function(b){return arguments.length?(e=b,g(),u.forEach(j),t):e},alpha:function(b){return arguments.length?(r=+b,t):r},alphaMin:function(b){return arguments.length?(n=+b,t):n},alphaDecay:function(b){return arguments.length?(i=+b,t):+i},alphaTarget:function(b){return arguments.length?(a=+b,t):a},velocityDecay:function(b){return arguments.length?(s=1-b,t):1-s},randomSource:function(b){return arguments.length?(h=b,u.forEach(j),t):h},force:function(b,w){return arguments.length>1?(w==null?u.delete(b):u.set(b,j(w)),t):u.get(b)},find:function(b,w,N){var P=0,E=e.length,k,C,T,A,M;for(N==null?N=1/0:N*=N,P=0;P<E;++P)A=e[P],k=b-A.x,C=w-A.y,T=k*k+C*C,T<N&&(M=A,N=T);return M},on:function(b,w){return arguments.length>1?(f.on(b,w),t):f.on(b)}}}function ole(){var e,t,r,n,i=is(-30),a,s=1,u=1/0,d=.81;function f(g){var j,b=e.length,w=e1(e,tle,rle).visitAfter(p);for(n=g,j=0;j<b;++j)t=e[j],w.visit(v)}function h(){if(e){var g,j=e.length,b;for(a=new Array(j),g=0;g<j;++g)b=e[g],a[b.index]=+i(b,g,e)}}function p(g){var j=0,b,w,N=0,P,E,k;if(g.length){for(P=E=k=0;k<4;++k)(b=g[k])&&(w=Math.abs(b.value))&&(j+=b.value,N+=w,P+=w*b.x,E+=w*b.y);g.x=P/N,g.y=E/N}else{b=g,b.x=b.data.x,b.y=b.data.y;do j+=a[b.data.index];while(b=b.next)}g.value=j}function v(g,j,b,w){if(!g.value)return!0;var N=g.x-t.x,P=g.y-t.y,E=w-j,k=N*N+P*P;if(E*E/d<k)return k<u&&(N===0&&(N=mo(r),k+=N*N),P===0&&(P=mo(r),k+=P*P),k<s&&(k=Math.sqrt(s*k)),t.vx+=N*g.value*n/k,t.vy+=P*g.value*n/k),!0;if(g.length||k>=u)return;(g.data!==t||g.next)&&(N===0&&(N=mo(r),k+=N*N),P===0&&(P=mo(r),k+=P*P),k<s&&(k=Math.sqrt(s*k)));do g.data!==t&&(E=a[g.data.index]*n/k,t.vx+=N*E,t.vy+=P*E);while(g=g.next)}return f.initialize=function(g,j){e=g,r=j,h()},f.strength=function(g){return arguments.length?(i=typeof g=="function"?g:is(+g),h(),f):i},f.distanceMin=function(g){return arguments.length?(s=g*g,f):Math.sqrt(s)},f.distanceMax=function(g){return arguments.length?(u=g*g,f):Math.sqrt(u)},f.theta=function(g){return arguments.length?(d=g*g,f):Math.sqrt(d)},f}const Lf=e=>()=>e;function sle(e,{sourceEvent:t,target:r,transform:n,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:i}})}function fa(e,t,r){this.k=e,this.x=t,this.y=r}fa.prototype={constructor:fa,scale:function(e){return e===1?this:new fa(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new fa(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var r1=new fa(1,0,0);fa.prototype;function nx(e){e.stopImmediatePropagation()}function zc(e){e.preventDefault(),e.stopImmediatePropagation()}function lle(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function cle(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function qC(){return this.__zoom||r1}function ule(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function dle(){return navigator.maxTouchPoints||"ontouchstart"in this}function fle(e,t,r){var n=e.invertX(t[0][0])-r[0][0],i=e.invertX(t[1][0])-r[1][0],a=e.invertY(t[0][1])-r[0][1],s=e.invertY(t[1][1])-r[1][1];return e.translate(i>n?(n+i)/2:Math.min(0,n)||Math.max(0,i),s>a?(a+s)/2:Math.min(0,a)||Math.max(0,s))}function hle(){var e=lle,t=cle,r=fle,n=ule,i=dle,a=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],u=250,d=ZU,f=Gu("start","zoom","end"),h,p,v,g=500,j=150,b=0,w=10;function N(R){R.property("__zoom",qC).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",z).on("dblclick.zoom",V).filter(i).on("touchstart.zoom",L).on("touchmove.zoom",K).on("touchend.zoom touchcancel.zoom",te).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}N.transform=function(R,U,F,X){var $=R.selection?R.selection():R;$.property("__zoom",qC),R!==$?C(R,U,F,X):$.interrupt().each(function(){T(this,arguments).event(X).start().zoom(null,typeof U=="function"?U.apply(this,arguments):U).end()})},N.scaleBy=function(R,U,F,X){N.scaleTo(R,function(){var $=this.__zoom.k,Y=typeof U=="function"?U.apply(this,arguments):U;return $*Y},F,X)},N.scaleTo=function(R,U,F,X){N.transform(R,function(){var $=t.apply(this,arguments),Y=this.__zoom,W=F==null?k($):typeof F=="function"?F.apply(this,arguments):F,I=Y.invert(W),H=typeof U=="function"?U.apply(this,arguments):U;return r(E(P(Y,H),W,I),$,s)},F,X)},N.translateBy=function(R,U,F,X){N.transform(R,function(){return r(this.__zoom.translate(typeof U=="function"?U.apply(this,arguments):U,typeof F=="function"?F.apply(this,arguments):F),t.apply(this,arguments),s)},null,X)},N.translateTo=function(R,U,F,X,$){N.transform(R,function(){var Y=t.apply(this,arguments),W=this.__zoom,I=X==null?k(Y):typeof X=="function"?X.apply(this,arguments):X;return r(r1.translate(I[0],I[1]).scale(W.k).translate(typeof U=="function"?-U.apply(this,arguments):-U,typeof F=="function"?-F.apply(this,arguments):-F),Y,s)},X,$)};function P(R,U){return U=Math.max(a[0],Math.min(a[1],U)),U===R.k?R:new fa(U,R.x,R.y)}function E(R,U,F){var X=U[0]-F[0]*R.k,$=U[1]-F[1]*R.k;return X===R.x&&$===R.y?R:new fa(R.k,X,$)}function k(R){return[(+R[0][0]+ +R[1][0])/2,(+R[0][1]+ +R[1][1])/2]}function C(R,U,F,X){R.on("start.zoom",function(){T(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(X).end()}).tween("zoom",function(){var $=this,Y=arguments,W=T($,Y).event(X),I=t.apply($,Y),H=F==null?k(I):typeof F=="function"?F.apply($,Y):F,oe=Math.max(I[1][0]-I[0][0],I[1][1]-I[0][1]),se=$.__zoom,be=typeof U=="function"?U.apply($,Y):U,Ae=d(se.invert(H).concat(oe/se.k),be.invert(H).concat(oe/be.k));return function(de){if(de===1)de=be;else{var Se=Ae(de),J=oe/Se[2];de=new fa(J,H[0]-Se[0]*J,H[1]-Se[1]*J)}W.zoom(null,de)}})}function T(R,U,F){return!F&&R.__zooming||new A(R,U)}function A(R,U){this.that=R,this.args=U,this.active=0,this.sourceEvent=null,this.extent=t.apply(R,U),this.taps=0}A.prototype={event:function(R){return R&&(this.sourceEvent=R),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(R,U){return this.mouse&&R!=="mouse"&&(this.mouse[1]=U.invert(this.mouse[0])),this.touch0&&R!=="touch"&&(this.touch0[1]=U.invert(this.touch0[0])),this.touch1&&R!=="touch"&&(this.touch1[1]=U.invert(this.touch1[0])),this.that.__zoom=U,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(R){var U=dn(this.that).datum();f.call(R,this.that,new sle(R,{sourceEvent:this.sourceEvent,target:N,transform:this.that.__zoom,dispatch:f}),U)}};function M(R,...U){if(!e.apply(this,arguments))return;var F=T(this,U).event(R),X=this.__zoom,$=Math.max(a[0],Math.min(a[1],X.k*Math.pow(2,n.apply(this,arguments)))),Y=oa(R);if(F.wheel)(F.mouse[0][0]!==Y[0]||F.mouse[0][1]!==Y[1])&&(F.mouse[1]=X.invert(F.mouse[0]=Y)),clearTimeout(F.wheel);else{if(X.k===$)return;F.mouse=[Y,X.invert(Y)],Qf(this),F.start()}zc(R),F.wheel=setTimeout(W,j),F.zoom("mouse",r(E(P(X,$),F.mouse[0],F.mouse[1]),F.extent,s));function W(){F.wheel=null,F.end()}}function z(R,...U){if(v||!e.apply(this,arguments))return;var F=R.currentTarget,X=T(this,U,!0).event(R),$=dn(R.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",oe,!0),Y=oa(R,F),W=R.clientX,I=R.clientY;hD(R.view),nx(R),X.mouse=[Y,this.__zoom.invert(Y)],Qf(this),X.start();function H(se){if(zc(se),!X.moved){var be=se.clientX-W,Ae=se.clientY-I;X.moved=be*be+Ae*Ae>b}X.event(se).zoom("mouse",r(E(X.that.__zoom,X.mouse[0]=oa(se,F),X.mouse[1]),X.extent,s))}function oe(se){$.on("mousemove.zoom mouseup.zoom",null),mD(se.view,X.moved),zc(se),X.event(se).end()}}function V(R,...U){if(e.apply(this,arguments)){var F=this.__zoom,X=oa(R.changedTouches?R.changedTouches[0]:R,this),$=F.invert(X),Y=F.k*(R.shiftKey?.5:2),W=r(E(P(F,Y),X,$),t.apply(this,U),s);zc(R),u>0?dn(this).transition().duration(u).call(C,W,X,R):dn(this).call(N.transform,W,X,R)}}function L(R,...U){if(e.apply(this,arguments)){var F=R.touches,X=F.length,$=T(this,U,R.changedTouches.length===X).event(R),Y,W,I,H;for(nx(R),W=0;W<X;++W)I=F[W],H=oa(I,this),H=[H,this.__zoom.invert(H),I.identifier],$.touch0?!$.touch1&&$.touch0[2]!==H[2]&&($.touch1=H,$.taps=0):($.touch0=H,Y=!0,$.taps=1+!!h);h&&(h=clearTimeout(h)),Y&&($.taps<2&&(p=H[0],h=setTimeout(function(){h=null},g)),Qf(this),$.start())}}function K(R,...U){if(this.__zooming){var F=T(this,U).event(R),X=R.changedTouches,$=X.length,Y,W,I,H;for(zc(R),Y=0;Y<$;++Y)W=X[Y],I=oa(W,this),F.touch0&&F.touch0[2]===W.identifier?F.touch0[0]=I:F.touch1&&F.touch1[2]===W.identifier&&(F.touch1[0]=I);if(W=F.that.__zoom,F.touch1){var oe=F.touch0[0],se=F.touch0[1],be=F.touch1[0],Ae=F.touch1[1],de=(de=be[0]-oe[0])*de+(de=be[1]-oe[1])*de,Se=(Se=Ae[0]-se[0])*Se+(Se=Ae[1]-se[1])*Se;W=P(W,Math.sqrt(de/Se)),I=[(oe[0]+be[0])/2,(oe[1]+be[1])/2],H=[(se[0]+Ae[0])/2,(se[1]+Ae[1])/2]}else if(F.touch0)I=F.touch0[0],H=F.touch0[1];else return;F.zoom("touch",r(E(W,I,H),F.extent,s))}}function te(R,...U){if(this.__zooming){var F=T(this,U).event(R),X=R.changedTouches,$=X.length,Y,W;for(nx(R),v&&clearTimeout(v),v=setTimeout(function(){v=null},g),Y=0;Y<$;++Y)W=X[Y],F.touch0&&F.touch0[2]===W.identifier?delete F.touch0:F.touch1&&F.touch1[2]===W.identifier&&delete F.touch1;if(F.touch1&&!F.touch0&&(F.touch0=F.touch1,delete F.touch1),F.touch0)F.touch0[1]=this.__zoom.invert(F.touch0[0]);else if(F.end(),F.taps===2&&(W=oa(W,this),Math.hypot(p[0]-W[0],p[1]-W[1])<w)){var I=dn(this).on("dblclick.zoom");I&&I.apply(this,arguments)}}}return N.wheelDelta=function(R){return arguments.length?(n=typeof R=="function"?R:Lf(+R),N):n},N.filter=function(R){return arguments.length?(e=typeof R=="function"?R:Lf(!!R),N):e},N.touchable=function(R){return arguments.length?(i=typeof R=="function"?R:Lf(!!R),N):i},N.extent=function(R){return arguments.length?(t=typeof R=="function"?R:Lf([[+R[0][0],+R[0][1]],[+R[1][0],+R[1][1]]]),N):t},N.scaleExtent=function(R){return arguments.length?(a[0]=+R[0],a[1]=+R[1],N):[a[0],a[1]]},N.translateExtent=function(R){return arguments.length?(s[0][0]=+R[0][0],s[1][0]=+R[1][0],s[0][1]=+R[0][1],s[1][1]=+R[1][1],N):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},N.constrain=function(R){return arguments.length?(r=R,N):r},N.duration=function(R){return arguments.length?(u=+R,N):u},N.interpolate=function(R){return arguments.length?(d=R,N):d},N.on=function(){var R=f.on.apply(f,arguments);return R===f?N:R},N.clickDistance=function(R){return arguments.length?(b=(R=+R)*R,N):Math.sqrt(b)},N.tapDistance=function(R){return arguments.length?(w=+R,N):w},N}const $f=25,mle=10,ple=150,vle=-300,gle=800,HC=600,yle="hsl(var(--chart-1))",xle="hsl(var(--chart-5))",ble="hsl(var(--destructive))",VC="hsl(var(--muted-foreground))",wle="hsl(var(--muted-foreground))",YC="hsl(var(--background))";function jle({nodes:e,nodeStats:t,viewToggle:r}){const n=y.useRef(null),i=y.useRef(null),a=y.useRef(null),s=y.useRef(new Map),[u,d]=y.useState(gle);y.useEffect(()=>{if(!i.current)return;const w=new ResizeObserver(N=>{for(const P of N){const E=P.contentRect.width;E>0&&d(E)}});return w.observe(i.current),()=>w.disconnect()},[]);const{graphNodes:f,graphLinks:h}=y.useMemo(()=>{if(!e||e.length===0)return{graphNodes:[],graphLinks:[]};const w=e.map(P=>{const E=s.current.get(P.id);return{id:P.id,address:P.address,role:P.flags.includes("master")?"master":"replica",masterId:P.master&&P.master!=="-"?P.master:void 0,slots:P.slots,stats:t==null?void 0:t.find(k=>k.nodeId===P.id),healthy:P.linkState==="connected"&&!P.flags.includes("fail"),x:E==null?void 0:E.x,y:E==null?void 0:E.y}}),N=[];for(const P of w)P.role==="replica"&&P.masterId&&N.push({source:P.masterId,target:P.id,type:"replication"});return{graphNodes:w,graphLinks:N}},[e,t]);y.useEffect(()=>{if(!n.current||f.length===0)return;const w=dn(n.current);w.selectAll("*").remove();const N=u,P=HC,E=w.append("g"),k=hle().scaleExtent([.1,4]).on("zoom",L=>{E.attr("transform",L.transform)});a.current=k,w.call(k);const C=f.some(L=>L.x===void 0||L.y===void 0),T=ale(f).force("link",Qse(h).id(L=>L.id).distance(ple)).force("charge",ole().strength(vle)).force("center",Ose(N/2,P/2)).force("collision",Gse().radius($f+mle)).alpha(C?1:0).alphaDecay(C?.0228:1),A=E.append("g").selectAll("line").data(h).join("line").attr("stroke",VC).attr("stroke-width",2).attr("stroke-dasharray","5,5").attr("marker-end","url(#arrowhead)");w.append("defs").append("marker").attr("id","arrowhead").attr("viewBox","0 -5 10 10").attr("refX",$f+15).attr("refY",0).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M0,-5L10,0L0,5").attr("fill",VC);const z=yoe().on("start",function(L,K){L.active||T.alphaTarget(.3).restart(),K.fx=K.x,K.fy=K.y}).on("drag",function(L,K){K.fx=L.x,K.fy=L.y}).on("end",function(L,K){L.active||T.alphaTarget(0),K.fx=null,K.fy=null,K.x!==void 0&&K.y!==void 0&&s.current.set(K.id,{x:K.x,y:K.y})}),V=E.append("g").selectAll("g").data(f).join("g").call(z);return V.append("circle").attr("r",$f).attr("fill",L=>L.healthy?L.role==="master"?yle:xle:ble).attr("stroke",YC).attr("stroke-width",3),V.append("text").text(L=>{const K=L.address.split(":")[0];return K.length>12?K.substring(0,12)+"...":K}).attr("text-anchor","middle").attr("dy",$f+15).attr("fill",wle).attr("font-size","11px").attr("font-weight","bold"),V.append("text").text(L=>L.role==="master"?"M":"R").attr("text-anchor","middle").attr("dy",5).attr("fill",YC).attr("font-size","14px").attr("font-weight","bold"),V.append("title").text(L=>{const K=Hc(L.slots);return`${L.address}
308
+ Role: ${L.role}
309
+ Slots: ${K>0?K.toLocaleString():"none"}
310
+ Memory: ${L.stats?Bf(L.stats.memoryUsed):"N/A"}
311
+ Ops/sec: ${L.stats?L.stats.opsPerSec.toLocaleString():"N/A"}
312
+ Clients: ${L.stats?L.stats.connectedClients:"N/A"}`}),T.on("tick",()=>{A.attr("x1",L=>L.source.x||0).attr("y1",L=>L.source.y||0).attr("x2",L=>L.target.x||0).attr("y2",L=>L.target.y||0),V.attr("transform",L=>`translate(${L.x||0},${L.y||0})`)}),T.on("end",()=>{f.forEach(L=>{L.x!==void 0&&L.y!==void 0&&s.current.set(L.id,{x:L.x,y:L.y})})}),()=>{T.stop()}},[f,h,u]);const p=y.useCallback(()=>{!n.current||!a.current||dn(n.current).transition().duration(300).call(a.current.scaleBy,1.3)},[]),v=y.useCallback(()=>{!n.current||!a.current||dn(n.current).transition().duration(300).call(a.current.scaleBy,.7)},[]),g=y.useCallback(()=>{!n.current||!a.current||dn(n.current).transition().duration(300).call(a.current.transform,r1)},[]);if(f.length===0)return l.jsx(ae,{children:l.jsx(ce,{className:"p-6",children:l.jsx("div",{className:"text-center text-muted-foreground",children:"No cluster nodes available"})})});const j=f.filter(w=>w.role==="master").length,b=f.filter(w=>w.role==="replica").length;return l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs(he,{className:"flex items-center gap-2",children:[l.jsx(wR,{className:"w-5 h-5"}),"Cluster Topology Graph"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(Ve,{variant:"outline",className:"bg-[hsl(var(--chart-1))]/10 text-[hsl(var(--chart-1))] border-[hsl(var(--chart-1))]/20",children:[j," Masters"]}),l.jsxs(Ve,{variant:"outline",className:"bg-[hsl(var(--chart-5))]/10 text-[hsl(var(--chart-5))] border-[hsl(var(--chart-5))]/20",children:[b," Replicas"]})]})]}),r]})}),l.jsx(ce,{children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("div",{className:"w-3 h-3 rounded-full bg-[hsl(var(--chart-1))]"}),l.jsx("span",{children:"Master"})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("div",{className:"w-3 h-3 rounded-full bg-[hsl(var(--chart-5))]"}),l.jsx("span",{children:"Replica"})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("div",{className:"w-3 h-3 rounded-full bg-[hsl(var(--destructive))]"}),l.jsx("span",{children:"Unhealthy"})]})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("button",{onClick:p,className:"p-2 hover:bg-muted rounded-md transition-colors",title:"Zoom In",children:l.jsx(cre,{className:"w-4 h-4"})}),l.jsx("button",{onClick:v,className:"p-2 hover:bg-muted rounded-md transition-colors",title:"Zoom Out",children:l.jsx(dre,{className:"w-4 h-4"})}),l.jsx("button",{onClick:g,className:"p-2 hover:bg-muted rounded-md transition-colors",title:"Reset Zoom",children:l.jsx(Ute,{className:"w-4 h-4"})})]})]}),l.jsx("div",{ref:i,className:"border rounded-lg bg-muted/20 overflow-hidden",children:l.jsx("svg",{ref:n,width:"100%",height:HC,style:{cursor:"grab"}})}),l.jsxs("div",{className:"text-xs text-muted-foreground",children:[l.jsx("strong",{children:"Drag"})," nodes to reposition | ",l.jsx("strong",{children:"Scroll"})," to zoom | ",l.jsx("strong",{children:"Hover"})," for details"]})]})})]})}function Sle({nodes:e,nodeStats:t}){const[r,n]=y.useState(new Set),[i,a]=y.useState("grid"),s=y.useMemo(()=>{const v=e.filter(j=>j.flags.includes("master")),g=new Map;return e.forEach(j=>{if(j.flags.includes("slave")||j.flags.includes("replica")){const b=j.master;g.has(b)||g.set(b,[]),g.get(b).push(j)}}),v.map(j=>({master:j,replicas:g.get(j.id)||[]}))},[e]),u=v=>{n(g=>{const j=new Set(g);return j.has(v)?j.delete(v):j.add(v),j})},d=v=>v.flags.includes("fail")?"border-red-500":v.flags.includes("pfail")?"border-yellow-500":v.flags.includes("myself")?"border-blue-500":v.linkState==="connected"&&!v.flags.includes("fail")?"border-green-500":"border-muted",f=v=>v.flags.includes("fail")?"bg-red-500/5":v.flags.includes("pfail")?"bg-yellow-500/5":v.flags.includes("myself")?"bg-blue-500/5":"",h=(v,g)=>{const j=r.has(v.id),b=Hc(v.slots),w=d(v),N=f(v);return l.jsxs("div",{className:`border-2 rounded-lg p-3 ${w} ${N} transition-all`,children:[l.jsxs("div",{className:"flex items-start justify-between",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx(du,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),l.jsx("span",{className:"font-mono text-sm truncate",children:v.address}),v.flags.includes("myself")&&l.jsx(Ve,{className:"bg-blue-500/10 text-blue-500 border-0 text-[10px]",children:"MYSELF"})]}),l.jsxs("div",{className:"text-xs text-muted-foreground font-mono truncate",children:[v.id.substring(0,12),"..."]}),g&&v.slots.length>0&&l.jsxs("div",{className:"mt-2 text-xs",children:[l.jsx("span",{className:"text-muted-foreground",children:"Slots: "}),l.jsx("span",{className:"font-medium",children:b.toLocaleString()})]}),l.jsxs("div",{className:"mt-1 flex items-center gap-1",children:[l.jsx(Ve,{className:`text-[10px] ${v.linkState==="connected"?"bg-green-500/10 text-green-500":"bg-red-500/10 text-red-500"} border-0`,children:v.linkState}),v.flags.includes("fail")&&l.jsx(Ve,{className:"bg-red-500/10 text-red-500 border-0 text-[10px]",children:"FAIL"}),v.flags.includes("pfail")&&l.jsx(Ve,{className:"bg-yellow-500/10 text-yellow-500 border-0 text-[10px]",children:"PFAIL"})]})]}),l.jsx("button",{type:"button",onClick:()=>u(v.id),className:"p-1 hover:bg-muted rounded flex-shrink-0","aria-label":j?"Collapse node details":"Expand node details",children:j?l.jsx(_te,{className:"w-4 h-4"}):l.jsx(dp,{className:"w-4 h-4"})})]}),j&&l.jsxs("div",{className:"mt-3 pt-3 border-t space-y-2 text-xs",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Config Epoch: "}),l.jsx("span",{className:"font-mono",children:v.configEpoch})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Ping Sent: "}),l.jsx("span",{className:"font-mono",children:v.pingSent})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Pong Received: "}),l.jsx("span",{className:"font-mono",children:v.pongReceived})]}),g&&v.slots.length>0&&l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Slot Ranges: "}),l.jsx("div",{className:"font-mono text-[10px] mt-1 p-2 bg-background rounded max-h-20 overflow-y-auto",children:JR(v.slots)})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Flags: "}),l.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:v.flags.map(P=>l.jsx(Ve,{className:"bg-muted text-[10px]",variant:"outline",children:P},P))})]})]})]},v.id)},p=()=>l.jsxs("div",{className:"flex items-center gap-1 border rounded-md p-1",children:[l.jsxs("button",{onClick:()=>a("grid"),className:`px-3 py-1.5 rounded text-sm flex items-center gap-2 transition-colors ${i==="grid"?"bg-primary text-primary-foreground":"hover:bg-muted"}`,title:"Grid View","aria-label":"Switch to grid view",children:[l.jsx(Lte,{className:"w-4 h-4"}),"Grid"]}),l.jsxs("button",{onClick:()=>a("graph"),className:`px-3 py-1.5 rounded text-sm flex items-center gap-2 transition-colors ${i==="graph"?"bg-primary text-primary-foreground":"hover:bg-muted"}`,title:"Graph View","aria-label":"Switch to graph view",children:[l.jsx(wR,{className:"w-4 h-4"}),"Graph"]})]});return i==="graph"?l.jsx("div",{className:"animate-in fade-in duration-300",children:l.jsx(jle,{nodes:e,nodeStats:t,viewToggle:p()})}):l.jsx("div",{className:"animate-in fade-in duration-300",children:l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx(he,{className:"text-lg",children:"Cluster Topology"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Master nodes with their replicas"})]}),p()]})}),l.jsx(ce,{children:l.jsxs("div",{className:"space-y-6",children:[s.map(({master:v,replicas:g})=>l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-2 uppercase tracking-wide",children:"Master"}),h(v,!0)]}),g.length>0&&l.jsxs("div",{className:"pl-6 border-l-2 border-muted space-y-2",children:[l.jsxs("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:["Replicas (",g.length,")"]}),g.map(j=>h(j,!1))]})]},v.id)),s.length===0&&l.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[l.jsx(du,{className:"w-12 h-12 mx-auto mb-3 opacity-50"}),l.jsx("p",{children:"No cluster nodes found"})]})]})})]})})}function Nle({slotStats:e,nodes:t,hasSlotStats:r}){const n=y.useRef(null),i=y.useRef(null),[a,s]=y.useState(null),u=y.useMemo(()=>eD(t),[t]),d=y.useCallback(()=>{if(!r||!e||!n.current||!i.current)return;const p=n.current,v=i.current,g=p.getContext("2d");if(!g)return;const j=v.clientWidth,b=Math.min(j,800),w=window.devicePixelRatio||1,N=b*w;p.width=N,p.height=N,p.style.width=`${b}px`,p.style.height=`${b}px`,g.scale(w,w);const P=Math.max(...Object.values(e).map(k=>k.key_count),1),E=b/Qs;for(let k=0;k<ol;k++){const C=k%Qs*E,T=Math.floor(k/Qs)*E,A=e[k.toString()];if(A&&A.key_count>0){const z=.1+A.key_count/P*.9;g.fillStyle=`rgba(59, 130, 246, ${z})`}else g.fillStyle="#f3f4f6";const M=E>2?.5:0;g.fillRect(C,T,E-M,E-M)}},[r,e]);y.useEffect(()=>{d()},[d]),y.useEffect(()=>{const p=()=>{d()};return window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[d]);const f=p=>{if(!r||!e||!n.current)return;const g=n.current.getBoundingClientRect(),j=p.clientX-g.left,b=p.clientY-g.top,w=Math.floor(j/g.width*Qs),P=Math.floor(b/g.height*Qs)*Qs+w;if(P>=0&&P<ol){const E=e[P.toString()],k=u.get(P)||"unknown";s({slot:P,x:p.clientX,y:p.clientY,keyCount:(E==null?void 0:E.key_count)||0,nodeId:k})}},h=()=>{s(null)};return r?l.jsxs(ae,{children:[l.jsxs(fe,{children:[l.jsx(he,{className:"text-lg",children:"Slot Heatmap"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Key distribution across 16,384 hash slots"})]}),l.jsx(ce,{children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{ref:i,className:"relative w-full",children:[l.jsx("canvas",{ref:n,className:"border rounded w-full",onMouseMove:f,onMouseLeave:h,style:{cursor:"crosshair",aspectRatio:"1/1"},role:"img","aria-label":e?`Cluster slot heatmap showing key distribution across ${Object.values(e).filter(p=>p.key_count>0).length} populated slots out of ${ol} total slots`:"Cluster slot heatmap"}),a&&l.jsxs("div",{className:"fixed z-50 bg-popover text-popover-foreground px-3 py-2 rounded-md shadow-lg border text-sm pointer-events-none",style:{left:a.x+10,top:a.y+10},children:[l.jsxs("div",{className:"font-medium",children:["Slot ",a.slot]}),l.jsxs("div",{className:"text-muted-foreground",children:["Keys: ",a.keyCount.toLocaleString()]}),l.jsxs("div",{className:"text-xs text-muted-foreground font-mono truncate max-w-[200px]",children:["Node: ",a.nodeId.substring(0,12),"..."]})]})]}),l.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[l.jsx("span",{className:"text-muted-foreground",children:"Key density:"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("div",{className:"w-4 h-4 rounded",style:{backgroundColor:"#f3f4f6"}}),l.jsx("span",{className:"text-xs",children:"Empty"})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("div",{className:"w-4 h-4 rounded",style:{backgroundColor:"rgba(59, 130, 246, 0.3)"}}),l.jsx("span",{className:"text-xs",children:"Low"})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("div",{className:"w-4 h-4 rounded",style:{backgroundColor:"rgba(59, 130, 246, 0.6)"}}),l.jsx("span",{className:"text-xs",children:"Medium"})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("div",{className:"w-4 h-4 rounded",style:{backgroundColor:"rgba(59, 130, 246, 1)"}}),l.jsx("span",{className:"text-xs",children:"High"})]})]})]}),e&&l.jsxs("div",{className:"grid grid-cols-3 gap-4 pt-4 border-t",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Total Keys"}),l.jsx("div",{className:"text-lg font-bold",children:Object.values(e).reduce((p,v)=>p+v.key_count,0).toLocaleString()})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Populated Slots"}),l.jsx("div",{className:"text-lg font-bold",children:Object.values(e).filter(p=>p.key_count>0).length})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Avg Keys/Slot"}),l.jsx("div",{className:"text-lg font-bold",children:(Object.values(e).reduce((p,v)=>p+v.key_count,0)/Math.max(Object.values(e).filter(p=>p.key_count>0).length,1)).toFixed(1)})]})]})]})})]}):l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsx(he,{className:"text-lg",children:"Slot Heatmap"})}),l.jsx(ce,{children:l.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[l.jsx(ns,{className:"w-12 h-12 text-muted-foreground mb-3 opacity-50"}),l.jsx("p",{className:"text-muted-foreground font-medium",children:"Slot statistics not available"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-2 max-w-md",children:"This feature requires Valkey 8.0+ or Redis with CLUSTER SLOT-STATS support. Connect to a compatible cluster to view per-slot key distribution."})]})})]})}function Ple({nodes:e}){const[t,r]=y.useState("address"),[n,i]=y.useState("asc"),[a,s]=y.useState("all"),[u,d]=y.useState(null),f=y.useMemo(()=>{const P=new Map;return e.forEach(E=>P.set(E.id,E)),P},[e]),h=y.useMemo(()=>{let P=e;return a==="masters"?P=e.filter(E=>E.flags.includes("master")):a==="replicas"&&(P=e.filter(E=>E.flags.includes("slave")||E.flags.includes("replica"))),P},[e,a]),p=y.useMemo(()=>{const P=[...h];return P.sort((E,k)=>{let C,T;switch(t){case"address":C=E.address,T=k.address;break;case"role":C=E.flags.includes("master")?"master":"replica",T=k.flags.includes("master")?"master":"replica";break;case"slots":C=Hc(E.slots),T=Hc(k.slots);break;case"state":C=E.linkState,T=k.linkState;break}return C<T?n==="asc"?-1:1:C>T?n==="asc"?1:-1:0}),P},[h,t,n]),v=P=>{t===P?i(n==="asc"?"desc":"asc"):(r(P),i("asc"))},g=P=>{d(u===P?null:P)},j=P=>P.flags.includes("master")?l.jsx(Ve,{className:"bg-blue-500/10 text-blue-500 border-0",children:"Master"}):l.jsx(Ve,{className:"bg-gray-500/10 text-gray-500 border-0",children:"Replica"}),b=P=>P==="connected"?l.jsx(Ve,{className:"bg-green-500/10 text-green-500 border-0",children:"Connected"}):l.jsx(Ve,{className:"bg-red-500/10 text-red-500 border-0",children:"Disconnected"}),w=P=>{if(P.master==="-")return"N/A";const E=f.get(P.master);return(E==null?void 0:E.address)||P.master.substring(0,8)},N=[{key:"all",label:"All Nodes"},{key:"masters",label:"Masters"},{key:"replicas",label:"Replicas"}];return l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(he,{className:"text-lg",children:"Cluster Nodes"}),l.jsx("div",{className:"flex gap-2",children:N.map(P=>l.jsx("button",{type:"button",onClick:()=>s(P.key),className:`px-3 py-1.5 rounded text-sm font-medium transition-colors ${a===P.key?"bg-primary text-primary-foreground":"bg-muted hover:bg-muted/80"}`,children:P.label},P.key))})]})}),l.jsxs(ce,{children:[l.jsxs(Ai,{children:[l.jsx(Ti,{children:l.jsxs(bt,{children:[l.jsx(Me,{className:"w-12"}),l.jsxs(Me,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>v("address"),children:["Address ",t==="address"&&(n==="asc"?"↑":"↓")]}),l.jsxs(Me,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>v("role"),children:["Role ",t==="role"&&(n==="asc"?"↑":"↓")]}),l.jsxs(Me,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>v("state"),children:["State ",t==="state"&&(n==="asc"?"↑":"↓")]}),l.jsxs(Me,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>v("slots"),children:["Slots ",t==="slots"&&(n==="asc"?"↑":"↓")]}),l.jsx(Me,{children:"Master"})]})}),l.jsx(Mi,{children:p.map(P=>{const E=u===P.id,k=P.flags.includes("master"),C=Hc(P.slots);return l.jsxs(y.Fragment,{children:[l.jsxs(bt,{className:"cursor-pointer",onClick:()=>g(P.id),children:[l.jsx(Oe,{children:E?l.jsx(dp,{className:"w-4 h-4"}):l.jsx(Uw,{className:"w-4 h-4"})}),l.jsx(Oe,{className:"font-mono text-sm",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(du,{className:"w-4 h-4 text-muted-foreground"}),P.address,P.flags.includes("myself")&&l.jsx(Ve,{className:"bg-blue-500/10 text-blue-500 border-0 text-[10px]",children:"MYSELF"})]})}),l.jsx(Oe,{children:j(P)}),l.jsx(Oe,{children:b(P.linkState)}),l.jsx(Oe,{children:k?l.jsx("span",{className:"font-medium",children:C.toLocaleString()}):l.jsx("span",{className:"text-muted-foreground",children:"N/A"})}),l.jsx(Oe,{children:k?l.jsx("span",{className:"text-muted-foreground",children:"-"}):l.jsx("span",{className:"text-sm text-muted-foreground font-mono",children:w(P)})})]}),E&&l.jsx(bt,{children:l.jsx(Oe,{colSpan:6,className:"bg-muted/30",children:l.jsxs("div",{className:"p-4 space-y-3 text-sm",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Node ID:"}),l.jsxs("div",{className:"font-mono text-xs flex items-center gap-2 mt-1",children:[P.id,l.jsx("button",{type:"button",onClick:T=>{T.stopPropagation(),navigator.clipboard.writeText(P.id)},className:"p-1 hover:bg-muted rounded",title:"Copy node ID","aria-label":"Copy node ID",children:l.jsx(Mte,{className:"w-3 h-3"})})]})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Flags:"}),l.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:P.flags.map(T=>l.jsx(Ve,{className:"bg-muted text-xs",variant:"outline",children:T},T))})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Ping Sent:"}),l.jsx("div",{className:"font-mono mt-1",children:P.pingSent})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Pong Received:"}),l.jsx("div",{className:"font-mono mt-1",children:P.pongReceived})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Config Epoch:"}),l.jsx("div",{className:"font-mono mt-1",children:P.configEpoch})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Link State:"}),l.jsx("div",{className:"mt-1",children:b(P.linkState)})]})]}),k&&P.slots.length>0&&l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Slot Ranges:"}),l.jsx("div",{className:"font-mono text-xs mt-1 p-2 bg-background rounded",children:JR(P.slots)})]})]})})})]},P.id)})})]}),p.length===0&&l.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No nodes found in the selected filter"})]})]})}function kle({nodeStats:e}){const t=e||[],{means:r,imbalancedNodes:n}=y.useMemo(()=>{if(t.length===0)return{means:{memory:0,ops:0,clients:0},imbalancedNodes:[]};const s={memory:t.reduce((d,f)=>d+f.memoryUsed,0)/t.length,ops:t.reduce((d,f)=>d+f.opsPerSec,0)/t.length,clients:t.reduce((d,f)=>d+f.connectedClients,0)/t.length},u=t.filter(d=>{const f=Math.abs(d.memoryUsed-s.memory)/(s.memory||1),h=Math.abs(d.opsPerSec-s.ops)/(s.ops||1),p=Math.abs(d.connectedClients-s.clients)/(s.clients||1);return f>.2||h>.2||p>.2});return{means:s,imbalancedNodes:u}},[t]);if(t.length===0)return l.jsx(ae,{children:l.jsx(ce,{className:"p-6",children:l.jsx("div",{className:"text-center text-muted-foreground",children:"No node statistics available"})})});const i=s=>n.some(u=>u.nodeId===s),a=(s,u)=>Math.abs(s-u)/(u||1)>.2?"text-yellow-500":"text-muted-foreground";return l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsxs(he,{className:"flex items-center gap-2",children:[l.jsx(uu,{className:"w-5 h-5"}),"Node Performance Comparison"]})}),l.jsxs(ce,{className:"space-y-6",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(qc,{className:"w-4 h-4 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-medium",children:"Memory Usage"})]}),l.jsxs("span",{className:"text-xs text-muted-foreground",children:["Avg: ",Bf(r.memory)]})]}),l.jsx("div",{className:"space-y-2",children:t.map(s=>{const u=s.memoryUsed/s.memoryPeak*100,d=i(s.nodeId);return l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between text-xs",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:a(s.memoryUsed,r.memory),children:s.nodeAddress}),l.jsx(Ve,{variant:"outline",className:"text-xs",children:s.role}),d&&l.jsx(gs,{className:"w-3 h-3 text-yellow-500"})]}),l.jsxs("span",{className:"font-medium",children:[Bf(s.memoryUsed)," / ",Bf(s.memoryPeak)]})]}),l.jsx("div",{className:"w-full bg-muted rounded-full h-2",children:l.jsx("div",{className:`h-2 rounded-full transition-all ${d?"bg-yellow-500":"bg-blue-500"}`,style:{width:`${Math.min(u,100)}%`}})})]},s.nodeId)})})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(uu,{className:"w-4 h-4 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-medium",children:"Operations/sec"})]}),l.jsxs("span",{className:"text-xs text-muted-foreground",children:["Avg: ",r.ops.toFixed(0)]})]}),l.jsx("div",{className:"space-y-2",children:t.map(s=>{const u=Math.max(...t.map(h=>h.opsPerSec)),d=u>0?s.opsPerSec/u*100:0,f=i(s.nodeId);return l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between text-xs",children:[l.jsx("span",{className:a(s.opsPerSec,r.ops),children:s.nodeAddress}),l.jsx("span",{className:"font-medium",children:s.opsPerSec.toLocaleString()})]}),l.jsx("div",{className:"w-full bg-muted rounded-full h-2",children:l.jsx("div",{className:`h-2 rounded-full transition-all ${f?"bg-yellow-500":"bg-green-500"}`,style:{width:`${d}%`}})})]},s.nodeId)})})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(SR,{className:"w-4 h-4 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-medium",children:"Connected Clients"})]}),l.jsxs("span",{className:"text-xs text-muted-foreground",children:["Avg: ",r.clients.toFixed(0)]})]}),l.jsx("div",{className:"space-y-2",children:t.map(s=>{const u=Math.max(...t.map(h=>h.connectedClients)),d=u>0?s.connectedClients/u*100:0,f=i(s.nodeId);return l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between text-xs",children:[l.jsx("span",{className:a(s.connectedClients,r.clients),children:s.nodeAddress}),l.jsxs("span",{className:"font-medium",children:[s.connectedClients," clients"]})]}),l.jsx("div",{className:"w-full bg-muted rounded-full h-2",children:l.jsx("div",{className:`h-2 rounded-full transition-all ${f?"bg-yellow-500":"bg-purple-500"}`,style:{width:`${d}%`}})})]},s.nodeId)})})]}),n.length>0&&l.jsx("div",{className:"pt-3 border-t",children:l.jsxs("div",{className:"flex items-center gap-2 text-xs text-yellow-600",children:[l.jsx(gs,{className:"w-3 h-3"}),l.jsxs("span",{children:[n.length," node",n.length!==1?"s":""," showing significant deviation (>20%) from cluster average"]})]})})]})]})}function _le(e=100){const{data:t,error:r,loading:n,refresh:i}=Ke({fetcher:f=>ze.getClusterSlowlog(e,f),interval:1e4,enabled:!0}),a=t||[],s=y.useMemo(()=>{const f=new Map;for(const h of a){const p=f.get(h.nodeId)||[];p.push(h),f.set(h.nodeId,p)}return f},[a]),u=y.useMemo(()=>{var v;if(s.size===0)return null;let f=0,h=null,p=null;for(const[g,j]of s.entries())j.length>f&&(f=j.length,h=g,p=((v=j[0])==null?void 0:v.nodeAddress)||null);return h?{nodeId:h,nodeAddress:p,count:f}:null},[s]),d=y.useMemo(()=>Array.from(new Set(a.map(f=>f.nodeId))),[a]);return{entries:a,byNode:s,slowestNode:u,nodeIds:d,isLoading:n,error:r,refresh:i}}const GC=1e3,XC=1e6,Ele=1e5,Cle=1e6;function Ole(){const{entries:e,nodeIds:t,slowestNode:r,isLoading:n,error:i}=_le(100),[a,s]=y.useState("all"),[u,d]=y.useState("duration"),f=y.useMemo(()=>(a==="all"?e:e.filter(g=>g.nodeId===a)).sort((g,j)=>u==="duration"?j.duration-g.duration:j.timestamp-g.timestamp),[e,a,u]);if(n)return l.jsx(ae,{children:l.jsx(ce,{className:"p-6",children:l.jsx("div",{className:"text-center text-muted-foreground",children:"Loading cluster slowlog..."})})});if(i)return l.jsx(ae,{children:l.jsx(ce,{className:"p-6",children:l.jsxs("div",{className:"text-center text-red-500",children:["Error loading slowlog: ",i.message]})})});const h=v=>v<GC?`${v}μs`:v<XC?`${(v/GC).toFixed(2)}ms`:`${(v/XC).toFixed(2)}s`,p=v=>new Date(v*1e3).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"});return l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs(he,{className:"flex items-center gap-2",children:[l.jsx(bR,{className:"w-5 h-5"}),"Cluster Slowlog"]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("select",{value:u,onChange:v=>d(v.target.value),className:"px-3 py-2 border rounded-md text-sm bg-background",children:[l.jsx("option",{value:"duration",children:"By Duration"}),l.jsx("option",{value:"timestamp",children:"By Time"})]}),l.jsxs("select",{value:a,onChange:v=>s(v.target.value),className:"px-3 py-2 border rounded-md text-sm bg-background",children:[l.jsxs("option",{value:"all",children:["All Nodes (",e.length,")"]}),t.map(v=>{var b;const g=e.filter(w=>w.nodeId===v),j=((b=g[0])==null?void 0:b.nodeAddress)||v.substring(0,8);return l.jsxs("option",{value:v,children:[j," (",g.length,")"]},v)})]})]})]})}),l.jsxs(ce,{children:[r&&a==="all"&&l.jsxs("div",{className:"mb-4 p-3 bg-yellow-500/10 border border-yellow-500/20 rounded-lg flex items-start gap-2",children:[l.jsx(fp,{className:"w-4 h-4 text-yellow-500 mt-0.5"}),l.jsxs("div",{className:"text-sm",children:[l.jsxs("span",{className:"font-medium",children:["Node ",r.nodeAddress]})," has the most slow queries (",r.count," entries)"]})]}),f.length===0?l.jsx("div",{className:"text-center text-muted-foreground py-8",children:"No slow queries found"}):l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"grid grid-cols-12 gap-2 text-xs font-medium text-muted-foreground pb-2 border-b",children:[l.jsx("div",{className:"col-span-2",children:"Duration"}),l.jsx("div",{className:"col-span-2",children:"Node"}),l.jsx("div",{className:"col-span-4",children:"Command"}),l.jsx("div",{className:"col-span-2",children:"Client"}),l.jsx("div",{className:"col-span-2",children:"Time"})]}),l.jsx("div",{className:"space-y-1 max-h-[500px] overflow-y-auto",children:f.map(v=>{const g=v.duration>Cle?"text-red-500":v.duration>Ele?"text-yellow-500":"text-muted-foreground";return l.jsxs("div",{className:"grid grid-cols-12 gap-2 text-sm py-2 hover:bg-muted/50 rounded px-2",children:[l.jsx("div",{className:`col-span-2 font-mono font-medium ${g}`,children:h(v.duration)}),l.jsx("div",{className:"col-span-2",children:l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(du,{className:"w-3 h-3 text-muted-foreground"}),l.jsx("span",{className:"text-xs truncate",title:v.nodeAddress,children:v.nodeAddress.split(":")[0]})]})}),l.jsx("div",{className:"col-span-4 font-mono text-xs truncate",title:v.command.join(" "),children:v.command.join(" ")}),l.jsx("div",{className:"col-span-2 text-xs truncate",title:v.clientAddress,children:v.clientName||v.clientAddress}),l.jsx("div",{className:"col-span-2 text-xs text-muted-foreground",children:p(v.timestamp)})]},`${v.nodeId}-${v.id}`)})})]})]})]})}function Ale(e,t){const r=y.useMemo(()=>{if(!e||e.length===0)return[];const s=[],u=e.filter(d=>d.flags.includes("slave")||d.flags.includes("replica"));for(const d of u){const f=d.master&&d.master!=="-"?d.master:void 0;if(!f)continue;const h=e.find(g=>g.id===f);if(!h)continue;const p=t==null?void 0:t.find(g=>g.nodeId===d.id),v=t==null?void 0:t.find(g=>g.nodeId===h.id);if(p&&v){const g=v.replicationOffset||0,j=p.replicationOffset||0,b=g-j,w=(p.masterLastIoSecondsAgo||0)*1e3,N=p.masterLinkStatus==="up"?"up":"down";let P;N==="down"?P="disconnected":b===0?P="in-sync":b<1e3&&w<100?P="slight-lag":P="lagging",s.push({masterId:h.id,masterAddress:h.address,replicaId:d.id,replicaAddress:d.address,offsetDiff:b,lagMs:w,linkStatus:N,status:P})}else{const g=d.linkState==="connected"&&!d.flags.includes("fail"),j=g?"up":"down",b=g?"in-sync":"disconnected";s.push({masterId:h.id,masterAddress:h.address,replicaId:d.id,replicaAddress:d.address,offsetDiff:0,lagMs:0,linkStatus:j,status:b})}}return s},[e,t]),n=y.useMemo(()=>r.some(s=>s.status==="lagging"||s.status==="disconnected"),[r]),i=y.useMemo(()=>r.length===0?0:Math.max(...r.map(s=>s.lagMs)),[r]),a=y.useMemo(()=>r.length===0?0:Math.max(...r.map(s=>s.offsetDiff)),[r]);return{lagData:r,hasLaggingReplicas:n,maxLagMs:i,maxOffsetDiff:a}}function Tle({nodes:e,nodeStats:t}){const{lagData:r,hasLaggingReplicas:n,maxLagMs:i,maxOffsetDiff:a}=Ale(e,t),s=t&&t.length>0;if(r.length===0)return l.jsx(ae,{children:l.jsx(ce,{className:"p-6",children:l.jsx("div",{className:"text-center text-muted-foreground",children:"No replication relationships found"})})});const u=f=>{switch(f){case"in-sync":return{icon:Kw,color:"text-green-500",bg:"bg-green-500/10",label:"In Sync"};case"slight-lag":return{icon:gs,color:"text-blue-500",bg:"bg-blue-500/10",label:"Slight Lag"};case"lagging":return{icon:gs,color:"text-yellow-500",bg:"bg-yellow-500/10",label:"Lagging"};case"disconnected":return{icon:xR,color:"text-red-500",bg:"bg-red-500/10",label:"Disconnected"}}},d=r.reduce((f,h)=>(f[h.masterId]||(f[h.masterId]=[]),f[h.masterId].push(h),f),{});return l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs(he,{className:"flex items-center gap-2",children:[l.jsx(dC,{className:"w-5 h-5"}),"Replication Status"]}),n&&l.jsx(Ve,{variant:"outline",className:"bg-yellow-500/10 text-yellow-500 border-yellow-500/20",children:"Issues Detected"})]})}),l.jsxs(ce,{className:"space-y-6",children:[!s&&l.jsx("div",{className:"px-4 py-3 bg-blue-500/10 border border-blue-500/20 rounded-lg text-sm text-blue-700 dark:text-blue-400",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ns,{className:"w-4 h-4 flex-shrink-0"}),l.jsxs("div",{children:[l.jsx("strong",{children:"Basic replication info shown."})," Detailed lag metrics are unavailable because individual node connections cannot be established. The topology and health status are still accurate."]})]})}),l.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Total Replicas"}),l.jsx("div",{className:"text-2xl font-bold",children:r.length})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Max Lag (time)"}),l.jsx("div",{className:"text-2xl font-bold",children:i<1e3?`${i}ms`:`${(i/1e3).toFixed(1)}s`})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Max Offset Diff"}),l.jsx("div",{className:"text-2xl font-bold",children:a.toLocaleString()})]})]}),l.jsx("div",{className:"space-y-4",children:Object.entries(d).map(([f,h])=>{var v;const p=((v=h[0])==null?void 0:v.masterAddress)||f.substring(0,8);return l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2 font-medium",children:[l.jsx(dC,{className:"w-4 h-4 text-blue-500"}),l.jsxs("span",{className:"text-sm",children:["Master: ",p]}),l.jsx(Ve,{variant:"outline",className:"text-xs",children:"primary"})]}),l.jsx("div",{className:"ml-6 space-y-2",children:h.map(g=>{const j=u(g.status),b=j.icon;return l.jsxs("div",{className:`p-3 rounded-lg border ${g.status==="lagging"||g.status==="disconnected"?"border-yellow-500/30 bg-yellow-500/5":"border-muted"}`,children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(b,{className:`w-4 h-4 ${j.color}`}),l.jsx("span",{className:"text-sm font-medium",children:g.replicaAddress}),l.jsx(Ve,{className:`${j.bg} ${j.color} border-0 text-xs`,children:j.label})]}),l.jsx("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:g.linkStatus==="up"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("span",{className:"font-medium",children:"Offset Diff:"})," ",l.jsx("span",{className:g.offsetDiff>1e3?"text-yellow-500":"",children:g.offsetDiff.toLocaleString()})]}),l.jsxs("div",{children:[l.jsx("span",{className:"font-medium",children:"Lag:"})," ",l.jsx("span",{className:g.lagMs>100?"text-yellow-500":"",children:g.lagMs<1e3?`${g.lagMs}ms`:`${(g.lagMs/1e3).toFixed(1)}s`})]})]}):l.jsx("div",{className:"text-red-500 font-medium",children:"Link Down"})})]}),g.status==="lagging"&&l.jsx("div",{className:"mt-2 text-xs text-yellow-600",children:"⚠️ Replica is lagging behind master. Consider investigating replication performance."}),g.status==="disconnected"&&l.jsx("div",{className:"mt-2 text-xs text-red-600",children:"⚠️ Replica link is down. Check network connectivity and replication configuration."})]},g.replicaId)})})]},f)})}),l.jsx("div",{className:"pt-4 border-t",children:l.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[l.jsxs("div",{children:[l.jsx("strong",{children:"In Sync:"})," Offset difference is 0"]}),l.jsxs("div",{children:[l.jsx("strong",{children:"Slight Lag:"})," Offset difference < 1000 and lag < 100ms"]}),l.jsxs("div",{children:[l.jsx("strong",{children:"Lagging:"})," Significant offset difference or lag > 100ms"]}),l.jsxs("div",{children:[l.jsx("strong",{children:"Disconnected:"})," Master link is down"]})]})})]})]})}function Mle({migrations:e}){const t=e||[];return l.jsxs(ae,{children:[l.jsx(fe,{children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs(he,{className:"flex items-center gap-2",children:[l.jsx(qc,{className:"w-5 h-5"}),"Slot Migrations"]}),t.length>0&&l.jsxs(Ve,{variant:"outline",className:"bg-blue-500/10 text-blue-500 border-blue-500/20",children:[t.length," Active"]})]})}),l.jsx(ce,{children:t.length===0?l.jsxs("div",{className:"text-center py-8",children:[l.jsx(qc,{className:"w-12 h-12 text-muted-foreground mx-auto mb-3"}),l.jsx("div",{className:"text-sm text-muted-foreground",children:"No active slot migrations"})]}):l.jsxs("div",{className:"space-y-4",children:[t.map(r=>{const n=r.state==="migrating"?"text-blue-500":"text-purple-500",i=r.state==="migrating"?"bg-blue-500/10":"bg-purple-500/10";return l.jsxs("div",{className:"p-4 border rounded-lg space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(qc,{className:`w-4 h-4 ${n}`}),l.jsxs("span",{className:"font-medium",children:["Slot ",r.slot]}),l.jsx(Ve,{className:`${i} ${n} border-0 capitalize text-xs`,children:r.state})]}),r.keysRemaining!==void 0&&l.jsxs("div",{className:"text-xs font-medium",children:[r.keysRemaining.toLocaleString()," keys remaining"]})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("div",{className:"flex-1 space-y-1",children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Source"}),l.jsx("div",{className:"text-sm font-medium truncate",title:r.sourceAddress,children:r.sourceAddress})]}),l.jsx(wte,{className:`w-5 h-5 ${n} flex-shrink-0`}),l.jsxs("div",{className:"flex-1 space-y-1",children:[l.jsx("div",{className:"text-xs text-muted-foreground",children:"Target"}),l.jsx("div",{className:"text-sm font-medium truncate",title:r.targetAddress,children:r.targetAddress})]})]})]},`${r.slot}-${r.sourceNodeId}-${r.targetNodeId}`)}),l.jsx("div",{className:"pt-3 border-t text-xs text-muted-foreground",children:l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{children:[l.jsx("strong",{className:"text-blue-500",children:"Migrating:"})," Keys are being moved from source to target"]}),l.jsxs("div",{children:[l.jsx("strong",{className:"text-purple-500",children:"Importing:"})," Keys are being received at target"]})]})})]})})]})}function Ile(){const{currentConnection:e}=Qr(),{isClusterMode:t,isLoading:r,error:n,nodes:i,masters:a,replicas:s,slotStats:u,hasSlotStats:d,health:f,refetch:h}=Cie(),p=y.useCallback(E=>ze.getClusterNodeStats(E),[]),v=y.useCallback(E=>ze.getSlotMigrations(E),[]),g=y.useMemo(()=>t&&i.length>0,[t,i.length]),{data:j}=Ke({fetcher:p,interval:5e3,enabled:g,refetchKey:e==null?void 0:e.id}),{data:b}=Ke({fetcher:v,interval:5e3,enabled:g,refetchKey:e==null?void 0:e.id}),w=y.useMemo(()=>eD(i),[i]),N=y.useMemo(()=>u?Object.entries(u).map(([E,k])=>{const C=parseInt(E,10);return isNaN(C)?null:{slot:C,keyCount:k.key_count,expiresCount:k.expires_count,totalReads:k.total_reads,totalWrites:k.total_writes,nodeId:w.get(C)||"unknown"}}).filter(E=>E!==null&&E.keyCount>0).sort((E,k)=>k.keyCount-E.keyCount).slice(0,10):[],[u,w]),P=E=>{const k=i.find(C=>C.id===E);return(k==null?void 0:k.address)||E.substring(0,12)};return r?l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-3xl font-bold",children:"Cluster Overview"}),l.jsx("p",{className:"text-muted-foreground",children:"Loading cluster information..."})]}),l.jsxs("div",{className:"grid md:grid-cols-4 gap-4",children:[l.jsx(px,{className:"h-[200px]"}),l.jsx(px,{className:"h-[200px] md:col-span-3"})]})]}):t?n?l.jsxs("div",{className:"space-y-6",children:[l.jsx("div",{children:l.jsx("h1",{className:"text-3xl font-bold",children:"Cluster Overview"})}),l.jsx(ae,{children:l.jsx(ce,{className:"pt-6",children:l.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[l.jsx(ns,{className:"w-16 h-16 text-red-500 mb-4 opacity-50"}),l.jsx("h3",{className:"text-xl font-semibold mb-2 text-red-500",children:"Error Loading Cluster"}),l.jsx("p",{className:"text-muted-foreground max-w-md",children:n instanceof Error?n.message:"An unknown error occurred"}),l.jsx("button",{type:"button",onClick:h,className:"mt-4 px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90",children:"Retry"})]})})})]}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-3xl font-bold",children:"Cluster Overview"}),l.jsxs("p",{className:"text-muted-foreground",children:["Monitoring ",a.length," master nodes and ",s.length," replicas"]})]}),l.jsxs("button",{type:"button",onClick:h,className:"flex items-center gap-2 px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",children:[l.jsx(Yte,{className:"w-4 h-4"}),"Refresh"]})]}),l.jsxs(Vw,{defaultValue:"overview",className:"space-y-4",children:[l.jsxs(mp,{children:[l.jsx(ni,{value:"overview",children:"Overview"}),l.jsx(ni,{value:"nodes",children:"Nodes"}),l.jsx(ni,{value:"replication",children:"Replication"}),l.jsx(ni,{value:"slowlog",children:"Slowlog"})]}),l.jsxs(ho,{value:"overview",className:"space-y-4",children:[l.jsxs("div",{className:"grid md:grid-cols-4 gap-4",children:[l.jsx("div",{className:"md:col-span-1",children:l.jsx(Oie,{health:f,masterCount:a.length,replicaCount:s.length})}),l.jsx("div",{className:"md:col-span-3",children:l.jsx(Sle,{nodes:i,nodeStats:j||void 0})})]}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsx(Nle,{slotStats:u,nodes:i,hasSlotStats:d}),l.jsx(Mle,{migrations:b||void 0})]}),l.jsxs(ae,{children:[l.jsxs(fe,{children:[l.jsx(he,{className:"text-lg",children:"Top Slots by Key Count"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Slots with the highest number of keys"})]}),l.jsx(ce,{children:d&&N.length>0?l.jsx("div",{className:"space-y-2",children:N.map((E,k)=>l.jsxs("div",{className:"flex items-center justify-between p-3 bg-muted/30 rounded text-sm",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("div",{className:"text-xs font-medium text-muted-foreground w-6",children:["#",k+1]}),l.jsxs("div",{children:[l.jsxs("div",{className:"font-medium",children:["Slot ",E.slot]}),l.jsx("div",{className:"text-xs text-muted-foreground font-mono",children:P(E.nodeId)})]})]}),l.jsxs("div",{className:"text-right",children:[l.jsx("div",{className:"font-bold",children:E.keyCount.toLocaleString()}),l.jsx("div",{className:"text-xs text-muted-foreground",children:"keys"})]})]},E.slot))}):d?l.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[l.jsx(ns,{className:"w-12 h-12 mx-auto mb-3 opacity-50"}),l.jsx("p",{children:"No keys found in cluster"})]}):l.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[l.jsx(ns,{className:"w-12 h-12 mx-auto mb-3 opacity-50"}),l.jsx("p",{className:"text-sm",children:"Slot statistics not available"}),l.jsx("p",{className:"text-xs mt-1",children:"Requires Valkey 8.0+"})]})})]})]}),l.jsxs(ho,{value:"nodes",className:"space-y-4",children:[l.jsx(kle,{nodeStats:j||void 0}),l.jsx(Ple,{nodes:i})]}),l.jsx(ho,{value:"replication",className:"space-y-4",children:l.jsx(Tle,{nodes:i,nodeStats:j||void 0})}),l.jsx(ho,{value:"slowlog",className:"space-y-4",children:l.jsx(Ole,{})})]})]}):l.jsxs("div",{className:"space-y-6",children:[l.jsx("div",{children:l.jsx("h1",{className:"text-3xl font-bold",children:"Cluster Overview"})}),l.jsx(ae,{children:l.jsx(ce,{className:"pt-6",children:l.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[l.jsx(du,{className:"w-16 h-16 text-muted-foreground mb-4 opacity-50"}),l.jsx("h3",{className:"text-xl font-semibold mb-2",children:"Standalone Mode"}),l.jsx("p",{className:"text-muted-foreground max-w-md",children:"This instance is running in standalone mode. Cluster features are available when connected to a Valkey/Redis cluster."})]})})})]})}function Rle(){const{currentConnection:e}=Qr(),[t,r]=y.useState(!0),[n,i]=y.useState(!1),[a,s]=y.useState(null),[u,d]=y.useState("defaults"),[f,h]=y.useState(!1),[p,v]=y.useState("audit"),[g,j]=y.useState({}),[b,w]=y.useState(!1);y.useEffect(()=>{N()},[e==null?void 0:e.id]);const N=async()=>{try{r(!0);const A=await Vf.getSettings();s(A.settings),j(A.settings),d(A.source),h(A.requiresRestart),w(!1)}catch(A){console.error("Failed to load settings:",A)}finally{r(!1)}},P=(A,M)=>{j(z=>({...z,[A]:M})),w(!0)},E=async()=>{if(a)try{i(!0);const A={};Object.keys(g).forEach(z=>{g[z]!==a[z]&&z!=="id"&&z!=="createdAt"&&z!=="updatedAt"&&(A[z]=g[z])});const M=await Vf.updateSettings(A);s(M.settings),j(M.settings),d(M.source),h(M.requiresRestart),w(!1)}catch(A){console.error("Failed to save settings:",A),alert("Failed to save settings. Please try again.")}finally{i(!1)}},k=()=>{a&&(j(a),w(!1))},C=async()=>{if(confirm("Are you sure you want to reset all settings to defaults? This will require a restart."))try{i(!0);const A=await Vf.resetSettings();s(A.settings),j(A.settings),d(A.source),h(A.requiresRestart),w(!1)}catch(A){console.error("Failed to reset settings:",A),alert("Failed to reset settings. Please try again.")}finally{i(!1)}};if(t)return l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx("div",{className:"text-lg text-gray-500",children:"Loading settings..."})});const T=[{id:"audit",label:"Audit Trail"},{id:"clientAnalytics",label:"Client Analytics"},{id:"anomaly",label:"Anomaly Detection"}];return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-3xl font-bold",children:"Settings"}),l.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Configure application settings"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(Ve,{variant:"secondary",children:["Source: ",u]}),f&&l.jsx(Ve,{variant:"destructive",children:"Restart Required"})]})]}),l.jsxs("div",{className:"flex gap-6",children:[l.jsx("aside",{className:"w-64 space-y-2",children:T.map(A=>l.jsx("button",{onClick:()=>v(A.id),className:`w-full text-left px-4 py-3 rounded-lg transition-colors ${p===A.id?"bg-blue-100 text-blue-900 font-medium":"hover:bg-gray-100"}`,children:A.label},A.id))}),l.jsx("div",{className:"flex-1",children:l.jsxs(ae,{className:"p-6",children:[p==="audit"&&l.jsxs("div",{className:"space-y-4",children:[l.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Audit Trail"}),l.jsx("p",{className:"text-sm text-gray-500",children:"These settings take effect within 30 seconds without requiring a restart."}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium mb-1",children:"Poll Interval (ms)"}),l.jsx("input",{type:"number",value:g.auditPollIntervalMs||6e4,onChange:A=>P("auditPollIntervalMs",parseInt(A.target.value)),className:"w-full px-3 py-2 border rounded-md"})]})]}),p==="clientAnalytics"&&l.jsxs("div",{className:"space-y-4",children:[l.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Client Analytics"}),l.jsx("p",{className:"text-sm text-gray-500",children:"These settings take effect within 30 seconds without requiring a restart."}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium mb-1",children:"Poll Interval (ms)"}),l.jsx("input",{type:"number",value:g.clientAnalyticsPollIntervalMs||6e4,onChange:A=>P("clientAnalyticsPollIntervalMs",parseInt(A.target.value)),className:"w-full px-3 py-2 border rounded-md"})]})]}),p==="anomaly"&&l.jsxs("div",{className:"space-y-4",children:[l.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Anomaly Detection"}),l.jsx("p",{className:"text-sm text-gray-500",children:"These settings take effect within 30 seconds without requiring a restart."}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium mb-1",children:"Poll Interval (ms)"}),l.jsx("input",{type:"number",value:g.anomalyPollIntervalMs||1e3,onChange:A=>P("anomalyPollIntervalMs",parseInt(A.target.value)),className:"w-full px-3 py-2 border rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium mb-1",children:"Cache TTL (ms)"}),l.jsx("input",{type:"number",value:g.anomalyCacheTtlMs||36e5,onChange:A=>P("anomalyCacheTtlMs",parseInt(A.target.value)),className:"w-full px-3 py-2 border rounded-md"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium mb-1",children:"Prometheus Export Interval (ms)"}),l.jsx("input",{type:"number",value:g.anomalyPrometheusIntervalMs||3e4,onChange:A=>P("anomalyPrometheusIntervalMs",parseInt(A.target.value)),className:"w-full px-3 py-2 border rounded-md"})]})]}),l.jsxs("div",{className:"flex items-center gap-3 mt-6 pt-6 border-t",children:[l.jsx("button",{onClick:E,disabled:!b||n,className:"px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 disabled:bg-gray-300 disabled:cursor-not-allowed",children:n?"Saving...":"Save Changes"}),l.jsx("button",{onClick:k,disabled:!b||n,className:"px-4 py-2 border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Cancel"}),l.jsx("button",{onClick:C,disabled:n,className:"ml-auto px-4 py-2 text-red-600 border border-red-600 rounded-md hover:bg-red-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Reset to Defaults"})]})]})})]})]})}const Ho={getWebhooks:async()=>ye("/webhooks"),getWebhook:async e=>ye(`/webhooks/${e}`),createWebhook:async e=>ye("/webhooks",{method:"POST",body:JSON.stringify(e)}),updateWebhook:async(e,t)=>ye(`/webhooks/${e}`,{method:"PATCH",body:JSON.stringify(t)}),deleteWebhook:async e=>ye(`/webhooks/${e}`,{method:"DELETE"}),testWebhook:async e=>ye(`/webhooks/${e}/test`,{method:"POST",body:JSON.stringify({})}),getDeliveries:async(e,t=50)=>ye(`/webhooks/${e}/deliveries?limit=${t}`),retryDelivery:async e=>ye(`/webhooks/deliveries/${e}/retry`,{method:"POST",body:JSON.stringify({})})};function Dle({webhooks:e,onEdit:t,onDelete:r,onTest:n,onViewDeliveries:i}){return e.length===0?l.jsx(ae,{className:"p-8 text-center",children:l.jsxs("div",{className:"text-gray-500",children:[l.jsx("p",{className:"text-lg font-medium mb-2",children:"No webhooks configured"}),l.jsx("p",{className:"text-sm",children:"Create your first webhook to get started with real-time notifications."})]})}):l.jsx("div",{className:"space-y-4",children:e.map(a=>l.jsx(ae,{className:"p-6",children:l.jsxs("div",{className:"flex items-start justify-between",children:[l.jsxs("div",{className:"flex-1",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[l.jsx("h3",{className:"text-lg font-semibold",children:a.name}),l.jsx(Ve,{variant:a.enabled?"success":"secondary",children:a.enabled?"Enabled":"Disabled"})]}),l.jsxs("div",{className:"space-y-2 text-sm text-gray-600",children:[l.jsxs("div",{children:[l.jsx("span",{className:"font-medium",children:"URL:"})," ",a.url]}),l.jsxs("div",{children:[l.jsx("span",{className:"font-medium",children:"Events:"})," ",l.jsx("span",{className:"inline-flex flex-wrap gap-1",children:a.events.map(s=>l.jsx(Ve,{variant:"outline",className:"text-xs",children:s},s))})]}),l.jsxs("div",{children:[l.jsx("span",{className:"font-medium",children:"Retry Policy:"})," Max ",a.retryPolicy.maxRetries," retries,"," ",a.retryPolicy.initialDelayMs,"ms initial delay"]}),a.secret&&l.jsxs("div",{children:[l.jsx("span",{className:"font-medium",children:"Secret:"})," ",a.secret.substring(0,12),"..."]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:()=>n(a),className:"px-3 py-1.5 text-sm border border-blue-600 text-blue-600 rounded hover:bg-blue-50 transition-colors",children:"Test"}),l.jsx("button",{onClick:()=>i(a),className:"px-3 py-1.5 text-sm border border-gray-300 rounded hover:bg-gray-50 transition-colors",children:"Deliveries"}),l.jsx("button",{onClick:()=>t(a),className:"px-3 py-1.5 text-sm border border-gray-300 rounded hover:bg-gray-50 transition-colors",children:"Edit"}),l.jsx("button",{onClick:()=>r(a),className:"px-3 py-1.5 text-sm border border-red-600 text-red-600 rounded hover:bg-red-50 transition-colors",children:"Delete"})]})]})},a.id))})}const Lle=[Ar.MEMORY_CRITICAL,Ar.CONNECTION_CRITICAL,Ar.COMPLIANCE_ALERT,Ar.SLOWLOG_THRESHOLD,Ar.REPLICATION_LAG,Ar.LATENCY_SPIKE,Ar.CONNECTION_SPIKE];function $le(e){return(e==null?void 0:e.some(t=>Lle.includes(t)))??!1}function zle(e){const t={...e};return t.deliveryConfig&&Object.keys(t.deliveryConfig).length===0&&delete t.deliveryConfig,t.alertConfig&&Object.keys(t.alertConfig).length===0&&delete t.alertConfig,t.thresholds&&Object.keys(t.thresholds).length===0&&delete t.thresholds,t}const Fle={"instance.down":"Instance Down","instance.up":"Instance Up","memory.critical":"Memory Critical","connection.critical":"Connection Critical","client.blocked":"Client Blocked","anomaly.detected":"Anomaly Detected","slowlog.threshold":"Slowlog Threshold","replication.lag":"Replication Lag","cluster.failover":"Cluster Failover","latency.spike":"Latency Spike","connection.spike":"Connection Spike","audit.policy.violation":"Audit Policy Violation","compliance.alert":"Compliance Alert","acl.violation":"ACL Violation","acl.modified":"ACL Modified","config.changed":"Config Changed"},QC={[rt.community]:"Community",[rt.pro]:"Pro",[rt.enterprise]:"Enterprise"};function ZC({webhook:e,onSubmit:t,onCancel:r}){var E,k,C,T,A,M,z,V,L,K,te,R,U,F,X,$,Y;const[n,i]=y.useState({name:"",url:"",secret:"",enabled:!0,events:[],headers:{},retryPolicy:{maxRetries:3,backoffMultiplier:2,initialDelayMs:1e3,maxDelayMs:6e4},deliveryConfig:{},alertConfig:{},thresholds:{}}),[a,s]=y.useState([]),[u,d]=y.useState(!1),[f,h]=y.useState(rt.community),[p,v]=y.useState(!0);y.useEffect(()=>{(async()=>{try{const I=await RO.getStatus();h(I.tier)}catch(I){console.error("Failed to fetch license status:",I),h(rt.community)}finally{v(!1)}})()},[]),y.useEffect(()=>{e&&(i({name:e.name,url:e.url,secret:e.secret,enabled:e.enabled,events:e.events,headers:e.headers||{},retryPolicy:e.retryPolicy,deliveryConfig:e.deliveryConfig??{},alertConfig:e.alertConfig??{},thresholds:e.thresholds??{}}),e.headers&&s(Object.entries(e.headers).map(([W,I])=>({key:W,value:I}))))},[e]);const g=async W=>{W.preventDefault();try{d(!0);const I={};a.forEach(({key:oe,value:se})=>{oe&&se&&(I[oe]=se)});const H=zle({...n,headers:Object.keys(I).length>0?I:void 0});await t(H)}catch(I){console.error("Failed to submit webhook:",I),alert("Failed to save webhook. Please try again.")}finally{d(!1)}},j=W=>{Zy(W,f)&&i(I=>({...I,events:I.events.includes(W)?I.events.filter(H=>H!==W):[...I.events,W]}))},b=()=>{s([...a,{key:"",value:""}])},w=W=>{s(a.filter((I,H)=>H!==W))},N=(W,I,H)=>{const oe=[...a];oe[W][I]=H,s(oe)},P=(W,I)=>{i({...n,thresholds:{...n.thresholds,[W]:I?parseInt(I):void 0}})};return l.jsx("form",{onSubmit:g,children:l.jsxs(ae,{className:"p-6",children:[l.jsx("h2",{className:"text-xl font-semibold mb-4",children:e?"Edit Webhook":"Create Webhook"}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium mb-1",children:"Name *"}),l.jsx("input",{type:"text",required:!0,value:n.name,onChange:W=>i({...n,name:W.target.value}),className:"w-full px-3 py-2 border rounded-md",placeholder:"Production Alerts"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium mb-1",children:"URL *"}),l.jsx("input",{type:"url",required:!0,value:n.url,onChange:W=>i({...n,url:W.target.value}),className:"w-full px-3 py-2 border rounded-md",placeholder:"https://api.example.com/webhooks"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium mb-1",children:"Secret (optional)"}),l.jsx("input",{type:"text",value:n.secret||"",onChange:W=>i({...n,secret:W.target.value}),className:"w-full px-3 py-2 border rounded-md",placeholder:"wh_secret_abc123"}),l.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Used for HMAC signature verification (X-Webhook-Signature header)"})]}),l.jsxs("div",{className:"flex items-center",children:[l.jsx("input",{type:"checkbox",id:"enabled",checked:n.enabled,onChange:W=>i({...n,enabled:W.target.checked}),className:"mr-2"}),l.jsx("label",{htmlFor:"enabled",className:"text-sm font-medium",children:"Enable webhook"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium mb-2",children:"Events to Subscribe *"}),p?l.jsx("div",{className:"border rounded-md p-4 text-center text-sm text-gray-500",children:"Loading available events..."}):l.jsxs("div",{className:"border rounded-md p-3 max-h-96 overflow-y-auto space-y-4",children:[Object.entries(jie()).map(([W,I])=>{const H=Zy(I[0]||"instance.down",f);return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsxs("h4",{className:"text-xs font-semibold text-gray-700 uppercase tracking-wide",children:[QC[W]," Tier"]}),!H&&l.jsxs("span",{className:"text-xs px-2 py-0.5 bg-yellow-100 text-yellow-800 rounded",children:["Requires ",QC[W]]})]}),l.jsx("div",{className:"grid grid-cols-2 gap-2",children:I.map(oe=>{const se=Zy(oe,f),be=n.events.includes(oe);return l.jsxs("label",{className:`flex items-center space-x-2 p-2 rounded ${se?"cursor-pointer hover:bg-gray-50":"cursor-not-allowed opacity-60 bg-gray-50"}`,children:[l.jsx("input",{type:"checkbox",checked:be,disabled:!se,onChange:()=>j(oe),className:se?"":"cursor-not-allowed"}),l.jsx("span",{className:"text-sm flex-1",children:Fle[oe]}),!se&&l.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"currentColor",viewBox:"0 0 20 20",children:l.jsx("path",{fillRule:"evenodd",d:"M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z",clipRule:"evenodd"})})]},oe)})})]},W)}),f!==rt.enterprise&&l.jsx("div",{className:"mt-4 p-3 bg-blue-50 border border-blue-200 rounded-md",children:l.jsxs("p",{className:"text-sm text-blue-900",children:[f===rt.community&&l.jsxs(l.Fragment,{children:[l.jsx("strong",{children:"Unlock more events:"})," Upgrade to Pro for advanced monitoring events or Enterprise for compliance and audit events."]}),f===rt.pro&&l.jsxs(l.Fragment,{children:[l.jsx("strong",{children:"Unlock Enterprise events:"})," Upgrade to Enterprise for compliance alerts, audit policy violations, and more."]})]})})]}),n.events.length===0&&l.jsx("p",{className:"text-xs text-red-500 mt-1",children:"Please select at least one event"})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("label",{className:"block text-sm font-medium",children:"Custom Headers"}),l.jsx("button",{type:"button",onClick:b,className:"text-sm text-blue-600 hover:text-blue-700",children:"+ Add Header"})]}),l.jsx("div",{className:"space-y-2",children:a.map((W,I)=>l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{type:"text",value:W.key,onChange:H=>N(I,"key",H.target.value),className:"flex-1 px-3 py-2 border rounded-md text-sm",placeholder:"Header-Name"}),l.jsx("input",{type:"text",value:W.value,onChange:H=>N(I,"value",H.target.value),className:"flex-1 px-3 py-2 border rounded-md text-sm",placeholder:"Header Value"}),l.jsx("button",{type:"button",onClick:()=>w(I),className:"px-3 py-2 text-sm text-red-600 border border-red-600 rounded hover:bg-red-50",children:"Remove"})]},I))})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-sm font-medium mb-2",children:"Retry Policy"}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:"Max Retries"}),l.jsx("input",{type:"number",min:"0",max:"10",value:n.retryPolicy.maxRetries,onChange:W=>i({...n,retryPolicy:{...n.retryPolicy,maxRetries:parseInt(W.target.value)}}),className:"w-full px-3 py-2 border rounded-md text-sm"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:"Backoff Multiplier"}),l.jsx("input",{type:"number",min:"1",max:"10",step:"0.1",value:n.retryPolicy.backoffMultiplier,onChange:W=>i({...n,retryPolicy:{...n.retryPolicy,backoffMultiplier:parseFloat(W.target.value)}}),className:"w-full px-3 py-2 border rounded-md text-sm"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:"Initial Delay (ms)"}),l.jsx("input",{type:"number",min:"100",max:"60000",step:"100",value:n.retryPolicy.initialDelayMs,onChange:W=>i({...n,retryPolicy:{...n.retryPolicy,initialDelayMs:parseInt(W.target.value)}}),className:"w-full px-3 py-2 border rounded-md text-sm"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:"Max Delay (ms)"}),l.jsx("input",{type:"number",min:"1000",max:"600000",step:"1000",value:n.retryPolicy.maxDelayMs,onChange:W=>i({...n,retryPolicy:{...n.retryPolicy,maxDelayMs:parseInt(W.target.value)}}),className:"w-full px-3 py-2 border rounded-md text-sm"})]})]})]}),l.jsxs("details",{className:"mt-6",children:[l.jsx("summary",{className:"cursor-pointer text-sm font-medium text-gray-700 hover:text-gray-900",children:"Advanced Configuration"}),l.jsxs("div",{className:"mt-4 space-y-6 pl-4 border-l-2 border-gray-200",children:[l.jsxs("div",{children:[l.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:"Delivery Settings"}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-500 mb-1",children:"Request Timeout (ms)"}),l.jsx("input",{type:"number",min:1e3,max:12e4,placeholder:"30000",value:((E=n.deliveryConfig)==null?void 0:E.timeoutMs)??"",onChange:W=>i({...n,deliveryConfig:{...n.deliveryConfig,timeoutMs:W.target.value?parseInt(W.target.value):void 0}}),className:"w-full px-3 py-2 border rounded-md text-sm"}),l.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Default: 30000ms"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-500 mb-1",children:"Max Response Body (bytes)"}),l.jsx("input",{type:"number",min:1e3,max:1e5,placeholder:"10000",value:((k=n.deliveryConfig)==null?void 0:k.maxResponseBodyBytes)??"",onChange:W=>i({...n,deliveryConfig:{...n.deliveryConfig,maxResponseBodyBytes:W.target.value?parseInt(W.target.value):void 0}}),className:"w-full px-3 py-2 border rounded-md text-sm"}),l.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Default: 10000 bytes"})]})]})]}),l.jsxs("div",{children:[l.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:"Alert Settings"}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-500 mb-1",children:"Hysteresis Factor"}),l.jsx("input",{type:"number",min:.5,max:.99,step:.01,placeholder:"0.9",value:((C=n.alertConfig)==null?void 0:C.hysteresisFactor)??"",onChange:W=>i({...n,alertConfig:{...n.alertConfig,hysteresisFactor:W.target.value?parseFloat(W.target.value):void 0}}),className:"w-full max-w-xs px-3 py-2 border rounded-md text-sm"}),l.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Recovery threshold = trigger threshold x factor. Default: 0.9 (10% margin)"})]})]}),$le(n.events)&&l.jsxs("div",{children:[l.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:"Alert Thresholds"}),l.jsx("p",{className:"text-xs text-gray-500 mb-3",children:"Override default thresholds for subscribed events. Leave blank for defaults."}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[((T=n.events)==null?void 0:T.includes(Ar.MEMORY_CRITICAL))&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-500 mb-1",children:"Memory Critical (%)"}),l.jsx("input",{type:"number",min:1,max:100,placeholder:"90",value:((A=n.thresholds)==null?void 0:A.memoryCriticalPercent)??"",onChange:W=>P("memoryCriticalPercent",W.target.value),className:"w-full px-3 py-2 border rounded-md text-sm"})]}),((M=n.events)==null?void 0:M.includes(Ar.CONNECTION_CRITICAL))&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-500 mb-1",children:"Connection Critical (%)"}),l.jsx("input",{type:"number",min:1,max:100,placeholder:"90",value:((z=n.thresholds)==null?void 0:z.connectionCriticalPercent)??"",onChange:W=>P("connectionCriticalPercent",W.target.value),className:"w-full px-3 py-2 border rounded-md text-sm"})]}),((V=n.events)==null?void 0:V.includes(Ar.COMPLIANCE_ALERT))&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-500 mb-1",children:"Compliance Memory (%)"}),l.jsx("input",{type:"number",min:1,max:100,placeholder:"80",value:((L=n.thresholds)==null?void 0:L.complianceMemoryPercent)??"",onChange:W=>P("complianceMemoryPercent",W.target.value),className:"w-full px-3 py-2 border rounded-md text-sm"})]}),((K=n.events)==null?void 0:K.includes(Ar.SLOWLOG_THRESHOLD))&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-500 mb-1",children:"Slowlog Count"}),l.jsx("input",{type:"number",min:1,placeholder:"100",value:((te=n.thresholds)==null?void 0:te.slowlogCount)??"",onChange:W=>P("slowlogCount",W.target.value),className:"w-full px-3 py-2 border rounded-md text-sm"})]}),((R=n.events)==null?void 0:R.includes(Ar.REPLICATION_LAG))&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-500 mb-1",children:"Replication Lag (seconds)"}),l.jsx("input",{type:"number",min:1,placeholder:"10",value:((U=n.thresholds)==null?void 0:U.replicationLagSeconds)??"",onChange:W=>P("replicationLagSeconds",W.target.value),className:"w-full px-3 py-2 border rounded-md text-sm"})]}),((F=n.events)==null?void 0:F.includes(Ar.LATENCY_SPIKE))&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-500 mb-1",children:"Latency Spike (ms)"}),l.jsx("input",{type:"number",min:0,placeholder:"0 (auto)",value:((X=n.thresholds)==null?void 0:X.latencySpikeMs)??"",onChange:W=>P("latencySpikeMs",W.target.value),className:"w-full px-3 py-2 border rounded-md text-sm"}),l.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"0 = auto baseline"})]}),(($=n.events)==null?void 0:$.includes(Ar.CONNECTION_SPIKE))&&l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs text-gray-500 mb-1",children:"Connection Spike Count"}),l.jsx("input",{type:"number",min:0,placeholder:"0 (auto)",value:((Y=n.thresholds)==null?void 0:Y.connectionSpikeCount)??"",onChange:W=>P("connectionSpikeCount",W.target.value),className:"w-full px-3 py-2 border rounded-md text-sm"}),l.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"0 = auto baseline"})]})]})]})]})]})]}),l.jsxs("div",{className:"flex items-center gap-3 mt-6 pt-6 border-t",children:[l.jsx("button",{type:"submit",disabled:u||n.events.length===0,className:"px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 disabled:bg-gray-300 disabled:cursor-not-allowed",children:u?"Saving...":e?"Update Webhook":"Create Webhook"}),l.jsx("button",{type:"button",onClick:r,disabled:u,className:"px-4 py-2 border rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed",children:"Cancel"})]})]})})}function Ble({webhook:e,onClose:t}){const[r,n]=y.useState([]),[i,a]=y.useState(!0),[s,u]=y.useState(null);y.useEffect(()=>{d()},[e.id]);const d=async()=>{try{a(!0);const v=await Ho.getDeliveries(e.id,100);n(v)}catch(v){console.error("Failed to load deliveries:",v)}finally{a(!1)}},f=async v=>{try{u(v),await Ho.retryDelivery(v),await d(),alert("Delivery retry initiated successfully")}catch(g){console.error("Failed to retry delivery:",g),alert("Failed to retry delivery. Please try again.")}finally{u(null)}},h=v=>new Date(v).toLocaleString(),p=v=>{const g={success:"success",failed:"destructive",retrying:"warning",pending:"secondary"};return l.jsx(Ve,{variant:g[v]||"secondary",children:v})};return i?l.jsxs(ae,{className:"p-6",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("h2",{className:"text-xl font-semibold",children:["Delivery History: ",e.name]}),l.jsx("button",{onClick:t,className:"px-4 py-2 border rounded-md hover:bg-gray-50",children:"Close"})]}),l.jsx("div",{className:"text-center py-8 text-gray-500",children:"Loading deliveries..."})]}):l.jsxs(ae,{className:"p-6",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("div",{children:[l.jsxs("h2",{className:"text-xl font-semibold",children:["Delivery History: ",e.name]}),l.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Showing last 100 deliveries"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:d,className:"px-4 py-2 border rounded-md hover:bg-gray-50",children:"Refresh"}),l.jsx("button",{onClick:t,className:"px-4 py-2 border rounded-md hover:bg-gray-50",children:"Close"})]})]}),r.length===0?l.jsx("div",{className:"text-center py-8 text-gray-500",children:"No deliveries found for this webhook."}):l.jsx("div",{className:"overflow-x-auto",children:l.jsxs(Ai,{children:[l.jsx(Ti,{children:l.jsxs(bt,{children:[l.jsx(Me,{children:"Event Type"}),l.jsx(Me,{children:"Status"}),l.jsx(Me,{children:"HTTP Code"}),l.jsx(Me,{children:"Attempts"}),l.jsx(Me,{children:"Duration"}),l.jsx(Me,{children:"Created At"}),l.jsx(Me,{children:"Completed At"}),l.jsx(Me,{children:"Actions"})]})}),l.jsx(Mi,{children:r.map(v=>l.jsxs(bt,{children:[l.jsx(Oe,{className:"font-mono text-xs",children:v.eventType}),l.jsx(Oe,{children:p(v.status)}),l.jsx(Oe,{children:v.statusCode?l.jsx("span",{className:`font-mono ${v.statusCode>=200&&v.statusCode<300?"text-green-600":"text-red-600"}`,children:v.statusCode}):l.jsx("span",{className:"text-gray-400",children:"-"})}),l.jsx(Oe,{children:v.attempts}),l.jsx(Oe,{children:v.durationMs?`${v.durationMs}ms`:"-"}),l.jsx(Oe,{className:"text-xs",children:h(v.createdAt)}),l.jsx(Oe,{className:"text-xs",children:v.completedAt?h(v.completedAt):"-"}),l.jsx(Oe,{children:v.status==="failed"&&l.jsx("button",{onClick:()=>f(v.id),disabled:s===v.id,className:"text-sm text-blue-600 hover:text-blue-700 disabled:opacity-50 disabled:cursor-not-allowed",children:s===v.id?"Retrying...":"Retry"})})]},v.id))})]})}),r.length>0&&l.jsxs("div",{className:"mt-6 space-y-4",children:[l.jsx("h3",{className:"text-lg font-semibold",children:"Latest Delivery Details"}),l.jsxs("div",{className:"bg-gray-50 rounded-md p-4 space-y-2 text-sm",children:[l.jsxs("div",{children:[l.jsx("span",{className:"font-medium",children:"Delivery ID:"})," ",r[0].id]}),l.jsxs("div",{children:[l.jsx("span",{className:"font-medium",children:"Webhook ID:"})," ",r[0].webhookId]}),r[0].responseBody&&l.jsxs("div",{children:[l.jsx("span",{className:"font-medium",children:"Response Body:"}),l.jsx("pre",{className:"mt-1 p-2 bg-white border rounded text-xs overflow-x-auto",children:r[0].responseBody})]}),r[0].nextRetryAt&&l.jsxs("div",{children:[l.jsx("span",{className:"font-medium",children:"Next Retry At:"})," ",h(r[0].nextRetryAt)]})]})]})]})}function Wle(){const{currentConnection:e}=Qr(),[t,r]=y.useState([]),[n,i]=y.useState(!0),[a,s]=y.useState("list"),[u,d]=y.useState(null),[f,h]=y.useState(null);y.useEffect(()=>{p()},[e==null?void 0:e.id]);const p=async()=>{try{i(!0);const k=await Ho.getWebhooks();r(k)}catch(k){console.error("Failed to load webhooks:",k)}finally{i(!1)}},v=async k=>{await Ho.createWebhook(k),await p(),s("list")},g=async k=>{u&&(await Ho.updateWebhook(u.id,k),await p(),s("list"),d(null))},j=async k=>{if(confirm(`Are you sure you want to delete webhook "${k.name}"?`))try{await Ho.deleteWebhook(k.id),await p()}catch(C){console.error("Failed to delete webhook:",C),alert("Failed to delete webhook. Please try again.")}},b=async k=>{try{h(null);const C=await Ho.testWebhook(k.id);h(C)}catch(C){console.error("Failed to test webhook:",C),h({success:!1,error:"Failed to test webhook",durationMs:0})}},w=k=>{d(k),s("edit")},N=k=>{d(k),s("deliveries")},P=()=>{s("list"),d(null)},E=()=>{s("list"),d(null)};return n?l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx("div",{className:"text-lg text-gray-500",children:"Loading webhooks..."})}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-3xl font-bold",children:"Webhooks"}),l.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Configure webhooks to receive real-time notifications for events"})]}),a==="list"&&l.jsx("button",{onClick:()=>s("create"),className:"px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors",children:"Create Webhook"})]}),f&&l.jsx(ae,{className:"p-4",children:l.jsxs("div",{className:"flex items-start justify-between",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx("h3",{className:"font-semibold mb-2",children:f.success?"Test Successful":"Test Failed"}),l.jsxs("div",{className:"space-y-1 text-sm",children:[f.statusCode&&l.jsxs("div",{children:[l.jsx("span",{className:"font-medium",children:"Status Code:"})," ",l.jsx("span",{className:f.statusCode>=200&&f.statusCode<300?"text-green-600":"text-red-600",children:f.statusCode})]}),l.jsxs("div",{children:[l.jsx("span",{className:"font-medium",children:"Duration:"})," ",f.durationMs,"ms"]}),f.responseBody&&l.jsxs("div",{children:[l.jsx("span",{className:"font-medium",children:"Response:"}),l.jsx("pre",{className:"mt-1 p-2 bg-gray-50 border rounded text-xs overflow-x-auto",children:f.responseBody})]}),f.error&&l.jsxs("div",{children:[l.jsx("span",{className:"font-medium",children:"Error:"})," ",l.jsx("span",{className:"text-red-600",children:f.error})]})]})]}),l.jsx("button",{onClick:()=>h(null),className:"text-gray-400 hover:text-gray-600",children:"✕"})]})}),a==="list"&&l.jsx(Dle,{webhooks:t,onEdit:w,onDelete:j,onTest:b,onViewDeliveries:N}),a==="create"&&l.jsx(ZC,{onSubmit:v,onCancel:P}),a==="edit"&&u&&l.jsx(ZC,{webhook:u,onSubmit:g,onCancel:P}),a==="deliveries"&&u&&l.jsx(Ble,{webhook:u,onClose:E}),a==="list"&&t.length===0&&l.jsxs(ae,{className:"p-6",children:[l.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Getting Started with Webhooks"}),l.jsxs("div",{className:"text-sm text-gray-600 space-y-2",children:[l.jsx("p",{children:"Webhooks allow you to receive real-time HTTP notifications when events occur in your BetterDB instance."}),l.jsxs("ul",{className:"list-disc list-inside space-y-1 ml-4",children:[l.jsx("li",{children:"Configure your endpoint URL and select events to subscribe to"}),l.jsx("li",{children:"Secure your webhooks with HMAC signature verification"}),l.jsx("li",{children:"Automatic retry with exponential backoff for failed deliveries"}),l.jsx("li",{children:"Track delivery history and retry failed attempts"})]}),l.jsxs("p",{className:"mt-4",children:[l.jsx("strong",{children:"Available Events:"})," Instance health, memory alerts, client analytics, anomaly detection, cluster failover, audit violations, and more."]})]})]})]})}function Ule(){const[e,t]=y.useState(null),{license:r}=n5(),n=a5(),i=o5(),a=l5();return y.useEffect(()=>{ze.getHealth().then(s=>{s.capabilities&&t(s.capabilities)}).catch(console.error)},[]),l.jsx(B3,{children:l.jsx(zO.Provider,{value:i,children:l.jsx($O.Provider,{value:n,children:l.jsx(DO.Provider,{value:r,children:l.jsx(IO.Provider,{value:e,children:l.jsxs(BO.Provider,{value:a,children:[l.jsx(Kle,{}),l.jsx(MO,{id:"license-tooltip"}),n.error&&l.jsx(J5,{error:n.error,onDismiss:n.dismissUpgradePrompt})]})})})})})})}function Kle(){const e=Ea();return l.jsxs("div",{className:"min-h-screen bg-background",children:[l.jsxs("aside",{className:"fixed left-0 top-0 z-40 h-screen w-64 border-r bg-card flex flex-col",children:[l.jsx("div",{className:"p-6 pb-2",children:l.jsx("h2",{className:"text-lg font-semibold",children:"BetterDB Monitor"})}),l.jsx("div",{className:"border-b pb-2 mb-2",children:l.jsx(tz,{})}),l.jsxs("nav",{className:"space-y-1 px-3 flex-1",children:[l.jsx(ln,{to:"/",active:e.pathname==="/",children:"Dashboard"}),l.jsx(ln,{to:"/slowlog",active:e.pathname==="/slowlog",children:"Slow Log"}),l.jsx(ln,{to:"/latency",active:e.pathname==="/latency",children:"Latency"}),l.jsx(ln,{to:"/clients",active:e.pathname==="/clients",children:"Clients"}),l.jsx(ln,{to:"/client-analytics",active:e.pathname==="/client-analytics",children:"Client Analytics"}),l.jsx(ln,{to:"/client-analytics/deep-dive",active:e.pathname==="/client-analytics/deep-dive",children:"Analytics Deep Dive"}),l.jsx(ln,{to:"/cluster",active:e.pathname==="/cluster",children:"Cluster"}),l.jsx(ln,{to:"/anomalies",active:e.pathname==="/anomalies",requiredFeature:hu.ANOMALY_DETECTION,children:"Anomaly Detection"}),l.jsx(ln,{to:"/key-analytics",active:e.pathname==="/key-analytics",requiredFeature:hu.KEY_ANALYTICS,children:"Key Analytics"}),l.jsx(ln,{to:"/audit",active:e.pathname==="/audit",children:"Audit Trail"}),l.jsx(ln,{to:"/webhooks",active:e.pathname==="/webhooks",children:"Webhooks"}),l.jsx(ln,{to:"/helper",active:e.pathname==="/helper",children:l.jsxs("span",{className:"flex items-center justify-between w-full",children:["AI Helper",l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 bg-amber-500 text-amber-950 rounded font-medium",children:"Experimental"})]})})]}),l.jsxs("div",{className:"px-3 pb-4 border-t border-gray-200 pt-2 space-y-1",children:[l.jsx("a",{href:"https://docs.betterdb.com",target:"_blank",rel:"noopener noreferrer",className:"block w-full rounded-md px-3 py-2 text-sm transition-colors hover:bg-muted",children:"Documentation"}),l.jsx("a",{href:"https://github.com/betterdb-inc/monitor/issues/new",target:"_blank",rel:"noopener noreferrer",className:"block w-full rounded-md px-3 py-2 text-sm transition-colors hover:bg-muted",children:"Report a Problem"}),l.jsx(ln,{to:"/settings",active:e.pathname==="/settings",children:"Settings"})]})]}),l.jsxs("main",{className:"pl-64 min-h-screen flex flex-col",children:[l.jsx(ez,{}),l.jsx("div",{className:"p-8 flex-1 flex flex-col",children:l.jsxs(v3,{children:[l.jsx(Yr,{path:"/",element:l.jsx(hre,{})}),l.jsx(Yr,{path:"/slowlog",element:l.jsx(lie,{})}),l.jsx(Yr,{path:"/latency",element:l.jsx(fie,{})}),l.jsx(Yr,{path:"/clients",element:l.jsx(mie,{})}),l.jsx(Yr,{path:"/client-analytics",element:l.jsx(xie,{})}),l.jsx(Yr,{path:"/client-analytics/deep-dive",element:l.jsx(Nie,{})}),l.jsx(Yr,{path:"/anomalies",element:l.jsx(_ie,{})}),l.jsx(Yr,{path:"/key-analytics",element:l.jsx(Eie,{})}),l.jsx(Yr,{path:"/cluster",element:l.jsx(Ile,{})}),l.jsx(Yr,{path:"/audit",element:l.jsx(vie,{})}),l.jsx(Yr,{path:"/helper",element:l.jsx(kie,{})}),l.jsx(Yr,{path:"/webhooks",element:l.jsx(Wle,{})}),l.jsx(Yr,{path:"/settings",element:l.jsx(Rle,{})})]})})]})]})}function ln({children:e,active:t,to:r,requiredFeature:n}){const{hasFeature:i,tier:a}=LO(),s=n&&!i(n),u=s?`This feature requires a Pro or Enterprise license. Current tier: ${a}`:void 0;return s?l.jsxs("div",{"data-tooltip-id":"license-tooltip","data-tooltip-content":u,className:"block w-full rounded-md px-3 py-2 text-sm opacity-50 cursor-not-allowed flex items-center justify-between",children:[l.jsx("span",{children:e}),l.jsx("span",{className:"text-[10px] px-1.5 py-0.5 bg-yellow-500 text-yellow-950 rounded font-medium",children:"Pro+"})]}):l.jsx(ll,{to:r,className:`block w-full rounded-md px-3 py-2 text-sm transition-colors ${t?"bg-primary text-primary-foreground":"hover:bg-muted"}`,children:e})}x$.createRoot(document.getElementById("root")).render(l.jsx(xr.StrictMode,{children:l.jsx(Ule,{})}));