aicodeswitch 5.2.13 → 6.0.0
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.
- package/dist/server/agent-map/agent-map-service.js +355 -51
- package/dist/server/conversions/index.js +10 -2
- package/dist/server/conversions/thinking/providers.js +12 -7
- package/dist/server/fs-database.js +6 -0
- package/dist/server/main.js +7 -30
- package/dist/server/performance-tracker.js +78 -8
- package/dist/server/proxy-server.js +104 -26
- package/dist/server/transformers/chunk-collector.js +112 -25
- package/dist/ui/assets/{index-4liE4bV8.css → index-CQVhBlBB.css} +1 -1
- package/dist/ui/assets/index-QZBX5HHX.js +1186 -0
- package/dist/ui/assets/three-CFpmPosW.js +3802 -0
- package/dist/ui/index.html +3 -2
- package/package.json +3 -1
- package/scripts/dev.js +76 -30
- package/dist/server/tools-service.js +0 -203
- package/dist/server/websocket-service.js +0 -148
- package/dist/ui/assets/index-CJMAVkIN.js +0 -813
|
@@ -0,0 +1,1186 @@
|
|
|
1
|
+
var DL=Object.defineProperty;var LL=(e,t,n)=>t in e?DL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var $e=(e,t,n)=>LL(e,typeof t!="symbol"?t+"":t,n);import{E as zL,V as nt,M as As,T as Es,S as Dw,Q as Zc,a as _n,R as $L,P as BL,b as U2,c as Hx,O as W2,I as FL,F as Lw,d as Ey,e as Us,W as UL,B as Vx,f as K2,g as WL,h as yp,U as H2,i as vp,j as Da,k as Ru,L as KL,l as HL,C as VL,m as qL,A as YL,n as zw,o as GL,p as XL,q as QL,r as ZL,D as JL,s as ez,t as $w,u as Bw,v as Ts,w as rc,x as tz,y as nz,z as rz,G as iz,H as az,J as Fw,K as Uw,N as oz,X as sz,Y as lz,Z as cz}from"./three-CFpmPosW.js";function uz(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[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"]'))r(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"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(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 r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();var gl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ll(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var V2={exports:{}},vh={},q2={exports:{}},rt={};/**
|
|
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 Du=Symbol.for("react.element"),dz=Symbol.for("react.portal"),pz=Symbol.for("react.fragment"),fz=Symbol.for("react.strict_mode"),hz=Symbol.for("react.profiler"),mz=Symbol.for("react.provider"),gz=Symbol.for("react.context"),yz=Symbol.for("react.forward_ref"),vz=Symbol.for("react.suspense"),xz=Symbol.for("react.memo"),bz=Symbol.for("react.lazy"),Ww=Symbol.iterator;function wz(e){return e===null||typeof e!="object"?null:(e=Ww&&e[Ww]||e["@@iterator"],typeof e=="function"?e:null)}var Y2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},G2=Object.assign,X2={};function zl(e,t,n){this.props=e,this.context=t,this.refs=X2,this.updater=n||Y2}zl.prototype.isReactComponent={};zl.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};zl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Q2(){}Q2.prototype=zl.prototype;function qx(e,t,n){this.props=e,this.context=t,this.refs=X2,this.updater=n||Y2}var Yx=qx.prototype=new Q2;Yx.constructor=qx;G2(Yx,zl.prototype);Yx.isPureReactComponent=!0;var Kw=Array.isArray,Z2=Object.prototype.hasOwnProperty,Gx={current:null},J2={key:!0,ref:!0,__self:!0,__source:!0};function eE(e,t,n){var r,i={},a=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(a=""+t.key),t)Z2.call(t,r)&&!J2.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)i[r]===void 0&&(i[r]=l[r]);return{$$typeof:Du,type:e,key:a,ref:s,props:i,_owner:Gx.current}}function Sz(e,t){return{$$typeof:Du,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Xx(e){return typeof e=="object"&&e!==null&&e.$$typeof===Du}function jz(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Hw=/\/+/g;function ig(e,t){return typeof e=="object"&&e!==null&&e.key!=null?jz(""+e.key):t.toString(36)}function xp(e,t,n,r,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(a){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Du:case dz:s=!0}}if(s)return s=e,i=i(s),e=r===""?"."+ig(s,0):r,Kw(i)?(n="",e!=null&&(n=e.replace(Hw,"$&/")+"/"),xp(i,t,n,"",function(u){return u})):i!=null&&(Xx(i)&&(i=Sz(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(Hw,"$&/")+"/")+e)),t.push(i)),1;if(s=0,r=r===""?".":r+":",Kw(e))for(var l=0;l<e.length;l++){a=e[l];var c=r+ig(a,l);s+=xp(a,t,n,c,i)}else if(c=wz(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=r+ig(a,l++),s+=xp(a,t,n,c,i);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function jd(e,t,n){if(e==null)return e;var r=[],i=0;return xp(e,r,"","",function(a){return t.call(n,a,i++)}),r}function kz(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var nr={current:null},bp={transition:null},Cz={ReactCurrentDispatcher:nr,ReactCurrentBatchConfig:bp,ReactCurrentOwner:Gx};function tE(){throw Error("act(...) is not supported in production builds of React.")}rt.Children={map:jd,forEach:function(e,t,n){jd(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return jd(e,function(){t++}),t},toArray:function(e){return jd(e,function(t){return t})||[]},only:function(e){if(!Xx(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};rt.Component=zl;rt.Fragment=pz;rt.Profiler=hz;rt.PureComponent=qx;rt.StrictMode=fz;rt.Suspense=vz;rt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Cz;rt.act=tE;rt.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=G2({},e.props),i=e.key,a=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,s=Gx.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)Z2.call(t,c)&&!J2.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:Du,type:e.type,key:i,ref:a,props:r,_owner:s}};rt.createContext=function(e){return e={$$typeof:gz,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:mz,_context:e},e.Consumer=e};rt.createElement=eE;rt.createFactory=function(e){var t=eE.bind(null,e);return t.type=e,t};rt.createRef=function(){return{current:null}};rt.forwardRef=function(e){return{$$typeof:yz,render:e}};rt.isValidElement=Xx;rt.lazy=function(e){return{$$typeof:bz,_payload:{_status:-1,_result:e},_init:kz}};rt.memo=function(e,t){return{$$typeof:xz,type:e,compare:t===void 0?null:t}};rt.startTransition=function(e){var t=bp.transition;bp.transition={};try{e()}finally{bp.transition=t}};rt.unstable_act=tE;rt.useCallback=function(e,t){return nr.current.useCallback(e,t)};rt.useContext=function(e){return nr.current.useContext(e)};rt.useDebugValue=function(){};rt.useDeferredValue=function(e){return nr.current.useDeferredValue(e)};rt.useEffect=function(e,t){return nr.current.useEffect(e,t)};rt.useId=function(){return nr.current.useId()};rt.useImperativeHandle=function(e,t,n){return nr.current.useImperativeHandle(e,t,n)};rt.useInsertionEffect=function(e,t){return nr.current.useInsertionEffect(e,t)};rt.useLayoutEffect=function(e,t){return nr.current.useLayoutEffect(e,t)};rt.useMemo=function(e,t){return nr.current.useMemo(e,t)};rt.useReducer=function(e,t,n){return nr.current.useReducer(e,t,n)};rt.useRef=function(e){return nr.current.useRef(e)};rt.useState=function(e){return nr.current.useState(e)};rt.useSyncExternalStore=function(e,t,n){return nr.current.useSyncExternalStore(e,t,n)};rt.useTransition=function(){return nr.current.useTransition()};rt.version="18.3.1";q2.exports=rt;var h=q2.exports;const nE=Ll(h),rE=uz({__proto__:null,default:nE},[h]);/**
|
|
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 Pz=h,Az=Symbol.for("react.element"),Ez=Symbol.for("react.fragment"),Tz=Object.prototype.hasOwnProperty,Iz=Pz.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Oz={key:!0,ref:!0,__self:!0,__source:!0};function iE(e,t,n){var r,i={},a=null,s=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)Tz.call(t,r)&&!Oz.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Az,type:e,key:a,ref:s,props:i,_owner:Iz.current}}vh.Fragment=Ez;vh.jsx=iE;vh.jsxs=iE;V2.exports=vh;var o=V2.exports,Ty={},aE={exports:{}},Tr={},oE={exports:{}},sE={};/**
|
|
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
|
+
*/(function(e){function t(N,U){var P=N.length;N.push(U);e:for(;0<P;){var W=P-1>>>1,se=N[W];if(0<i(se,U))N[W]=U,N[P]=se,P=W;else break e}}function n(N){return N.length===0?null:N[0]}function r(N){if(N.length===0)return null;var U=N[0],P=N.pop();if(P!==U){N[0]=P;e:for(var W=0,se=N.length,T=se>>>1;W<T;){var he=2*(W+1)-1,ye=N[he],Z=he+1,le=N[Z];if(0>i(ye,P))Z<se&&0>i(le,ye)?(N[W]=le,N[Z]=P,W=Z):(N[W]=ye,N[he]=P,W=he);else if(Z<se&&0>i(le,P))N[W]=le,N[Z]=P,W=Z;else break e}}return U}function i(N,U){var P=N.sortIndex-U.sortIndex;return P!==0?P:N.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var c=[],u=[],p=1,d=null,f=3,m=!1,g=!1,v=!1,x=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(N){for(var U=n(u);U!==null;){if(U.callback===null)r(u);else if(U.startTime<=N)r(u),U.sortIndex=U.expirationTime,t(c,U);else break;U=n(u)}}function S(N){if(v=!1,w(N),!g)if(n(c)!==null)g=!0,$(k);else{var U=n(u);U!==null&&H(S,U.startTime-N)}}function k(N,U){g=!1,v&&(v=!1,y(E),E=-1),m=!0;var P=f;try{for(w(U),d=n(c);d!==null&&(!(d.expirationTime>U)||N&&!_());){var W=d.callback;if(typeof W=="function"){d.callback=null,f=d.priorityLevel;var se=W(d.expirationTime<=U);U=e.unstable_now(),typeof se=="function"?d.callback=se:d===n(c)&&r(c),w(U)}else r(c);d=n(c)}if(d!==null)var T=!0;else{var he=n(u);he!==null&&H(S,he.startTime-U),T=!1}return T}finally{d=null,f=P,m=!1}}var j=!1,A=null,E=-1,D=5,O=-1;function _(){return!(e.unstable_now()-O<D)}function R(){if(A!==null){var N=e.unstable_now();O=N;var U=!0;try{U=A(!0,N)}finally{U?X():(j=!1,A=null)}}else j=!1}var X;if(typeof b=="function")X=function(){b(R)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,I=V.port2;V.port1.onmessage=R,X=function(){I.postMessage(null)}}else X=function(){x(R,0)};function $(N){A=N,j||(j=!0,X())}function H(N,U){E=x(function(){N(e.unstable_now())},U)}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(N){N.callback=null},e.unstable_continueExecution=function(){g||m||(g=!0,$(k))},e.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<N?Math.floor(1e3/N):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(N){switch(f){case 1:case 2:case 3:var U=3;break;default:U=f}var P=f;f=U;try{return N()}finally{f=P}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(N,U){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var P=f;f=N;try{return U()}finally{f=P}},e.unstable_scheduleCallback=function(N,U,P){var W=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?W+P:W):P=W,N){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=P+se,N={id:p++,callback:U,priorityLevel:N,startTime:P,expirationTime:se,sortIndex:-1},P>W?(N.sortIndex=P,t(u,N),n(c)===null&&N===n(u)&&(v?(y(E),E=-1):v=!0,H(S,P-W))):(N.sortIndex=se,t(c,N),g||m||(g=!0,$(k))),N},e.unstable_shouldYield=_,e.unstable_wrapCallback=function(N){var U=f;return function(){var P=f;f=U;try{return N.apply(this,arguments)}finally{f=P}}}})(sE);oE.exports=sE;var Nz=oE.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 Mz=h,Pr=Nz;function be(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var lE=new Set,Jc={};function vs(e,t){yl(e,t),yl(e+"Capture",t)}function yl(e,t){for(Jc[e]=t,e=0;e<t.length;e++)lE.add(t[e])}var pa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Iy=Object.prototype.hasOwnProperty,_z=/^[: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]*$/,Vw={},qw={};function Rz(e){return Iy.call(qw,e)?!0:Iy.call(Vw,e)?!1:_z.test(e)?qw[e]=!0:(Vw[e]=!0,!1)}function Dz(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Lz(e,t,n,r){if(t===null||typeof t>"u"||Dz(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function rr(e,t,n,r,i,a,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=s}var zn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){zn[e]=new rr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];zn[t]=new rr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){zn[e]=new rr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){zn[e]=new rr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){zn[e]=new rr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){zn[e]=new rr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){zn[e]=new rr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){zn[e]=new rr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){zn[e]=new rr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Qx=/[\-:]([a-z])/g;function Zx(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Qx,Zx);zn[t]=new rr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Qx,Zx);zn[t]=new rr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Qx,Zx);zn[t]=new rr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){zn[e]=new rr(e,1,!1,e.toLowerCase(),null,!1,!1)});zn.xlinkHref=new rr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){zn[e]=new rr(e,1,!1,e.toLowerCase(),null,!0,!0)});function Jx(e,t,n,r){var i=zn.hasOwnProperty(t)?zn[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Lz(t,n,i,r)&&(n=null),r||i===null?Rz(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var ba=Mz.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,kd=Symbol.for("react.element"),Ws=Symbol.for("react.portal"),Ks=Symbol.for("react.fragment"),e0=Symbol.for("react.strict_mode"),Oy=Symbol.for("react.profiler"),cE=Symbol.for("react.provider"),uE=Symbol.for("react.context"),t0=Symbol.for("react.forward_ref"),Ny=Symbol.for("react.suspense"),My=Symbol.for("react.suspense_list"),n0=Symbol.for("react.memo"),La=Symbol.for("react.lazy"),dE=Symbol.for("react.offscreen"),Yw=Symbol.iterator;function ic(e){return e===null||typeof e!="object"?null:(e=Yw&&e[Yw]||e["@@iterator"],typeof e=="function"?e:null)}var Gt=Object.assign,ag;function Ac(e){if(ag===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ag=t&&t[1]||""}return`
|
|
34
|
+
`+ag+e}var og=!1;function sg(e,t){if(!e||og)return"";og=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
|
|
35
|
+
`),a=r.stack.split(`
|
|
36
|
+
`),s=i.length-1,l=a.length-1;1<=s&&0<=l&&i[s]!==a[l];)l--;for(;1<=s&&0<=l;s--,l--)if(i[s]!==a[l]){if(s!==1||l!==1)do if(s--,l--,0>l||i[s]!==a[l]){var c=`
|
|
37
|
+
`+i[s].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=s&&0<=l);break}}}finally{og=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ac(e):""}function zz(e){switch(e.tag){case 5:return Ac(e.type);case 16:return Ac("Lazy");case 13:return Ac("Suspense");case 19:return Ac("SuspenseList");case 0:case 2:case 15:return e=sg(e.type,!1),e;case 11:return e=sg(e.type.render,!1),e;case 1:return e=sg(e.type,!0),e;default:return""}}function _y(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ks:return"Fragment";case Ws:return"Portal";case Oy:return"Profiler";case e0:return"StrictMode";case Ny:return"Suspense";case My:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case uE:return(e.displayName||"Context")+".Consumer";case cE:return(e._context.displayName||"Context")+".Provider";case t0:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case n0:return t=e.displayName||null,t!==null?t:_y(e.type)||"Memo";case La:t=e._payload,e=e._init;try{return _y(e(t))}catch{}}return null}function $z(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _y(t);case 8:return t===e0?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function io(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function pE(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Bz(e){var t=pE(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,a.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Cd(e){e._valueTracker||(e._valueTracker=Bz(e))}function fE(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=pE(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function $p(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ry(e,t){var n=t.checked;return Gt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Gw(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=io(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function hE(e,t){t=t.checked,t!=null&&Jx(e,"checked",t,!1)}function Dy(e,t){hE(e,t);var n=io(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ly(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ly(e,t.type,io(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Xw(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ly(e,t,n){(t!=="number"||$p(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ec=Array.isArray;function al(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+io(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function zy(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(be(91));return Gt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Qw(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(be(92));if(Ec(n)){if(1<n.length)throw Error(be(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:io(n)}}function mE(e,t){var n=io(t.value),r=io(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Zw(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function gE(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function $y(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?gE(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Pd,yE=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Pd=Pd||document.createElement("div"),Pd.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Pd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function eu(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var _c={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},Fz=["Webkit","ms","Moz","O"];Object.keys(_c).forEach(function(e){Fz.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),_c[t]=_c[e]})});function vE(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||_c.hasOwnProperty(e)&&_c[e]?(""+t).trim():t+"px"}function xE(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=vE(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Uz=Gt({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 By(e,t){if(t){if(Uz[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(be(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(be(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(be(61))}if(t.style!=null&&typeof t.style!="object")throw Error(be(62))}}function Fy(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Uy=null;function r0(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Wy=null,ol=null,sl=null;function Jw(e){if(e=$u(e)){if(typeof Wy!="function")throw Error(be(280));var t=e.stateNode;t&&(t=jh(t),Wy(e.stateNode,e.type,t))}}function bE(e){ol?sl?sl.push(e):sl=[e]:ol=e}function wE(){if(ol){var e=ol,t=sl;if(sl=ol=null,Jw(e),t)for(e=0;e<t.length;e++)Jw(t[e])}}function SE(e,t){return e(t)}function jE(){}var lg=!1;function kE(e,t,n){if(lg)return e(t,n);lg=!0;try{return SE(e,t,n)}finally{lg=!1,(ol!==null||sl!==null)&&(jE(),wE())}}function tu(e,t){var n=e.stateNode;if(n===null)return null;var r=jh(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(be(231,t,typeof n));return n}var Ky=!1;if(pa)try{var ac={};Object.defineProperty(ac,"passive",{get:function(){Ky=!0}}),window.addEventListener("test",ac,ac),window.removeEventListener("test",ac,ac)}catch{Ky=!1}function Wz(e,t,n,r,i,a,s,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(p){this.onError(p)}}var Rc=!1,Bp=null,Fp=!1,Hy=null,Kz={onError:function(e){Rc=!0,Bp=e}};function Hz(e,t,n,r,i,a,s,l,c){Rc=!1,Bp=null,Wz.apply(Kz,arguments)}function Vz(e,t,n,r,i,a,s,l,c){if(Hz.apply(this,arguments),Rc){if(Rc){var u=Bp;Rc=!1,Bp=null}else throw Error(be(198));Fp||(Fp=!0,Hy=u)}}function xs(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function CE(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function eS(e){if(xs(e)!==e)throw Error(be(188))}function qz(e){var t=e.alternate;if(!t){if(t=xs(e),t===null)throw Error(be(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return eS(i),e;if(a===r)return eS(i),t;a=a.sibling}throw Error(be(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=a;break}if(l===r){s=!0,r=i,n=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===n){s=!0,n=a,r=i;break}if(l===r){s=!0,r=a,n=i;break}l=l.sibling}if(!s)throw Error(be(189))}}if(n.alternate!==r)throw Error(be(190))}if(n.tag!==3)throw Error(be(188));return n.stateNode.current===n?e:t}function PE(e){return e=qz(e),e!==null?AE(e):null}function AE(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=AE(e);if(t!==null)return t;e=e.sibling}return null}var EE=Pr.unstable_scheduleCallback,tS=Pr.unstable_cancelCallback,Yz=Pr.unstable_shouldYield,Gz=Pr.unstable_requestPaint,rn=Pr.unstable_now,Xz=Pr.unstable_getCurrentPriorityLevel,i0=Pr.unstable_ImmediatePriority,TE=Pr.unstable_UserBlockingPriority,Up=Pr.unstable_NormalPriority,Qz=Pr.unstable_LowPriority,IE=Pr.unstable_IdlePriority,xh=null,_i=null;function Zz(e){if(_i&&typeof _i.onCommitFiberRoot=="function")try{_i.onCommitFiberRoot(xh,e,void 0,(e.current.flags&128)===128)}catch{}}var si=Math.clz32?Math.clz32:t4,Jz=Math.log,e4=Math.LN2;function t4(e){return e>>>=0,e===0?32:31-(Jz(e)/e4|0)|0}var Ad=64,Ed=4194304;function Tc(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Wp(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~i;l!==0?r=Tc(l):(a&=s,a!==0&&(r=Tc(a)))}else s=n&~i,s!==0?r=Tc(s):a!==0&&(r=Tc(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-si(t),i=1<<n,r|=e[n],t&=~i;return r}function n4(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function r4(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var s=31-si(a),l=1<<s,c=i[s];c===-1?(!(l&n)||l&r)&&(i[s]=n4(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function Vy(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function OE(){var e=Ad;return Ad<<=1,!(Ad&4194240)&&(Ad=64),e}function cg(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Lu(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-si(t),e[t]=n}function i4(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-si(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function a0(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-si(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var wt=0;function NE(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var ME,o0,_E,RE,DE,qy=!1,Td=[],qa=null,Ya=null,Ga=null,nu=new Map,ru=new Map,Fa=[],a4="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 nS(e,t){switch(e){case"focusin":case"focusout":qa=null;break;case"dragenter":case"dragleave":Ya=null;break;case"mouseover":case"mouseout":Ga=null;break;case"pointerover":case"pointerout":nu.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ru.delete(t.pointerId)}}function oc(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=$u(t),t!==null&&o0(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function o4(e,t,n,r,i){switch(t){case"focusin":return qa=oc(qa,e,t,n,r,i),!0;case"dragenter":return Ya=oc(Ya,e,t,n,r,i),!0;case"mouseover":return Ga=oc(Ga,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return nu.set(a,oc(nu.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,ru.set(a,oc(ru.get(a)||null,e,t,n,r,i)),!0}return!1}function LE(e){var t=Lo(e.target);if(t!==null){var n=xs(t);if(n!==null){if(t=n.tag,t===13){if(t=CE(n),t!==null){e.blockedOn=t,DE(e.priority,function(){_E(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function wp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Yy(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Uy=r,n.target.dispatchEvent(r),Uy=null}else return t=$u(n),t!==null&&o0(t),e.blockedOn=n,!1;t.shift()}return!0}function rS(e,t,n){wp(e)&&n.delete(t)}function s4(){qy=!1,qa!==null&&wp(qa)&&(qa=null),Ya!==null&&wp(Ya)&&(Ya=null),Ga!==null&&wp(Ga)&&(Ga=null),nu.forEach(rS),ru.forEach(rS)}function sc(e,t){e.blockedOn===t&&(e.blockedOn=null,qy||(qy=!0,Pr.unstable_scheduleCallback(Pr.unstable_NormalPriority,s4)))}function iu(e){function t(i){return sc(i,e)}if(0<Td.length){sc(Td[0],e);for(var n=1;n<Td.length;n++){var r=Td[n];r.blockedOn===e&&(r.blockedOn=null)}}for(qa!==null&&sc(qa,e),Ya!==null&&sc(Ya,e),Ga!==null&&sc(Ga,e),nu.forEach(t),ru.forEach(t),n=0;n<Fa.length;n++)r=Fa[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Fa.length&&(n=Fa[0],n.blockedOn===null);)LE(n),n.blockedOn===null&&Fa.shift()}var ll=ba.ReactCurrentBatchConfig,Kp=!0;function l4(e,t,n,r){var i=wt,a=ll.transition;ll.transition=null;try{wt=1,s0(e,t,n,r)}finally{wt=i,ll.transition=a}}function c4(e,t,n,r){var i=wt,a=ll.transition;ll.transition=null;try{wt=4,s0(e,t,n,r)}finally{wt=i,ll.transition=a}}function s0(e,t,n,r){if(Kp){var i=Yy(e,t,n,r);if(i===null)xg(e,t,r,Hp,n),nS(e,r);else if(o4(i,e,t,n,r))r.stopPropagation();else if(nS(e,r),t&4&&-1<a4.indexOf(e)){for(;i!==null;){var a=$u(i);if(a!==null&&ME(a),a=Yy(e,t,n,r),a===null&&xg(e,t,r,Hp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else xg(e,t,r,null,n)}}var Hp=null;function Yy(e,t,n,r){if(Hp=null,e=r0(r),e=Lo(e),e!==null)if(t=xs(e),t===null)e=null;else if(n=t.tag,n===13){if(e=CE(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Hp=e,null}function zE(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Xz()){case i0:return 1;case TE:return 4;case Up:case Qz:return 16;case IE:return 536870912;default:return 16}default:return 16}}var Ka=null,l0=null,Sp=null;function $E(){if(Sp)return Sp;var e,t=l0,n=t.length,r,i="value"in Ka?Ka.value:Ka.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===i[a-r];r++);return Sp=i.slice(e,1<r?1-r:void 0)}function jp(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Id(){return!0}function iS(){return!1}function Ir(e){function t(n,r,i,a,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=a,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Id:iS,this.isPropagationStopped=iS,this}return Gt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Id)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Id)},persist:function(){},isPersistent:Id}),t}var $l={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},c0=Ir($l),zu=Gt({},$l,{view:0,detail:0}),u4=Ir(zu),ug,dg,lc,bh=Gt({},zu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:u0,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==lc&&(lc&&e.type==="mousemove"?(ug=e.screenX-lc.screenX,dg=e.screenY-lc.screenY):dg=ug=0,lc=e),ug)},movementY:function(e){return"movementY"in e?e.movementY:dg}}),aS=Ir(bh),d4=Gt({},bh,{dataTransfer:0}),p4=Ir(d4),f4=Gt({},zu,{relatedTarget:0}),pg=Ir(f4),h4=Gt({},$l,{animationName:0,elapsedTime:0,pseudoElement:0}),m4=Ir(h4),g4=Gt({},$l,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),y4=Ir(g4),v4=Gt({},$l,{data:0}),oS=Ir(v4),x4={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},b4={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"},w4={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function S4(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=w4[e])?!!t[e]:!1}function u0(){return S4}var j4=Gt({},zu,{key:function(e){if(e.key){var t=x4[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=jp(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?b4[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:u0,charCode:function(e){return e.type==="keypress"?jp(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?jp(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),k4=Ir(j4),C4=Gt({},bh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sS=Ir(C4),P4=Gt({},zu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:u0}),A4=Ir(P4),E4=Gt({},$l,{propertyName:0,elapsedTime:0,pseudoElement:0}),T4=Ir(E4),I4=Gt({},bh,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),O4=Ir(I4),N4=[9,13,27,32],d0=pa&&"CompositionEvent"in window,Dc=null;pa&&"documentMode"in document&&(Dc=document.documentMode);var M4=pa&&"TextEvent"in window&&!Dc,BE=pa&&(!d0||Dc&&8<Dc&&11>=Dc),lS=" ",cS=!1;function FE(e,t){switch(e){case"keyup":return N4.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function UE(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Hs=!1;function _4(e,t){switch(e){case"compositionend":return UE(t);case"keypress":return t.which!==32?null:(cS=!0,lS);case"textInput":return e=t.data,e===lS&&cS?null:e;default:return null}}function R4(e,t){if(Hs)return e==="compositionend"||!d0&&FE(e,t)?(e=$E(),Sp=l0=Ka=null,Hs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return BE&&t.locale!=="ko"?null:t.data;default:return null}}var D4={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 uS(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!D4[e.type]:t==="textarea"}function WE(e,t,n,r){bE(r),t=Vp(t,"onChange"),0<t.length&&(n=new c0("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Lc=null,au=null;function L4(e){eT(e,0)}function wh(e){var t=Ys(e);if(fE(t))return e}function z4(e,t){if(e==="change")return t}var KE=!1;if(pa){var fg;if(pa){var hg="oninput"in document;if(!hg){var dS=document.createElement("div");dS.setAttribute("oninput","return;"),hg=typeof dS.oninput=="function"}fg=hg}else fg=!1;KE=fg&&(!document.documentMode||9<document.documentMode)}function pS(){Lc&&(Lc.detachEvent("onpropertychange",HE),au=Lc=null)}function HE(e){if(e.propertyName==="value"&&wh(au)){var t=[];WE(t,au,e,r0(e)),kE(L4,t)}}function $4(e,t,n){e==="focusin"?(pS(),Lc=t,au=n,Lc.attachEvent("onpropertychange",HE)):e==="focusout"&&pS()}function B4(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return wh(au)}function F4(e,t){if(e==="click")return wh(t)}function U4(e,t){if(e==="input"||e==="change")return wh(t)}function W4(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ci=typeof Object.is=="function"?Object.is:W4;function ou(e,t){if(ci(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Iy.call(t,i)||!ci(e[i],t[i]))return!1}return!0}function fS(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function hS(e,t){var n=fS(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=fS(n)}}function VE(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?VE(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function qE(){for(var e=window,t=$p();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=$p(e.document)}return t}function p0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function K4(e){var t=qE(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&VE(n.ownerDocument.documentElement,n)){if(r!==null&&p0(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=hS(n,a);var s=hS(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var H4=pa&&"documentMode"in document&&11>=document.documentMode,Vs=null,Gy=null,zc=null,Xy=!1;function mS(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Xy||Vs==null||Vs!==$p(r)||(r=Vs,"selectionStart"in r&&p0(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),zc&&ou(zc,r)||(zc=r,r=Vp(Gy,"onSelect"),0<r.length&&(t=new c0("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Vs)))}function Od(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var qs={animationend:Od("Animation","AnimationEnd"),animationiteration:Od("Animation","AnimationIteration"),animationstart:Od("Animation","AnimationStart"),transitionend:Od("Transition","TransitionEnd")},mg={},YE={};pa&&(YE=document.createElement("div").style,"AnimationEvent"in window||(delete qs.animationend.animation,delete qs.animationiteration.animation,delete qs.animationstart.animation),"TransitionEvent"in window||delete qs.transitionend.transition);function Sh(e){if(mg[e])return mg[e];if(!qs[e])return e;var t=qs[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in YE)return mg[e]=t[n];return e}var GE=Sh("animationend"),XE=Sh("animationiteration"),QE=Sh("animationstart"),ZE=Sh("transitionend"),JE=new Map,gS="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 co(e,t){JE.set(e,t),vs(t,[e])}for(var gg=0;gg<gS.length;gg++){var yg=gS[gg],V4=yg.toLowerCase(),q4=yg[0].toUpperCase()+yg.slice(1);co(V4,"on"+q4)}co(GE,"onAnimationEnd");co(XE,"onAnimationIteration");co(QE,"onAnimationStart");co("dblclick","onDoubleClick");co("focusin","onFocus");co("focusout","onBlur");co(ZE,"onTransitionEnd");yl("onMouseEnter",["mouseout","mouseover"]);yl("onMouseLeave",["mouseout","mouseover"]);yl("onPointerEnter",["pointerout","pointerover"]);yl("onPointerLeave",["pointerout","pointerover"]);vs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));vs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));vs("onBeforeInput",["compositionend","keypress","textInput","paste"]);vs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));vs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));vs("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(" "),Y4=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ic));function yS(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Vz(r,t,void 0,e),e.currentTarget=null}function eT(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==a&&i.isPropagationStopped())break e;yS(i,l,u),a=c}else for(s=0;s<r.length;s++){if(l=r[s],c=l.instance,u=l.currentTarget,l=l.listener,c!==a&&i.isPropagationStopped())break e;yS(i,l,u),a=c}}}if(Fp)throw e=Hy,Fp=!1,Hy=null,e}function Rt(e,t){var n=t[tv];n===void 0&&(n=t[tv]=new Set);var r=e+"__bubble";n.has(r)||(tT(t,e,2,!1),n.add(r))}function vg(e,t,n){var r=0;t&&(r|=4),tT(n,e,r,t)}var Nd="_reactListening"+Math.random().toString(36).slice(2);function su(e){if(!e[Nd]){e[Nd]=!0,lE.forEach(function(n){n!=="selectionchange"&&(Y4.has(n)||vg(n,!1,e),vg(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Nd]||(t[Nd]=!0,vg("selectionchange",!1,t))}}function tT(e,t,n,r){switch(zE(t)){case 1:var i=l4;break;case 4:i=c4;break;default:i=s0}n=i.bind(null,t,n,e),i=void 0,!Ky||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function xg(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var l=r.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var c=s.tag;if((c===3||c===4)&&(c=s.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;s=s.return}for(;l!==null;){if(s=Lo(l),s===null)return;if(c=s.tag,c===5||c===6){r=a=s;continue e}l=l.parentNode}}r=r.return}kE(function(){var u=a,p=r0(n),d=[];e:{var f=JE.get(e);if(f!==void 0){var m=c0,g=e;switch(e){case"keypress":if(jp(n)===0)break e;case"keydown":case"keyup":m=k4;break;case"focusin":g="focus",m=pg;break;case"focusout":g="blur",m=pg;break;case"beforeblur":case"afterblur":m=pg;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=aS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=p4;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=A4;break;case GE:case XE:case QE:m=m4;break;case ZE:m=T4;break;case"scroll":m=u4;break;case"wheel":m=O4;break;case"copy":case"cut":case"paste":m=y4;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=sS}var v=(t&4)!==0,x=!v&&e==="scroll",y=v?f!==null?f+"Capture":null:f;v=[];for(var b=u,w;b!==null;){w=b;var S=w.stateNode;if(w.tag===5&&S!==null&&(w=S,y!==null&&(S=tu(b,y),S!=null&&v.push(lu(b,S,w)))),x)break;b=b.return}0<v.length&&(f=new m(f,g,null,n,p),d.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",f&&n!==Uy&&(g=n.relatedTarget||n.fromElement)&&(Lo(g)||g[fa]))break e;if((m||f)&&(f=p.window===p?p:(f=p.ownerDocument)?f.defaultView||f.parentWindow:window,m?(g=n.relatedTarget||n.toElement,m=u,g=g?Lo(g):null,g!==null&&(x=xs(g),g!==x||g.tag!==5&&g.tag!==6)&&(g=null)):(m=null,g=u),m!==g)){if(v=aS,S="onMouseLeave",y="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(v=sS,S="onPointerLeave",y="onPointerEnter",b="pointer"),x=m==null?f:Ys(m),w=g==null?f:Ys(g),f=new v(S,b+"leave",m,n,p),f.target=x,f.relatedTarget=w,S=null,Lo(p)===u&&(v=new v(y,b+"enter",g,n,p),v.target=w,v.relatedTarget=x,S=v),x=S,m&&g)t:{for(v=m,y=g,b=0,w=v;w;w=Is(w))b++;for(w=0,S=y;S;S=Is(S))w++;for(;0<b-w;)v=Is(v),b--;for(;0<w-b;)y=Is(y),w--;for(;b--;){if(v===y||y!==null&&v===y.alternate)break t;v=Is(v),y=Is(y)}v=null}else v=null;m!==null&&vS(d,f,m,v,!1),g!==null&&x!==null&&vS(d,x,g,v,!0)}}e:{if(f=u?Ys(u):window,m=f.nodeName&&f.nodeName.toLowerCase(),m==="select"||m==="input"&&f.type==="file")var k=z4;else if(uS(f))if(KE)k=U4;else{k=B4;var j=$4}else(m=f.nodeName)&&m.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(k=F4);if(k&&(k=k(e,u))){WE(d,k,n,p);break e}j&&j(e,f,u),e==="focusout"&&(j=f._wrapperState)&&j.controlled&&f.type==="number"&&Ly(f,"number",f.value)}switch(j=u?Ys(u):window,e){case"focusin":(uS(j)||j.contentEditable==="true")&&(Vs=j,Gy=u,zc=null);break;case"focusout":zc=Gy=Vs=null;break;case"mousedown":Xy=!0;break;case"contextmenu":case"mouseup":case"dragend":Xy=!1,mS(d,n,p);break;case"selectionchange":if(H4)break;case"keydown":case"keyup":mS(d,n,p)}var A;if(d0)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Hs?FE(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(BE&&n.locale!=="ko"&&(Hs||E!=="onCompositionStart"?E==="onCompositionEnd"&&Hs&&(A=$E()):(Ka=p,l0="value"in Ka?Ka.value:Ka.textContent,Hs=!0)),j=Vp(u,E),0<j.length&&(E=new oS(E,e,null,n,p),d.push({event:E,listeners:j}),A?E.data=A:(A=UE(n),A!==null&&(E.data=A)))),(A=M4?_4(e,n):R4(e,n))&&(u=Vp(u,"onBeforeInput"),0<u.length&&(p=new oS("onBeforeInput","beforeinput",null,n,p),d.push({event:p,listeners:u}),p.data=A))}eT(d,t)})}function lu(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Vp(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=tu(e,n),a!=null&&r.unshift(lu(e,a,i)),a=tu(e,t),a!=null&&r.push(lu(e,a,i))),e=e.return}return r}function Is(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function vS(e,t,n,r,i){for(var a=t._reactName,s=[];n!==null&&n!==r;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&u!==null&&(l=u,i?(c=tu(n,a),c!=null&&s.unshift(lu(n,c,l))):i||(c=tu(n,a),c!=null&&s.push(lu(n,c,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var G4=/\r\n?/g,X4=/\u0000|\uFFFD/g;function xS(e){return(typeof e=="string"?e:""+e).replace(G4,`
|
|
38
|
+
`).replace(X4,"")}function Md(e,t,n){if(t=xS(t),xS(e)!==t&&n)throw Error(be(425))}function qp(){}var Qy=null,Zy=null;function Jy(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ev=typeof setTimeout=="function"?setTimeout:void 0,Q4=typeof clearTimeout=="function"?clearTimeout:void 0,bS=typeof Promise=="function"?Promise:void 0,Z4=typeof queueMicrotask=="function"?queueMicrotask:typeof bS<"u"?function(e){return bS.resolve(null).then(e).catch(J4)}:ev;function J4(e){setTimeout(function(){throw e})}function bg(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),iu(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);iu(t)}function Xa(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function wS(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Bl=Math.random().toString(36).slice(2),Ti="__reactFiber$"+Bl,cu="__reactProps$"+Bl,fa="__reactContainer$"+Bl,tv="__reactEvents$"+Bl,e$="__reactListeners$"+Bl,t$="__reactHandles$"+Bl;function Lo(e){var t=e[Ti];if(t)return t;for(var n=e.parentNode;n;){if(t=n[fa]||n[Ti]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=wS(e);e!==null;){if(n=e[Ti])return n;e=wS(e)}return t}e=n,n=e.parentNode}return null}function $u(e){return e=e[Ti]||e[fa],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ys(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(be(33))}function jh(e){return e[cu]||null}var nv=[],Gs=-1;function uo(e){return{current:e}}function zt(e){0>Gs||(e.current=nv[Gs],nv[Gs]=null,Gs--)}function Nt(e,t){Gs++,nv[Gs]=e.current,e.current=t}var ao={},Vn=uo(ao),dr=uo(!1),rs=ao;function vl(e,t){var n=e.type.contextTypes;if(!n)return ao;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function pr(e){return e=e.childContextTypes,e!=null}function Yp(){zt(dr),zt(Vn)}function SS(e,t,n){if(Vn.current!==ao)throw Error(be(168));Nt(Vn,t),Nt(dr,n)}function nT(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(be(108,$z(e)||"Unknown",i));return Gt({},n,r)}function Gp(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ao,rs=Vn.current,Nt(Vn,e),Nt(dr,dr.current),!0}function jS(e,t,n){var r=e.stateNode;if(!r)throw Error(be(169));n?(e=nT(e,t,rs),r.__reactInternalMemoizedMergedChildContext=e,zt(dr),zt(Vn),Nt(Vn,e)):zt(dr),Nt(dr,n)}var ta=null,kh=!1,wg=!1;function rT(e){ta===null?ta=[e]:ta.push(e)}function n$(e){kh=!0,rT(e)}function po(){if(!wg&&ta!==null){wg=!0;var e=0,t=wt;try{var n=ta;for(wt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ta=null,kh=!1}catch(i){throw ta!==null&&(ta=ta.slice(e+1)),EE(i0,po),i}finally{wt=t,wg=!1}}return null}var Xs=[],Qs=0,Xp=null,Qp=0,zr=[],$r=0,is=null,ia=1,aa="";function Eo(e,t){Xs[Qs++]=Qp,Xs[Qs++]=Xp,Xp=e,Qp=t}function iT(e,t,n){zr[$r++]=ia,zr[$r++]=aa,zr[$r++]=is,is=e;var r=ia;e=aa;var i=32-si(r)-1;r&=~(1<<i),n+=1;var a=32-si(t)+i;if(30<a){var s=i-i%5;a=(r&(1<<s)-1).toString(32),r>>=s,i-=s,ia=1<<32-si(t)+i|n<<i|r,aa=a+e}else ia=1<<a|n<<i|r,aa=e}function f0(e){e.return!==null&&(Eo(e,1),iT(e,1,0))}function h0(e){for(;e===Xp;)Xp=Xs[--Qs],Xs[Qs]=null,Qp=Xs[--Qs],Xs[Qs]=null;for(;e===is;)is=zr[--$r],zr[$r]=null,aa=zr[--$r],zr[$r]=null,ia=zr[--$r],zr[$r]=null}var kr=null,wr=null,Ut=!1,ri=null;function aT(e,t){var n=Fr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function kS(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,kr=e,wr=Xa(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,kr=e,wr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=is!==null?{id:ia,overflow:aa}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Fr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,kr=e,wr=null,!0):!1;default:return!1}}function rv(e){return(e.mode&1)!==0&&(e.flags&128)===0}function iv(e){if(Ut){var t=wr;if(t){var n=t;if(!kS(e,t)){if(rv(e))throw Error(be(418));t=Xa(n.nextSibling);var r=kr;t&&kS(e,t)?aT(r,n):(e.flags=e.flags&-4097|2,Ut=!1,kr=e)}}else{if(rv(e))throw Error(be(418));e.flags=e.flags&-4097|2,Ut=!1,kr=e}}}function CS(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;kr=e}function _d(e){if(e!==kr)return!1;if(!Ut)return CS(e),Ut=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Jy(e.type,e.memoizedProps)),t&&(t=wr)){if(rv(e))throw oT(),Error(be(418));for(;t;)aT(e,t),t=Xa(t.nextSibling)}if(CS(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(be(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){wr=Xa(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}wr=null}}else wr=kr?Xa(e.stateNode.nextSibling):null;return!0}function oT(){for(var e=wr;e;)e=Xa(e.nextSibling)}function xl(){wr=kr=null,Ut=!1}function m0(e){ri===null?ri=[e]:ri.push(e)}var r$=ba.ReactCurrentBatchConfig;function cc(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(be(309));var r=n.stateNode}if(!r)throw Error(be(147,e));var i=r,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(s){var l=i.refs;s===null?delete l[a]:l[a]=s},t._stringRef=a,t)}if(typeof e!="string")throw Error(be(284));if(!n._owner)throw Error(be(290,e))}return e}function Rd(e,t){throw e=Object.prototype.toString.call(t),Error(be(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function PS(e){var t=e._init;return t(e._payload)}function sT(e){function t(y,b){if(e){var w=y.deletions;w===null?(y.deletions=[b],y.flags|=16):w.push(b)}}function n(y,b){if(!e)return null;for(;b!==null;)t(y,b),b=b.sibling;return null}function r(y,b){for(y=new Map;b!==null;)b.key!==null?y.set(b.key,b):y.set(b.index,b),b=b.sibling;return y}function i(y,b){return y=eo(y,b),y.index=0,y.sibling=null,y}function a(y,b,w){return y.index=w,e?(w=y.alternate,w!==null?(w=w.index,w<b?(y.flags|=2,b):w):(y.flags|=2,b)):(y.flags|=1048576,b)}function s(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,b,w,S){return b===null||b.tag!==6?(b=Eg(w,y.mode,S),b.return=y,b):(b=i(b,w),b.return=y,b)}function c(y,b,w,S){var k=w.type;return k===Ks?p(y,b,w.props.children,S,w.key):b!==null&&(b.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===La&&PS(k)===b.type)?(S=i(b,w.props),S.ref=cc(y,b,w),S.return=y,S):(S=Ip(w.type,w.key,w.props,null,y.mode,S),S.ref=cc(y,b,w),S.return=y,S)}function u(y,b,w,S){return b===null||b.tag!==4||b.stateNode.containerInfo!==w.containerInfo||b.stateNode.implementation!==w.implementation?(b=Tg(w,y.mode,S),b.return=y,b):(b=i(b,w.children||[]),b.return=y,b)}function p(y,b,w,S,k){return b===null||b.tag!==7?(b=Xo(w,y.mode,S,k),b.return=y,b):(b=i(b,w),b.return=y,b)}function d(y,b,w){if(typeof b=="string"&&b!==""||typeof b=="number")return b=Eg(""+b,y.mode,w),b.return=y,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case kd:return w=Ip(b.type,b.key,b.props,null,y.mode,w),w.ref=cc(y,null,b),w.return=y,w;case Ws:return b=Tg(b,y.mode,w),b.return=y,b;case La:var S=b._init;return d(y,S(b._payload),w)}if(Ec(b)||ic(b))return b=Xo(b,y.mode,w,null),b.return=y,b;Rd(y,b)}return null}function f(y,b,w,S){var k=b!==null?b.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return k!==null?null:l(y,b,""+w,S);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case kd:return w.key===k?c(y,b,w,S):null;case Ws:return w.key===k?u(y,b,w,S):null;case La:return k=w._init,f(y,b,k(w._payload),S)}if(Ec(w)||ic(w))return k!==null?null:p(y,b,w,S,null);Rd(y,w)}return null}function m(y,b,w,S,k){if(typeof S=="string"&&S!==""||typeof S=="number")return y=y.get(w)||null,l(b,y,""+S,k);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case kd:return y=y.get(S.key===null?w:S.key)||null,c(b,y,S,k);case Ws:return y=y.get(S.key===null?w:S.key)||null,u(b,y,S,k);case La:var j=S._init;return m(y,b,w,j(S._payload),k)}if(Ec(S)||ic(S))return y=y.get(w)||null,p(b,y,S,k,null);Rd(b,S)}return null}function g(y,b,w,S){for(var k=null,j=null,A=b,E=b=0,D=null;A!==null&&E<w.length;E++){A.index>E?(D=A,A=null):D=A.sibling;var O=f(y,A,w[E],S);if(O===null){A===null&&(A=D);break}e&&A&&O.alternate===null&&t(y,A),b=a(O,b,E),j===null?k=O:j.sibling=O,j=O,A=D}if(E===w.length)return n(y,A),Ut&&Eo(y,E),k;if(A===null){for(;E<w.length;E++)A=d(y,w[E],S),A!==null&&(b=a(A,b,E),j===null?k=A:j.sibling=A,j=A);return Ut&&Eo(y,E),k}for(A=r(y,A);E<w.length;E++)D=m(A,y,E,w[E],S),D!==null&&(e&&D.alternate!==null&&A.delete(D.key===null?E:D.key),b=a(D,b,E),j===null?k=D:j.sibling=D,j=D);return e&&A.forEach(function(_){return t(y,_)}),Ut&&Eo(y,E),k}function v(y,b,w,S){var k=ic(w);if(typeof k!="function")throw Error(be(150));if(w=k.call(w),w==null)throw Error(be(151));for(var j=k=null,A=b,E=b=0,D=null,O=w.next();A!==null&&!O.done;E++,O=w.next()){A.index>E?(D=A,A=null):D=A.sibling;var _=f(y,A,O.value,S);if(_===null){A===null&&(A=D);break}e&&A&&_.alternate===null&&t(y,A),b=a(_,b,E),j===null?k=_:j.sibling=_,j=_,A=D}if(O.done)return n(y,A),Ut&&Eo(y,E),k;if(A===null){for(;!O.done;E++,O=w.next())O=d(y,O.value,S),O!==null&&(b=a(O,b,E),j===null?k=O:j.sibling=O,j=O);return Ut&&Eo(y,E),k}for(A=r(y,A);!O.done;E++,O=w.next())O=m(A,y,E,O.value,S),O!==null&&(e&&O.alternate!==null&&A.delete(O.key===null?E:O.key),b=a(O,b,E),j===null?k=O:j.sibling=O,j=O);return e&&A.forEach(function(R){return t(y,R)}),Ut&&Eo(y,E),k}function x(y,b,w,S){if(typeof w=="object"&&w!==null&&w.type===Ks&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case kd:e:{for(var k=w.key,j=b;j!==null;){if(j.key===k){if(k=w.type,k===Ks){if(j.tag===7){n(y,j.sibling),b=i(j,w.props.children),b.return=y,y=b;break e}}else if(j.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===La&&PS(k)===j.type){n(y,j.sibling),b=i(j,w.props),b.ref=cc(y,j,w),b.return=y,y=b;break e}n(y,j);break}else t(y,j);j=j.sibling}w.type===Ks?(b=Xo(w.props.children,y.mode,S,w.key),b.return=y,y=b):(S=Ip(w.type,w.key,w.props,null,y.mode,S),S.ref=cc(y,b,w),S.return=y,y=S)}return s(y);case Ws:e:{for(j=w.key;b!==null;){if(b.key===j)if(b.tag===4&&b.stateNode.containerInfo===w.containerInfo&&b.stateNode.implementation===w.implementation){n(y,b.sibling),b=i(b,w.children||[]),b.return=y,y=b;break e}else{n(y,b);break}else t(y,b);b=b.sibling}b=Tg(w,y.mode,S),b.return=y,y=b}return s(y);case La:return j=w._init,x(y,b,j(w._payload),S)}if(Ec(w))return g(y,b,w,S);if(ic(w))return v(y,b,w,S);Rd(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,b!==null&&b.tag===6?(n(y,b.sibling),b=i(b,w),b.return=y,y=b):(n(y,b),b=Eg(w,y.mode,S),b.return=y,y=b),s(y)):n(y,b)}return x}var bl=sT(!0),lT=sT(!1),Zp=uo(null),Jp=null,Zs=null,g0=null;function y0(){g0=Zs=Jp=null}function v0(e){var t=Zp.current;zt(Zp),e._currentValue=t}function av(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function cl(e,t){Jp=e,g0=Zs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(lr=!0),e.firstContext=null)}function Hr(e){var t=e._currentValue;if(g0!==e)if(e={context:e,memoizedValue:t,next:null},Zs===null){if(Jp===null)throw Error(be(308));Zs=e,Jp.dependencies={lanes:0,firstContext:e}}else Zs=Zs.next=e;return t}var zo=null;function x0(e){zo===null?zo=[e]:zo.push(e)}function cT(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,x0(t)):(n.next=i.next,i.next=n),t.interleaved=n,ha(e,r)}function ha(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var za=!1;function b0(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function uT(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ca(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Qa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ft&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,ha(e,n)}return i=r.interleaved,i===null?(t.next=t,x0(r)):(t.next=i.next,i.next=t),r.interleaved=t,ha(e,n)}function kp(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,a0(e,n)}}function AS(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=s:a=a.next=s,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ef(e,t,n,r){var i=e.updateQueue;za=!1;var a=i.firstBaseUpdate,s=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,u=c.next;c.next=null,s===null?a=u:s.next=u,s=c;var p=e.alternate;p!==null&&(p=p.updateQueue,l=p.lastBaseUpdate,l!==s&&(l===null?p.firstBaseUpdate=u:l.next=u,p.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;s=0,p=u=c=null,l=a;do{var f=l.lane,m=l.eventTime;if((r&f)===f){p!==null&&(p=p.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,v=l;switch(f=t,m=n,v.tag){case 1:if(g=v.payload,typeof g=="function"){d=g.call(m,d,f);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=v.payload,f=typeof g=="function"?g.call(m,d,f):g,f==null)break e;d=Gt({},d,f);break e;case 2:za=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[l]:f.push(l))}else m={eventTime:m,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},p===null?(u=p=m,c=d):p=p.next=m,s|=f;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;f=l,l=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(p===null&&(c=d),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=p,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);os|=s,e.lanes=s,e.memoizedState=d}}function ES(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(be(191,i));i.call(r)}}}var Bu={},Ri=uo(Bu),uu=uo(Bu),du=uo(Bu);function $o(e){if(e===Bu)throw Error(be(174));return e}function w0(e,t){switch(Nt(du,t),Nt(uu,e),Nt(Ri,Bu),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:$y(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=$y(t,e)}zt(Ri),Nt(Ri,t)}function wl(){zt(Ri),zt(uu),zt(du)}function dT(e){$o(du.current);var t=$o(Ri.current),n=$y(t,e.type);t!==n&&(Nt(uu,e),Nt(Ri,n))}function S0(e){uu.current===e&&(zt(Ri),zt(uu))}var Vt=uo(0);function tf(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Sg=[];function j0(){for(var e=0;e<Sg.length;e++)Sg[e]._workInProgressVersionPrimary=null;Sg.length=0}var Cp=ba.ReactCurrentDispatcher,jg=ba.ReactCurrentBatchConfig,as=0,qt=null,gn=null,Sn=null,nf=!1,$c=!1,pu=0,i$=0;function $n(){throw Error(be(321))}function k0(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ci(e[n],t[n]))return!1;return!0}function C0(e,t,n,r,i,a){if(as=a,qt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Cp.current=e===null||e.memoizedState===null?l$:c$,e=n(r,i),$c){a=0;do{if($c=!1,pu=0,25<=a)throw Error(be(301));a+=1,Sn=gn=null,t.updateQueue=null,Cp.current=u$,e=n(r,i)}while($c)}if(Cp.current=rf,t=gn!==null&&gn.next!==null,as=0,Sn=gn=qt=null,nf=!1,t)throw Error(be(300));return e}function P0(){var e=pu!==0;return pu=0,e}function Ci(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Sn===null?qt.memoizedState=Sn=e:Sn=Sn.next=e,Sn}function Vr(){if(gn===null){var e=qt.alternate;e=e!==null?e.memoizedState:null}else e=gn.next;var t=Sn===null?qt.memoizedState:Sn.next;if(t!==null)Sn=t,gn=e;else{if(e===null)throw Error(be(310));gn=e,e={memoizedState:gn.memoizedState,baseState:gn.baseState,baseQueue:gn.baseQueue,queue:gn.queue,next:null},Sn===null?qt.memoizedState=Sn=e:Sn=Sn.next=e}return Sn}function fu(e,t){return typeof t=="function"?t(e):t}function kg(e){var t=Vr(),n=t.queue;if(n===null)throw Error(be(311));n.lastRenderedReducer=e;var r=gn,i=r.baseQueue,a=n.pending;if(a!==null){if(i!==null){var s=i.next;i.next=a.next,a.next=s}r.baseQueue=i=a,n.pending=null}if(i!==null){a=i.next,r=r.baseState;var l=s=null,c=null,u=a;do{var p=u.lane;if((as&p)===p)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:p,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=d,s=r):c=c.next=d,qt.lanes|=p,os|=p}u=u.next}while(u!==null&&u!==a);c===null?s=r:c.next=l,ci(r,t.memoizedState)||(lr=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do a=i.lane,qt.lanes|=a,os|=a,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Cg(e){var t=Vr(),n=t.queue;if(n===null)throw Error(be(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do a=e(a,s.action),s=s.next;while(s!==i);ci(a,t.memoizedState)||(lr=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function pT(){}function fT(e,t){var n=qt,r=Vr(),i=t(),a=!ci(r.memoizedState,i);if(a&&(r.memoizedState=i,lr=!0),r=r.queue,A0(gT.bind(null,n,r,e),[e]),r.getSnapshot!==t||a||Sn!==null&&Sn.memoizedState.tag&1){if(n.flags|=2048,hu(9,mT.bind(null,n,r,i,t),void 0,null),kn===null)throw Error(be(349));as&30||hT(n,t,i)}return i}function hT(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=qt.updateQueue,t===null?(t={lastEffect:null,stores:null},qt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function mT(e,t,n,r){t.value=n,t.getSnapshot=r,yT(t)&&vT(e)}function gT(e,t,n){return n(function(){yT(t)&&vT(e)})}function yT(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ci(e,n)}catch{return!0}}function vT(e){var t=ha(e,1);t!==null&&li(t,e,1,-1)}function TS(e){var t=Ci();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:fu,lastRenderedState:e},t.queue=e,e=e.dispatch=s$.bind(null,qt,e),[t.memoizedState,e]}function hu(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=qt.updateQueue,t===null?(t={lastEffect:null,stores:null},qt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function xT(){return Vr().memoizedState}function Pp(e,t,n,r){var i=Ci();qt.flags|=e,i.memoizedState=hu(1|t,n,void 0,r===void 0?null:r)}function Ch(e,t,n,r){var i=Vr();r=r===void 0?null:r;var a=void 0;if(gn!==null){var s=gn.memoizedState;if(a=s.destroy,r!==null&&k0(r,s.deps)){i.memoizedState=hu(t,n,a,r);return}}qt.flags|=e,i.memoizedState=hu(1|t,n,a,r)}function IS(e,t){return Pp(8390656,8,e,t)}function A0(e,t){return Ch(2048,8,e,t)}function bT(e,t){return Ch(4,2,e,t)}function wT(e,t){return Ch(4,4,e,t)}function ST(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function jT(e,t,n){return n=n!=null?n.concat([e]):null,Ch(4,4,ST.bind(null,t,e),n)}function E0(){}function kT(e,t){var n=Vr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&k0(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function CT(e,t){var n=Vr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&k0(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function PT(e,t,n){return as&21?(ci(n,t)||(n=OE(),qt.lanes|=n,os|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,lr=!0),e.memoizedState=n)}function a$(e,t){var n=wt;wt=n!==0&&4>n?n:4,e(!0);var r=jg.transition;jg.transition={};try{e(!1),t()}finally{wt=n,jg.transition=r}}function AT(){return Vr().memoizedState}function o$(e,t,n){var r=Ja(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ET(e))TT(t,n);else if(n=cT(e,t,n,r),n!==null){var i=Jn();li(n,e,r,i),IT(n,t,r)}}function s$(e,t,n){var r=Ja(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ET(e))TT(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var s=t.lastRenderedState,l=a(s,n);if(i.hasEagerState=!0,i.eagerState=l,ci(l,s)){var c=t.interleaved;c===null?(i.next=i,x0(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=cT(e,t,i,r),n!==null&&(i=Jn(),li(n,e,r,i),IT(n,t,r))}}function ET(e){var t=e.alternate;return e===qt||t!==null&&t===qt}function TT(e,t){$c=nf=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function IT(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,a0(e,n)}}var rf={readContext:Hr,useCallback:$n,useContext:$n,useEffect:$n,useImperativeHandle:$n,useInsertionEffect:$n,useLayoutEffect:$n,useMemo:$n,useReducer:$n,useRef:$n,useState:$n,useDebugValue:$n,useDeferredValue:$n,useTransition:$n,useMutableSource:$n,useSyncExternalStore:$n,useId:$n,unstable_isNewReconciler:!1},l$={readContext:Hr,useCallback:function(e,t){return Ci().memoizedState=[e,t===void 0?null:t],e},useContext:Hr,useEffect:IS,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Pp(4194308,4,ST.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Pp(4194308,4,e,t)},useInsertionEffect:function(e,t){return Pp(4,2,e,t)},useMemo:function(e,t){var n=Ci();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ci();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=o$.bind(null,qt,e),[r.memoizedState,e]},useRef:function(e){var t=Ci();return e={current:e},t.memoizedState=e},useState:TS,useDebugValue:E0,useDeferredValue:function(e){return Ci().memoizedState=e},useTransition:function(){var e=TS(!1),t=e[0];return e=a$.bind(null,e[1]),Ci().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=qt,i=Ci();if(Ut){if(n===void 0)throw Error(be(407));n=n()}else{if(n=t(),kn===null)throw Error(be(349));as&30||hT(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,IS(gT.bind(null,r,a,e),[e]),r.flags|=2048,hu(9,mT.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Ci(),t=kn.identifierPrefix;if(Ut){var n=aa,r=ia;n=(r&~(1<<32-si(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=pu++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=i$++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},c$={readContext:Hr,useCallback:kT,useContext:Hr,useEffect:A0,useImperativeHandle:jT,useInsertionEffect:bT,useLayoutEffect:wT,useMemo:CT,useReducer:kg,useRef:xT,useState:function(){return kg(fu)},useDebugValue:E0,useDeferredValue:function(e){var t=Vr();return PT(t,gn.memoizedState,e)},useTransition:function(){var e=kg(fu)[0],t=Vr().memoizedState;return[e,t]},useMutableSource:pT,useSyncExternalStore:fT,useId:AT,unstable_isNewReconciler:!1},u$={readContext:Hr,useCallback:kT,useContext:Hr,useEffect:A0,useImperativeHandle:jT,useInsertionEffect:bT,useLayoutEffect:wT,useMemo:CT,useReducer:Cg,useRef:xT,useState:function(){return Cg(fu)},useDebugValue:E0,useDeferredValue:function(e){var t=Vr();return gn===null?t.memoizedState=e:PT(t,gn.memoizedState,e)},useTransition:function(){var e=Cg(fu)[0],t=Vr().memoizedState;return[e,t]},useMutableSource:pT,useSyncExternalStore:fT,useId:AT,unstable_isNewReconciler:!1};function ei(e,t){if(e&&e.defaultProps){t=Gt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function ov(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Gt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ph={isMounted:function(e){return(e=e._reactInternals)?xs(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Jn(),i=Ja(e),a=ca(r,i);a.payload=t,n!=null&&(a.callback=n),t=Qa(e,a,i),t!==null&&(li(t,e,i,r),kp(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Jn(),i=Ja(e),a=ca(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Qa(e,a,i),t!==null&&(li(t,e,i,r),kp(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Jn(),r=Ja(e),i=ca(n,r);i.tag=2,t!=null&&(i.callback=t),t=Qa(e,i,r),t!==null&&(li(t,e,r,n),kp(t,e,r))}};function OS(e,t,n,r,i,a,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,a,s):t.prototype&&t.prototype.isPureReactComponent?!ou(n,r)||!ou(i,a):!0}function OT(e,t,n){var r=!1,i=ao,a=t.contextType;return typeof a=="object"&&a!==null?a=Hr(a):(i=pr(t)?rs:Vn.current,r=t.contextTypes,a=(r=r!=null)?vl(e,i):ao),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ph,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function NS(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ph.enqueueReplaceState(t,t.state,null)}function sv(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},b0(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=Hr(a):(a=pr(t)?rs:Vn.current,i.context=vl(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(ov(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Ph.enqueueReplaceState(i,i.state,null),ef(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Sl(e,t){try{var n="",r=t;do n+=zz(r),r=r.return;while(r);var i=n}catch(a){i=`
|
|
39
|
+
Error generating stack: `+a.message+`
|
|
40
|
+
`+a.stack}return{value:e,source:t,stack:i,digest:null}}function Pg(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function lv(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var d$=typeof WeakMap=="function"?WeakMap:Map;function NT(e,t,n){n=ca(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){of||(of=!0,vv=r),lv(e,t)},n}function MT(e,t,n){n=ca(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){lv(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){lv(e,t),typeof r!="function"&&(Za===null?Za=new Set([this]):Za.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function MS(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new d$;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=C$.bind(null,e,t,n),t.then(e,e))}function _S(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function RS(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=ca(-1,1),t.tag=2,Qa(n,t,1))),n.lanes|=1),e)}var p$=ba.ReactCurrentOwner,lr=!1;function Qn(e,t,n,r){t.child=e===null?lT(t,null,n,r):bl(t,e.child,n,r)}function DS(e,t,n,r,i){n=n.render;var a=t.ref;return cl(t,i),r=C0(e,t,n,r,a,i),n=P0(),e!==null&&!lr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ma(e,t,i)):(Ut&&n&&f0(t),t.flags|=1,Qn(e,t,r,i),t.child)}function LS(e,t,n,r,i){if(e===null){var a=n.type;return typeof a=="function"&&!D0(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,_T(e,t,a,r,i)):(e=Ip(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var s=a.memoizedProps;if(n=n.compare,n=n!==null?n:ou,n(s,r)&&e.ref===t.ref)return ma(e,t,i)}return t.flags|=1,e=eo(a,r),e.ref=t.ref,e.return=t,t.child=e}function _T(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(ou(a,r)&&e.ref===t.ref)if(lr=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(lr=!0);else return t.lanes=e.lanes,ma(e,t,i)}return cv(e,t,n,r,i)}function RT(e,t,n){var r=t.pendingProps,i=r.children,a=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Nt(el,xr),xr|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Nt(el,xr),xr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a!==null?a.baseLanes:n,Nt(el,xr),xr|=r}else a!==null?(r=a.baseLanes|n,t.memoizedState=null):r=n,Nt(el,xr),xr|=r;return Qn(e,t,i,n),t.child}function DT(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function cv(e,t,n,r,i){var a=pr(n)?rs:Vn.current;return a=vl(t,a),cl(t,i),n=C0(e,t,n,r,a,i),r=P0(),e!==null&&!lr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,ma(e,t,i)):(Ut&&r&&f0(t),t.flags|=1,Qn(e,t,n,i),t.child)}function zS(e,t,n,r,i){if(pr(n)){var a=!0;Gp(t)}else a=!1;if(cl(t,i),t.stateNode===null)Ap(e,t),OT(t,n,r),sv(t,n,r,i),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var c=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=Hr(u):(u=pr(n)?rs:Vn.current,u=vl(t,u));var p=n.getDerivedStateFromProps,d=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||c!==u)&&NS(t,s,r,u),za=!1;var f=t.memoizedState;s.state=f,ef(t,r,s,i),c=t.memoizedState,l!==r||f!==c||dr.current||za?(typeof p=="function"&&(ov(t,n,p,r),c=t.memoizedState),(l=za||OS(t,n,l,r,f,c,u))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),s.props=r,s.state=c,s.context=u,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,uT(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:ei(t.type,l),s.props=u,d=t.pendingProps,f=s.context,c=n.contextType,typeof c=="object"&&c!==null?c=Hr(c):(c=pr(n)?rs:Vn.current,c=vl(t,c));var m=n.getDerivedStateFromProps;(p=typeof m=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==d||f!==c)&&NS(t,s,r,c),za=!1,f=t.memoizedState,s.state=f,ef(t,r,s,i);var g=t.memoizedState;l!==d||f!==g||dr.current||za?(typeof m=="function"&&(ov(t,n,m,r),g=t.memoizedState),(u=za||OS(t,n,u,r,f,g,c)||!1)?(p||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,g,c),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,g,c)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),s.props=r,s.state=g,s.context=c,r=u):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return uv(e,t,n,r,a,i)}function uv(e,t,n,r,i,a){DT(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return i&&jS(t,n,!1),ma(e,t,a);r=t.stateNode,p$.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=bl(t,e.child,null,a),t.child=bl(t,null,l,a)):Qn(e,t,l,a),t.memoizedState=r.state,i&&jS(t,n,!0),t.child}function LT(e){var t=e.stateNode;t.pendingContext?SS(e,t.pendingContext,t.pendingContext!==t.context):t.context&&SS(e,t.context,!1),w0(e,t.containerInfo)}function $S(e,t,n,r,i){return xl(),m0(i),t.flags|=256,Qn(e,t,n,r),t.child}var dv={dehydrated:null,treeContext:null,retryLane:0};function pv(e){return{baseLanes:e,cachePool:null,transitions:null}}function zT(e,t,n){var r=t.pendingProps,i=Vt.current,a=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Nt(Vt,i&1),e===null)return iv(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,a?(r=t.mode,a=t.child,s={mode:"hidden",children:s},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=s):a=Th(s,r,0,null),e=Xo(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=pv(n),t.memoizedState=dv,e):T0(t,s));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return f$(e,t,s,r,l,i,n);if(a){a=r.fallback,s=t.mode,i=e.child,l=i.sibling;var c={mode:"hidden",children:r.children};return!(s&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=eo(i,c),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?a=eo(l,a):(a=Xo(a,s,n,null),a.flags|=2),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,s=e.child.memoizedState,s=s===null?pv(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},a.memoizedState=s,a.childLanes=e.childLanes&~n,t.memoizedState=dv,r}return a=e.child,e=a.sibling,r=eo(a,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function T0(e,t){return t=Th({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Dd(e,t,n,r){return r!==null&&m0(r),bl(t,e.child,null,n),e=T0(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function f$(e,t,n,r,i,a,s){if(n)return t.flags&256?(t.flags&=-257,r=Pg(Error(be(422))),Dd(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=r.fallback,i=t.mode,r=Th({mode:"visible",children:r.children},i,0,null),a=Xo(a,i,s,null),a.flags|=2,r.return=t,a.return=t,r.sibling=a,t.child=r,t.mode&1&&bl(t,e.child,null,s),t.child.memoizedState=pv(s),t.memoizedState=dv,a);if(!(t.mode&1))return Dd(e,t,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,a=Error(be(419)),r=Pg(a,r,void 0),Dd(e,t,s,r)}if(l=(s&e.childLanes)!==0,lr||l){if(r=kn,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|s)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,ha(e,i),li(r,e,i,-1))}return R0(),r=Pg(Error(be(421))),Dd(e,t,s,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=P$.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,wr=Xa(i.nextSibling),kr=t,Ut=!0,ri=null,e!==null&&(zr[$r++]=ia,zr[$r++]=aa,zr[$r++]=is,ia=e.id,aa=e.overflow,is=t),t=T0(t,r.children),t.flags|=4096,t)}function BS(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),av(e.return,t,n)}function Ag(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function $T(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Qn(e,t,r.children,n),r=Vt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&BS(e,n,t);else if(e.tag===19)BS(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Nt(Vt,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&tf(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ag(t,!1,i,n,a);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&tf(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ag(t,!0,n,null,a);break;case"together":Ag(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ap(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ma(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),os|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(be(153));if(t.child!==null){for(e=t.child,n=eo(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=eo(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function h$(e,t,n){switch(t.tag){case 3:LT(t),xl();break;case 5:dT(t);break;case 1:pr(t.type)&&Gp(t);break;case 4:w0(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Nt(Zp,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Nt(Vt,Vt.current&1),t.flags|=128,null):n&t.child.childLanes?zT(e,t,n):(Nt(Vt,Vt.current&1),e=ma(e,t,n),e!==null?e.sibling:null);Nt(Vt,Vt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return $T(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Nt(Vt,Vt.current),r)break;return null;case 22:case 23:return t.lanes=0,RT(e,t,n)}return ma(e,t,n)}var BT,fv,FT,UT;BT=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};fv=function(){};FT=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,$o(Ri.current);var a=null;switch(n){case"input":i=Ry(e,i),r=Ry(e,r),a=[];break;case"select":i=Gt({},i,{value:void 0}),r=Gt({},r,{value:void 0}),a=[];break;case"textarea":i=zy(e,i),r=zy(e,r),a=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=qp)}By(n,r);var s;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var l=i[u];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Jc.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in r){var c=r[u];if(l=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(s in l)!l.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in c)c.hasOwnProperty(s)&&l[s]!==c[s]&&(n||(n={}),n[s]=c[s])}else n||(a||(a=[]),a.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Jc.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&Rt("scroll",e),a||l===c||(a=[])):(a=a||[]).push(u,c))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};UT=function(e,t,n,r){n!==r&&(t.flags|=4)};function uc(e,t){if(!Ut)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Bn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function m$(e,t,n){var r=t.pendingProps;switch(h0(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bn(t),null;case 1:return pr(t.type)&&Yp(),Bn(t),null;case 3:return r=t.stateNode,wl(),zt(dr),zt(Vn),j0(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(_d(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ri!==null&&(wv(ri),ri=null))),fv(e,t),Bn(t),null;case 5:S0(t);var i=$o(du.current);if(n=t.type,e!==null&&t.stateNode!=null)FT(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(be(166));return Bn(t),null}if(e=$o(Ri.current),_d(t)){r=t.stateNode,n=t.type;var a=t.memoizedProps;switch(r[Ti]=t,r[cu]=a,e=(t.mode&1)!==0,n){case"dialog":Rt("cancel",r),Rt("close",r);break;case"iframe":case"object":case"embed":Rt("load",r);break;case"video":case"audio":for(i=0;i<Ic.length;i++)Rt(Ic[i],r);break;case"source":Rt("error",r);break;case"img":case"image":case"link":Rt("error",r),Rt("load",r);break;case"details":Rt("toggle",r);break;case"input":Gw(r,a),Rt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!a.multiple},Rt("invalid",r);break;case"textarea":Qw(r,a),Rt("invalid",r)}By(n,a),i=null;for(var s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="children"?typeof l=="string"?r.textContent!==l&&(a.suppressHydrationWarning!==!0&&Md(r.textContent,l,e),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&Md(r.textContent,l,e),i=["children",""+l]):Jc.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&Rt("scroll",r)}switch(n){case"input":Cd(r),Xw(r,a,!0);break;case"textarea":Cd(r),Zw(r);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(r.onclick=qp)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=gE(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Ti]=t,e[cu]=r,BT(e,t,!1,!1),t.stateNode=e;e:{switch(s=Fy(n,r),n){case"dialog":Rt("cancel",e),Rt("close",e),i=r;break;case"iframe":case"object":case"embed":Rt("load",e),i=r;break;case"video":case"audio":for(i=0;i<Ic.length;i++)Rt(Ic[i],e);i=r;break;case"source":Rt("error",e),i=r;break;case"img":case"image":case"link":Rt("error",e),Rt("load",e),i=r;break;case"details":Rt("toggle",e),i=r;break;case"input":Gw(e,r),i=Ry(e,r),Rt("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Gt({},r,{value:void 0}),Rt("invalid",e);break;case"textarea":Qw(e,r),i=zy(e,r),Rt("invalid",e);break;default:i=r}By(n,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?xE(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&yE(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&eu(e,c):typeof c=="number"&&eu(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Jc.hasOwnProperty(a)?c!=null&&a==="onScroll"&&Rt("scroll",e):c!=null&&Jx(e,a,c,s))}switch(n){case"input":Cd(e),Xw(e,r,!1);break;case"textarea":Cd(e),Zw(e);break;case"option":r.value!=null&&e.setAttribute("value",""+io(r.value));break;case"select":e.multiple=!!r.multiple,a=r.value,a!=null?al(e,!!r.multiple,a,!1):r.defaultValue!=null&&al(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=qp)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Bn(t),null;case 6:if(e&&t.stateNode!=null)UT(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(be(166));if(n=$o(du.current),$o(Ri.current),_d(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ti]=t,(a=r.nodeValue!==n)&&(e=kr,e!==null))switch(e.tag){case 3:Md(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Md(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ti]=t,t.stateNode=r}return Bn(t),null;case 13:if(zt(Vt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ut&&wr!==null&&t.mode&1&&!(t.flags&128))oT(),xl(),t.flags|=98560,a=!1;else if(a=_d(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(be(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(be(317));a[Ti]=t}else xl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Bn(t),a=!1}else ri!==null&&(wv(ri),ri=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Vt.current&1?yn===0&&(yn=3):R0())),t.updateQueue!==null&&(t.flags|=4),Bn(t),null);case 4:return wl(),fv(e,t),e===null&&su(t.stateNode.containerInfo),Bn(t),null;case 10:return v0(t.type._context),Bn(t),null;case 17:return pr(t.type)&&Yp(),Bn(t),null;case 19:if(zt(Vt),a=t.memoizedState,a===null)return Bn(t),null;if(r=(t.flags&128)!==0,s=a.rendering,s===null)if(r)uc(a,!1);else{if(yn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=tf(e),s!==null){for(t.flags|=128,uc(a,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)a=n,e=r,a.flags&=14680066,s=a.alternate,s===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=s.childLanes,a.lanes=s.lanes,a.child=s.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=s.memoizedProps,a.memoizedState=s.memoizedState,a.updateQueue=s.updateQueue,a.type=s.type,e=s.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Nt(Vt,Vt.current&1|2),t.child}e=e.sibling}a.tail!==null&&rn()>jl&&(t.flags|=128,r=!0,uc(a,!1),t.lanes=4194304)}else{if(!r)if(e=tf(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),uc(a,!0),a.tail===null&&a.tailMode==="hidden"&&!s.alternate&&!Ut)return Bn(t),null}else 2*rn()-a.renderingStartTime>jl&&n!==1073741824&&(t.flags|=128,r=!0,uc(a,!1),t.lanes=4194304);a.isBackwards?(s.sibling=t.child,t.child=s):(n=a.last,n!==null?n.sibling=s:t.child=s,a.last=s)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=rn(),t.sibling=null,n=Vt.current,Nt(Vt,r?n&1|2:n&1),t):(Bn(t),null);case 22:case 23:return _0(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?xr&1073741824&&(Bn(t),t.subtreeFlags&6&&(t.flags|=8192)):Bn(t),null;case 24:return null;case 25:return null}throw Error(be(156,t.tag))}function g$(e,t){switch(h0(t),t.tag){case 1:return pr(t.type)&&Yp(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return wl(),zt(dr),zt(Vn),j0(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return S0(t),null;case 13:if(zt(Vt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(be(340));xl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return zt(Vt),null;case 4:return wl(),null;case 10:return v0(t.type._context),null;case 22:case 23:return _0(),null;case 24:return null;default:return null}}var Ld=!1,Wn=!1,y$=typeof WeakSet=="function"?WeakSet:Set,Ne=null;function Js(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){en(e,t,r)}else n.current=null}function hv(e,t,n){try{n()}catch(r){en(e,t,r)}}var FS=!1;function v$(e,t){if(Qy=Kp,e=qE(),p0(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var s=0,l=-1,c=-1,u=0,p=0,d=e,f=null;t:for(;;){for(var m;d!==n||i!==0&&d.nodeType!==3||(l=s+i),d!==a||r!==0&&d.nodeType!==3||(c=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(m=d.firstChild)!==null;)f=d,d=m;for(;;){if(d===e)break t;if(f===n&&++u===i&&(l=s),f===a&&++p===r&&(c=s),(m=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Zy={focusedElem:e,selectionRange:n},Kp=!1,Ne=t;Ne!==null;)if(t=Ne,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ne=e;else for(;Ne!==null;){t=Ne;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var v=g.memoizedProps,x=g.memoizedState,y=t.stateNode,b=y.getSnapshotBeforeUpdate(t.elementType===t.type?v:ei(t.type,v),x);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(be(163))}}catch(S){en(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Ne=e;break}Ne=t.return}return g=FS,FS=!1,g}function Bc(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&hv(t,n,a)}i=i.next}while(i!==r)}}function Ah(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function mv(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function WT(e){var t=e.alternate;t!==null&&(e.alternate=null,WT(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ti],delete t[cu],delete t[tv],delete t[e$],delete t[t$])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function KT(e){return e.tag===5||e.tag===3||e.tag===4}function US(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||KT(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function gv(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=qp));else if(r!==4&&(e=e.child,e!==null))for(gv(e,t,n),e=e.sibling;e!==null;)gv(e,t,n),e=e.sibling}function yv(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(yv(e,t,n),e=e.sibling;e!==null;)yv(e,t,n),e=e.sibling}var Nn=null,ni=!1;function Oa(e,t,n){for(n=n.child;n!==null;)HT(e,t,n),n=n.sibling}function HT(e,t,n){if(_i&&typeof _i.onCommitFiberUnmount=="function")try{_i.onCommitFiberUnmount(xh,n)}catch{}switch(n.tag){case 5:Wn||Js(n,t);case 6:var r=Nn,i=ni;Nn=null,Oa(e,t,n),Nn=r,ni=i,Nn!==null&&(ni?(e=Nn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Nn.removeChild(n.stateNode));break;case 18:Nn!==null&&(ni?(e=Nn,n=n.stateNode,e.nodeType===8?bg(e.parentNode,n):e.nodeType===1&&bg(e,n),iu(e)):bg(Nn,n.stateNode));break;case 4:r=Nn,i=ni,Nn=n.stateNode.containerInfo,ni=!0,Oa(e,t,n),Nn=r,ni=i;break;case 0:case 11:case 14:case 15:if(!Wn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,s=a.destroy;a=a.tag,s!==void 0&&(a&2||a&4)&&hv(n,t,s),i=i.next}while(i!==r)}Oa(e,t,n);break;case 1:if(!Wn&&(Js(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){en(n,t,l)}Oa(e,t,n);break;case 21:Oa(e,t,n);break;case 22:n.mode&1?(Wn=(r=Wn)||n.memoizedState!==null,Oa(e,t,n),Wn=r):Oa(e,t,n);break;default:Oa(e,t,n)}}function WS(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new y$),t.forEach(function(r){var i=A$.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Qr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var a=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:Nn=l.stateNode,ni=!1;break e;case 3:Nn=l.stateNode.containerInfo,ni=!0;break e;case 4:Nn=l.stateNode.containerInfo,ni=!0;break e}l=l.return}if(Nn===null)throw Error(be(160));HT(a,s,i),Nn=null,ni=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){en(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)VT(t,e),t=t.sibling}function VT(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Qr(t,e),vi(e),r&4){try{Bc(3,e,e.return),Ah(3,e)}catch(v){en(e,e.return,v)}try{Bc(5,e,e.return)}catch(v){en(e,e.return,v)}}break;case 1:Qr(t,e),vi(e),r&512&&n!==null&&Js(n,n.return);break;case 5:if(Qr(t,e),vi(e),r&512&&n!==null&&Js(n,n.return),e.flags&32){var i=e.stateNode;try{eu(i,"")}catch(v){en(e,e.return,v)}}if(r&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,s=n!==null?n.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&hE(i,a),Fy(l,s);var u=Fy(l,a);for(s=0;s<c.length;s+=2){var p=c[s],d=c[s+1];p==="style"?xE(i,d):p==="dangerouslySetInnerHTML"?yE(i,d):p==="children"?eu(i,d):Jx(i,p,d,u)}switch(l){case"input":Dy(i,a);break;case"textarea":mE(i,a);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var m=a.value;m!=null?al(i,!!a.multiple,m,!1):f!==!!a.multiple&&(a.defaultValue!=null?al(i,!!a.multiple,a.defaultValue,!0):al(i,!!a.multiple,a.multiple?[]:"",!1))}i[cu]=a}catch(v){en(e,e.return,v)}}break;case 6:if(Qr(t,e),vi(e),r&4){if(e.stateNode===null)throw Error(be(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(v){en(e,e.return,v)}}break;case 3:if(Qr(t,e),vi(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{iu(t.containerInfo)}catch(v){en(e,e.return,v)}break;case 4:Qr(t,e),vi(e);break;case 13:Qr(t,e),vi(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(N0=rn())),r&4&&WS(e);break;case 22:if(p=n!==null&&n.memoizedState!==null,e.mode&1?(Wn=(u=Wn)||p,Qr(t,e),Wn=u):Qr(t,e),vi(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!p&&e.mode&1)for(Ne=e,p=e.child;p!==null;){for(d=Ne=p;Ne!==null;){switch(f=Ne,m=f.child,f.tag){case 0:case 11:case 14:case 15:Bc(4,f,f.return);break;case 1:Js(f,f.return);var g=f.stateNode;if(typeof g.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(v){en(r,n,v)}}break;case 5:Js(f,f.return);break;case 22:if(f.memoizedState!==null){HS(d);continue}}m!==null?(m.return=f,Ne=m):HS(d)}p=p.sibling}e:for(p=null,d=e;;){if(d.tag===5){if(p===null){p=d;try{i=d.stateNode,u?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=d.stateNode,c=d.memoizedProps.style,s=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=vE("display",s))}catch(v){en(e,e.return,v)}}}else if(d.tag===6){if(p===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(v){en(e,e.return,v)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;p===d&&(p=null),d=d.return}p===d&&(p=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Qr(t,e),vi(e),r&4&&WS(e);break;case 21:break;default:Qr(t,e),vi(e)}}function vi(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(KT(n)){var r=n;break e}n=n.return}throw Error(be(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(eu(i,""),r.flags&=-33);var a=US(e);yv(e,a,i);break;case 3:case 4:var s=r.stateNode.containerInfo,l=US(e);gv(e,l,s);break;default:throw Error(be(161))}}catch(c){en(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function x$(e,t,n){Ne=e,qT(e)}function qT(e,t,n){for(var r=(e.mode&1)!==0;Ne!==null;){var i=Ne,a=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||Ld;if(!s){var l=i.alternate,c=l!==null&&l.memoizedState!==null||Wn;l=Ld;var u=Wn;if(Ld=s,(Wn=c)&&!u)for(Ne=i;Ne!==null;)s=Ne,c=s.child,s.tag===22&&s.memoizedState!==null?VS(i):c!==null?(c.return=s,Ne=c):VS(i);for(;a!==null;)Ne=a,qT(a),a=a.sibling;Ne=i,Ld=l,Wn=u}KS(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,Ne=a):KS(e)}}function KS(e){for(;Ne!==null;){var t=Ne;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Wn||Ah(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Wn)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:ei(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&ES(t,a,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}ES(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var p=u.memoizedState;if(p!==null){var d=p.dehydrated;d!==null&&iu(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(be(163))}Wn||t.flags&512&&mv(t)}catch(f){en(t,t.return,f)}}if(t===e){Ne=null;break}if(n=t.sibling,n!==null){n.return=t.return,Ne=n;break}Ne=t.return}}function HS(e){for(;Ne!==null;){var t=Ne;if(t===e){Ne=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Ne=n;break}Ne=t.return}}function VS(e){for(;Ne!==null;){var t=Ne;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ah(4,t)}catch(c){en(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(c){en(t,i,c)}}var a=t.return;try{mv(t)}catch(c){en(t,a,c)}break;case 5:var s=t.return;try{mv(t)}catch(c){en(t,s,c)}}}catch(c){en(t,t.return,c)}if(t===e){Ne=null;break}var l=t.sibling;if(l!==null){l.return=t.return,Ne=l;break}Ne=t.return}}var b$=Math.ceil,af=ba.ReactCurrentDispatcher,I0=ba.ReactCurrentOwner,Kr=ba.ReactCurrentBatchConfig,ft=0,kn=null,ln=null,Ln=0,xr=0,el=uo(0),yn=0,mu=null,os=0,Eh=0,O0=0,Fc=null,sr=null,N0=0,jl=1/0,Zi=null,of=!1,vv=null,Za=null,zd=!1,Ha=null,sf=0,Uc=0,xv=null,Ep=-1,Tp=0;function Jn(){return ft&6?rn():Ep!==-1?Ep:Ep=rn()}function Ja(e){return e.mode&1?ft&2&&Ln!==0?Ln&-Ln:r$.transition!==null?(Tp===0&&(Tp=OE()),Tp):(e=wt,e!==0||(e=window.event,e=e===void 0?16:zE(e.type)),e):1}function li(e,t,n,r){if(50<Uc)throw Uc=0,xv=null,Error(be(185));Lu(e,n,r),(!(ft&2)||e!==kn)&&(e===kn&&(!(ft&2)&&(Eh|=n),yn===4&&Ua(e,Ln)),fr(e,r),n===1&&ft===0&&!(t.mode&1)&&(jl=rn()+500,kh&&po()))}function fr(e,t){var n=e.callbackNode;r4(e,t);var r=Wp(e,e===kn?Ln:0);if(r===0)n!==null&&tS(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&tS(n),t===1)e.tag===0?n$(qS.bind(null,e)):rT(qS.bind(null,e)),Z4(function(){!(ft&6)&&po()}),n=null;else{switch(NE(r)){case 1:n=i0;break;case 4:n=TE;break;case 16:n=Up;break;case 536870912:n=IE;break;default:n=Up}n=tI(n,YT.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function YT(e,t){if(Ep=-1,Tp=0,ft&6)throw Error(be(327));var n=e.callbackNode;if(ul()&&e.callbackNode!==n)return null;var r=Wp(e,e===kn?Ln:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=lf(e,r);else{t=r;var i=ft;ft|=2;var a=XT();(kn!==e||Ln!==t)&&(Zi=null,jl=rn()+500,Go(e,t));do try{j$();break}catch(l){GT(e,l)}while(!0);y0(),af.current=a,ft=i,ln!==null?t=0:(kn=null,Ln=0,t=yn)}if(t!==0){if(t===2&&(i=Vy(e),i!==0&&(r=i,t=bv(e,i))),t===1)throw n=mu,Go(e,0),Ua(e,r),fr(e,rn()),n;if(t===6)Ua(e,r);else{if(i=e.current.alternate,!(r&30)&&!w$(i)&&(t=lf(e,r),t===2&&(a=Vy(e),a!==0&&(r=a,t=bv(e,a))),t===1))throw n=mu,Go(e,0),Ua(e,r),fr(e,rn()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(be(345));case 2:To(e,sr,Zi);break;case 3:if(Ua(e,r),(r&130023424)===r&&(t=N0+500-rn(),10<t)){if(Wp(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){Jn(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=ev(To.bind(null,e,sr,Zi),t);break}To(e,sr,Zi);break;case 4:if(Ua(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var s=31-si(r);a=1<<s,s=t[s],s>i&&(i=s),r&=~a}if(r=i,r=rn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*b$(r/1960))-r,10<r){e.timeoutHandle=ev(To.bind(null,e,sr,Zi),r);break}To(e,sr,Zi);break;case 5:To(e,sr,Zi);break;default:throw Error(be(329))}}}return fr(e,rn()),e.callbackNode===n?YT.bind(null,e):null}function bv(e,t){var n=Fc;return e.current.memoizedState.isDehydrated&&(Go(e,t).flags|=256),e=lf(e,t),e!==2&&(t=sr,sr=n,t!==null&&wv(t)),e}function wv(e){sr===null?sr=e:sr.push.apply(sr,e)}function w$(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!ci(a(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ua(e,t){for(t&=~O0,t&=~Eh,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-si(t),r=1<<n;e[n]=-1,t&=~r}}function qS(e){if(ft&6)throw Error(be(327));ul();var t=Wp(e,0);if(!(t&1))return fr(e,rn()),null;var n=lf(e,t);if(e.tag!==0&&n===2){var r=Vy(e);r!==0&&(t=r,n=bv(e,r))}if(n===1)throw n=mu,Go(e,0),Ua(e,t),fr(e,rn()),n;if(n===6)throw Error(be(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,To(e,sr,Zi),fr(e,rn()),null}function M0(e,t){var n=ft;ft|=1;try{return e(t)}finally{ft=n,ft===0&&(jl=rn()+500,kh&&po())}}function ss(e){Ha!==null&&Ha.tag===0&&!(ft&6)&&ul();var t=ft;ft|=1;var n=Kr.transition,r=wt;try{if(Kr.transition=null,wt=1,e)return e()}finally{wt=r,Kr.transition=n,ft=t,!(ft&6)&&po()}}function _0(){xr=el.current,zt(el)}function Go(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Q4(n)),ln!==null)for(n=ln.return;n!==null;){var r=n;switch(h0(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Yp();break;case 3:wl(),zt(dr),zt(Vn),j0();break;case 5:S0(r);break;case 4:wl();break;case 13:zt(Vt);break;case 19:zt(Vt);break;case 10:v0(r.type._context);break;case 22:case 23:_0()}n=n.return}if(kn=e,ln=e=eo(e.current,null),Ln=xr=t,yn=0,mu=null,O0=Eh=os=0,sr=Fc=null,zo!==null){for(t=0;t<zo.length;t++)if(n=zo[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var s=a.next;a.next=i,r.next=s}n.pending=r}zo=null}return e}function GT(e,t){do{var n=ln;try{if(y0(),Cp.current=rf,nf){for(var r=qt.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}nf=!1}if(as=0,Sn=gn=qt=null,$c=!1,pu=0,I0.current=null,n===null||n.return===null){yn=1,mu=t,ln=null;break}e:{var a=e,s=n.return,l=n,c=t;if(t=Ln,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,p=l,d=p.tag;if(!(p.mode&1)&&(d===0||d===11||d===15)){var f=p.alternate;f?(p.updateQueue=f.updateQueue,p.memoizedState=f.memoizedState,p.lanes=f.lanes):(p.updateQueue=null,p.memoizedState=null)}var m=_S(s);if(m!==null){m.flags&=-257,RS(m,s,l,a,t),m.mode&1&&MS(a,u,t),t=m,c=u;var g=t.updateQueue;if(g===null){var v=new Set;v.add(c),t.updateQueue=v}else g.add(c);break e}else{if(!(t&1)){MS(a,u,t),R0();break e}c=Error(be(426))}}else if(Ut&&l.mode&1){var x=_S(s);if(x!==null){!(x.flags&65536)&&(x.flags|=256),RS(x,s,l,a,t),m0(Sl(c,l));break e}}a=c=Sl(c,l),yn!==4&&(yn=2),Fc===null?Fc=[a]:Fc.push(a),a=s;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var y=NT(a,c,t);AS(a,y);break e;case 1:l=c;var b=a.type,w=a.stateNode;if(!(a.flags&128)&&(typeof b.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Za===null||!Za.has(w)))){a.flags|=65536,t&=-t,a.lanes|=t;var S=MT(a,l,t);AS(a,S);break e}}a=a.return}while(a!==null)}ZT(n)}catch(k){t=k,ln===n&&n!==null&&(ln=n=n.return);continue}break}while(!0)}function XT(){var e=af.current;return af.current=rf,e===null?rf:e}function R0(){(yn===0||yn===3||yn===2)&&(yn=4),kn===null||!(os&268435455)&&!(Eh&268435455)||Ua(kn,Ln)}function lf(e,t){var n=ft;ft|=2;var r=XT();(kn!==e||Ln!==t)&&(Zi=null,Go(e,t));do try{S$();break}catch(i){GT(e,i)}while(!0);if(y0(),ft=n,af.current=r,ln!==null)throw Error(be(261));return kn=null,Ln=0,yn}function S$(){for(;ln!==null;)QT(ln)}function j$(){for(;ln!==null&&!Yz();)QT(ln)}function QT(e){var t=eI(e.alternate,e,xr);e.memoizedProps=e.pendingProps,t===null?ZT(e):ln=t,I0.current=null}function ZT(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=g$(n,t),n!==null){n.flags&=32767,ln=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{yn=6,ln=null;return}}else if(n=m$(n,t,xr),n!==null){ln=n;return}if(t=t.sibling,t!==null){ln=t;return}ln=t=e}while(t!==null);yn===0&&(yn=5)}function To(e,t,n){var r=wt,i=Kr.transition;try{Kr.transition=null,wt=1,k$(e,t,n,r)}finally{Kr.transition=i,wt=r}return null}function k$(e,t,n,r){do ul();while(Ha!==null);if(ft&6)throw Error(be(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(be(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(i4(e,a),e===kn&&(ln=kn=null,Ln=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||zd||(zd=!0,tI(Up,function(){return ul(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=Kr.transition,Kr.transition=null;var s=wt;wt=1;var l=ft;ft|=4,I0.current=null,v$(e,n),VT(n,e),K4(Zy),Kp=!!Qy,Zy=Qy=null,e.current=n,x$(n),Gz(),ft=l,wt=s,Kr.transition=a}else e.current=n;if(zd&&(zd=!1,Ha=e,sf=i),a=e.pendingLanes,a===0&&(Za=null),Zz(n.stateNode),fr(e,rn()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(of)throw of=!1,e=vv,vv=null,e;return sf&1&&e.tag!==0&&ul(),a=e.pendingLanes,a&1?e===xv?Uc++:(Uc=0,xv=e):Uc=0,po(),null}function ul(){if(Ha!==null){var e=NE(sf),t=Kr.transition,n=wt;try{if(Kr.transition=null,wt=16>e?16:e,Ha===null)var r=!1;else{if(e=Ha,Ha=null,sf=0,ft&6)throw Error(be(331));var i=ft;for(ft|=4,Ne=e.current;Ne!==null;){var a=Ne,s=a.child;if(Ne.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(Ne=u;Ne!==null;){var p=Ne;switch(p.tag){case 0:case 11:case 15:Bc(8,p,a)}var d=p.child;if(d!==null)d.return=p,Ne=d;else for(;Ne!==null;){p=Ne;var f=p.sibling,m=p.return;if(WT(p),p===u){Ne=null;break}if(f!==null){f.return=m,Ne=f;break}Ne=m}}}var g=a.alternate;if(g!==null){var v=g.child;if(v!==null){g.child=null;do{var x=v.sibling;v.sibling=null,v=x}while(v!==null)}}Ne=a}}if(a.subtreeFlags&2064&&s!==null)s.return=a,Ne=s;else e:for(;Ne!==null;){if(a=Ne,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Bc(9,a,a.return)}var y=a.sibling;if(y!==null){y.return=a.return,Ne=y;break e}Ne=a.return}}var b=e.current;for(Ne=b;Ne!==null;){s=Ne;var w=s.child;if(s.subtreeFlags&2064&&w!==null)w.return=s,Ne=w;else e:for(s=b;Ne!==null;){if(l=Ne,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Ah(9,l)}}catch(k){en(l,l.return,k)}if(l===s){Ne=null;break e}var S=l.sibling;if(S!==null){S.return=l.return,Ne=S;break e}Ne=l.return}}if(ft=i,po(),_i&&typeof _i.onPostCommitFiberRoot=="function")try{_i.onPostCommitFiberRoot(xh,e)}catch{}r=!0}return r}finally{wt=n,Kr.transition=t}}return!1}function YS(e,t,n){t=Sl(n,t),t=NT(e,t,1),e=Qa(e,t,1),t=Jn(),e!==null&&(Lu(e,1,t),fr(e,t))}function en(e,t,n){if(e.tag===3)YS(e,e,n);else for(;t!==null;){if(t.tag===3){YS(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Za===null||!Za.has(r))){e=Sl(n,e),e=MT(t,e,1),t=Qa(t,e,1),e=Jn(),t!==null&&(Lu(t,1,e),fr(t,e));break}}t=t.return}}function C$(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Jn(),e.pingedLanes|=e.suspendedLanes&n,kn===e&&(Ln&n)===n&&(yn===4||yn===3&&(Ln&130023424)===Ln&&500>rn()-N0?Go(e,0):O0|=n),fr(e,t)}function JT(e,t){t===0&&(e.mode&1?(t=Ed,Ed<<=1,!(Ed&130023424)&&(Ed=4194304)):t=1);var n=Jn();e=ha(e,t),e!==null&&(Lu(e,t,n),fr(e,n))}function P$(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),JT(e,n)}function A$(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(be(314))}r!==null&&r.delete(t),JT(e,n)}var eI;eI=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||dr.current)lr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return lr=!1,h$(e,t,n);lr=!!(e.flags&131072)}else lr=!1,Ut&&t.flags&1048576&&iT(t,Qp,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ap(e,t),e=t.pendingProps;var i=vl(t,Vn.current);cl(t,n),i=C0(null,t,r,e,i,n);var a=P0();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,pr(r)?(a=!0,Gp(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,b0(t),i.updater=Ph,t.stateNode=i,i._reactInternals=t,sv(t,r,e,n),t=uv(null,t,r,!0,a,n)):(t.tag=0,Ut&&a&&f0(t),Qn(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ap(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=T$(r),e=ei(r,e),i){case 0:t=cv(null,t,r,e,n);break e;case 1:t=zS(null,t,r,e,n);break e;case 11:t=DS(null,t,r,e,n);break e;case 14:t=LS(null,t,r,ei(r.type,e),n);break e}throw Error(be(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ei(r,i),cv(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ei(r,i),zS(e,t,r,i,n);case 3:e:{if(LT(t),e===null)throw Error(be(387));r=t.pendingProps,a=t.memoizedState,i=a.element,uT(e,t),ef(t,r,null,n);var s=t.memoizedState;if(r=s.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=Sl(Error(be(423)),t),t=$S(e,t,r,n,i);break e}else if(r!==i){i=Sl(Error(be(424)),t),t=$S(e,t,r,n,i);break e}else for(wr=Xa(t.stateNode.containerInfo.firstChild),kr=t,Ut=!0,ri=null,n=lT(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(xl(),r===i){t=ma(e,t,n);break e}Qn(e,t,r,n)}t=t.child}return t;case 5:return dT(t),e===null&&iv(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,s=i.children,Jy(r,i)?s=null:a!==null&&Jy(r,a)&&(t.flags|=32),DT(e,t),Qn(e,t,s,n),t.child;case 6:return e===null&&iv(t),null;case 13:return zT(e,t,n);case 4:return w0(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=bl(t,null,r,n):Qn(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ei(r,i),DS(e,t,r,i,n);case 7:return Qn(e,t,t.pendingProps,n),t.child;case 8:return Qn(e,t,t.pendingProps.children,n),t.child;case 12:return Qn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,s=i.value,Nt(Zp,r._currentValue),r._currentValue=s,a!==null)if(ci(a.value,s)){if(a.children===i.children&&!dr.current){t=ma(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){s=a.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(a.tag===1){c=ca(-1,n&-n),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var p=u.pending;p===null?c.next=c:(c.next=p.next,p.next=c),u.pending=c}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),av(a.return,n,t),l.lanes|=n;break}c=c.next}}else if(a.tag===10)s=a.type===t.type?null:a.child;else if(a.tag===18){if(s=a.return,s===null)throw Error(be(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),av(s,n,t),s=a.sibling}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===t){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}Qn(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,cl(t,n),i=Hr(i),r=r(i),t.flags|=1,Qn(e,t,r,n),t.child;case 14:return r=t.type,i=ei(r,t.pendingProps),i=ei(r.type,i),LS(e,t,r,i,n);case 15:return _T(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ei(r,i),Ap(e,t),t.tag=1,pr(r)?(e=!0,Gp(t)):e=!1,cl(t,n),OT(t,r,i),sv(t,r,i,n),uv(null,t,r,!0,e,n);case 19:return $T(e,t,n);case 22:return RT(e,t,n)}throw Error(be(156,t.tag))};function tI(e,t){return EE(e,t)}function E$(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fr(e,t,n,r){return new E$(e,t,n,r)}function D0(e){return e=e.prototype,!(!e||!e.isReactComponent)}function T$(e){if(typeof e=="function")return D0(e)?1:0;if(e!=null){if(e=e.$$typeof,e===t0)return 11;if(e===n0)return 14}return 2}function eo(e,t){var n=e.alternate;return n===null?(n=Fr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ip(e,t,n,r,i,a){var s=2;if(r=e,typeof e=="function")D0(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Ks:return Xo(n.children,i,a,t);case e0:s=8,i|=8;break;case Oy:return e=Fr(12,n,t,i|2),e.elementType=Oy,e.lanes=a,e;case Ny:return e=Fr(13,n,t,i),e.elementType=Ny,e.lanes=a,e;case My:return e=Fr(19,n,t,i),e.elementType=My,e.lanes=a,e;case dE:return Th(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case cE:s=10;break e;case uE:s=9;break e;case t0:s=11;break e;case n0:s=14;break e;case La:s=16,r=null;break e}throw Error(be(130,e==null?e:typeof e,""))}return t=Fr(s,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Xo(e,t,n,r){return e=Fr(7,e,r,t),e.lanes=n,e}function Th(e,t,n,r){return e=Fr(22,e,r,t),e.elementType=dE,e.lanes=n,e.stateNode={isHidden:!1},e}function Eg(e,t,n){return e=Fr(6,e,null,t),e.lanes=n,e}function Tg(e,t,n){return t=Fr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function I$(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=cg(0),this.expirationTimes=cg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=cg(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function L0(e,t,n,r,i,a,s,l,c){return e=new I$(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Fr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},b0(a),e}function O$(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ws,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function nI(e){if(!e)return ao;e=e._reactInternals;e:{if(xs(e)!==e||e.tag!==1)throw Error(be(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(pr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(be(171))}if(e.tag===1){var n=e.type;if(pr(n))return nT(e,n,t)}return t}function rI(e,t,n,r,i,a,s,l,c){return e=L0(n,r,!0,e,i,a,s,l,c),e.context=nI(null),n=e.current,r=Jn(),i=Ja(n),a=ca(r,i),a.callback=t??null,Qa(n,a,i),e.current.lanes=i,Lu(e,i,r),fr(e,r),e}function Ih(e,t,n,r){var i=t.current,a=Jn(),s=Ja(i);return n=nI(n),t.context===null?t.context=n:t.pendingContext=n,t=ca(a,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Qa(i,t,s),e!==null&&(li(e,i,s,a),kp(e,i,s)),s}function cf(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function GS(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function z0(e,t){GS(e,t),(e=e.alternate)&&GS(e,t)}function N$(){return null}var iI=typeof reportError=="function"?reportError:function(e){console.error(e)};function $0(e){this._internalRoot=e}Oh.prototype.render=$0.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(be(409));Ih(e,t,null,null)};Oh.prototype.unmount=$0.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ss(function(){Ih(null,e,null,null)}),t[fa]=null}};function Oh(e){this._internalRoot=e}Oh.prototype.unstable_scheduleHydration=function(e){if(e){var t=RE();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Fa.length&&t!==0&&t<Fa[n].priority;n++);Fa.splice(n,0,e),n===0&&LE(e)}};function B0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Nh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function XS(){}function M$(e,t,n,r,i){if(i){if(typeof r=="function"){var a=r;r=function(){var u=cf(s);a.call(u)}}var s=rI(t,r,e,0,null,!1,!1,"",XS);return e._reactRootContainer=s,e[fa]=s.current,su(e.nodeType===8?e.parentNode:e),ss(),s}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var u=cf(c);l.call(u)}}var c=L0(e,0,!1,null,null,!1,!1,"",XS);return e._reactRootContainer=c,e[fa]=c.current,su(e.nodeType===8?e.parentNode:e),ss(function(){Ih(t,c,n,r)}),c}function Mh(e,t,n,r,i){var a=n._reactRootContainer;if(a){var s=a;if(typeof i=="function"){var l=i;i=function(){var c=cf(s);l.call(c)}}Ih(t,s,e,i)}else s=M$(n,t,e,i,r);return cf(s)}ME=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Tc(t.pendingLanes);n!==0&&(a0(t,n|1),fr(t,rn()),!(ft&6)&&(jl=rn()+500,po()))}break;case 13:ss(function(){var r=ha(e,1);if(r!==null){var i=Jn();li(r,e,1,i)}}),z0(e,1)}};o0=function(e){if(e.tag===13){var t=ha(e,134217728);if(t!==null){var n=Jn();li(t,e,134217728,n)}z0(e,134217728)}};_E=function(e){if(e.tag===13){var t=Ja(e),n=ha(e,t);if(n!==null){var r=Jn();li(n,e,t,r)}z0(e,t)}};RE=function(){return wt};DE=function(e,t){var n=wt;try{return wt=e,t()}finally{wt=n}};Wy=function(e,t,n){switch(t){case"input":if(Dy(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=jh(r);if(!i)throw Error(be(90));fE(r),Dy(r,i)}}}break;case"textarea":mE(e,n);break;case"select":t=n.value,t!=null&&al(e,!!n.multiple,t,!1)}};SE=M0;jE=ss;var _$={usingClientEntryPoint:!1,Events:[$u,Ys,jh,bE,wE,M0]},dc={findFiberByHostInstance:Lo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},R$={bundleType:dc.bundleType,version:dc.version,rendererPackageName:dc.rendererPackageName,rendererConfig:dc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ba.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=PE(e),e===null?null:e.stateNode},findFiberByHostInstance:dc.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 $d=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$d.isDisabled&&$d.supportsFiber)try{xh=$d.inject(R$),_i=$d}catch{}}Tr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=_$;Tr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!B0(t))throw Error(be(200));return O$(e,t,null,n)};Tr.createRoot=function(e,t){if(!B0(e))throw Error(be(299));var n=!1,r="",i=iI;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=L0(e,1,!1,null,null,n,!1,r,i),e[fa]=t.current,su(e.nodeType===8?e.parentNode:e),new $0(t)};Tr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(be(188)):(e=Object.keys(e).join(","),Error(be(268,e)));return e=PE(t),e=e===null?null:e.stateNode,e};Tr.flushSync=function(e){return ss(e)};Tr.hydrate=function(e,t,n){if(!Nh(t))throw Error(be(200));return Mh(null,e,t,!0,n)};Tr.hydrateRoot=function(e,t,n){if(!B0(e))throw Error(be(405));var r=n!=null&&n.hydratedSources||null,i=!1,a="",s=iI;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=rI(t,null,e,1,n??null,i,!1,a,s),e[fa]=t.current,su(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Oh(t)};Tr.render=function(e,t,n){if(!Nh(t))throw Error(be(200));return Mh(null,e,t,!1,n)};Tr.unmountComponentAtNode=function(e){if(!Nh(e))throw Error(be(40));return e._reactRootContainer?(ss(function(){Mh(null,null,e,!1,function(){e._reactRootContainer=null,e[fa]=null})}),!0):!1};Tr.unstable_batchedUpdates=M0;Tr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Nh(n))throw Error(be(200));if(e==null||e._reactInternals===void 0)throw Error(be(38));return Mh(e,t,n,!1,r)};Tr.version="18.3.1-next-f1338f8080-20240426";function aI(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(aI)}catch(e){console.error(e)}}aI(),aE.exports=Tr;var Fu=aE.exports,QS=Fu;Ty.createRoot=QS.createRoot,Ty.hydrateRoot=QS.hydrateRoot;/**
|
|
41
|
+
* @remix-run/router v1.23.3
|
|
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
|
+
*/function gu(){return gu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gu.apply(null,arguments)}var Va;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Va||(Va={}));const ZS="popstate";function D$(e){e===void 0&&(e={});function t(i,a){let{pathname:s="/",search:l="",hash:c=""}=bs(i.location.hash.substr(1));return!s.startsWith("/")&&!s.startsWith(".")&&(s="/"+s),Sv("",{pathname:s,search:l,hash:c},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(i,a){let s=i.document.querySelector("base"),l="";if(s&&s.getAttribute("href")){let c=i.location.href,u=c.indexOf("#");l=u===-1?c:c.slice(0,u)}return l+"#"+(typeof a=="string"?a:uf(a))}function r(i,a){_h(i.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(a)+")")}return z$(t,n,r,e)}function Yt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function _h(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function L$(){return Math.random().toString(36).substr(2,8)}function JS(e,t){return{usr:e.state,key:e.key,idx:t}}function Sv(e,t,n,r){return n===void 0&&(n=null),gu({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?bs(t):t,{state:n,key:t&&t.key||r||L$()})}function uf(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function bs(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function z$(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,s=i.history,l=Va.Pop,c=null,u=p();u==null&&(u=0,s.replaceState(gu({},s.state,{idx:u}),""));function p(){return(s.state||{idx:null}).idx}function d(){l=Va.Pop;let x=p(),y=x==null?null:x-u;u=x,c&&c({action:l,location:v.location,delta:y})}function f(x,y){l=Va.Push;let b=Sv(v.location,x,y);n&&n(b,x),u=p()+1;let w=JS(b,u),S=v.createHref(b);try{s.pushState(w,"",S)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;i.location.assign(S)}a&&c&&c({action:l,location:v.location,delta:1})}function m(x,y){l=Va.Replace;let b=Sv(v.location,x,y);n&&n(b,x),u=p();let w=JS(b,u),S=v.createHref(b);s.replaceState(w,"",S),a&&c&&c({action:l,location:v.location,delta:0})}function g(x){let y=i.location.origin!=="null"?i.location.origin:i.location.href,b=typeof x=="string"?x:uf(x);return b=b.replace(/ $/,"%20"),Yt(y,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,y)}let v={get action(){return l},get location(){return e(i,s)},listen(x){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(ZS,d),c=x,()=>{i.removeEventListener(ZS,d),c=null}},createHref(x){return t(i,x)},createURL:g,encodeLocation(x){let y=g(x);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:f,replace:m,go(x){return s.go(x)}};return v}var ej;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(ej||(ej={}));function $$(e,t,n){return n===void 0&&(n="/"),B$(e,t,n)}function B$(e,t,n,r){let i=typeof t=="string"?bs(t):t,a=kl(i.pathname||"/",n);if(a==null)return null;let s=oI(e);F$(s);let l=null,c=Z$(a);for(let u=0;l==null&&u<s.length;++u)l=X$(s[u],c);return l}function oI(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(a,s,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:s,route:a};c.relativePath.startsWith("/")&&(Yt(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=to([r,c.relativePath]),p=n.concat(c);a.children&&a.children.length>0&&(Yt(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),oI(a.children,t,p,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:Y$(u,a.index),routesMeta:p})};return e.forEach((a,s)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))i(a,s);else for(let c of sI(a.path))i(a,s,c)}),t}function sI(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let s=sI(r.join("/")),l=[];return l.push(...s.map(c=>c===""?a:[a,c].join("/"))),i&&l.push(...s),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function F$(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:G$(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const U$=/^:[\w-]+$/,W$=3,K$=2,H$=1,V$=10,q$=-2,tj=e=>e==="*";function Y$(e,t){let n=e.split("/"),r=n.length;return n.some(tj)&&(r+=q$),t&&(r+=K$),n.filter(i=>!tj(i)).reduce((i,a)=>i+(U$.test(a)?W$:a===""?H$:V$),r)}function G$(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function X$(e,t,n){let{routesMeta:r}=e,i={},a="/",s=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,p=a==="/"?t:t.slice(a.length)||"/",d=jv({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},p),f=c.route;if(!d)return null;Object.assign(i,d.params),s.push({params:i,pathname:to([a,d.pathname]),pathnameBase:r3(to([a,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(a=to([a,d.pathnameBase]))}return s}function jv(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Q$(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],s=a.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:r.reduce((u,p,d)=>{let{paramName:f,isOptional:m}=p;if(f==="*"){let v=l[d]||"";s=a.slice(0,a.length-v.length).replace(/(.)\/+$/,"$1")}const g=l[d];return m&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:s,pattern:e}}function Q$(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),_h(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 r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Z$(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return _h(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function kl(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const J$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,e3=e=>J$.test(e);function t3(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?bs(e):e,a;if(n)if(e3(n))a=n;else{if(n.includes("//")){let s=n;n=lI(n),_h(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+n))}n.startsWith("/")?a=nj(n.substring(1),"/"):a=nj(n,t)}else a=t;return{pathname:a,search:i3(r),hash:a3(i)}}function nj(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Ig(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function n3(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function F0(e,t){let n=n3(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function U0(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=bs(e):(i=gu({},e),Yt(!i.pathname||!i.pathname.includes("?"),Ig("?","pathname","search",i)),Yt(!i.pathname||!i.pathname.includes("#"),Ig("#","pathname","hash",i)),Yt(!i.search||!i.search.includes("#"),Ig("#","search","hash",i)));let a=e===""||i.pathname==="",s=a?"/":i.pathname,l;if(s==null)l=n;else{let d=t.length-1;if(!r&&s.startsWith("..")){let f=s.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}l=d>=0?t[d]:"/"}let c=t3(i,l),u=s&&s!=="/"&&s.endsWith("/"),p=(a||s===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||p)&&(c.pathname+="/"),c}const lI=e=>e.replace(/\/\/+/g,"/"),to=e=>lI(e.join("/")),r3=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),i3=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,a3=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function o3(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const cI=["post","put","patch","delete"];new Set(cI);const s3=["get",...cI];new Set(s3);/**
|
|
50
|
+
* React Router v6.30.4
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/function yu(){return yu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yu.apply(null,arguments)}const Rh=h.createContext(null),uI=h.createContext(null),wa=h.createContext(null),Dh=h.createContext(null),Sa=h.createContext({outlet:null,matches:[],isDataRoute:!1}),dI=h.createContext(null);function l3(e,t){let{relative:n}=t===void 0?{}:t;Fl()||Yt(!1);let{basename:r,navigator:i}=h.useContext(wa),{hash:a,pathname:s,search:l}=zh(e,{relative:n}),c=s;return r!=="/"&&(c=s==="/"?r:to([r,s])),i.createHref({pathname:c,search:l,hash:a})}function Fl(){return h.useContext(Dh)!=null}function Ul(){return Fl()||Yt(!1),h.useContext(Dh).location}function pI(e){h.useContext(wa).static||h.useLayoutEffect(e)}function Lh(){let{isDataRoute:e}=h.useContext(Sa);return e?S3():c3()}function c3(){Fl()||Yt(!1);let e=h.useContext(Rh),{basename:t,future:n,navigator:r}=h.useContext(wa),{matches:i}=h.useContext(Sa),{pathname:a}=Ul(),s=JSON.stringify(F0(i,n.v7_relativeSplatPath)),l=h.useRef(!1);return pI(()=>{l.current=!0}),h.useCallback(function(u,p){if(p===void 0&&(p={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let d=U0(u,JSON.parse(s),a,p.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:to([t,d.pathname])),(p.replace?r.replace:r.push)(d,p.state,p)},[t,r,s,a,e])}function u3(){let{matches:e}=h.useContext(Sa),t=e[e.length-1];return t?t.params:{}}function zh(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=h.useContext(wa),{matches:i}=h.useContext(Sa),{pathname:a}=Ul(),s=JSON.stringify(F0(i,r.v7_relativeSplatPath));return h.useMemo(()=>U0(e,JSON.parse(s),a,n==="path"),[e,s,a,n])}function d3(e,t){return p3(e,t)}function p3(e,t,n,r){Fl()||Yt(!1);let{navigator:i}=h.useContext(wa),{matches:a}=h.useContext(Sa),s=a[a.length-1],l=s?s.params:{};s&&s.pathname;let c=s?s.pathnameBase:"/";s&&s.route;let u=Ul(),p;if(t){var d;let x=typeof t=="string"?bs(t):t;c==="/"||(d=x.pathname)!=null&&d.startsWith(c)||Yt(!1),p=x}else p=u;let f=p.pathname||"/",m=f;if(c!=="/"){let x=c.replace(/^\//,"").split("/");m="/"+f.replace(/^\//,"").split("/").slice(x.length).join("/")}let g=$$(e,{pathname:m}),v=y3(g&&g.map(x=>Object.assign({},x,{params:Object.assign({},l,x.params),pathname:to([c,i.encodeLocation?i.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?c:to([c,i.encodeLocation?i.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),a,n,r);return t&&v?h.createElement(Dh.Provider,{value:{location:yu({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:Va.Pop}},v):v}function f3(){let e=w3(),t=o3(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),n?h.createElement("pre",{style:i},n):null,null)}const h3=h.createElement(f3,null);class m3 extends h.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?h.createElement(Sa.Provider,{value:this.props.routeContext},h.createElement(dI.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function g3(e){let{routeContext:t,match:n,children:r}=e,i=h.useContext(Rh);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),h.createElement(Sa.Provider,{value:t},r)}function y3(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,l=(i=n)==null?void 0:i.errors;if(l!=null){let p=s.findIndex(d=>d.route.id&&(l==null?void 0:l[d.route.id])!==void 0);p>=0||Yt(!1),s=s.slice(0,Math.min(s.length,p+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let p=0;p<s.length;p++){let d=s[p];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=p),d.route.id){let{loaderData:f,errors:m}=n,g=d.route.loader&&f[d.route.id]===void 0&&(!m||m[d.route.id]===void 0);if(d.route.lazy||g){c=!0,u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((p,d,f)=>{let m,g=!1,v=null,x=null;n&&(m=l&&d.route.id?l[d.route.id]:void 0,v=d.route.errorElement||h3,c&&(u<0&&f===0?(j3("route-fallback"),g=!0,x=null):u===f&&(g=!0,x=d.route.hydrateFallbackElement||null)));let y=t.concat(s.slice(0,f+1)),b=()=>{let w;return m?w=v:g?w=x:d.route.Component?w=h.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=p,h.createElement(g3,{match:d,routeContext:{outlet:p,matches:y,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?h.createElement(m3,{location:n.location,revalidation:n.revalidation,component:v,error:m,children:b(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):b()},null)}var fI=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(fI||{}),hI=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(hI||{});function v3(e){let t=h.useContext(Rh);return t||Yt(!1),t}function x3(e){let t=h.useContext(uI);return t||Yt(!1),t}function b3(e){let t=h.useContext(Sa);return t||Yt(!1),t}function mI(e){let t=b3(),n=t.matches[t.matches.length-1];return n.route.id||Yt(!1),n.route.id}function w3(){var e;let t=h.useContext(dI),n=x3(),r=mI();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function S3(){let{router:e}=v3(fI.UseNavigateStable),t=mI(hI.UseNavigateStable),n=h.useRef(!1);return pI(()=>{n.current=!0}),h.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,yu({fromRouteId:t},a)))},[e,t])}const rj={};function j3(e,t,n){rj[e]||(rj[e]=!0)}function k3(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function pc(e){let{to:t,replace:n,state:r,relative:i}=e;Fl()||Yt(!1);let{future:a,static:s}=h.useContext(wa),{matches:l}=h.useContext(Sa),{pathname:c}=Ul(),u=Lh(),p=U0(t,F0(l,a.v7_relativeSplatPath),c,i==="path"),d=JSON.stringify(p);return h.useEffect(()=>u(JSON.parse(d),{replace:n,state:r,relative:i}),[u,d,i,n,r]),null}function Xn(e){Yt(!1)}function C3(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Va.Pop,navigator:a,static:s=!1,future:l}=e;Fl()&&Yt(!1);let c=t.replace(/^\/*/,"/"),u=h.useMemo(()=>({basename:c,navigator:a,static:s,future:yu({v7_relativeSplatPath:!1},l)}),[c,l,a,s]);typeof r=="string"&&(r=bs(r));let{pathname:p="/",search:d="",hash:f="",state:m=null,key:g="default"}=r,v=h.useMemo(()=>{let x=kl(p,c);return x==null?null:{location:{pathname:x,search:d,hash:f,state:m,key:g},navigationType:i}},[c,p,d,f,m,g,i]);return v==null?null:h.createElement(wa.Provider,{value:u},h.createElement(Dh.Provider,{children:n,value:v}))}function P3(e){let{children:t,location:n}=e;return d3(kv(t),n)}new Promise(()=>{});function kv(e,t){t===void 0&&(t=[]);let n=[];return h.Children.forEach(e,(r,i)=>{if(!h.isValidElement(r))return;let a=[...t,i];if(r.type===h.Fragment){n.push.apply(n,kv(r.props.children,a));return}r.type!==Xn&&Yt(!1),!r.props.index||!r.props.children||Yt(!1);let s={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=kv(r.props.children,a)),n.push(s)}),n}/**
|
|
59
|
+
* React Router DOM v6.30.4
|
|
60
|
+
*
|
|
61
|
+
* Copyright (c) Remix Software Inc.
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the MIT license found in the
|
|
64
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
65
|
+
*
|
|
66
|
+
* @license MIT
|
|
67
|
+
*/function df(){return df=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},df.apply(null,arguments)}function gI(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function A3(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function E3(e,t){return e.button===0&&(!t||t==="_self")&&!A3(e)}const T3=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],I3=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],O3="6";try{window.__reactRouterVersion=O3}catch{}const N3=h.createContext({isTransitioning:!1}),M3="startTransition",ij=rE[M3];function _3(e){let{basename:t,children:n,future:r,window:i}=e,a=h.useRef();a.current==null&&(a.current=D$({window:i,v5Compat:!0}));let s=a.current,[l,c]=h.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},p=h.useCallback(d=>{u&&ij?ij(()=>c(d)):c(d)},[c,u]);return h.useLayoutEffect(()=>s.listen(p),[s,p]),h.useEffect(()=>k3(r),[r]),h.createElement(C3,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:s,future:r})}const R3=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",D3=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,L3=h.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:a,replace:s,state:l,target:c,to:u,preventScrollReset:p,viewTransition:d}=t,f=gI(t,T3),{basename:m}=h.useContext(wa),g,v=!1;if(typeof u=="string"&&D3.test(u)&&(g=u,R3))try{let w=new URL(window.location.href),S=u.startsWith("//")?new URL(w.protocol+u):new URL(u),k=kl(S.pathname,m);S.origin===w.origin&&k!=null?u=k+S.search+S.hash:v=!0}catch{}let x=l3(u,{relative:i}),y=$3(u,{replace:s,state:l,target:c,preventScrollReset:p,relative:i,viewTransition:d});function b(w){r&&r(w),w.defaultPrevented||y(w)}return h.createElement("a",df({},f,{href:g||x,onClick:v||a?r:b,ref:n,target:c}))}),Zr=h.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:a="",end:s=!1,style:l,to:c,viewTransition:u,children:p}=t,d=gI(t,I3),f=zh(c,{relative:d.relative}),m=Ul(),g=h.useContext(uI),{navigator:v,basename:x}=h.useContext(wa),y=g!=null&&B3(f)&&u===!0,b=v.encodeLocation?v.encodeLocation(f).pathname:f.pathname,w=m.pathname,S=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;i||(w=w.toLowerCase(),S=S?S.toLowerCase():null,b=b.toLowerCase()),S&&x&&(S=kl(S,x)||S);const k=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let j=w===b||!s&&w.startsWith(b)&&w.charAt(k)==="/",A=S!=null&&(S===b||!s&&S.startsWith(b)&&S.charAt(b.length)==="/"),E={isActive:j,isPending:A,isTransitioning:y},D=j?r:void 0,O;typeof a=="function"?O=a(E):O=[a,j?"active":null,A?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let _=typeof l=="function"?l(E):l;return h.createElement(L3,df({},d,{"aria-current":D,className:O,ref:n,style:_,to:c,viewTransition:u}),typeof p=="function"?p(E):p)});var Cv;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Cv||(Cv={}));var aj;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(aj||(aj={}));function z3(e){let t=h.useContext(Rh);return t||Yt(!1),t}function $3(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:s,viewTransition:l}=t===void 0?{}:t,c=Lh(),u=Ul(),p=zh(e,{relative:s});return h.useCallback(d=>{if(E3(d,n)){d.preventDefault();let f=r!==void 0?r:uf(u)===uf(p);c(e,{replace:f,state:i,preventScrollReset:a,relative:s,viewTransition:l})}},[u,c,p,r,i,n,e,a,s,l])}function B3(e,t){t===void 0&&(t={});let n=h.useContext(N3);n==null&&Yt(!1);let{basename:r}=z3(Cv.useViewTransitionState),i=zh(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=kl(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=kl(n.nextLocation.pathname,r)||n.nextLocation.pathname;return jv(i.pathname,s)!=null||jv(i.pathname,a)!=null}function F3(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const U3=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,W3=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,K3={};function oj(e,t){return(K3.jsx?W3:U3).test(e)}const H3=/[ \t\n\f\r]/g;function V3(e){return typeof e=="object"?e.type==="text"?sj(e.value):!1:sj(e)}function sj(e){return e.replace(H3,"")===""}class Uu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Uu.prototype.normal={};Uu.prototype.property={};Uu.prototype.space=void 0;function yI(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Uu(n,r,t)}function Pv(e){return e.toLowerCase()}class gr{constructor(t,n){this.attribute=n,this.property=t}}gr.prototype.attribute="";gr.prototype.booleanish=!1;gr.prototype.boolean=!1;gr.prototype.commaOrSpaceSeparated=!1;gr.prototype.commaSeparated=!1;gr.prototype.defined=!1;gr.prototype.mustUseProperty=!1;gr.prototype.number=!1;gr.prototype.overloadedBoolean=!1;gr.prototype.property="";gr.prototype.spaceSeparated=!1;gr.prototype.space=void 0;let q3=0;const He=ws(),sn=ws(),Av=ws(),we=ws(),Pt=ws(),Qo=ws(),vr=ws();function ws(){return 2**++q3}const Ev=Object.freeze(Object.defineProperty({__proto__:null,boolean:He,booleanish:sn,commaOrSpaceSeparated:vr,commaSeparated:Qo,number:we,overloadedBoolean:Av,spaceSeparated:Pt},Symbol.toStringTag,{value:"Module"})),Og=Object.keys(Ev);class W0 extends gr{constructor(t,n,r,i){let a=-1;if(super(t,n),lj(this,"space",i),typeof r=="number")for(;++a<Og.length;){const s=Og[a];lj(this,Og[a],(r&Ev[s])===Ev[s])}}}W0.prototype.defined=!0;function lj(e,t,n){n&&(e[t]=n)}function Wl(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new W0(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Pv(r)]=r,n[Pv(a.attribute)]=r}return new Uu(t,n,e.space)}const vI=Wl({properties:{ariaActiveDescendant:null,ariaAtomic:sn,ariaAutoComplete:null,ariaBusy:sn,ariaChecked:sn,ariaColCount:we,ariaColIndex:we,ariaColSpan:we,ariaControls:Pt,ariaCurrent:null,ariaDescribedBy:Pt,ariaDetails:null,ariaDisabled:sn,ariaDropEffect:Pt,ariaErrorMessage:null,ariaExpanded:sn,ariaFlowTo:Pt,ariaGrabbed:sn,ariaHasPopup:null,ariaHidden:sn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Pt,ariaLevel:we,ariaLive:null,ariaModal:sn,ariaMultiLine:sn,ariaMultiSelectable:sn,ariaOrientation:null,ariaOwns:Pt,ariaPlaceholder:null,ariaPosInSet:we,ariaPressed:sn,ariaReadOnly:sn,ariaRelevant:null,ariaRequired:sn,ariaRoleDescription:Pt,ariaRowCount:we,ariaRowIndex:we,ariaRowSpan:we,ariaSelected:sn,ariaSetSize:we,ariaSort:null,ariaValueMax:we,ariaValueMin:we,ariaValueNow:we,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function xI(e,t){return t in e?e[t]:t}function bI(e,t){return xI(e,t.toLowerCase())}const Y3=Wl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Qo,acceptCharset:Pt,accessKey:Pt,action:null,allow:null,allowFullScreen:He,allowPaymentRequest:He,allowUserMedia:He,alpha:He,alt:null,as:null,async:He,autoCapitalize:null,autoComplete:Pt,autoFocus:He,autoPlay:He,blocking:Pt,capture:null,charSet:null,checked:He,cite:null,className:Pt,closedBy:null,colorSpace:null,cols:we,colSpan:we,command:null,commandFor:null,content:null,contentEditable:sn,controls:He,controlsList:Pt,coords:we|Qo,crossOrigin:null,data:null,dateTime:null,decoding:null,default:He,defer:He,dir:null,dirName:null,disabled:He,download:Av,draggable:sn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:He,formTarget:null,headers:Pt,height:we,hidden:Av,high:we,href:null,hrefLang:null,htmlFor:Pt,httpEquiv:Pt,id:null,imageSizes:null,imageSrcSet:null,inert:He,inputMode:null,integrity:null,is:null,isMap:He,itemId:null,itemProp:Pt,itemRef:Pt,itemScope:He,itemType:Pt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:He,low:we,manifest:null,max:null,maxLength:we,media:null,method:null,min:null,minLength:we,multiple:He,muted:He,name:null,nonce:null,noModule:He,noValidate:He,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:He,optimum:we,pattern:null,ping:Pt,placeholder:null,playsInline:He,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:He,referrerPolicy:null,rel:Pt,required:He,reversed:He,rows:we,rowSpan:we,sandbox:Pt,scope:null,scoped:He,seamless:He,selected:He,shadowRootClonable:He,shadowRootCustomElementRegistry:He,shadowRootDelegatesFocus:He,shadowRootMode:null,shadowRootSerializable:He,shape:null,size:we,sizes:null,slot:null,span:we,spellCheck:sn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:we,step:null,style:null,tabIndex:we,target:null,title:null,translate:null,type:null,typeMustMatch:He,useMap:null,value:sn,width:we,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Pt,axis:null,background:null,bgColor:null,border:we,borderColor:null,bottomMargin:we,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:He,declare:He,event:null,face:null,frame:null,frameBorder:null,hSpace:we,leftMargin:we,link:null,longDesc:null,lowSrc:null,marginHeight:we,marginWidth:we,noResize:He,noHref:He,noShade:He,noWrap:He,object:null,profile:null,prompt:null,rev:null,rightMargin:we,rules:null,scheme:null,scrolling:sn,standby:null,summary:null,text:null,topMargin:we,valueType:null,version:null,vAlign:null,vLink:null,vSpace:we,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:He,disablePictureInPicture:He,disableRemotePlayback:He,exportParts:Qo,part:Pt,prefix:null,property:null,results:we,security:null,unselectable:null},space:"html",transform:bI}),G3=Wl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:vr,accentHeight:we,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:we,amplitude:we,arabicForm:null,ascent:we,attributeName:null,attributeType:null,azimuth:we,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:we,by:null,calcMode:null,capHeight:we,className:Pt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:we,diffuseConstant:we,direction:null,display:null,dur:null,divisor:we,dominantBaseline:null,download:He,dx:null,dy:null,edgeMode:null,editable:null,elevation:we,enableBackground:null,end:null,event:null,exponent:we,externalResourcesRequired:null,fill:null,fillOpacity:we,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Qo,g2:Qo,glyphName:Qo,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:we,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:we,horizOriginX:we,horizOriginY:we,id:null,ideographic:we,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:we,k:we,k1:we,k2:we,k3:we,k4:we,kernelMatrix:vr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:we,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:we,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:we,overlineThickness:we,paintOrder:null,panose1:null,path:null,pathLength:we,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Pt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:we,pointsAtY:we,pointsAtZ:we,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:vr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:vr,rev:vr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:vr,requiredFeatures:vr,requiredFonts:vr,requiredFormats:vr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:we,specularExponent:we,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:we,strikethroughThickness:we,string:null,stroke:null,strokeDashArray:vr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:we,strokeOpacity:we,strokeWidth:null,style:null,surfaceScale:we,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:vr,tabIndex:we,tableValues:null,target:null,targetX:we,targetY:we,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:vr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:we,underlineThickness:we,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:we,values:null,vAlphabetic:we,vMathematical:we,vectorEffect:null,vHanging:we,vIdeographic:we,version:null,vertAdvY:we,vertOriginX:we,vertOriginY:we,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:we,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:xI}),wI=Wl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),SI=Wl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:bI}),jI=Wl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),X3={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Q3=/[A-Z]/g,cj=/-[a-z]/g,Z3=/^data[-\w.:]+$/i;function J3(e,t){const n=Pv(t);let r=t,i=gr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Z3.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(cj,t6);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!cj.test(a)){let s=a.replace(Q3,e6);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=W0}return new i(r,t)}function e6(e){return"-"+e.toLowerCase()}function t6(e){return e.charAt(1).toUpperCase()}const n6=yI([vI,Y3,wI,SI,jI],"html"),K0=yI([vI,G3,wI,SI,jI],"svg");function r6(e){return e.join(" ").trim()}var H0={},uj=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i6=/\n/g,a6=/^\s*/,o6=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s6=/^:\s*/,l6=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c6=/^[;\s]*/,u6=/^\s+|\s+$/g,d6=`
|
|
68
|
+
`,dj="/",pj="*",Ro="",p6="comment",f6="declaration";function h6(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(g){var v=g.match(i6);v&&(n+=v.length);var x=g.lastIndexOf(d6);r=~x?g.length-x:r+g.length}function a(){var g={line:n,column:r};return function(v){return v.position=new s(g),u(),v}}function s(g){this.start=g,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function l(g){var v=new Error(t.source+":"+n+":"+r+": "+g);if(v.reason=g,v.filename=t.source,v.line=n,v.column=r,v.source=e,!t.silent)throw v}function c(g){var v=g.exec(e);if(v){var x=v[0];return i(x),e=e.slice(x.length),v}}function u(){c(a6)}function p(g){var v;for(g=g||[];v=d();)v!==!1&&g.push(v);return g}function d(){var g=a();if(!(dj!=e.charAt(0)||pj!=e.charAt(1))){for(var v=2;Ro!=e.charAt(v)&&(pj!=e.charAt(v)||dj!=e.charAt(v+1));)++v;if(v+=2,Ro===e.charAt(v-1))return l("End of comment missing");var x=e.slice(2,v-2);return r+=2,i(x),e=e.slice(v),r+=2,g({type:p6,comment:x})}}function f(){var g=a(),v=c(o6);if(v){if(d(),!c(s6))return l("property missing ':'");var x=c(l6),y=g({type:f6,property:fj(v[0].replace(uj,Ro)),value:x?fj(x[0].replace(uj,Ro)):Ro});return c(c6),y}}function m(){var g=[];p(g);for(var v;v=f();)v!==!1&&(g.push(v),p(g));return g}return u(),m()}function fj(e){return e?e.replace(u6,Ro):Ro}var m6=h6,g6=gl&&gl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(H0,"__esModule",{value:!0});H0.default=v6;const y6=g6(m6);function v6(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,y6.default)(e),i=typeof t=="function";return r.forEach(a=>{if(a.type!=="declaration")return;const{property:s,value:l}=a;i?t(s,l,a):l&&(n=n||{},n[s]=l)}),n}var $h={};Object.defineProperty($h,"__esModule",{value:!0});$h.camelCase=void 0;var x6=/^--[a-zA-Z0-9_-]+$/,b6=/-([a-z])/g,w6=/^[^-]+$/,S6=/^-(webkit|moz|ms|o|khtml)-/,j6=/^-(ms)-/,k6=function(e){return!e||w6.test(e)||x6.test(e)},C6=function(e,t){return t.toUpperCase()},hj=function(e,t){return"".concat(t,"-")},P6=function(e,t){return t===void 0&&(t={}),k6(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(j6,hj):e=e.replace(S6,hj),e.replace(b6,C6))};$h.camelCase=P6;var A6=gl&&gl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},E6=A6(H0),T6=$h;function Tv(e,t){var n={};return!e||typeof e!="string"||(0,E6.default)(e,function(r,i){r&&i&&(n[(0,T6.camelCase)(r,t)]=i)}),n}Tv.default=Tv;var I6=Tv;const O6=Ll(I6),kI=CI("end"),V0=CI("start");function CI(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function N6(e){const t=V0(e),n=kI(e);if(t&&n)return{start:t,end:n}}function Wc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?mj(e.position):"start"in e||"end"in e?mj(e):"line"in e||"column"in e?Iv(e):""}function Iv(e){return gj(e&&e.line)+":"+gj(e&&e.column)}function mj(e){return Iv(e&&e.start)+"-"+Iv(e&&e.end)}function gj(e){return e&&typeof e=="number"?e:1}class qn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},s=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(s=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?a.ruleId=r:(a.source=r.slice(0,c),a.ruleId=r.slice(c+1))}if(!a.place&&a.ancestors&&a.ancestors){const c=a.ancestors[a.ancestors.length-1];c&&(a.place=c.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=Wc(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=s&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}qn.prototype.file="";qn.prototype.name="";qn.prototype.reason="";qn.prototype.message="";qn.prototype.stack="";qn.prototype.column=void 0;qn.prototype.line=void 0;qn.prototype.ancestors=void 0;qn.prototype.cause=void 0;qn.prototype.fatal=void 0;qn.prototype.place=void 0;qn.prototype.ruleId=void 0;qn.prototype.source=void 0;const q0={}.hasOwnProperty,M6=new Map,_6=/[A-Z]/g,R6=new Set(["table","tbody","thead","tfoot","tr"]),D6=new Set(["td","th"]),PI="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function L6(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=H6(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=K6(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?K0:n6,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=AI(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function AI(e,t,n){if(t.type==="element")return z6(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return $6(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return F6(e,t,n);if(t.type==="mdxjsEsm")return B6(e,t);if(t.type==="root")return U6(e,t,n);if(t.type==="text")return W6(e,t)}function z6(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=K0,e.schema=i),e.ancestors.push(t);const a=TI(e,t.tagName,!1),s=V6(e,t);let l=G0(e,t);return R6.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!V3(c):!0})),EI(e,s,a,t),Y0(s,l),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function $6(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}vu(e,t.position)}function B6(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);vu(e,t.position)}function F6(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=K0,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:TI(e,t.name,!0),s=q6(e,t),l=G0(e,t);return EI(e,s,a,t),Y0(s,l),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function U6(e,t,n){const r={};return Y0(r,G0(e,t)),e.create(t,e.Fragment,r,n)}function W6(e,t){return t.value}function EI(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Y0(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function K6(e,t,n){return r;function r(i,a,s,l){const u=Array.isArray(s.children)?n:t;return l?u(a,s,l):u(a,s)}}function H6(e,t){return n;function n(r,i,a,s){const l=Array.isArray(a.children),c=V0(r);return t(i,a,s,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function V6(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&q0.call(t.properties,i)){const a=Y6(e,i,t.properties[i]);if(a){const[s,l]=a;e.tableCellAlignToStyle&&s==="align"&&typeof l=="string"&&D6.has(t.tagName)?r=l:n[s]=l}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function q6(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const s=a.expression;s.type;const l=s.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else vu(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else vu(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function G0(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:M6;for(;++r<t.children.length;){const a=t.children[r];let s;if(e.passKeys){const c=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(c){const u=i.get(c)||0;s=c+"-"+u,i.set(c,u+1)}}const l=AI(e,a,s);l!==void 0&&n.push(l)}return n}function Y6(e,t,n){const r=J3(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?F3(n):r6(n)),r.property==="style"){let i=typeof n=="object"?n:G6(e,String(n));return e.stylePropertyNameCase==="css"&&(i=X6(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?X3[r.property]||r.property:r.attribute,n]}}function G6(e,t){try{return O6(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new qn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=PI+"#cannot-parse-style-attribute",i}}function TI(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,s;for(;++a<i.length;){const l=oj(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};s=s?{type:"MemberExpression",object:s,property:l,computed:!!(a&&l.type==="Literal"),optional:!1}:l}r=s}else r=oj(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return q0.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);vu(e)}function vu(e,t){const n=new qn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=PI+"#cannot-handle-mdx-estrees-without-createevaluater",n}function X6(e){const t={};let n;for(n in e)q0.call(e,n)&&(t[Q6(n)]=e[n]);return t}function Q6(e){let t=e.replace(_6,Z6);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Z6(e){return"-"+e.toLowerCase()}const Ng={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},J6={};function e8(e,t){const n=J6,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return II(e,r,i)}function II(e,t,n){if(t8(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return yj(e.children,t,n)}return Array.isArray(e)?yj(e,t,n):""}function yj(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=II(e[i],t,n);return r.join("")}function t8(e){return!!(e&&typeof e=="object")}const vj=document.createElement("i");function X0(e){const t="&"+e+";";vj.innerHTML=t;const n=vj.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function zi(e,t,n,r){const i=e.length;let a=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);a<r.length;)s=r.slice(a,a+1e4),s.unshift(t,0),e.splice(...s),a+=1e4,t+=1e4}function Br(e,t){return e.length>0?(zi(e,e.length,0,t),e):t}const xj={}.hasOwnProperty;function n8(e){const t={};let n=-1;for(;++n<e.length;)r8(t,e[n]);return t}function r8(e,t){let n;for(n in t){const i=(xj.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let s;if(a)for(s in a){xj.call(i,s)||(i[s]=[]);const l=a[s];i8(i[s],Array.isArray(l)?l:l?[l]:[])}}}function i8(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);zi(e,0,0,r)}function OI(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function dl(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ii=fo(/[A-Za-z]/),Sr=fo(/[\dA-Za-z]/),a8=fo(/[#-'*+\--9=?A-Z^-~]/);function Ov(e){return e!==null&&(e<32||e===127)}const Nv=fo(/\d/),o8=fo(/[\dA-Fa-f]/),s8=fo(/[!-/:-@[-`{-~]/);function Ue(e){return e!==null&&e<-2}function hr(e){return e!==null&&(e<0||e===32)}function vt(e){return e===-2||e===-1||e===32}const l8=fo(new RegExp("\\p{P}|\\p{S}","u")),c8=fo(/\s/);function fo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Kl(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let s="";if(a===37&&Sr(e.charCodeAt(n+1))&&Sr(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(s=String.fromCharCode(a));else if(a>55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(s=String.fromCharCode(a,l),i=1):s="�"}else s=String.fromCharCode(a);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Mt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(c){return vt(c)?(e.enter(n),l(c)):t(c)}function l(c){return vt(c)&&a++<i?(e.consume(c),l):(e.exit(n),t(c))}}const u8={tokenize:d8};function d8(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Mt(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),a(l)}function a(l){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,s(l)}function s(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return Ue(l)?(e.consume(l),e.exit("chunkText"),a):(e.consume(l),s)}}const p8={tokenize:f8},bj={tokenize:h8};function f8(e){const t=this,n=[];let r=0,i,a,s;return l;function l(w){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,c,u)(w)}return u(w)}function c(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&b();const S=t.events.length;let k=S,j;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){j=t.events[k][1].end;break}y(r);let A=S;for(;A<t.events.length;)t.events[A][1].end={...j},A++;return zi(t.events,k+1,0,t.events.slice(S)),t.events.length=A,u(w)}return l(w)}function u(w){if(r===n.length){if(!i)return f(w);if(i.currentConstruct&&i.currentConstruct.concrete)return g(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(bj,p,d)(w)}function p(w){return i&&b(),y(r),f(w)}function d(w){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,g(w)}function f(w){return t.containerState={},e.attempt(bj,m,g)(w)}function m(w){return r++,n.push([t.currentConstruct,t.containerState]),f(w)}function g(w){if(w===null){i&&b(),y(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),v(w)}function v(w){if(w===null){x(e.exit("chunkFlow"),!0),y(0),e.consume(w);return}return Ue(w)?(e.consume(w),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(w),v)}function x(w,S){const k=t.sliceStream(w);if(S&&k.push(null),w.previous=a,a&&(a.next=w),a=w,i.defineSkip(w.start),i.write(k),t.parser.lazy[w.start.line]){let j=i.events.length;for(;j--;)if(i.events[j][1].start.offset<s&&(!i.events[j][1].end||i.events[j][1].end.offset>s))return;const A=t.events.length;let E=A,D,O;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){if(D){O=t.events[E][1].end;break}D=!0}for(y(r),j=A;j<t.events.length;)t.events[j][1].end={...O},j++;zi(t.events,E+1,0,t.events.slice(A)),t.events.length=j}}function y(w){let S=n.length;for(;S-- >w;){const k=n[S];t.containerState=k[1],k[0].exit.call(t,e)}n.length=w}function b(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function h8(e,t,n){return Mt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function wj(e){if(e===null||hr(e)||c8(e))return 1;if(l8(e))return 2}function Q0(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Mv={name:"attention",resolveAll:m8,tokenize:g8};function m8(e,t){let n=-1,r,i,a,s,l,c,u,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},f={...e[n][1].start};Sj(d,-c),Sj(f,c),s={type:c>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},a={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...s.start},end:{...l.end}},e[r][1].end={...s.start},e[n][1].start={...l.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Br(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Br(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",a,t]]),u=Br(u,Q0(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Br(u,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,u=Br(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,zi(e,r-1,n-r+3,u),n=r+u.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function g8(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=wj(r);let a;return s;function s(c){return a=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===a)return e.consume(c),l;const u=e.exit("attentionSequence"),p=wj(c),d=!p||p===2&&i||n.includes(c),f=!i||i===2&&p||n.includes(r);return u._open=!!(a===42?d:d&&(i||!f)),u._close=!!(a===42?f:f&&(p||!d)),t(c)}}function Sj(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const y8={name:"autolink",tokenize:v8};function v8(e,t,n){let r=0;return i;function i(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(m){return Ii(m)?(e.consume(m),s):m===64?n(m):u(m)}function s(m){return m===43||m===45||m===46||Sr(m)?(r=1,l(m)):u(m)}function l(m){return m===58?(e.consume(m),r=0,c):(m===43||m===45||m===46||Sr(m))&&r++<32?(e.consume(m),l):(r=0,u(m))}function c(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||Ov(m)?n(m):(e.consume(m),c)}function u(m){return m===64?(e.consume(m),p):a8(m)?(e.consume(m),u):n(m)}function p(m){return Sr(m)?d(m):n(m)}function d(m){return m===46?(e.consume(m),r=0,p):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):f(m)}function f(m){if((m===45||Sr(m))&&r++<63){const g=m===45?f:d;return e.consume(m),g}return n(m)}}const Bh={partial:!0,tokenize:x8};function x8(e,t,n){return r;function r(a){return vt(a)?Mt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Ue(a)?t(a):n(a)}}const NI={continuation:{tokenize:w8},exit:S8,name:"blockQuote",tokenize:b8};function b8(e,t,n){const r=this;return i;function i(s){if(s===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),a}return n(s)}function a(s){return vt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function w8(e,t,n){const r=this;return i;function i(s){return vt(s)?Mt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):a(s)}function a(s){return e.attempt(NI,t,n)(s)}}function S8(e){e.exit("blockQuote")}const MI={name:"characterEscape",tokenize:j8};function j8(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return s8(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const _I={name:"characterReference",tokenize:k8};function k8(e,t,n){const r=this;let i=0,a,s;return l;function l(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),c}function c(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),a=31,s=Sr,p(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,s=o8,p):(e.enter("characterReferenceValue"),a=7,s=Nv,p(d))}function p(d){if(d===59&&i){const f=e.exit("characterReferenceValue");return s===Sr&&!X0(r.sliceSerialize(f))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(d)&&i++<a?(e.consume(d),p):n(d)}}const jj={partial:!0,tokenize:P8},kj={concrete:!0,name:"codeFenced",tokenize:C8};function C8(e,t,n){const r=this,i={partial:!0,tokenize:k};let a=0,s=0,l;return c;function c(j){return u(j)}function u(j){const A=r.events[r.events.length-1];return a=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,l=j,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(j)}function p(j){return j===l?(s++,e.consume(j),p):s<3?n(j):(e.exit("codeFencedFenceSequence"),vt(j)?Mt(e,d,"whitespace")(j):d(j))}function d(j){return j===null||Ue(j)?(e.exit("codeFencedFence"),r.interrupt?t(j):e.check(jj,v,S)(j)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(j))}function f(j){return j===null||Ue(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(j)):vt(j)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Mt(e,m,"whitespace")(j)):j===96&&j===l?n(j):(e.consume(j),f)}function m(j){return j===null||Ue(j)?d(j):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(j))}function g(j){return j===null||Ue(j)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(j)):j===96&&j===l?n(j):(e.consume(j),g)}function v(j){return e.attempt(i,S,x)(j)}function x(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),y}function y(j){return a>0&&vt(j)?Mt(e,b,"linePrefix",a+1)(j):b(j)}function b(j){return j===null||Ue(j)?e.check(jj,v,S)(j):(e.enter("codeFlowValue"),w(j))}function w(j){return j===null||Ue(j)?(e.exit("codeFlowValue"),b(j)):(e.consume(j),w)}function S(j){return e.exit("codeFenced"),t(j)}function k(j,A,E){let D=0;return O;function O(I){return j.enter("lineEnding"),j.consume(I),j.exit("lineEnding"),_}function _(I){return j.enter("codeFencedFence"),vt(I)?Mt(j,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):R(I)}function R(I){return I===l?(j.enter("codeFencedFenceSequence"),X(I)):E(I)}function X(I){return I===l?(D++,j.consume(I),X):D>=s?(j.exit("codeFencedFenceSequence"),vt(I)?Mt(j,V,"whitespace")(I):V(I)):E(I)}function V(I){return I===null||Ue(I)?(j.exit("codeFencedFence"),A(I)):E(I)}}}function P8(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Mg={name:"codeIndented",tokenize:E8},A8={partial:!0,tokenize:T8};function E8(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),Mt(e,a,"linePrefix",5)(u)}function a(u){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?c(u):Ue(u)?e.attempt(A8,s,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||Ue(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function T8(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):Ue(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Mt(e,a,"linePrefix",5)(s)}function a(s){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):Ue(s)?i(s):n(s)}}const I8={name:"codeText",previous:N8,resolve:O8,tokenize:M8};function O8(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function N8(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function M8(e,t,n){let r=0,i,a;return s;function s(d){return e.enter("codeText"),e.enter("codeTextSequence"),l(d)}function l(d){return d===96?(e.consume(d),r++,l):(e.exit("codeTextSequence"),c(d))}function c(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),c):d===96?(a=e.enter("codeTextSequence"),i=0,p(d)):Ue(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(d))}function u(d){return d===null||d===32||d===96||Ue(d)?(e.exit("codeTextData"),c(d)):(e.consume(d),u)}function p(d){return d===96?(e.consume(d),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(a.type="codeTextData",u(d))}}class _8{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&fc(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),fc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),fc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);fc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);fc(this.left,n.reverse())}}}function fc(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function RI(e){const t={};let n=-1,r,i,a,s,l,c,u;const p=new _8(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type==="lineEndingBlank"&&(a+=2),a<c.length&&c[a][1].type==="content"))for(;++a<c.length&&c[a][1].type!=="content";)c[a][1].type==="chunkText"&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,R8(p,n)),n=t[n],u=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(s=p.get(a),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=a);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},l=p.slice(i,n),l.unshift(r),p.splice(i,n-i+1,l))}}return zi(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!u}function R8(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const l=s.events,c=[],u={};let p,d,f=-1,m=n,g=0,v=0;const x=[v];for(;m;){for(;e.get(++i)[1]!==m;);a.push(i),m._tokenizer||(p=r.sliceStream(m),m.next||p.push(null),d&&s.defineSkip(m.start),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(p),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=m,m=m.next}for(m=n;++f<l.length;)l[f][0]==="exit"&&l[f-1][0]==="enter"&&l[f][1].type===l[f-1][1].type&&l[f][1].start.line!==l[f][1].end.line&&(v=f+1,x.push(v),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(s.events=[],m?(m._tokenizer=void 0,m.previous=void 0):x.pop(),f=x.length;f--;){const y=l.slice(x[f],x[f+1]),b=a.pop();c.push([b,b+y.length-1]),e.splice(b,2,y)}for(c.reverse(),f=-1;++f<c.length;)u[g+c[f][0]]=g+c[f][1],g+=c[f][1]-c[f][0]-1;return u}const D8={resolve:z8,tokenize:$8},L8={partial:!0,tokenize:B8};function z8(e){return RI(e),e}function $8(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?a(l):Ue(l)?e.check(L8,s,a)(l):(e.consume(l),i)}function a(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function s(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function B8(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Mt(e,a,"linePrefix")}function a(s){if(s===null||Ue(s))return n(s);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function DI(e,t,n,r,i,a,s,l,c){const u=c||Number.POSITIVE_INFINITY;let p=0;return d;function d(y){return y===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(y),e.exit(a),f):y===null||y===32||y===41||Ov(y)?n(y):(e.enter(r),e.enter(s),e.enter(l),e.enter("chunkString",{contentType:"string"}),v(y))}function f(y){return y===62?(e.enter(a),e.consume(y),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(l),f(y)):y===null||y===60||Ue(y)?n(y):(e.consume(y),y===92?g:m)}function g(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function v(y){return!p&&(y===null||y===41||hr(y))?(e.exit("chunkString"),e.exit(l),e.exit(s),e.exit(r),t(y)):p<u&&y===40?(e.consume(y),p++,v):y===41?(e.consume(y),p--,v):y===null||y===32||y===40||Ov(y)?n(y):(e.consume(y),y===92?x:v)}function x(y){return y===40||y===41||y===92?(e.consume(y),v):v(y)}}function LI(e,t,n,r,i,a){const s=this;let l=0,c;return u;function u(m){return e.enter(r),e.enter(i),e.consume(m),e.exit(i),e.enter(a),p}function p(m){return l>999||m===null||m===91||m===93&&!c||m===94&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?n(m):m===93?(e.exit(a),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):Ue(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||Ue(m)||l++>999?(e.exit("chunkString"),p(m)):(e.consume(m),c||(c=!vt(m)),m===92?f:d)}function f(m){return m===91||m===92||m===93?(e.consume(m),l++,d):d(m)}}function zI(e,t,n,r,i,a){let s;return l;function l(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),s=f===40?41:f,c):n(f)}function c(f){return f===s?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(a),u(f))}function u(f){return f===s?(e.exit(a),c(s)):f===null?n(f):Ue(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Mt(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(f))}function p(f){return f===s||f===null||Ue(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?d:p)}function d(f){return f===s||f===92?(e.consume(f),p):p(f)}}function Kc(e,t){let n;return r;function r(i){return Ue(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):vt(i)?Mt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const F8={name:"definition",tokenize:W8},U8={partial:!0,tokenize:K8};function W8(e,t,n){const r=this;let i;return a;function a(m){return e.enter("definition"),s(m)}function s(m){return LI.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function l(m){return i=dl(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),c):n(m)}function c(m){return hr(m)?Kc(e,u)(m):u(m)}function u(m){return DI(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function p(m){return e.attempt(U8,d,d)(m)}function d(m){return vt(m)?Mt(e,f,"whitespace")(m):f(m)}function f(m){return m===null||Ue(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function K8(e,t,n){return r;function r(l){return hr(l)?Kc(e,i)(l):n(l)}function i(l){return zI(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return vt(l)?Mt(e,s,"whitespace")(l):s(l)}function s(l){return l===null||Ue(l)?t(l):n(l)}}const H8={name:"hardBreakEscape",tokenize:V8};function V8(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Ue(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const q8={name:"headingAtx",resolve:Y8,tokenize:G8};function Y8(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},zi(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function G8(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),s(p)}function s(p){return p===35&&r++<6?(e.consume(p),s):p===null||hr(p)?(e.exit("atxHeadingSequence"),l(p)):n(p)}function l(p){return p===35?(e.enter("atxHeadingSequence"),c(p)):p===null||Ue(p)?(e.exit("atxHeading"),t(p)):vt(p)?Mt(e,l,"whitespace")(p):(e.enter("atxHeadingText"),u(p))}function c(p){return p===35?(e.consume(p),c):(e.exit("atxHeadingSequence"),l(p))}function u(p){return p===null||p===35||hr(p)?(e.exit("atxHeadingText"),l(p)):(e.consume(p),u)}}const X8=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Cj=["pre","script","style","textarea"],Q8={concrete:!0,name:"htmlFlow",resolveTo:eB,tokenize:tB},Z8={partial:!0,tokenize:rB},J8={partial:!0,tokenize:nB};function eB(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function tB(e,t,n){const r=this;let i,a,s,l,c;return u;function u(T){return p(T)}function p(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),d}function d(T){return T===33?(e.consume(T),f):T===47?(e.consume(T),a=!0,v):T===63?(e.consume(T),i=3,r.interrupt?t:P):Ii(T)?(e.consume(T),s=String.fromCharCode(T),x):n(T)}function f(T){return T===45?(e.consume(T),i=2,m):T===91?(e.consume(T),i=5,l=0,g):Ii(T)?(e.consume(T),i=4,r.interrupt?t:P):n(T)}function m(T){return T===45?(e.consume(T),r.interrupt?t:P):n(T)}function g(T){const he="CDATA[";return T===he.charCodeAt(l++)?(e.consume(T),l===he.length?r.interrupt?t:R:g):n(T)}function v(T){return Ii(T)?(e.consume(T),s=String.fromCharCode(T),x):n(T)}function x(T){if(T===null||T===47||T===62||hr(T)){const he=T===47,ye=s.toLowerCase();return!he&&!a&&Cj.includes(ye)?(i=1,r.interrupt?t(T):R(T)):X8.includes(s.toLowerCase())?(i=6,he?(e.consume(T),y):r.interrupt?t(T):R(T)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(T):a?b(T):w(T))}return T===45||Sr(T)?(e.consume(T),s+=String.fromCharCode(T),x):n(T)}function y(T){return T===62?(e.consume(T),r.interrupt?t:R):n(T)}function b(T){return vt(T)?(e.consume(T),b):O(T)}function w(T){return T===47?(e.consume(T),O):T===58||T===95||Ii(T)?(e.consume(T),S):vt(T)?(e.consume(T),w):O(T)}function S(T){return T===45||T===46||T===58||T===95||Sr(T)?(e.consume(T),S):k(T)}function k(T){return T===61?(e.consume(T),j):vt(T)?(e.consume(T),k):w(T)}function j(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),c=T,A):vt(T)?(e.consume(T),j):E(T)}function A(T){return T===c?(e.consume(T),c=null,D):T===null||Ue(T)?n(T):(e.consume(T),A)}function E(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||hr(T)?k(T):(e.consume(T),E)}function D(T){return T===47||T===62||vt(T)?w(T):n(T)}function O(T){return T===62?(e.consume(T),_):n(T)}function _(T){return T===null||Ue(T)?R(T):vt(T)?(e.consume(T),_):n(T)}function R(T){return T===45&&i===2?(e.consume(T),$):T===60&&i===1?(e.consume(T),H):T===62&&i===4?(e.consume(T),W):T===63&&i===3?(e.consume(T),P):T===93&&i===5?(e.consume(T),U):Ue(T)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Z8,se,X)(T)):T===null||Ue(T)?(e.exit("htmlFlowData"),X(T)):(e.consume(T),R)}function X(T){return e.check(J8,V,se)(T)}function V(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),I}function I(T){return T===null||Ue(T)?X(T):(e.enter("htmlFlowData"),R(T))}function $(T){return T===45?(e.consume(T),P):R(T)}function H(T){return T===47?(e.consume(T),s="",N):R(T)}function N(T){if(T===62){const he=s.toLowerCase();return Cj.includes(he)?(e.consume(T),W):R(T)}return Ii(T)&&s.length<8?(e.consume(T),s+=String.fromCharCode(T),N):R(T)}function U(T){return T===93?(e.consume(T),P):R(T)}function P(T){return T===62?(e.consume(T),W):T===45&&i===2?(e.consume(T),P):R(T)}function W(T){return T===null||Ue(T)?(e.exit("htmlFlowData"),se(T)):(e.consume(T),W)}function se(T){return e.exit("htmlFlow"),t(T)}}function nB(e,t,n){const r=this;return i;function i(s){return Ue(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):n(s)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function rB(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Bh,t,n)}}const iB={name:"htmlText",tokenize:aB};function aB(e,t,n){const r=this;let i,a,s;return l;function l(P){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(P),c}function c(P){return P===33?(e.consume(P),u):P===47?(e.consume(P),k):P===63?(e.consume(P),w):Ii(P)?(e.consume(P),E):n(P)}function u(P){return P===45?(e.consume(P),p):P===91?(e.consume(P),a=0,g):Ii(P)?(e.consume(P),b):n(P)}function p(P){return P===45?(e.consume(P),m):n(P)}function d(P){return P===null?n(P):P===45?(e.consume(P),f):Ue(P)?(s=d,H(P)):(e.consume(P),d)}function f(P){return P===45?(e.consume(P),m):d(P)}function m(P){return P===62?$(P):P===45?f(P):d(P)}function g(P){const W="CDATA[";return P===W.charCodeAt(a++)?(e.consume(P),a===W.length?v:g):n(P)}function v(P){return P===null?n(P):P===93?(e.consume(P),x):Ue(P)?(s=v,H(P)):(e.consume(P),v)}function x(P){return P===93?(e.consume(P),y):v(P)}function y(P){return P===62?$(P):P===93?(e.consume(P),y):v(P)}function b(P){return P===null||P===62?$(P):Ue(P)?(s=b,H(P)):(e.consume(P),b)}function w(P){return P===null?n(P):P===63?(e.consume(P),S):Ue(P)?(s=w,H(P)):(e.consume(P),w)}function S(P){return P===62?$(P):w(P)}function k(P){return Ii(P)?(e.consume(P),j):n(P)}function j(P){return P===45||Sr(P)?(e.consume(P),j):A(P)}function A(P){return Ue(P)?(s=A,H(P)):vt(P)?(e.consume(P),A):$(P)}function E(P){return P===45||Sr(P)?(e.consume(P),E):P===47||P===62||hr(P)?D(P):n(P)}function D(P){return P===47?(e.consume(P),$):P===58||P===95||Ii(P)?(e.consume(P),O):Ue(P)?(s=D,H(P)):vt(P)?(e.consume(P),D):$(P)}function O(P){return P===45||P===46||P===58||P===95||Sr(P)?(e.consume(P),O):_(P)}function _(P){return P===61?(e.consume(P),R):Ue(P)?(s=_,H(P)):vt(P)?(e.consume(P),_):D(P)}function R(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),i=P,X):Ue(P)?(s=R,H(P)):vt(P)?(e.consume(P),R):(e.consume(P),V)}function X(P){return P===i?(e.consume(P),i=void 0,I):P===null?n(P):Ue(P)?(s=X,H(P)):(e.consume(P),X)}function V(P){return P===null||P===34||P===39||P===60||P===61||P===96?n(P):P===47||P===62||hr(P)?D(P):(e.consume(P),V)}function I(P){return P===47||P===62||hr(P)?D(P):n(P)}function $(P){return P===62?(e.consume(P),e.exit("htmlTextData"),e.exit("htmlText"),t):n(P)}function H(P){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),N}function N(P){return vt(P)?Mt(e,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):U(P)}function U(P){return e.enter("htmlTextData"),s(P)}}const Z0={name:"labelEnd",resolveAll:cB,resolveTo:uB,tokenize:dB},oB={tokenize:pB},sB={tokenize:fB},lB={tokenize:hB};function cB(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&zi(e,0,e.length,n),e}function uB(e,t){let n=e.length,r=0,i,a,s,l;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const c={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[a][1].start},end:{...e[s][1].end}},p={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[s-2][1].start}};return l=[["enter",c,t],["enter",u,t]],l=Br(l,e.slice(a+1,a+r+3)),l=Br(l,[["enter",p,t]]),l=Br(l,Q0(t.parser.constructs.insideSpan.null,e.slice(a+r+4,s-3),t)),l=Br(l,[["exit",p,t],e[s-2],e[s-1],["exit",u,t]]),l=Br(l,e.slice(s+1)),l=Br(l,[["exit",c,t]]),zi(e,a,e.length,l),e}function dB(e,t,n){const r=this;let i=r.events.length,a,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return l;function l(f){return a?a._inactive?d(f):(s=r.parser.defined.includes(dl(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),c):n(f)}function c(f){return f===40?e.attempt(oB,p,s?p:d)(f):f===91?e.attempt(sB,p,s?u:d)(f):s?p(f):d(f)}function u(f){return e.attempt(lB,p,d)(f)}function p(f){return t(f)}function d(f){return a._balanced=!0,n(f)}}function pB(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return hr(d)?Kc(e,a)(d):a(d)}function a(d){return d===41?p(d):DI(e,s,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return hr(d)?Kc(e,c)(d):p(d)}function l(d){return n(d)}function c(d){return d===34||d===39||d===40?zI(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):p(d)}function u(d){return hr(d)?Kc(e,p)(d):p(d)}function p(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function fB(e,t,n){const r=this;return i;function i(l){return LI.call(r,e,a,s,"reference","referenceMarker","referenceString")(l)}function a(l){return r.parser.defined.includes(dl(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function s(l){return n(l)}}function hB(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const mB={name:"labelStartImage",resolveAll:Z0.resolveAll,tokenize:gB};function gB(e,t,n){const r=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),a}function a(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),s):n(l)}function s(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const yB={name:"labelStartLink",resolveAll:Z0.resolveAll,tokenize:vB};function vB(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),a}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const _g={name:"lineEnding",tokenize:xB};function xB(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Mt(e,t,"linePrefix")}}const Op={name:"thematicBreak",tokenize:bB};function bB(e,t,n){let r=0,i;return a;function a(u){return e.enter("thematicBreak"),s(u)}function s(u){return i=u,l(u)}function l(u){return u===i?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||Ue(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===i?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),vt(u)?Mt(e,l,"whitespace")(u):l(u))}}const or={continuation:{tokenize:kB},exit:PB,name:"list",tokenize:jB},wB={partial:!0,tokenize:AB},SB={partial:!0,tokenize:CB};function jB(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return l;function l(m){const g=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Nv(m)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Op,n,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(m)}return n(m)}function c(m){return Nv(m)&&++s<10?(e.consume(m),c):(!r.interrupt||s<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(Bh,r.interrupt?n:p,e.attempt(wB,f,d))}function p(m){return r.containerState.initialBlankLine=!0,a++,f(m)}function d(m){return vt(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),f):n(m)}function f(m){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function kB(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Bh,i,a);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Mt(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!vt(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(SB,t,s)(l))}function s(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Mt(e,e.attempt(or,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function CB(e,t,n){const r=this;return Mt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(a):n(a)}}function PB(e){e.exit(this.containerState.type)}function AB(e,t,n){const r=this;return Mt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const s=r.events[r.events.length-1];return!vt(a)&&s&&s[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const Pj={name:"setextUnderline",resolveTo:EB,tokenize:TB};function EB(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",s,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function TB(e,t,n){const r=this;let i;return a;function a(u){let p=r.events.length,d;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){d=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===i?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),vt(u)?Mt(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Ue(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const IB={tokenize:OB};function OB(e){const t=this,n=e.attempt(Bh,r,e.attempt(this.parser.constructs.flowInitial,i,Mt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(D8,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const NB={resolveAll:BI()},MB=$I("string"),_B=$I("text");function $I(e){return{resolveAll:BI(e==="text"?RB:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,s,l);return s;function s(p){return u(p)?a(p):l(p)}function l(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),c}function c(p){return u(p)?(n.exit("data"),a(p)):(n.consume(p),c)}function u(p){if(p===null)return!0;const d=i[p];let f=-1;if(d)for(;++f<d.length;){const m=d[f];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function BI(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function RB(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,s=-1,l=0,c;for(;a--;){const u=i[a];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)l++,s--;if(s)break;s=-1}else if(u===-2)c=!0,l++;else if(u!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const u={type:n===e.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:r.start._bufferIndex+s,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const DB={42:or,43:or,45:or,48:or,49:or,50:or,51:or,52:or,53:or,54:or,55:or,56:or,57:or,62:NI},LB={91:F8},zB={[-2]:Mg,[-1]:Mg,32:Mg},$B={35:q8,42:Op,45:[Pj,Op],60:Q8,61:Pj,95:Op,96:kj,126:kj},BB={38:_I,92:MI},FB={[-5]:_g,[-4]:_g,[-3]:_g,33:mB,38:_I,42:Mv,60:[y8,iB],91:yB,92:[H8,MI],93:Z0,95:Mv,96:I8},UB={null:[Mv,NB]},WB={null:[42,95]},KB={null:[]},HB=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:WB,contentInitial:LB,disable:KB,document:DB,flow:$B,flowInitial:zB,insideSpan:UB,string:BB,text:FB},Symbol.toStringTag,{value:"Module"}));function VB(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let s=[],l=[];const c={attempt:A(k),check:A(j),consume:b,enter:w,exit:S,interrupt:A(j,{interrupt:!0})},u={code:null,containerState:{},defineSkip:v,events:[],now:g,parser:e,previous:null,sliceSerialize:f,sliceStream:m,write:d};let p=t.tokenize.call(u,c);return t.resolveAll&&a.push(t),u;function d(_){return s=Br(s,_),x(),s[s.length-1]!==null?[]:(E(t,0),u.events=Q0(a,u.events,u),u.events)}function f(_,R){return YB(m(_),R)}function m(_){return qB(s,_)}function g(){const{_bufferIndex:_,_index:R,line:X,column:V,offset:I}=r;return{_bufferIndex:_,_index:R,line:X,column:V,offset:I}}function v(_){i[_.line]=_.column,O()}function x(){let _;for(;r._index<s.length;){const R=s[r._index];if(typeof R=="string")for(_=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===_&&r._bufferIndex<R.length;)y(R.charCodeAt(r._bufferIndex));else y(R)}}function y(_){p=p(_)}function b(_){Ue(_)?(r.line++,r.column=1,r.offset+=_===-3?2:1,O()):_!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=_}function w(_,R){const X=R||{};return X.type=_,X.start=g(),u.events.push(["enter",X,u]),l.push(X),X}function S(_){const R=l.pop();return R.end=g(),u.events.push(["exit",R,u]),R}function k(_,R){E(_,R.from)}function j(_,R){R.restore()}function A(_,R){return X;function X(V,I,$){let H,N,U,P;return Array.isArray(V)?se(V):"tokenize"in V?se([V]):W(V);function W(Z){return le;function le(Se){const Q=Se!==null&&Z[Se],ne=Se!==null&&Z.null,pe=[...Array.isArray(Q)?Q:Q?[Q]:[],...Array.isArray(ne)?ne:ne?[ne]:[]];return se(pe)(Se)}}function se(Z){return H=Z,N=0,Z.length===0?$:T(Z[N])}function T(Z){return le;function le(Se){return P=D(),U=Z,Z.partial||(u.currentConstruct=Z),Z.name&&u.parser.constructs.disable.null.includes(Z.name)?ye():Z.tokenize.call(R?Object.assign(Object.create(u),R):u,c,he,ye)(Se)}}function he(Z){return _(U,P),I}function ye(Z){return P.restore(),++N<H.length?T(H[N]):$}}}function E(_,R){_.resolveAll&&!a.includes(_)&&a.push(_),_.resolve&&zi(u.events,R,u.events.length-R,_.resolve(u.events.slice(R),u)),_.resolveTo&&(u.events=_.resolveTo(u.events,u))}function D(){const _=g(),R=u.previous,X=u.currentConstruct,V=u.events.length,I=Array.from(l);return{from:V,restore:$};function $(){r=_,u.previous=R,u.currentConstruct=X,u.events.length=V,l=I,O()}}function O(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function qB(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,a)];else{if(s=e.slice(n,i),r>-1){const l=s[0];typeof l=="string"?s[0]=l.slice(r):s.shift()}a>0&&s.push(e[i].slice(0,a))}return s}function YB(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let s;if(typeof a=="string")s=a;else switch(a){case-5:{s="\r";break}case-4:{s=`
|
|
69
|
+
`;break}case-3:{s=`\r
|
|
70
|
+
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(a)}i=a===-2,r.push(s)}return r.join("")}function GB(e){const r={constructs:n8([HB,...(e||{}).extensions||[]]),content:i(u8),defined:[],document:i(p8),flow:i(IB),lazy:{},string:i(MB),text:i(_B)};return r;function i(a){return s;function s(l){return VB(r,a,l)}}}function XB(e){for(;!RI(e););return e}const Aj=/[\0\t\n\r]/g;function QB(){let e=1,t="",n=!0,r;return i;function i(a,s,l){const c=[];let u,p,d,f,m;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(s||void 0).decode(a)),d=0,t="",n&&(a.charCodeAt(0)===65279&&d++,n=void 0);d<a.length;){if(Aj.lastIndex=d,u=Aj.exec(a),f=u&&u.index!==void 0?u.index:a.length,m=a.charCodeAt(f),!u){t=a.slice(d);break}if(m===10&&d===f&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),d<f&&(c.push(a.slice(d,f)),e+=f-d),m){case 0:{c.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,c.push(-2);e++<p;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}d=f+1}return l&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const ZB=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function JB(e){return e.replace(ZB,e5)}function e5(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return OI(n.slice(a?2:1),a?16:10)}return X0(n)||e}const FI={}.hasOwnProperty;function t5(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),n5(n)(XB(GB(n).document().write(QB()(e,t,!0))))}function n5(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(We),autolinkProtocol:D,autolinkEmail:D,atxHeading:a(te),blockQuote:a(ne),characterEscape:D,characterReference:D,codeFenced:a(pe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:a(pe,s),codeText:a(ie,s),codeTextData:D,data:D,codeFlowValue:D,definition:a(_e),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:a(ke),hardBreakEscape:a(De),hardBreakTrailing:a(De),htmlFlow:a(Ve,s),htmlFlowData:D,htmlText:a(Ve,s),htmlTextData:D,image:a(Le),label:s,link:a(We),listItem:a(qe),listItemValue:f,listOrdered:a(pt,d),listUnordered:a(pt),paragraph:a(Xe),reference:T,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:a(te),strong:a(Qe),thematicBreak:a(J)},exit:{atxHeading:c(),atxHeadingSequence:k,autolink:c(),autolinkEmail:Q,autolinkProtocol:Se,blockQuote:c(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:ye,characterReferenceMarkerNumeric:ye,characterReferenceValue:Z,characterReference:le,codeFenced:c(x),codeFencedFence:v,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:O,codeIndented:c(y),codeText:c(I),codeTextData:O,data:O,definition:c(),definitionDestinationString:S,definitionLabelString:b,definitionTitleString:w,emphasis:c(),hardBreakEscape:c(R),hardBreakTrailing:c(R),htmlFlow:c(X),htmlFlowData:O,htmlText:c(V),htmlTextData:O,image:c(H),label:U,labelText:N,lineEnding:_,link:c($),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:he,resourceDestinationString:P,resourceTitleString:W,resource:se,setextHeading:c(E),setextHeadingLineSequence:A,setextHeadingText:j,strong:c(),thematicBreak:c()}};UI(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(q){let ue={type:"root",children:[]};const M={stack:[ue],tokenStack:[],config:t,enter:l,exit:u,buffer:s,resume:p,data:n},fe=[];let ee=-1;for(;++ee<q.length;)if(q[ee][1].type==="listOrdered"||q[ee][1].type==="listUnordered")if(q[ee][0]==="enter")fe.push(ee);else{const xe=fe.pop();ee=i(q,xe,ee)}for(ee=-1;++ee<q.length;){const xe=t[q[ee][0]];FI.call(xe,q[ee][1].type)&&xe[q[ee][1].type].call(Object.assign({sliceSerialize:q[ee][2].sliceSerialize},M),q[ee][1])}if(M.tokenStack.length>0){const xe=M.tokenStack[M.tokenStack.length-1];(xe[1]||Ej).call(M,void 0,xe[0])}for(ue.position={start:Na(q.length>0?q[0][1].start:{line:1,column:1,offset:0}),end:Na(q.length>0?q[q.length-2][1].end:{line:1,column:1,offset:0})},ee=-1;++ee<t.transforms.length;)ue=t.transforms[ee](ue)||ue;return ue}function i(q,ue,M){let fe=ue-1,ee=-1,xe=!1,je,Re,ze,Ke;for(;++fe<=M;){const Ie=q[fe];switch(Ie[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ie[0]==="enter"?ee++:ee--,Ke=void 0;break}case"lineEndingBlank":{Ie[0]==="enter"&&(je&&!Ke&&!ee&&!ze&&(ze=fe),Ke=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ke=void 0}if(!ee&&Ie[0]==="enter"&&Ie[1].type==="listItemPrefix"||ee===-1&&Ie[0]==="exit"&&(Ie[1].type==="listUnordered"||Ie[1].type==="listOrdered")){if(je){let Ge=fe;for(Re=void 0;Ge--;){const L=q[Ge];if(L[1].type==="lineEnding"||L[1].type==="lineEndingBlank"){if(L[0]==="exit")continue;Re&&(q[Re][1].type="lineEndingBlank",xe=!0),L[1].type="lineEnding",Re=Ge}else if(!(L[1].type==="linePrefix"||L[1].type==="blockQuotePrefix"||L[1].type==="blockQuotePrefixWhitespace"||L[1].type==="blockQuoteMarker"||L[1].type==="listItemIndent"))break}ze&&(!Re||ze<Re)&&(je._spread=!0),je.end=Object.assign({},Re?q[Re][1].start:Ie[1].end),q.splice(Re||fe,0,["exit",je,Ie[2]]),fe++,M++}if(Ie[1].type==="listItemPrefix"){const Ge={type:"listItem",_spread:!1,start:Object.assign({},Ie[1].start),end:void 0};je=Ge,q.splice(fe,0,["enter",Ge,Ie[2]]),fe++,M++,ze=void 0,Ke=!0}}}return q[ue][1]._spread=xe,M}function a(q,ue){return M;function M(fe){l.call(this,q(fe),fe),ue&&ue.call(this,fe)}}function s(){this.stack.push({type:"fragment",children:[]})}function l(q,ue,M){this.stack[this.stack.length-1].children.push(q),this.stack.push(q),this.tokenStack.push([ue,M||void 0]),q.position={start:Na(ue.start),end:void 0}}function c(q){return ue;function ue(M){q&&q.call(this,M),u.call(this,M)}}function u(q,ue){const M=this.stack.pop(),fe=this.tokenStack.pop();if(fe)fe[0].type!==q.type&&(ue?ue.call(this,q,fe[0]):(fe[1]||Ej).call(this,q,fe[0]));else throw new Error("Cannot close `"+q.type+"` ("+Wc({start:q.start,end:q.end})+"): it’s not open");M.position.end=Na(q.end)}function p(){return e8(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(q){if(this.data.expectingFirstListItemValue){const ue=this.stack[this.stack.length-2];ue.start=Number.parseInt(this.sliceSerialize(q),10),this.data.expectingFirstListItemValue=void 0}}function m(){const q=this.resume(),ue=this.stack[this.stack.length-1];ue.lang=q}function g(){const q=this.resume(),ue=this.stack[this.stack.length-1];ue.meta=q}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const q=this.resume(),ue=this.stack[this.stack.length-1];ue.value=q.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const q=this.resume(),ue=this.stack[this.stack.length-1];ue.value=q.replace(/(\r?\n|\r)$/g,"")}function b(q){const ue=this.resume(),M=this.stack[this.stack.length-1];M.label=ue,M.identifier=dl(this.sliceSerialize(q)).toLowerCase()}function w(){const q=this.resume(),ue=this.stack[this.stack.length-1];ue.title=q}function S(){const q=this.resume(),ue=this.stack[this.stack.length-1];ue.url=q}function k(q){const ue=this.stack[this.stack.length-1];if(!ue.depth){const M=this.sliceSerialize(q).length;ue.depth=M}}function j(){this.data.setextHeadingSlurpLineEnding=!0}function A(q){const ue=this.stack[this.stack.length-1];ue.depth=this.sliceSerialize(q).codePointAt(0)===61?1:2}function E(){this.data.setextHeadingSlurpLineEnding=void 0}function D(q){const M=this.stack[this.stack.length-1].children;let fe=M[M.length-1];(!fe||fe.type!=="text")&&(fe=et(),fe.position={start:Na(q.start),end:void 0},M.push(fe)),this.stack.push(fe)}function O(q){const ue=this.stack.pop();ue.value+=this.sliceSerialize(q),ue.position.end=Na(q.end)}function _(q){const ue=this.stack[this.stack.length-1];if(this.data.atHardBreak){const M=ue.children[ue.children.length-1];M.position.end=Na(q.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ue.type)&&(D.call(this,q),O.call(this,q))}function R(){this.data.atHardBreak=!0}function X(){const q=this.resume(),ue=this.stack[this.stack.length-1];ue.value=q}function V(){const q=this.resume(),ue=this.stack[this.stack.length-1];ue.value=q}function I(){const q=this.resume(),ue=this.stack[this.stack.length-1];ue.value=q}function $(){const q=this.stack[this.stack.length-1];if(this.data.inReference){const ue=this.data.referenceType||"shortcut";q.type+="Reference",q.referenceType=ue,delete q.url,delete q.title}else delete q.identifier,delete q.label;this.data.referenceType=void 0}function H(){const q=this.stack[this.stack.length-1];if(this.data.inReference){const ue=this.data.referenceType||"shortcut";q.type+="Reference",q.referenceType=ue,delete q.url,delete q.title}else delete q.identifier,delete q.label;this.data.referenceType=void 0}function N(q){const ue=this.sliceSerialize(q),M=this.stack[this.stack.length-2];M.label=JB(ue),M.identifier=dl(ue).toLowerCase()}function U(){const q=this.stack[this.stack.length-1],ue=this.resume(),M=this.stack[this.stack.length-1];if(this.data.inReference=!0,M.type==="link"){const fe=q.children;M.children=fe}else M.alt=ue}function P(){const q=this.resume(),ue=this.stack[this.stack.length-1];ue.url=q}function W(){const q=this.resume(),ue=this.stack[this.stack.length-1];ue.title=q}function se(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function he(q){const ue=this.resume(),M=this.stack[this.stack.length-1];M.label=ue,M.identifier=dl(this.sliceSerialize(q)).toLowerCase(),this.data.referenceType="full"}function ye(q){this.data.characterReferenceType=q.type}function Z(q){const ue=this.sliceSerialize(q),M=this.data.characterReferenceType;let fe;M?(fe=OI(ue,M==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):fe=X0(ue);const ee=this.stack[this.stack.length-1];ee.value+=fe}function le(q){const ue=this.stack.pop();ue.position.end=Na(q.end)}function Se(q){O.call(this,q);const ue=this.stack[this.stack.length-1];ue.url=this.sliceSerialize(q)}function Q(q){O.call(this,q);const ue=this.stack[this.stack.length-1];ue.url="mailto:"+this.sliceSerialize(q)}function ne(){return{type:"blockquote",children:[]}}function pe(){return{type:"code",lang:null,meta:null,value:""}}function ie(){return{type:"inlineCode",value:""}}function _e(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ke(){return{type:"emphasis",children:[]}}function te(){return{type:"heading",depth:0,children:[]}}function De(){return{type:"break"}}function Ve(){return{type:"html",value:""}}function Le(){return{type:"image",title:null,url:"",alt:null}}function We(){return{type:"link",title:null,url:"",children:[]}}function pt(q){return{type:"list",ordered:q.type==="listOrdered",start:null,spread:q._spread,children:[]}}function qe(q){return{type:"listItem",spread:q._spread,checked:null,children:[]}}function Xe(){return{type:"paragraph",children:[]}}function Qe(){return{type:"strong",children:[]}}function et(){return{type:"text",value:""}}function J(){return{type:"thematicBreak"}}}function Na(e){return{line:e.line,column:e.column,offset:e.offset}}function UI(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?UI(e,r):r5(e,r)}}function r5(e,t){let n;for(n in t)if(FI.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Ej(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Wc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Wc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Wc({start:t.start,end:t.end})+") is still open")}function i5(e){const t=this;t.parser=n;function n(r){return t5(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function a5(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function o5(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
71
|
+
`}]}function s5(e,t){const n=t.value?t.value+`
|
|
72
|
+
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function l5(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function c5(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function u5(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Kl(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let s,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=a+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function d5(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function p5(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function WI(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function f5(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return WI(e,t);const i={src:Kl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function h5(e,t){const n={src:Kl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function m5(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function g5(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return WI(e,t);const i={href:Kl(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function y5(e,t){const n={href:Kl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function v5(e,t,n){const r=e.all(t),i=n?x5(n):KI(t),a={},s=[];if(typeof t.checked=="boolean"){const p=r[0];let d;p&&p.type==="element"&&p.tagName==="p"?d=p:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const p=r[l];(i||l!==0||p.type!=="element"||p.tagName!=="p")&&s.push({type:"text",value:`
|
|
73
|
+
`}),p.type==="element"&&p.tagName==="p"&&!i?s.push(...p.children):s.push(p)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&s.push({type:"text",value:`
|
|
74
|
+
`});const u={type:"element",tagName:"li",properties:a,children:s};return e.patch(t,u),e.applyData(t,u)}function x5(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=KI(n[r])}return t}function KI(e){const t=e.spread;return t??e.children.length>1}function b5(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function w5(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function S5(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function j5(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function k5(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=V0(t.children[1]),c=kI(t.children[t.children.length-1]);l&&c&&(s.position={start:l,end:c}),i.push(s)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function C5(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,l=s?s.length:t.children.length;let c=-1;const u=[];for(;++c<l;){const d=t.children[c],f={},m=s?s[c]:void 0;m&&(f.align=m);let g={type:"element",tagName:a,properties:f,children:[]};d&&(g.children=e.all(d),e.patch(d,g),g=e.applyData(d,g)),u.push(g)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,p),e.applyData(t,p)}function P5(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Tj=9,Ij=32;function A5(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(Oj(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Oj(t.slice(i),i>0,!1)),a.join("")}function Oj(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===Tj||a===Ij;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===Tj||a===Ij;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function E5(e,t){const n={type:"text",value:A5(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function T5(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const I5={blockquote:a5,break:o5,code:s5,delete:l5,emphasis:c5,footnoteReference:u5,heading:d5,html:p5,imageReference:f5,image:h5,inlineCode:m5,linkReference:g5,link:y5,listItem:v5,list:b5,paragraph:w5,root:S5,strong:j5,table:k5,tableCell:P5,tableRow:C5,text:E5,thematicBreak:T5,toml:Bd,yaml:Bd,definition:Bd,footnoteDefinition:Bd};function Bd(){}const HI=-1,Fh=0,Hc=1,pf=2,J0=3,eb=4,tb=5,nb=6,VI=7,qI=8,O5=typeof self=="object"?self:globalThis,Nj=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new O5[e](t)},N5=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,s]=t[i];switch(a){case Fh:case HI:return n(s,i);case Hc:{const l=n([],i);for(const c of s)l.push(r(c));return l}case pf:{const l=n({},i);for(const[c,u]of s)l[r(c)]=r(u);return l}case J0:return n(new Date(s),i);case eb:{const{source:l,flags:c}=s;return n(new RegExp(l,c),i)}case tb:{const l=n(new Map,i);for(const[c,u]of s)l.set(r(c),r(u));return l}case nb:{const l=n(new Set,i);for(const c of s)l.add(r(c));return l}case VI:{const{name:l,message:c}=s;return n(Nj(l,c),i)}case qI:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:l}=new Uint8Array(s);return n(new DataView(l),s)}}return n(Nj(a,s),i)};return r},Mj=e=>N5(new Map,e)(0),Io="",{toString:M5}={},{keys:_5}=Object,hc=e=>{const t=typeof e;if(t!=="object"||!e)return[Fh,t];const n=M5.call(e).slice(8,-1);switch(n){case"Array":return[Hc,Io];case"Object":return[pf,Io];case"Date":return[J0,Io];case"RegExp":return[eb,Io];case"Map":return[tb,Io];case"Set":return[nb,Io];case"DataView":return[Hc,n]}return n.includes("Array")?[Hc,n]:n.includes("Error")?[VI,n]:[pf,n]},Fd=([e,t])=>e===Fh&&(t==="function"||t==="symbol"),R5=(e,t,n,r)=>{const i=(s,l)=>{const c=r.push(s)-1;return n.set(l,c),c},a=s=>{if(n.has(s))return n.get(s);let[l,c]=hc(s);switch(l){case Fh:{let p=s;switch(c){case"bigint":l=qI,p=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);p=null;break;case"undefined":return i([HI],s)}return i([l,p],s)}case Hc:{if(c){let f=s;return c==="DataView"?f=new Uint8Array(s.buffer):c==="ArrayBuffer"&&(f=new Uint8Array(s)),i([c,[...f]],s)}const p=[],d=i([l,p],s);for(const f of s)p.push(a(f));return d}case pf:{if(c)switch(c){case"BigInt":return i([c,s.toString()],s);case"Boolean":case"Number":case"String":return i([c,s.valueOf()],s)}if(t&&"toJSON"in s)return a(s.toJSON());const p=[],d=i([l,p],s);for(const f of _5(s))(e||!Fd(hc(s[f])))&&p.push([a(f),a(s[f])]);return d}case J0:return i([l,isNaN(s.getTime())?Io:s.toISOString()],s);case eb:{const{source:p,flags:d}=s;return i([l,{source:p,flags:d}],s)}case tb:{const p=[],d=i([l,p],s);for(const[f,m]of s)(e||!(Fd(hc(f))||Fd(hc(m))))&&p.push([a(f),a(m)]);return d}case nb:{const p=[],d=i([l,p],s);for(const f of s)(e||!Fd(hc(f)))&&p.push(a(f));return d}}const{message:u}=s;return i([l,{name:c,message:u}],s)};return a},_j=(e,{json:t,lossy:n}={})=>{const r=[];return R5(!(t||n),!!t,new Map,r)(e),r},ff=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Mj(_j(e,t)):structuredClone(e):(e,t)=>Mj(_j(e,t));function D5(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function L5(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function z5(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||D5,r=e.options.footnoteBackLabel||L5,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[c]);if(!u)continue;const p=e.all(u),d=String(u.identifier).toUpperCase(),f=Kl(d.toLowerCase());let m=0;const g=[],v=e.footnoteCounts.get(d);for(;v!==void 0&&++m<=v;){g.length>0&&g.push({type:"text",value:" "});let b=typeof n=="string"?n:n(c,m);typeof b=="string"&&(b={type:"text",value:b}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,m),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const x=p[p.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const b=x.children[x.children.length-1];b&&b.type==="text"?b.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...g)}else p.push(...g);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(p,!0)};e.patch(u,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...ff(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
75
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
|
|
76
|
+
`}]}}const YI=function(e){if(e==null)return U5;if(typeof e=="function")return Uh(e);if(typeof e=="object")return Array.isArray(e)?$5(e):B5(e);if(typeof e=="string")return F5(e);throw new Error("Expected function, string, or object as test")};function $5(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=YI(e[n]);return Uh(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function B5(e){const t=e;return Uh(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function F5(e){return Uh(t);function t(n){return n&&n.type===e}}function Uh(e){return t;function t(n,r,i){return!!(W5(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function U5(){return!0}function W5(e){return e!==null&&typeof e=="object"&&"type"in e}const GI=[],K5=!0,Rj=!1,H5="skip";function V5(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=YI(i),s=r?-1:1;l(e,void 0,[])();function l(c,u,p){const d=c&&typeof c=="object"?c:{};if(typeof d.type=="string"){const m=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(c.type+(m?"<"+m+">":""))+")"})}return f;function f(){let m=GI,g,v,x;if((!t||a(c,u,p[p.length-1]||void 0))&&(m=q5(n(c,p)),m[0]===Rj))return m;if("children"in c&&c.children){const y=c;if(y.children&&m[0]!==H5)for(v=(r?y.children.length:-1)+s,x=p.concat(y);v>-1&&v<y.children.length;){const b=y.children[v];if(g=l(b,v,x)(),g[0]===Rj)return g;v=typeof g[1]=="number"?g[1]:v+s}}return m}}}function q5(e){return Array.isArray(e)?e:typeof e=="number"?[K5,e]:e==null?GI:[e]}function XI(e,t,n,r){let i,a,s;typeof t=="function"&&typeof n!="function"?(a=void 0,s=t,i=n):(a=t,s=n,i=r),V5(e,a,l,i);function l(c,u){const p=u[u.length-1],d=p?p.children.indexOf(c):void 0;return s(c,d,p)}}const _v={}.hasOwnProperty,Y5={};function G5(e,t){const n=t||Y5,r=new Map,i=new Map,a=new Map,s={...I5,...n.handlers},l={all:u,applyData:Q5,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:s,one:c,options:n,patch:X5,wrap:J5};return XI(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const d=p.type==="definition"?r:i,f=String(p.identifier).toUpperCase();d.has(f)||d.set(f,p)}}),l;function c(p,d){const f=p.type,m=l.handlers[f];if(_v.call(l.handlers,f)&&m)return m(l,p,d);if(l.options.passThrough&&l.options.passThrough.includes(f)){if("children"in p){const{children:v,...x}=p,y=ff(x);return y.children=l.all(p),y}return ff(p)}return(l.options.unknownHandler||Z5)(l,p,d)}function u(p){const d=[];if("children"in p){const f=p.children;let m=-1;for(;++m<f.length;){const g=l.one(f[m],p);if(g){if(m&&f[m-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=Dj(g.value)),!Array.isArray(g)&&g.type==="element")){const v=g.children[0];v&&v.type==="text"&&(v.value=Dj(v.value))}Array.isArray(g)?d.push(...g):d.push(g)}}}return d}}function X5(e,t){e.position&&(t.position=N6(e))}function Q5(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&a&&Object.assign(n.properties,ff(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Z5(e,t){const n=t.data||{},r="value"in t&&!(_v.call(n,"hProperties")||_v.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function J5(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
77
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
78
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
79
|
+
`}),n}function Dj(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Lj(e,t){const n=G5(e,t),r=n.one(e,void 0),i=z5(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
|
|
80
|
+
`},i),a}function eF(e,t){return e&&"run"in e?async function(n,r){const i=Lj(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Lj(n,{file:r,...e||t})}}function zj(e){if(e)throw e}var Np=Object.prototype.hasOwnProperty,QI=Object.prototype.toString,$j=Object.defineProperty,Bj=Object.getOwnPropertyDescriptor,Fj=function(t){return typeof Array.isArray=="function"?Array.isArray(t):QI.call(t)==="[object Array]"},Uj=function(t){if(!t||QI.call(t)!=="[object Object]")return!1;var n=Np.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Np.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Np.call(t,i)},Wj=function(t,n){$j&&n.name==="__proto__"?$j(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Kj=function(t,n){if(n==="__proto__")if(Np.call(t,n)){if(Bj)return Bj(t,n).value}else return;return t[n]},tF=function e(){var t,n,r,i,a,s,l=arguments[0],c=1,u=arguments.length,p=!1;for(typeof l=="boolean"&&(p=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});c<u;++c)if(t=arguments[c],t!=null)for(n in t)r=Kj(l,n),i=Kj(t,n),l!==i&&(p&&i&&(Uj(i)||(a=Fj(i)))?(a?(a=!1,s=r&&Fj(r)?r:[]):s=r&&Uj(r)?r:{},Wj(l,{name:n,newValue:e(p,s,i)})):typeof i<"u"&&Wj(l,{name:n,newValue:i}));return l};const Rg=Ll(tF);function Rv(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function nF(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);l(null,...i);function l(c,...u){const p=e[++a];let d=-1;if(c){s(c);return}for(;++d<i.length;)(u[d]===null||u[d]===void 0)&&(u[d]=i[d]);i=u,p?rF(p,l)(...u):s(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function rF(e,t){let n;return r;function r(...s){const l=e.length>s.length;let c;l&&s.push(i);try{c=e.apply(this,s)}catch(u){const p=u;if(l&&n)throw p;return i(p)}l||(c&&c.then&&typeof c.then=="function"?c.then(a,i):c instanceof Error?i(c):a(c))}function i(s,...l){n||(n=!0,t(s,...l))}function a(s){i(null,s)}}const Pi={basename:iF,dirname:aF,extname:oF,join:sF,sep:"/"};function iF(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Wu(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else s<0&&(a=!0,s=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function aF(e){if(Wu(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function oF(e){Wu(e);let t=e.length,n=-1,r=0,i=-1,a=0,s;for(;t--;){const l=e.codePointAt(t);if(l===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),l===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function sF(...e){let t=-1,n;for(;++t<e.length;)Wu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":lF(n)}function lF(e){Wu(e);const t=e.codePointAt(0)===47;let n=cF(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function cF(e,t){let n="",r=0,i=-1,a=0,s=-1,l,c;for(;++s<=e.length;){if(s<e.length)l=e.codePointAt(s);else{if(l===47)break;l=47}if(l===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),i=s,a=0;continue}}else if(n.length>0){n="",r=0,i=s,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else l===46&&a>-1?a++:a=-1}return n}function Wu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const uF={cwd:dF};function dF(){return"/"}function Dv(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function pF(e){if(typeof e=="string")e=new URL(e);else if(!Dv(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return fF(e)}function fF(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Dg=["history","path","basename","stem","extname","dirname"];class ZI{constructor(t){let n;t?Dv(t)?n={path:t}:typeof t=="string"||hF(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":uF.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Dg.length;){const a=Dg[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)Dg.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Pi.basename(this.path):void 0}set basename(t){zg(t,"basename"),Lg(t,"basename"),this.path=Pi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Pi.dirname(this.path):void 0}set dirname(t){Hj(this.basename,"dirname"),this.path=Pi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Pi.extname(this.path):void 0}set extname(t){if(Lg(t,"extname"),Hj(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Pi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Dv(t)&&(t=pF(t)),zg(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Pi.basename(this.path,this.extname):void 0}set stem(t){zg(t,"stem"),Lg(t,"stem"),this.path=Pi.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new qn(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Lg(e,t){if(e&&e.includes(Pi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Pi.sep+"`")}function zg(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Hj(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function hF(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const mF=function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a},gF={}.hasOwnProperty;class rb extends mF{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=nF()}copy(){const t=new rb;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Rg(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Fg("data",this.frozen),this.namespace[t]=n,this):gF.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Fg("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Ud(t),r=this.parser||this.Parser;return $g("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),$g("process",this.parser||this.Parser),Bg("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,s){const l=Ud(t),c=r.parse(l);r.run(c,l,function(p,d,f){if(p||!d||!f)return u(p);const m=d,g=r.stringify(m,f);xF(g)?f.value=g:f.result=g,u(p,f)});function u(p,d){p||!d?s(p):a?a(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),$g("processSync",this.parser||this.Parser),Bg("processSync",this.compiler||this.Compiler),this.process(t,i),qj("processSync","process",n),r;function i(a,s){n=!0,zj(a),r=s}}run(t,n,r){Vj(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(s,l){const c=Ud(n);i.run(t,c,u);function u(p,d,f){const m=d||t;p?l(p):s?s(m):r(void 0,m,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),qj("runSync","run",r),i;function a(s,l){zj(s),i=l,r=!0}}stringify(t,n){this.freeze();const r=Ud(n),i=this.compiler||this.Compiler;return Bg("stringify",i),Vj(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Fg("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[p,...d]=u;c(p,d)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(u.plugins),u.settings&&(i.settings=Rg(!0,i.settings,u.settings))}function l(u){let p=-1;if(u!=null)if(Array.isArray(u))for(;++p<u.length;){const d=u[p];a(d)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,p){let d=-1,f=-1;for(;++d<r.length;)if(r[d][0]===u){f=d;break}if(f===-1)r.push([u,...p]);else if(p.length>0){let[m,...g]=p;const v=r[f][1];Rv(v)&&Rv(m)&&(m=Rg(!0,v,m)),r[f]=[u,m,...g]}}}}const yF=new rb().freeze();function $g(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Bg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Fg(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Vj(e){if(!Rv(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function qj(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ud(e){return vF(e)?e:new ZI(e)}function vF(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function xF(e){return typeof e=="string"||bF(e)}function bF(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const wF="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Yj=[],Gj={allowDangerousHtml:!0},SF=/^(https?|ircs?|mailto|xmpp)$/i,jF=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Vc(e){const t=kF(e),n=CF(e);return PF(t.runSync(t.parse(n),n),e)}function kF(e){const t=e.rehypePlugins||Yj,n=e.remarkPlugins||Yj,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Gj}:Gj;return yF().use(i5).use(n).use(eF,r).use(t)}function CF(e){const t=e.children||"",n=new ZI;return typeof t=="string"&&(n.value=t),n}function PF(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,s=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||AF;for(const p of jF)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+wF+p.id,void 0);return XI(e,u),L6(e,{Fragment:o.Fragment,components:i,ignoreInvalidStyle:!0,jsx:o.jsx,jsxs:o.jsxs,passKeys:!0,passNode:!0});function u(p,d,f){if(p.type==="raw"&&f&&typeof d=="number")return s?f.children.splice(d,1):f.children[d]={type:"text",value:p.value},d;if(p.type==="element"){let m;for(m in Ng)if(Object.hasOwn(Ng,m)&&Object.hasOwn(p.properties,m)){const g=p.properties[m],v=Ng[m];(v===null||v.includes(p.tagName))&&(p.properties[m]=c(String(g||""),m,p))}}if(p.type==="element"){let m=n?!n.includes(p.tagName):a?a.includes(p.tagName):!1;if(!m&&r&&typeof d=="number"&&(m=!r(p,d,f)),m&&f&&typeof d=="number")return l&&p.children?f.children.splice(d,1,...p.children):f.children.splice(d,1),d}}}function AF(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||SF.test(e.slice(0,t))?e:""}const ae=(e,t)=>{if(!t)return e;const n=new URLSearchParams;Object.entries(t).forEach(([i,a])=>{a!=null&&a!==""&&n.set(i,String(a))});const r=n.toString();return r?`${e}?${r}`:e},oe=async(e,t={})=>{const n=localStorage.getItem("auth_token"),r=await fetch(e,{...t,headers:{"Content-Type":"application/json",...n?{"Access-Token":n}:{},...t.headers||{}}});if(!r.ok){if(r.status===401){localStorage.removeItem("auth_token");const l=await r.text(),c=new Error(l||r.statusText);throw c.status=401,c}const a=await r.text();let s=null;try{const l=JSON.parse(a);l.error&&(s=l.error)}catch{}throw new Error(s||a||r.statusText)}return r.status===204?void 0:(r.headers.get("content-type")||"").includes("application/json")?r.json():r.text()},Y={getAuthStatus:()=>oe(ae("/api/auth/status")),login:e=>oe(ae("/api/auth/login"),{method:"POST",body:JSON.stringify({authCode:e})}),checkVersion:()=>oe(ae("/api/version/check")),getVendors:()=>oe(ae("/api/vendors")),createVendor:e=>oe(ae("/api/vendors"),{method:"POST",body:JSON.stringify(e)}),updateVendor:(e,t)=>oe(ae(`/api/vendors/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteVendor:e=>oe(ae(`/api/vendors/${e}`),{method:"DELETE"}),getAPIServices:e=>oe(ae("/api/services",e?{vendorId:e}:void 0)),createAPIService:e=>oe(ae("/api/services"),{method:"POST",body:JSON.stringify(e)}),updateAPIService:(e,t)=>oe(ae(`/api/services/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteAPIService:e=>oe(ae(`/api/services/${e}`),{method:"DELETE"}),getRoutes:()=>oe(ae("/api/routes")),createRoute:e=>oe(ae("/api/routes"),{method:"POST",body:JSON.stringify(e)}),updateRoute:(e,t)=>oe(ae(`/api/routes/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteRoute:e=>oe(ae(`/api/routes/${e}`),{method:"DELETE"}),getToolBindings:()=>oe(ae("/api/tool-bindings")),activateToolRoute:(e,t)=>oe(ae("/api/tool-bindings/activate"),{method:"POST",body:JSON.stringify({tool:e,routeId:t})}),deactivateToolRoute:e=>oe(ae("/api/tool-bindings/deactivate"),{method:"POST",body:JSON.stringify({tool:e})}),getRules:e=>oe(ae("/api/rules",e?{routeId:e}:void 0)),createRule:e=>oe(ae("/api/rules"),{method:"POST",body:JSON.stringify(e)}),updateRule:(e,t)=>oe(ae(`/api/rules/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteRule:e=>oe(ae(`/api/rules/${e}`),{method:"DELETE"}),resetRuleTokens:e=>oe(ae(`/api/rules/${e}/reset-tokens`),{method:"PUT"}),resetRuleRequests:e=>oe(ae(`/api/rules/${e}/reset-requests`),{method:"PUT"}),clearRuleBlacklist:e=>oe(ae(`/api/rules/${e}/clear-blacklist`),{method:"PUT"}),toggleRuleDisable:e=>oe(ae(`/api/rules/${e}/toggle-disable`),{method:"PUT"}),clearRuleStatus:e=>oe(ae(`/api/rules/${e}/clear-status`),{method:"POST"}),getRuleStatuses:()=>oe(ae("/api/rules/status")),getRulesBlacklistStatus:e=>oe(ae(`/api/rules/${e}/blacklist-status`)),getLogs:(e,t)=>oe(ae("/api/logs",{limit:e,offset:t})),clearLogs:()=>oe(ae("/api/logs"),{method:"DELETE"}),getErrorLogs:(e,t)=>oe(ae("/api/error-logs",{limit:e,offset:t})),clearErrorLogs:()=>oe(ae("/api/error-logs"),{method:"DELETE"}),getLogsCount:()=>oe(ae("/api/logs/count")),getErrorLogsCount:()=>oe(ae("/api/error-logs/count")),searchLogs:(e,t,n)=>oe(ae("/api/logs/search",{query:e,limit:t,offset:n})),searchLogsCount:e=>oe(ae("/api/logs/search/count",{query:e})),queryLogs:async({filters:e,keyword:t,limit:n,offset:r})=>{const i=await oe(ae("/api/logs",{targetType:e==null?void 0:e.targetType,vendorId:e==null?void 0:e.vendorId,serviceId:e==null?void 0:e.serviceId,model:e==null?void 0:e.model,routeId:e==null?void 0:e.routeId,keyword:t,limit:n,offset:r}));if(!Array.isArray(i)){const l=i;return{logs:l.logs??[],total:l.total??0}}const a=i;let s=a.length;try{!!(e&&(e.targetType||e.vendorId||e.serviceId||e.model||e.routeId))||(s=(await oe(ae("/api/logs/count"))).count)}catch{}return{logs:a,total:s}},queryErrorLogs:async({filters:e,keyword:t,limit:n,offset:r})=>{const i=await oe(ae("/api/error-logs",{targetType:e==null?void 0:e.targetType,vendorId:e==null?void 0:e.vendorId,serviceId:e==null?void 0:e.serviceId,model:e==null?void 0:e.model,routeId:e==null?void 0:e.routeId,keyword:t,limit:n,offset:r}));if(!Array.isArray(i)){const l=i;return{logs:l.logs??[],total:l.total??0}}const a=i;let s=a.length;try{!!(e&&(e.targetType||e.vendorId||e.serviceId||e.model||e.routeId))||!!t||(s=(await oe(ae("/api/error-logs/count"))).count)}catch{}return{logs:a,total:s}},searchErrorLogs:(e,t,n)=>oe(ae("/api/error-logs/search",{query:e,limit:t,offset:n})),searchErrorLogsCount:e=>oe(ae("/api/error-logs/search/count",{query:e})),getStatistics:(e=30)=>oe(ae("/api/statistics",{days:e})),resetStatistics:()=>oe(ae("/api/statistics"),{method:"DELETE"}),getPerformanceServicesOverview:()=>oe(ae("/api/performance/services-overview")),getPerformanceVendors:()=>oe(ae("/api/performance/vendors")),getPerformanceVendor:e=>oe(ae(`/api/performance/vendors/${e}`)),getPerformanceService:e=>oe(ae(`/api/performance/services/${e}`)),getPerformanceModel:(e,t)=>oe(ae(`/api/performance/services/${e}/models/${encodeURIComponent(t)}`)),getConfig:()=>oe(ae("/api/config")),updateConfig:e=>oe(ae("/api/config"),{method:"PUT",body:JSON.stringify(e)}),exportData:async e=>(await oe(ae("/api/export"),{method:"POST",body:JSON.stringify({password:e})})).data,previewImportData:(e,t)=>oe(ae("/api/import/preview"),{method:"POST",body:JSON.stringify({encryptedData:e,password:t})}),importData:(e,t)=>oe(ae("/api/import"),{method:"POST",body:JSON.stringify({encryptedData:e,password:t})}),writeClaudeConfig:(e,t,n)=>oe(ae("/api/write-config/claude"),{method:"POST",body:JSON.stringify({enableAgentTeams:e,enableBypassPermissionsSupport:t,permissionsDefaultMode:n})}),writeCodexConfig:(e,t)=>oe(ae("/api/write-config/codex"),{method:"POST",body:JSON.stringify({modelReasoningEffort:e,enableMemories:t})}),restoreClaudeConfig:()=>oe(ae("/api/restore-config/claude"),{method:"POST"}),restoreCodexConfig:()=>oe(ae("/api/restore-config/codex"),{method:"POST"}),updateClaudeAgentTeams:e=>oe(ae("/api/update-claude-agent-teams"),{method:"POST",body:JSON.stringify({enableAgentTeams:e})}),updateClaudeBypassPermissionsSupport:e=>oe(ae("/api/update-claude-bypass-permissions-support"),{method:"POST",body:JSON.stringify({enableBypassPermissionsSupport:e})}),updateCodexReasoningEffort:e=>oe(ae("/api/update-codex-reasoning-effort"),{method:"POST",body:JSON.stringify({modelReasoningEffort:e})}),checkClaudeBackup:()=>oe(ae("/api/check-backup/claude")),checkCodexBackup:()=>oe(ae("/api/check-backup/codex")),getClaudeConfigStatus:()=>oe(ae("/api/config-status/claude")),getCodexConfigStatus:()=>oe(ae("/api/config-status/codex")),getSessions:async({filters:e,keyword:t,limit:n,offset:r}={})=>{const i=await oe(ae("/api/sessions",{targetType:e==null?void 0:e.targetType,vendorId:e==null?void 0:e.vendorId,serviceId:e==null?void 0:e.serviceId,model:e==null?void 0:e.model,routeId:e==null?void 0:e.routeId,keyword:t,limit:n,offset:r}));if(!Array.isArray(i)){const l=i;return{sessions:l.sessions??[],total:l.total??0}}const a=i;let s=a.length;try{!!(e&&(e.targetType||e.vendorId||e.serviceId||e.model||e.routeId))||!!t||(s=(await oe(ae("/api/sessions/count"))).count)}catch{}return{sessions:a,total:s}},getSessionsCount:()=>oe(ae("/api/sessions/count")),getSession:e=>oe(ae(`/api/sessions/${e}`)),getSessionLogs:(e,t)=>oe(ae(`/api/sessions/${e}/logs`,{limit:t})),deleteSession:e=>oe(ae(`/api/sessions/${e}`),{method:"DELETE"}),clearSessions:()=>oe(ae("/api/sessions"),{method:"DELETE"}),cleanupSessions:(e,t)=>oe(ae("/api/sessions/cleanup"),{method:"POST",body:JSON.stringify({beforeDays:e,onlyLogs:t})}),getRecommendVendorsMarkdown:()=>oe(ae("/api/docs/recommend-vendors")),getReadmeMarkdown:()=>oe(ae("/api/docs/readme")),getInstalledSkills:()=>oe(ae("/api/skills/installed")),searchSkills:e=>oe(ae("/api/skills/search"),{method:"POST",body:JSON.stringify({query:e})}),getSkillDetails:e=>oe(ae(`/api/skills/${e}/details`)),installSkill:(e,t)=>oe(ae("/api/skills/install"),{method:"POST",body:JSON.stringify({skillId:e.id,name:e.name,description:e.description,tags:e.tags,...t?{targetType:t}:{},githubUrl:e.url})}),enableSkill:(e,t)=>oe(ae(`/api/skills/${e}/enable`),{method:"POST",body:JSON.stringify({targetType:t})}),disableSkill:(e,t)=>oe(ae(`/api/skills/${e}/disable`),{method:"POST",body:JSON.stringify({targetType:t})}),deleteSkill:e=>oe(ae(`/api/skills/${e}`),{method:"DELETE"}),createLocalSkill:e=>oe(ae("/api/skills/create-local"),{method:"POST",body:JSON.stringify(e)}),getUpgradeMarkdown:()=>oe(ae("/api/docs/upgrade")),getUpgrade:()=>oe(ae("/api/upgrade")),acknowledgeUpgrade:()=>oe(ae("/api/upgrade/ack"),{method:"POST"}),getMCPs:()=>oe(ae("/api/mcps")),getMCP:e=>oe(ae(`/api/mcps/${e}`)),createMCP:e=>oe(ae("/api/mcps"),{method:"POST",body:JSON.stringify(e)}),updateMCP:(e,t)=>oe(ae(`/api/mcps/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteMCP:e=>oe(ae(`/api/mcps/${e}`),{method:"DELETE"}),bindSessionRoute:(e,t)=>oe(ae(`/api/sessions/${e}/bind-route`),{method:"PUT",body:JSON.stringify({routeId:t})}),unbindSessionRoute:e=>oe(ae(`/api/sessions/${e}/bind-route`),{method:"DELETE"}),getBoundSessions:e=>oe(ae(`/api/routes/${e}/bound-sessions`)),migrationPreview:(e,t)=>oe(ae(`/api/sessions/${e}/migration-preview`),{method:"POST",body:JSON.stringify(t)}),migrateSession:(e,t)=>oe(ae(`/api/sessions/${e}/migrate`),{method:"POST",body:JSON.stringify(t)}),migrateLaunch:(e,t)=>oe(ae(`/api/sessions/${e}/migrate-launch`),{method:"POST",body:JSON.stringify(t)}),getApiPathBindings:()=>oe(ae("/api/api-path-bindings")),updateApiPathBindings:(e,t)=>oe(ae("/api/api-path-bindings"),{method:"PUT",body:JSON.stringify({bindings:e,models:t})}),getAccessKeys:e=>oe(ae("/api/access-keys",e)),createAccessKey:e=>oe(ae("/api/access-keys"),{method:"POST",body:JSON.stringify(e)}),getAccessKey:e=>oe(ae(`/api/access-keys/${e}`)),updateAccessKey:(e,t)=>oe(ae(`/api/access-keys/${e}`),{method:"PUT",body:JSON.stringify(t)}),deleteAccessKey:e=>oe(ae(`/api/access-keys/${e}`),{method:"DELETE"}),regenerateAccessKey:e=>oe(ae(`/api/access-keys/${e}/regenerate`),{method:"POST"}),batchUpdateAccessKeyStatus:(e,t)=>oe(ae("/api/access-keys/batch/status"),{method:"PUT",body:JSON.stringify({keyIds:e,status:t})}),batchBindAccessKeyPolicy:(e,t)=>oe(ae("/api/access-keys/batch/policy"),{method:"PUT",body:JSON.stringify({keyIds:e,policyId:t})}),batchDeleteAccessKeys:e=>oe(ae("/api/access-keys/batch"),{method:"DELETE",body:JSON.stringify({keyIds:e})}),getAccessKeyUsage:e=>oe(ae(`/api/access-keys/${e}/usage`)),getAccessKeyUsageTrend:(e,t)=>oe(ae(`/api/access-keys/${e}/usage/trend`,{days:t})),getAccessKeyLogs:(e,t)=>oe(ae(`/api/access-keys/${e}/logs`,t)),getAccessKeySessions:(e,t)=>oe(ae(`/api/access-keys/${e}/sessions`,t)),getAccessKeySession:(e,t)=>oe(ae(`/api/access-keys/${e}/sessions/${t}`)),getAccessKeySessionLogs:(e,t,n)=>oe(ae(`/api/access-keys/${e}/sessions/${t}/logs`,{limit:n})),deleteAccessKeySession:(e,t)=>oe(ae(`/api/access-keys/${e}/sessions/${t}`),{method:"DELETE"}),clearAccessKeySessions:e=>oe(ae(`/api/access-keys/${e}/sessions`),{method:"DELETE"}),getAccessKeyGuide:(e,t,n)=>oe(ae(`/api/access-keys/${e}/guide`,{host:t,port:n})),writeAccessKeyToLocal:(e,t)=>oe(ae(`/api/access-keys/${e}/write-local`),{method:"POST",body:JSON.stringify({targets:t})}),getWriteLocalRecords:()=>oe(ae("/api/write-local-records")),getPolicies:()=>oe(ae("/api/policies")),createPolicy:e=>oe(ae("/api/policies"),{method:"POST",body:JSON.stringify(e)}),getPolicy:e=>oe(ae(`/api/policies/${e}`)),updatePolicy:(e,t)=>oe(ae(`/api/policies/${e}`),{method:"PUT",body:JSON.stringify(t)}),deletePolicy:e=>oe(ae(`/api/policies/${e}`),{method:"DELETE"}),duplicatePolicy:e=>oe(ae(`/api/policies/${e}/duplicate`),{method:"POST"}),getPolicyKeys:e=>oe(ae(`/api/policies/${e}/keys`)),getPolicyTemplates:()=>oe(ae("/api/policies/templates")),getAccessKeyRanking:e=>oe(ae("/api/statistics/access-keys",e)),getQuotaAlerts:()=>oe(ae("/api/statistics/quota-alerts")),lanScan:()=>oe(ae("/api/lan/scan")),lanDiscover:(e,t)=>{const n=`http://${e}:${t}/api/lan/discover`;return fetch(n,{signal:AbortSignal.timeout(3e3)}).then(r=>{if(!r.ok)throw new Error(`HTTP ${r.status}`);return r.json()})},lanSync:e=>oe(ae("/api/lan/sync"),{method:"POST",body:JSON.stringify(e)}),getAgentMapSessions:()=>oe(ae("/api/agent-map/sessions")),getAgentMapSessionEvents:(e,t)=>oe(ae(`/api/agent-map/sessions/${e}/events`,t!=null?{since:t}:void 0)),getAgentMapStats:()=>oe(ae("/api/agent-map/stats")),getAgentMapSessionMeta:e=>oe(ae(`/api/agent-map/sessions/${e}/meta`)),getAgentMapNotify:()=>oe(ae("/api/agent-map/notify")),setAgentMapNotify:e=>oe(ae("/api/agent-map/notify"),{method:"POST",body:JSON.stringify({enabled:e})}),setAgentMapNotifyFocus:e=>oe(ae("/api/agent-map/notify-focus"),{method:"POST",body:JSON.stringify({hidden:e})}),testAgentMapNotify:()=>oe(ae("/api/agent-map/notify-test"),{method:"POST"}),streamAgentMap:e=>{const t=new AbortController,n=localStorage.getItem("auth_token");let r=!1,i=0;const a=async()=>{var p,d,f,m;const s=await fetch("/api/agent-map/stream",{method:"GET",signal:t.signal,headers:{Accept:"text/event-stream",...n?{"Access-Token":n}:{}}});if(!s.ok||!s.body)throw new Error(`HTTP ${s.status}`);const l=s.body.getReader(),c=new TextDecoder;let u="";for(;;){const{value:g,done:v}=await l.read();if(v)break;u+=c.decode(g,{stream:!0});let x;for(;(x=u.indexOf(`
|
|
81
|
+
|
|
82
|
+
`))!==-1;){const y=u.slice(0,x);u=u.slice(x+2);const b=y.split(`
|
|
83
|
+
`).find(k=>k.startsWith("data:"));if(!b)continue;const w=b.slice(5).trim();if(!w)continue;let S;try{S=JSON.parse(w)}catch{continue}switch(S.type){case"init":(p=e.onInit)==null||p.call(e,{type:"init",sessions:S.sessions||[],events:S.events||[],stats:S.stats,serverTime:S.serverTime});break;case"session-update":(d=e.onSessionUpdate)==null||d.call(e,S.session);break;case"activity":(f=e.onActivity)==null||f.call(e,S.event);break;case"stats":(m=e.onStats)==null||m.call(e,S.stats);break}}}};return(async()=>{var s;for(;!r;){try{await a(),i=0}catch(c){if((c==null?void 0:c.name)==="AbortError")return;(s=e.onError)==null||s.call(e,c)}if(r)break;i=Math.min(i+1,5);const l=Math.min(1e3*2**(i-1),15e3);await new Promise(c=>setTimeout(c,l))}})(),{abort:()=>{r=!0,t.abort()}}}};var dt=(e=>(e.AUTH_TOKEN="authorization",e.API_KEY="x-api-key",e.G_API_KEY="x-goog-api-key",e))(dt||{});const Fn={aicodingbus:{name:"AICodingBus",description:"AICodingBus 是一个Token共享平台,用户可以在平台上分享和交换Token。",tags:["官方推荐"],link:"https://aicodingbus.24x7.to/",apiBaseUrl:"https://aicodingbus.24x7.to",authType:dt.AUTH_TOKEN,services:[{name:"Claude 标准接口",sourceType:"claude",apiUrl:"https://aicodingbus.24x7.to",models:""},{name:"Chat Completions 标准接口",sourceType:"openai-chat",apiUrl:"https://aicodingbus.24x7.to/v1/chat/completions",models:""},{name:"Responses 标准接口",sourceType:"openai",apiUrl:"https://aicodingbus.24x7.to",models:""}],sortedGroup:-1},minimax:{name:"Minimax",description:"国内优秀的大模型",link:"https://platform.minimaxi.com/subscribe/coding-plan?code=G6xKj7L4YN&source=link",authType:dt.AUTH_TOKEN,services:[{name:"Claude 标准接口 | Coding Plan",sourceType:"claude",apiUrl:"https://api.minimaxi.com/anthropic",models:"MiniMax-M2.5, MiniMax-M2.7"},{name:"Chat Completions 标准接口(支持Coding Plan的API Key)",sourceType:"openai-chat",apiUrl:"https://api.minimaxi.com/v1/chat/completions",models:"MiniMax-M2.5, MiniMax-M2.7"}]},glm:{name:"GLM",description:"国内优秀的大模型",link:"https://www.bigmodel.cn/invite?icode=kgOTGFRH%2Ftc5Xkyu5N0wHOnfet45IvM%2BqDogImfeLyI%3D",authType:dt.AUTH_TOKEN,services:[{name:"Claude 标准接口 | Coding Plan",sourceType:"claude",apiUrl:"https://open.bigmodel.cn/api/anthropic",models:"glm-5.1, glm-5, glm-4.7, glm-4.5-air",modelLimits:{"glm-5.1":131072,"glm-5":131072,"glm-4.7":131072,"glm-4.5-air":98304}},{name:"Chat Completions 标准接口 | Coding Plan",sourceType:"openai-chat",apiUrl:"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",models:"glm-5.1, glm-5, glm-4.7, glm-4.5-air",modelLimits:{"glm-5.1":131072,"glm-5":131072,"glm-4.7":131072,"glm-4.5-air":98304}}]},kimi:{name:"Kimi",description:"国内优秀大模型",link:"https://www.kimi.ai/",authType:dt.AUTH_TOKEN,services:[{name:"Claude 标准接口 | Coding Plan",sourceType:"claude",apiUrl:"https://api.kimi.com/coding"},{name:"Chat Completions 标准接口 | Coding Plan",sourceType:"openai-chat",apiUrl:"https://api.kimi.com/coding/v1/chat/completions",models:"kimi-for-coding",modelLimits:{"kimi-for-coding":32768}}]},doubao:{name:"火山方舟(豆包)",description:"字节旗下大模型平台。Coding Plan一次性支持GLM、Kimi-K2、Deepseek多个国产模型 邀请码:Y58X463P",link:"https://volcengine.com/L/RcHlm6yxj0w/",authType:dt.AUTH_TOKEN,services:[{name:"Claude 标准接口 | Coding Plan",sourceType:"claude",apiUrl:"https://ark.cn-beijing.volces.com/api/coding",models:"ark-code-latest"},{name:"Responses 标准接口 | Coding Plan",sourceType:"openai",apiUrl:"https://ark.cn-beijing.volces.com/api/coding/v3",models:"ark-code-latest"},{name:"Claude 标准接口(付费API)",sourceType:"claude",apiUrl:"https://ark.cn-beijing.volces.com/api/compatible",models:"doubao-seed-2-0-code-preview-260215, doubao-seed-code-preview-251028"},{name:"Responses 标准接口(付费API)",sourceType:"openai",apiUrl:"https://ark.cn-beijing.volces.com/api/v3",models:"doubao-seed-2-0-code-preview-260215, doubao-seed-code-preview-251028"},{name:"Chat Completions 标准接口(付费API)",sourceType:"openai-chat",apiUrl:"https://ark.cn-beijing.volces.com/api/v3/chat/completions",models:"doubao-seed-2-0-code-preview-260215, doubao-seed-code-preview-251028"}]},qwen:{name:"阿里云百炼(千问)",description:"国内优秀大模型",link:"https://help.aliyun.com/zh/model-studio/coding-plan",authType:dt.AUTH_TOKEN,services:[{name:"Claude 标准接口 | Coding Plan",sourceType:"claude",apiUrl:"https://coding.dashscope.aliyuncs.com/apps/anthropic",models:"qwen3-max-2026-01-23, qwen3-coder-plus"},{name:"Responses 标准接口 | Coding Plan",sourceType:"openai-chat",apiUrl:"https://coding.dashscope.aliyuncs.com/v1",models:"qwen3-max-2026-01-23, qwen3-coder-plus"},{name:"Responses 标准接口(付费API)",sourceType:"openai",apiUrl:"https://dashscope.aliyuncs.com/api/v2/apps/protocols/compatible-mode/v1",models:"qwen3-max-2026-01-23, qwen3-coder-plus, kimi-k2.5, glm-4.7, MiniMax-M2.1"},{name:"Claude 标准接口(付费API)",sourceType:"claude",apiUrl:"https://dashscope.aliyuncs.com/apps/anthropic",models:"qwen3-max-2026-01-23, qwen3-coder-plus, kimi-k2.5, glm-4.7, MiniMax-M2.1"}]},deepseek:{name:"DeepSeek",description:"DeepSeek 官方 API",link:"https://platform.deepseek.com",authType:dt.AUTH_TOKEN,services:[{name:"Claude 标准接口(付费API)",sourceType:"claude",apiUrl:"https://api.deepseek.com/anthropic",models:"deepseek-v4-flash, deepseek-v4-pro"},{name:"DeepSeek Reasoning Chat 接口(付费API)",sourceType:"openai-chat",apiUrl:"https://api.deepseek.com/v1/chat/completions",models:"deepseek-v4-flash, deepseek-v4-pro"}]},mimo:{name:"Mimo",description:"小米 Mimo 国产大模型",link:"https://platform.xiaomimimo.com?ref=M8BFP3",authType:dt.AUTH_TOKEN,services:[{name:"Claude 标准接口 | Coding Plan",sourceType:"claude",apiUrl:"https://token-plan-cn.xiaomimimo.com/anthropic",models:"mimo-v2.5-pro, mimo-v2-pro, mimo-v2.5, mimo-v2-omni, mimo-v2-flash"},{name:"Chat Completions 标准接口 | Coding Plan",sourceType:"openai-chat",apiUrl:"https://token-plan-cn.xiaomimimo.com/v1/chat/completions",models:"mimo-v2.5-pro, mimo-v2-pro, mimo-v2.5, mimo-v2-omni, mimo-v2-flash"},{name:"Chat Completions 标准接口(付费API)",sourceType:"openai-chat",apiUrl:"https://api.xiaomimimo.com/v1/chat/completions",models:"mimo-v2.5-pro, mimo-v2-pro, mimo-v2.5, mimo-v2-omni, mimo-v2-flash"},{name:"Claude 标准接口(付费API)",sourceType:"claude",apiUrl:"https://api.xiaomimimo.com/anthropic",models:"mimo-v2.5-pro, mimo-v2-pro, mimo-v2.5, mimo-v2-omni, mimo-v2-flash"}]},openai:{name:"OpenAI",description:"OpenAI 官方 API",link:"https://platform.openai.com",authType:dt.AUTH_TOKEN,services:[{name:"GPT官方接口",sourceType:"openai",apiUrl:"https://api.openai.com"}],sortedGroup:3},anthropic:{name:"Anthropic",description:"Anthropic 官方 API",link:"https://www.anthropic.com",authType:dt.API_KEY,services:[{name:"Claude官方接口",sourceType:"claude",apiUrl:"https://api.anthropic.com"}],sortedGroup:3},google:{name:"Google AI",description:"Gemini官方接口",authType:dt.G_API_KEY,services:[{name:"Gemini",sourceType:"gemini",apiUrl:"https://generativelanguage.googleapis.com"}],sortedGroup:3},openrouter:{name:"OpenRouter",description:"一站式 AI 模型路由平台",link:"https://openrouter.ai",authType:dt.AUTH_TOKEN,apiBaseUrl:"https://openrouter.ai/api",services:[{name:"Claude Code专属接口",sourceType:"claude",apiUrl:"https://openrouter.ai/api",models:"anthropic/claude-fable-5, anthropic/claude-opus-4.8, anthropic/claude-opus-4.6, anthropic/claude-opus-4.5, anthropic/claude-sonnet-4.6, anthropic/claude-sonnet-4.5, anthropic/claude-haiku-4.5"},{name:"Responses 标准接口 (Beta)",sourceType:"openai",apiUrl:"https://openrouter.ai/api/v1",models:"openai/gpt-5.3-codex, openai/gpt-5.4, openai/gpt-5.5, openai/gpt-5.4-mini"},{name:"Chat Completions 标准接口",sourceType:"openai-chat",apiUrl:"https://openrouter.ai/api/v1/chat/completions",models:"openai/gpt-5.5, openai/gpt-5.4, openai/gpt-5.4-mini, openai/gpt-5.3-codex, google/gemini-3-flash-preview, google/gemini-3-pro-preview"},{name:"Claude 标准接口",sourceType:"claude",apiUrl:"https://openrouter.ai/api",models:"anthropic/claude-fable-5, anthropic/claude-opus-4.8, anthropic/claude-opus-4.6, anthropic/claude-sonnet-4.6, anthropic/claude-haiku-4.6",authType:dt.AUTH_TOKEN}],sortedGroup:3},agnes:{name:"Agnes",description:"优秀的模型厂商,拥有多种模型,提供免费 API 使用",tags:["永久免费"],link:"https://platform.agnes-ai.com",authType:dt.AUTH_TOKEN,services:[{name:"Chat Completions 标准接口(免费)",sourceType:"openai-chat",apiUrl:"https://apihub.agnes-ai.com/v1/chat/completions",models:"agnes-2.0-flash",authType:dt.AUTH_TOKEN}],sortedGroup:-1}},Cl={"claude-code":"Claude Code",codex:"Codex"},Wd={claude:"Claude","claude-chat":"Claude Chat",openai:"OpenAI","openai-chat":"OpenAI Chat",gemini:"Gemini","gemini-chat":"Gemini Chat"},EF={"openai-chat":"填写完整的接口地址,如:https://api.openai.com/v1/chat/completions",openai:"填写接口Base URL地址,如:https://api.openai.com,(注,有的服务商需要带/v1)","claude-chat":"填写完整的接口地址,如:https://api.anthropic.com/v1/messages",claude:"只填写 base 地址,如:https://api.anthropic.com",gemini:"只填写 base 地址,如:https://generativelanguage.googleapis.com","gemini-chat":"填写完整的接口地址,如:https://generativelanguage.googleapis.com/v1beta/models/{modelName}:{endPoint} 注意,{modelName}和{endPoint}会在实际运行时被替换,你只需要按此处的格式填写即可"},Kd={[dt.AUTH_TOKEN]:"AUTH_TOKEN",[dt.API_KEY]:"API_KEY",[dt.G_API_KEY]:"GOOGLE_API_KEY"},Ug={[dt.AUTH_TOKEN]:"使用 Authorization: Bearer <token> 进行认证",[dt.API_KEY]:"使用 x-api-key: <token> 进行认证",[dt.G_API_KEY]:"使用 x-goog-api-key: <token> 进行认证"},TF=`#### 🚀 智谱 GLM Coding Plan
|
|
84
|
+
|
|
85
|
+
> 价格便宜,国内速度快,支持多工具(Claude Code等 20+ 大编程工具),而且其中的GLM-4.7是目前国内最强编程模型。适合对模型有一定要求,同时又无法获取国外模型的朋友入手。
|
|
86
|
+
>
|
|
87
|
+
> 链接:[https://www.bigmodel.cn](https://www.bigmodel.cn/invite?icode=kgOTGFRH%2Ftc5Xkyu5N0wHOnfet45IvM%2BqDogImfeLyI%3D) | [一键配置](# "glm")
|
|
88
|
+
|
|
89
|
+
#### 🌌 MiniMax Coding Plan
|
|
90
|
+
|
|
91
|
+
> 国内优秀的大模型,支持Claude Code和Codex等编程工具,其中 M2.1 模型在大模型评测中获得非常高的分数。可作为国内大模型的备选方案。
|
|
92
|
+
> 链接:[https://platform.minimaxi.com/subscribe/coding-plan](https://platform.minimaxi.com/subscribe/coding-plan?code=G6xKj7L4YN&source=link) | [一键配置](# "minimax")
|
|
93
|
+
|
|
94
|
+
#### 🧠 Mimo Coding Plan
|
|
95
|
+
|
|
96
|
+
> 小米旗下 Mimo 国产大模型,支持 Claude Code 和 Codex 等编程工具,提供 Coding Plan 和付费 API 两种模式,涵盖 mimo-v2.5-pro、mimo-v2-pro、mimo-v2.5、mimo-v2-omni、mimo-v2-flash 等多个模型,性价比出色。
|
|
97
|
+
> 链接:[https://platform.xiaomimimo.com](https://platform.xiaomimimo.com?ref=M8BFP3) | [一键配置](# "mimo")
|
|
98
|
+
`;function JI(e,t){let n,r;const i=a=>a.replace(/!\[.*?\]\(.*?\)/g,s=>{var c;const l=(c=s.match(/\((.*?)\)/))==null?void 0:c[1];if((l==null?void 0:l.indexOf("public/"))===0){const u=l.replace("public/","/");return s.replace(l,u)}else return s});return function(){const[a,s]=h.useState(i(e));return h.useEffect(()=>{if(r){s(i(r));return}const l=c=>{c&&(r=c,s(i(c)))};n?n.then(l).catch(()=>{}):n=t().then(l).catch(()=>{})},[]),a}}const IF=JI(TF,Y.getRecommendVendorsMarkdown),OF=JI("",Y.getUpgradeMarkdown),eO=h.createContext(void 0);function Ku(){const e=h.useContext(eO);if(!e)throw new Error("useConfirm must be used within ConfirmProvider");return e}let So=null;function NF({children:e}){const[t,n]=h.useState(!1),[r,i]=h.useState({message:""}),a=p=>(i(p),n(!0),new Promise(d=>{So=d})),s=()=>{n(!1),So&&(So(!0),So=null)},l=()=>{n(!1),So&&(So(!1),So=null)},u=(()=>{switch(r.type){case"danger":return{icon:"⚠️",iconColor:"#dc3545",buttonClass:"btn-danger"};case"warning":return{icon:"⚠",iconColor:"#ffc107",buttonClass:"btn-warning"};default:return{icon:"ℹ️",iconColor:"#17a2b8",buttonClass:"btn-primary"}}})();return o.jsxs(eO.Provider,{value:{confirm:a},children:[e,t&&o.jsx("div",{className:"modal-overlay",style:{zIndex:1e6},children:o.jsx("div",{className:"modal",style:{maxWidth:"500px"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:r.title||"确认操作"})}),o.jsx("div",{style:{padding:"20px"},children:o.jsxs("div",{style:{display:"flex",gap:"15px",alignItems:"flex-start"},children:[o.jsx("span",{style:{fontSize:"32px",flexShrink:0},children:u.icon}),o.jsx("div",{style:{flex:1,whiteSpace:"pre-wrap",lineHeight:"1.6"},children:r.message})]})}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-secondary",onClick:l,children:r.cancelText||"取消"}),o.jsx("button",{className:`btn ${u.buttonClass}`,onClick:s,children:r.confirmText||"确认"})]})]})})})]})}let MF=0;const Lv=new Set;let hf=[];function tO(){Lv.forEach(e=>e([...hf]))}function Hd(e,t,n=3e3){const r=++MF,i={id:r,message:e,type:t,duration:n};return hf.push(i),tO(),n>0&&setTimeout(()=>{nO(r)},n),r}function nO(e){hf=hf.filter(t=>t.id!==e),tO()}const K={success(e,t){Hd(e,"success",t)},error(e,t){Hd(e,"error",t)},warning(e,t){Hd(e,"warning",t)},info(e,t){Hd(e,"info",t)}};function _F(){const[e,t]=h.useState([]);h.useEffect(()=>(Lv.add(t),()=>{Lv.delete(t)}),[]);const n=i=>({...{padding:"12px 20px",borderRadius:"8px",marginBottom:"10px",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.1)",display:"flex",alignItems:"center",gap:"10px",minWidth:"300px",maxWidth:"500px",animation:"slideIn 0.2s ease-out"},...{success:{backgroundColor:"#d4edda",color:"#155724",border:"1px solid #c3e6cb"},error:{backgroundColor:"#f8d7da",color:"#721c24",border:"1px solid #f5c6cb"},warning:{backgroundColor:"#fff3cd",color:"#856404",border:"1px solid #ffeaa7"},info:{backgroundColor:"#d1ecf1",color:"#0c5460",border:"1px solid #bee5eb"}}[i]}),r=i=>({success:"✓",error:"✕",warning:"⚠",info:"ℹ"})[i];return o.jsxs(o.Fragment,{children:[o.jsx("style",{children:`
|
|
99
|
+
@keyframes slideIn {
|
|
100
|
+
from {
|
|
101
|
+
transform: translateX(50px);
|
|
102
|
+
opacity: 0;
|
|
103
|
+
}
|
|
104
|
+
to {
|
|
105
|
+
transform: translateX(0);
|
|
106
|
+
opacity: 1;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
`}),o.jsx("div",{style:{position:"fixed",top:"20px",right:"20px",zIndex:1000001},children:e.map(i=>o.jsxs("div",{style:n(i.type),children:[o.jsx("span",{style:{fontSize:"18px",fontWeight:"bold"},children:r(i.type)}),o.jsx("span",{style:{flex:1},children:i.message}),o.jsx("button",{onClick:()=>nO(i.id),style:{background:"none",border:"none",color:"inherit",cursor:"pointer",fontSize:"18px",padding:"0",marginLeft:"10px",opacity:.6},onMouseEnter:a=>a.currentTarget.style.opacity="1",onMouseLeave:a=>a.currentTarget.style.opacity="0.6",children:"×"})]},i.id))})]})}function rO({value:e,onChange:t,existingVendors:n=[],disabled:r=!1}){const[i,a]=h.useState(!1),s=h.useRef(null);h.useEffect(()=>{if(!i)return;const u=p=>{s.current&&!s.current.contains(p.target)&&a(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[i]);const l=h.useMemo(()=>{const u=Object.entries(Fn).map(([f,m])=>({key:f,name:m.name,sortedGroup:m.sortedGroup??0}));u.sort((f,m)=>f.sortedGroup-m.sortedGroup);const p=[];let d=null;for(const f of u)d!==null&&f.sortedGroup!==d&&p.push(null),p.push(f),d=f.sortedGroup;return p},[]),c=e?Fn[e]:null;return o.jsxs("div",{ref:s,style:{position:"relative"},children:[o.jsxs("div",{onClick:()=>!r&&a(!i),style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 14px",border:`1px solid ${i?"var(--accent-primary)":"var(--border-primary)"}`,borderRadius:"8px",background:"var(--input-bg, var(--bg-primary))",cursor:r?"not-allowed":"pointer",opacity:r?.6:1,transition:"border-color 0.2s",userSelect:"none"},children:[c?o.jsx("span",{style:{fontSize:"14px",color:"var(--text-primary)"},children:c.name}):o.jsx("span",{style:{fontSize:"14px",color:"var(--text-muted)"},children:"请选择供应商"}),o.jsx("span",{style:{fontSize:"12px",color:"var(--text-muted)",transform:i?"rotate(180deg)":"rotate(0)",transition:"transform 0.2s"},children:"▼"})]}),i&&o.jsx("div",{style:{position:"absolute",top:"100%",left:0,right:0,zIndex:999,marginTop:"4px",maxHeight:"320px",overflowY:"auto",background:"var(--bg-primary)",border:"1px solid var(--border-primary)",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0,0,0,0.15)"},children:l.map((u,p)=>{var g;if(!u)return o.jsx("div",{style:{height:"1px",background:"var(--border-primary)"}},`sep-${p}`);const d=Fn[u.key],f=n.some(v=>v.name===u.name),m=e===u.key;return o.jsxs("div",{onClick:()=>{t(u.key),a(!1)},style:{display:"flex",alignItems:"center",gap:"12px",padding:"10px 14px",cursor:"pointer",background:m?"var(--accent-light)":f?"rgba(255, 167, 38, 0.08)":"rgba(76, 175, 80, 0.08)",borderLeft:m?"3px solid var(--accent-primary)":"3px solid transparent",transition:"background 0.15s"},onMouseEnter:v=>{m||(v.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:v=>{m||(v.currentTarget.style.background=f?"rgba(255, 167, 38, 0.08)":"rgba(76, 175, 80, 0.08)")},children:[o.jsxs("div",{style:{flex:1,minWidth:0},children:[o.jsxs("div",{style:{fontSize:"14px",fontWeight:m?600:400,color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[u.name,(g=d==null?void 0:d.tags)==null?void 0:g.map((v,x)=>o.jsx("span",{style:{fontSize:"11px",marginLeft:"6px",padding:"1px 6px",borderRadius:"8px",background:"rgba(229, 57, 53, 0.1)",color:"#e53935",fontWeight:500,verticalAlign:"middle"},children:v},x))]}),(d==null?void 0:d.description)&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.description})]}),o.jsx("span",{style:{fontSize:"11px",padding:"2px 8px",borderRadius:"10px",fontWeight:500,whiteSpace:"nowrap",background:f?"rgba(255, 167, 38, 0.15)":"rgba(76, 175, 80, 0.15)",color:f?"#e67e22":"#4caf50"},children:f?"已配置":"可用"})]},u.key)})})]})}function Xj(e){const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0"),i=String(e.getHours()).padStart(2,"0"),a=String(e.getMinutes()).padStart(2,"0");return`${t}-${n}-${r}T${i}:${a}`}function RF({value:e=[],onChange:t,placeholder:n,inputValue:r,onInputChange:i}){const a=l=>{if(l.key==="Enter"||l.key===","){l.preventDefault();const c=r.trim();c&&!e.includes(c)&&(t([...e,c]),i(""))}else l.key==="Backspace"&&!r&&e.length>0&&t(e.slice(0,-1))},s=l=>{t(e.filter((c,u)=>u!==l))};return o.jsx("div",{style:{border:"1px solid var(--border-primary)",borderRadius:"4px",padding:"8px",minHeight:"40px",background:"var(--bg-secondary)"},children:o.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",alignItems:"center"},children:[e.map((l,c)=>o.jsxs("span",{style:{backgroundColor:"var(--accent-light)",color:"var(--text-primary)",padding:"4px 8px",borderRadius:"4px",fontSize:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[l,o.jsx("button",{type:"button",onClick:()=>s(c),style:{background:"none",border:"none",color:"var(--text-primary)",cursor:"pointer",fontSize:"16px",lineHeight:"1",padding:"0",marginLeft:"4px"},onMouseOver:u=>u.currentTarget.style.color="var(--accent-danger)",onMouseOut:u=>u.currentTarget.style.color="var(--text-primary)",children:"×"})]},c)),o.jsx("input",{type:"text",value:r,onChange:l=>i(l.target.value),onKeyDown:a,placeholder:n,style:{border:"none",outline:"none",flex:"1",minWidth:"120px",fontSize:"14px"}})]})})}function DF(){var L,ge;const{confirm:e}=Ku(),t=h.useRef(null),[n,r]=h.useState([]),[i,a]=h.useState(null),[s,l]=h.useState(!1),[c,u]=h.useState(!1),[p,d]=h.useState(!1),[f,m]=h.useState(!1),[g,v]=h.useState(null),[x,y]=h.useState(null),[b,w]=h.useState([]),[S,k]=h.useState(""),[j,A]=h.useState({}),[E,D]=h.useState(!1),[O,_]=h.useState(void 0),[R,X]=h.useState(void 0),[V,I]=h.useState(void 0),[$,H]=h.useState(!1),[N,U]=h.useState(void 0),[P,W]=h.useState(void 0),[se,T]=h.useState(void 0),[he,ye]=h.useState("openai-chat"),[Z,le]=h.useState(!1),[Se,Q]=h.useState(dt.AUTH_TOKEN),[ne,pe]=h.useState(""),[ie,_e]=h.useState(!0),[ke,te]=h.useState(!0),[De,Ve]=h.useState(!0),Le=F=>{if(ye(F),De)return;let de;F==="gemini"||F==="gemini-chat"?de=dt.G_API_KEY:F==="claude-chat"||F==="claude"?de=dt.API_KEY:de=dt.AUTH_TOKEN,Q(de),t.current&&(t.current.value=de)},[We,pt]=h.useState(""),[qe,Xe]=h.useState([]),[Qe,et]=h.useState(""),J=IF();h.useEffect(()=>{q()},[]),h.useEffect(()=>{const F=new Set(b),de={};Object.entries(j).forEach(([Ae,Ee])=>{F.has(Ae)&&(de[Ae]=Ee)}),Object.keys(de).length!==Object.keys(j).length&&A(de)},[b]);const q=async()=>{const F=await Y.getVendors();return r(F),F.length>0&&!i&&a(F[0]),F},ue=()=>{v(null),pe(""),l(!0)},M=()=>{d(!0)},fe=F=>{v(F),pe(F.authType||""),l(!0)},ee=async F=>{if(await e({message:"确定要删除此供应商吗?",title:"确认删除",type:"danger",confirmText:"删除",cancelText:"取消"}))try{const ve=await Y.getRules(),Ae=(F.services||[]).map(tt=>tt.id),Ee=ve.filter(tt=>Ae.includes(tt.targetServiceId)).length;if(!await e({message:`二次确认:删除供应商“${F.name}”后,将同时删除关联的 ${Ee} 条路由规则。是否继续?`,title:"二次确认",type:"danger",confirmText:"确认删除",cancelText:"取消"}))return;await Y.deleteVendor(F.id),q(),i&&i.id===F.id&&a(null),K.success(`供应商已删除,关联规则清理 ${Ee} 条`)}catch(ve){const Ae=ve instanceof Error?ve.message:"删除失败";K.error(Ae)}},xe=async F=>{F.preventDefault();const de=new FormData(F.currentTarget),ve={name:de.get("name"),description:de.get("description"),apiKey:de.get("apiKey")||"",apiBaseUrl:de.get("apiBaseUrl")||"",authType:de.get("authType")||void 0,sortOrder:parseInt(de.get("sortOrder"))||0};g?await Y.updateVendor(g.id,ve):await Y.createVendor({...ve,services:[]}),l(!1);const Ae=await q();if(i){const Ee=Ae.find(Ye=>Ye.id===i.id);Ee&&a(Ee)}},je=()=>{y(null),w([]),k(""),A({}),D(!1),_(void 0),X(void 0),I(void 0),H(!1),U(void 0),W(void 0),T(void 0),ye("openai-chat"),Q((i==null?void 0:i.authType)||dt.AUTH_TOKEN),_e(!!(i!=null&&i.apiKey)),te(!!(i!=null&&i.apiBaseUrl)),Ve(!!(i!=null&&i.authType)),le(!1),u(!0)},Re=F=>{y(F),w(F.supportedModels||[]),k(""),A(F.modelLimits||{}),D(F.enableTokenLimit||!1),_(F.tokenLimit),X(F.tokenResetInterval),I(F.tokenResetBaseTime?new Date(F.tokenResetBaseTime):void 0),H(F.enableRequestLimit||!1),U(F.requestCountLimit),W(F.requestResetInterval),T(F.requestResetBaseTime?new Date(F.requestResetBaseTime):void 0);const de=F.sourceType||"openai-chat";if(ye(de),_e(F.inheritVendorApiKey===!0),te(F.inheritVendorApiBaseUrl===!0),Ve(F.inheritVendorAuthType===!0),F.inheritVendorAuthType===!0){const ve=(i==null?void 0:i.authType)||dt.AUTH_TOKEN;Q(ve)}else if(F.authType)Q(F.authType);else{let ve;de==="gemini"||de==="gemini-chat"?ve=dt.G_API_KEY:de==="claude-chat"||de==="claude"?ve=dt.API_KEY:ve=dt.AUTH_TOKEN,Q(ve)}le(F.isDowngradeCompatibility===!0),u(!0)},ze=async F=>{if(await e({message:"确定要删除此API服务吗?",title:"确认删除",type:"danger",confirmText:"删除",cancelText:"取消"}))try{const Ae=(await Y.getRules()).filter(tt=>tt.targetServiceId===F).length;if(!await e({message:`二次确认:删除该 API 服务后,将同时删除关联的 ${Ae} 条路由规则。是否继续?`,title:"二次确认",type:"danger",confirmText:"确认删除",cancelText:"取消"}))return;await Y.deleteAPIService(F);const Ye=await q();if(i){const tt=Ye.find(at=>at.id===i.id);tt&&a(tt)}K.success(`API服务已删除,关联规则清理 ${Ae} 条`)}catch(ve){const Ae=ve instanceof Error?ve.message:"删除失败";K.error(Ae)}},Ke=async F=>{F.preventDefault();let de=[...b];if(S.trim()){const Tt=S.split(",").map(jt=>jt.trim()).filter(jt=>jt&&!de.includes(jt));de=[...de,...Tt]}const ve=new FormData(F.currentTarget),Ae=ve.get("sourceType"),Ee=ve.get("inheritVendorApiBaseUrl")==="on",Ye=(ve.get("apiUrl")||"").trim(),tt=Ee?(x==null?void 0:x.apiUrl)||"":Ye,at=ve.get("inheritVendorApiKey")==="on",Ze=ve.get("apiKey")||"",nn=at?(x==null?void 0:x.apiKey)||"":Ze,Kt=ve.get("inheritVendorAuthType")==="on",ct={};Object.entries(j).forEach(([Tt,jt])=>{Tt&&jt&&jt>0&&(ct[Tt]=jt)});const Ht={vendorId:i.id,name:ve.get("name"),apiUrl:tt,apiKey:nn,inheritVendorApiKey:at,inheritVendorApiBaseUrl:Ee,inheritVendorAuthType:Kt,sourceType:Ae,authType:Kt?(x==null?void 0:x.authType)||void 0:ve.get("authType")||void 0,supportedModels:de.length>0?de:void 0,modelLimits:Object.keys(ct).length>0?ct:void 0,enableProxy:ve.get("enableProxy")==="on",enableCodingPlan:ve.get("enableCodingPlan")==="on",isDowngradeCompatibility:he==="openai"?Z:void 0,enableTokenLimit:E,tokenLimit:O,tokenResetInterval:R,tokenResetBaseTime:V?V.getTime():void 0,enableRequestLimit:$,requestCountLimit:N,requestResetInterval:P,requestResetBaseTime:se?se.getTime():void 0};x?await Y.updateAPIService(x.id,Ht):await Y.createAPIService(Ht),u(!1),w([]),k(""),A({}),D(!1),_(void 0),X(void 0),I(void 0),H(!1),U(void 0),W(void 0),T(void 0),_e(!0),te(!0),le(!1);const Zt=await q();if(i){const Tt=Zt.find(jt=>jt.id===i.id);Tt&&a(Tt)}},Ie=F=>{if(F){pt(F);const de=Fn[F];de&&de.services.length>0&&Xe(de.services.map((ve,Ae)=>Ae))}else pt(""),Xe([]);et(""),m(!0)},Ge=async F=>{F.preventDefault();const de=We,ve=Qe;if(!de||!ve){K.warning("请填写完整信息");return}if(qe.length===0){K.warning("请至少选择一个源类型");return}const Ae=Fn[de];if(!Ae){K.error("未找到对应的供应商配置");return}try{const Ee=await Y.createVendor({name:Ae.name,description:Ae.description,apiKey:ve,authType:Ae.authType??dt.AUTH_TOKEN,...Ae.apiBaseUrl?{apiBaseUrl:Ae.apiBaseUrl}:{},sortOrder:0,services:[]});if(console.log("[一键配置] 供应商创建成功:",Ee),console.log("[一键配置] 供应商 ID:",Ee==null?void 0:Ee.id),!Ee||!Ee.id)throw console.error("[一键配置] 供应商创建失败或缺少 ID:",Ee),new Error("供应商创建失败,缺少 ID");const Ye=Ae.services.filter((ct,Ht)=>qe.includes(Ht));if(console.log("[一键配置] 准备创建服务:",Ye.length,"个"),console.log("[一键配置] vendorId:",Ee.id),Ye.length===0)throw new Error("没有选择任何服务");const tt=Ye.map(async(ct,Ht)=>{const Zt={vendorId:Ee.id,name:ct.name,apiUrl:ct.apiUrl,apiKey:"",inheritVendorApiKey:!0,inheritVendorApiBaseUrl:!1,sourceType:ct.sourceType,authType:ct.authType,supportedModels:ct.models?ct.models.split(",").map(jt=>jt.trim()):void 0,modelLimits:ct.modelLimits||{},enableCodingPlan:!0};console.log(`[一键配置] 创建服务 ${Ht+1}/${Ye.length}:`,{...Zt,apiKey:"***"});const Tt=await Y.createAPIService(Zt);return console.log(`[一键配置] 服务 ${Ht+1} 创建成功,ID:`,Tt.id),Tt.vendorId||console.error(`[一键配置] 警告:服务 ${Tt.id} 缺少 vendorId!`),Tt}),at=await Promise.all(tt);console.log("[一键配置] 所有服务创建完成,数量:",at.length);const Ze=at.filter(ct=>!ct.vendorId);if(Ze.length>0)throw console.error("[一键配置] 发现缺少 vendorId 的服务:",Ze),new Error(`有 ${Ze.length} 个服务缺少 vendorId`);const Kt=(await q()).find(ct=>ct.id===Ee.id);a(Kt||{...Ee,services:at}),m(!1),K.success(`配置成功! 已创建 ${qe.length} 个API服务`)}catch(Ee){console.error("一键配置失败:",Ee),K.error(`配置失败: ${Ee instanceof Error?Ee.message:"未知错误"}`)}};return o.jsxs("div",{className:"vendors-page",children:[o.jsxs("div",{className:"page-header",children:[o.jsx("h1",{children:"供应商管理"}),o.jsx("p",{children:"管理API供应商和服务配置"})]}),o.jsxs("div",{style:{display:"flex",gap:"20px"},children:[o.jsxs("div",{className:"card",style:{flex:"0 0 25%",minWidth:400},children:[o.jsxs("div",{className:"toolbar",children:[o.jsx("h3",{children:"供应商列表"}),o.jsxs("div",{style:{display:"flex",gap:"10px"},children:[o.jsx("button",{className:"btn btn-secondary",style:{background:"#2563EB",color:"#FFFFFF",border:"none",cursor:"pointer"},onClick:M,children:"推荐"}),o.jsx("button",{className:"btn btn-primary",onClick:()=>Ie(),children:"一键配置"}),o.jsx("button",{className:"btn btn-primary",onClick:ue,children:"新增"})]})]}),n.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"暂无供应商"})}):o.jsx("div",{style:{marginTop:"10px"},children:n.map(F=>o.jsx("div",{onClick:()=>a(F),style:{padding:"12px",marginBottom:"8px",backgroundColor:i&&i.id===F.id?"var(--accent-light)":"var(--bg-secondary)",borderRadius:"4px",cursor:"pointer",border:"1px solid var(--border-secondary)",color:"var(--text-primary)"},children:o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"8px"},children:[o.jsxs("div",{style:{flex:1,minWidth:0,overflow:"hidden"},children:[o.jsx("div",{style:{fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F.name}),F.description&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"4px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:F.description})]}),o.jsxs("div",{className:"action-buttons",style:{flexShrink:0},children:[o.jsx("button",{className:"btn btn-secondary",style:{padding:"4px 8px",fontSize:"12px"},onClick:de=>{de.stopPropagation(),fe(F)},children:"编辑"}),o.jsx("button",{className:"btn btn-danger",style:{padding:"4px 8px",fontSize:"12px"},onClick:de=>{de.stopPropagation(),ee(F)},children:"删除"})]})]})},F.id))})]}),o.jsxs("div",{className:"card",style:{flex:1},children:[o.jsxs("div",{className:"toolbar",children:[o.jsxs("h3",{children:["供应商",i?`(${i.name})`:null,"API服务"]}),i&&o.jsx("button",{className:"btn btn-primary",onClick:je,children:"新增服务"})]}),i?!i.services||i.services.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"暂无API服务"})}):o.jsxs("table",{style:{fontSize:"smaller"},children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{style:{whiteSpace:"nowrap"},children:"服务名称"}),o.jsx("th",{children:"源类型"}),o.jsx("th",{children:"API地址"}),o.jsx("th",{children:"模型"}),o.jsx("th",{children:"操作"})]})}),o.jsx("tbody",{children:i.services.map(F=>{var de;return o.jsxs("tr",{children:[o.jsx("td",{children:F.name}),o.jsx("td",{children:F.sourceType?Wd[F.sourceType]:"-"}),o.jsx("td",{style:{maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:F.apiUrl,children:F.apiUrl}),o.jsx("td",{children:(de=F.supportedModels)!=null&&de.length?`${F.supportedModels.length}个`:"*"}),o.jsx("td",{children:o.jsxs("div",{className:"action-buttons",children:[o.jsx("button",{className:"btn btn-sm btn-secondary",onClick:()=>Re(F),children:"编辑"}),o.jsx("button",{className:"btn btn-sm btn-danger",onClick:()=>ze(F.id),children:"删除"})]})})]},F.id)})})]}):o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"请先选择一个供应商"})})]})]}),s&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>l(!1),"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:g?"编辑供应商":"新增供应商"})}),o.jsxs("form",{onSubmit:xe,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商名称"}),o.jsx("input",{type:"text",name:"name",defaultValue:g?g.name:"",required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"描述"}),o.jsx("textarea",{name:"description",rows:3,defaultValue:g?g.description:""})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"API密钥"}),o.jsx("input",{type:"password",name:"apiKey",defaultValue:g&&g.apiKey||"",placeholder:"可选:供应商默认API密钥"})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["API认证方式 ",o.jsx("small",{children:"新增服务时默认使用此方式"})]}),o.jsxs("select",{name:"authType",defaultValue:(g==null?void 0:g.authType)||"",onChange:F=>pe(F.target.value),children:[o.jsx("option",{value:"",disabled:!0,children:"无"}),Object.keys(Kd).map(F=>o.jsx("option",{value:F,children:Kd[F]},F))]}),ne&&Ug[ne]&&o.jsx("small",{style:{display:"block",marginTop:"4px",color:"var(--text-muted)"},children:Ug[ne]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"API Base URL"}),o.jsx("input",{type:"text",name:"apiBaseUrl",defaultValue:g&&g.apiBaseUrl||"",placeholder:"可选:供应商默认API Base URL"})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["排序 ",o.jsx("small",{children:"数值越大越靠前"})]}),o.jsx("input",{type:"number",name:"sortOrder",defaultValue:g&&g.sortOrder||0,min:"0"})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>l(!1),children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存"})]})]})]})})]}),c&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>u(!1),"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{width:800},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:x?"编辑供应商API服务":"新增供应商API服务"})}),o.jsxs("form",{onSubmit:Ke,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"服务名称"}),o.jsx("input",{type:"text",name:"name",defaultValue:x?x.name:"",required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["数据源类型 ",o.jsx("small",{children:"供应商接口返回的数据格式标准类型"})]}),o.jsxs("select",{name:"sourceType",defaultValue:x&&x.sourceType||"",onChange:F=>Le(F.target.value),required:!0,children:[o.jsx("option",{value:"",disabled:!0,children:"请选择源类型"}),Object.keys(Wd).map(F=>o.jsx("option",{value:F,children:Wd[F]},F))]}),o.jsx("small",{style:{display:"block",marginTop:"4px",color:"var(--text-muted)"},children:EF[he]||""}),he==="openai"&&o.jsxs("label",{style:{display:"flex",alignItems:"flex-start",marginTop:"10px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:Z,onChange:F=>le(F.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px",marginTop:"2px"}}),o.jsxs("span",{children:[o.jsx("span",{style:{fontWeight:500},children:"降级兼容"}),o.jsx("br",{}),o.jsx("small",{style:{color:"var(--text-muted)"},children:"通过降级请求格式来确保非 OpenAI 官方的 Responses 接口可以被 Codex 正确使用。"})]})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商API地址"}),o.jsxs("label",{style:{display:"flex",alignItems:"center",marginBottom:"8px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",name:"inheritVendorApiBaseUrl",checked:ke,onChange:F=>te(F.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"使用供应商全局配置的API地址"})]}),!ke&&o.jsx("input",{type:"url",name:"apiUrl",defaultValue:x?x.apiUrl:"",required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商API密钥"}),o.jsxs("label",{style:{display:"flex",alignItems:"center",marginBottom:"8px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",name:"inheritVendorApiKey",checked:ie,onChange:F=>_e(F.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"使用供应商全局配置的API密钥"})]}),!ie&&o.jsx("input",{type:"password",name:"apiKey",defaultValue:x?x.apiKey:"",required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商API认证方式"}),o.jsxs("label",{style:{display:"flex",alignItems:"center",marginBottom:"8px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",name:"inheritVendorAuthType",checked:De,onChange:F=>Ve(F.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"使用供应商全局配置的API认证方式"})]}),!De&&o.jsxs(o.Fragment,{children:[o.jsx("select",{ref:t,name:"authType",defaultValue:x?x.authType||dt.AUTH_TOKEN:Se,onChange:F=>Q(F.target.value),children:Object.keys(Kd).map(F=>o.jsx("option",{value:F,children:Kd[F]},F))}),o.jsx("small",{style:{display:"block",marginTop:"4px",color:"var(--text-muted)"},children:Ug[Se]||""})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"支持的模型列表"}),o.jsx(RF,{value:b,onChange:w,inputValue:S,onInputChange:k,placeholder:"输入模型名,按Enter或逗号添加"},(x==null?void 0:x.id)||"new"),o.jsx("div",{style:{display:"block",width:"100%"},children:o.jsx("small",{style:{fontSize:"10px"},children:"留空表示支持所有模型,路由配置中,可直接将模型透传给该供应商服务接口。"})})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["模型输出限制 ",o.jsx("small",{children:"为支持的模型配置最大输出tokens"})]}),o.jsxs("div",{style:{border:"1px solid var(--border-primary)",borderRadius:"8px",padding:"16px",background:"var(--bg-secondary)",maxHeight:"300px",overflowY:"auto"},children:[Object.keys(j).length===0&&b.length===0?o.jsx("div",{style:{color:"var(--text-muted)",textAlign:"center",padding:"20px",fontSize:"14px"},children:"暂无模型限制配置,可点击下方按钮添加"}):o.jsxs("div",{children:[b.length>0&&o.jsxs("div",{style:{marginBottom:"12px"},children:[o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginBottom:"8px",fontWeight:500},children:'来自"支持的模型列表"(自动同步)'}),b.map(F=>o.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"8px",alignItems:"center",padding:"8px",background:"var(--bg-primary)",borderRadius:"4px",border:"1px solid var(--accent-light)"},children:[o.jsxs("div",{style:{flex:2,fontSize:"14px",color:"var(--text-primary)",fontWeight:500,display:"flex",alignItems:"center",gap:"6px"},children:[F,o.jsx("span",{style:{fontSize:"10px",padding:"2px 6px",borderRadius:"3px",background:"var(--accent-light)",color:"var(--accent-primary)"},children:"已同步"})]}),o.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("input",{type:"number",value:j[F]||"",onChange:de=>{const ve=de.target.value;if(ve===""){const Ae={...j};delete Ae[F],A(Ae)}else A({...j,[F]:parseInt(ve)||0})},placeholder:"留空不限",min:"1",style:{width:"100%",padding:"6px 8px",border:"1px solid var(--border-primary)",borderRadius:"4px",fontSize:"14px"}}),o.jsx("span",{style:{fontSize:"12px",color:"var(--text-muted)",whiteSpace:"nowrap"},children:"tokens"})]}),o.jsx("button",{type:"button",className:"btn btn-sm btn-secondary",onClick:()=>{const de={...j};delete de[F],A(de)},style:{padding:"4px 8px",fontSize:"12px"},title:"移除此限制(模型仍在支持列表中)",children:"移除限制"})]},`sync-${F}`))]}),Object.keys(j).length>0&&o.jsx("div",{children:Object.entries(j).filter(([F])=>!b.includes(F)).map(([F,de])=>o.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"8px",alignItems:"center",padding:"8px",background:"var(--bg-primary)",borderRadius:"4px",border:"1px solid var(--border-secondary)"},children:[o.jsx("input",{type:"text",value:F,onChange:ve=>{const Ae={...j},Ee=ve.target.value;delete Ae[F],Ae[Ee]=de,A(Ae)},placeholder:"模型名 (如: gpt-4)",style:{flex:2,padding:"6px 8px",border:"1px solid var(--border-primary)",borderRadius:"4px",fontSize:"14px"}}),o.jsx("input",{type:"number",value:de,onChange:ve=>{A({...j,[F]:parseInt(ve.target.value)||0})},placeholder:"最大tokens",min:"1",style:{flex:1,padding:"6px 8px",border:"1px solid var(--border-primary)",borderRadius:"4px",fontSize:"14px"}}),o.jsx("button",{type:"button",className:"btn btn-sm btn-danger",onClick:()=>{const ve={...j};delete ve[F],A(ve)},style:{padding:"4px 8px",fontSize:"12px"},children:"删除"})]},`custom-${F}`))})]}),o.jsx("button",{type:"button",className:"btn btn-sm btn-secondary",onClick:()=>{const F=`model-${Date.now()}`;A({...j,[F]:4096})},style:{marginTop:"8px",width:"100%"},children:"+ 添加模型限制"})]}),o.jsx("div",{style:{display:"block",width:"100%",marginTop:"8px"},children:o.jsxs("small",{style:{fontSize:"10px"},children:[o.jsx("strong",{children:"自动同步:"}),"上方添加的模型会自动在此创建限制配置(默认4096),删除模型会同步移除限制。",o.jsx("strong",{children:"手动添加:"}),"可点击下方按钮为特定模型(如 gpt-4)或前缀(如 gpt-4-*)添加限制。 留空则透传前端工具发送的值。支持精确匹配和前缀匹配。 对于o1等新模型,将自动映射到max_completion_tokens字段。"]})})]}),o.jsx("div",{className:"form-group",children:o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:E,onChange:F=>D(F.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用Token超量限制"})]})}),E&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"Token超量值(单位:k)"}),o.jsx("input",{type:"number",value:O||"",onChange:F=>_(F.target.value?parseInt(F.target.value):void 0),min:"1",placeholder:"例如:1000表示1000k tokens"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"自动重置间隔(小时)"}),o.jsx("input",{type:"number",value:R||"",onChange:F=>X(F.target.value?parseInt(F.target.value):void 0),min:"1",placeholder:"例如:720表示30天,168表示7天"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"下一次重置时间基点"}),o.jsx("input",{type:"datetime-local",value:V?Xj(V):"",onChange:F=>{F.target.value?I(new Date(F.target.value)):I(void 0)},className:"datetime-picker-input"}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"设置下一次重置的精确时间点"})]})]}),o.jsx("div",{className:"form-group",children:o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:$,onChange:F=>H(F.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用请求次数超量限制"})]})}),$&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求次数超量值"}),o.jsx("input",{type:"number",value:N||"",onChange:F=>U(F.target.value?parseInt(F.target.value):void 0),min:"1",placeholder:"例如:100"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"自动重置间隔(小时)"}),o.jsx("input",{type:"number",value:P||"",onChange:F=>W(F.target.value?parseInt(F.target.value):void 0),min:"1",placeholder:"例如:720表示30天,168表示7天"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"下一次重置时间基点"}),o.jsx("input",{type:"datetime-local",value:se?Xj(se):"",onChange:F=>{F.target.value?T(new Date(F.target.value)):T(void 0)},className:"datetime-picker-input"}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"设置下一次重置的精确时间点"})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",name:"enableProxy",defaultChecked:(x==null?void 0:x.enableProxy)||!1,style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用代理"})]}),o.jsx("small",{style:{display:"block",marginTop:"6px",color:"#666",fontSize:"12px",marginLeft:"24px"},children:'勾选后,此 API 服务的请求将通过设置的代理转发。请在"设置"页面配置代理。'})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",name:"enableCodingPlan",defaultChecked:x?!!x.enableCodingPlan:!0,style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用编程套餐限制"})]}),o.jsx("small",{style:{display:"block",marginTop:"6px",color:"#666",fontSize:"12px",marginLeft:"24px"},children:"启用后,此 API 服务仅允许编程工具(如 Claude Code、Codex、Cursor 等)发起的请求通过,普通对话请求将被拒绝。"})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>u(!1),children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存"})]})]})]})})]}),p&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>d(!1),"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"800px"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"供应商推荐"})}),o.jsx("div",{className:"modal-body",children:o.jsx("div",{className:"markdown-content",children:o.jsx(Vc,{components:{a:({href:F,children:de,title:ve})=>ve&&Fn[ve]?o.jsx("a",{href:"#",style:{color:"#2563EB",borderBottom:"solid 1px #2563EB",cursor:"pointer"},onClick:Ae=>{Ae.preventDefault(),d(!1),Ie(ve)},children:de}):o.jsx("a",{href:F,style:{color:"#2563EB",borderBottom:"solid 1px #2563EB"},target:"_blank",rel:"noopener noreferrer",children:de})},children:J})})}),o.jsx("div",{className:"modal-footer",children:o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>d(!1),children:"关闭"})})]})})]}),f&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>m(!1),"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"一键配置供应商"})}),o.jsxs("form",{onSubmit:Ge,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商"}),o.jsx(rO,{value:We,onChange:F=>{if(pt(F),F){const de=Fn[F];de&&de.services.length>0&&Xe(de.services.map((ve,Ae)=>Ae))}else Xe([])},existingVendors:n})]}),(L=Fn[We])!=null&&L.description?o.jsxs("div",{style:{fontSize:".8em",marginBottom:16,marginTop:-16},children:[Fn[We].description,Fn[We].link&&o.jsxs(o.Fragment,{children:[" ",o.jsx("a",{href:Fn[We].link,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-primary)"},children:(()=>{try{const F=new URL(Fn[We].link);return F.protocol+"//"+F.hostname}catch{return Fn[We].link}})()})]})]}):null,o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["源类型 ",o.jsx("small",{style:{color:"var(--text-muted)",fontWeight:"normal"},children:"可选择多个"})]}),o.jsx("div",{style:{border:"1px solid var(--border-primary)",borderRadius:"8px",padding:"16px",background:"var(--bg-secondary)",minHeight:"100px",display:"flex",flexDirection:"column",gap:"8px"},children:We?(ge=Fn[We])==null?void 0:ge.services.map((F,de)=>{const ve=qe.includes(de);return o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer",padding:"10px 14px",borderRadius:"6px",background:ve?"var(--accent-light)":"transparent",border:`2px solid ${ve?"var(--accent-primary)":"transparent"}`,transition:"all 0.2s ease",position:"relative",overflow:"hidden"},onMouseEnter:Ae=>{ve||(Ae.currentTarget.style.background="var(--bg-hover)",Ae.currentTarget.style.borderColor="var(--border-secondary)")},onMouseLeave:Ae=>{ve||(Ae.currentTarget.style.background="transparent",Ae.currentTarget.style.borderColor="transparent")},children:[o.jsx("input",{type:"checkbox",checked:ve,onChange:Ae=>{Ae.target.checked?Xe([...qe,de]):Xe(qe.filter(Ee=>Ee!==de))},style:{width:"18px",height:"18px",marginRight:"12px",cursor:"pointer",accentColor:"var(--accent-primary)"}}),o.jsxs("span",{style:{fontSize:"14px",fontWeight:ve?"600":"400",color:"var(--text-primary)",transition:"all 0.2s ease"},children:[F.name," - ",Wd[F.sourceType]]}),ve&&o.jsx("span",{style:{marginLeft:"auto",fontSize:"16px",color:"var(--text-primary)"},children:"✓"})]},de)}):o.jsx("div",{style:{color:"var(--text-muted)",textAlign:"center",padding:"30px 20px",fontSize:"14px"},children:"请先选择供应商"})})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"API Key"}),o.jsx("input",{type:"password",name:"apiKey",value:Qe,onChange:F=>et(F.target.value),placeholder:"请输入API密钥",required:!0})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>m(!1),children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"确认配置"})]})]})]})})]})]})}function LF({value:e,options:t,onChange:n,disabled:r=!1,placeholder:i="请选择"}){const[a,s]=h.useState(!1),l=h.useRef(null);h.useEffect(()=>{if(!a)return;const u=p=>{l.current&&!l.current.contains(p.target)&&s(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[a]);const c=t.find(u=>u.value===e);return o.jsxs("div",{ref:l,style:{position:"relative"},children:[o.jsxs("div",{onClick:()=>!r&&s(!a),style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",border:`1px solid ${a?"var(--accent-primary)":"var(--border-primary)"}`,borderRadius:"8px",background:"var(--input-bg, var(--bg-primary))",cursor:r?"not-allowed":"pointer",opacity:r?.6:1,transition:"border-color 0.2s",userSelect:"none",minWidth:0},children:[c?o.jsx("span",{style:{fontSize:"14px",color:"var(--text-primary)"},children:c.label}):o.jsx("span",{style:{fontSize:"14px",color:"var(--text-muted)"},children:i}),o.jsx("span",{style:{fontSize:"12px",color:"var(--text-muted)",marginLeft:"8px",flexShrink:0,transform:a?"rotate(180deg)":"rotate(0)",transition:"transform 0.2s"},children:"▼"})]}),a&&o.jsx("div",{style:{position:"absolute",top:"100%",left:0,right:0,zIndex:999,marginTop:"4px",maxHeight:"360px",overflowY:"auto",background:"var(--bg-primary)",border:"1px solid var(--border-primary)",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0,0,0,0.15)"},children:t.map(u=>{const p=e===u.value;return o.jsxs("div",{onClick:()=>{n(u.value),s(!1)},style:{padding:"10px 14px",cursor:"pointer",background:p?"var(--accent-light)":"transparent",borderLeft:p?"3px solid var(--accent-primary)":"3px solid transparent",transition:"background 0.15s"},onMouseEnter:d=>{p||(d.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:d=>{p||(d.currentTarget.style.background="transparent")},children:[o.jsxs("div",{style:{fontSize:"14px",fontWeight:p?600:400,color:"var(--text-primary)",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px"},children:[o.jsx("span",{children:u.label}),p&&o.jsx("span",{style:{fontSize:"13px",color:"var(--accent-primary)",flexShrink:0},children:"✓"})]}),u.description&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"4px",lineHeight:"1.5"},children:u.description})]},u.value)})})]})}const zF={1:"选择节点",2:"Skills",3:"MCP",4:"供应商",5:"确认同步"};function $F({show:e,onClose:t,onComplete:n}){const[r,i]=h.useState(1),[a,s]=h.useState(!1),[l,c]=h.useState({current:0,total:0}),[u,p]=h.useState([]),[d,f]=h.useState(null),[m,g]=h.useState(""),[v,x]=h.useState("4567"),[y,b]=h.useState(!1),[w,S]=h.useState([]),[k,j]=h.useState(""),[A,E]=h.useState(4567),[D,O]=h.useState("scan"),[_,R]=h.useState([]),[X,V]=h.useState(new Set),[I,$]=h.useState([]),[H,N]=h.useState(new Set),[U,P]=h.useState({}),[W,se]=h.useState(!1),[T,he]=h.useState(""),[ye,Z]=h.useState(!1),[le,Se]=h.useState(!1),[Q,ne]=h.useState(!1),pe=h.useCallback(()=>{i(1),s(!1),c({current:0,total:0}),p([]),f(null),g(""),x("4567"),b(!1),R([]),V(new Set),$([]),N(new Set),P({}),se(!1),he(""),Z(!1),Se(!1),ne(!1),S([]),j(""),E(4567),O("scan")},[]);h.useEffect(()=>{e&&(pe(),ie())},[e]);const ie=async()=>{try{const M=await Y.lanScan();S(M.networkInterfaces||[]),E(M.port),M.networkInterfaces.length<=1,j(M.subnet),_e(M.subnet,M.port,M.localIp)}catch(M){console.error("[LAN Scan] 获取网络信息失败:",M)}},_e=async(M,fe,ee)=>{s(!0),p([]),c({current:0,total:0});const xe=Date.now();try{const je=[];for(let Ke=1;Ke<=254;Ke++){const Ie=`${M}.${Ke}`;Ie!==ee&&je.push(Ie)}c({current:0,total:je.length});const Re=30,ze=[];for(let Ke=0;Ke<je.length;Ke+=Re){const Ie=je.slice(Ke,Ke+Re),Ge=await Promise.allSettled(Ie.map(async L=>{const ge=await Y.lanDiscover(L,fe);return{ip:L,port:fe,data:ge}}));for(const L of Ge)L.status==="fulfilled"&&ze.push(L.value);p([...ze]),c({current:Math.min(Ke+Re,je.length),total:je.length})}c({current:je.length,total:je.length})}catch(je){console.error("[LAN Scan] 扫描失败:",je)}finally{const je=Date.now()-xe;je<1e3&&await new Promise(Re=>setTimeout(Re,1e3-je)),s(!1),Se(!0)}},ke=M=>{j(M);const fe=w.find(ee=>ee.subnet===M);fe&&_e(fe.subnet,A,fe.address)},te=()=>{const M=w.find(fe=>fe.subnet===k);M&&(f(null),_e(M.subnet,A,M.address))},De=async()=>{if(m.trim()){b(!0);try{const M=parseInt(v)||4567,fe=await Y.lanDiscover(m.trim(),M),ee={ip:m.trim(),port:M,data:fe};p(xe=>xe.some(je=>je.ip===m.trim()&&je.port===M)?xe:[...xe,ee]),f(ee),K.success("连接成功")}catch{K.error("无法连接,请检查 IP 和端口")}finally{b(!1)}}},Ve=async()=>{if(d){ne(!0);try{let M=[],fe=[];try{M=await Y.getInstalledSkills()}catch{}try{fe=await Y.getMCPs()}catch(ze){console.error("[LAN Sync] 获取本地 MCPs 失败,重复检测可能不准确:",ze)}const ee=new Set(M.map(ze=>ze.name)),xe=new Set(fe.map(ze=>ze.name)),je=(d.data.skills||[]).map(ze=>({...ze,isDuplicate:ee.has(ze.name)}));R(je);const Re=(d.data.mcps||[]).map(ze=>({...ze,isDuplicate:xe.has(ze.name)}));$(Re),i(2)}finally{ne(!1)}}},Le=async()=>{if(!d)return;const M=X.size>0,fe=H.size>0;if(!(!M&&!fe&&!W)){Z(!0);try{const ee=await Y.lanSync({remoteNode:{ip:d.ip,port:d.port,name:d.data.node.name},skills:_.filter(xe=>X.has(xe.name)&&!xe.isDuplicate).map(({isDuplicate:xe,...je})=>je),mcps:I.filter(xe=>H.has(xe.name)&&!xe.isDuplicate).map(({isDuplicate:xe,...je})=>{const Re=U[je.name];return Re&&je.env?{...je,env:{...je.env,...Re}}:je}),vendor:{enabled:W,apiKey:T||void 0}});ee.success?(K.success("同步完成"),n(),setTimeout(()=>t(),500)):K.error("同步失败: "+(ee.error||"未知错误"))}catch(ee){K.error("同步失败: "+ee.message)}finally{Z(!1)}}},We=M=>M.env?Object.entries(M.env).filter(([,fe])=>fe==="***").map(([fe])=>fe):[],pt=(M,fe,ee)=>{P(xe=>({...xe,[M]:{...xe[M]||{},[fe]:ee}}))},qe=M=>{const fe=_.find(ee=>ee.name===M);fe!=null&&fe.isDuplicate||V(ee=>{const xe=new Set(ee);return xe.has(M)?xe.delete(M):xe.add(M),xe})},Xe=()=>{const M=_.filter(ee=>!ee.isDuplicate),fe=M.every(ee=>X.has(ee.name));V(fe?new Set:new Set(M.map(ee=>ee.name)))},Qe=M=>{const fe=I.find(ee=>ee.name===M);fe!=null&&fe.isDuplicate||N(ee=>{const xe=new Set(ee);return xe.has(M)?xe.delete(M):xe.add(M),xe})},et=()=>{const M=I.filter(ee=>!ee.isDuplicate),fe=M.every(ee=>H.has(ee.name));N(fe?new Set:new Set(M.map(ee=>ee.name)))},J=X.size>0||H.size>0||W,q=_.filter(M=>!M.isDuplicate),ue=I.filter(M=>!M.isDuplicate);return e?o.jsxs("div",{className:"modal-overlay",onClick:M=>{M.target===M.currentTarget&&!ye&&t()},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>{ye||t()},"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{width:"720px",maxWidth:"90%"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"局域网内同步配置"})}),o.jsx("div",{style:{display:"flex",justifyContent:"space-between",padding:"0 24px",marginBottom:"20px",borderBottom:"1px solid var(--border-secondary)",paddingBottom:"12px"},children:[1,2,3,4,5].map(M=>o.jsxs("span",{style:{fontSize:"13px",color:r===M?"var(--primary-color)":M<r?"var(--text-secondary)":"var(--text-muted)",fontWeight:r===M?600:400,borderBottom:r===M?"2px solid var(--primary-color)":"2px solid transparent",paddingBottom:"10px",cursor:"default",whiteSpace:"nowrap"},children:[M<r?"✓ ":`${M} `,zF[M]]},M))}),o.jsxs("div",{style:{padding:"0 24px",minHeight:"300px",position:"relative"},children:[r===1&&o.jsxs("div",{children:[o.jsx("div",{style:{display:"flex",gap:"24px",marginBottom:"20px"},children:["scan","manual"].map(M=>o.jsx("button",{type:"button",onClick:()=>O(M),style:{padding:"8px 4px",background:"none",border:"none",borderBottom:D===M?"2px solid var(--primary-color)":"none",color:D===M?"var(--primary-color)":"var(--text-muted)",fontWeight:D===M?500:400,fontSize:"14px",cursor:"pointer",transition:"all 0.2s"},children:M==="scan"?"局域网扫描":"手动添加"},M))}),D==="scan"&&o.jsxs(o.Fragment,{children:[w.length>0&&o.jsxs("div",{style:{marginBottom:"16px",padding:"10px 14px",background:"var(--accent-light)",borderRadius:"8px",fontSize:"13px",color:"var(--text-secondary)"},children:[o.jsx("span",{style:{fontWeight:500,color:"var(--accent-primary)"},children:"本机"})," · ",w.map(M=>M.address).join("、")," · ","端口 ",A,w.length>1&&o.jsxs(o.Fragment,{children:[" · ",w.map((M,fe)=>o.jsxs("span",{children:[fe>0?" / ":"",o.jsxs("button",{type:"button",onClick:()=>ke(M.subnet),disabled:a,style:{padding:0,border:"none",background:"none",color:k===M.subnet?"var(--primary-color)":"var(--text-muted)",fontSize:"12px",fontWeight:k===M.subnet?600:400,cursor:a?"not-allowed":"pointer",textDecoration:k===M.subnet?"underline":"none"},children:[M.subnet,".0/",M.netmask]})]},M.subnet))]})]}),a&&o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsxs("p",{style:{fontSize:"14px",color:"#666",marginBottom:"8px"},children:["正在扫描 ",k,".0 网段... ",l.current,"/",l.total]}),o.jsx("div",{style:{width:"100%",height:"6px",background:"var(--bg-secondary)",borderRadius:"3px",overflow:"hidden"},children:o.jsx("div",{style:{width:l.total>0?`${l.current/l.total*100}%`:"0%",height:"100%",background:"var(--primary-color)",borderRadius:"3px",transition:"width 0.3s ease"}})})]}),!a&&le&&u.length===0&&o.jsxs("div",{style:{textAlign:"center",padding:"40px 0",color:"#999"},children:[o.jsx("p",{style:{fontSize:"16px",marginBottom:"8px"},children:"未发现可用节点"}),o.jsx("p",{style:{fontSize:"14px",marginBottom:"12px"},children:'请确认远端节点已开启"允许局域网拉取配置"'}),o.jsx("button",{type:"button",className:"btn btn-secondary",style:{fontSize:"13px",padding:"6px 16px"},onClick:te,children:"重新扫描"})]}),u.length>0&&o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[o.jsxs("p",{style:{fontSize:"14px",color:"#666"},children:["已发现 ",u.length," 个节点:"]}),!a&&le&&o.jsx("button",{type:"button",className:"btn btn-secondary",style:{fontSize:"12px",padding:"4px 10px"},onClick:te,children:"重新扫描"})]}),o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:u.map(M=>{var fe,ee;return o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",border:`2px solid ${(d==null?void 0:d.ip)===M.ip&&(d==null?void 0:d.port)===M.port?"var(--primary-color)":"var(--border-secondary)"}`,borderRadius:"8px",cursor:"pointer",background:(d==null?void 0:d.ip)===M.ip&&(d==null?void 0:d.port)===M.port?"var(--primary-bg)":"transparent",transition:"all 0.2s"},onClick:()=>f(M),children:[o.jsx("input",{type:"radio",name:"node",checked:(d==null?void 0:d.ip)===M.ip&&(d==null?void 0:d.port)===M.port,onChange:()=>f(M),style:{accentColor:"var(--primary-color)"}}),o.jsxs("div",{style:{flex:1},children:[o.jsx("div",{style:{fontWeight:500},children:M.data.node.name}),o.jsxs("div",{style:{fontSize:"13px",color:"#666"},children:[M.ip,":",M.port,((fe=M.data.skills)==null?void 0:fe.length)>0&&` · ${M.data.skills.length} Skills`,((ee=M.data.mcps)==null?void 0:ee.length)>0&&` · ${M.data.mcps.length} MCP`]})]})]},`${M.ip}-${M.port}`)})})]})]}),Q&&o.jsxs("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,background:"rgba(255, 255, 255, 0.7)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"8px",zIndex:10},children:[o.jsx("div",{style:{width:"32px",height:"32px",border:"3px solid var(--border-secondary)",borderTop:"3px solid var(--primary-color)",borderRadius:"50%",animation:"spin 1s linear infinite",marginBottom:"12px"}}),o.jsx("p",{style:{fontSize:"14px",color:"var(--text-secondary)"},children:"正在准备数据..."}),o.jsx("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"})]}),D==="manual"&&o.jsxs("div",{style:{padding:"20px 0"},children:[o.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"center",marginBottom:"16px"},children:[o.jsx("input",{type:"text",value:m,onChange:M=>g(M.target.value),placeholder:"IP 地址,如 192.168.1.100",style:{flex:1,padding:"8px 12px",borderRadius:"6px",border:"1px solid var(--border-secondary)",background:"var(--input-bg, var(--bg-card))",color:"var(--text-primary)",fontSize:"14px"}}),o.jsx("input",{type:"text",value:v,onChange:M=>x(M.target.value),placeholder:"端口",style:{width:"80px",padding:"8px 12px",borderRadius:"6px",border:"1px solid var(--border-secondary)",background:"var(--input-bg, var(--bg-card))",color:"var(--text-primary)",fontSize:"14px"}}),o.jsx("button",{className:"btn btn-primary",onClick:De,disabled:y||!m.trim(),children:y?"连接中...":"连接"})]}),u.length>0&&o.jsxs("div",{children:[o.jsx("p",{style:{fontSize:"14px",color:"#666",marginBottom:"8px"},children:"已发现的节点:"}),o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:u.map(M=>{var fe,ee;return o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px",border:`2px solid ${(d==null?void 0:d.ip)===M.ip&&(d==null?void 0:d.port)===M.port?"var(--primary-color)":"var(--border-secondary)"}`,borderRadius:"8px",cursor:"pointer",background:(d==null?void 0:d.ip)===M.ip&&(d==null?void 0:d.port)===M.port?"var(--primary-bg)":"transparent",transition:"all 0.2s"},onClick:()=>f(M),children:[o.jsx("input",{type:"radio",name:"node",checked:(d==null?void 0:d.ip)===M.ip&&(d==null?void 0:d.port)===M.port,onChange:()=>f(M),style:{accentColor:"var(--primary-color)"}}),o.jsxs("div",{style:{flex:1},children:[o.jsx("div",{style:{fontWeight:500},children:M.data.node.name}),o.jsxs("div",{style:{fontSize:"13px",color:"#666"},children:[M.ip,":",M.port,((fe=M.data.skills)==null?void 0:fe.length)>0&&` · ${M.data.skills.length} Skills`,((ee=M.data.mcps)==null?void 0:ee.length)>0&&` · ${M.data.mcps.length} MCP`]})]})]},`${M.ip}-${M.port}`)})})]})]})]}),r===2&&o.jsxs("div",{children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px"},children:[o.jsxs("p",{style:{fontSize:"14px",color:"#666"},children:["远端节点:",d==null?void 0:d.data.node.name," (",d==null?void 0:d.ip,")"]}),q.length>0&&o.jsx("button",{className:"btn btn-secondary",style:{fontSize:"12px",padding:"4px 10px"},onClick:Xe,children:q.every(M=>X.has(M.name))?"取消全选":"全选"})]}),o.jsx("p",{style:{fontSize:"15px",fontWeight:500,marginBottom:"12px"},children:"选择需要同步的 Skills:"}),_.length===0?o.jsx("div",{style:{textAlign:"center",padding:"30px 0",color:"#999"},children:o.jsx("p",{children:"远端无可用 Skills"})}):o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",maxHeight:"360px",overflowY:"auto"},children:_.map(M=>o.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px",border:`1px solid ${M.isDuplicate?"#f0ad4e":"var(--border-secondary)"}`,borderRadius:"8px",cursor:M.isDuplicate?"not-allowed":"pointer",opacity:M.isDuplicate?.7:1,background:M.isDuplicate?"var(--bg-secondary)":"transparent"},children:[o.jsx("input",{type:"checkbox",checked:X.has(M.name),onChange:()=>qe(M.name),disabled:M.isDuplicate,style:{accentColor:"var(--primary-color)",marginTop:"2px"}}),o.jsxs("div",{style:{flex:1},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("span",{style:{fontWeight:500},children:M.name}),M.targets&&M.targets.length>0&&o.jsx("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"4px",background:"var(--bg-secondary)",color:"#666"},children:M.targets.join(", ")})]}),M.description&&o.jsx("div",{style:{fontSize:"13px",color:"#666",marginTop:"2px"},children:M.description}),M.isDuplicate&&o.jsx("div",{style:{fontSize:"12px",color:"#e67e22",marginTop:"4px"},children:"⚠ 本地已存在,无法重复同步"})]})]},M.name))})]}),r===3&&o.jsxs("div",{children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"12px"},children:[o.jsx("p",{style:{fontSize:"15px",fontWeight:500},children:"选择需要同步的 MCP:"}),ue.length>0&&o.jsx("button",{className:"btn btn-secondary",style:{fontSize:"12px",padding:"4px 10px"},onClick:et,children:ue.every(M=>H.has(M.name))?"取消全选":"全选"})]}),I.length===0?o.jsx("div",{style:{textAlign:"center",padding:"30px 0",color:"#999"},children:o.jsx("p",{children:"远端无可用 MCP"})}):o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",maxHeight:"360px",overflowY:"auto"},children:I.map(M=>{const fe=We(M),ee=H.has(M.name),xe=ee&&fe.length>0;return o.jsxs("div",{style:{border:`1px solid ${M.isDuplicate?"#f0ad4e":"var(--border-secondary)"}`,borderRadius:"8px",opacity:M.isDuplicate?.7:1,background:M.isDuplicate?"var(--bg-secondary)":"transparent",overflow:"hidden"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px",cursor:M.isDuplicate?"not-allowed":"pointer"},children:[o.jsx("input",{type:"checkbox",checked:ee,onChange:()=>Qe(M.name),disabled:M.isDuplicate,style:{accentColor:"var(--primary-color)",marginTop:"2px"}}),o.jsxs("div",{style:{flex:1},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("span",{style:{fontWeight:500},children:M.name}),o.jsx("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"4px",background:"var(--bg-secondary)",color:"#666"},children:M.type}),fe.length>0&&!M.isDuplicate&&o.jsx("span",{style:{fontSize:"11px",padding:"1px 6px",borderRadius:"4px",background:"#fff3e0",color:"#e67e22"},children:"含敏感变量"})]}),M.description&&o.jsx("div",{style:{fontSize:"13px",color:"#666",marginTop:"2px"},children:M.description}),M.isDuplicate&&o.jsx("div",{style:{fontSize:"12px",color:"#e67e22",marginTop:"4px"},children:"⚠ 本地已存在,无法重复同步"})]})]}),xe&&o.jsxs("div",{style:{padding:"8px 12px 12px 36px",borderTop:"1px dashed var(--border-secondary)",background:"var(--bg-secondary)"},children:[o.jsx("p",{style:{fontSize:"12px",color:"#e67e22",marginBottom:"8px"},children:"以下环境变量需要手动填写:"}),fe.map(je=>{var Re;return o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"6px"},children:[o.jsx("span",{style:{fontSize:"12px",color:"#666",minWidth:"120px",fontFamily:"monospace"},children:je}),o.jsx("input",{type:"text",value:((Re=U[M.name])==null?void 0:Re[je])||"",onChange:ze=>pt(M.name,je,ze.target.value),placeholder:`请输入 ${je}`,style:{flex:1,padding:"4px 8px",borderRadius:"4px",border:"1px solid var(--border-secondary)",background:"var(--input-bg, #fff)",color:"var(--text-primary)",fontSize:"12px"}})]},je)})]})]},M.name)})})]}),r===4&&o.jsxs("div",{children:[o.jsx("p",{style:{fontSize:"15px",fontWeight:500,marginBottom:"16px"},children:"是否将该节点作为本地供应商?"}),o.jsxs("div",{style:{display:"flex",gap:"24px",marginBottom:"16px"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"6px",cursor:"pointer"},children:[o.jsx("input",{type:"radio",name:"createVendor",checked:W,onChange:()=>se(!0),style:{accentColor:"var(--primary-color)"}}),o.jsx("span",{children:"是"})]}),o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"6px",cursor:"pointer"},children:[o.jsx("input",{type:"radio",name:"createVendor",checked:!W,onChange:()=>se(!1),style:{accentColor:"var(--primary-color)"}}),o.jsx("span",{children:"否"})]})]}),W&&o.jsxs("div",{style:{padding:"16px",border:"1px solid var(--border-secondary)",borderRadius:"8px",marginBottom:"12px"},children:[o.jsx("label",{style:{fontSize:"14px",fontWeight:500,display:"block",marginBottom:"6px"},children:"API Key(选填)"}),o.jsx("input",{type:"text",value:T,onChange:M=>he(M.target.value),placeholder:"如果远端节点开启了认证,请填写其接入密钥",style:{width:"100%",padding:"8px 12px",borderRadius:"6px",border:"1px solid var(--border-secondary)",background:"var(--input-bg, var(--bg-secondary))",color:"var(--text-primary)",boxSizing:"border-box"}}),o.jsx("p",{style:{fontSize:"12px",color:"#999",marginTop:"6px"},children:"不填写则使用空密钥连接。"})]}),W&&o.jsxs("p",{style:{fontSize:"13px",color:"#666"},children:["将创建供应商 ",o.jsxs("strong",{children:[d==null?void 0:d.data.node.name,"@",d==null?void 0:d.ip]}),", 包含 6 个 API 服务(Claude Code、Codex、Claude、Responses、Chat Completions、Gemini)。"]}),!W&&o.jsx("p",{style:{fontSize:"13px",color:"#999"},children:"跳过供应商创建,仅同步 Skills 和 MCP 配置。"})]}),r===5&&!ye&&o.jsxs("div",{children:[o.jsx("p",{style:{fontSize:"16px",fontWeight:600,marginBottom:"16px"},children:"同步预览"}),o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsxs("h4",{style:{fontSize:"14px",color:"#666",marginBottom:"8px"},children:["Skills(",X.size," 项)"]}),X.size===0?o.jsx("p",{style:{fontSize:"13px",color:"#999",paddingLeft:"8px"},children:"未选择"}):o.jsx("div",{style:{paddingLeft:"8px"},children:_.filter(M=>X.has(M.name)).map(M=>{var fe;return o.jsxs("div",{style:{fontSize:"14px",padding:"2px 0"},children:["· ",M.name," ",(fe=M.targets)!=null&&fe.length?`(${M.targets.join(", ")})`:""]},M.name)})})]}),o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsxs("h4",{style:{fontSize:"14px",color:"#666",marginBottom:"8px"},children:["MCP(",H.size," 项)"]}),H.size===0?o.jsx("p",{style:{fontSize:"13px",color:"#999",paddingLeft:"8px"},children:"未选择"}):o.jsx("div",{style:{paddingLeft:"8px"},children:I.filter(M=>H.has(M.name)).map(M=>{const fe=We(M),ee=fe.some(xe=>{var je,Re;return!((Re=(je=U[M.name])==null?void 0:je[xe])!=null&&Re.trim())});return o.jsxs("div",{style:{fontSize:"14px",padding:"2px 0"},children:["· ",M.name," (",M.type,")",fe.length>0&&o.jsx("span",{style:{fontSize:"12px",color:ee?"#e74c3c":"#e67e22",marginLeft:"6px"},children:ee?`⚠ ${fe.length} 个敏感变量未填写`:"✓ 敏感变量已填写"})]},M.name)})})]}),o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsx("h4",{style:{fontSize:"14px",color:"#666",marginBottom:"8px"},children:"供应商"}),W?o.jsxs("div",{style:{paddingLeft:"8px"},children:[o.jsxs("div",{style:{fontSize:"14px"},children:["名称:",d==null?void 0:d.data.node.name,"@",d==null?void 0:d.ip]}),o.jsxs("div",{style:{fontSize:"14px"},children:["API Key:",T?"已填写":"未填写"]}),o.jsx("div",{style:{fontSize:"14px"},children:"API 服务:6 个(Claude Code、Codex、Claude、Responses、Chat Completions、Gemini)"})]}):o.jsx("p",{style:{fontSize:"13px",color:"#999",paddingLeft:"8px"},children:"不创建"})]}),!J&&o.jsx("p",{style:{fontSize:"13px",color:"#e74c3c",textAlign:"center"},children:"未选择任何同步内容"})]}),r===5&&ye&&o.jsxs("div",{style:{textAlign:"center",padding:"60px 0"},children:[o.jsx("div",{style:{width:"40px",height:"40px",border:"3px solid var(--border-secondary)",borderTop:"3px solid var(--primary-color)",borderRadius:"50%",animation:"spin 1s linear infinite",margin:"0 auto 16px"}}),o.jsx("p",{style:{fontSize:"16px",color:"#666"},children:"正在同步..."}),o.jsx("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"})]})]}),o.jsxs("div",{className:"modal-footer",style:{marginTop:"20px"},children:[r>1&&(r<5||!ye)&&o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>i(r-1),disabled:ye,children:"← 上一步"}),o.jsx("div",{style:{flex:1}}),o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:t,disabled:ye,children:"取消"}),r===1&&o.jsx("button",{type:"button",className:"btn btn-primary",onClick:Ve,disabled:!d||Q,children:Q?"加载中...":"下一步 →"}),r===2&&o.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>i(3),children:"下一步 →"}),r===3&&o.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>i(4),children:"下一步 →"}),r===4&&o.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>i(5),children:"下一步 →"}),r===5&&!ye&&o.jsx("button",{type:"button",className:"btn btn-primary",onClick:Le,disabled:!J,children:"同步"})]})]})})]}):null}const iO=h.createContext(null),BF=async e=>{try{await Y.clearRuleStatus(e)}catch(t){throw console.error("[RulesStatus] 清除规则状态失败:",t),t}};function FF(e){const t={};return e.forEach(n=>{t[n.ruleId]={status:n.status,totalTokensUsed:n.totalTokensUsed,totalRequestsUsed:n.totalRequestsUsed,errorMessage:n.errorMessage,errorType:n.errorType,lastUpdate:n.timestamp}}),t}function UF({children:e}){const[t,n]=h.useState({}),r=h.useRef(null),i=h.useRef(null),a=h.useRef(Date.now());h.useEffect(()=>{let p=!0;const d=()=>{r.current&&(r.current.close(),r.current=null);const f=localStorage.getItem("auth_token"),m=f?`/api/rules/status/stream?token=${encodeURIComponent(f)}`:"/api/rules/status/stream",g=new EventSource(m);r.current=g,a.current=Date.now(),g.onmessage=v=>{a.current=Date.now();try{const x=JSON.parse(v.data);if(x.type==="init")n(FF(x.statuses));else if(x.type==="update"){const y=x.status;n(b=>({...b,[y.ruleId]:{status:y.status,totalTokensUsed:y.totalTokensUsed,totalRequestsUsed:y.totalRequestsUsed,errorMessage:y.errorMessage,errorType:y.errorType,lastUpdate:y.timestamp}}))}}catch(x){console.error("[RulesStatus] SSE 数据解析错误:",x)}},g.onerror=()=>{console.warn("[RulesStatus] SSE 连接错误,准备重连..."),g.close(),r.current=null,a.current=0}};return d(),i.current=setInterval(()=>{if(!p)return;const m=Date.now()-a.current;m>=15e3&&(console.warn(`[RulesStatus] 心跳超时(${Math.round(m/1e3)}秒无响应),重新连接 SSE...`),d())},3e3),()=>{p=!1,r.current&&(r.current.close(),r.current=null),i.current&&(clearInterval(i.current),i.current=null)}},[]),h.useEffect(()=>{},[]);const l={ruleStatuses:t,getRuleStatus:c=>t[c],clearRuleStatus:BF};return o.jsx(iO.Provider,{value:l,children:e})}function WF(){const e=h.useContext(iO);return e||{ruleStatuses:{},getRuleStatus:t=>{},clearRuleStatus:async t=>{}}}const KF=[{value:"codex",label:"Codex",icon:"🤖"},{value:"claude-code",label:"Claude Code",icon:"⚡"},{value:"api",label:"所有 API",icon:"🔗"}],HF={codex:" [Codex]","claude-code":" [Claude Code]",api:" [API]"},VF={"claude-code":{claude:0,"claude-chat":1,"openai-chat":2,openai:3,gemini:4,"gemini-chat":5},codex:{openai:0,"openai-chat":1,claude:2,"claude-chat":3,gemini:4,"gemini-chat":5},api:{"openai-chat":0,claude:1,"claude-chat":2,openai:3,gemini:4,"gemini-chat":5}};function aO({show:e,onClose:t,onComplete:n}){const[r,i]=h.useState(""),[a,s]=h.useState(""),[l,c]=h.useState("codex"),[u,p]=h.useState(!1),[d,f]=h.useState([]),[m,g]=h.useState([]);h.useEffect(()=>{e&&(Y.getVendors().then(f).catch(()=>{}),Y.getRoutes().then(g).catch(()=>{}))},[e]);const v=r?Fn[r]:null,x=v?d.find(j=>j.name===v.name):null,y=!!(x!=null&&x.apiKey),b=!x||!y;if(!e)return null;const w=()=>{u||(i(""),s(""),c("codex"),t())},S=(j,A)=>Y.createAPIService({vendorId:j,name:A.name,apiUrl:A.apiUrl,apiKey:"",inheritVendorApiKey:!0,inheritVendorApiBaseUrl:!1,sourceType:A.sourceType,authType:A.authType,supportedModels:A.models?A.models.split(",").map(E=>E.trim()):void 0,modelLimits:A.modelLimits||{},enableCodingPlan:!1}),k=async j=>{var E,D;if(j.preventDefault(),!r){K.warning("请选择供应商");return}if(b&&!a){K.warning("请填写 API Key");return}const A=Fn[r];if(!A){K.error("未找到对应的供应商配置");return}p(!0);try{let O,_;if(x){O=x.id,!y&&a&&await Y.updateVendor(O,{...x,apiKey:a});const N=new Set((x.services||[]).map(W=>W.sourceType)),U=A.services.filter(W=>!N.has(W.sourceType)),P=U.length>0?await Promise.all(U.map(W=>S(O,W))):[];_=[...x.services||[],...P]}else{const N=await Y.createVendor({name:A.name,description:A.description,apiKey:a,authType:A.authType??dt.AUTH_TOKEN,...A.apiBaseUrl?{apiBaseUrl:A.apiBaseUrl}:{},sortOrder:0,services:[]});if(!(N!=null&&N.id))throw new Error("供应商创建失败");O=N.id,_=await Promise.all(A.services.map(U=>S(O,U)))}const R=A.name+HF[l],X=new Set(m.map(N=>N.name));let V=R;if(X.has(V)){let N=2;for(;X.has(`${R}-${N}`);)N++;V=`${R}-${N}`}const I=await Y.createRoute({name:V,description:"由一键配置自动创建"});if(!(I!=null&&I.id))throw new Error("路由创建失败");const $=VF[l],H=(E=[..._].filter(N=>N.sourceType).map(N=>({service:N,priority:$[N.sourceType]??99})).sort((N,U)=>N.priority-U.priority)[0])==null?void 0:E.service;if(H){const N=(D=H.supportedModels)!=null&&D.length?H.supportedModels[0]:void 0;await Y.createRule({routeId:I.id,contentType:"default",targetServiceId:H.id,targetModel:N,sortOrder:0})}if(l==="codex"||l==="claude-code")try{await Y.activateToolRoute(l,I.id)}catch{}if(l==="api"){let N=null;try{N=await Y.getApiPathBindings()}catch{}if(N!=null&&N.bindings){const U=N.bindings.map(P=>P.apiPath==="/v1/models"?P:{...P,routeId:I.id});try{await Y.updateApiPathBindings(U,N.models||"")}catch{}}}K.success("一键配置完成!路由已激活,可以开始使用"),n==null||n(),w(),setTimeout(()=>{window.location.reload()},300)}catch(O){console.error("一键配置失败:",O),K.error(`配置失败: ${O instanceof Error?O.message:"未知错误"}`)}finally{p(!1)}};return o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:w,"aria-label":"关闭",disabled:u,children:"×"}),o.jsx("div",{className:"modal",children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"🚀 一键配置"})}),o.jsxs("form",{onSubmit:k,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商"}),o.jsx(rO,{value:r,onChange:j=>i(j),existingVendors:d,disabled:u})]}),(v==null?void 0:v.description)&&o.jsxs("div",{style:{fontSize:".8em",marginBottom:16,marginTop:-16},children:[v.description,v.link&&o.jsxs(o.Fragment,{children:[" ",o.jsx("a",{href:v.link,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--accent-primary)"},children:(()=>{try{const j=new URL(v.link);return j.protocol+"//"+j.hostname}catch{return v.link}})()})]})]}),b&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"API Key"}),o.jsx("input",{type:"password",value:a,onChange:j=>s(j.target.value),placeholder:"请输入API密钥",required:!0,disabled:u})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"目标"}),o.jsx("div",{style:{border:"1px solid var(--border-primary)",borderRadius:"8px",padding:"12px",background:"var(--bg-secondary)",display:"flex",flexDirection:"column",gap:"8px"},children:KF.map(j=>{const A=l===j.value;return o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer",padding:"10px 14px",borderRadius:"6px",background:A?"var(--accent-light)":"transparent",border:`2px solid ${A?"var(--accent-primary)":"transparent"}`,transition:"all 0.2s ease"},onMouseEnter:E=>{A||(E.currentTarget.style.background="var(--bg-hover)",E.currentTarget.style.borderColor="var(--border-secondary)")},onMouseLeave:E=>{A||(E.currentTarget.style.background="transparent",E.currentTarget.style.borderColor="transparent")},children:[o.jsx("input",{type:"radio",name:"setupTarget",value:j.value,checked:A,onChange:()=>c(j.value),style:{width:"18px",height:"18px",marginRight:"12px",cursor:"pointer",accentColor:"var(--accent-primary)"},disabled:u}),o.jsxs("span",{style:{fontSize:"14px",fontWeight:A?"600":"400",color:"var(--text-primary)",transition:"all 0.2s ease"},children:[j.icon," ",j.label]}),A&&o.jsx("span",{style:{marginLeft:"auto",fontSize:"16px",color:"var(--text-primary)"},children:"✓"})]},j.value)})})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:w,disabled:u,children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",disabled:u,children:u?"配置中...":"确认配置"})]})]})]})})]})}const qF=""+new URL("openai-CPEiZpaN.webp",import.meta.url).href,YF=""+new URL("claude-XtpLmGtF.webp",import.meta.url).href,Qj=[{value:"compact",label:"压缩对话",icon:"📦"},{value:"image-understanding",label:"图像理解",icon:"🖼"},{value:"high-iq",label:"高智商",icon:"🧠"},{value:"long-context",label:"长上下文",icon:"📄"},{value:"thinking",label:"思考",icon:"💭"},{value:"background",label:"后台",icon:"⚙"},{value:"model-mapping",label:"模型顶替",icon:"🔄"},{value:"default",label:"默认"}],Zj={compact:0,"image-understanding":1,"high-iq":2,"long-context":3,thinking:4,background:5,"model-mapping":6,default:7},Jj={compact:"📦",background:"🧱",thinking:"💭","high-iq":"🧠","long-context":"📄","image-understanding":"🖼️","model-mapping":"🔄"},oO=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}],sO=[{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"max",label:"Max"}],zv=[{value:"default",label:"default",desc:"每次编辑前都会请求批准。适合入门或处理敏感代码。"},{value:"acceptEdits",label:"acceptEdits",desc:"自动编辑选中文本或整个文件;读取、文件编辑及常见文件系统命令(mkdir、touch、mv、cp 等)免询问。"},{value:"plan",label:"plan",desc:"先探索代码并给出方案,确认后再编辑;仅读取免询问。"},{value:"auto",label:"auto",desc:"自动为每个任务选择最佳权限模式;所有操作免询问,带后台安全检查。"},{value:"dontAsk",label:"dontAsk",desc:"仅预先批准的工具免询问。适合锁定的 CI 与脚本。"},{value:"bypassPermissions",label:"bypassPermissions",desc:"运行潜在危险命令前不请求批准;所有操作免询问,带后台安全检查。仅建议在隔离容器与 VM 中使用。"}],GF=e=>oO.some(t=>t.value===e),XF=e=>sO.some(t=>t.value===e),QF=e=>zv.some(t=>t.value===e),ZF=e=>GF(e==null?void 0:e.codexModelReasoningEffort)?e.codexModelReasoningEffort:"high",JF=e=>XF(e==null?void 0:e.claudeEffortLevel)?e.claudeEffortLevel:"medium",Wg=e=>{const t=QF(e==null?void 0:e.claudePermissionsDefaultMode)?e.claudePermissionsDefaultMode:"default";return t==="bypassPermissions"&&!(e!=null&&e.enableBypassPermissionsSupport)?"default":t};function ek(e){const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0"),i=String(e.getHours()).padStart(2,"0"),a=String(e.getMinutes()).padStart(2,"0");return`${t}-${n}-${r}T${i}:${a}`}function eU(){var kw,Cw,Pw,Aw,Ew,Tw,Iw,Ow;const{confirm:e}=Ku(),{ruleStatuses:t,clearRuleStatus:n}=WF(),[r,i]=h.useState([]),[a,s]=h.useState([]),[l,c]=h.useState([]),[u,p]=h.useState([]),[d,f]=h.useState([]),[m,g]=h.useState([]),[v,x]=h.useState([]),[y,b]=h.useState(null),[w,S]=h.useState([]),[k,j]=h.useState(""),[A,E]=h.useState(null),[D,O]=h.useState(!1),[_,R]=h.useState(!1),[X,V]=h.useState(null),[I,$]=h.useState(null),[H,N]=h.useState(""),[U,P]=h.useState(""),[W,se]=h.useState(""),[T,he]=h.useState(""),[ye,Z]=h.useState(0),[le,Se]=h.useState((I==null?void 0:I.contentType)||""),[Q,ne]=h.useState(void 0),[pe,ie]=h.useState(void 0),[_e,ke]=h.useState(void 0),[te,De]=h.useState(void 0),[Ve,Le]=h.useState(""),[We,pt]=h.useState(void 0),[qe,Xe]=h.useState(void 0),[Qe,et]=h.useState(void 0),[J,q]=h.useState(void 0),[ue,M]=h.useState(void 0),[fe,ee]=h.useState(null),[xe,je]=h.useState(!1),[Re,ze]=h.useState(!1),[Ke,Ie]=h.useState(void 0),[Ge,L]=h.useState(void 0),[ge,F]=h.useState({}),[de,ve]=h.useState(!1),[Ae,Ee]=h.useState(""),[Ye,tt]=h.useState(1e3),[at,Ze]=h.useState(!1),[nn,Kt]=h.useState(!1),[ct,Ht]=h.useState(!1),[Zt,Tt]=h.useState(!1),[jt,mi]=h.useState(!1),[Gi,Ta]=h.useState(!1),[ce,_t]=h.useState(""),[En,ar]=h.useState(!1),[Xi,on]=h.useState(""),[B,z]=h.useState(!1),[Pe,ot]=h.useState(""),[Be,xt]=h.useState(!1),[Bt,gi]=h.useState({}),[bo,tc]=h.useState(null),[Qi,Ia]=h.useState([]),[ut,pn]=h.useState(!1),[vw,xw]=h.useState(null);h.useEffect(()=>{Ps(),ng(),rg(),uL(),Or(),bd(),bw(),jw()},[]);const bw=async()=>{try{const C=await Y.getApiPathBindings();S(C.bindings||[]),j(C.models||"")}catch(C){console.error("Failed to load API path bindings:",C)}},ww=async(C,re)=>{try{const me=await Y.updateApiPathBindings(C,re);S(me.bindings),K.success("路由映射已保存")}catch(me){K.error(me.message||"保存失败")}},oL=(C,re)=>{const me=w.map(Oe=>Oe.apiPath===C?{...Oe,routeId:re}:Oe);S(me),ww(me,k)},sL=()=>{ww(w,k)};h.useEffect(()=>{A&&wo(A.id)},[A]),h.useEffect(()=>{g(H?d.filter(C=>C.vendorId===H):[]),P(""),se("")},[H]);const Ps=async()=>{const C=await Y.getRoutes();i(C),C.length>0&&!A&&E(C[0]);const re={};for(const me of C)try{const Oe=await Y.getBoundSessions(me.id);re[me.id]=Oe.sessions.length}catch{re[me.id]=0}gi(re)},lL=async C=>{tc(C),pn(!0),Ia([]);try{const re=await Y.getBoundSessions(C);Ia(re.sessions)}catch{Ia([])}finally{pn(!1)}},Sw=()=>{tc(null),Ia([])},cL=async C=>{if(await e({title:"确认解绑会话",message:"确定要解除该会话的路由绑定吗?解绑后,该会话的后续请求将不再使用此路由。",type:"danger",confirmText:"解绑",cancelText:"取消"})){xw(C);try{const me=await Y.unbindSessionRoute(C);me.success?(K.success("已解除绑定"),Ia(Oe=>Oe.filter(kt=>kt.id!==C)),gi(Oe=>{const kt=bo;return!kt||!Oe[kt]?Oe:{...Oe,[kt]:Math.max(0,Oe[kt]-1)}})):K.error(me.error||"解绑失败")}catch(me){K.error(me.message||"解绑失败")}finally{xw(null)}}},wo=async C=>{const re=await Y.getRules(C);if(s(re),jw(),C)try{const Oe=(await Y.getRulesBlacklistStatus(C)).reduce((kt,Ct)=>(kt[Ct.ruleId]=Ct,kt),{});F(Oe)}catch(me){console.error("Failed to load blacklist status:",me)}},jw=async()=>{try{const C=await Y.getRules();c(C)}catch(C){console.error("Failed to load all rules:",C)}},ng=async()=>{const C=await Y.getVendors();p(C)},rg=async()=>{const C=await Y.getAPIServices();f(C)},uL=async()=>{const C=await Y.getMCPs();x(C)},[it,dL]=h.useState(null),[yi,xd]=h.useState(null),Or=async()=>{try{const C=await Y.getConfig();b(C),_t(C.claudeDefaultModel||""),ar(!1),on(C.autocompactPctOverride!=null?String(C.autocompactPctOverride):""),z(!1),ot(C.codexDefaultModel||""),xt(!1),Le(typeof C.ruleGlobalTimeout=="number"&&C.ruleGlobalTimeout>0?String(C.ruleGlobalTimeout):"")}catch(C){console.error("Failed to load app config:",C)}},bd=async()=>{try{const C=await Y.getToolBindings();dL(C)}catch(C){console.error("Failed to load tool bindings:",C)}},wd=async(C,re)=>{xd(C);try{(await Y.activateToolRoute(C,re)).success?(await bd(),await Ps(),K.success("路由已激活")):K.error("激活失败")}catch(me){K.error(`激活失败: ${me.message||"未知错误"}`)}finally{xd(null)}},Sd=async C=>{xd(C);try{(await Y.deactivateToolRoute(C)).success?(await bd(),await Ps(),K.success("路由已停用")):K.error("停用失败")}catch(re){K.error(`停用失败: ${re.message||"未知错误"}`)}finally{xd(null)}},pL=async C=>{C.preventDefault();const re=new FormData(C.currentTarget),me={name:re.get("name"),description:re.get("description")};X?await Y.updateRoute(X.id,me):await Y.createRoute(me),O(!1),Ps()},fL=async C=>{if(await e({message:"确定要删除此路由吗?",title:"确认删除",type:"danger",confirmText:"删除",cancelText:"取消"}))try{await Y.deleteRoute(C),Ps(),A&&A.id===C&&(E(null),s([])),K.success("路由已删除")}catch(me){K.error(me.message||"删除失败")}},hL=async C=>{if(C.preventDefault(),le==="image-understanding"&&de&&!Ae){K.warning("请选择一个MCP工具");return}if(!de&&!U){K.warning("请选择供应商API服务");return}if(!de&&Q!==void 0&&Ke!==void 0&&Q>Ke){K.warning(`Token超量值 (${Q}k) 不能超过API服务的限制 (${Ke}k)`);return}if(!de&&We!==void 0&&Ge!==void 0&&We>Ge){K.warning(`请求次数超量值 (${We}) 不能超过API服务的限制 (${Ge})`);return}const re=new FormData(C.currentTarget),me={routeId:A.id,contentType:re.get("contentType"),targetServiceId:de?"":U,targetModel:de?void 0:W||"",replacedModel:T||"",sortOrder:ye,timeout:te?te*1e3:void 0,tokenLimit:de?void 0:Q||void 0,resetInterval:de?void 0:pe,tokenResetBaseTime:de?void 0:_e?_e.getTime():void 0,requestCountLimit:de?void 0:We,requestResetInterval:de?void 0:qe,requestResetBaseTime:de?void 0:Qe?Qe.getTime():void 0,frequencyLimit:J,frequencyWindow:ue,useMCP:le==="image-understanding"?de:!1,mcpId:le==="image-understanding"&&de?Ae:void 0,sessionTokenThreshold:le==="long-context"?Ye:void 0};I?await Y.updateRule(I.id,me):await Y.createRule(me),R(!1),A&&wo(A.id)},mL=async C=>{await e({message:"确定要删除此路由吗?",title:"确认删除",type:"danger",confirmText:"删除",cancelText:"取消"})&&(await Y.deleteRule(C),A&&wo(A.id),K.success("规则已删除"))},gL=async C=>{try{const re=await Y.toggleRuleDisable(C);A&&wo(A.id),K.success(re.isDisabled?"规则已屏蔽":"规则已启用")}catch(re){K.error("操作失败: "+re.message)}},yL=async C=>{var re,me;try{const Oe=[];(re=ge[C])!=null&&re.isBlacklisted&&Oe.push(Y.clearRuleBlacklist(C));const kt=(me=t[C])==null?void 0:me.status;(kt==="error"||kt==="suspended")&&Oe.push(n(C)),await Promise.all(Oe),A&&wo(A.id),K.success("已恢复")}catch(Oe){K.error("恢复失败: "+Oe.message)}},vL=async C=>{try{const re=a.find(Ct=>Ct.id===C);if(!re)return;const me=a.filter(Ct=>Ct.contentType===re.contentType),kt=Math.max(...me.map(Ct=>Ct.sortOrder||0))+1;await Y.updateRule(C,{sortOrder:kt}),A&&wo(A.id),K.success("优先级已提升至最高")}catch(re){K.error("操作失败: "+re.message)}},xL=async C=>{try{if(!a.find(Oe=>Oe.id===C))return;await Y.updateRule(C,{sortOrder:0}),A&&wo(A.id),K.success("优先级已降至最低")}catch(re){K.error("操作失败: "+re.message)}},bL=async C=>{try{const re=y||{};await Y.updateConfig({...re,enableAgentTeams:C}),K.success(C?"Agent Teams 设置已保存(重启 Claude Code 后生效)":"Agent Teams 设置已取消(重启 Claude Code 后生效)"),await Or()}catch(re){K.error("更新失败: "+re.message)}},wL=async C=>{try{const re=y||{},me=Wg(y),Oe=!C&&me==="bypassPermissions"?"default":me;await Y.updateConfig({...re,enableBypassPermissionsSupport:C,claudePermissionsDefaultMode:Oe}),K.success(C?"对 bypassPermissions 的支持设置已保存(重启 Claude Code 后生效)":"对 bypassPermissions 的支持设置已取消(重启 Claude Code 后生效)"),await Or()}catch(re){K.error("更新失败: "+re.message)}},SL=async C=>{try{const re=y||{};await Y.updateConfig({...re,claudePermissionsDefaultMode:C}),K.success("默认权限模式已保存(重启 Claude Code 后生效)"),await Or()}catch(re){K.error("更新失败: "+re.message)}},jL=async C=>{try{mi(!0);const re=y||{};await Y.updateConfig({...re,codexModelReasoningEffort:C}),K.success("Reasoning Effort 设置已保存(重启 Codex 后生效)"),await Or()}catch(re){K.error("更新失败: "+re.message)}finally{mi(!1)}},kL=async C=>{try{Ta(!0);const re=y||{};await Y.updateConfig({...re,claudeEffortLevel:C}),K.success("Effort Level 设置已保存(重启 Claude Code 后生效)"),await Or()}catch(re){K.error("更新失败: "+re.message)}finally{Ta(!1)}},CL=async()=>{try{const C=y||{};await Y.updateConfig({...C,claudeDefaultModel:ce.trim()||void 0}),K.success("默认模型已保存(重启 Claude Code 后生效)"),ar(!1),await Or()}catch(C){K.error("保存失败: "+C.message)}},PL=async()=>{const C=Xi.trim();if(C===""){try{const me=y||{};await Y.updateConfig({...me,autocompactPctOverride:void 0}),K.success("自动压缩百分比已清除(重启 Claude Code 后生效)"),z(!1),await Or()}catch(me){K.error("保存失败: "+me.message)}return}const re=Number(C);if(!Number.isInteger(re)||re<1||re>100){K.error("自动压缩百分比必须为 1-100 的整数");return}try{const me=y||{};await Y.updateConfig({...me,autocompactPctOverride:re}),K.success("自动压缩百分比已保存(重启 Claude Code 后生效)"),z(!1),await Or()}catch(me){K.error("保存失败: "+me.message)}},AL=async()=>{try{const C=y||{};await Y.updateConfig({...C,codexDefaultModel:Pe.trim()||void 0}),K.success("默认模型已保存(重启 Codex 后生效)"),xt(!1),await Or()}catch(C){K.error("保存失败: "+C.message)}},EL=async()=>{try{const C=y||{},re=Number(Ve),me=Number.isFinite(re)&&re>0?re:void 0;await Y.updateConfig({...C,ruleGlobalTimeout:me}),K.success(me?`规则全局超时时间已设置为 ${me} 秒`:"规则全局超时时间已恢复为默认值(300秒)"),await Or()}catch(C){K.error("更新失败: "+C.message)}},TL=()=>Qj,IL=C=>{$(C),Se(C.contentType),ve(C.useMCP||!1),Ee(C.mcpId||"");const re=d.find(me=>me.id===C.targetServiceId);re?(re.vendorId&&(N(re.vendorId),g(d.filter(me=>me.vendorId===re.vendorId))),setTimeout(()=>{if(P(re.id),se(C.targetModel||""),he(C.replacedModel||""),Z(C.sortOrder||0),De(C.timeout?C.timeout/1e3:void 0),ne(C.tokenLimit||void 0),ie(C.resetInterval),ke(C.tokenResetBaseTime?new Date(C.tokenResetBaseTime):void 0),pt(C.requestCountLimit),Xe(C.requestResetInterval),et(C.requestResetBaseTime?new Date(C.requestResetBaseTime):void 0),q(C.frequencyLimit),M(C.frequencyWindow),re.enableTokenLimit&&re.tokenLimit){Ie(re.tokenLimit);const me=C.tokenLimit===re.tokenLimit&&C.resetInterval===(re.tokenResetInterval||void 0)&&C.tokenLimit!==null&&C.resetInterval!==null;je(me)}else Ie(void 0),je(!1);if(re.enableRequestLimit&&re.requestCountLimit){L(re.requestCountLimit);const me=C.requestCountLimit===re.requestCountLimit&&C.requestResetInterval===(re.requestResetInterval||void 0)&&C.requestCountLimit!==null&&C.requestResetInterval!==null;ze(me)}else L(void 0),ze(!1);Ze(!!C.tokenLimit),Kt(!!C.requestCountLimit),tt(C.sessionTokenThreshold??1e3)},0)):(C.useMCP&&(N(""),P(""),se(""),he(""),Z(C.sortOrder||0),De(C.timeout?C.timeout/1e3:void 0),Ze(!1),Kt(!1)),tt(C.sessionTokenThreshold??1e3)),R(!0)},OL=C=>l.some(re=>{var me;return re.routeId===C&&((me=t[re.id])==null?void 0:me.status)==="in_use"}),NL=C=>{var nc;const re=ge[C.id],me=[],Oe=t[C.id];if((Oe==null?void 0:Oe.status)==="in_use")return{status:"in_use",label:"使用中",reason:"正在处理请求"};if((Oe==null?void 0:Oe.status)==="suspended"){const Fe=Oe.errorType==="timeout"?"超时":Oe.errorType==="http"?"HTTP错误":"错误";return{status:"suspended",label:"已挂起",reason:Oe.errorMessage||`${Fe}导致服务暂时不可用`}}if((Oe==null?void 0:Oe.status)==="error")return{status:"error",label:"请求失败",reason:Oe.errorMessage||"请求处理失败"};if(re!=null&&re.isBlacklisted){const Fe=re.blacklistEntry;(Fe==null?void 0:Fe.errorType)==="timeout"?me.push("请求超时"):Fe!=null&&Fe.lastStatusCode&&me.push(`HTTP ${Fe.lastStatusCode}错误`)}const kt=(Oe==null?void 0:Oe.totalTokensUsed)!==void 0?Oe.totalTokensUsed:C.totalTokensUsed;C.tokenLimit&&kt!==void 0&&kt>=C.tokenLimit*1e3&&me.push("Token超限");const Ct=(Oe==null?void 0:Oe.totalRequestsUsed)!==void 0?Oe.totalRequestsUsed:C.totalRequestsUsed;if(C.requestCountLimit&&Ct!==void 0&&Ct>=C.requestCountLimit&&me.push("次数超限"),me.length>0)return{status:"error",label:re!=null&&re.isBlacklisted?((nc=re.blacklistEntry)==null?void 0:nc.errorType)==="timeout"?"超时":"服务错误":me[0],reason:me.join(", ")};const yr=[];if(C.tokenLimit&&kt!==void 0){const Fe=kt/(C.tokenLimit*1e3)*100;Fe>=80&&yr.push(`Token ${Fe.toFixed(0)}%`)}if(C.requestCountLimit&&Ct!==void 0){const Fe=Ct/C.requestCountLimit*100;Fe>=80&&yr.push(`次数 ${Fe.toFixed(0)}%`)}return yr.length>0?{status:"warning",label:"接近限制",reason:yr.join(", ")}:{status:"success",label:"正常",reason:""}},ML=()=>{$(null),Se("default"),N(""),P(""),se(""),he(""),Z(0),De(void 0),ne(void 0),ie(void 0),ke(void 0),pt(void 0),Xe(void 0),et(void 0),je(!1),ze(!1),Ie(void 0),L(void 0),Ze(!1),Kt(!1),ve(!1),Ee(""),tt(1e3),R(!0)};return o.jsxs("div",{className:"routes-page",children:[o.jsxs("div",{className:"page-header",style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[o.jsxs("div",{children:[o.jsx("h1",{children:"路由管理"}),o.jsx("p",{children:"管理API路由和路由配置"})]}),o.jsxs("div",{style:{display:"flex",gap:"8px"},children:[o.jsx("button",{className:"btn btn-secondary",onClick:()=>Tt(!0),style:{whiteSpace:"nowrap"},children:"局域网内同步配置"}),o.jsx("button",{className:"btn btn-primary",onClick:()=>Ht(!0),style:{whiteSpace:"nowrap"},children:"一键配置"})]})]}),o.jsx("div",{style:{display:"flex",flexDirection:"column"},children:o.jsxs("div",{style:{display:"flex",gap:"20px"},children:[o.jsxs("div",{className:"card",style:{flex:"0 0 25%",minWidth:300},children:[o.jsxs("div",{className:"toolbar",children:[o.jsx("h3",{children:"路由"}),o.jsx("button",{className:"btn btn-primary",onClick:()=>O(!0),children:"新建"})]}),r.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"暂无路由规则"})}):o.jsx("div",{style:{marginTop:"10px"},children:r.map(C=>{var re,me,Oe,kt;return o.jsx("div",{className:OL(C.id)?"route-active-glow":void 0,onClick:()=>E(C),style:{padding:"12px",marginBottom:"8px",backgroundColor:A&&A.id===C.id?"var(--bg-route-item-selected)":"var(--bg-route-item)",borderRadius:"8px",cursor:"pointer",border:"1px solid var(--border-primary)",position:"relative"},children:o.jsxs("div",{children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[o.jsx("div",{style:{fontWeight:500,flex:1,minWidth:0},children:C.name}),o.jsxs("div",{style:{display:"flex",gap:"3px",alignItems:"center",flexShrink:0,marginLeft:"8px"},children:[Bt[C.id]>0&&o.jsxs("div",{style:{position:"relative"},children:[o.jsx("div",{onClick:Ct=>{Ct.stopPropagation(),lL(C.id)},style:{width:"18px",height:"18px",borderRadius:"50%",border:"2px solid var(--color-primary, #2980b9)",boxSizing:"border-box",backgroundColor:"transparent",color:"var(--color-primary, #2980b9)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px",fontWeight:700,cursor:"pointer",flexShrink:0},children:Bt[C.id]>99?"99+":Bt[C.id]}),o.jsxs("span",{className:"route-icon-popover",children:[Bt[C.id]," 个会话绑定此路由,点击查看"]})]}),o.jsxs("div",{style:{position:"relative"},children:[o.jsx("img",{src:qF,alt:"Codex",onClick:Ct=>{var yr;Ct.stopPropagation(),!yi&&(((yr=it==null?void 0:it.codex)==null?void 0:yr.routeId)===C.id?Sd("codex"):wd("codex",C.id))},style:{width:"18px",height:"18px",borderRadius:"50%",cursor:yi?"wait":"pointer",opacity:((re=it==null?void 0:it.codex)==null?void 0:re.routeId)===C.id?1:.1,transition:"opacity 0.2s ease",objectFit:"cover",flexShrink:0,display:"block"}}),o.jsx("span",{className:"route-icon-popover",children:((me=it==null?void 0:it.codex)==null?void 0:me.routeId)===C.id?"Codex 已绑定此路由,点击解绑":"点击将 Codex 绑定到此路由"})]}),o.jsxs("div",{style:{position:"relative"},children:[o.jsx("img",{src:YF,alt:"Claude Code",onClick:Ct=>{var yr;Ct.stopPropagation(),!yi&&(((yr=it==null?void 0:it["claude-code"])==null?void 0:yr.routeId)===C.id?Sd("claude-code"):wd("claude-code",C.id))},style:{width:"18px",height:"18px",borderRadius:"50%",cursor:yi?"wait":"pointer",opacity:((Oe=it==null?void 0:it["claude-code"])==null?void 0:Oe.routeId)===C.id?1:.1,transition:"opacity 0.2s ease",objectFit:"cover",flexShrink:0,display:"block"}}),o.jsx("span",{className:"route-icon-popover",children:((kt=it==null?void 0:it["claude-code"])==null?void 0:kt.routeId)===C.id?"Claude Code 已绑定此路由,点击解绑":"点击将 Claude Code 绑定到此路由"})]})]})]}),C.description&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-route-muted)",marginTop:"2px"},children:C.description}),o.jsxs("div",{className:"action-buttons",style:{marginTop:"8px"},children:[o.jsx("button",{className:"btn btn-secondary",style:{padding:"4px 8px",fontSize:"12px"},onClick:Ct=>{Ct.stopPropagation(),V(C),O(!0)},children:"编辑"}),o.jsx("button",{className:"btn btn-danger",style:{padding:"4px 8px",fontSize:"12px"},onClick:Ct=>{Ct.stopPropagation(),fL(C.id)},children:"删除"})]})]})},C.id)})})]}),o.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:o.jsxs("div",{className:"card",style:{flex:1},children:[o.jsxs("div",{className:"toolbar",children:[o.jsx("h3",{children:"规则列表"}),A&&o.jsx("button",{className:"btn btn-primary",onClick:ML,children:"新建规则"})]}),A?a.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"暂无路由规则"})}):o.jsxs("table",{className:"rules-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"col-priority",children:"优先级"}),o.jsx("th",{children:"类型"}),o.jsx("th",{children:"API服务"}),o.jsx("th",{children:"状态"}),o.jsx("th",{children:"用量情况"}),o.jsx("th",{children:"操作"})]})}),o.jsx("tbody",{children:[...a].sort((C,re)=>{const me=Zj[C.contentType]??999,Oe=Zj[re.contentType]??999;if(me!==Oe)return me-Oe;const kt=C.sortOrder||0;return(re.sortOrder||0)-kt}).map(C=>{var kt,Ct,yr,nc;const re=d.find(Fe=>Fe.id===C.targetServiceId),me=u.find(Fe=>Fe.id===(re==null?void 0:re.vendorId)),Oe=(kt=Qj.find(Fe=>Fe.value===C.contentType))==null?void 0:kt.label;return o.jsxs("tr",{children:[o.jsx("td",{className:"col-priority",style:C.isDisabled?{opacity:.4}:void 0,children:o.jsxs("div",{className:"col-priority-box",children:[o.jsx("span",{children:C.sortOrder||0}),o.jsx("button",{className:"priority-arrow-btn",onClick:()=>xL(C.id),title:"降至最低优先级",children:"↓"}),o.jsx("button",{className:"priority-arrow-btn",onClick:()=>vL(C.id),title:"升至最高优先级",children:"↑"})]})}),o.jsx("td",{style:C.isDisabled?{opacity:.4}:void 0,children:o.jsxs("div",{style:{fontSize:"12px",whiteSpace:"nowrap"},children:[C.contentType!=="default"&&Jj[C.contentType]&&o.jsx("span",{style:{fontSize:"14px"},children:Jj[C.contentType]}),o.jsx("span",{children:Oe}),C.contentType==="model-mapping"&&C.replacedModel&&o.jsxs("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:()=>ee(C.id),onMouseLeave:()=>ee(null),children:[o.jsx("span",{style:{cursor:"help",fontSize:"14px",color:"var(--text-info)",fontWeight:"bold"},children:"ⓘ"}),fe===C.id&&o.jsxs("div",{style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"calc(100% + 8px)",backgroundColor:"var(--bg-popover, #333)",color:"var(--text-popover, #fff)",padding:"6px 10px",borderRadius:"4px",fontSize:"12px",whiteSpace:"nowrap",zIndex:1e3,boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},children:["被顶替的模型是: ",C.replacedModel,o.jsx("div",{style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"-4px",width:"0",height:"0",borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid var(--bg-popover, #333)"}})]})]})]})}),o.jsx("td",{style:C.isDisabled?{opacity:.4}:void 0,children:o.jsx("div",{className:"vendor-sevices-col",style:{fontSize:"0.6em"},children:C.useMCP?o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:["MCP:",((Ct=v.find(Fe=>Fe.id===C.mcpId))==null?void 0:Ct.name)||"Unknown"]}),o.jsx("div",{style:{fontSize:"11px",color:"var(--text-muted)"},children:"使用MCP工具"})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:["供应商:",me?me.name:"Unknown"]}),o.jsxs("div",{children:["服务:",re?re.name:"Unknown"]}),o.jsxs("div",{children:["模型:",C.targetModel||"透传模型"]})]})})}),o.jsx("td",{style:{whiteSpace:"nowrap",...C.isDisabled?{opacity:.4}:{}},children:(()=>{var Nw,Mw,_w,Rw;const Fe=NL(C),Gn=ge[C.id],_L=(Gn==null?void 0:Gn.isBlacklisted)&&!((Nw=Fe.reason)!=null&&Nw.includes("Token超限"))&&!((Mw=Fe.reason)!=null&&Mw.includes("次数超限"));if(C.isDisabled)return o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[o.jsx("span",{style:{color:"#6c757d",fontWeight:"bold",fontSize:"14px"},children:"⊘"}),o.jsx("span",{style:{fontSize:"13px",color:"#6c757d",fontWeight:"bold"},children:"已屏蔽"})]});const RL=_L||((_w=t[C.id])==null?void 0:_w.status)==="error"||((Rw=t[C.id])==null?void 0:Rw.status)==="suspended";return o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[Fe.status==="success"&&o.jsx("span",{style:{color:"#28a745",fontWeight:"bold",fontSize:"14px"},children:"✓"}),Fe.status==="warning"&&o.jsx("span",{style:{color:"#ffc107",fontWeight:"bold",fontSize:"14px"},children:"⚠"}),Fe.status==="error"&&o.jsx("span",{style:{color:"#dc3545",fontWeight:"bold",fontSize:"14px"},children:"✗"}),Fe.status==="suspended"&&o.jsx("span",{style:{color:"#6f42c1",fontWeight:"bold",fontSize:"14px"},children:"⏸"}),Fe.status==="in_use"&&o.jsx(o.Fragment,{children:o.jsx("span",{style:{color:"#007bff",fontWeight:"bold",fontSize:"14px",animation:"pulse 1.5s ease-in-out infinite"},children:"●"})}),o.jsx("span",{style:{fontSize:"13px",color:Fe.status==="success"?"#28a745":Fe.status==="warning"?"#ffc107":Fe.status==="in_use"?"#007bff":Fe.status==="suspended"?"#6f42c1":"#dc3545",fontWeight:Fe.status!=="success"?"bold":"normal"},children:Fe.label}),Fe.reason&&o.jsxs("div",{style:{position:"relative",display:"inline-block",cursor:"help"},onMouseEnter:()=>ee(C.id+"-status"),onMouseLeave:()=>ee(null),children:[o.jsx("span",{style:{fontSize:"12px",color:"#999",marginLeft:"4px"},children:" ⓘ"}),fe===C.id+"-status"&&o.jsxs("div",{style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"calc(100% + 8px)",backgroundColor:"var(--bg-popover, #333)",color:"var(--text-popover, #fff)",padding:"6px 10px",borderRadius:"4px",fontSize:"12px",whiteSpace:"nowrap",zIndex:1e3,boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},children:[Fe.reason,o.jsx("div",{style:{position:"absolute",left:"50%",transform:"translateX(-50%)",bottom:"-4px",width:"0",height:"0",borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderTop:"4px solid var(--bg-popover, #333)"}})]})]})]}),RL&&o.jsx("button",{className:"btn btn-info",style:{padding:"2px 8px",fontSize:"11px"},onClick:()=>yL(C.id),children:"恢复"})]})})()}),o.jsx("td",{style:C.isDisabled?{opacity:.4}:void 0,children:C.tokenLimit||C.requestCountLimit?o.jsxs("div",{style:{fontSize:"13px"},children:[C.tokenLimit&&o.jsxs("div",{style:{whiteSpace:"nowrap"},children:[o.jsx("span",{style:{fontWeight:"bold",fontSize:"12px"},children:"Tokens:"}),o.jsxs(o.Fragment,{children:[o.jsxs("span",{style:{color:(()=>{var Gn;const Fe=((Gn=t[C.id])==null?void 0:Gn.totalTokensUsed)??C.totalTokensUsed;return Fe&&C.tokenLimit&&Fe>=C.tokenLimit*1e3?"red":"inherit"})()},children:[(((((yr=t[C.id])==null?void 0:yr.totalTokensUsed)??C.totalTokensUsed)||0)/1e3).toFixed(1),"K/",C.tokenLimit.toFixed(0),"K"]}),(()=>{var Gn;const Fe=((Gn=t[C.id])==null?void 0:Gn.totalTokensUsed)??C.totalTokensUsed;return Fe&&C.tokenLimit&&Fe>=C.tokenLimit*1e3?o.jsx("span",{style:{color:"red",marginLeft:"4px",fontWeight:"bold",fontSize:"11px"},children:"超限"}):null})()]})]}),C.requestCountLimit&&o.jsxs("div",{style:{marginTop:C.tokenLimit?"6px":0},children:[o.jsx("span",{style:{fontWeight:"bold",fontSize:"12px"},children:"次数:"}),o.jsxs(o.Fragment,{children:[o.jsxs("span",{style:{color:(()=>{var Gn;const Fe=((Gn=t[C.id])==null?void 0:Gn.totalRequestsUsed)??C.totalRequestsUsed;return Fe&&C.requestCountLimit&&Fe>=C.requestCountLimit?"red":"inherit"})()},children:[(((nc=t[C.id])==null?void 0:nc.totalRequestsUsed)??C.totalTokensUsed)||0,"/",C.requestCountLimit]}),(()=>{var Gn;const Fe=((Gn=t[C.id])==null?void 0:Gn.totalRequestsUsed)??C.totalRequestsUsed;return Fe&&C.requestCountLimit&&Fe>=C.requestCountLimit?o.jsx("span",{style:{color:"red",marginLeft:"4px",fontWeight:"bold",fontSize:"11px"},children:"超限"}):null})()]})]})]}):o.jsx("span",{style:{color:"#999",fontSize:"12px"},children:"不限制"})}),o.jsx("td",{children:o.jsxs("div",{className:"action-buttons",style:{justifyContent:"flex-end"},children:[o.jsx("button",{className:`btn ${C.isDisabled?"btn-success":"btn-warning"}`,onClick:()=>gL(C.id),title:C.isDisabled?"启用规则":"临时屏蔽规则",children:C.isDisabled?"启用":"屏蔽"}),o.jsx("button",{className:"btn btn-secondary",onClick:()=>IL(C),children:"编辑"}),o.jsx("button",{className:"btn btn-danger",onClick:()=>mL(C.id),children:"删除"})]})})]},C.id)})})]}):o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"请先选择一个路由"})}),A&&a.length>0&&o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-info-box)",marginTop:"16px",padding:"12px",backgroundColor:"var(--bg-info-box)",borderRadius:"6px",border:"1px solid var(--border-info-box)",lineHeight:"1.6"},children:[o.jsx("strong",{children:"📌 如何配置规则(推荐)"}),o.jsxs("div",{style:{marginTop:"6px"},children:["• 先创建一条 ",o.jsx("strong",{children:"默认"})," 规则作为兜底,避免请求无规则可走",o.jsx("br",{}),"• 再按你的实际场景增加规则:如图像理解、长上下文、思考、高智商等",o.jsx("br",{}),"• 按类型匹配顺序:",o.jsx("strong",{children:"压缩对话 → 图像理解 → 高智商 → 长上下文 → 思考 → 后台 → 模型顶替 → 默认"}),o.jsx("br",{}),"• 如果要“指定模型走指定服务”,再加 ",o.jsx("strong",{children:"模型顶替"})," 规则",o.jsx("br",{}),"• 同一类型可配多条:",o.jsx("strong",{children:"把主力服务放上面(优先级更大),备用服务放下面"}),o.jsx("br",{}),"• 开启智能故障切换后,系统会在主力不可用时自动切到下一个可用规则",o.jsx("br",{}),"• 你只需要记住:",o.jsx("strong",{children:"先分类型,再排顺序,上主下备"})]})]}),A&&a.length>0&&o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-info-box)",marginTop:"12px",padding:"12px",backgroundColor:"var(--bg-info-box)",borderRadius:"6px",border:"1px solid var(--border-info-box)",lineHeight:"1.6"},children:[o.jsx("strong",{children:"💡 智能故障切换机制"}),o.jsxs("div",{style:{marginTop:"6px"},children:["• 当同一请求类型配置多个规则时,系统会按排序优先使用第一个",o.jsx("br",{}),"• 如果某个服务报错(4xx/5xx)或请求超时,将自动切换到下一个可用服务",o.jsx("br",{}),"• 报错或超时的服务会被标记为不可用(默认10秒),可在设置页面修改“故障自动恢复时间”",o.jsx("br",{}),"• 到达恢复时间后自动解除标记,如果再次报错或超时则重新标记",o.jsx("br",{}),"• 确保您的请求始终路由到稳定可用的服务",o.jsx("br",{}),"• 规则状态列会实时显示每个规则的可用性状态",o.jsx("br",{}),"• 如不需要此功能,可在",o.jsx("strong",{children:"设置"}),'页面关闭"启用智能故障切换"选项']})]})]})})]})}),o.jsxs("div",{className:"card",children:[o.jsx("div",{className:"toolbar",children:o.jsx("h3",{children:"规则配置"})}),o.jsxs("div",{style:{padding:"20px"},children:[o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"rule-global-timeout",style:{marginBottom:0,minWidth:"140px",whiteSpace:"nowrap"},children:"超时时间(秒)"}),o.jsx("input",{id:"rule-global-timeout",type:"number",value:Ve,onChange:C=>Le(C.target.value),onBlur:()=>EL(),min:"1",placeholder:"默认300秒",style:{flex:1,minWidth:0}})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"设置规则的全局超时时间。当单个规则未配置超时时间时,将使用此值作为超时上限。 不设置则默认为300秒(5分钟)。超时后会自动触发故障切换到下一个可用规则。"})]})]}),o.jsxs("div",{className:"card api-binding-card",style:{marginTop:"20px"},children:[o.jsx("div",{className:"api-binding-header",children:o.jsx("h3",{children:"API 路径路由映射"})}),o.jsx("p",{className:"api-binding-desc",children:"将标准 API 路径绑定到路由,使任何兼容该 API 的编程工具都可以通过对应路径使用服务。"}),o.jsxs("div",{className:"api-binding-baseurl-row",children:[o.jsx("span",{className:"api-binding-baseurl-prefix",children:"Base URL"}),o.jsx("span",{className:"api-binding-baseurl-value",children:window.location.origin})]}),o.jsx("div",{className:"api-binding-list",children:w.map(C=>{const re=C.apiPath==="/v1/models",me=re?!!k.trim():!!C.routeId;return o.jsxs("div",{className:"api-binding-row",children:[o.jsx("span",{className:`api-binding-status ${me?"api-binding-status--bound":""}`}),o.jsx("span",{className:"api-binding-path",children:C.apiPath==="/v1beta/models"?"/v1beta/models/{model}:{action}":C.apiPath}),o.jsx("span",{className:"api-binding-arrow",children:"→"}),o.jsx("div",{className:"api-binding-control",children:re?o.jsx("input",{type:"text",value:k,onChange:Oe=>j(Oe.target.value),onBlur:sL,placeholder:"自定义模型列表,英文逗号分隔,留空使用默认列表"}):o.jsxs("select",{value:C.routeId||"",onChange:Oe=>oL(C.apiPath,Oe.target.value||null),children:[o.jsx("option",{value:"",children:"无"}),r.map(Oe=>o.jsx("option",{value:Oe.id,children:Oe.name},Oe.id))]})})]},C.apiPath)})})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("div",{className:"toolbar",children:o.jsx("h3",{children:"Claude Code 全局配置"})}),o.jsxs("div",{style:{padding:"20px"},children:[o.jsxs("div",{className:"tool-binding-block",children:[o.jsxs("div",{className:"tool-binding-label",children:[o.jsx("span",{className:"tool-binding-label-icon",children:"⚡"}),"激活路由"]}),o.jsxs("div",{className:"tool-binding-row",children:[o.jsxs("select",{id:"claude-route-binding",value:((kw=it==null?void 0:it["claude-code"])==null?void 0:kw.routeId)||"",onChange:C=>{const re=C.target.value||null;re&&wd("claude-code",re)},disabled:yi==="claude-code",children:[o.jsx("option",{value:"",children:"选择要激活的路由..."}),r.map(C=>{var re;return o.jsxs("option",{value:C.id,children:[C.name,((re=it==null?void 0:it["claude-code"])==null?void 0:re.routeId)===C.id?" (已激活)":""]},C.id)})]}),((Cw=it==null?void 0:it["claude-code"])==null?void 0:Cw.routeId)&&o.jsx("button",{className:"btn btn-warning tool-binding-deactivate-btn",onClick:()=>Sd("claude-code"),disabled:yi==="claude-code",children:yi==="claude-code"?"处理中...":"停用"})]}),o.jsx("div",{className:"tool-binding-desc",children:"选择一条路由用于 Claude Code 代理请求。激活后,/claude-code/ 路径的请求将使用该路由的规则。"})]}),o.jsxs("div",{style:{marginTop:"20px",marginBottom:"20px"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("input",{type:"checkbox",id:"agent-teams-toggle",checked:(y==null?void 0:y.enableAgentTeams)||!1,onChange:C=>bL(C.target.checked),style:{cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("label",{htmlFor:"agent-teams-toggle",style:{cursor:"pointer",fontSize:"14px",userSelect:"none"},children:"开启 Agent Teams 功能"})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"开启后将启用 Agent Teams 实验性功能,并实时写入配置;重启 Claude Code 后生效。"})]}),o.jsxs("div",{children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("input",{type:"checkbox",id:"bypass-permissions-support-toggle",checked:(y==null?void 0:y.enableBypassPermissionsSupport)||!1,onChange:C=>wL(C.target.checked),style:{cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("label",{htmlFor:"bypass-permissions-support-toggle",style:{cursor:"pointer",fontSize:"14px",userSelect:"none"},children:"开启对 bypassPermissions 的支持"})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"开启后默认编辑跳过危险模式权限提示,你可以切换到其他模式。该设置会实时写入配置文件,重启 Claude Code 后生效。"})]}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{style:{marginBottom:0,minWidth:"100px",whiteSpace:"nowrap"},children:"默认权限模式"}),o.jsx("div",{style:{flex:1,minWidth:0},children:o.jsx(LF,{value:Wg(y),options:zv.filter(C=>C.value!=="bypassPermissions"||(y==null?void 0:y.enableBypassPermissionsSupport)).map(C=>({value:C.value,label:C.label,description:C.desc})),onChange:C=>SL(C)})})]}),o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:[(Pw=zv.find(C=>C.value===Wg(y)))==null?void 0:Pw.desc,y!=null&&y.enableBypassPermissionsSupport?"":" 需先开启上方的 bypassPermissions 支持,才能切换到 bypassPermissions 模式。"," 该设置会实时写入 ~/.claude/settings.json,重启 Claude Code 后生效。"]})]}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"claude-effort-level",style:{marginBottom:0,minWidth:"100px",whiteSpace:"nowrap"},children:"Effort Level"}),o.jsx("select",{id:"claude-effort-level",value:JF(y),onChange:C=>kL(C.target.value),disabled:Gi,style:{flex:1,minWidth:0},children:sO.map(C=>o.jsx("option",{value:C.value,children:C.label},C.value))})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"该设置会实时写入 ~/.claude/settings.json,重启 Claude Code 后生效。"})]}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"claude-default-model",style:{marginBottom:0,minWidth:"100px",whiteSpace:"nowrap"},children:"默认模型"}),o.jsx("input",{id:"claude-default-model",type:"text",value:ce,onChange:C=>{_t(C.target.value),ar(C.target.value!==((y==null?void 0:y.claudeDefaultModel)||""))},onBlur:()=>{En&&CL()},placeholder:"例如:claude-3-5-sonnet-20241022",style:{flex:1,minWidth:0}})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"设置后写入 ~/.claude/settings.json 的 model 字段,重启 Claude Code 后生效。留空则不写入。"})]}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"claude-autocompact-pct",style:{marginBottom:0,minWidth:"100px",whiteSpace:"nowrap"},children:"Autocompact PCT"}),o.jsx("input",{id:"claude-autocompact-pct",type:"number",min:"1",max:"100",value:Xi,onChange:C=>{on(C.target.value),z(C.target.value!==((y==null?void 0:y.autocompactPctOverride)!=null?String(y.autocompactPctOverride):""))},onBlur:()=>{B&&PL()},placeholder:"1-100",style:{flex:1,minWidth:0}})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"设置自动压缩百分比阈值(1-100),写入 ~/.claude/settings.json 的 env 字段,重启 Claude Code 后生效。留空则不写入。"})]})]})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("div",{className:"toolbar",children:o.jsx("h3",{children:"Codex 全局配置"})}),o.jsxs("div",{style:{padding:"20px"},children:[o.jsxs("div",{className:"tool-binding-block",children:[o.jsxs("div",{className:"tool-binding-label",children:[o.jsx("span",{className:"tool-binding-label-icon",children:"⚡"}),"激活路由"]}),o.jsxs("div",{className:"tool-binding-row",children:[o.jsxs("select",{id:"codex-route-binding",value:((Aw=it==null?void 0:it.codex)==null?void 0:Aw.routeId)||"",onChange:C=>{const re=C.target.value||null;re&&wd("codex",re)},disabled:yi==="codex",children:[o.jsx("option",{value:"",children:"选择要激活的路由..."}),r.map(C=>{var re;return o.jsxs("option",{value:C.id,children:[C.name,((re=it==null?void 0:it.codex)==null?void 0:re.routeId)===C.id?" (已激活)":""]},C.id)})]}),((Ew=it==null?void 0:it.codex)==null?void 0:Ew.routeId)&&o.jsx("button",{className:"btn btn-warning tool-binding-deactivate-btn",onClick:()=>Sd("codex"),disabled:yi==="codex",children:yi==="codex"?"处理中...":"停用"})]}),o.jsx("div",{className:"tool-binding-desc",children:"选择一条路由用于 Codex 代理请求。激活后,/codex/ 路径的请求将使用该路由的规则。"})]}),o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"codex-reasoning-effort",style:{marginBottom:0,minWidth:"120px",whiteSpace:"nowrap"},children:"Reasoning Effort"}),o.jsx("select",{id:"codex-reasoning-effort",value:ZF(y),onChange:C=>jL(C.target.value),disabled:jt,style:{flex:1,minWidth:0},children:oO.map(C=>o.jsx("option",{value:C.value,children:C.label},C.value))})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"该设置会实时写入 ~/.codex/config.toml,重启 Codex 后生效。"}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsxs("div",{className:"form-group",style:{marginBottom:"0",maxWidth:"420px",display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("label",{htmlFor:"codex-default-model",style:{marginBottom:0,minWidth:"100px",whiteSpace:"nowrap"},children:"默认模型"}),o.jsx("input",{id:"codex-default-model",type:"text",value:Pe,onChange:C=>{ot(C.target.value),xt(C.target.value!==((y==null?void 0:y.codexDefaultModel)||""))},onBlur:()=>{Be&&AL()},placeholder:"例如:o1",style:{flex:1,minWidth:0}})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"设置后写入 ~/.codex/config.toml 的 model 字段,重启 Codex 后生效。留空则使用默认值 gpt-5.3-codex。"})]}),o.jsxs("div",{style:{marginTop:"20px",marginBottom:"20px"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[o.jsx("input",{type:"checkbox",id:"codex-enable-memories-toggle",checked:!!(y!=null&&y.codexEnableMemories),onChange:async C=>{try{const re=y||{};await Y.updateConfig({...re,codexEnableMemories:C.target.checked}),await Or(),await Y.writeCodexConfig(void 0,C.target.checked),K.success("记忆功能设置已保存(重启 Codex 后生效)")}catch(re){K.error("更新失败: "+re.message)}},style:{cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("label",{htmlFor:"codex-enable-memories-toggle",style:{cursor:"pointer",fontSize:"14px",userSelect:"none"},children:"开启记忆功能"})]}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"12px"},children:"开启后会在 ~/.codex/config.toml 中添加 features.memories 和 memories 配置段。"})]})]})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("div",{className:"toolbar",children:o.jsx("h3",{children:"📝 配置文件自动管理"})}),o.jsxs("div",{style:{padding:"20px",lineHeight:"1.8"},children:[o.jsxs("div",{style:{background:"var(--bg-info-blue)",padding:"15px",borderRadius:"8px",marginBottom:"15px",borderLeft:"4px solid var(--border-info-blue)"},children:[o.jsx("strong",{children:"💡 工作原理"}),o.jsx("p",{style:{marginTop:"8px",marginBottom:"0"},children:"配置文件由服务生命周期统一管理:服务启动时自动写入代理配置,服务停止时自动恢复原始配置;运行中修改全局工具配置会实时写入配置文件。"})]}),o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"15px"},children:[o.jsxs("div",{style:{background:"var(--bg-info-green)",padding:"15px",borderRadius:"8px",borderLeft:"4px solid var(--border-info-green)"},children:[o.jsx("strong",{children:"✓ 服务启动"}),o.jsxs("ul",{style:{marginTop:"8px",paddingLeft:"20px",marginBottom:"0"},children:[o.jsx("li",{children:"自动备份并覆盖配置文件"}),o.jsx("li",{children:"按全局工具设置写入 Claude/Codex 配置"})]})]}),o.jsxs("div",{style:{background:"var(--bg-info-orange)",padding:"15px",borderRadius:"8px",borderLeft:"4px solid var(--border-info-orange)"},children:[o.jsx("strong",{children:"○ 服务停止"}),o.jsxs("ul",{style:{marginTop:"8px",paddingLeft:"20px",marginBottom:"0"},children:[o.jsx("li",{children:"自动恢复原始配置文件"}),o.jsx("li",{children:"删除备份文件"})]})]})]}),o.jsxs("div",{style:{marginTop:"15px",padding:"12px 15px",background:"var(--bg-info-yellow)",borderRadius:"8px",borderLeft:"4px solid var(--border-info-yellow)"},children:[o.jsx("strong",{children:"⚠️ 重要提示"}),o.jsxs("ul",{style:{marginTop:"8px",paddingLeft:"20px",marginBottom:"0"},children:[o.jsx("li",{children:"修改路由规则后立即生效;修改全局工具配置后仅需重启对应编程工具(无需重启服务)"}),o.jsx("li",{children:"操作前建议关闭编程工具,避免配置冲突"})]})]}),o.jsxs("details",{style:{marginTop:"15px",cursor:"pointer"},children:[o.jsx("summary",{style:{fontWeight:"bold",color:"#666"},children:"📂 配置文件位置(点击展开)"}),o.jsxs("ul",{style:{marginTop:"8px",paddingLeft:"20px",color:"#666"},children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Claude Code:"})," ~/.claude/settings.json, ~/.claude.json"]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Codex:"})," ~/.codex/config.toml, ~/.codex/auth.json"]})]})]})]})]}),D&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>O(!1),"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:X?"编辑路由":"新建路由"})}),o.jsxs("form",{onSubmit:pL,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"路由名称"}),o.jsx("input",{type:"text",name:"name",defaultValue:X?X.name:"",required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"描述"}),o.jsx("textarea",{name:"description",rows:3,defaultValue:X?X.description:""})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>O(!1),children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存"})]})]})]})})]}),_&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>R(!1),"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:I?"编辑规则":"新建规则"})}),o.jsxs("form",{onSubmit:hL,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"对象请求类型"}),o.jsx("select",{name:"contentType",value:le,required:!0,onChange:C=>{Se(C.target.value)},children:TL().map(C=>o.jsx("option",{value:C.value,children:C.label},C.value))})]}),le==="high-iq"&&o.jsxs("div",{style:{background:"var(--bg-info-blue)",padding:"12px",borderRadius:"6px",borderLeft:"4px solid var(--border-info-blue)",marginBottom:"16px"},children:[o.jsx("div",{style:{fontSize:"13px",fontWeight:"bold",marginBottom:"6px"},children:"💡 高智商请求使用方法"}),o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-muted)",lineHeight:"1.6"},children:["在编程工具中输入提示词时:",o.jsxs("ul",{style:{marginTop:"8px",paddingLeft:"20px",lineHeight:"1.8"},children:[o.jsxs("li",{children:["使用 ",o.jsx("code",{style:{background:"var(--bg-code-inline, #f5f5f5)",padding:"2px 6px",borderRadius:"3px",fontFamily:"monospace",fontSize:"12px"},children:"[!]"})," 标记高智商请求(仅在”最近一条真实用户输入”生效)"]}),o.jsxs("li",{children:["使用 ",o.jsx("code",{style:{background:"var(--bg-code-inline, #f5f5f5)",padding:"2px 6px",borderRadius:"3px",fontFamily:"monospace",fontSize:"12px"},children:"[x]"})," 标记退出高智商模式,继续走普通模式"]})]})]}),o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"8px",lineHeight:"1.6"},children:[o.jsx("strong",{children:"示例:"}),o.jsx("br",{}),"• ",o.jsx("code",{style:{background:"var(--bg-code-inline, #f5f5f5)",padding:"2px 6px",borderRadius:"3px",fontFamily:"monospace",fontSize:"12px"},children:"[!] 重构A模块"}),o.jsx("br",{}),"• ",o.jsx("code",{style:{background:"var(--bg-code-inline, #f5f5f5)",padding:"2px 6px",borderRadius:"3px",fontFamily:"monospace",fontSize:"12px"},children:"继续正常对话(不加 [!])"}),o.jsx("br",{}),"• ",o.jsx("code",{style:{background:"var(--bg-code-inline, #f5f5f5)",padding:"2px 6px",borderRadius:"3px",fontFamily:"monospace",fontSize:"12px"},children:"[x] 接下来帮我解决一个简单的问题"})]})]}),le==="model-mapping"&&o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["被顶替模型 ",o.jsx("small",{children:"(可在日志中找出想要顶替的模型名)"})]}),o.jsx("input",{type:"text",value:T,onChange:C=>he(C.target.value),placeholder:"例如:gpt-4"})]}),le==="long-context"&&o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["Session累积Tokens阈值 (单位: k) ",o.jsx("small",{children:"默认1000k (1M tokens)"})]}),o.jsx("input",{type:"number",value:Ye??1e3,onChange:C=>tt(Number(C.target.value)),placeholder:"1000",min:"1"}),o.jsxs("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:["当前对话(session)的累积tokens数量超过 ",Ye??1e3,"k 时,该对话的新请求将走此规则"]})]}),le==="image-understanding"&&o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:de,onChange:C=>ve(C.target.checked),style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"使用MCP"})]}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"开启后,将使用MCP工具处理图像理解请求,而不是直接调用API服务"})]}),le==="image-understanding"&&de&&o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["选择MCP工具 ",o.jsx("span",{className:"required",children:"*"})]}),o.jsx("div",{style:{maxHeight:"300px",overflowY:"auto",border:"1px solid var(--border-primary)",borderRadius:"6px",padding:"8px"},children:v.length===0?o.jsx("div",{style:{padding:"12px",textAlign:"center",color:"var(--text-muted)"},children:"暂无MCP工具,请先在MCP管理页面添加"}):v.map(C=>o.jsxs("div",{onClick:()=>Ee(C.id),style:{padding:"12px",marginBottom:"8px",border:`2px solid ${Ae===C.id?"var(--primary-color)":"var(--border-primary)"}`,borderRadius:"6px",cursor:"pointer",backgroundColor:Ae===C.id?"var(--bg-info-blue)":"var(--bg-card)",transition:"all 0.2s ease"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o.jsx("div",{style:{fontWeight:600,fontSize:"14px"},children:C.name}),o.jsx("div",{className:"badge badge-secondary",style:{fontSize:"11px"},children:C.type==="stdio"?"命令行":C.type.toUpperCase()})]}),C.description&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"4px"},children:C.description})]},C.id))})]}),!de&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商"}),o.jsxs("select",{value:H,onChange:C=>N(C.target.value),required:!0,children:[o.jsx("option",{value:"",disabled:!0,children:"请选择供应商"}),u.map(C=>o.jsx("option",{value:C.id,children:C.name},C.id))]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商API服务"}),o.jsxs("select",{value:U,onChange:C=>{const re=C.target.value;P(re),se("");const me=d.find(Oe=>Oe.id===re);me&&(me.enableTokenLimit&&me.tokenLimit?(ne(me.tokenLimit),ie(me.tokenResetInterval),ke(me.tokenResetBaseTime?new Date(me.tokenResetBaseTime):void 0),Ie(me.tokenLimit),je(!0),Ze(!0)):(Ie(void 0),je(!1),Ze(!1)),me.enableRequestLimit&&me.requestCountLimit?(pt(me.requestCountLimit),Xe(me.requestResetInterval),et(me.requestResetBaseTime?new Date(me.requestResetBaseTime):void 0),L(me.requestCountLimit),ze(!0),Kt(!0)):(L(void 0),ze(!1),Kt(!1)))},required:!0,disabled:!H,children:[o.jsx("option",{value:"",disabled:!0,children:"请选择API服务"}),m.map(C=>o.jsx("option",{value:C.id,children:C.name},C.id))]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商模型"}),o.jsxs("select",{value:W,onChange:C=>se(C.target.value),disabled:!U,children:[o.jsx("option",{value:"",children:"透传模型名"}),(Iw=(Tw=d.find(C=>C.id===U))==null?void 0:Tw.supportedModels)==null?void 0:Iw.map(C=>o.jsx("option",{value:C,children:C},C))]})]}),o.jsx("div",{className:"form-group",children:o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:xe?"not-allowed":"pointer"},children:[o.jsx("input",{type:"checkbox",checked:at,onChange:C=>Ze(C.target.checked),disabled:xe,style:{marginRight:"8px",cursor:xe?"not-allowed":"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用Tokens超量限制"}),xe&&o.jsx("small",{style:{color:"#999",fontSize:"12px",marginLeft:"8px"},children:"(从API服务继承)"})]}),xe&&o.jsx("button",{type:"button",className:"btn btn-sm btn-secondary",onClick:()=>je(!1),style:{padding:"4px 12px",fontSize:"12px"},children:"自定义限制"})]})}),at&&!xe&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"Tokens超量(单位:k)"}),o.jsx("input",{type:"number",value:Q||"",onChange:C=>{const re=C.target.value?parseInt(C.target.value):void 0;if(re!==void 0&&Ke!==void 0&&re>Ke){K.warning(`Token超量值不能超过API服务的限制 (${Ke}k)`);return}ne(re),xe&&re!==Ke&&je(!1)},min:"0",max:Ke,placeholder:Ke?`最大 ${Ke}k`:"不限制",disabled:xe}),Ke&&o.jsxs("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:["⚠️ API服务限制:最大 ",Ke,"k,当前值不能超过此限制"]}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"当编程工具的请求tokens达到这个量时,在配置了其他规则的情况下,本条规则将失效,从而保护你的余额。例如:输入100表示100k即100,000个tokens"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"Tokens超量自动重置间隔(小时)"}),o.jsx("input",{type:"number",value:pe||"",onChange:C=>{ie(C.target.value?parseInt(C.target.value):void 0),xe&&je(!1)},min:"1",placeholder:"不自动重置",disabled:xe}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"设置后,系统将每隔指定小时数自动重置token计数。例如设置5小时,则每5小时重置一次"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"Token下一次重置时间基点"}),o.jsx("input",{type:"datetime-local",value:_e?ek(_e):"",onChange:C=>{C.target.value?ke(new Date(C.target.value)):ke(void 0),xe&&je(!1)},disabled:!pe||xe,className:"datetime-picker-input"}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:'配合"Tokens超量自动重置间隔"使用,设置下一次重置的精确时间点。例如,每月1日0点重置(间隔720小时),或每周一0点重置(间隔168小时)。设置后,系统会基于此时间点自动计算后续重置周期'})]})]}),o.jsx("div",{className:"form-group",children:o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:Re?"not-allowed":"pointer"},children:[o.jsx("input",{type:"checkbox",checked:nn,onChange:C=>Kt(C.target.checked),disabled:Re,style:{marginRight:"8px",cursor:Re?"not-allowed":"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用请求次数超量限制"}),Re&&o.jsx("small",{style:{color:"#999",fontSize:"12px",marginLeft:"8px"},children:"(从API服务继承)"})]}),Re&&o.jsx("button",{type:"button",className:"btn btn-sm btn-secondary",onClick:()=>ze(!1),style:{padding:"4px 12px",fontSize:"12px"},children:"自定义限制"})]})}),nn&&!Re&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求次数超量"}),o.jsx("input",{type:"number",value:We||"",onChange:C=>{const re=C.target.value?parseInt(C.target.value):void 0;if(re!==void 0&&Ge!==void 0&&re>Ge){K.warning(`请求次数超量值不能超过API服务的限制 (${Ge})`);return}pt(re),Re&&re!==Ge&&ze(!1)},min:"0",max:Ge,placeholder:Ge?`最大 ${Ge}`:"不限制",disabled:Re}),Ge&&o.jsxs("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:["⚠️ API服务限制:最大 ",Ge,",当前值不能超过此限制"]}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"当请求次数达到这个量时,在配置了其他规则的情况下,本条规则将失效"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求次数自动重置间隔(小时)"}),o.jsx("input",{type:"number",value:qe||"",onChange:C=>{Xe(C.target.value?parseInt(C.target.value):void 0),Re&&ze(!1)},min:"1",placeholder:"不自动重置",disabled:Re}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"设置后,系统将每隔指定小时数自动重置请求次数计数。例如设置24小时,则每24小时重置一次"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"下一次重置时间基点"}),o.jsx("input",{type:"datetime-local",value:Qe?ek(Qe):"",onChange:C=>{C.target.value?et(new Date(C.target.value)):et(void 0),Re&&ze(!1)},disabled:!qe||Re,className:"datetime-picker-input"}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:'配合"请求次数自动重置间隔"使用,设置下一次重置的精确时间点。例如,每月1日0点重置(间隔720小时),或每周一0点重置(间隔168小时)。设置后,系统会基于此时间点自动计算后续重置周期'})]})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:!!J,onChange:C=>{C.target.checked?(q(10),M(0)):(q(void 0),M(void 0))},style:{marginRight:"8px",cursor:"pointer",width:"16px",height:"16px"}}),o.jsx("span",{children:"启用请求频率限制"})]}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"启用后,当同一内容类型的请求频率超过限制时,系统会自动切换到其他同类型规则"})]}),J&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"频率限制次数(并发数)"}),o.jsx("input",{type:"number",value:J||"",onChange:C=>q(C.target.value?parseInt(C.target.value):void 0),min:"1",placeholder:"例如: 10"}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"在指定时间窗口内允许的最大请求次数"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"频率限制时间窗口(秒,0=同一时刻)"}),o.jsx("input",{type:"number",value:ue===0?0:ue||"",onChange:C=>{const re=C.target.value?parseInt(C.target.value):void 0;M(re===0?0:re)},min:"0",placeholder:"0 表示同一时刻"}),o.jsx("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:"时间窗口大小。0 表示同一时刻(并发数),持续累积;设置为 60 则在 60 秒内最多允许 N 次请求"})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"超时时间(秒)"}),o.jsx("input",{type:"number",value:te||"",onChange:C=>De(C.target.value?parseInt(C.target.value):void 0),min:"1",placeholder:y!=null&&y.ruleGlobalTimeout?`全局${y.ruleGlobalTimeout}秒`:"默认300秒"}),o.jsxs("small",{style:{color:"#666",fontSize:"12px",marginTop:"4px",display:"block"},children:["设置此规则的API请求超时时间。不设置则使用全局超时配置(当前为",y!=null&&y.ruleGlobalTimeout?`${y.ruleGlobalTimeout}秒`:"默认300秒","),超时后自动触发故障切换"]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"排序(值越大优先级越高)"}),o.jsx("input",{type:"number",value:ye,onChange:C=>Z(parseInt(C.target.value)||0),min:"0",max:"1000"})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>R(!1),children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存"})]})]})]})})]}),o.jsx(aO,{show:ct,onClose:()=>Ht(!1),onComplete:()=>{Ps(),ng(),rg(),bd(),bw()}}),o.jsx($F,{show:Zt,onClose:()=>Tt(!1),onComplete:()=>{ng(),rg()}}),bo&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:Sw,"aria-label":"关闭",children:"×"}),o.jsxs("div",{className:"modal modal--sticky-layout",style:{width:"500px",maxWidth:"90vw"},children:[o.jsx("div",{className:"modal-header",children:o.jsxs("h2",{children:["绑定会话 - ",((Ow=r.find(C=>C.id===bo))==null?void 0:Ow.name)||bo]})}),o.jsxs("div",{className:"modal-body-scrollable",style:{maxHeight:"460px"},children:[ut?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:"加载中..."}):Qi.length===0?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:o.jsx("p",{children:"暂无绑定会话"})}):o.jsxs("div",{style:{marginBottom:"12px",fontSize:"13px",color:"var(--text-tertiary)"},children:["以下 ",Qi.length," 个会话绑定了此路由:"]}),o.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[Qi.slice(0,50).map((C,re)=>{var me;return o.jsxs("div",{style:{padding:"12px 0",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"12px",borderBottom:re===Math.min(Qi.length,50)-1?"none":"1px solid var(--border-color)"},children:[o.jsxs("div",{style:{flex:1,minWidth:0},children:[o.jsx("div",{style:{fontWeight:500,fontSize:"14px",marginBottom:"4px"},children:((me=C.title)==null?void 0:me.replace(/<\/?session>/g,"").trim())||C.id.slice(0,8)}),o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",display:"flex",gap:"12px",alignItems:"center"},children:[o.jsx("span",{className:`badge ${C.targetType==="claude-code"?"badge-claude-code":"badge-codex"}`,style:{fontSize:"11px"},children:C.targetType==="claude-code"?"Claude Code":"Codex"}),o.jsxs("span",{children:[C.requestCount," 次请求"]}),o.jsxs("span",{children:[C.totalTokens.toLocaleString()," tokens"]})]})]}),o.jsx("button",{type:"button",className:"btn btn-danger",style:{flexShrink:0,padding:"4px 12px",fontSize:"12px"},disabled:vw===C.id,onClick:Oe=>{Oe.stopPropagation(),cL(C.id)},children:vw===C.id?"解绑中...":"解绑"})]},C.id)}),Qi.length>50&&o.jsxs("div",{style:{textAlign:"center",fontSize:"12px",color:"var(--text-tertiary)",padding:"8px"},children:["等共 ",Qi.length," 个会话"]})]})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("div",{style:{flex:1}}),o.jsx("button",{className:"btn btn-secondary",onClick:Sw,children:"关闭"})]})]})]})]})}var lO={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(gl,function(){var n=1e3,r=6e4,i=36e5,a="millisecond",s="second",l="minute",c="hour",u="day",p="week",d="month",f="quarter",m="year",g="date",v="Invalid Date",x=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(V){var I=["th","st","nd","rd"],$=V%100;return"["+V+(I[($-20)%10]||I[$]||I[0])+"]"}},w=function(V,I,$){var H=String(V);return!H||H.length>=I?V:""+Array(I+1-H.length).join($)+V},S={s:w,z:function(V){var I=-V.utcOffset(),$=Math.abs(I),H=Math.floor($/60),N=$%60;return(I<=0?"+":"-")+w(H,2,"0")+":"+w(N,2,"0")},m:function V(I,$){if(I.date()<$.date())return-V($,I);var H=12*($.year()-I.year())+($.month()-I.month()),N=I.clone().add(H,d),U=$-N<0,P=I.clone().add(H+(U?-1:1),d);return+(-(H+($-N)/(U?N-P:P-N))||0)},a:function(V){return V<0?Math.ceil(V)||0:Math.floor(V)},p:function(V){return{M:d,y:m,w:p,d:u,D:g,h:c,m:l,s,ms:a,Q:f}[V]||String(V||"").toLowerCase().replace(/s$/,"")},u:function(V){return V===void 0}},k="en",j={};j[k]=b;var A="$isDayjsObject",E=function(V){return V instanceof R||!(!V||!V[A])},D=function V(I,$,H){var N;if(!I)return k;if(typeof I=="string"){var U=I.toLowerCase();j[U]&&(N=U),$&&(j[U]=$,N=U);var P=I.split("-");if(!N&&P.length>1)return V(P[0])}else{var W=I.name;j[W]=I,N=W}return!H&&N&&(k=N),N||!H&&k},O=function(V,I){if(E(V))return V.clone();var $=typeof I=="object"?I:{};return $.date=V,$.args=arguments,new R($)},_=S;_.l=D,_.i=E,_.w=function(V,I){return O(V,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var R=function(){function V($){this.$L=D($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[A]=!0}var I=V.prototype;return I.parse=function($){this.$d=function(H){var N=H.date,U=H.utc;if(N===null)return new Date(NaN);if(_.u(N))return new Date;if(N instanceof Date)return new Date(N);if(typeof N=="string"&&!/Z$/i.test(N)){var P=N.match(x);if(P){var W=P[2]-1||0,se=(P[7]||"0").substring(0,3);return U?new Date(Date.UTC(P[1],W,P[3]||1,P[4]||0,P[5]||0,P[6]||0,se)):new Date(P[1],W,P[3]||1,P[4]||0,P[5]||0,P[6]||0,se)}}return new Date(N)}($),this.init()},I.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},I.$utils=function(){return _},I.isValid=function(){return this.$d.toString()!==v},I.isSame=function($,H){var N=O($);return this.startOf(H)<=N&&N<=this.endOf(H)},I.isAfter=function($,H){return O($)<this.startOf(H)},I.isBefore=function($,H){return this.endOf(H)<O($)},I.$g=function($,H,N){return _.u($)?this[H]:this.set(N,$)},I.unix=function(){return Math.floor(this.valueOf()/1e3)},I.valueOf=function(){return this.$d.getTime()},I.startOf=function($,H){var N=this,U=!!_.u(H)||H,P=_.p($),W=function(Q,ne){var pe=_.w(N.$u?Date.UTC(N.$y,ne,Q):new Date(N.$y,ne,Q),N);return U?pe:pe.endOf(u)},se=function(Q,ne){return _.w(N.toDate()[Q].apply(N.toDate("s"),(U?[0,0,0,0]:[23,59,59,999]).slice(ne)),N)},T=this.$W,he=this.$M,ye=this.$D,Z="set"+(this.$u?"UTC":"");switch(P){case m:return U?W(1,0):W(31,11);case d:return U?W(1,he):W(0,he+1);case p:var le=this.$locale().weekStart||0,Se=(T<le?T+7:T)-le;return W(U?ye-Se:ye+(6-Se),he);case u:case g:return se(Z+"Hours",0);case c:return se(Z+"Minutes",1);case l:return se(Z+"Seconds",2);case s:return se(Z+"Milliseconds",3);default:return this.clone()}},I.endOf=function($){return this.startOf($,!1)},I.$set=function($,H){var N,U=_.p($),P="set"+(this.$u?"UTC":""),W=(N={},N[u]=P+"Date",N[g]=P+"Date",N[d]=P+"Month",N[m]=P+"FullYear",N[c]=P+"Hours",N[l]=P+"Minutes",N[s]=P+"Seconds",N[a]=P+"Milliseconds",N)[U],se=U===u?this.$D+(H-this.$W):H;if(U===d||U===m){var T=this.clone().set(g,1);T.$d[W](se),T.init(),this.$d=T.set(g,Math.min(this.$D,T.daysInMonth())).$d}else W&&this.$d[W](se);return this.init(),this},I.set=function($,H){return this.clone().$set($,H)},I.get=function($){return this[_.p($)]()},I.add=function($,H){var N,U=this;$=Number($);var P=_.p(H),W=function(he){var ye=O(U);return _.w(ye.date(ye.date()+Math.round(he*$)),U)};if(P===d)return this.set(d,this.$M+$);if(P===m)return this.set(m,this.$y+$);if(P===u)return W(1);if(P===p)return W(7);var se=(N={},N[l]=r,N[c]=i,N[s]=n,N)[P]||1,T=this.$d.getTime()+$*se;return _.w(T,this)},I.subtract=function($,H){return this.add(-1*$,H)},I.format=function($){var H=this,N=this.$locale();if(!this.isValid())return N.invalidDate||v;var U=$||"YYYY-MM-DDTHH:mm:ssZ",P=_.z(this),W=this.$H,se=this.$m,T=this.$M,he=N.weekdays,ye=N.months,Z=N.meridiem,le=function(ne,pe,ie,_e){return ne&&(ne[pe]||ne(H,U))||ie[pe].slice(0,_e)},Se=function(ne){return _.s(W%12||12,ne,"0")},Q=Z||function(ne,pe,ie){var _e=ne<12?"AM":"PM";return ie?_e.toLowerCase():_e};return U.replace(y,function(ne,pe){return pe||function(ie){switch(ie){case"YY":return String(H.$y).slice(-2);case"YYYY":return _.s(H.$y,4,"0");case"M":return T+1;case"MM":return _.s(T+1,2,"0");case"MMM":return le(N.monthsShort,T,ye,3);case"MMMM":return le(ye,T);case"D":return H.$D;case"DD":return _.s(H.$D,2,"0");case"d":return String(H.$W);case"dd":return le(N.weekdaysMin,H.$W,he,2);case"ddd":return le(N.weekdaysShort,H.$W,he,3);case"dddd":return he[H.$W];case"H":return String(W);case"HH":return _.s(W,2,"0");case"h":return Se(1);case"hh":return Se(2);case"a":return Q(W,se,!0);case"A":return Q(W,se,!1);case"m":return String(se);case"mm":return _.s(se,2,"0");case"s":return String(H.$s);case"ss":return _.s(H.$s,2,"0");case"SSS":return _.s(H.$ms,3,"0");case"Z":return P}return null}(ne)||P.replace(":","")})},I.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},I.diff=function($,H,N){var U,P=this,W=_.p(H),se=O($),T=(se.utcOffset()-this.utcOffset())*r,he=this-se,ye=function(){return _.m(P,se)};switch(W){case m:U=ye()/12;break;case d:U=ye();break;case f:U=ye()/3;break;case p:U=(he-T)/6048e5;break;case u:U=(he-T)/864e5;break;case c:U=he/i;break;case l:U=he/r;break;case s:U=he/n;break;default:U=he}return N?U:_.a(U)},I.daysInMonth=function(){return this.endOf(d).$D},I.$locale=function(){return j[this.$L]},I.locale=function($,H){if(!$)return this.$L;var N=this.clone(),U=D($,H,!0);return U&&(N.$L=U),N},I.clone=function(){return _.w(this.$d,this)},I.toDate=function(){return new Date(this.valueOf())},I.toJSON=function(){return this.isValid()?this.toISOString():null},I.toISOString=function(){return this.$d.toISOString()},I.toString=function(){return this.$d.toUTCString()},V}(),X=R.prototype;return O.prototype=X,[["$ms",a],["$s",s],["$m",l],["$H",c],["$W",u],["$M",d],["$y",m],["$D",g]].forEach(function(V){X[V[1]]=function(I){return this.$g(I,V[0],V[1])}}),O.extend=function(V,I){return V.$i||(V(I,R,O),V.$i=!0),O},O.locale=D,O.isDayjs=E,O.unix=function(V){return O(1e3*V)},O.en=j[k],O.Ls=j,O.p={},O})})(lO);var tU=lO.exports;const bt=Ll(tU);var cO={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(gl,function(){return function(n,r,i){n=n||{};var a=r.prototype,s={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function l(u,p,d,f){return a.fromToBase(u,p,d,f)}i.en.relativeTime=s,a.fromToBase=function(u,p,d,f,m){for(var g,v,x,y=d.$locale().relativeTime||s,b=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],w=b.length,S=0;S<w;S+=1){var k=b[S];k.d&&(g=f?i(u).diff(d,k.d,!0):d.diff(u,k.d,!0));var j=(n.rounding||Math.round)(Math.abs(g));if(x=g>0,j<=k.r||!k.r){j<=1&&S>0&&(k=b[S-1]);var A=y[k.l];m&&(j=m(""+j)),v=typeof A=="string"?A.replace("%d",j):A(j,p,k.l,x);break}}if(p)return v;var E=x?y.future:y.past;return typeof E=="function"?E(v):E.replace("%s",v)},a.to=function(u,p){return l(u,p,this,!0)},a.from=function(u,p){return l(u,p,this)};var c=function(u){return u.$u?i.utc():i()};a.toNow=function(u){return this.to(c(this),u)},a.fromNow=function(u){return this.from(c(this),u)}}})})(cO);var nU=cO.exports;const ib=Ll(nU),xu=({currentPage:e,totalItems:t,pageSize:n,onPageChange:r,onPageSizeChange:i,pageSizeOptions:a=[10,20,50,100]})=>{const s=Math.max(1,Math.ceil(t/n)),l=e===1,c=e>=s,u=()=>{l||r(1)},p=()=>{l||r(e-1)},d=()=>{c||r(e+1)},f=()=>{c||r(s)},m=g=>{const v=parseInt(g.target.value,10);i(v)};return o.jsxs("div",{className:"pagination",children:[o.jsxs("div",{className:"pagination-info",children:["共 ",t," 条"]}),o.jsxs("div",{className:"pagination-controls",children:[o.jsx("button",{className:"pagination-btn",onClick:u,disabled:l,children:"首页"}),o.jsx("button",{className:"pagination-btn",onClick:p,disabled:l,children:"上一页"}),o.jsxs("span",{className:"pagination-info",children:["第 ",e," / ",s," 页"]}),o.jsx("button",{className:"pagination-btn",onClick:d,disabled:c,children:"下一页"}),o.jsx("button",{className:"pagination-btn",onClick:f,disabled:c,children:"尾页"})]}),o.jsx("div",{className:"pagination-size",children:o.jsxs("label",{children:["每页显示",o.jsx("select",{className:"pagination-select",value:n,onChange:m,children:a.map(g=>o.jsx("option",{value:g,children:g},g))}),"条"]})})]})},rU=["authorization","x-api-key","api-key","apikey","x-auth-token","auth-token","secret","password","api_secret","jwt","csrf_token","xsrf_token","auth_token","session_token","private_key","client_secret"],iU=e=>{const t=e.toLowerCase();return!!(rU.some(n=>t===n)||t.startsWith("api_")&&(t.endsWith("_key")||t.endsWith("_secret"))||(t.endsWith("_token")||t.endsWith("_key")||t.endsWith("_secret"))&&!["max_tokens","input_tokens","output_tokens","completion_tokens","prompt_tokens","cachereadinputtokens","totaltokens"].some(r=>t.replace(/_/g,"").includes(r.replace(/_/g,""))))},aU=e=>!e||e.length<=8?"***":`${e.slice(0,4)}${"*".repeat(Math.min(e.length-8,20))}${e.slice(-4)}`,$v=e=>{if(e==null)return e;if(Array.isArray(e))return e.map(t=>$v(t));if(typeof e=="object"){const t={};for(const[n,r]of Object.entries(e))iU(n)?t[n]=typeof r=="string"?aU(r):"***":typeof r=="object"?t[n]=$v(r):t[n]=r;return t}return e},Lr=({data:e,title:t,collapsed:n=!1})=>{const[r,i]=h.useState(!n),[a,s]=h.useState(!1),l=p=>{try{let d;typeof p=="string"?d=JSON.parse(p):d=p;const f=$v(d);return JSON.stringify(f,null,2)}catch{return typeof p=="string"?p:String(p)}},c=()=>{const p=l(e);navigator.clipboard.writeText(p).then(()=>{s(!0),setTimeout(()=>s(!1),2e3)}).catch(d=>{console.error("Failed to copy JSON:",d)})},u=l(e);return o.jsxs("div",{className:"json-viewer",children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[t&&o.jsx("h4",{style:{margin:0,fontSize:"14px",color:"var(--text-primary)"},children:t}),o.jsxs("div",{style:{display:"flex",gap:"8px"},children:[o.jsx("button",{onClick:()=>i(!r),className:"btn btn-sm btn-secondary",style:{fontSize:"12px",padding:"2px 8px"},children:r?"折叠":"展开"}),o.jsx("button",{onClick:c,className:"btn btn-sm btn-primary",style:{fontSize:"12px",padding:"2px 8px"},children:a?"已复制":"复制"})]})]}),r&&o.jsx("pre",{style:{background:"var(--bg-code)",border:"1px solid var(--border-primary)",borderRadius:"8px",padding:"12px",overflowX:"auto",fontSize:"12px",lineHeight:"1.4",color:"var(--text-primary)",maxHeight:"400px",overflowY:"auto",margin:0},children:o.jsx("code",{children:u})})]})};function Hu(e){const t=e.split(`
|
|
110
|
+
`).map(r=>r.trim()).join(`
|
|
111
|
+
`).split(`
|
|
112
|
+
|
|
113
|
+
`).filter(r=>r.trim()),n=[];for(const r of t){let i="",a=[],s=0;r.split(`
|
|
114
|
+
`).forEach(p=>{if(/^[a-z]+:/.test(p)){const d=p.indexOf(":"),f=p.slice(0,d).trim(),m=p.slice(d+1).trim();f==="event"?i=m:f==="data"?(a.push(m),s=1):a.length&&(s=-1)}else s===1&&a.push(p)});const c=a.length>0?a.join(`
|
|
115
|
+
`).trim():void 0;let u;if(c)try{u=JSON.parse(c)}catch{u=c}n.push({event:i,data:u,raw:r})}return n}function Vu(e,t){var l,c;let n="",r="",i=!1,a=!1,s=!1;for(const u of e){const p=u.data;if(p){if(u.event==="content_block_start"&&p.content_block){const d=p.content_block.type;d==="thinking"?i=!0:d==="text"&&(a=!0);continue}if(u.event==="content_block_stop"){i=!1,a=!1;continue}if(u.event==="content_block_delta"&&p.delta){p.delta.type==="text_delta"&&a?n+=p.delta.text||"":p.delta.type==="thinking_delta"&&i&&(r+=p.delta.thinking||"");continue}if(u.event==="response.reasoning_text.delta"&&p.delta!==void 0){r+=p.delta||"",s=!0;continue}if(u.event==="response.content_part.done"&&p.part){const d=p.part;d.type==="reasoning_text"&&d.text?s||(r=d.text):d.type==="output_text"&&d.text&&(n+=d.text);continue}if(!u.event&&p.choices){const d=(c=(l=p.choices)==null?void 0:l[0])==null?void 0:c.delta;d&&(typeof d.content=="string"&&(n+=d.content),d.thinking&&typeof d.thinking.content=="string"&&(r+=d.thinking.content));continue}(p.reasoning_content||p.thinking)&&(r+=p.reasoning_content||p.thinking||"")}}return{text:n,thinking:r}}function oU(e,t){if(!e||e.length===0)return{text:"",thinking:""};const n=Hu(e);return Vu(n)}function uO(e){var t,n;if(console.log("[assembleResponseBody] log:",{id:e.id,hasResponseBody:!!e.responseBody,responseBodyLength:(t=e.responseBody)==null?void 0:t.length,hasStreamChunks:!!e.streamChunks,streamChunksLength:(n=e.streamChunks)==null?void 0:n.length,targetType:e.targetType}),e.responseBody)try{const r=JSON.parse(e.responseBody);return console.log("[assembleResponseBody] returning parsed responseBody"),r}catch{return console.log("[assembleResponseBody] returning raw responseBody (parse failed)"),e.responseBody}if(e.streamChunks&&e.streamChunks.length>0){console.log("[assembleResponseBody] processing streamChunks:",e.streamChunks.length);const{text:r,thinking:i}=oU(e.downstreamResponseBody,e.targetType);if(console.log("[assembleResponseBody] assembled text:",{textLength:r.length,thinkingLength:i.length}),e.targetType==="claude-code"){const s=[];i&&s.push({type:"thinking",thinking:i}),r&&s.push({type:"text",text:r}),s.length===0&&s.push({type:"text",text:"(空内容 - 可能响应未完成或解析失败)"});const l={type:"message",role:"assistant",content:s,model:e.targetModel||e.requestModel,usage:e.usage};return console.log("[assembleResponseBody] returning claude-code format with",s.length,"content blocks"),l}else if(e.targetType==="codex"){const s={id:e.id,object:"chat.completion",created:Math.floor(e.timestamp/1e3),model:e.targetModel||e.requestModel,choices:[{index:0,message:{role:"assistant",content:r||i||"(空内容 - 可能响应未完成或解析失败)"},finish_reason:"stop"}],usage:e.usage};return console.log("[assembleResponseBody] returning codex format"),s}const a={content:r||i||"(空内容 - 可能响应未完成或解析失败)",usage:e.usage};return console.log("[assembleResponseBody] returning generic format"),a}return console.log("[assembleResponseBody] no responseBody or streamChunks, returning null"),null}function sU(e){const t=[];t.push(`# 请求日志详情
|
|
116
|
+
`),t.push("## 基本信息"),t.push(`- **日志ID**: ${e.id}`),t.push(`- **时间**: ${bt(e.timestamp).format("YYYY-MM-DD HH:mm:ss")}`),e.targetType&&t.push(`- **客户端类型**: ${Cl[e.targetType]||"-"}`),e.tags&&e.tags.length>0&&t.push(`- **标签**: ${e.tags.join(", ")}`),t.push(""),t.push("## 模型信息"),e.requestModel&&t.push(`- **请求模型**: ${e.requestModel}`),e.vendorName&&t.push(`- **供应商**: ${e.vendorName}`),e.targetServiceName&&t.push(`- **供应商API服务**: ${e.targetServiceName}`),e.targetModel&&t.push(`- **供应商模型**: ${e.targetModel}`),t.push(""),t.push("## 请求信息"),t.push(`- **请求方法**: ${e.method}`),t.push(`- **请求路径**: ${e.path}`),t.push(""),e.headers&&(t.push("## 请求头"),t.push("```json"),t.push(JSON.stringify(e.headers,null,2)),t.push("```\n")),e.body&&(t.push("## 请求体"),t.push("```json"),t.push(JSON.stringify(e.body,null,2)),t.push("```\n")),e.upstreamRequest&&(t.push("## 实际转发的请求信息"),t.push("```json"),t.push(JSON.stringify(e.upstreamRequest,null,2)),t.push("```\n")),t.push("## 响应信息"),t.push(`- **状态码**: ${e.statusCode||"Error"}`),t.push(`- **响应时间**: ${e.responseTime?`${e.responseTime}ms`:"-"}`),t.push(""),e.responseHeaders&&(t.push("## 响应头"),t.push("```json"),t.push(JSON.stringify(e.responseHeaders,null,2)),t.push("```\n"));const n=uO(e);if(n&&(t.push("## 响应体"),t.push("```json"),t.push(JSON.stringify(n,null,2)),t.push("```\n")),e.usage&&(t.push("## Token 使用"),t.push(`- **输入**: ${e.usage.inputTokens}`),t.push(`- **输出**: ${e.usage.outputTokens}`),e.usage.totalTokens!==void 0&&t.push(`- **总计**: ${e.usage.totalTokens}`),e.usage.cacheReadInputTokens!==void 0&&t.push(`- **缓存读取**: ${e.usage.cacheReadInputTokens}`),t.push("")),e.error&&(t.push("## 错误信息"),t.push("```"),t.push(e.error),t.push("```\n")),e.downstreamResponseBody&&(t.push("## 实际转发的响应体"),t.push("```json"),t.push(typeof e.downstreamResponseBody=="string"?e.downstreamResponseBody:JSON.stringify(e.downstreamResponseBody,null,2)),t.push("```\n"),typeof e.downstreamResponseBody=="string"&&(e.downstreamResponseBody.includes("event:")||e.downstreamResponseBody.includes("data:")))){const r=Hu(e.downstreamResponseBody),{text:i,thinking:a}=Vu(r);a&&(t.push(`## 思考内容 (${a.length} 字符)`),t.push("```"),t.push(a),t.push("```\n")),i&&(t.push(`## 回复内容 (${i.length} 字符)`),t.push("```"),t.push(i),t.push("```\n"))}return t.join(`
|
|
117
|
+
`)}function lU(e){const t=[];return t.push(`# 错误日志详情
|
|
118
|
+
`),t.push("## 基本信息"),t.push(`- **ID**: ${e.id}`),t.push(`- **时间**: ${bt(e.timestamp).format("YYYY-MM-DD HH:mm:ss")}`),e.targetType&&t.push(`- **客户端类型**: ${Cl[e.targetType]||"-"}`),e.tags&&e.tags.length>0&&t.push(`- **标签**: ${e.tags.join(", ")}`),t.push(""),t.push("## 模型信息"),e.requestModel&&t.push(`- **请求模型**: ${e.requestModel}`),e.vendorName&&t.push(`- **供应商**: ${e.vendorName}`),e.targetServiceName&&t.push(`- **供应商API服务**: ${e.targetServiceName}`),e.targetModel&&t.push(`- **供应商模型**: ${e.targetModel}`),t.push(""),t.push("## 请求信息"),t.push(`- **请求方法**: ${e.method}`),t.push(`- **请求路径**: ${e.path}`),t.push(""),e.requestHeaders&&(t.push("## 请求头"),t.push("```json"),t.push(JSON.stringify(e.requestHeaders,null,2)),t.push("```\n")),e.requestBody&&(t.push("## 请求体"),t.push("```json"),t.push(JSON.stringify(e.requestBody,null,2)),t.push("```\n")),e.upstreamRequest&&(t.push("## 实际转发的请求信息"),t.push("```json"),t.push(JSON.stringify(e.upstreamRequest,null,2)),t.push("```\n")),t.push("## 错误信息"),t.push("```"),t.push(e.errorMessage),t.push("```\n"),e.errorStack&&(t.push("## 错误堆栈"),t.push("```"),t.push(e.errorStack),t.push("```\n")),t.push("## 响应信息"),t.push(`- **状态码**: ${e.statusCode||"-"}`),t.push(`- **响应时间**: ${e.responseTime?`${e.responseTime}ms`:"-"}`),t.push(""),e.responseHeaders&&(t.push("## 响应头"),t.push("```json"),t.push(JSON.stringify(e.responseHeaders,null,2)),t.push("```\n")),e.responseBody&&(t.push("## 响应体"),t.push("```json"),t.push(JSON.stringify(e.responseBody,null,2)),t.push("```\n")),t.join(`
|
|
119
|
+
`)}const cU=1e6;function uU(e){return"errorMessage"in e}function dU({events:e}){const{text:t,thinking:n}=Vu(e);return console.log("AssembledTextViewFromDownstream",{text:t,thinking:n}),!t&&!n?o.jsx("div",{style:{color:"#7f8c8d",fontStyle:"italic"},children:"无法解析出文本内容"}):o.jsxs("div",{className:"assembled-text-view",children:[n&&o.jsxs("details",{style:{marginBottom:"15px",border:"1px solid var(--border-thinking-box)",borderRadius:"8px",padding:"10px",backgroundColor:"var(--bg-thinking-box)"},open:!0,children:[o.jsxs("summary",{style:{cursor:"pointer",fontWeight:"bold",color:"var(--text-thinking-title)",userSelect:"none"},children:["思考内容 (",n.length," 字符)"]}),o.jsx("pre",{style:{marginTop:"10px",whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:"monospace",fontSize:"13px",color:"var(--text-thinking-content)",backgroundColor:"var(--bg-thinking-content)",padding:"10px",borderRadius:"4px",border:"1px solid var(--border-thinking-content)"},children:n})]}),t&&o.jsxs("div",{children:[o.jsxs("div",{style:{fontWeight:"bold",marginBottom:"8px",color:"var(--text-reply-title)"},children:["回复内容 (",t.length," 字符)"]}),o.jsx("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:"monospace",fontSize:"13px",color:"var(--text-reply-content)",backgroundColor:"var(--bg-reply-content)",padding:"10px",borderRadius:"4px",border:"1px solid var(--border-reply-content)"},children:t})]})]})}function pU({log:e}){const[t,n]=h.useState(!1),[r,i]=h.useState(!0);return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"日志ID"}),o.jsx("input",{type:"text",value:e.id,readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"时间"}),o.jsx("input",{type:"text",value:bt(e.timestamp).format("YYYY-MM-DD HH:mm:ss"),readOnly:!0})]}),e.targetType&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"客户端类型"}),o.jsx("input",{type:"text",value:Cl[e.targetType]||"-",readOnly:!0})]}),e.tags&&e.tags.length>0&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"标签"}),o.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap",marginTop:"8px"},children:e.tags.map((a,s)=>o.jsx("span",{style:{padding:"4px 12px",backgroundColor:"#3498db",color:"white",borderRadius:"12px",fontSize:"13px",fontWeight:"500"},children:a},s))})]}),e.requestModel&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求模型"}),o.jsx("input",{type:"text",value:e.requestModel,readOnly:!0})]}),e.vendorName&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商"}),o.jsx("input",{type:"text",value:e.vendorName,readOnly:!0})]}),e.targetServiceName&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商API服务"}),o.jsx("input",{type:"text",value:e.targetServiceName,readOnly:!0})]}),e.targetModel&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商模型"}),o.jsx("input",{type:"text",value:e.targetModel,readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求方法"}),o.jsx("input",{type:"text",value:e.method,readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求路径"}),o.jsx("input",{type:"text",value:e.path,readOnly:!0})]}),e.headers&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求头"}),o.jsx(Lr,{data:e.headers,collapsed:!0})]}),e.body&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求体"}),o.jsx(Lr,{data:e.body,collapsed:!0})]}),e.upstreamRequest&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"实际转发的请求信息"}),o.jsx(Lr,{data:e.upstreamRequest})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"状态码"}),o.jsx("input",{type:"text",value:e.statusCode||"Error",readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应时间"}),o.jsx("input",{type:"text",value:e.responseTime?`${e.responseTime}ms`:"-",readOnly:!0})]}),e.responseHeaders&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应头"}),o.jsx(Lr,{data:e.responseHeaders,collapsed:!0})]}),(()=>{const a=uO(e);return a?o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应体"}),o.jsx(Lr,{data:a})]}):o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应体"}),o.jsxs("div",{style:{padding:"10px",color:"#7f8c8d",fontStyle:"italic"},children:["无响应体数据",e.streamChunks===void 0&&e.responseBody===void 0&&o.jsx("div",{style:{marginTop:"5px",fontSize:"12px",color:"#e74c3c"},children:"⚠️ 该日志不包含响应数据(可能是旧版本记录)"})]})]})})(),e.usage&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"Token 使用"}),o.jsx("textarea",{rows:4,value:`输入: ${e.usage.inputTokens}
|
|
120
|
+
输出: ${e.usage.outputTokens}
|
|
121
|
+
`+(e.usage.totalTokens!==void 0?`总计: ${e.usage.totalTokens}
|
|
122
|
+
`:"")+(e.usage.cacheReadInputTokens!==void 0?`缓存读取: ${e.usage.cacheReadInputTokens}`:""),readOnly:!0})]}),e.error&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"错误信息"}),o.jsx("textarea",{rows:4,value:e.error,readOnly:!0,style:{color:"red"}})]}),e.downstreamResponseBody&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"实际转发的响应体"}),o.jsx(Lr,{data:e.downstreamResponseBody,collapsed:!0})]}),(()=>{const a=e.downstreamResponseBody;if(!a||!(typeof a=="string"&&(a.includes("event:")||a.includes("data:"))))return null;const l=Hu(a);return o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["Stream Events (",l.length,"个)",o.jsx("button",{onClick:()=>n(!t),style:{marginLeft:"10px",padding:"2px 8px",fontSize:"12px"},className:"btn btn-sm btn-secondary",children:t?"折叠":"展开"}),o.jsx("button",{onClick:()=>i(!r),style:{marginLeft:"5px",padding:"2px 8px",fontSize:"12px"},className:"btn btn-sm btn-primary",children:r?"隐藏拼装结果":"查看拼装结果"})]}),t&&o.jsx("div",{style:{maxHeight:"400px",overflowY:"auto",border:"1px solid #ddd",padding:"10px",borderRadius:"4px"},children:l.map((c,u)=>o.jsxs("div",{style:{marginBottom:"10px"},children:[o.jsxs("div",{style:{fontWeight:"bold",fontSize:"12px",color:"#7f8c8d",marginBottom:"4px"},children:["Event #",u+1," ",c.event&&`[${c.event}]`]}),o.jsx(Lr,{data:c.data||c.raw,collapsed:!0})]},u))}),r&&o.jsx("div",{style:{marginTop:"10px",maxHeight:"400px",overflowY:"auto",border:"1px solid var(--border-secondary)",padding:"10px",borderRadius:"4px",backgroundColor:"var(--bg-assembled-text)"},children:o.jsx(dU,{events:l})})]})})()]})}function fU({log:e}){return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"ID"}),o.jsx("input",{type:"text",value:e.id,readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"时间"}),o.jsx("input",{type:"text",value:bt(e.timestamp).format("YYYY-MM-DD HH:mm:ss"),readOnly:!0})]}),e.targetType&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"客户端类型"}),o.jsx("input",{type:"text",value:Cl[e.targetType]||"-",readOnly:!0})]}),e.tags&&e.tags.length>0&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"标签"}),o.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap",marginTop:"8px"},children:e.tags.map((t,n)=>o.jsx("span",{style:{padding:"4px 12px",backgroundColor:"#3498db",color:"white",borderRadius:"12px",fontSize:"13px",fontWeight:"500"},children:t},n))})]}),e.requestModel&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求模型"}),o.jsx("input",{type:"text",value:e.requestModel,readOnly:!0})]}),e.vendorName&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商"}),o.jsx("input",{type:"text",value:e.vendorName,readOnly:!0})]}),e.targetServiceName&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商API服务"}),o.jsx("input",{type:"text",value:e.targetServiceName,readOnly:!0})]}),e.targetModel&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"供应商模型"}),o.jsx("input",{type:"text",value:e.targetModel,readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求方法"}),o.jsx("input",{type:"text",value:e.method,readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求路径"}),o.jsx("input",{type:"text",value:e.path,readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"状态码"}),o.jsx("input",{type:"text",value:e.statusCode||"-",readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应时间"}),o.jsx("input",{type:"text",value:e.responseTime?`${e.responseTime}ms`:"-",readOnly:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"错误信息"}),o.jsx("textarea",{rows:4,value:e.errorMessage,readOnly:!0,style:{color:"#e74c3c"}})]}),e.errorStack&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"错误堆栈"}),o.jsx("textarea",{rows:8,value:e.errorStack,readOnly:!0,style:{fontSize:"12px",color:"#7f8c8d"}})]}),e.requestHeaders&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求头"}),o.jsx(Lr,{data:e.requestHeaders,collapsed:!0})]}),e.requestBody&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"请求体"}),o.jsx(Lr,{data:e.requestBody,collapsed:!0})]}),e.upstreamRequest&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"实际转发的请求信息"}),o.jsx(Lr,{data:e.upstreamRequest})]}),e.responseHeaders&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应头"}),o.jsx(Lr,{data:e.responseHeaders,collapsed:!0})]}),e.responseBody&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"响应体"}),o.jsx(Lr,{data:e.responseBody})]})]})}function mf({log:e,onClose:t,zIndex:n}){const r=n??cU,i=uU(e),a=()=>{const s=i?lU(e):sU(e);navigator.clipboard.writeText(s).then(()=>{K.success("复制成功")}).catch(()=>{K.error("复制失败")})};return o.jsxs("div",{className:"modal-overlay",style:{zIndex:r},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:t,"aria-label":"关闭",style:{zIndex:r+1},children:"×"}),o.jsxs("div",{className:"modal modal--sticky-layout",style:{width:"800px",zIndex:r},children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:i?"错误日志详情":"请求详情"})}),o.jsx("div",{className:"modal-body-scrollable",children:i?o.jsx(fU,{log:e}):o.jsx(pU,{log:e})}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-primary",onClick:a,children:"复制"}),o.jsx("button",{className:"btn btn-secondary",onClick:t,children:"关闭"})]})]})]})}const hU=!1;bt.extend(ib);function mU(){const{confirm:e}=Ku(),[t,n]=h.useState("request"),[r,i]=h.useState([]),[a,s]=h.useState([]),[l,c]=h.useState(null),[u,p]=h.useState(null),[d,f]=h.useState(1),[m,g]=h.useState(20),[v,x]=h.useState(0),[y,b]=h.useState(1),[w,S]=h.useState(20),[k,j]=h.useState(0),[A,E]=h.useState(0),[D,O]=h.useState(0),[_,R]=h.useState(!1),[X,V]=h.useState(!1),[I,$]=h.useState(10),[H,N]=h.useState([]),[U,P]=h.useState([]),[W,se]=h.useState([]),[T,he]=h.useState(""),[ye,Z]=h.useState(""),[le,Se]=h.useState(""),[Q,ne]=h.useState(""),[pe,ie]=h.useState(""),[_e,ke]=h.useState(""),[te,De]=h.useState(""),[Ve,Le]=h.useState(""),[We,pt]=h.useState(""),qe=h.useRef({activeTab:t,requestLogsPage:d,requestLogsPageSize:m,errorLogsPage:y,errorLogsPageSize:w,appliedSearchQuery:te,appliedErrorSearchQuery:We,filterTargetType:T,filterVendorId:ye,filterServiceId:le,filterModel:Q,filterRouteId:pe});qe.current={activeTab:t,requestLogsPage:d,requestLogsPageSize:m,errorLogsPage:y,errorLogsPageSize:w,appliedSearchQuery:te,appliedErrorSearchQuery:We,filterTargetType:T,filterVendorId:ye,filterServiceId:le,filterModel:Q,filterRouteId:pe},h.useEffect(()=>{et()},[t,d,m,y,w,te,We,T,ye,le,Q,pe]),h.useEffect(()=>{Xe(),Qe()},[]),h.useEffect(()=>{let ce=null,_t=null;return X&&(_t=setInterval(()=>{$(En=>En<=1?10:En-1)},1e3),ce=setInterval(()=>{et(),Qe()},1e4)),()=>{ce&&clearInterval(ce),_t&&clearInterval(_t)}},[X,t,d,m,y,w]);const Xe=async()=>{try{const[ce,_t,En]=await Promise.all([Y.getVendors(),Y.getAPIServices(),Y.getRoutes()]);N(ce),P(_t),se(En)}catch(ce){console.error("Failed to load filter options:",ce)}},Qe=async()=>{try{const[ce,_t]=await Promise.all([Y.getLogsCount(),Y.getErrorLogsCount()]);E(ce.count),O(_t.count)}catch(ce){console.error("Failed to load badge counts:",ce)}},et=async()=>{const ce=qe.current,_t={targetType:ce.filterTargetType||void 0,vendorId:ce.filterVendorId||void 0,serviceId:ce.filterServiceId||void 0,model:ce.filterModel||void 0,routeId:ce.filterRouteId||void 0};R(!0);try{if(ce.activeTab==="request"){const En=(ce.requestLogsPage-1)*ce.requestLogsPageSize,ar=await Y.queryLogs({filters:_t,keyword:ce.appliedSearchQuery.trim()||void 0,limit:ce.requestLogsPageSize,offset:En});i(ar.logs),x(ar.total)}else if(ce.activeTab==="error"){const En=(ce.errorLogsPage-1)*ce.errorLogsPageSize,ar=await Y.queryErrorLogs({filters:_t,keyword:ce.appliedErrorSearchQuery.trim()||void 0,limit:ce.errorLogsPageSize,offset:En});s(ar.logs),j(ar.total)}}catch(En){console.error("Failed to load logs:",En)}finally{R(!1)}},J=ce=>ce?ce>=200&&ce<300?"badge-success":ce>=400&&ce<500?"badge-warning":"badge-danger":"badge-danger",q=ce=>{Z(ce),Se(""),ne(""),f(1),b(1)},ue=ce=>{Se(ce),ne(""),f(1),b(1)},M=()=>{f(1),b(1)},fe=ce=>{he(ce),M()},ee=ce=>{ne(ce),M()},xe=ce=>{ie(ce),M()},je=()=>{he(""),Z(""),Se(""),ne(""),ie(""),ke(""),De(""),Le(""),pt(""),M()},Re=()=>{ke(""),De(""),f(1)},ze=()=>{Le(""),pt(""),b(1)},Ke=()=>ye?U.filter(ce=>ce.vendorId===ye):[],Ie=()=>{var ce;return le?((ce=U.find(_t=>_t.id===le))==null?void 0:ce.supportedModels)||[]:[]},Ge=!!(T||ye||le||Q||pe||te||We),L=ce=>f(ce),ge=ce=>{g(ce),f(1)},F=ce=>b(ce),de=ce=>{S(ce),b(1)},ve=()=>r.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"暂无请求日志"})}):o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"时间"}),o.jsx("th",{children:"客户端类型"}),o.jsx("th",{children:"路径"}),o.jsx("th",{children:"状态"}),o.jsx("th",{children:"响应时间"}),o.jsx("th",{children:"Tokens信息"}),o.jsx("th",{children:"操作"})]})}),o.jsx("tbody",{children:r.map(ce=>o.jsxs("tr",{children:[o.jsx("td",{children:bt(ce.timestamp).format("YYYY-MM-DD HH:mm:ss")}),o.jsx("td",{children:Cl[ce.targetType]?o.jsx("span",{className:`badge ${ce.targetType==="claude-code"?"badge-claude-code":ce.targetType==="codex"?"badge-codex":"badge-info"}`,children:Cl[ce.targetType]}):"-"}),o.jsx("td",{children:ce.path}),o.jsx("td",{children:o.jsx("span",{className:`badge ${J(ce.statusCode)}`,children:ce.statusCode||"Error"})}),o.jsx("td",{children:ce.responseTime?`${ce.responseTime}ms`:"-"}),o.jsx("td",{children:ce.usage?o.jsxs("span",{children:[ce.usage.totalTokens?ce.usage.totalTokens:ce.usage.inputTokens+ce.usage.outputTokens," tokens"]}):"-"}),o.jsx("td",{children:o.jsxs("div",{style:{position:"relative",display:"inline-block"},children:[(()=>{const _t=ce.downstreamResponseBody;return typeof _t=="string"&&(_t.includes("event:")||_t.includes("data:"))&&o.jsx("span",{style:{position:"absolute",top:"-4px",right:"-4px",width:"6px",height:"6px",backgroundColor:"#f39c12",borderRadius:"50%",boxShadow:"0 0 0 2px rgba(243, 156, 18, 0.5)"}})})(),o.jsx("button",{className:"btn btn-secondary",onClick:()=>c(ce),children:"详情"})]})})]},ce.id))})]}),Ae=()=>a.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"暂无错误日志"})}):o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"时间"}),o.jsx("th",{children:"方法"}),o.jsx("th",{children:"路径"}),o.jsx("th",{children:"状态"}),o.jsx("th",{children:"错误信息"}),o.jsx("th",{children:"操作"})]})}),o.jsx("tbody",{children:a.map(ce=>o.jsxs("tr",{children:[o.jsx("td",{children:bt(ce.timestamp).format("YYYY-MM-DD HH:mm:ss")}),o.jsx("td",{children:o.jsx("span",{className:"badge badge-danger",children:ce.method})}),o.jsx("td",{children:ce.path}),o.jsx("td",{children:o.jsx("span",{className:"badge badge-danger",children:ce.statusCode||"-"})}),o.jsx("td",{style:{maxWidth:"300px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#e74c3c"},children:ce.errorMessage}),o.jsx("td",{children:o.jsx("button",{className:"btn btn-secondary",onClick:()=>p(ce),children:"详情"})})]},ce.id))})]}),Ee={padding:"15px",background:"var(--bg-secondary)",borderRadius:"12px",marginBottom:"20px",display:"flex",gap:"15px",alignItems:"center",flexWrap:"wrap",border:"1px solid var(--border-primary)"},Ye={display:"flex",alignItems:"center",gap:"8px"},tt={fontWeight:"bold",color:"var(--text-primary)"},at={padding:"6px 10px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)"},Ze={...at,minWidth:"150px"},nn={padding:"6px 12px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",border:"1px solid var(--accent-danger)",background:"var(--accent-danger)",color:"white"},Kt={padding:"6px 12px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)",width:"320px",fontSize:"14px"},ct={padding:"6px 16px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",border:"none",background:"var(--accent-primary, #3498db)",color:"white"},Ht={padding:"6px 12px",borderRadius:"8px",cursor:"pointer",fontSize:"13px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)"},Zt=t==="request",Tt=Zt?_e:Ve,jt=ce=>Zt?ke(ce):Le(ce),mi=()=>{Zt?(De(_e),f(1)):(pt(Ve),b(1))},Gi=Zt?te:We,Ta=Zt?Re:ze;return o.jsxs("div",{className:"logs-page",children:[o.jsx("div",{className:"page-header",children:o.jsxs("div",{className:"page-header-content",children:[o.jsxs("div",{className:"page-header-text",children:[o.jsx("h1",{children:"日志"}),o.jsx("p",{children:"查看所有API请求日志"})]}),hU]})}),o.jsxs("div",{className:"card",children:[o.jsx("div",{style:{borderBottom:"1px solid #ecf0f1",marginBottom:"20px"},children:o.jsxs("div",{style:{display:"flex",gap:"0"},children:[o.jsxs("button",{onClick:()=>n("request"),style:{padding:"12px 24px",border:"none",background:t==="request"?"#3498db":"transparent",color:t==="request"?"white":"#7f8c8d",cursor:"pointer",borderBottom:t==="request"?"2px solid #2980b9":"2px solid transparent",fontWeight:t==="request"?"bold":"normal"},children:["请求日志 (",A,")"]}),o.jsxs("button",{onClick:()=>n("error"),style:{padding:"12px 24px",border:"none",background:t==="error"?"#e74c3c":"transparent",color:t==="error"?"white":"#7f8c8d",cursor:"pointer",borderBottom:t==="error"?"2px solid #c0392b":"2px solid transparent",fontWeight:t==="error"?"bold":"normal"},children:["错误日志 (",D,")"]})]})}),o.jsxs("div",{className:"toolbar",children:[o.jsx("h3",{children:t==="error"?"错误日志列表":"请求日志列表"}),o.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"center"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"0 12px",background:"var(--bg-secondary)",borderRadius:"8px"},children:[o.jsx("input",{type:"checkbox",id:"auto-refresh",checked:X,onChange:ce=>{V(ce.target.checked),ce.target.checked&&$(10)},style:{cursor:"pointer"}}),o.jsxs("label",{htmlFor:"auto-refresh",style:{cursor:"pointer",fontSize:"14px",color:"var(--text-primary)",userSelect:"none"},children:["自动刷新 ",X&&`(⏱ ${I}s)`]})]}),o.jsx("button",{className:"btn btn-primary",onClick:()=>{et(),Qe(),$(10)},children:"刷新"})]})]}),o.jsxs("div",{style:Ee,children:[o.jsxs("div",{style:Ye,children:[o.jsx("label",{style:tt,children:"来源类型:"}),o.jsxs("select",{value:T,onChange:ce=>fe(ce.target.value),style:at,children:[o.jsx("option",{value:"",children:"全部"}),o.jsx("option",{value:"claude-code",children:"Claude Code"}),o.jsx("option",{value:"codex",children:"Codex"})]})]}),o.jsxs("div",{style:Ye,children:[o.jsx("label",{style:tt,children:"供应商:"}),o.jsxs("select",{value:ye,onChange:ce=>q(ce.target.value),style:Ze,children:[o.jsx("option",{value:"",children:"全部供应商"}),H.map(ce=>o.jsx("option",{value:ce.id,children:ce.name},ce.id))]})]}),o.jsxs("div",{style:Ye,children:[o.jsx("label",{style:tt,children:"API服务:"}),o.jsxs("select",{value:le,onChange:ce=>ue(ce.target.value),disabled:!ye,style:{...Ze,background:ye?"var(--bg-card)":"var(--bg-secondary)",cursor:ye?"pointer":"not-allowed",opacity:ye?1:.6},children:[o.jsx("option",{value:"",children:"全部服务"}),Ke().map(ce=>o.jsx("option",{value:ce.id,children:ce.name},ce.id))]})]}),o.jsxs("div",{style:Ye,children:[o.jsx("label",{style:tt,children:"模型:"}),o.jsxs("select",{value:Q,onChange:ce=>ee(ce.target.value),disabled:!le,style:{...Ze,background:le?"var(--bg-card)":"var(--bg-secondary)",cursor:le?"pointer":"not-allowed",opacity:le?1:.6},children:[o.jsx("option",{value:"",children:"全部模型"}),Ie().map(ce=>o.jsx("option",{value:ce,children:ce},ce))]})]}),o.jsxs("div",{style:Ye,children:[o.jsx("label",{style:tt,children:"路由:"}),o.jsxs("select",{value:pe,onChange:ce=>xe(ce.target.value),style:Ze,children:[o.jsx("option",{value:"",children:"全部路由"}),W.map(ce=>o.jsx("option",{value:ce.id,children:ce.name},ce.id))]})]}),Ge&&o.jsx("button",{style:nn,onClick:je,children:"清除筛选"}),o.jsxs("div",{style:Ye,children:[o.jsx("input",{type:"text",placeholder:Zt?"搜索日志内容...":"搜索错误日志...",value:Tt,onChange:ce=>jt(ce.target.value),onKeyDown:ce=>{ce.key==="Enter"&&mi()},style:Kt}),o.jsx("button",{style:ct,onClick:mi,children:"搜索"}),(Tt||Gi)&&o.jsx("button",{style:Ht,onClick:Ta,children:"清空"})]})]}),t==="request"&&o.jsxs(o.Fragment,{children:[_?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"加载中..."})}):ve(),!_&&o.jsx(xu,{currentPage:d,totalItems:v,pageSize:m,onPageChange:L,onPageSizeChange:ge})]}),t==="error"&&o.jsxs(o.Fragment,{children:[_?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"加载中..."})}):Ae(),!_&&o.jsx(xu,{currentPage:y,totalItems:k,pageSize:w,onPageChange:F,onPageSizeChange:de})]})]}),l&&o.jsx(mf,{log:l,onClose:()=>c(null)}),u&&o.jsx(mf,{log:u,onClose:()=>p(null)})]})}function gU({session:e,onClose:t}){var _;const[n,r]=h.useState(e.targetType==="claude-code"?"codex":"claude-code"),[i,a]=h.useState(!1),[s,l]=h.useState(!0),[c,u]=h.useState(0),[p,d]=h.useState(!1),[f,m]=h.useState(null),[g,v]=h.useState(""),[x,y]=h.useState(null),[b,w]=h.useState(!1),S=e.targetType==="claude-code"?"Claude Code":"Codex",k=n==="claude-code"?"Claude Code":"Codex",j=(()=>{const R=e.lastRequestAt-e.firstRequestAt,X=Math.floor(R/6e4);return X<1?`${Math.max(1,Math.floor(R/1e3))}秒`:X<60?`${X}分钟`:`${Math.floor(X/60)}小时${X%60}分钟`})(),A=async()=>{d(!0),m(null),y(null);try{const R={sourceSessionId:e.id,targetTool:n,includeThinking:i,includeToolCalls:s,maxRounds:c},X=await Y.migrationPreview(e.id,R);m(X),v(X.generatedPrompt)}catch(R){K.error(R.message||"预览失败")}finally{d(!1)}},E=async()=>{const R=g||(f==null?void 0:f.generatedPrompt)||"";try{await navigator.clipboard.writeText(R),K.success("已复制到剪贴板!请打开 "+k+",粘贴为第一条消息")}catch{const X=document.querySelector(".migration-prompt-textarea");X?(X.select(),document.execCommand("copy"),K.success("已复制到剪贴板!")):K.error("复制失败,请手动选择内容复制")}},D=async()=>{if(x!=null&&x.command)try{await navigator.clipboard.writeText(x.command),K.success("命令已复制!请在终端中执行")}catch{K.error("复制失败")}},O=async()=>{w(!0),y(null);try{const R={sourceSessionId:e.id,targetTool:n,includeThinking:i,includeToolCalls:s,maxRounds:c},X=await Y.migrateLaunch(e.id,R);y(X),X.success&&K.success(`已在新的终端窗口中启动 ${k}`)}catch(R){K.error(R.message||"启动失败")}finally{w(!1)}};return o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:t,"aria-label":"关闭",children:"×"}),o.jsxs("div",{className:"modal modal--sticky-layout migration-modal",style:{width:"900px",maxWidth:"90vw"},children:[o.jsxs("div",{className:"modal-header",children:[o.jsx("h2",{children:"会话迁移"}),o.jsxs("div",{style:{fontSize:"13px",color:"var(--text-tertiary)",marginLeft:"12px"},children:["将 ",S," 会话迁移到 ",k]})]}),o.jsxs("div",{className:"modal-body-scrollable",style:{padding:"20px"},children:[o.jsxs("div",{className:"migration-source-info",children:[o.jsx("div",{className:"migration-source-title",children:((_=e.title)==null?void 0:_.replace(/<\/?session>/g,"").trim())||e.id.slice(0,8)}),o.jsxs("div",{className:"migration-source-meta",children:[o.jsx("span",{className:`badge migration-source-badge ${e.targetType==="claude-code"?"migration-badge-claude":"migration-badge-codex"}`,children:e.targetType==="claude-code"?"Claude Code":"Codex"}),o.jsxs("span",{children:[e.requestCount," 轮对话"]}),o.jsxs("span",{children:[e.totalTokens.toLocaleString()," tokens"]}),o.jsx("span",{children:j})]})]}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"12px",fontWeight:500,color:"var(--text-secondary)",fontSize:"13px"},children:"迁移方向"}),o.jsxs("div",{className:"migration-tool-cards",children:[o.jsxs("div",{className:"migration-tool-card is-source",style:{cursor:"default"},children:[o.jsx("div",{className:"migration-tool-card-icon",children:e.targetType==="claude-code"?o.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2Z"}),o.jsx("path",{d:"M8.5 8.5h7v7h-7z"}),o.jsx("path",{d:"M5 12h2"}),o.jsx("path",{d:"M17 12h2"}),o.jsx("path",{d:"M12 5v2"}),o.jsx("path",{d:"M12 17v2"})]}):o.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2Z"}),o.jsx("path",{d:"M12 6v4l3 2"}),o.jsx("path",{d:"M9 18h6"}),o.jsx("path",{d:"M9 14h3"})]})}),o.jsx("div",{className:"migration-tool-card-name",children:S}),o.jsx("span",{className:"migration-tool-card-badge",children:"来源"})]}),o.jsx("div",{className:"migration-arrow",children:o.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M5 12h14"}),o.jsx("path",{d:"m12 5 7 7-7 7"})]})}),o.jsxs("button",{type:"button",className:`migration-tool-card${n==="claude-code"?" active":""}`,onClick:()=>{r("claude-code"),y(null)},children:[o.jsx("div",{className:"migration-tool-card-icon",children:o.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2Z"}),o.jsx("path",{d:"M8.5 8.5h7v7h-7z"}),o.jsx("path",{d:"M5 12h2"}),o.jsx("path",{d:"M17 12h2"}),o.jsx("path",{d:"M12 5v2"}),o.jsx("path",{d:"M12 17v2"})]})}),o.jsx("div",{className:"migration-tool-card-name",children:"Claude Code"}),o.jsx("div",{className:"migration-tool-card-desc",children:e.targetType==="claude-code"&&n==="claude-code"?"同工具新会话":"Anthropic 编程助手"})]}),o.jsxs("button",{type:"button",className:`migration-tool-card${n==="codex"?" active":""}`,onClick:()=>{r("codex"),y(null)},children:[o.jsx("div",{className:"migration-tool-card-icon",children:o.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2Z"}),o.jsx("path",{d:"M12 6v4l3 2"}),o.jsx("path",{d:"M9 18h6"}),o.jsx("path",{d:"M9 14h3"})]})}),o.jsx("div",{className:"migration-tool-card-name",children:"Codex"}),o.jsx("div",{className:"migration-tool-card-desc",children:e.targetType==="codex"&&n==="codex"?"同工具新会话":"OpenAI 编程助手"})]})]})]}),o.jsxs("div",{className:"migration-options",style:{marginTop:"12px",display:"flex",gap:"16px",alignItems:"center",flexWrap:"wrap"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"14px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:s,onChange:R=>l(R.target.checked)}),"包含工具调用摘要"]}),o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"14px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:i,onChange:R=>a(R.target.checked)}),"包含思考过程"]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("label",{style:{fontSize:"14px",whiteSpace:"nowrap"},children:"最大轮数:"}),o.jsxs("select",{value:c,onChange:R=>u(Number(R.target.value)),style:{padding:"4px 8px",border:"1px solid var(--border-primary)",borderRadius:"6px",fontSize:"14px",backgroundColor:"var(--input-bg)",color:"var(--text-primary)"},children:[o.jsx("option",{value:0,children:"全部"}),o.jsx("option",{value:5,children:"最近 5 轮"}),o.jsx("option",{value:10,children:"最近 10 轮"}),o.jsx("option",{value:20,children:"最近 20 轮"}),o.jsx("option",{value:30,children:"最近 30 轮"})]})]})]}),o.jsx("div",{style:{marginTop:"16px"},children:o.jsx("button",{className:"btn btn-primary",onClick:A,disabled:p,children:p?"加载中...":"预览迁移内容"})}),!f&&!p&&o.jsxs("div",{className:"migration-empty-hint",children:[o.jsxs("svg",{width:"36",height:"36",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("path",{d:"M12 20h9"}),o.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 1 1 3 3L7 19l-4 1 1-4Z"})]}),o.jsxs("div",{children:[o.jsx("div",{style:{fontWeight:500,color:"var(--text-secondary)",marginBottom:"4px"},children:"请先预览迁移内容"}),o.jsx("div",{style:{fontSize:"13px",color:"var(--text-tertiary)"},children:"点击上方「预览迁移内容」按钮,确认迁移 Prompt 后即可启动目标工具或复制到剪贴板"})]})]}),f&&o.jsxs("div",{className:"migration-preview-section",style:{marginTop:"16px"},children:[o.jsx("textarea",{className:"migration-prompt-textarea",value:g,onChange:R=>v(R.target.value),style:{width:"100%",minHeight:"400px",padding:"12px",border:"1px solid var(--border-primary)",borderRadius:"8px",fontSize:"13px",fontFamily:"monospace",backgroundColor:"var(--input-bg)",color:"var(--text-primary)",resize:"vertical",lineHeight:1.5}}),o.jsx("div",{className:"migration-preview-footer",style:{marginTop:"10px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:o.jsxs("div",{style:{fontSize:"13px",color:"var(--text-tertiary)"},children:["预估 Tokens: ",f.estimatedTokens.toLocaleString(),f.warnings.map((R,X)=>o.jsxs("span",{style:{color:"#e67e22",marginLeft:"12px"},children:["⚠ ",R]},X)),f.content.extractedRounds>0&&o.jsxs("span",{style:{color:"var(--text-tertiary)",marginLeft:"12px"},children:[f.content.extractedRounds,"/",f.content.totalRounds," 轮"]})]})})]}),x&&o.jsx("div",{className:`migration-launch-result ${x.success?"migration-launch-success":"migration-launch-fallback"}`,style:{marginTop:"16px",padding:"16px",borderRadius:"8px",backgroundColor:x.success?"#27ae6010":"#e67e2210",border:`1px solid ${x.success?"#27ae6040":"#e67e2240"}`},children:x.success?o.jsxs("div",{children:[o.jsxs("div",{style:{fontSize:"14px",fontWeight:600,color:"#27ae60",marginBottom:"8px"},children:["✅ 已在新终端窗口中启动 ",k]}),o.jsxs("div",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:["请在新终端窗口中继续与 ",k," 交互"]})]}):o.jsxs("div",{children:[o.jsxs("div",{style:{fontSize:"14px",fontWeight:600,color:"#e67e22",marginBottom:"8px"},children:["⚠️ ",x.reason||"无法自动启动"]}),x.command&&o.jsxs("div",{style:{marginTop:"8px"},children:[o.jsx("div",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:"请在终端中执行以下命令:"}),o.jsx("pre",{style:{marginTop:"6px",padding:"10px",backgroundColor:"var(--bg-secondary)",borderRadius:"6px",fontSize:"12px",fontFamily:"monospace",overflow:"auto"},children:x.command}),o.jsx("button",{className:"btn btn-sm btn-secondary",onClick:D,style:{marginTop:"6px"},children:"复制命令"})]}),x.fallbackSuggestions&&x.fallbackSuggestions.length>0&&o.jsx("div",{style:{marginTop:"8px",fontSize:"13px",color:"var(--text-tertiary)"},children:x.fallbackSuggestions.map((R,X)=>o.jsxs("div",{children:["• ",R]},X))})]})})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-primary",onClick:O,disabled:b||!f,title:f?"":"请先预览迁移内容",children:b?"启动中...":`🚀 启动 ${k}`}),o.jsx("button",{className:"btn btn-secondary",onClick:E,disabled:!f,title:f?"":"请先预览迁移内容",children:"📋 复制到剪贴板"}),o.jsx("button",{className:"btn btn-secondary",onClick:t,children:"关闭"})]})]})]})}function yU({session:e,onClose:t,onBound:n}){var y;const[r,i]=h.useState([]),[a,s]=h.useState({}),[l,c]=h.useState(e.routeId||null),[u,p]=h.useState(!1),[d,f]=h.useState(!0),m=e.targetType==="claude-code"?"Claude Code":"Codex";h.useEffect(()=>{(async()=>{try{const w=await Y.getRoutes();i(w);const S={};for(const k of w)try{const j=await Y.getRules(k.id);S[k.id]=j.length}catch{S[k.id]=0}s(S)}catch{K.error("加载路由列表失败")}finally{f(!1)}})()},[]);const g=async()=>{if(l){p(!0);try{const b=await Y.bindSessionRoute(e.id,l);b.success?(K.success("路由绑定成功"),n(),t()):K.error(b.error||"绑定失败")}catch(b){K.error(b.message||"绑定失败")}finally{p(!1)}}},v=async()=>{p(!0);try{const b=await Y.unbindSessionRoute(e.id);b.success?(K.success("已解除路由绑定"),n(),t()):K.error(b.error||"解绑失败")}catch(b){K.error(b.message||"解绑失败")}finally{p(!1)}},x=l!==(e.routeId||null);return o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:t,"aria-label":"关闭",children:"×"}),o.jsxs("div",{className:"modal",style:{width:"500px",maxWidth:"90vw"},children:[o.jsxs("div",{className:"modal-header",children:[o.jsx("h2",{children:"路由绑定"}),o.jsx("div",{style:{fontSize:"13px",color:"var(--text-tertiary)",marginLeft:"12px"},children:"为会话指定专用的路由"})]}),o.jsxs("div",{className:"modal-body-scrollable",style:{padding:"20px"},children:[o.jsxs("div",{style:{padding:"12px 16px",backgroundColor:"var(--bg-secondary)",borderRadius:"8px",marginBottom:"20px"},children:[o.jsx("div",{style:{fontWeight:500,marginBottom:"6px"},children:((y=e.title)==null?void 0:y.replace(/<\/?session>/g,"").trim())||e.id.slice(0,8)}),o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",display:"flex",gap:"12px",alignItems:"center"},children:[o.jsx("span",{className:`badge ${e.targetType==="claude-code"?"badge-claude-code":"badge-codex"}`,style:{fontSize:"11px"},children:m}),o.jsxs("span",{children:[e.requestCount," 次请求"]}),o.jsxs("span",{children:[e.totalTokens.toLocaleString()," tokens"]})]})]}),e.routeId&&o.jsx("div",{style:{padding:"10px 14px",backgroundColor:"var(--bg-info, rgba(41, 128, 185, 0.1))",borderRadius:"6px",marginBottom:"16px",display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"13px"},children:o.jsxs("span",{style:{color:"var(--text-secondary)"},children:["当前绑定:",o.jsx("strong",{children:e.routeName||e.routeId})]})}),o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"10px",fontWeight:500,color:"var(--text-secondary)",fontSize:"13px"},children:"选择路由"}),d?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:"加载中..."}):r.length===0?o.jsxs("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:[o.jsx("p",{children:"暂无可用路由"}),o.jsx("p",{style:{fontSize:"12px",marginTop:"8px"},children:"请先在路由管理页面创建路由"})]}):o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",maxHeight:"300px",overflowY:"auto"},children:r.map(b=>{const w=l===b.id,S=e.routeId===b.id;return o.jsx("div",{onClick:()=>c(b.id),style:{padding:"12px 14px",border:`2px solid ${w?"var(--color-primary, #2980b9)":"var(--border-primary, #e0e0e0)"}`,borderRadius:"8px",cursor:"pointer",backgroundColor:w?"var(--bg-route-item-selected, rgba(41, 128, 185, 0.08))":"var(--bg-primary)",transition:"all 0.15s ease",position:"relative"},children:o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o.jsxs("div",{children:[o.jsxs("div",{style:{fontWeight:500,fontSize:"14px",display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("span",{style:{width:"16px",height:"16px",borderRadius:"50%",border:`2px solid ${w?"var(--color-primary, #2980b9)":"var(--border-secondary, #ccc)"}`,display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:w&&o.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"var(--color-primary, #2980b9)"}})}),b.name,S&&o.jsx("span",{style:{fontSize:"10px",padding:"1px 6px",borderRadius:"4px",backgroundColor:"var(--color-primary, #2980b9)",color:"white"},children:"当前"})]}),b.description&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",marginTop:"4px",marginLeft:"24px"},children:b.description})]}),o.jsxs("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",flexShrink:0},children:[a[b.id]||0," 条规则"]})]})},b.id)})})]})]}),o.jsxs("div",{className:"modal-footer",children:[e.routeId&&o.jsx("button",{className:"btn btn-danger",onClick:v,disabled:u,children:"解绑"}),o.jsx("div",{style:{flex:1}}),o.jsx("button",{className:"btn btn-secondary",onClick:t,children:"取消"}),o.jsx("button",{className:"btn btn-primary",onClick:g,disabled:u||!l||!x,children:u?"处理中...":"确认绑定"})]})]})]})}const vU=Array.from({length:15},(e,t)=>t+1);function xU({onClose:e,onCleared:t}){const[n,r]=h.useState(7),[i,a]=h.useState(!1),[s,l]=h.useState(!1),c=async()=>{l(!0);try{const p=await Y.cleanupSessions(n,i);p.sessionsAffected===0?K.info("没有符合条件的会话需要清除"):i?K.success(`已清除 ${p.sessionsAffected} 个会话的日志(共 ${p.logsDeleted} 条),会话记录已保留`):K.success(`已清除 ${p.sessionsAffected} 个会话及其关联日志(共 ${p.logsDeleted} 条)`),t(),e()}catch(p){K.error(p.message||"清除会话失败")}finally{l(!1)}},u=i?`将删除最后请求在 ${n} 天以前的会话所关联的日志,会话记录本身将被保留。`:`将永久删除最后请求在 ${n} 天以前的会话,及其所有关联日志。此操作不可撤销。`;return o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:e,"aria-label":"关闭",children:"×"}),o.jsxs("div",{className:"modal",style:{width:"480px",maxWidth:"90vw"},children:[o.jsxs("div",{className:"modal-header",children:[o.jsx("h2",{children:"清除会话"}),o.jsx("div",{style:{fontSize:"13px",color:"var(--text-tertiary)",marginLeft:"12px"},children:"按最后请求时间清理过期会话"})]}),o.jsxs("div",{className:"modal-body-scrollable",style:{padding:"20px"},children:[o.jsxs("div",{style:{marginBottom:"20px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"10px",fontWeight:500,color:"var(--text-secondary)",fontSize:"13px"},children:"清除范围"}),o.jsxs("div",{style:{padding:"14px 16px",backgroundColor:"var(--bg-secondary)",borderRadius:"8px",display:"flex",alignItems:"center",gap:"10px",flexWrap:"wrap"},children:[o.jsx("span",{style:{fontSize:"14px",color:"var(--text-secondary)"},children:"最后请求在"}),o.jsx("select",{value:n,onChange:p=>r(Number(p.target.value)),disabled:s,style:{padding:"6px 10px",borderRadius:"6px",border:"1px solid var(--border-primary)",backgroundColor:"var(--bg-primary)",color:"var(--text-primary)",fontSize:"14px",cursor:"pointer"},children:vU.map(p=>o.jsx("option",{value:p,children:p},p))}),o.jsx("span",{style:{fontSize:"14px",color:"var(--text-secondary)"},children:"天以前的会话"})]})]}),o.jsxs("div",{onClick:()=>!s&&a(p=>!p),style:{padding:"14px 16px",borderRadius:"8px",border:`2px solid ${i?"var(--color-primary, #2980b9)":"var(--border-primary, #e0e0e0)"}`,backgroundColor:i?"var(--bg-route-item-selected, rgba(41, 128, 185, 0.08))":"var(--bg-primary)",cursor:s?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",opacity:s?.6:1},children:[o.jsxs("div",{children:[o.jsx("div",{style:{fontWeight:500,fontSize:"14px",color:"var(--text-primary)"},children:"仅清空日志"}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",marginTop:"4px"},children:"开启后保留会话记录,仅删除这些会话的关联日志"})]}),o.jsx("div",{style:{width:"40px",height:"22px",borderRadius:"11px",backgroundColor:i?"var(--color-primary, #2980b9)":"var(--border-secondary, #ccc)",position:"relative",transition:"background-color 0.15s ease",flexShrink:0},children:o.jsx("div",{style:{position:"absolute",top:"2px",left:i?"20px":"2px",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#fff",transition:"left 0.15s ease",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}})})]}),o.jsxs("div",{style:{marginTop:"20px",padding:"12px 14px",backgroundColor:"rgba(231, 76, 60, 0.08)",border:"1px solid rgba(231, 76, 60, 0.3)",borderRadius:"6px",fontSize:"13px",color:"#c0392b",lineHeight:1.5},children:[o.jsx("strong",{children:"⚠️ 警告:"}),u]})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("div",{style:{flex:1}}),o.jsx("button",{className:"btn btn-secondary",onClick:e,disabled:s,children:"取消"}),o.jsx("button",{className:"btn btn-danger",onClick:c,disabled:s,children:s?"处理中...":"确认清除"})]})]})]})}bt.extend(ib);function bU(e,t,n,r){if(!e)return[];const i=[];if(e.role==="user"){const a=e.content;if(typeof a=="string")i.push({role:"user",content:a,timestamp:t,model:n});else if(Array.isArray(a)){let s=[];const l=()=>{s.length>0&&(i.push({role:"user",content:s.join(`
|
|
123
|
+
`),timestamp:t,model:n}),s=[])};for(const c of a)if((c==null?void 0:c.type)==="text"&&(c!=null&&c.text))s.push(c.text);else if((c==null?void 0:c.type)==="image"||(c==null?void 0:c.type)==="image_url")s.push("[图片]");else if((c==null?void 0:c.type)==="tool_result"){l();let u="";c.content&&(typeof c.content=="string"?u=c.content:Array.isArray(c.content)?u=c.content.map(m=>typeof m=="string"?m:(m==null?void 0:m.type)==="text"&&(m!=null&&m.text)?m.text:(m==null?void 0:m.type)==="image"||(m==null?void 0:m.type)==="image_url"?"[图片]":JSON.stringify(m)).join(`
|
|
124
|
+
`):u=JSON.stringify(c.content));const p=c.tool_use_id&&(r==null?void 0:r.get(c.tool_use_id))||c.name||"",d=c.tool_use_id?c.tool_use_id.slice(-8):"",f=p?`[工具结果: ${p}${d?` · ...${d}`:""}]`:d?`[工具结果: ...${d}]`:"[工具结果]";i.push({role:"user",type:"tool_result",header:f,content:u||f,timestamp:t,model:n})}l()}}else if(e.role==="assistant"){const a=e.content;if(typeof a=="string")a&&i.push({role:"assistant",content:a,timestamp:t,model:n});else if(Array.isArray(a)){let s="",l="";for(const c of a)if(c.type==="text"&&c.text&&(s+=c.text),c.type==="thinking"&&c.thinking&&(l+=c.thinking),c.type==="tool_use"){(s||l)&&(i.push({role:"assistant",content:s,thinking:l||void 0,timestamp:t,model:n}),s="",l="");const u=c.name||"",p=c.id?c.id.slice(-8):"",d=u+(p?` · ...${p}`:""),f=c.input?JSON.stringify(c.input,null,2):"";i.push({role:"assistant",type:"tool_use",header:`[工具调用: ${d}]`,content:f||`[工具调用: ${d}]`,timestamp:t,model:n})}(s||l)&&i.push({role:"assistant",content:s||"",thinking:l||void 0,timestamp:t,model:n})}}return i}function wU(e){var i,a,s,l,c;const t=[],n={timestamp:e.timestamp,model:e.targetModel,tokens:((i=e.usage)==null?void 0:i.totalTokens)||(e.usage?e.usage.inputTokens+e.usage.outputTokens:void 0)},r=e.downstreamResponseBody;if(typeof r=="string"&&(r.includes("event:")||r.includes("data:"))){const u=Hu(r),{text:p,thinking:d}=Vu(u);if(p||d)return t.push({role:"assistant",content:p||"",thinking:d||void 0,...n}),t}if(e.responseBody)try{const u=typeof e.responseBody=="string"?JSON.parse(e.responseBody):e.responseBody;if(u.content&&Array.isArray(u.content)){let p="",d="";for(const f of u.content)if(f.type==="text"&&f.text&&(p+=f.text),f.type==="thinking"&&f.thinking&&(d+=f.thinking),f.type==="tool_use"){(p||d)&&(t.push({role:"assistant",content:p,thinking:d||void 0,...n}),p="",d="");const m=f.name||"",g=f.id?f.id.slice(-8):"",v=m+(g?` · ...${g}`:""),x=f.input?JSON.stringify(f.input,null,2):"";t.push({role:"assistant",type:"tool_use",header:`[工具调用: ${v}]`,content:x||`[工具调用: ${v}]`,...n})}if((p||d)&&t.push({role:"assistant",content:p||"",thinking:d||void 0,...n}),t.length>0)return t}if((s=(a=u.choices)==null?void 0:a[0])!=null&&s.message){const p=u.choices[0].message;if(p.content&&t.push({role:"assistant",content:p.content,...n}),p.tool_calls&&Array.isArray(p.tool_calls))for(const d of p.tool_calls){const f=((l=d.function)==null?void 0:l.name)||"",m=d.id?d.id.slice(-8):"",g=f+(m?` · ...${m}`:""),v=((c=d.function)==null?void 0:c.arguments)||"";t.push({role:"assistant",type:"tool_use",header:`[工具调用: ${g}]`,content:v||`[工具调用: ${g}]`,...n})}if(t.length>0)return t}if(u.output){let p="";const d=Array.isArray(u.output)?u.output:[u.output];for(const f of d){if(f.type==="message"&&f.content){const m=Array.isArray(f.content)?f.content:[f.content];for(const g of m)g.type==="output_text"&&g.text?p+=g.text:typeof g=="string"&&(p+=g)}if(f.type==="function_call"){p&&(t.push({role:"assistant",content:p,...n}),p="");const m=f.name||"",g=f.call_id?f.call_id.slice(-8):"",v=m+(g?` · ...${g}`:""),x=f.arguments||"";t.push({role:"assistant",type:"tool_use",header:`[工具调用: ${v}]`,content:x||`[工具调用: ${v}]`,...n})}}if(p&&t.push({role:"assistant",content:p,...n}),t.length>0)return t}}catch{}return t}function ab(e){var i,a;const t=[];let n=0;const r=new Map;for(const s of e){const l=((i=s.body)==null?void 0:i.messages)||[];for(const c of l)if(c.role==="assistant"&&Array.isArray(c.content))for(const u of c.content)u.type==="tool_use"&&u.id&&u.name&&r.set(u.id,u.name)}for(const s of e){const l=((a=s.body)==null?void 0:a.messages)||[],c=l.slice(n);n=l.length;for(const p of c){const d=bU(p,s.timestamp,s.requestModel,r);t.push(...d)}const u=wU(s);t.push(...u)}return SU(t)}function SU(e){const t=[];for(const n of e){if(n.role!=="assistant"){t.push(n);continue}const r=t.findIndex(i=>i.role==="assistant"&&i.type===n.type&&i.content===n.content);if(r===-1)t.push(n);else{const i=t[r],a=!!n.tokens,s=!!i.tokens;a&&!s&&(t[r]=n)}}return t}function Bo(e){return(e||"").replace("<session>","").replace("</session>","").trim()||"(无标题)"}function jU({content:e,header:t,forceCollapsible:n,hideContentWhenCollapsed:r}){const i=e.split(`
|
|
125
|
+
`),a=10,s=3,l=h.useRef(null),c=!!n,u=n||i.length>a,p=c?s:a,[d,f]=h.useState(!u),m=()=>{d?(requestAnimationFrame(()=>{const g=l.current,v=g==null?void 0:g.closest(".modal-body-scrollable");if(g&&v){const x=g.getBoundingClientRect(),y=v.getBoundingClientRect();(x.top<y.top||x.top>y.bottom)&&g.scrollIntoView({block:"start"})}}),f(!1)):f(!0)};return u?!d&&r?o.jsx("div",{className:"chat-collapsible-wrapper",ref:l,style:{width:"400px"},children:o.jsxs("div",{className:"chat-collapse-top-bar",children:[t&&o.jsx("div",{className:"chat-tool-header",children:t}),o.jsx("div",{className:"chat-collapse-btn-sticky",children:o.jsxs("button",{className:"chat-collapse-btn",onClick:m,children:["展开 (",i.length," 行)"]})})]})}):o.jsxs("div",{className:"chat-collapsible-wrapper",ref:l,style:!d&&c?{width:"400px"}:void 0,children:[o.jsxs("div",{className:"chat-collapse-top-bar",children:[t&&o.jsx("div",{className:"chat-tool-header",children:t}),o.jsx("div",{className:"chat-collapse-btn-sticky",children:o.jsx("button",{className:"chat-collapse-btn",onClick:m,children:d?"收起":`展开全部 (${i.length} 行)`})})]}),o.jsx("div",{className:"chat-content-text",children:d?e:i.slice(0,p).join(`
|
|
126
|
+
`)}),!d&&o.jsx("div",{className:"chat-collapse-fade",onClick:m,children:o.jsxs("span",{className:"chat-collapse-fade-btn",children:["展开全部 (",i.length," 行)"]})})]}):o.jsxs(o.Fragment,{children:[t&&o.jsx("div",{className:"chat-tool-header",children:t}),o.jsx("div",{className:"chat-content-text",children:e})]})}function kU({logs:e,onFetchNew:t}){const n=[...e].sort((m,g)=>m.timestamp-g.timestamp),[r,i]=h.useState(n),a=ab(r),s=h.useRef(null),[l,c]=h.useState(!1),[u,p]=h.useState(!1);h.useEffect(()=>{i([...e].sort((m,g)=>m.timestamp-g.timestamp))},[e]),h.useEffect(()=>{var v;const m=(v=s.current)==null?void 0:v.parentElement;if(!m)return;const g=()=>{const x=m.scrollHeight-m.scrollTop-m.clientHeight<60;c(x)};return m.addEventListener("scroll",g),g(),()=>m.removeEventListener("scroll",g)},[r]);const d=()=>{var g;const m=(g=s.current)==null?void 0:g.parentElement;m&&m.scrollTo({top:m.scrollHeight,behavior:"smooth"})},f=async()=>{if(l&&t){p(!0);try{const m=await t(),g=new Set(r.map(y=>y.id)),x=[...m].sort((y,b)=>y.timestamp-b.timestamp).filter(y=>!g.has(y.id));x.length>0&&(i(y=>[...y,...x]),requestAnimationFrame(()=>d()))}finally{p(!1)}}else d()};return a.length===0?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:"暂无对话内容"}):o.jsxs("div",{className:"chat-view-container",ref:s,children:[a.map((m,g)=>o.jsxs("div",{className:`chat-message chat-message--${m.role}${m.type?` chat-message--${m.type}`:""}`,children:[o.jsxs("div",{className:"chat-bubble",children:[m.role==="assistant"&&m.thinking&&o.jsxs("details",{className:"chat-thinking",children:[o.jsxs("summary",{children:["思考内容 (",m.thinking.length," 字符)"]}),o.jsx("pre",{children:m.thinking})]}),m.content&&o.jsx(jU,{content:m.content,header:m.header,forceCollapsible:!!m.type,hideContentWhenCollapsed:m.type==="tool_use"})]}),!m.type&&o.jsxs("div",{className:"chat-meta",children:[bt(m.timestamp).format("HH:mm:ss"),m.model&&` · ${m.model}`,m.tokens&&` · ${m.tokens.toLocaleString()} tokens`]})]},g)),o.jsx("div",{className:"chat-scroll-bottom",children:o.jsx("button",{className:"chat-scroll-bottom-btn",onClick:f,disabled:u,children:u?o.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"spin-icon",children:o.jsx("path",{d:"M21.5 2v6h-6M2.5 22v-6h6M2 11.5a10 10 0 0 1 18.8-4.3M22 12.5a10 10 0 0 1-18.8 4.3"})}):o.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M12 5v14M5 12l7 7 7-7"})})})})]})}function ob({session:e,logs:t,logsLoading:n,onRefreshLogs:r,onFetchNewLogs:i,onClose:a,onExport:s}){const[l,c]=h.useState("logs"),[u,p]=h.useState(null),d=(g,v)=>{const x=v-g;return x<6e4?`${Math.floor(x/1e3)}秒`:x<36e5?`${Math.floor(x/6e4)}分钟`:`${Math.floor(x/36e5)}小时`},f=g=>g>=1e6?(g/1e6).toFixed(1)+"M":g>=1e3?(g/1e3).toFixed(1)+"k":String(g),m=()=>{if(s){s(e,t,l);return}const v=`${Bo(e.title)}.json`;if(l==="chat"){const x=ab(t),y={session:{id:e.id,targetType:e.targetType,title:e.title,firstRequestAt:e.firstRequestAt,lastRequestAt:e.lastRequestAt,requestCount:e.requestCount,totalTokens:e.totalTokens},messages:x.map(k=>({role:k.role,type:k.type,header:k.header,content:k.content,thinking:k.thinking,timestamp:k.timestamp,model:k.model,tokens:k.tokens}))},b=new Blob([JSON.stringify(y,null,2)],{type:"application/json"}),w=URL.createObjectURL(b),S=document.createElement("a");S.href=w,S.download=v,S.click(),URL.revokeObjectURL(w)}else{const x={session:{id:e.id,targetType:e.targetType,title:e.title,firstRequestAt:e.firstRequestAt,lastRequestAt:e.lastRequestAt,requestCount:e.requestCount,totalTokens:e.totalTokens},logs:t},y=new Blob([JSON.stringify(x,null,2)],{type:"application/json"}),b=URL.createObjectURL(y),w=document.createElement("a");w.href=b,w.download=v,w.click(),URL.revokeObjectURL(b)}};return o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:a,"aria-label":"关闭",children:"×"}),o.jsxs("div",{className:"modal modal--sticky-layout",style:{width:"900px",maxWidth:"90vw"},children:[o.jsxs("div",{className:"modal-header",children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("h2",{children:"会话详情"}),o.jsx("button",{className:"session-refresh-btn",onClick:r,disabled:n,title:"刷新",children:o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:n?"spin-icon":"",children:o.jsx("path",{d:"M21.5 2v6h-6M2.5 22v-6h6M2 11.5a10 10 0 0 1 18.8-4.3M22 12.5a10 10 0 0 1-18.8 4.3"})})})]}),o.jsxs("div",{className:"session-view-toggle",children:[o.jsx("button",{className:l==="logs"?"active":"",onClick:()=>c("logs"),children:"日志"}),o.jsx("button",{className:l==="chat"?"active":"",onClick:()=>c("chat"),children:"对话"})]})]}),o.jsx("div",{className:"modal-body-scrollable",children:l==="logs"?o.jsxs(o.Fragment,{children:[o.jsxs("div",{style:{marginBottom:"12px",padding:"10px 12px",background:"var(--bg-secondary)",borderRadius:"8px"},children:[o.jsx("div",{style:{fontSize:"15px",fontWeight:500,marginBottom:"8px"},children:Bo(e.title)}),o.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"12px 20px",fontSize:"13px",color:"var(--text-secondary)"},children:[o.jsxs("div",{children:[o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"类型"})," ",o.jsx("span",{style:{display:"inline-block",padding:"1px 6px",borderRadius:"4px",fontSize:"12px",background:e.targetType==="claude-code"?"rgba(59,130,246,0.1)":"rgba(34,197,94,0.1)",color:e.targetType==="claude-code"?"var(--color-primary, #3b82f6)":"var(--color-success, #22c55e)"},children:e.targetType==="claude-code"?"Claude Code":"Codex"})]}),o.jsxs("div",{children:[o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"请求数"})," ",e.requestCount]}),o.jsxs("div",{children:[o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"Tokens"})," ",f(e.totalTokens)]}),o.jsxs("div",{children:[o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"时长"})," ",d(e.firstRequestAt,e.lastRequestAt)]}),o.jsxs("div",{children:[o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"首次请求"})," ",bt(e.firstRequestAt).format("YYYY-MM-DD HH:mm:ss")]}),o.jsxs("div",{children:[o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"最后请求"})," ",bt(e.lastRequestAt).format("YYYY-MM-DD HH:mm:ss")]})]})]}),o.jsxs("h3",{style:{marginTop:"0",marginBottom:"10px"},children:["会话日志 (",t.length,")"]}),n?o.jsx("div",{style:{textAlign:"center",padding:"20px"},children:"加载中..."}):t.length===0?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"#7f8c8d"},children:"暂无日志"}):o.jsx("div",{style:{border:"1px solid var(--border-color)",borderRadius:"8px",overflow:"hidden"},children:o.jsxs("table",{style:{fontSize:"14px"},children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"时间"}),o.jsx("th",{children:"状态"}),o.jsx("th",{children:"响应时间"}),o.jsx("th",{children:"Tokens"}),o.jsx("th",{children:"操作"})]})}),o.jsx("tbody",{children:[...t].sort((g,v)=>g.timestamp-v.timestamp).map(g=>o.jsxs("tr",{children:[o.jsx("td",{children:bt(g.timestamp).format("HH:mm:ss")}),o.jsx("td",{children:o.jsx("span",{className:`badge ${g.statusCode&&g.statusCode>=200&&g.statusCode<300?"badge-success":g.statusCode&&g.statusCode>=400?"badge-danger":"badge-warning"}`,children:g.statusCode||"Error"})}),o.jsx("td",{children:g.responseTime?`${g.responseTime}ms`:"-"}),o.jsx("td",{children:g.usage?o.jsx("span",{children:g.usage.totalTokens||g.usage.inputTokens+g.usage.outputTokens}):"-"}),o.jsx("td",{children:o.jsx("button",{className:"btn btn-sm btn-secondary",onClick:()=>p(g),children:"详情"})})]},g.id))})]})})]}):o.jsx(o.Fragment,{children:n?o.jsx("div",{style:{textAlign:"center",padding:"20px"},children:"加载中..."}):o.jsx(kU,{logs:t,onFetchNew:i})})}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-primary",onClick:m,disabled:t.length===0,children:"导出"}),o.jsx("button",{className:"btn btn-secondary",onClick:a,children:"关闭"})]})]}),u&&o.jsx(mf,{log:u,onClose:()=>p(null)})]})}bt.extend(ib);function CU(){const[e,t]=h.useState([]),[n,r]=h.useState(0),[i,a]=h.useState(1),[s,l]=h.useState(20),[c,u]=h.useState(null),[p,d]=h.useState([]),[f,m]=h.useState(!1),[g,v]=h.useState(""),[x,y]=h.useState(""),[b,w]=h.useState(""),[S,k]=h.useState(""),[j,A]=h.useState(""),[E,D]=h.useState(""),[O,_]=h.useState(""),[R,X]=h.useState([]),[V,I]=h.useState([]),[$,H]=h.useState([]),[N,U]=h.useState(!1),[P,W]=h.useState(10),[se,T]=h.useState(null),[he,ye]=h.useState(null),[Z,le]=h.useState(!1),Se=h.useRef({sessionsPage:i,sessionsPageSize:s,appliedSearchQuery:x,filterTargetType:b,filterVendorId:S,filterServiceId:j,filterModel:E,filterRouteId:O});Se.current={sessionsPage:i,sessionsPageSize:s,appliedSearchQuery:x,filterTargetType:b,filterVendorId:S,filterServiceId:j,filterModel:E,filterRouteId:O},h.useEffect(()=>{ne()},[i,s,x,b,S,j,E,O]),h.useEffect(()=>{Q()},[]),h.useEffect(()=>{let J=null,q=null;return N&&(q=setInterval(()=>{W(ue=>ue<=1?10:ue-1)},1e3),J=setInterval(()=>{ne()},1e4)),()=>{J&&clearInterval(J),q&&clearInterval(q)}},[N,i,s]);const Q=async()=>{try{const[J,q,ue]=await Promise.all([Y.getVendors(),Y.getAPIServices(),Y.getRoutes()]);X(J),I(q),H(ue)}catch(J){console.error("Failed to load filter options:",J)}},ne=async()=>{const J=Se.current;try{const q=(J.sessionsPage-1)*J.sessionsPageSize,ue=await Y.getSessions({filters:{targetType:J.filterTargetType||void 0,vendorId:J.filterVendorId||void 0,serviceId:J.filterServiceId||void 0,model:J.filterModel||void 0,routeId:J.filterRouteId||void 0},keyword:J.appliedSearchQuery.trim()||void 0,limit:J.sessionsPageSize,offset:q});t(ue.sessions),r(ue.total)}catch(q){console.error("Failed to load sessions:",q)}},pe=async J=>{u(J),m(!0);try{const q=await Y.getSessionLogs(J.id,1e4);d(q)}catch(q){console.error("Failed to load session logs:",q)}finally{m(!1)}},ie=(J,q)=>{const ue=q-J;return ue<6e4?`${Math.floor(ue/1e3)}秒`:ue<36e5?`${Math.floor(ue/6e4)}分钟`:`${Math.floor(ue/36e5)}小时`},_e=J=>J==="claude-code"?o.jsx("span",{className:"badge badge-claude-code",children:"Claude Code"}):J==="codex"?o.jsx("span",{className:"badge badge-codex",children:"Codex"}):o.jsx("span",{className:"badge",children:J}),ke=J=>{k(J),A(""),D(""),a(1)},te=J=>{A(J),D(""),a(1)},De=()=>S?V.filter(J=>J.vendorId===S):[],Ve=()=>{if(!j)return[];const J=V.find(q=>q.id===j);return(J==null?void 0:J.supportedModels)||[]},Le=!!(x||b||S||j||E||O),We=()=>{v(""),y(""),w(""),k(""),A(""),D(""),_(""),a(1)},pt=(J,q,ue)=>{const M=J;if(ue==="chat"){const Ge=ab(q).map((Ee,Ye)=>({index:Ye+1,role:Ee.role,type:Ee.type||null,header:Ee.header||null,content:Ee.content,thinking:Ee.thinking||null,timestamp:bt(Ee.timestamp).format("YYYY-MM-DD HH:mm:ss"),model:Ee.model||null,tokens:Ee.tokens||null})),L={session:{id:M.id,title:Bo(M.title),targetType:M.targetType,requestCount:M.requestCount,totalTokens:M.totalTokens,firstRequestAt:bt(M.firstRequestAt).format("YYYY-MM-DD HH:mm:ss"),lastRequestAt:bt(M.lastRequestAt).format("YYYY-MM-DD HH:mm:ss"),duration:ie(M.firstRequestAt,M.lastRequestAt)},messages:Ge,exportedAt:bt().format("YYYY-MM-DD HH:mm:ss")},ge=JSON.stringify(L,null,2),F=new Blob([ge],{type:"application/json;charset=utf-8"}),de=URL.createObjectURL(F),ve=document.createElement("a");ve.href=de;const Ae=Bo(M.title).replace(/[\\/:*?"<>|]/g,"_");ve.download=`${Ae}_对话.json`,document.body.appendChild(ve),ve.click(),document.body.removeChild(ve),URL.revokeObjectURL(de),K.success("对话数据已导出");return}const fe=q.map((Ie,Ge)=>{var de,ve,Ae,Ee;const L=((de=Ie.body)==null?void 0:de.messages)||[];let ge="";const F=Ie.downstreamResponseBody;if(typeof F=="string"&&(F.includes("event:")||F.includes("data:"))){const Ye=Hu(F),{text:tt,thinking:at}=Vu(Ye),Ze=[];at&&Ze.push(`<details><summary>思考过程</summary>
|
|
127
|
+
|
|
128
|
+
${at}
|
|
129
|
+
|
|
130
|
+
</details>`),tt&&Ze.push(tt),ge=Ze.join(`
|
|
131
|
+
|
|
132
|
+
`)}if(!ge&&Ie.responseBody)try{const Ye=typeof Ie.responseBody=="string"?JSON.parse(Ie.responseBody):Ie.responseBody;if(Ye.content){if(Array.isArray(Ye.content)){const tt=[];for(const at of Ye.content)at.type==="text"&&at.text?tt.push(at.text):at.type==="thinking"&&at.thinking&&tt.push(`<details><summary>思考过程</summary>
|
|
133
|
+
|
|
134
|
+
${at.thinking}
|
|
135
|
+
|
|
136
|
+
</details>`);ge=tt.join(`
|
|
137
|
+
|
|
138
|
+
`)}typeof Ye.content=="string"&&(ge=Ye.content)}!ge&&((Ee=(Ae=(ve=Ye.choices)==null?void 0:ve[0])==null?void 0:Ae.message)!=null&&Ee.content)&&(ge=Ye.choices[0].message.content)}catch{}return{index:Ge+1,timestamp:bt(Ie.timestamp).format("YYYY-MM-DD HH:mm:ss"),statusCode:Ie.statusCode||null,responseTime:Ie.responseTime||null,requestModel:Ie.requestModel||null,targetModel:Ie.targetModel||null,vendorName:Ie.vendorName||null,serviceName:Ie.targetServiceName||null,contentType:Ie.contentType||null,tags:Ie.tags||[],usage:Ie.usage||null,messages:L,response:ge||null}}),ee={session:{id:M.id,title:M.title||null,targetType:M.targetType,requestCount:M.requestCount,totalTokens:M.totalTokens,model:M.model||null,vendorName:M.vendorName||null,serviceName:M.serviceName||null,firstRequestAt:bt(M.firstRequestAt).format("YYYY-MM-DD HH:mm:ss"),lastRequestAt:bt(M.lastRequestAt).format("YYYY-MM-DD HH:mm:ss"),duration:ie(M.firstRequestAt,M.lastRequestAt)},logs:fe,exportedAt:bt().format("YYYY-MM-DD HH:mm:ss")},xe=JSON.stringify(ee,null,2),je=new Blob([xe],{type:"application/json;charset=utf-8"}),Re=URL.createObjectURL(je),ze=document.createElement("a");ze.href=Re;const Ke=Bo(M.title).replace(/[\\/:*?"<>|]/g,"_");ze.download=`${Ke}.json`,document.body.appendChild(ze),ze.click(),document.body.removeChild(ze),URL.revokeObjectURL(Re),K.success("导出成功")},qe=J=>a(J),Xe=J=>{l(J),a(1)},Qe={padding:"6px 10px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)",minWidth:"140px"},et={fontWeight:"bold",color:"var(--text-primary)"};return o.jsxs("div",{className:"sessions-page",children:[o.jsx("div",{className:"page-header",children:o.jsxs("div",{className:"page-header-content",children:[o.jsxs("div",{className:"page-header-text",children:[o.jsx("h1",{children:"会话"}),o.jsx("p",{children:"查看和管理所有会话记录"})]}),o.jsx("button",{className:"btn btn-danger",onClick:()=>le(!0),children:"清除会话"})]})}),o.jsxs("div",{className:"card",children:[o.jsxs("div",{className:"toolbar",children:[o.jsx("h3",{children:"会话列表"}),o.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"center"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[o.jsx("input",{type:"checkbox",id:"auto-refresh",checked:N,onChange:J=>{U(J.target.checked),W(10)}}),o.jsxs("label",{htmlFor:"auto-refresh",style:{cursor:"pointer",fontSize:"14px",color:"var(--text-primary)",userSelect:"none"},children:["自动刷新 ",N&&`(⏱ ${P}s)`]})]}),o.jsx("button",{className:"btn btn-primary",onClick:()=>{ne(),W(10)},children:"刷新"})]})]}),o.jsxs("div",{style:{padding:"15px",background:"var(--bg-secondary)",borderRadius:"12px",marginBottom:"20px",display:"flex",gap:"15px",alignItems:"center",flexWrap:"wrap",border:"1px solid var(--border-primary)"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("label",{style:et,children:"来源类型:"}),o.jsxs("select",{value:b,onChange:J=>{w(J.target.value),a(1)},style:Qe,children:[o.jsx("option",{value:"",children:"全部"}),o.jsx("option",{value:"claude-code",children:"Claude Code"}),o.jsx("option",{value:"codex",children:"Codex"})]})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("label",{style:et,children:"供应商:"}),o.jsxs("select",{value:S,onChange:J=>ke(J.target.value),style:Qe,children:[o.jsx("option",{value:"",children:"全部供应商"}),R.map(J=>o.jsx("option",{value:J.id,children:J.name},J.id))]})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("label",{style:et,children:"API服务:"}),o.jsxs("select",{value:j,onChange:J=>te(J.target.value),disabled:!S,style:{...Qe,background:S?"var(--bg-card)":"var(--bg-secondary)",cursor:S?"pointer":"not-allowed",opacity:S?1:.6},children:[o.jsx("option",{value:"",children:"全部服务"}),De().map(J=>o.jsx("option",{value:J.id,children:J.name},J.id))]})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("label",{style:et,children:"模型:"}),o.jsxs("select",{value:E,onChange:J=>{D(J.target.value),a(1)},disabled:!j,style:{...Qe,background:j?"var(--bg-card)":"var(--bg-secondary)",cursor:j?"pointer":"not-allowed",opacity:j?1:.6},children:[o.jsx("option",{value:"",children:"全部模型"}),Ve().map(J=>o.jsx("option",{value:J,children:J},J))]})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("label",{style:et,children:"路由:"}),o.jsxs("select",{value:O,onChange:J=>{_(J.target.value),a(1)},style:Qe,children:[o.jsx("option",{value:"",children:"全部路由"}),$.map(J=>o.jsx("option",{value:J.id,children:J.name},J.id))]})]}),Le&&o.jsx("button",{onClick:We,style:{padding:"6px 12px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",border:"1px solid var(--accent-danger)",background:"var(--accent-danger)",color:"white"},children:"清除筛选"}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("input",{type:"text",placeholder:"搜索标题或ID...",value:g,onChange:J=>v(J.target.value),onKeyDown:J=>{J.key==="Enter"&&(y(g),a(1))},style:{padding:"6px 12px",border:"1px solid var(--border-primary)",borderRadius:"8px",fontSize:"14px",width:"320px",background:"var(--bg-card)",color:"var(--text-primary)"}}),o.jsx("button",{onClick:()=>{y(g),a(1)},style:{padding:"6px 16px",borderRadius:"8px",cursor:"pointer",fontSize:"14px",border:"none",background:"var(--accent-primary, #3498db)",color:"white"},children:"搜索"}),(g||x)&&o.jsx("button",{onClick:()=>{v(""),y(""),a(1)},style:{padding:"6px 12px",borderRadius:"8px",cursor:"pointer",fontSize:"13px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)"},children:"清空"})]})]}),e.length===0?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:Le?"没有匹配的会话":"暂无会话记录"})}):o.jsxs(o.Fragment,{children:[o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"标题"}),o.jsx("th",{children:"客户端类型"}),o.jsx("th",{children:"请求数"}),o.jsx("th",{children:"Tokens"}),o.jsx("th",{children:"首次请求"}),o.jsx("th",{children:"最后请求"}),o.jsx("th",{children:"时长"}),o.jsx("th",{children:"操作"})]})}),o.jsx("tbody",{children:e.map(J=>o.jsxs("tr",{onClick:()=>pe(J),style:{cursor:"pointer",backgroundColor:(c==null?void 0:c.id)===J.id?"var(--bg-selected)":void 0},children:[o.jsx("td",{style:{maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Bo(J.title)}),o.jsx("td",{children:_e(J.targetType)}),o.jsx("td",{children:J.requestCount}),o.jsx("td",{children:J.totalTokens.toLocaleString()}),o.jsx("td",{children:bt(J.firstRequestAt).format("MM-DD HH:mm")}),o.jsx("td",{children:bt(J.lastRequestAt).format("MM-DD HH:mm")}),o.jsx("td",{children:ie(J.firstRequestAt,J.lastRequestAt)}),o.jsx("td",{children:o.jsxs("div",{style:{display:"flex",gap:"6px"},children:[o.jsx("button",{className:"btn btn-sm btn-secondary",onClick:q=>{q.stopPropagation(),pe(J)},children:"查看"}),o.jsx("button",{className:"btn btn-sm btn-primary",onClick:q=>{q.stopPropagation(),u(J),m(!0),Y.getSessionLogs(J.id,1e4).then(ue=>d(ue)).catch(console.error).finally(()=>m(!1))},children:"对话"}),o.jsx("button",{className:"btn btn-sm",style:{backgroundColor:"#8e44ad",color:"white",border:"none"},onClick:q=>{q.stopPropagation(),T(J)},title:"迁移到另一个工具",children:"迁移"}),o.jsx("button",{className:"btn btn-sm",style:{backgroundColor:J.routeId?"#27ae60":"#2980b9",color:"white",border:"none",minWidth:(J.routeId,void 0)},onClick:q=>{q.stopPropagation(),ye(J)},title:J.routeId?`已绑定: ${J.routeName||J.routeId}`:"绑定路由",children:J.routeName?J.routeName.length>8?J.routeName.slice(0,8)+"…":J.routeName:"路由"})]})})]},J.id))})]}),o.jsx(xu,{currentPage:i,pageSize:s,totalItems:n,onPageChange:qe,onPageSizeChange:Xe})]})]}),c&&o.jsx(ob,{session:c,logs:p,logsLoading:f,onRefreshLogs:async()=>{if(c){m(!0);try{const J=await Y.getSessionLogs(c.id,1e4);d(J)}catch(J){console.error("Failed to refresh session logs:",J)}finally{m(!1)}}},onFetchNewLogs:async()=>{if(!c)return[];const J=await Y.getSessionLogs(c.id,1e4);return d(J),J},onClose:()=>{u(null),d([])},onExport:pt}),se&&o.jsx(gU,{session:se,onClose:()=>T(null)}),he&&o.jsx(yU,{session:he,onClose:()=>ye(null),onBound:()=>{ne()}}),Z&&o.jsx(xU,{onClose:()=>le(!1),onCleared:()=>{a(1),ne()}})]})}function Pl({checked:e,onChange:t,disabled:n,label:r,labelPosition:i="right"}){const a=o.jsx("button",{type:"button",role:"switch","aria-checked":e,className:`switch ${e?"active":""}`,onClick:()=>!n&&t(!e),disabled:n,children:o.jsx("span",{className:"switch-thumb",style:{position:"absolute",top:"2px",left:e?"22px":"2px",width:"20px",height:"20px",borderRadius:"10px",backgroundColor:"#fff",transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}})});return r?i==="left"?o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:n?"not-allowed":"pointer"},children:[o.jsx("span",{style:{fontSize:"14px",color:"var(--text-muted)"},children:r}),a]}):o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:n?"not-allowed":"pointer"},children:[a,o.jsx("span",{style:{fontSize:"14px",color:"var(--text-muted)"},children:r})]}):a}function tk({skillId:e,targetType:t,enabled:n,onChange:r,disabled:i}){const a=t==="claude-code"?"Claude Code":"Codex";return o.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:o.jsx(Pl,{checked:n,onChange:s=>r(e,t,s),disabled:i,label:a,labelPosition:"right"})})}function PU(){var I,$,H,N,U,P;const[e,t]=h.useState(null),[n,r]=h.useState(!0),[i,a]=h.useState("10"),[s,l]=h.useState(""),[c,u]=h.useState(""),[p,d]=h.useState(""),[f,m]=h.useState({proxyEnabled:!1,proxyUrl:"",proxyUsername:"",proxyPassword:""}),[g,v]=h.useState(!1),[x,y]=h.useState(null),[b,w]=h.useState(!1),[S,k]=h.useState(!1);h.useEffect(()=>{j()},[]);const j=async()=>{const W=await Y.getConfig();t(W),r(W.enableFailover!==!1),a(typeof W.failoverRecoverySeconds=="number"&&W.failoverRecoverySeconds>0?String(Math.floor(W.failoverRecoverySeconds)):"10"),m({proxyEnabled:W.proxyEnabled||!1,proxyUrl:W.proxyUrl||"",proxyUsername:W.proxyUsername||"",proxyPassword:W.proxyPassword||""}),v(W.enableLanDiscovery||!1)},A=async W=>{W.preventDefault();const se=Number(i),T=Number.isFinite(se)&&se>0?Math.floor(se):10,he={...e,enableFailover:n,failoverRecoverySeconds:T};await Y.updateConfig(he)?(K.success("配置保存成功"),j()):K.error("配置保存失败")},E=async W=>{W.preventDefault();const se=new FormData(W.currentTarget),T={...e,enableLogging:se.get("enableLogging")==="true",logRetentionDays:parseInt(se.get("logRetentionDays")),maxLogSize:parseInt(se.get("maxLogSize"))};await Y.updateConfig(T)?(K.success("日志配置保存成功"),j()):K.error("日志配置保存失败")},D=async W=>{W.preventDefault();const se=new FormData(W.currentTarget),T={...e,proxyEnabled:se.get("proxyEnabled")==="true",proxyUrl:se.get("proxyUrl"),proxyUsername:se.get("proxyUsername"),proxyPassword:se.get("proxyPassword")};await Y.updateConfig(T)?(K.success("代理配置保存成功"),j()):K.error("代理配置保存失败")},O=async W=>{v(W);const se={...e,enableLanDiscovery:W};await Y.updateConfig(se)?(K.success(W?"已开启局域网同步":"已关闭局域网同步"),j()):(v(!W),K.error("配置保存失败"))},_=async()=>{if(!s){K.warning("请输入密码");return}try{const W=await Y.exportData(s);d(W),K.success("导出成功,请复制下方数据")}catch(W){K.error("导出失败: "+W.message)}},R=async()=>{if(!s||!c){K.warning("请输入密码和导入数据");return}w(!0);try{const W=await Y.previewImportData(c,s);y(W),W.success||K.error(W.message||"预览失败")}catch(W){K.error("预览失败: "+W.message),y({success:!1,message:W.message})}finally{w(!1)}},X=async()=>{if(!s||!c||!(x!=null&&x.success)){K.warning("请先预览数据并确认无误");return}k(!0);try{const W=await Y.importData(c,s);W.success?(K.success(W.message+(W.details?` (${W.details})`:"")),u(""),l(""),y(null)):K.error(W.message+(W.details?`: ${W.details}`:""))}catch(W){K.error("导入失败: "+W.message)}finally{k(!1)}},V=()=>{y(null),u(""),l("")};return e?o.jsxs("div",{children:[o.jsxs("div",{className:"page-header",children:[o.jsx("h1",{children:"设置"}),o.jsx("p",{children:"管理应用配置和数据导入导出"})]}),o.jsxs("div",{className:"card",children:[o.jsx("h3",{children:"应用配置"}),o.jsxs("form",{onSubmit:A,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"启用智能故障切换"}),o.jsxs("select",{name:"enableFailover",value:n?"true":"false",onChange:W=>r(W.target.value==="true"),children:[o.jsx("option",{value:"true",children:"是"}),o.jsx("option",{value:"false",children:"否"})]}),o.jsx("small",{style:{display:"block",marginTop:"4px",color:"#666",fontSize:"12px"},children:"启用后,当某个服务报错时会自动切换到备用服务,并按下方“故障自动恢复时间”自动恢复"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"故障自动恢复时间(秒)"}),o.jsx("input",{type:"number",name:"failoverRecoverySeconds",min:1,step:1,value:i,onChange:W=>a(W.target.value),disabled:!n}),o.jsx("small",{style:{display:"block",marginTop:"4px",color:"#666",fontSize:"12px"},children:"默认 10 秒。仅在“启用智能故障切换”为“是”时可修改"})]}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存配置"})]})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("h3",{children:"日志设置"}),o.jsx("p",{style:{color:"#7f8c8d",fontSize:"14px"},children:"配置请求日志的记录和保留策略。"}),o.jsxs("form",{onSubmit:E,children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"启用日志"}),o.jsxs("select",{name:"enableLogging",defaultValue:e.enableLogging?"true":"false",children:[o.jsx("option",{value:"true",children:"是"}),o.jsx("option",{value:"false",children:"否"})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"日志保留天数"}),o.jsx("input",{type:"number",name:"logRetentionDays",defaultValue:e.logRetentionDays,required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"最大日志数量"}),o.jsx("input",{type:"number",name:"maxLogSize",defaultValue:e.maxLogSize,required:!0})]}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存日志配置"})]})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("h3",{children:"代理设置"}),o.jsx("p",{style:{color:"#7f8c8d",fontSize:"14px"},children:"配置代理服务器,API 服务可选择是否通过代理转发请求。"}),o.jsxs("form",{onSubmit:D,children:[o.jsx("input",{type:"hidden",name:"proxyEnabled",value:f.proxyEnabled?"true":"false"}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"启用代理"}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[o.jsx(Pl,{checked:f.proxyEnabled,onChange:W=>m(se=>({...se,proxyEnabled:W}))}),o.jsx("span",{style:{fontSize:"14px",color:"#666"},children:f.proxyEnabled?"已启用":"未启用"})]})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"代理地址"}),o.jsx("input",{type:"text",name:"proxyUrl",value:f.proxyUrl,onChange:W=>m(se=>({...se,proxyUrl:W.target.value})),placeholder:"例如: proxy.example.com:8080 或 http://proxy.example.com:8080"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"代理用户名(可选)"}),o.jsx("input",{type:"text",name:"proxyUsername",value:f.proxyUsername,onChange:W=>m(se=>({...se,proxyUsername:W.target.value})),placeholder:"如果代理需要认证"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"代理密码(可选)"}),o.jsx("input",{type:"password",name:"proxyPassword",value:f.proxyPassword,onChange:W=>m(se=>({...se,proxyPassword:W.target.value})),placeholder:"如果代理需要认证"})]}),o.jsx("button",{type:"submit",className:"btn btn-primary",children:"保存代理配置"})]})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("h3",{children:"局域网同步"}),o.jsx("p",{style:{color:"#7f8c8d",fontSize:"14px"},children:"开启后,同一局域网内的其他 AICodeSwitch 节点可以发现并拉取本节点的 Skills、MCP 配置信息。上游 API Key 等敏感信息不会被传输。"}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"允许局域网拉取配置"}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[o.jsx(Pl,{checked:g,onChange:O}),o.jsx("span",{style:{fontSize:"14px",color:"#666"},children:g?"已启用":"未启用"})]})]})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("h3",{children:"数据导出"}),o.jsx("p",{style:{color:"#7f8c8d",fontSize:"14px"},children:"导出所有配置数据,包括供应商、API服务、路由等。数据将使用密码加密。"}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"加密密码"}),o.jsx("input",{type:"password",value:s,onChange:W=>l(W.target.value),placeholder:"用于加密导出数据"})]}),o.jsx("button",{className:"btn btn-primary",onClick:_,children:"导出数据"}),p&&o.jsxs("div",{className:"form-group",style:{marginTop:"20px"},children:[o.jsx("label",{children:"导出的数据(请复制保存)"}),o.jsx("textarea",{rows:6,value:p,readOnly:!0,style:{fontFamily:"monospace",fontSize:"12px"}}),o.jsx("button",{className:"btn btn-secondary",style:{marginTop:"10px"},onClick:()=>{navigator.clipboard.writeText(p),K.success("已复制到剪贴板")},children:"复制到剪贴板"})]})]}),o.jsxs("div",{className:"card",style:{marginTop:"20px"},children:[o.jsx("h3",{children:"数据导入"}),o.jsx("p",{style:{color:"#e74c3c",fontSize:"14px",fontWeight:500},children:"警告:导入数据将覆盖所有现有配置!请确保已备份重要数据。"}),x!=null&&x.success?o.jsxs(o.Fragment,{children:[o.jsxs("div",{style:{marginTop:"15px",padding:"15px",backgroundColor:"#e8f4fd",borderRadius:"6px",border:"1px solid #bee5eb"},children:[o.jsx("h4",{style:{margin:"0 0 12px 0",color:"#0c5460",fontSize:"16px"},children:"数据预览"}),o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"10px",marginBottom:"12px"},children:[o.jsxs("div",{style:{padding:"10px",backgroundColor:"white",borderRadius:"4px"},children:[o.jsx("div",{style:{fontSize:"12px",color:"#666"},children:"供应商"}),o.jsx("div",{style:{fontSize:"20px",fontWeight:"bold",color:"#333"},children:((I=x.data)==null?void 0:I.vendors)||0})]}),o.jsxs("div",{style:{padding:"10px",backgroundColor:"white",borderRadius:"4px"},children:[o.jsx("div",{style:{fontSize:"12px",color:"#666"},children:"API服务"}),o.jsx("div",{style:{fontSize:"20px",fontWeight:"bold",color:"#333"},children:(($=x.data)==null?void 0:$.services)||0})]}),o.jsxs("div",{style:{padding:"10px",backgroundColor:"white",borderRadius:"4px"},children:[o.jsx("div",{style:{fontSize:"12px",color:"#666"},children:"路由"}),o.jsx("div",{style:{fontSize:"20px",fontWeight:"bold",color:"#333"},children:((H=x.data)==null?void 0:H.routes)||0})]}),o.jsxs("div",{style:{padding:"10px",backgroundColor:"white",borderRadius:"4px"},children:[o.jsx("div",{style:{fontSize:"12px",color:"#666"},children:"规则"}),o.jsx("div",{style:{fontSize:"20px",fontWeight:"bold",color:"#333"},children:((N=x.data)==null?void 0:N.rules)||0})]})]}),o.jsxs("div",{style:{fontSize:"12px",color:"#666",marginTop:"8px"},children:[o.jsxs("div",{children:["数据版本: ",(U=x.data)==null?void 0:U.version]}),o.jsxs("div",{children:["导出时间: ",(P=x.data)!=null&&P.exportDate?new Date(x.data.exportDate).toLocaleString("zh-CN"):"-"]})]})]}),o.jsxs("div",{style:{marginTop:"15px",padding:"12px",backgroundColor:"#fff3cd",borderRadius:"4px",border:"1px solid #ffeaa7",color:"#856404"},children:[o.jsx("strong",{children:"确认导入?"})," 此操作将覆盖所有现有的供应商、服务、路由和规则配置,且无法撤销。"]}),o.jsxs("div",{style:{marginTop:"15px",display:"flex",gap:"10px"},children:[o.jsx("button",{className:"btn btn-danger",onClick:X,disabled:S,children:S?"导入中...":"确认导入"}),o.jsx("button",{className:"btn btn-secondary",onClick:V,disabled:S,children:"取消"})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"解密密码"}),o.jsx("input",{type:"password",value:s,onChange:W=>l(W.target.value),placeholder:"用于解密导入数据"})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"导入数据"}),o.jsx("textarea",{rows:6,value:c,onChange:W=>u(W.target.value),placeholder:"粘贴导出的加密数据",style:{fontFamily:"monospace",fontSize:"12px"}})]}),o.jsx("button",{className:"btn btn-primary",onClick:R,disabled:b||!s||!c,children:b?"预览中...":"预览数据"}),(x==null?void 0:x.success)===!1&&o.jsxs("div",{style:{marginTop:"10px",padding:"10px",backgroundColor:"#fdeaea",borderRadius:"4px",color:"#e74c3c"},children:[o.jsx("strong",{children:"预览失败:"}),x.message]})]})]})]}):o.jsx("div",{children:"加载中..."})}function AU(){var f,m,g,v,x,y,b,w;const[e,t]=h.useState({claude:!1,codex:!1}),[n,r]=h.useState({claude:!1,codex:!1}),[i,a]=h.useState({claude:null,codex:null}),[s,l]=h.useState("");h.useEffect(()=>{c()},[]);const c=async()=>{try{const[S,k]=await Promise.all([Y.getClaudeConfigStatus(),Y.getCodexConfigStatus()]);a({claude:S,codex:k})}catch(S){console.error("Failed to check config status:",S)}},u=async S=>{t(k=>({...k,[S]:!0})),l("");try{(S==="claude"?await Y.writeClaudeConfig():await Y.writeCodexConfig())?(l(`${S==="claude"?"Claude Code":"Codex"}配置文件写入成功!原始文件已备份为 .aicodeswitch_backup 文件。`),await c()):l("写入失败: 操作未成功")}catch(k){l(`写入失败: ${k.message}`)}finally{t(k=>({...k,[S]:!1}))}},p=async S=>{r(k=>({...k,[S]:!0})),l("");try{(S==="claude"?await Y.restoreClaudeConfig():await Y.restoreCodexConfig())?(l(`${S==="claude"?"Claude Code":"Codex"}配置文件已从备份恢复!`),await c()):l("恢复失败: 操作未成功")}catch(k){l(`恢复失败: ${k.message}`)}finally{r(k=>({...k,[S]:!1}))}},d=S=>{const k=i[S];if(!k)return null;const j=S==="claude"?"Claude Code":"Codex";return k.isOverwritten&&k.isModified?o.jsxs("p",{style:{color:"#f39c12",fontSize:"12px",marginTop:"10px"},children:["⚠️ 检测到",j,"配置已被修改,但备份文件仍然存在。建议先恢复原始配置,再重新写入以确保配置正确。"]}):k.isOverwritten&&!k.isModified?o.jsxs("p",{style:{color:"#27ae60",fontSize:"12px",marginTop:"10px"},children:["✓ ",j,"配置已正确设置为代理模式,且未被修改。"]}):!k.isOverwritten&&k.hasBackup?o.jsx("p",{style:{color:"#e74c3c",fontSize:"12px",marginTop:"10px"},children:"⚠️ 检测到配置状态不一致。备份文件存在但当前配置不是代理配置,请先恢复或手动删除备份文件。"}):null};return o.jsxs("div",{children:[o.jsxs("div",{className:"page-header",children:[o.jsx("h1",{children:"写入配置"}),o.jsx("p",{children:"将Claude Code和Codex的配置文件写入到用户目录"})]}),o.jsxs("div",{className:"card",style:{marginBottom:"20px"},children:[o.jsx("h3",{children:"Claude Code配置"}),o.jsx("p",{style:{color:"#7f8c8d",marginBottom:"15px"},children:"为Claude Code工具写入配置文件。原始文件将被备份为.aicodeswitch_backup文件。"}),o.jsxs("div",{style:{marginBottom:"15px"},children:[o.jsx("h4",{children:"配置文件:"}),o.jsxs("ul",{style:{color:"#7f8c8d",lineHeight:"1.6"},children:[o.jsxs("li",{children:[o.jsx("code",{children:"~/.claude/settings.json"})," - Claude Code设置"]}),o.jsxs("li",{children:[o.jsx("code",{children:"~/.claude.json"})," - Claude Code初始化设置"]})]})]}),o.jsxs("div",{style:{display:"flex",gap:"10px"},children:[o.jsx("button",{className:"btn btn-primary",onClick:()=>u("claude"),disabled:e.claude||(((f=i.claude)==null?void 0:f.isOverwritten)??!1),children:e.claude?"写入中...":"写入Claude Code配置"}),o.jsx("button",{className:"btn btn-secondary",onClick:()=>p("claude"),disabled:n.claude||!(((m=i.claude)==null?void 0:m.hasBackup)??!1),children:n.claude?"恢复中...":"恢复Claude Code配置"})]}),d("claude"),((g=i.claude)==null?void 0:g.isOverwritten)&&!((v=i.claude)!=null&&v.isModified)&&o.jsx("p",{style:{color:"#e74c3c",fontSize:"12px",marginTop:"10px"},children:"⚠️ 配置已被覆盖,如需重新写入请先恢复原始配置"})]}),o.jsxs("div",{className:"card",children:[o.jsx("h3",{children:"Codex配置"}),o.jsx("p",{style:{color:"#7f8c8d",marginBottom:"15px"},children:"为Codex工具写入配置文件。原始文件将被备份为.aicodeswitch_backup文件。"}),o.jsxs("div",{style:{marginBottom:"15px"},children:[o.jsx("h4",{children:"配置文件:"}),o.jsxs("ul",{style:{color:"#7f8c8d",lineHeight:"1.6"},children:[o.jsxs("li",{children:[o.jsx("code",{children:"~/.codex/config.toml"})," - Codex配置"]}),o.jsxs("li",{children:[o.jsx("code",{children:"~/.codex/auth.json"})," - Codex认证信息"]})]})]}),o.jsxs("div",{style:{display:"flex",gap:"10px"},children:[o.jsx("button",{className:"btn btn-primary",onClick:()=>u("codex"),disabled:e.codex||(((x=i.codex)==null?void 0:x.isOverwritten)??!1),children:e.codex?"写入中...":"写入Codex配置"}),o.jsx("button",{className:"btn btn-secondary",onClick:()=>p("codex"),disabled:n.codex||!(((y=i.codex)==null?void 0:y.hasBackup)??!1),children:n.codex?"恢复中...":"恢复Codex配置"})]}),d("codex"),((b=i.codex)==null?void 0:b.isOverwritten)&&!((w=i.codex)!=null&&w.isModified)&&o.jsx("p",{style:{color:"#e74c3c",fontSize:"12px",marginTop:"10px"},children:"⚠️ 配置已被覆盖,如需重新写入请先恢复原始配置"})]}),s&&o.jsx("div",{style:{marginTop:"20px",padding:"10px",borderRadius:"4px",backgroundColor:s.includes("成功")?"#d4edda":"#f8d7da",color:s.includes("成功")?"#155724":"#721c24",border:`1px solid ${s.includes("成功")?"#c3e6cb":"#f5c6cb"}`},children:s})]})}const EU=`# AI Code Switch
|
|
139
|
+
|
|
140
|
+
## 简介
|
|
141
|
+
|
|
142
|
+
AI Code Switch 是帮助你在本地管理 AI 编程工具接入大模型的工具。
|
|
143
|
+
它可以让你的 Claude Code、Codex 等工具不再局限于官方模型。
|
|
144
|
+
为所有编程工具提供本地API驱动,自动智能的切换不同场景下的模型。
|
|
145
|
+
|
|
146
|
+
**而且它尽可能简单的帮你解决这件事。**
|
|
147
|
+
|
|
148
|
+
- 视频演示:[https://www.bilibili.com/video/BV1uEznBuEJd/](https://www.bilibili.com/video/BV1uEznBuEJd/?from=github)
|
|
149
|
+
- 1分钟让Claude Code接入GLM国产模型:[https://www.bilibili.com/video/BV1a865B8ErA/](https://www.bilibili.com/video/BV1a865B8ErA/)
|
|
150
|
+
- 1分钟让Codex接入免费模型Agnes:[https://www.bilibili.com/video/BV1tQ7Q63Eva/](https://www.bilibili.com/video/BV1tQ7Q63Eva/) Codex接入Deepseek可参考该方法实现
|
|
151
|
+
- 在线教程:[https://space.bilibili.com/37442719/lists/8333248](https://space.bilibili.com/37442719/lists/8333248)
|
|
152
|
+
|
|
153
|
+
## 功能要点
|
|
154
|
+
|
|
155
|
+
* 可登记任意的大模型API接口服务,让你可以在一个面板管理你的大模型厂商
|
|
156
|
+
* 一键切换模型:可以注册多个供应商的多个API接口,当想要切换模型时,只需要点击一个按钮就可以立即切换
|
|
157
|
+
* 自动配置:无需你手动去修改claude code或codex的系统配置文件,aicodeswitch自动帮你修改,你只要启动它,无需配置claude code或codex就可以让它们正常工作
|
|
158
|
+
* 一键配置供应商,省去复杂的供应商配置流程
|
|
159
|
+
* 启动所有已知大模型接口标准,可接入任意客户端,包括但不限于openclaw、hermes、trae等,根据不同需要自主配置接口对应的大模型服务
|
|
160
|
+
* API转流:将兼容openai接口标准的模型,轻松接入到claude code中,支持将符合openai、anthropic、gemini的数据格式转发给claude code或codex
|
|
161
|
+
* 按需中转请求:根据请求类型,让不同的模型来处理不同的任务,节省成本,基于该特性,可以让glm等原生非多模态模型支持图像识别
|
|
162
|
+
* 智能故障切换:当API服务发生故障时,智能切换到其他API服务进行尝试,无需手动切换,特别适用于中转服务商
|
|
163
|
+
* 代理:针对无法直接访问的模型服务,例如地区被ban,支持设置代理来解决
|
|
164
|
+
* tokens超量限制:避免其中一个服务商的用量超过限制,浪费了钱,适合有免费额度的服务商
|
|
165
|
+
* 次数超量限制:次数到达一定量后,切换其他服务商,适合coding plan的服务商
|
|
166
|
+
* 日志:超精细的日志记录和会话记录,帮助你发现编程工具本身的问题,以及专研工具的agent逻辑
|
|
167
|
+
* 统计:丰富且详细的统计数据,用量信息快速掌握,发掘自己的编程习惯
|
|
168
|
+
* Skills管理:一键搜索和安装Skills,一键启用skill到claude code或codex
|
|
169
|
+
* MCP管理:一键安装预设MCP,一键启用MCP
|
|
170
|
+
* 导入和导出:一键备份数据,在多太电脑间共享aicodeswitch配置
|
|
171
|
+
* 服务端部署,自定义API Key,支持B/S架构,让aicodeswitch成为在线服务,提供给团队使用
|
|
172
|
+
* 数据完全本地,自主可控
|
|
173
|
+
* 特殊语法:在发送的提示词最前面添加\`[!]\`来直接切换为高智商模型服务(\`[x]\`关闭),简单快捷
|
|
174
|
+
|
|
175
|
+

|
|
176
|
+
|
|
177
|
+
## 桌面客户端
|
|
178
|
+
|
|
179
|
+
[进入下载](https://github.com/tangshuang/aicodeswitch/releases)
|
|
180
|
+
|
|
181
|
+
## 命令行工具
|
|
182
|
+
|
|
183
|
+
\`\`\`
|
|
184
|
+
# 安装
|
|
185
|
+
npm install -g aicodeswitch
|
|
186
|
+
# 启动服务
|
|
187
|
+
aicos start
|
|
188
|
+
# http://127.0.0.1:4567
|
|
189
|
+
# 启动服务并打开管理界面
|
|
190
|
+
aicos ui
|
|
191
|
+
# 停止服务
|
|
192
|
+
aicos stop
|
|
193
|
+
\`\`\`
|
|
194
|
+
|
|
195
|
+
## 管理界面
|
|
196
|
+
|
|
197
|
+
**配置供应商**
|
|
198
|
+
|
|
199
|
+
* 什么是供应商?
|
|
200
|
+
* 供应商配置有什么用?
|
|
201
|
+
|
|
202
|
+
具体请看下方文档。
|
|
203
|
+
|
|
204
|
+
**路由配置**
|
|
205
|
+
|
|
206
|
+
* 什么是路由?
|
|
207
|
+
* 什么是路由规则?
|
|
208
|
+
|
|
209
|
+
具体请看下方文档。
|
|
210
|
+
|
|
211
|
+
**覆盖配置文件**
|
|
212
|
+
|
|
213
|
+
在aicodeswitch中,点击“写入Claude Code配置”按钮,它会修改Claude Code的配置文件,让Claude Code开始使用aicocdeswitch提供的模型API,而非直接连到官网的模型API。
|
|
214
|
+
|
|
215
|
+
你不用太担心,你可以在写入后,点击“恢复Claude Code配置”按钮,将Claude Code的配置文件恢复到原始状态。
|
|
216
|
+
|
|
217
|
+
Codex的配置覆盖逻辑一模一样。
|
|
218
|
+
|
|
219
|
+
**设置**
|
|
220
|
+
|
|
221
|
+
你可以在设置页面,对aicodedeswitch进行配置。
|
|
222
|
+
|
|
223
|
+
也可以导出配置数据,转移到其他电脑上导入。
|
|
224
|
+
|
|
225
|
+
## 配置供应商
|
|
226
|
+
|
|
227
|
+
### 什么是供应商?
|
|
228
|
+
|
|
229
|
+
所谓供应商,就是提供AI服务的上游服务商。可以是OpenAI、Claude、DeepSeek、GLM 官方服务,也可以是其他中转服务商。
|
|
230
|
+
|
|
231
|
+
### 供应商配置有什么用?
|
|
232
|
+
|
|
233
|
+
通过将你所有的AI服务商统一起来管理,可以帮你:
|
|
234
|
+
|
|
235
|
+
1. 避免频繁修改配置文件,通过aicodeswitch,可以一键切换到不同的供应商的AI服务API
|
|
236
|
+
2. 通过aicodeswitch,将不同供应商的接口数据,转换为工具可以正确使用的接口数据格式,也就是说,你可以将Claude Code接入遵循openai的接口数据协议的其他接口
|
|
237
|
+
3. 避免你忘记曾经注册过那些供应商
|
|
238
|
+
4. 充分榨干不怎么用的供应商的服务,避免充值后不怎么用浪费了
|
|
239
|
+
|
|
240
|
+
### 什么是API服务的“源类型”
|
|
241
|
+
|
|
242
|
+
供应商接口返回的数据格式标准类型,目前支持以下几种:
|
|
243
|
+
|
|
244
|
+
* OpenAI(Responses API标准)
|
|
245
|
+
* OpenAI Chat (Chat Completions API标准)
|
|
246
|
+
* DeepSeek Chat(reasoning_content标准)
|
|
247
|
+
* Claude
|
|
248
|
+
* Claude Chat
|
|
249
|
+
* Gemini
|
|
250
|
+
* Gemini Chat
|
|
251
|
+
|
|
252
|
+
**有什么用?**
|
|
253
|
+
|
|
254
|
+
aicodeswitch内部,会根据“源类型”来转换数据。例如,你的供应商API服务接口是OpenAI Chat的数据格式,而你在路由中配置的“客户端工具“是Claude Code,那么就意味着,这个供应商API的数据,需要经过转换之后才能被Claude Code正确使用。
|
|
255
|
+
|
|
256
|
+
## 路由管理
|
|
257
|
+
|
|
258
|
+
### 什么是路由?
|
|
259
|
+
|
|
260
|
+
路由是aicodeswitch的核心功能,它负责将不同的对象工具(目前指Claude Code和Codex)的请求,路由到不同的供应商API服务上。
|
|
261
|
+
|
|
262
|
+
### 什么是“客户端工具”?
|
|
263
|
+
|
|
264
|
+
目前指Claude Code或Codex。
|
|
265
|
+
|
|
266
|
+
### 什么是“路由规则”?
|
|
267
|
+
|
|
268
|
+
以Claude Code为例,它的请求实际上并非铁板一块,可以被分为多种。比如它的深度思考、长文对话、图片理解等等,都是可以独立对待的。
|
|
269
|
+
|
|
270
|
+
路由规则的目的,就是让你的工具发出的请求,可以根据这个区分,发送给不同的服务商来处理。例如,你默认使用glm-4.7作为写代码的模型,但是,你可以把图片识别的请求发给doubao-code来进行,因为doubao-code的图片识别平均价格可以更低。同样的道理,不同目标的请求可以通过不同的规则来处理,以提升编程的质量和效果。
|
|
271
|
+
|
|
272
|
+
目前,我仅提供了几个比较容易区分的规则,以后,还会添加更多的规则。
|
|
273
|
+
|
|
274
|
+
### 激活路由
|
|
275
|
+
|
|
276
|
+
我们可以为Claude Code添加多个路由,但是,我们必须激活一个路由,才能开始使用。
|
|
277
|
+
而且,所有以Claude Code为对象的路由,在同一时间,只有一个可以被激活。
|
|
278
|
+
|
|
279
|
+
### 切换路由
|
|
280
|
+
|
|
281
|
+
你可以根据你的实际情况来实时切换路由,比如,你可以在发现自己的某个服务商处的余额较少时,立即切换到另外一个服务商。
|
|
282
|
+
|
|
283
|
+
**智能故障切换机制**
|
|
284
|
+
|
|
285
|
+
当同一请求类型配置多个规则时,系统会按排序优先使用第一个,如果某个服务报错(4xx/5xx)或请求超时,将自动切换到下一个可用规则,确保你可以正常使用coding工具。
|
|
286
|
+
|
|
287
|
+
### 数据转流
|
|
288
|
+
|
|
289
|
+
支持将openai的流式响应数据转换成Claude Code的流式数据,并支持实时转换,从而可以让你使用支持openAI的API服务来在Claude Code中使用。
|
|
290
|
+
|
|
291
|
+
*不过,需要注意,如果你的API服务商不支持tools,或者所支持的max_tokens太小,是无法在Claude Code中使用的。*
|
|
292
|
+
|
|
293
|
+
## Skills管理
|
|
294
|
+
|
|
295
|
+
你可以在 aicodeswitch 中集中统一管理 skills,把skills分发给claude code和codex,随时启用和停用skills。
|
|
296
|
+
另外,你可以基于自然语言搜索skills,找到skill之后,支持一键安装。
|
|
297
|
+
|
|
298
|
+
## MCP管理
|
|
299
|
+
|
|
300
|
+
你可以在 aicodeswitch 中集中统一管理 MCP,把MCP分发给claude code和codex,随时启用和停用MCP。
|
|
301
|
+
并且,你还可以通过MCP来实现图像理解。
|
|
302
|
+
|
|
303
|
+
## 日志
|
|
304
|
+
|
|
305
|
+
在**日志**页面,您可以查看:
|
|
306
|
+
|
|
307
|
+
**请求日志**:所有 API 请求的详细记录
|
|
308
|
+
|
|
309
|
+
* 请求来源和目标
|
|
310
|
+
* 请求内容和响应
|
|
311
|
+
* 耗时和状态码
|
|
312
|
+
* 错误信息(如有)
|
|
313
|
+
|
|
314
|
+
**错误日志**:错误和异常记录
|
|
315
|
+
|
|
316
|
+
* 错误类型
|
|
317
|
+
* 错误详情
|
|
318
|
+
* 发生时间
|
|
319
|
+
|
|
320
|
+
**会话日志**:按照会话session来汇集日志
|
|
321
|
+
|
|
322
|
+
**日志筛选**
|
|
323
|
+
|
|
324
|
+
根据提供的选项进行筛选。
|
|
325
|
+
|
|
326
|
+
## 配置文件
|
|
327
|
+
|
|
328
|
+
作为 CLI 工具,你可以在 ~/.aicodeswitch/ 目录下找到工具的相关文件。里面有一个 aicodeswitch.conf 文件,可以进行配置。
|
|
329
|
+
目前仅支持以下配置:
|
|
330
|
+
|
|
331
|
+
\`\`\`
|
|
332
|
+
# aicodeswitch的服务端口
|
|
333
|
+
PORT=4567
|
|
334
|
+
|
|
335
|
+
# 如果提供AUTH,你无法直接登录用户界面,必须输入AUTH的值才能进入,相当于是一个登陆鉴权
|
|
336
|
+
# 如果你在自己的服务器上使用,通过远程接入接口时,就必须提供这个值
|
|
337
|
+
# AUTH=
|
|
338
|
+
\`\`\`
|
|
339
|
+
|
|
340
|
+
> 服务监听地址由 AUTH 模式自动决定,无需也无法通过配置修改:
|
|
341
|
+
> - AUTH 关闭:仅监听 \`127.0.0.1\`(本机访问)
|
|
342
|
+
> - AUTH 开启:监听 \`0.0.0.0\`(允许远端 AccessKey 客户端连接)
|
|
343
|
+
>
|
|
344
|
+
> 写入本地编程工具(Claude Code / Codex)配置文件的地址、以及 UI / CLI 展示的访问地址,统一使用 \`127.0.0.1\`。
|
|
345
|
+
|
|
346
|
+
## 常见问题
|
|
347
|
+
|
|
348
|
+
### 1\\. 如何切换供应商?
|
|
349
|
+
|
|
350
|
+
在路由管理页面修改规则的目标供应商,或调整优先级即可。
|
|
351
|
+
|
|
352
|
+
### 2\\. 如何查看失败的请求?
|
|
353
|
+
|
|
354
|
+
在请求日志页面,筛选状态码不为 200 的记录。
|
|
355
|
+
|
|
356
|
+
### 3\\. 如何备份配置?
|
|
357
|
+
|
|
358
|
+
在系统设置页面使用**导出配置**功能,然后将提供的数据保存到本地文件中。
|
|
359
|
+
|
|
360
|
+
### 4\\. 如何设置日志保留时间?
|
|
361
|
+
|
|
362
|
+
在系统设置页面修改**日志保留天数**配置。
|
|
363
|
+
|
|
364
|
+
## 我的开源
|
|
365
|
+
|
|
366
|
+
* [PCM](https://github.com/tangshuang/pcm): 用户意图识别、精准上下文、多线对话的Agent系统
|
|
367
|
+
* [Lan Transfer](https://github.com/tangshuang/lan-transfer): 免费高效的局域网文件互传工具
|
|
368
|
+
* [MCP Bone](https://github.com/tangshuang/mcp-bone): 远程托管的MCP服管理工具
|
|
369
|
+
* [Anys](https://github.com/tangshuang/anys): 免费前端监控kit
|
|
370
|
+
* [WebCut](https://github.com/tangshuang/webcut): 免费开源的网页端视频剪辑UI框架
|
|
371
|
+
* [indb](https://github.com/tangshuang/indb): 网页端轻量kv数据库操作库
|
|
372
|
+
* [Formast](https://github.com/tangshuang/formast): 复杂业务场景下的企业级JSON驱动表单框架
|
|
373
|
+
|
|
374
|
+
## 关联资源
|
|
375
|
+
|
|
376
|
+
* [Claude Code 深度教程](https://claudecode.tangshuang.net): 100%免费的Claude Code入门到精通教程
|
|
377
|
+
* [AICodingBus](https://aicodingbus.24x7.to): AI Tokens 交换平台
|
|
378
|
+
|
|
379
|
+
## 支持我
|
|
380
|
+
|
|
381
|
+

|
|
382
|
+
|
|
383
|
+
你的支持是我前进的动力!
|
|
384
|
+
|
|
385
|
+
## 许可
|
|
386
|
+
|
|
387
|
+
此项目采用双许可证模式:
|
|
388
|
+
|
|
389
|
+
* **开源使用**:项目默认采用 GPL 3.0 许可证,允许个人免费使用、修改和分发,但所有衍生品必须开源。
|
|
390
|
+
* **商业使用**:如果您希望商业化使用而不遵守 GPL 条款(例如闭源销售),请联系我们购买单独的商业许可证。
|
|
391
|
+
|
|
392
|
+
## 技术支持
|
|
393
|
+
|
|
394
|
+
如有问题或建议,请访问项目 [GitHub 仓库](https://github.com/tangshuang/aicodeswitch/issues)提交 Issue。
|
|
395
|
+
`,TU=()=>o.jsx("div",{className:"markdown-content",children:o.jsx(Vc,{children:EU})});function dO(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=dO(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function mt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=dO(e))&&(r&&(r+=" "),r+=t);return r}var IU=["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 sb(e){if(typeof e!="string")return!1;var t=IU;return t.includes(e)}var OU=["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"],NU=new Set(OU);function pO(e){return typeof e!="string"?!1:NU.has(e)}function fO(e){return typeof e=="string"&&e.startsWith("data-")}function er(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(pO(n)||fO(n))&&(t[n]=e[n]);return t}function ls(e){if(e==null)return null;if(h.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return er(t)}return typeof e=="object"&&!Array.isArray(e)?er(e):null}function mr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(pO(n)||fO(n)||sb(n))&&(t[n]=e[n]);return t}function MU(e){return e==null?null:h.isValidElement(e)?mr(e.props):typeof e=="object"&&!Array.isArray(e)?mr(e):null}var _U=["children","width","height","viewBox","className","style","title","desc"];function Bv(){return Bv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bv.apply(null,arguments)}function RU(e,t){if(e==null)return{};var n,r,i=DU(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function DU(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var lb=h.forwardRef((e,t)=>{var n=e.children,r=e.width,i=e.height,a=e.viewBox,s=e.className,l=e.style,c=e.title,u=e.desc,p=RU(e,_U),d=a||{width:r,height:i,x:0,y:0},f=mt("recharts-surface",s);return h.createElement("svg",Bv({},mr(p),{className:f,width:r,height:i,style:l,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height),ref:t}),h.createElement("title",null,c),h.createElement("desc",null,u),n)}),LU=["children","className"];function Fv(){return Fv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fv.apply(null,arguments)}function zU(e,t){if(e==null)return{};var n,r,i=$U(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $U(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Xt=h.forwardRef((e,t)=>{var n=e.children,r=e.className,i=zU(e,LU),a=mt("recharts-layer",r);return h.createElement("g",Fv({className:a},mr(i),{ref:t}),n)}),hO=h.createContext(null),BU=()=>h.useContext(hO);function It(e){return function(){return e}}const mO=Math.cos,gf=Math.sin,pi=Math.sqrt,yf=Math.PI,Wh=2*yf,Uv=Math.PI,Wv=2*Uv,Oo=1e-6,FU=Wv-Oo;function gO(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function UU(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return gO;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class WU{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?gO:UU(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,s){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+s}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,l=this._y1,c=r-t,u=i-n,p=s-t,d=l-n,f=p*p+d*d;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(f>Oo)if(!(Math.abs(d*c-u*p)>Oo)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let m=r-s,g=i-l,v=c*c+u*u,x=m*m+g*g,y=Math.sqrt(v),b=Math.sqrt(f),w=a*Math.tan((Uv-Math.acos((v+f-x)/(2*y*b)))/2),S=w/b,k=w/y;Math.abs(S-1)>Oo&&this._append`L${t+S*p},${n+S*d}`,this._append`A${a},${a},0,0,${+(d*m>p*g)},${this._x1=t+k*c},${this._y1=n+k*u}`}}arc(t,n,r,i,a,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(i),c=r*Math.sin(i),u=t+l,p=n+c,d=1^s,f=s?i-a:a-i;this._x1===null?this._append`M${u},${p}`:(Math.abs(this._x1-u)>Oo||Math.abs(this._y1-p)>Oo)&&this._append`L${u},${p}`,r&&(f<0&&(f=f%Wv+Wv),f>FU?this._append`A${r},${r},0,1,${d},${t-l},${n-c}A${r},${r},0,1,${d},${this._x1=u},${this._y1=p}`:f>Oo&&this._append`A${r},${r},0,${+(f>=Uv)},${d},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function cb(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new WU(t)}function ub(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function yO(e){this._context=e}yO.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 Kh(e){return new yO(e)}function vO(e){return e[0]}function xO(e){return e[1]}function bO(e,t){var n=It(!0),r=null,i=Kh,a=null,s=cb(l);e=typeof e=="function"?e:e===void 0?vO:It(e),t=typeof t=="function"?t:t===void 0?xO:It(t);function l(c){var u,p=(c=ub(c)).length,d,f=!1,m;for(r==null&&(a=i(m=s())),u=0;u<=p;++u)!(u<p&&n(d=c[u],u,c))===f&&((f=!f)?a.lineStart():a.lineEnd()),f&&a.point(+e(d,u,c),+t(d,u,c));if(m)return a=null,m+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:It(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:It(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:It(!!c),l):n},l.curve=function(c){return arguments.length?(i=c,r!=null&&(a=i(r)),l):i},l.context=function(c){return arguments.length?(c==null?r=a=null:a=i(r=c),l):r},l}function Vd(e,t,n){var r=null,i=It(!0),a=null,s=Kh,l=null,c=cb(u);e=typeof e=="function"?e:e===void 0?vO:It(+e),t=typeof t=="function"?t:It(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?xO:It(+n);function u(d){var f,m,g,v=(d=ub(d)).length,x,y=!1,b,w=new Array(v),S=new Array(v);for(a==null&&(l=s(b=c())),f=0;f<=v;++f){if(!(f<v&&i(x=d[f],f,d))===y)if(y=!y)m=f,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),g=f-1;g>=m;--g)l.point(w[g],S[g]);l.lineEnd(),l.areaEnd()}y&&(w[f]=+e(x,f,d),S[f]=+t(x,f,d),l.point(r?+r(x,f,d):w[f],n?+n(x,f,d):S[f]))}if(b)return l=null,b+""||null}function p(){return bO().defined(i).curve(s).context(a)}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:It(+d),r=null,u):e},u.x0=function(d){return arguments.length?(e=typeof d=="function"?d:It(+d),u):e},u.x1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:It(+d),u):r},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:It(+d),n=null,u):t},u.y0=function(d){return arguments.length?(t=typeof d=="function"?d:It(+d),u):t},u.y1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:It(+d),u):n},u.lineX0=u.lineY0=function(){return p().x(e).y(t)},u.lineY1=function(){return p().x(e).y(n)},u.lineX1=function(){return p().x(r).y(t)},u.defined=function(d){return arguments.length?(i=typeof d=="function"?d:It(!!d),u):i},u.curve=function(d){return arguments.length?(s=d,a!=null&&(l=s(a)),u):s},u.context=function(d){return arguments.length?(d==null?a=l=null:l=s(a=d),u):a},u}class wO{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function KU(e){return new wO(e,!0)}function HU(e){return new wO(e,!1)}const db={draw(e,t){const n=pi(t/yf);e.moveTo(n,0),e.arc(0,0,n,0,Wh)}},VU={draw(e,t){const n=pi(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},SO=pi(1/3),qU=SO*2,YU={draw(e,t){const n=pi(t/qU),r=n*SO;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},GU={draw(e,t){const n=pi(t),r=-n/2;e.rect(r,r,n,n)}},XU=.8908130915292852,jO=gf(yf/10)/gf(7*yf/10),QU=gf(Wh/10)*jO,ZU=-mO(Wh/10)*jO,JU={draw(e,t){const n=pi(t*XU),r=QU*n,i=ZU*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const s=Wh*a/5,l=mO(s),c=gf(s);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},Kg=pi(3),eW={draw(e,t){const n=-pi(t/(Kg*3));e.moveTo(0,n*2),e.lineTo(-Kg*n,-n),e.lineTo(Kg*n,-n),e.closePath()}},Nr=-.5,Mr=pi(3)/2,Kv=1/pi(12),tW=(Kv/2+1)*3,nW={draw(e,t){const n=pi(t/tW),r=n/2,i=n*Kv,a=r,s=n*Kv+n,l=-a,c=s;e.moveTo(r,i),e.lineTo(a,s),e.lineTo(l,c),e.lineTo(Nr*r-Mr*i,Mr*r+Nr*i),e.lineTo(Nr*a-Mr*s,Mr*a+Nr*s),e.lineTo(Nr*l-Mr*c,Mr*l+Nr*c),e.lineTo(Nr*r+Mr*i,Nr*i-Mr*r),e.lineTo(Nr*a+Mr*s,Nr*s-Mr*a),e.lineTo(Nr*l+Mr*c,Nr*c-Mr*l),e.closePath()}};function rW(e,t){let n=null,r=cb(i);e=typeof e=="function"?e:It(e||db),t=typeof t=="function"?t:It(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:It(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:It(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function vf(){}function xf(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function kO(e){this._context=e}kO.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:xf(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:xf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function iW(e){return new kO(e)}function CO(e){this._context=e}CO.prototype={areaStart:vf,areaEnd:vf,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:xf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function aW(e){return new CO(e)}function PO(e){this._context=e}PO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:xf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function oW(e){return new PO(e)}function AO(e){this._context=e}AO.prototype={areaStart:vf,areaEnd:vf,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 sW(e){return new AO(e)}function nk(e){return e<0?-1:1}function rk(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),s=(n-e._y1)/(i||r<0&&-0),l=(a*i+s*r)/(r+i);return(nk(a)+nk(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(l))||0}function ik(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Hg(e,t,n){var r=e._x0,i=e._y0,a=e._x1,s=e._y1,l=(a-r)/3;e._context.bezierCurveTo(r+l,i+l*t,a-l,s-l*n,a,s)}function bf(e){this._context=e}bf.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:Hg(this,this._t0,ik(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Hg(this,ik(this,n=rk(this,e,t)),n);break;default:Hg(this,this._t0,n=rk(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function EO(e){this._context=new TO(e)}(EO.prototype=Object.create(bf.prototype)).point=function(e,t){bf.prototype.point.call(this,t,e)};function TO(e){this._context=e}TO.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function lW(e){return new bf(e)}function cW(e){return new EO(e)}function IO(e){this._context=e}IO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=ak(e),i=ak(t),a=0,s=1;s<n;++a,++s)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[s],t[s]);(this._line||this._line!==0&&n===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 ak(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),s=new Array(n);for(i[0]=0,a[0]=2,s[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,s[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,s[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,s[t]-=r*s[t-1];for(i[n-1]=s[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(s[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function uW(e){return new IO(e)}function Hh(e,t){this._context=e,this._t=t}Hh.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 n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function dW(e){return new Hh(e,.5)}function pW(e){return new Hh(e,0)}function fW(e){return new Hh(e,1)}function cs(e,t){if((s=e.length)>1)for(var n=1,r,i,a=e[t[0]],s,l=a.length;n<s;++n)for(i=a,a=e[t[n]],r=0;r<l;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Hv(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function hW(e,t){return e[t]}function mW(e){const t=[];return t.key=e,t}function gW(){var e=It([]),t=Hv,n=cs,r=hW;function i(a){var s=Array.from(e.apply(this,arguments),mW),l,c=s.length,u=-1,p;for(const d of a)for(l=0,++u;l<c;++l)(s[l][u]=[0,+r(d,s[l].key,u,a)]).data=d;for(l=0,p=ub(t(s));l<c;++l)s[p[l]].index=l;return n(s,p),s}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:It(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:It(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?Hv:typeof a=="function"?a:It(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??cs,i):n},i}function yW(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,s;i<a;++i){for(s=n=0;n<r;++n)s+=e[n][i][1]||0;if(s)for(n=0;n<r;++n)e[n][i][1]/=s}cs(e,t)}}function vW(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var s=0,l=0;s<i;++s)l+=e[s][n][1]||0;r[n][1]+=r[n][0]=-l/2}cs(e,t)}}function xW(e,t){if(!(!((s=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,s;r<a;++r){for(var l=0,c=0,u=0;l<s;++l){for(var p=e[t[l]],d=p[r][1]||0,f=p[r-1][1]||0,m=(d-f)/2,g=0;g<l;++g){var v=e[t[g]],x=v[r][1]||0,y=v[r-1][1]||0;m+=x-y}c+=d,u+=m*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=u/c)}i[r-1][1]+=i[r-1][0]=n,cs(e,t)}}function Vv(e){return e==="__proto__"}function OO(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e.includes(".")||e.includes("[")||e.includes("]")}}function pb(e){var t;return typeof e=="string"||typeof e=="symbol"?e:Object.is((t=e==null?void 0:e.valueOf)==null?void 0:t.call(e),-0)?"-0":String(e)}function NO(e){if(e==null)return"";if(typeof e=="string")return e;if(Array.isArray(e))return e.map(NO).join(",");const t=String(e);return t==="0"&&Object.is(Number(e),-0)?"-0":t}function fb(e){if(Array.isArray(e))return e.map(pb);if(typeof e=="symbol")return[e];e=NO(e);const t=[],n=e.length;if(n===0)return t;let r=0,i="",a="",s=!1;for(e.charCodeAt(0)===46&&t.push("");r<n;){const l=e[r];if(a)l==="\\"&&r+1<n?(r++,i+=e[r]):l===a?a="":i+=l;else if(s)l==='"'||l==="'"?a=l:l==="]"?(s=!1,t.push(i),i=""):i+=l;else if(l==="[")s=!0,i&&(t.push(i),i="");else if(l==="."){i&&(t.push(i),i="");const c=e[r+1];(c===void 0||c===".")&&t.push("")}else i+=l;r++}return i&&t.push(i),t}function $i(e,t,n){if(e==null)return n;switch(typeof t){case"string":{if(Vv(t))return n;const r=e[t];return r===void 0?OO(t)?$i(e,fb(t),n):n:r}case"number":case"symbol":{typeof t=="number"&&(t=pb(t));const r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return bW(e,t,n);if(Object.is(t==null?void 0:t.valueOf(),-0)?t="-0":t=String(t),Vv(t))return n;const r=e[t];return r===void 0?n:r}}}function bW(e,t,n){if(t.length===0)return n;let r=e;for(let i=0;i<t.length;i++){if(r==null||Vv(t[i]))return n;r=r[t[i]]}return r===void 0?n:r}var wW=4;function oa(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:wW,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Rn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,a,s)=>{var l=n[s-1];return typeof l=="string"?i+l+a:l!==void 0?i+oa(l)+a:i+a},"")}var jn=e=>e===0?0:e>0?1:-1,ui=e=>typeof e=="number"&&e!=+e,us=e=>typeof e=="string"&&e.length>1&&e.indexOf("%")===e.length-1,Ce=e=>(typeof e=="number"||e instanceof Number)&&!ui(e),Bi=e=>Ce(e)||typeof e=="string",SW=0,bu=e=>{var t=++SW;return"".concat(e||"").concat(t)},Hn=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ce(t)&&typeof t!="string")return r;var a;if(us(t)){if(n==null)return r;var s=t.indexOf("%");a=n*parseFloat(t.slice(0,s))/100}else a=+t;return ui(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},MO=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function Ot(e,t,n){return Ce(e)&&Ce(t)?oa(e+n*(t-e)):t}function _O(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):$i(r,t))===n)}var $t=e=>e===null||typeof e>"u",qu=e=>$t(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function cr(e){return e!=null}function ho(){}var jW=["type","size","sizeType"];function qv(){return qv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qv.apply(null,arguments)}function ok(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function sk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ok(Object(n),!0).forEach(function(r){kW(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ok(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kW(e,t,n){return(t=CW(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CW(e){var t=PW(e,"string");return typeof t=="symbol"?t:t+""}function PW(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function AW(e,t){if(e==null)return{};var n,r,i=EW(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function EW(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var RO={symbolCircle:db,symbolCross:VU,symbolDiamond:YU,symbolSquare:GU,symbolStar:JU,symbolTriangle:eW,symbolWye:nW},TW=Math.PI/180,IW=e=>{var t="symbol".concat(qu(e));return RO[t]||db},OW=(e,t,n)=>{if(t==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var r=18*TW;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**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}},NW=(e,t)=>{RO["symbol".concat(qu(e))]=t},DO=e=>{var t=e.type,n=t===void 0?"circle":t,r=e.size,i=r===void 0?64:r,a=e.sizeType,s=a===void 0?"area":a,l=AW(e,jW),c=sk(sk({},l),{},{type:n,size:i,sizeType:s}),u="circle";typeof n=="string"&&(u=n);var p=()=>{var v=IW(u),x=rW().type(v).size(OW(i,s,u)),y=x();if(y!==null)return y},d=c.className,f=c.cx,m=c.cy,g=mr(c);return Ce(f)&&Ce(m)&&Ce(i)?h.createElement("path",qv({},g,{className:mt("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(m,")"),d:p()})):null};DO.registerSymbol=NW;var LO=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,hb=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(h.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{sb(i)&&typeof n[i]=="function"&&(r[i]=a=>n[i](n,a))}),r},MW=(e,t,n)=>r=>(e(t,n,r),null),Yu=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];sb(i)&&typeof a=="function"&&(r||(r={}),r[i]=MW(a,t,n))}),r};function lk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _W(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lk(Object(n),!0).forEach(function(r){RW(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function RW(e,t,n){return(t=DW(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DW(e){var t=LW(e,"string");return typeof t=="symbol"?t:t+""}function LW(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dn(e,t){var n=_W({},e),r=t,i=Object.keys(t),a=i.reduce((s,l)=>(s[l]===void 0&&r[l]!==void 0&&(s[l]=r[l]),s),n);return a}function wf(){return wf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wf.apply(null,arguments)}function ck(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ck(Object(n),!0).forEach(function(r){zW(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ck(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zW(e,t,n){return(t=$W(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $W(e){var t=BW(e,"string");return typeof t=="symbol"?t:t+""}function BW(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Dr=32,FW={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function UW(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function WW(e){var t=e.data,n=e.iconType,r=e.inactiveColor,i=Dr/2,a=Dr/6,s=Dr/3,l=t.inactive?r:t.color,c=n??t.type;if(c==="none")return null;if(c==="plainline")return h.createElement("line",{strokeWidth:4,fill:"none",stroke:l,strokeDasharray:UW(t.payload),x1:0,y1:i,x2:Dr,y2:i,className:"recharts-legend-icon"});if(c==="line")return h.createElement("path",{strokeWidth:4,fill:"none",stroke:l,d:"M0,".concat(i,"h").concat(s,`
|
|
396
|
+
A`).concat(a,",").concat(a,",0,1,1,").concat(2*s,",").concat(i,`
|
|
397
|
+
H`).concat(Dr,"M").concat(2*s,",").concat(i,`
|
|
398
|
+
A`).concat(a,",").concat(a,",0,1,1,").concat(s,",").concat(i),className:"recharts-legend-icon"});if(c==="rect")return h.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(Dr/8,"h").concat(Dr,"v").concat(Dr*3/4,"h").concat(-Dr,"z"),className:"recharts-legend-icon"});if(h.isValidElement(t.legendIcon)){var u=zO({},t);return delete u.legendIcon,h.cloneElement(t.legendIcon,u)}return h.createElement(DO,{fill:l,cx:i,cy:i,size:Dr,sizeType:"diameter",type:c})}function KW(e){var t=e.payload,n=e.iconSize,r=e.layout,i=e.formatter,a=e.inactiveColor,s=e.iconType,l=e.labelStyle,c={x:0,y:0,width:Dr,height:Dr},u={display:r==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((d,f)=>{var m=d.formatter||i,g=mt({"recharts-legend-item":!0,["legend-item-".concat(f)]:!0,inactive:d.inactive});if(d.type==="none")return null;var v=typeof l=="object"?zO({},l):{};v.color=d.inactive?a:v.color||d.color;var x=m?m(d.value,d,f):d.value;return h.createElement("li",wf({className:g,style:u,key:"legend-item-".concat(f)},Yu(e,d,f)),h.createElement(lb,{width:n,height:n,viewBox:c,style:p,"aria-label":"".concat(d.value," legend icon")},h.createElement(WW,{data:d,iconType:s,inactiveColor:a})),h.createElement("span",{className:"recharts-legend-item-text",style:v},x))})}var HW=e=>{var t=dn(e,FW),n=t.payload,r=t.layout,i=t.align;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return h.createElement("ul",{className:"recharts-default-legend",style:a},h.createElement(KW,wf({},t,{payload:n})))};function VW(e,t){const n=new Map;for(let r=0;r<e.length;r++){const i=e[r],a=t(i,r,e);n.has(a)||n.set(a,i)}return Array.from(n.values())}function qW(e,t){return function(...n){return e.apply(this,n.slice(0,t))}}function $O(e){return e}function YW(e){return function(t){return $i(t,e)}}function Yv(e){return e==null||typeof e!="object"&&typeof e!="function"}function GW(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function XW(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function mb(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const QW="[object RegExp]",BO="[object String]",FO="[object Number]",UO="[object Boolean]",WO="[object Arguments]",ZW="[object Symbol]",JW="[object Date]",e9="[object Map]",t9="[object Set]",n9="[object Array]",r9="[object ArrayBuffer]",i9="[object Object]",a9="[object DataView]",o9="[object Uint8Array]",s9="[object Uint8ClampedArray]",l9="[object Uint16Array]",c9="[object Uint32Array]",u9="[object Int8Array]",d9="[object Int16Array]",p9="[object Int32Array]",f9="[object Float32Array]",h9="[object Float64Array]",uk=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||function(){return this}();function m9(e){return typeof uk.Buffer<"u"&&uk.Buffer.isBuffer(e)}function g9(e,t){return Fo(e,void 0,e,new Map,t)}function Fo(e,t,n,r=new Map,i=void 0){const a=i==null?void 0:i(e,t,n,r);if(a!==void 0)return a;if(Yv(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){const s=new Array(e.length);r.set(e,s);for(let l=0;l<e.length;l++)s[l]=Fo(e[l],l,n,r,i);return Object.hasOwn(e,"index")&&(s.index=e.index),Object.hasOwn(e,"input")&&(s.input=e.input),s}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const s=new RegExp(e.source,e.flags);return s.lastIndex=e.lastIndex,s}if(e instanceof Map){const s=new Map;r.set(e,s);for(const[l,c]of e)s.set(l,Fo(c,l,n,r,i));return s}if(e instanceof Set){const s=new Set;r.set(e,s);for(const l of e)s.add(Fo(l,void 0,n,r,i));return s}if(m9(e))return e.subarray();if(GW(e)){const s=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,s);for(let l=0;l<e.length;l++)s[l]=Fo(e[l],l,n,r,i);return s}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){const s=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,s),ti(s,e,n,r,i),s}if(typeof File<"u"&&e instanceof File){const s=new File([e],e.name,{type:e.type});return r.set(e,s),ti(s,e,n,r,i),s}if(typeof Blob<"u"&&e instanceof Blob){const s=new Blob([e],{type:e.type});return r.set(e,s),ti(s,e,n,r,i),s}if(e instanceof Error){const s=structuredClone(e);return r.set(e,s),s.message=e.message,s.name=e.name,s.stack=e.stack,s.cause=e.cause,s.constructor=e.constructor,ti(s,e,n,r,i),s}if(e instanceof Boolean){const s=new Boolean(e.valueOf());return r.set(e,s),ti(s,e,n,r,i),s}if(e instanceof Number){const s=new Number(e.valueOf());return r.set(e,s),ti(s,e,n,r,i),s}if(e instanceof String){const s=new String(e.valueOf());return r.set(e,s),ti(s,e,n,r,i),s}if(typeof e=="object"&&y9(e)){const s=Object.create(Object.getPrototypeOf(e));return r.set(e,s),ti(s,e,n,r,i),s}return e}function ti(e,t,n=e,r,i){const a=[...Object.keys(t),...XW(t)];for(let s=0;s<a.length;s++){const l=a[s],c=Object.getOwnPropertyDescriptor(e,l);(c==null||c.writable)&&(e[l]=Fo(t[l],l,n,r,i))}}function y9(e){switch(mb(e)){case WO:case n9:case r9:case a9:case UO:case JW:case f9:case h9:case u9:case d9:case p9:case e9:case FO:case i9:case QW:case t9:case BO:case ZW:case o9:case s9:case l9:case c9:return!0;default:return!1}}function v9(e){return Fo(e,void 0,e,new Map,void 0)}function Mp(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function KO(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function HO(e,t,n){return typeof n!="function"?HO(e,t,()=>{}):Gv(e,t,function r(i,a,s,l,c,u){const p=n(i,a,s,l,c,u);return p!==void 0?!!p:Gv(i,a,r,u,!1)},new Map,!0)}function Gv(e,t,n,r,i=!1){if(t===e)return!0;switch(typeof t){case"object":return x9(e,t,n,r);case"function":return Object.keys(t).length>0?Gv(e,{...t},n,r,i):Mp(e,t);default:return KO(e)&&i?typeof t=="string"?t==="":!0:Mp(e,t)}}function x9(e,t,n,r){if(t==null)return!0;if(Array.isArray(t))return VO(e,t,n,r);if(t instanceof Map)return b9(e,t,n,r);if(t instanceof Set)return w9(e,t,n,r);const i=Object.keys(t);if(e==null||Yv(e))return i.length===0;if(i.length===0)return!0;if(r!=null&&r.has(t))return r.get(t)===e;r==null||r.set(t,e);try{for(let a=0;a<i.length;a++){const s=i[a];if(!Yv(e)&&!(s in e)||t[s]===void 0&&e[s]!==void 0||t[s]===null&&e[s]!==null||!n(e[s],t[s],s,e,t,r))return!1}return!0}finally{r==null||r.delete(t)}}function b9(e,t,n,r){if(t.size===0)return!0;if(!(e instanceof Map))return!1;for(const[i,a]of t.entries())if(n(e.get(i),a,i,e,t,r)===!1)return!1;return!0}function VO(e,t,n,r){if(t.length===0)return!0;if(!Array.isArray(e))return!1;const i=new Set;for(let a=0;a<t.length;a++){const s=t[a];let l=!1;for(let c=0;c<e.length;c++){if(i.has(c))continue;const u=e[c];let p=!1;if(n(u,s,a,e,t,r)&&(p=!0),p){i.add(c),l=!0;break}}if(!l)return!1}return!0}function w9(e,t,n,r){return t.size===0?!0:e instanceof Set?VO([...e],[...t],n,r):!1}function qO(e,t){return HO(e,t,()=>{})}function S9(e){return e=v9(e),t=>qO(t,e)}function j9(e,t){return g9(e,(n,r,i,a)=>{if(typeof e=="object"){if(mb(e)==="[object Object]"&&typeof e.constructor!="function"){const s={};return a.set(e,s),ti(s,e,i,a),s}switch(Object.prototype.toString.call(e)){case FO:case BO:case UO:{const s=new e.constructor(e==null?void 0:e.valueOf());return ti(s,e),s}case WO:{const s={};return ti(s,e),s.length=e.length,s[Symbol.iterator]=e[Symbol.iterator],s}default:return}}})}function k9(e){return j9(e)}const C9=/^(?:0|[1-9]\d*)$/;function YO(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e<t;case"symbol":return!1;case"string":return C9.test(e)}}function P9(e){return e!==null&&typeof e=="object"&&mb(e)==="[object Arguments]"}function A9(e,t){let n;if(Array.isArray(t)?n=t:typeof t=="string"&&OO(t)&&(e==null?void 0:e[t])==null?n=fb(t):n=[t],n.length===0)return!1;let r=e;for(let i=0;i<n.length;i++){const a=n[i];if((r==null||!Object.hasOwn(r,a))&&!((Array.isArray(r)||P9(r))&&YO(a)&&a<r.length))return!1;r=r[a]}return!0}function E9(e,t){switch(typeof e){case"object":Object.is(e==null?void 0:e.valueOf(),-0)&&(e="-0");break;case"number":e=pb(e);break}return t=k9(t),function(n){const r=$i(n,e);return r===void 0?A9(n,e):t===void 0?r===void 0:qO(r,t)}}function T9(e){if(e==null)return $O;switch(typeof e){case"function":return e;case"object":return Array.isArray(e)&&e.length===2?E9(e[0],e[1]):S9(e);case"string":case"symbol":case"number":return YW(e)}}function I9(e){return Number.isSafeInteger(e)&&e>=0}function GO(e){return e!=null&&typeof e!="function"&&I9(e.length)}function O9(e){return typeof e=="object"&&e!==null}function N9(e){return O9(e)&&GO(e)}function dk(e,t=$O){return N9(e)?VW(Array.from(e),qW(T9(t),1)):[]}function XO(e,t,n){return t===!0?dk(e,n):typeof t=="function"?dk(e,t):e}var QO={exports:{}},ZO={},JO={exports:{}},eN={};/**
|
|
399
|
+
* @license React
|
|
400
|
+
* use-sync-external-store-shim.production.js
|
|
401
|
+
*
|
|
402
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
403
|
+
*
|
|
404
|
+
* This source code is licensed under the MIT license found in the
|
|
405
|
+
* LICENSE file in the root directory of this source tree.
|
|
406
|
+
*/var Al=h;function M9(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _9=typeof Object.is=="function"?Object.is:M9,R9=Al.useState,D9=Al.useEffect,L9=Al.useLayoutEffect,z9=Al.useDebugValue;function $9(e,t){var n=t(),r=R9({inst:{value:n,getSnapshot:t}}),i=r[0].inst,a=r[1];return L9(function(){i.value=n,i.getSnapshot=t,Vg(i)&&a({inst:i})},[e,n,t]),D9(function(){return Vg(i)&&a({inst:i}),e(function(){Vg(i)&&a({inst:i})})},[e]),z9(n),n}function Vg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_9(e,n)}catch{return!0}}function B9(e,t){return t()}var F9=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?B9:$9;eN.useSyncExternalStore=Al.useSyncExternalStore!==void 0?Al.useSyncExternalStore:F9;JO.exports=eN;var U9=JO.exports;/**
|
|
407
|
+
* @license React
|
|
408
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
409
|
+
*
|
|
410
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
411
|
+
*
|
|
412
|
+
* This source code is licensed under the MIT license found in the
|
|
413
|
+
* LICENSE file in the root directory of this source tree.
|
|
414
|
+
*/var Vh=h,W9=U9;function K9(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var H9=typeof Object.is=="function"?Object.is:K9,V9=W9.useSyncExternalStore,q9=Vh.useRef,Y9=Vh.useEffect,G9=Vh.useMemo,X9=Vh.useDebugValue;ZO.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=q9(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=G9(function(){function c(m){if(!u){if(u=!0,p=m,m=r(m),i!==void 0&&s.hasValue){var g=s.value;if(i(g,m))return d=g}return d=m}if(g=d,H9(p,m))return g;var v=r(m);return i!==void 0&&i(g,v)?(p=m,g):(p=m,d=v)}var u=!1,p,d,f=n===void 0?null:n;return[function(){return c(t())},f===null?void 0:function(){return c(f())}]},[t,n,r,i]);var l=V9(e,a[0],a[1]);return Y9(function(){s.hasValue=!0,s.value=l},[l]),X9(l),l};QO.exports=ZO;var Q9=QO.exports,gb=h.createContext(null),Z9=e=>e,St=()=>{var e=h.useContext(gb);return e?e.store.dispatch:Z9},_p=()=>{},J9=()=>_p,eK=(e,t)=>e===t;function Te(e){var t=h.useContext(gb),n=h.useMemo(()=>t?r=>{if(r!=null)return e(r)}:_p,[t,e]);return Q9.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:J9,t?t.store.getState:_p,t?t.store.getState:_p,n,eK)}function tK(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function nK(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var pk=e=>Array.isArray(e)?e:[e];function rK(e){const t=Array.isArray(e[0])?e[0]:e;return nK(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function iK(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var aK=class{constructor(e){this.value=e}deref(){return this.value}},oK=()=>typeof WeakRef>"u"?aK:WeakRef,tN=oK(),sK=0,fk=1;function qd(){return{s:sK,v:void 0,o:null,p:null}}function lK(e){return e instanceof tN?e.deref():e}function nN(e,t={}){let n=qd();const{resultEqualityCheck:r}=t;let i,a=0;function s(){let l=n;const{length:c}=arguments;for(let d=0,f=c;d<f;d++){const m=arguments[d];if(typeof m=="function"||typeof m=="object"&&m!==null){let g=l.o;g===null&&(l.o=g=new WeakMap);const v=g.get(m);v===void 0?(l=qd(),g.set(m,l)):l=v}else{let g=l.p;g===null&&(l.p=g=new Map);const v=g.get(m);v===void 0?(l=qd(),g.set(m,l)):l=v}}const u=l;let p;if(l.s===fk)p=l.v;else if(p=e.apply(null,arguments),a++,r){const d=lK(i);d!=null&&r(d,p)&&(p=d,a!==0&&a--),i=typeof p=="object"&&p!==null||typeof p=="function"?new tN(p):p}return u.s=fk,u.v=p,p}return s.clearCache=()=>{n=qd(),s.resetResultsCount()},s.resultsCount=()=>a,s.resetResultsCount=()=>{a=0},s}function cK(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,s=0,l,c={},u=i.pop();typeof u=="object"&&(c=u,u=i.pop()),tK(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const p={...n,...c},{memoize:d,memoizeOptions:f=[],argsMemoize:m=nN,argsMemoizeOptions:g=[]}=p,v=pk(f),x=pk(g),y=rK(i),b=d(function(){return a++,u.apply(null,arguments)},...v),w=m(function(){s++;const k=iK(y,arguments);return l=b.apply(null,k),l},...x);return Object.assign(w,{resultFunc:u,memoizedResultFunc:b,dependencies:y,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>l,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:d,argsMemoize:m})};return Object.assign(r,{withTypes:()=>r}),r}var G=cK(nN);function uK(e,t=1){const n=[],r=Math.floor(t),i=(a,s)=>{for(let l=0;l<a.length;l++){const c=a[l];Array.isArray(c)&&s<r?i(c,s+1):n.push(c)}};return i(e,0),n}function Xv(e,t,n){return KO(n)&&(typeof t=="number"&&GO(n)&&YO(t)&&t<n.length||typeof t=="string"&&t in n)?Mp(n[t],e):!1}function hk(e){return typeof e=="symbol"?1:e===null?2:e===void 0?3:e!==e?4:0}const dK=(e,t,n)=>{if(e!==t){const r=hk(e),i=hk(t);if(r===i&&r===0){if(e<t)return n==="desc"?1:-1;if(e>t)return n==="desc"?-1:1}return n==="desc"?i-r:r-i}return 0};function rN(e){return typeof e=="symbol"||e instanceof Symbol}const pK=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fK=/^\w*$/;function hK(e,t){return Array.isArray(e)?!1:typeof e=="number"||typeof e=="boolean"||e==null||rN(e)?!0:typeof e=="string"&&(fK.test(e)||!pK.test(e))||t!=null}function mK(e,t,n,r){if(e==null)return[];n=n,Array.isArray(e)||(e=Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(n)||(n=n==null?[]:[n]),n=n.map(l=>String(l));const i=(l,c)=>{let u=l;for(let p=0;p<c.length&&u!=null;++p)u=u[c[p]];return u},a=(l,c)=>c==null||l==null?c:typeof l=="object"&&"key"in l?Object.hasOwn(c,l.key)?c[l.key]:i(c,l.path):typeof l=="function"?l(c):Array.isArray(l)?i(c,l):typeof c=="object"?c[l]:c,s=t.map(l=>(Array.isArray(l)&&l.length===1&&(l=l[0]),l==null||typeof l=="function"||Array.isArray(l)||hK(l)?l:{key:l,path:fb(l)}));return e.map(l=>({original:l,criteria:s.map(c=>a(c,l))})).slice().sort((l,c)=>{for(let u=0;u<s.length;u++){const p=dK(l.criteria[u],c.criteria[u],n[u]);if(p!==0)return p}return 0}).map(l=>l.original)}function qh(e,...t){const n=t.length;return n>1&&Xv(e,t[0],t[1])?t=[]:n>2&&Xv(t[0],t[1],t[2])&&(t=[t[0]]),mK(e,uK(t),["asc"])}var iN=e=>e.legend.settings,gK=e=>e.legend.size,yK=e=>e.legend.payload,vK=G([yK,iN],(e,t)=>{var n=t.itemSorter,r=e.flat(1);return n?qh(r,n):r});function xK(){return Te(vK)}function bK(e,t){return kK(e)||jK(e,t)||SK(e,t)||wK()}function wK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
415
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function SK(e,t){if(e){if(typeof e=="string")return mk(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mk(e,t):void 0}}function mk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function jK(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function kK(e){if(Array.isArray(e))return e}var Yd=1;function gk(e,t){return Math.abs(e.height-t.height)>Yd||Math.abs(e.left-t.left)>Yd||Math.abs(e.top-t.top)>Yd||Math.abs(e.width-t.width)>Yd}function yk(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function aN(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=h.useState({height:0,left:0,top:0,width:0}),n=bK(t,2),r=n[0],i=n[1],a=h.useRef(null),s=h.useRef(r);s.current=r;var l=h.useCallback(c=>{if(a.current!=null&&(a.current.disconnect(),a.current=null),c!=null){var u=yk(c);if(gk(u,s.current)&&i(u),typeof ResizeObserver<"u"){var p=new ResizeObserver(()=>{var d=yk(c);gk(d,s.current)&&i(d)});p.observe(c),a.current=p}}},[...e]);return h.useEffect(()=>()=>{var c;(c=a.current)===null||c===void 0||c.disconnect()},[]),[r,l]}function On(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 CK=typeof Symbol=="function"&&Symbol.observable||"@@observable",vk=CK,qg=()=>Math.random().toString(36).substring(7).split("").join("."),PK={INIT:`@@redux/INIT${qg()}`,REPLACE:`@@redux/REPLACE${qg()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${qg()}`},Sf=PK;function yb(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 oN(e,t,n){if(typeof e!="function")throw new Error(On(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(On(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(On(1));return n(oN)(e,t)}let r=e,i=t,a=new Map,s=a,l=0,c=!1;function u(){s===a&&(s=new Map,a.forEach((x,y)=>{s.set(y,x)}))}function p(){if(c)throw new Error(On(3));return i}function d(x){if(typeof x!="function")throw new Error(On(4));if(c)throw new Error(On(5));let y=!0;u();const b=l++;return s.set(b,x),function(){if(y){if(c)throw new Error(On(6));y=!1,u(),s.delete(b),a=null}}}function f(x){if(!yb(x))throw new Error(On(7));if(typeof x.type>"u")throw new Error(On(8));if(typeof x.type!="string")throw new Error(On(17));if(c)throw new Error(On(9));try{c=!0,i=r(i,x)}finally{c=!1}return(a=s).forEach(b=>{b()}),x}function m(x){if(typeof x!="function")throw new Error(On(10));r=x,f({type:Sf.REPLACE})}function g(){const x=d;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(On(11));function b(){const S=y;S.next&&S.next(p())}return b(),{unsubscribe:x(b)}},[vk](){return this}}}return f({type:Sf.INIT}),{dispatch:f,subscribe:d,getState:p,replaceReducer:m,[vk]:g}}function AK(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Sf.INIT})>"u")throw new Error(On(12));if(typeof n(void 0,{type:Sf.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(On(13))})}function sN(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const s=t[a];typeof e[s]=="function"&&(n[s]=e[s])}const r=Object.keys(n);let i;try{AK(n)}catch(a){i=a}return function(s={},l){if(i)throw i;let c=!1;const u={};for(let p=0;p<r.length;p++){const d=r[p],f=n[d],m=s[d],g=f(m,l);if(typeof g>"u")throw l&&l.type,new Error(On(14));u[d]=g,c=c||g!==m}return c=c||r.length!==Object.keys(s).length,c?u:s}}function jf(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function EK(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(On(15))};const s={getState:i.getState,dispatch:(c,...u)=>a(c,...u)},l=e.map(c=>c(s));return a=jf(...l)(i.dispatch),{...i,dispatch:a}}}function lN(e){return yb(e)&&"type"in e&&typeof e.type=="string"}var cN=Symbol.for("immer-nothing"),xk=Symbol.for("immer-draftable"),tr=Symbol.for("immer-state");function ii(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var jr=Object,El=jr.getPrototypeOf,kf="constructor",Yh="prototype",Qv="configurable",Cf="enumerable",Rp="writable",wu="value",ga=e=>!!e&&!!e[tr];function di(e){var t;return e?uN(e)||Xh(e)||!!e[xk]||!!((t=e[kf])!=null&&t[xk])||Qh(e)||Zh(e):!1}var TK=jr[Yh][kf].toString(),bk=new WeakMap;function uN(e){if(!e||!vb(e))return!1;const t=El(e);if(t===null||t===jr[Yh])return!0;const n=jr.hasOwnProperty.call(t,kf)&&t[kf];if(n===Object)return!0;if(!Bs(n))return!1;let r=bk.get(n);return r===void 0&&(r=Function.toString.call(n),bk.set(n,r)),r===TK}function Gh(e,t,n=!0){Gu(e)===0?(n?Reflect.ownKeys(e):jr.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Gu(e){const t=e[tr];return t?t.type_:Xh(e)?1:Qh(e)?2:Zh(e)?3:0}var wk=(e,t,n=Gu(e))=>n===2?e.has(t):jr[Yh].hasOwnProperty.call(e,t),Zv=(e,t,n=Gu(e))=>n===2?e.get(t):e[t],Pf=(e,t,n,r=Gu(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function IK(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Xh=Array.isArray,Qh=e=>e instanceof Map,Zh=e=>e instanceof Set,vb=e=>typeof e=="object",Bs=e=>typeof e=="function",Yg=e=>typeof e=="boolean";function OK(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var na=e=>e.copy_||e.base_,xb=e=>e.modified_?e.copy_:e.base_;function Jv(e,t){if(Qh(e))return new Map(e);if(Zh(e))return new Set(e);if(Xh(e))return Array[Yh].slice.call(e);const n=uN(e);if(t===!0||t==="class_only"&&!n){const r=jr.getOwnPropertyDescriptors(e);delete r[tr];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const s=i[a],l=r[s];l[Rp]===!1&&(l[Rp]=!0,l[Qv]=!0),(l.get||l.set)&&(r[s]={[Qv]:!0,[Rp]:!0,[Cf]:l[Cf],[wu]:e[s]})}return jr.create(El(e),r)}else{const r=El(e);if(r!==null&&n)return{...e};const i=jr.create(r);return jr.assign(i,e)}}function bb(e,t=!1){return Jh(e)||ga(e)||!di(e)||(Gu(e)>1&&jr.defineProperties(e,{set:Gd,add:Gd,clear:Gd,delete:Gd}),jr.freeze(e),t&&Gh(e,(n,r)=>{bb(r,!0)},!1)),e}function NK(){ii(2)}var Gd={[wu]:NK};function Jh(e){return e===null||!vb(e)?!0:jr.isFrozen(e)}var Af="MapSet",ex="Patches",Sk="ArrayMethods",dN={};function ds(e){const t=dN[e];return t||ii(0,e),t}var jk=e=>!!dN[e],Su,pN=()=>Su,MK=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:jk(Af)?ds(Af):void 0,arrayMethodsPlugin_:jk(Sk)?ds(Sk):void 0});function kk(e,t){t&&(e.patchPlugin_=ds(ex),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function tx(e){nx(e),e.drafts_.forEach(_K),e.drafts_=null}function nx(e){e===Su&&(Su=e.parent_)}var Ck=e=>Su=MK(Su,e);function _K(e){const t=e[tr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Pk(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[tr].modified_&&(tx(t),ii(4)),di(e)&&(e=Ak(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[tr].base_,e,t)}else e=Ak(t,n);return RK(t,e,!0),tx(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==cN?e:void 0}function Ak(e,t){if(Jh(t))return t;const n=t[tr];if(!n)return Ef(t,e.handledSet_,e);if(!em(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);mN(n,e)}return n.copy_}function RK(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&bb(t,n)}function fN(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var em=(e,t)=>e.scope_===t,DK=[];function hN(e,t,n,r){const i=na(e),a=e.type_;if(r!==void 0&&Zv(i,r,a)===t){Pf(i,r,n,a);return}if(!e.draftLocations_){const l=e.draftLocations_=new Map;Gh(i,(c,u)=>{if(ga(u)){const p=l.get(u)||[];p.push(c),l.set(u,p)}})}const s=e.draftLocations_.get(t)??DK;for(const l of s)Pf(i,l,n,a)}function LK(e,t,n){e.callbacks_.push(function(i){var l;const a=t;if(!a||!em(a,i))return;(l=i.mapSetPlugin_)==null||l.fixSetContents(a);const s=xb(a);hN(e,a.draft_??a,s,n),mN(a,i)})}function mN(e,t){var r;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((r=e.assigned_)==null?void 0:r.size)??0)>0)){const{patchPlugin_:i}=t;if(i){const a=i.getPath(e);a&&i.generatePatches_(e,a,t)}fN(e)}}function zK(e,t,n){const{scope_:r}=e;if(ga(n)){const i=n[tr];em(i,r)&&i.callbacks_.push(function(){Dp(e);const s=xb(i);hN(e,n,s,t)})}else di(n)&&e.callbacks_.push(function(){const a=na(e);e.type_===3?a.has(n)&&Ef(n,r.handledSet_,r):Zv(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Ef(Zv(e.copy_,t,e.type_),r.handledSet_,r)})}function Ef(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||ga(e)||t.has(e)||!di(e)||Jh(e)||(t.add(e),Gh(e,(r,i)=>{if(ga(i)){const a=i[tr];if(em(a,n)){const s=xb(a);Pf(e,r,s,e.type_),fN(a)}}else di(i)&&Ef(i,t,n)})),e}function $K(e,t){const n=Xh(e),r={type_:n?1:0,scope_:t?t.scope_:pN(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,a=Tf;n&&(i=[r],a=ju);const{revoke:s,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=s,[l,r]}var Tf={get(e,t){if(t===tr)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n!=null&&n.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=na(e);if(!wk(i,t,e.type_))return BK(e,i,t);const a=i[t];if(e.finalized_||!di(a)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&OK(t))return a;if(a===Gg(e.base_,t)){Dp(e);const s=e.type_===1?+t:t,l=ix(e.scope_,a,e,s);return e.copy_[s]=l}return a},has(e,t){return t in na(e)},ownKeys(e){return Reflect.ownKeys(na(e))},set(e,t,n){const r=gN(na(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Gg(na(e),t),a=i==null?void 0:i[tr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(IK(n,i)&&(n!==void 0||wk(e.base_,t,e.type_)))return!0;Dp(e),rx(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),zK(e,t,n)),!0},deleteProperty(e,t){return Dp(e),Gg(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),rx(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=na(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Rp]:!0,[Qv]:e.type_!==1||t!=="length",[Cf]:r[Cf],[wu]:n[t]}},defineProperty(){ii(11)},getPrototypeOf(e){return El(e.base_)},setPrototypeOf(){ii(12)}},ju={};for(let e in Tf){let t=Tf[e];ju[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}ju.deleteProperty=function(e,t){return ju.set.call(this,e,t,void 0)};ju.set=function(e,t,n){return Tf.set.call(this,e[0],t,n,e[0])};function Gg(e,t){const n=e[tr];return(n?na(n):e)[t]}function BK(e,t,n){var i;const r=gN(t,n);return r?wu in r?r[wu]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function gN(e,t){if(!(t in e))return;let n=El(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=El(n)}}function rx(e){e.modified_||(e.modified_=!0,e.parent_&&rx(e.parent_))}function Dp(e){e.copy_||(e.assigned_=new Map,e.copy_=Jv(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var FK=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Bs(n)&&!Bs(r)){const s=r;r=n;const l=this;return function(u=s,...p){return l.produce(u,d=>r.call(this,d,...p))}}Bs(r)||ii(6),i!==void 0&&!Bs(i)&&ii(7);let a;if(di(n)){const s=Ck(this),l=ix(s,n,void 0);let c=!0;try{a=r(l),c=!1}finally{c?tx(s):nx(s)}return kk(s,i),Pk(a,s)}else if(!n||!vb(n)){if(a=r(n),a===void 0&&(a=n),a===cN&&(a=void 0),this.autoFreeze_&&bb(a,!0),i){const s=[],l=[];ds(ex).generateReplacementPatches_(n,a,{patches_:s,inversePatches_:l}),i(s,l)}return a}else ii(1,n)},this.produceWithPatches=(n,r)=>{if(Bs(n))return(l,...c)=>this.produceWithPatches(l,u=>n(u,...c));let i,a;return[this.produce(n,r,(l,c)=>{i=l,a=c}),i,a]},Yg(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Yg(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Yg(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){di(t)||ii(8),ga(t)&&(t=Ur(t));const n=Ck(this),r=ix(n,t,void 0);return r[tr].isManual_=!0,nx(n),r}finishDraft(t,n){const r=t&&t[tr];(!r||!r.isManual_)&&ii(9);const{scope_:i}=r;return kk(i,n),Pk(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let r;for(r=n.length-1;r>=0;r--){const a=n[r];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}r>-1&&(n=n.slice(r+1));const i=ds(ex).applyPatches_;return ga(t)?i(t,n):this.produce(t,a=>i(a,n))}};function ix(e,t,n,r){const[i,a]=Qh(t)?ds(Af).proxyMap_(t,n):Zh(t)?ds(Af).proxySet_(t,n):$K(t,n);return((n==null?void 0:n.scope_)??pN()).drafts_.push(i),a.callbacks_=(n==null?void 0:n.callbacks_)??[],a.key_=r,n&&r!==void 0?LK(n,a,r):a.callbacks_.push(function(c){var p;(p=c.mapSetPlugin_)==null||p.fixSetContents(a);const{patchPlugin_:u}=c;a.modified_&&u&&u.generatePatches_(a,[],c)}),i}function Ur(e){return ga(e)||ii(10,e),yN(e)}function yN(e){if(!di(e)||Jh(e))return e;const t=e[tr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Jv(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Jv(e,!0);return Gh(n,(i,a)=>{Pf(n,i,yN(a))},r),t&&(t.finalized_=!1),n}var UK=new FK,vN=UK.produce;function xN(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var WK=xN(),KK=xN,HK=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?jf:jf.apply(null,arguments)};function Ar(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Cr(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>lN(r)&&r.type===e,n}var bN=class Oc extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Oc.prototype)}static get[Symbol.species](){return Oc}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Oc(...t[0].concat(this)):new Oc(...t.concat(this))}};function Ek(e){return di(e)?vN(e,()=>{}):e}function Xd(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function VK(e){return typeof e=="boolean"}var qK=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let s=new bN;return n&&(VK(n)?s.push(WK):s.push(KK(n.extraArgument))),s},wN="RTK_autoBatch",Dt=()=>e=>({payload:e,meta:{[wN]:!0}}),Tk=e=>t=>{setTimeout(t,e)},YK=(e,t)=>n=>{let r=!1;const i=()=>{r||(r=!0,cancelAnimationFrame(a),clearTimeout(s),n())},a=e(i),s=setTimeout(i,t)},SN=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,s=!1;const l=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?YK(window.requestAnimationFrame,100):Tk(10):e.type==="callback"?e.queueNotification:Tk(e.timeout),u=()=>{s=!1,a&&(a=!1,l.forEach(p=>p()))};return Object.assign({},r,{subscribe(p){const d=()=>i&&p(),f=r.subscribe(d);return l.add(p),()=>{f(),l.delete(p)}},dispatch(p){var d;try{return i=!((d=p==null?void 0:p.meta)!=null&&d[wN]),a=!i,a&&(s||(s=!0,c(u))),r.dispatch(p)}finally{i=!0}}})},GK=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new bN(e);return r&&i.push(SN(typeof r=="object"?r:void 0)),i};function XK(e){const t=qK(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:s=void 0}=e||{};let l;if(typeof n=="function")l=n;else if(yb(n))l=sN(n);else throw new Error(Cr(1));let c;typeof r=="function"?c=r(t):c=t();let u=jf;i&&(u=HK({trace:!1,...typeof i=="object"&&i}));const p=EK(...c),d=GK(p);let f=typeof s=="function"?s(d):d();const m=u(...f);return oN(l,a,m)}function jN(e){const t={},n=[];let r;const i={addCase(a,s){const l=typeof a=="string"?a:a.type;if(!l)throw new Error(Cr(28));if(l in t)throw new Error(Cr(29));return t[l]=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&&n.push({matcher:a.settled,reducer:s.settled}),i},addMatcher(a,s){return n.push({matcher:a,reducer:s}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function QK(e){return typeof e=="function"}function ZK(e,t){let[n,r,i]=jN(t),a;if(QK(e))a=()=>Ek(e());else{const l=Ek(e);a=()=>l}function s(l=a(),c){let u=[n[c.type],...r.filter(({matcher:p})=>p(c)).map(({reducer:p})=>p)];return u.filter(p=>!!p).length===0&&(u=[i]),u.reduce((p,d)=>{if(d)if(ga(p)){const m=d(p,c);return m===void 0?p:m}else{if(di(p))return vN(p,f=>d(f,c));{const f=d(p,c);if(f===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return f}}return p},l)}return s.getInitialState=a,s}var JK="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",eH=(e=21)=>{let t="",n=e;for(;n--;)t+=JK[Math.random()*64|0];return t},tH=Symbol.for("rtk-slice-createasyncthunk");function nH(e,t){return`${e}/${t}`}function rH({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[tH];return function(i){const{name:a,reducerPath:s=a}=i;if(!a)throw new Error(Cr(11));const l=(typeof i.reducers=="function"?i.reducers(aH()):i.reducers)||{},c=Object.keys(l),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},p={addCase(S,k){const j=typeof S=="string"?S:S.type;if(!j)throw new Error(Cr(12));if(j in u.sliceCaseReducersByType)throw new Error(Cr(13));return u.sliceCaseReducersByType[j]=k,p},addMatcher(S,k){return u.sliceMatchers.push({matcher:S,reducer:k}),p},exposeAction(S,k){return u.actionCreators[S]=k,p},exposeCaseReducer(S,k){return u.sliceCaseReducersByName[S]=k,p}};c.forEach(S=>{const k=l[S],j={reducerName:S,type:nH(a,S),createNotation:typeof i.reducers=="function"};sH(k)?cH(j,k,p,t):oH(j,k,p)});function d(){const[S={},k=[],j=void 0]=typeof i.extraReducers=="function"?jN(i.extraReducers):[i.extraReducers],A={...S,...u.sliceCaseReducersByType};return ZK(i.initialState,E=>{for(let D in A)E.addCase(D,A[D]);for(let D of u.sliceMatchers)E.addMatcher(D.matcher,D.reducer);for(let D of k)E.addMatcher(D.matcher,D.reducer);j&&E.addDefaultCase(j)})}const f=S=>S,m=new Map,g=new WeakMap;let v;function x(S,k){return v||(v=d()),v(S,k)}function y(){return v||(v=d()),v.getInitialState()}function b(S,k=!1){function j(E){let D=E[S];return typeof D>"u"&&k&&(D=Xd(g,j,y)),D}function A(E=f){const D=Xd(m,k,()=>new WeakMap);return Xd(D,E,()=>{const O={};for(const[_,R]of Object.entries(i.selectors??{}))O[_]=iH(R,E,()=>Xd(g,E,y),k);return O})}return{reducerPath:S,getSelectors:A,get selectors(){return A(j)},selectSlice:j}}const w={name:a,reducer:x,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:y,...b(s),injectInto(S,{reducerPath:k,...j}={}){const A=k??s;return S.inject({reducerPath:A,reducer:x},j),{...w,...b(A,!0)}}};return w}}function iH(e,t,n,r){function i(a,...s){let l=t(a);return typeof l>"u"&&r&&(l=n()),e(l,...s)}return i.unwrapped=e,i}var Yn=rH();function aH(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function oH({type:e,reducerName:t,createNotation:n},r,i){let a,s;if("reducer"in r){if(n&&!lH(r))throw new Error(Cr(17));a=r.reducer,s=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,s?Ar(e,s):Ar(e))}function sH(e){return e._reducerDefinitionType==="asyncThunk"}function lH(e){return e._reducerDefinitionType==="reducerWithPrepare"}function cH({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Cr(18));const{payloadCreator:a,fulfilled:s,pending:l,rejected:c,settled:u,options:p}=n,d=i(e,a,p);r.exposeAction(t,d),s&&r.addCase(d.fulfilled,s),l&&r.addCase(d.pending,l),c&&r.addCase(d.rejected,c),u&&r.addMatcher(d.settled,u),r.exposeCaseReducer(t,{fulfilled:s||Qd,pending:l||Qd,rejected:c||Qd,settled:u||Qd})}function Qd(){}var uH="task",kN="listener",CN="completed",wb="cancelled",dH=`task-${wb}`,pH=`task-${CN}`,ax=`${kN}-${wb}`,fH=`${kN}-${CN}`,tm=class{constructor(e){$e(this,"code");$e(this,"name","TaskAbortError");$e(this,"message");this.code=e,this.message=`${uH} ${wb} (reason: ${e})`}},Sb=(e,t)=>{if(typeof e!="function")throw new TypeError(Cr(32))},If=()=>{},PN=(e,t=If)=>(e.catch(t),e),AN=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Zo=e=>{if(e.aborted)throw new tm(e.reason)};function EN(e,t){let n=If;return new Promise((r,i)=>{const a=()=>i(new tm(e.reason));if(e.aborted){a();return}n=AN(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=If})}var hH=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof tm?"cancelled":"rejected",error:n}}finally{t==null||t()}},Of=e=>t=>PN(EN(e,t).then(n=>(Zo(e),n))),TN=e=>{const t=Of(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:pl}=Object,Ik={},nm="listenerMiddleware",mH=(e,t)=>{const n=r=>AN(e,()=>r.abort(e.reason));return(r,i)=>{Sb(r);const a=new AbortController;n(a);const s=hH(async()=>{Zo(e),Zo(a.signal);const l=await r({pause:Of(a.signal),delay:TN(a.signal),signal:a.signal});return Zo(a.signal),l},()=>a.abort(pH));return i!=null&&i.autoJoin&&t.push(s.catch(If)),{result:Of(e)(s),cancel(){a.abort(dH)}}}},gH=(e,t)=>{const n=async(r,i)=>{Zo(t);let a=()=>{};const l=[new Promise((c,u)=>{let p=e({predicate:r,effect:(d,f)=>{f.unsubscribe(),c([d,f.getState(),f.getOriginalState()])}});a=()=>{p(),u()}})];i!=null&&l.push(new Promise(c=>setTimeout(c,i,null)));try{const c=await EN(t,Promise.race(l));return Zo(t),c}finally{a()}};return(r,i)=>PN(n(r,i))},IN=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Ar(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Cr(21));return Sb(a),{predicate:i,type:t,effect:a}},ON=pl(e=>{const{type:t,predicate:n,effect:r}=IN(e);return{id:eH(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Cr(22))}}},{withTypes:()=>ON}),Ok=(e,t)=>{const{type:n,effect:r,predicate:i}=IN(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},ox=e=>{e.pending.forEach(t=>{t.abort(ax)})},yH=(e,t)=>()=>{for(const n of t.keys())ox(n);e.clear()},Nk=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},NN=pl(Ar(`${nm}/add`),{withTypes:()=>NN}),vH=Ar(`${nm}/removeAll`),MN=pl(Ar(`${nm}/remove`),{withTypes:()=>MN}),xH=(...e)=>{console.error(`${nm}/error`,...e)},Xu=(e={})=>{const t=new Map,n=new Map,r=m=>{const g=n.get(m)??0;n.set(m,g+1)},i=m=>{const g=n.get(m)??1;g===1?n.delete(m):n.set(m,g-1)},{extra:a,onError:s=xH}=e;Sb(s);const l=m=>(m.unsubscribe=()=>t.delete(m.id),t.set(m.id,m),g=>{m.unsubscribe(),g!=null&&g.cancelActive&&ox(m)}),c=m=>{const g=Ok(t,m)??ON(m);return l(g)};pl(c,{withTypes:()=>c});const u=m=>{const g=Ok(t,m);return g&&(g.unsubscribe(),m.cancelActive&&ox(g)),!!g};pl(u,{withTypes:()=>u});const p=async(m,g,v,x)=>{const y=new AbortController,b=gH(c,y.signal),w=[];try{m.pending.add(y),r(m),await Promise.resolve(m.effect(g,pl({},v,{getOriginalState:x,condition:(S,k)=>b(S,k).then(Boolean),take:b,delay:TN(y.signal),pause:Of(y.signal),extra:a,signal:y.signal,fork:mH(y.signal,w),unsubscribe:m.unsubscribe,subscribe:()=>{t.set(m.id,m)},cancelActiveListeners:()=>{m.pending.forEach((S,k,j)=>{S!==y&&(S.abort(ax),j.delete(S))})},cancel:()=>{y.abort(ax),m.pending.delete(y)},throwIfCancelled:()=>{Zo(y.signal)}})))}catch(S){S instanceof tm||Nk(s,S,{raisedBy:"effect"})}finally{await Promise.all(w),y.abort(fH),i(m),m.pending.delete(y)}},d=yH(t,n);return{middleware:m=>g=>v=>{if(!lN(v))return g(v);if(NN.match(v))return c(v.payload);if(vH.match(v)){d();return}if(MN.match(v))return u(v.payload);let x=m.getState();const y=()=>{if(x===Ik)throw new Error(Cr(23));return x};let b;try{if(b=g(v),t.size>0){const w=m.getState(),S=Array.from(t.values());for(const k of S){let j=!1;try{j=k.predicate(v,w,x)}catch(A){j=!1,Nk(s,A,{raisedBy:"predicate"})}j&&p(k,v,m,y)}}}finally{x=Ik}return b},startListening:c,stopListening:u,clearListeners:d}};function Cr(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 bH={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},_N=Yn({name:"chartLayout",initialState:bH,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var n,r,i,a;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(r=t.payload.right)!==null&&r!==void 0?r: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}}}),rm=_N.actions,wH=rm.setMargin,SH=rm.setLayout,jH=rm.setChartSize,kH=rm.setScale,CH=_N.reducer;function RN(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function Je(e){return Number.isFinite(e)}function Fi(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function Mk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function tl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Mk(Object(n),!0).forEach(function(r){PH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PH(e,t,n){return(t=AH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AH(e){var t=EH(e,"string");return typeof t=="symbol"?t:t+""}function EH(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ht(e,t,n){return $t(e)||$t(t)?n:Bi(t)?$i(e,t,n):typeof t=="function"?t(e):n}var TH=(e,t,n)=>{if(t&&n){var r=n.width,i=n.height,a=t.align,s=t.verticalAlign,l=t.layout;if((l==="vertical"||l==="horizontal"&&s==="middle")&&a!=="center"&&Ce(e[a]))return tl(tl({},e),{},{[a]:e[a]+(r||0)});if((l==="horizontal"||l==="vertical"&&a==="center")&&s!=="middle"&&Ce(e[s]))return tl(tl({},e),{},{[s]:e[s]+(i||0)})}return e},fi=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",DN=(e,t,n,r)=>{if(r)return e.map(l=>l.coordinate);var i,a,s=e.map(l=>(l.coordinate===t&&(i=!0),l.coordinate===n&&(a=!0),l.coordinate));return i||s.push(t),a||s.push(n),s},LN=(e,t,n)=>{if(!e)return null;var r=e.duplicateDomain,i=e.type,a=e.range,s=e.scale,l=e.realScaleType,c=e.isCategorical,u=e.categoricalDomain,p=e.tickCount,d=e.ticks,f=e.niceTicks,m=e.axisType;if(!s)return null;var g=l==="scaleBand"&&s.bandwidth?s.bandwidth()/2:2,v=i==="category"&&s.bandwidth?s.bandwidth()/g:0;if(v=m==="angleAxis"&&a&&a.length>=2?jn(a[0]-a[1])*2*v:v,d||f){var x=(d||f||[]).map((y,b)=>{var w=r?r.indexOf(y):y,S=s.map(w);return Je(S)?{coordinate:S+v,value:y,offset:v,index:b}:null}).filter(cr);return x}return c&&u?u.map((y,b)=>{var w=s.map(y);return Je(w)?{coordinate:w+v,value:y,index:b,offset:v}:null}).filter(cr):s.ticks&&p!=null?s.ticks(p).map((y,b)=>{var w=s.map(y);return Je(w)?{coordinate:w+v,value:y,index:b,offset:v}:null}).filter(cr):s.domain().map((y,b)=>{var w=s.map(y);return Je(w)?{coordinate:w+v,value:r?r[y]:y,index:b,offset:v}:null}).filter(cr)},IH=(e,t)=>{if(!t||t.length!==2||!Ce(t[0])||!Ce(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!Ce(e[0])||e[0]<n)&&(i[0]=n),(!Ce(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},OH=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,s=0,l=0;l<n;++l){var c=e[l],u=c==null?void 0:c[i];if(u!=null){var p=u[1],d=u[0],f=ui(p)?d:p;f>=0?(u[0]=a,a+=f,u[1]=a):(u[0]=s,s+=f,u[1]=s)}}}},NH=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,s=0;s<n;++s){var l=e[s],c=l==null?void 0:l[i];if(c!=null){var u=ui(c[1])?c[0]:c[1];u>=0?(c[0]=a,a+=u,c[1]=a):(c[0]=0,c[1]=0)}}}},MH={sign:OH,expand:yW,none:cs,silhouette:vW,wiggle:xW,positive:NH},_H=(e,t,n)=>{var r,i=(r=MH[n])!==null&&r!==void 0?r:cs,a=gW().keys(t).value((l,c)=>Number(ht(l,c,0))).order(Hv).offset(i),s=a(e);return s.forEach((l,c)=>{l.forEach((u,p)=>{var d=ht(e[p],t[c],0);Array.isArray(d)&&d.length===2&&Ce(d[0])&&Ce(d[1])&&(u[0]=d[0],u[1]=d[1])})}),s};function zN(e){return e==null?void 0:String(e)}function Nf(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,a=e.index,s=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!$t(i[t.dataKey])){var l=_O(n,"value",i[t.dataKey]);if(l)return l.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=ht(i,$t(s)?t.dataKey:s),u=t.scale.map(c);return Ce(u)?u:null}var _k=e=>{var t=e.axis,n=e.ticks,r=e.offset,i=e.bandSize,a=e.entry,s=e.index;if(t.type==="category")return n[s]?n[s].coordinate+r:null;var l=ht(a,t.dataKey,t.scale.domain()[s]);if($t(l))return null;var c=t.scale.map(l);return Ce(c)?c-i/2+r:null},RH=e=>{var t=e.numericAxis,n=t.scale.domain();if(t.type==="number"){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},DH=e=>{var t=e.flat(2).filter(Ce);return[Math.min(...t),Math.max(...t)]},LH=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],zH=(e,t,n)=>{if(!(e==null||Object.keys(e).length===0))return LH(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var s=a.stackedData,l=s.reduce((c,u)=>{var p=RN(u,t,n),d=DH(p);return!Je(d[0])||!Je(d[1])?c:[Math.min(c[0],d[0]),Math.max(c[1],d[1])]},[1/0,-1/0]);return[Math.min(l[0],r[0]),Math.max(l[1],r[1])]},[1/0,-1/0]))},Rk=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Dk=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,oo=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=qh(t,p=>p.coordinate),a=1/0,s=1,l=i.length;s<l;s++){var c=i[s],u=i[s-1];a=Math.min(((c==null?void 0:c.coordinate)||0)-((u==null?void 0:u.coordinate)||0),a)}return a===1/0?0:a}return n?void 0:0};function Lk(e){var t=e.tooltipEntrySettings,n=e.dataKey,r=e.payload,i=e.value,a=e.name;return tl(tl({},t),{},{dataKey:n,payload:r,value:i,name:a})}function mo(e,t){if(e!=null)return String(e);if(typeof t=="string")return t}var $H=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},BH=(e,t)=>t==="centric"?e.angle:e.radius,ja=e=>e.layout.width,ka=e=>e.layout.height,FH=e=>e.layout.scale,$N=e=>e.layout.margin,im=G(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),am=G(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),BN="data-recharts-item-index",FN="data-recharts-item-id",Qu=60;function zk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Zd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zk(Object(n),!0).forEach(function(r){UH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function UH(e,t,n){return(t=WH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WH(e){var t=KH(e,"string");return typeof t=="symbol"?t:t+""}function KH(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var HH=e=>e.brush.height;function VH(e){var t=am(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Qu;return n+i}return n},0)}function qH(e){var t=am(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Qu;return n+i}return n},0)}function YH(e){var t=im(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function GH(e){var t=im(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var vn=G([ja,ka,$N,HH,VH,qH,YH,GH,iN,gK],(e,t,n,r,i,a,s,l,c,u)=>{var p={left:(n.left||0)+i,right:(n.right||0)+a},d={top:(n.top||0)+s,bottom:(n.bottom||0)+l},f=Zd(Zd({},d),p),m=f.bottom;f.bottom+=r,f=TH(f,c,u);var g=e-f.left-f.right,v=t-f.top-f.bottom;return Zd(Zd({brushBottom:m},f),{},{width:Math.max(g,0),height:Math.max(v,0)})}),XH=G(vn,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),jb=G(ja,ka,(e,t)=>({x:0,y:0,width:e,height:t})),QH=h.createContext(null),Cn=()=>h.useContext(QH)!=null,om=e=>e.brush,sm=G([om,vn,$N],(e,t,n)=>({height:e.height,x:Ce(e.x)?e.x:t.left,y:Ce(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:Ce(e.width)?e.width:t.width}));function ZH(e,t,{signal:n,edges:r}={}){let i,a=null;const s=r!=null&&r.includes("leading"),l=r==null||r.includes("trailing"),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},u=()=>{l&&c(),m()};let p=null;const d=()=>{p!=null&&clearTimeout(p),p=setTimeout(()=>{p=null,u()},t)},f=()=>{p!==null&&(clearTimeout(p),p=null)},m=()=>{f(),i=void 0,a=null},g=()=>{c()},v=function(...x){if(n!=null&&n.aborted)return;i=this,a=x;const y=p==null;d(),s&&y&&c()};return v.schedule=d,v.cancel=m,v.flush=g,n==null||n.addEventListener("abort",m,{once:!0}),v}function JH(e,t=0,n={}){typeof n!="object"&&(n={});const{leading:r=!1,trailing:i=!0,maxWait:a}=n,s=Array(2);r&&(s[0]="leading"),i&&(s[1]="trailing");let l,c=null;const u=ZH(function(...f){l=e.apply(this,f),c=null},t,{edges:s}),p=function(...f){return a!=null&&(c===null&&(c=Date.now()),Date.now()-c>=a)?(l=e.apply(this,f),c=Date.now(),u.cancel(),u.schedule(),l):(u.apply(this,f),l)},d=()=>(u.flush(),l);return p.cancel=u.cancel,p.flush=d,p}function e7(e,t=0,n={}){const{leading:r=!0,trailing:i=!0}=n;return JH(e,t,{leading:r,maxWait:t,trailing:i})}var Mf=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===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(n.replace(/%s/g,()=>i[s++]))}},Ni={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},UN=(e,t,n)=>{var r=n.width,i=r===void 0?Ni.width:r,a=n.height,s=a===void 0?Ni.height:a,l=n.aspect,c=n.maxHeight,u=us(i)?e:Number(i),p=us(s)?t:Number(s);return l&&l>0&&(u?p=u/l:p&&(u=p*l),c&&p!=null&&p>c&&(p=c)),{calculatedWidth:u,calculatedHeight:p}},t7={width:0,height:0,overflow:"visible"},n7={width:0,overflowX:"visible"},r7={height:0,overflowY:"visible"},i7={},a7=e=>{var t=e.width,n=e.height,r=us(t),i=us(n);return r&&i?t7:r?n7:i?r7:i7};function o7(e){var t=e.width,n=e.height,r=e.aspect,i=t,a=n;return i===void 0&&a===void 0?(i=Ni.width,a=Ni.height):i===void 0?i=r&&r>0?void 0:Ni.width:a===void 0&&(a=r&&r>0?void 0:Ni.height),{width:i,height:a}}var s7=["aspect","initialDimension","width","height","minWidth","minHeight","maxHeight","children","debounce","id","className","onResize","style"];function _f(){return _f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_f.apply(null,arguments)}function $k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$k(Object(n),!0).forEach(function(r){l7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$k(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function l7(e,t,n){return(t=c7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c7(e){var t=u7(e,"string");return typeof t=="symbol"?t:t+""}function u7(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function d7(e,t){return m7(e)||h7(e,t)||f7(e,t)||p7()}function p7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
416
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f7(e,t){if(e){if(typeof e=="string")return Fk(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fk(e,t):void 0}}function Fk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h7(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function m7(e){if(Array.isArray(e))return e}function g7(e,t){if(e==null)return{};var n,r,i=y7(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function y7(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var WN=h.createContext(Ni.initialDimension);function v7(e){return Fi(e.width)&&Fi(e.height)}function KN(e){var t=e.children,n=e.width,r=e.height,i=h.useMemo(()=>({width:n,height:r}),[n,r]);return v7(i)?h.createElement(WN.Provider,{value:i},t):null}var kb=()=>h.useContext(WN),x7=h.forwardRef((e,t)=>{var n=e.aspect,r=e.initialDimension,i=r===void 0?Ni.initialDimension:r,a=e.width,s=e.height,l=e.minWidth,c=l===void 0?Ni.minWidth:l,u=e.minHeight,p=e.maxHeight,d=e.children,f=e.debounce,m=f===void 0?Ni.debounce:f,g=e.id,v=e.className,x=e.onResize,y=e.style,b=y===void 0?{}:y,w=g7(e,s7),S=h.useRef(null),k=h.useRef();k.current=x,h.useImperativeHandle(t,()=>S.current);var j=h.useState({containerWidth:i.width,containerHeight:i.height}),A=d7(j,2),E=A[0],D=A[1],O=h.useCallback(($,H)=>{D(N=>{var U=Math.round($),P=Math.round(H);return N.containerWidth===U&&N.containerHeight===P?N:{containerWidth:U,containerHeight:P}})},[]);h.useEffect(()=>{if(S.current==null||typeof ResizeObserver>"u")return ho;var $=W=>{var se,T=W[0];if(T!=null){var he=T.contentRect,ye=he.width,Z=he.height;O(ye,Z),(se=k.current)===null||se===void 0||se.call(k,ye,Z)}};m>0&&($=e7($,m,{trailing:!0,leading:!1}));var H=new ResizeObserver($),N=S.current.getBoundingClientRect(),U=N.width,P=N.height;return O(U,P),H.observe(S.current),()=>{H.disconnect()}},[O,m]);var _=E.containerWidth,R=E.containerHeight;Mf(!n||n>0,"The aspect(%s) must be greater than zero.",n);var X=UN(_,R,{width:a,height:s,aspect:n,maxHeight:p}),V=X.calculatedWidth,I=X.calculatedHeight;return Mf(_<0||R<0||V!=null&&V>0||I!=null&&I>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
417
|
+
please check the style of container, or the props width(%s) and height(%s),
|
|
418
|
+
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
419
|
+
height and width.`,V,I,a,s,c,u,n),h.createElement("div",_f({id:g?"".concat(g):void 0,className:mt("recharts-responsive-container",v),style:Bk(Bk({},b),{},{width:a,height:s,minWidth:c,minHeight:u,maxHeight:p}),ref:S},w),h.createElement("div",{style:a7({width:a,height:s})},h.createElement(KN,{width:V,height:I},d)))}),Fs=h.forwardRef((e,t)=>{var n=kb();if(Fi(n.width)&&Fi(n.height))return e.children;var r=o7({width:e.width,height:e.height,aspect:e.aspect}),i=r.width,a=r.height,s=UN(void 0,void 0,{width:i,height:a,aspect:e.aspect,maxHeight:e.maxHeight}),l=s.calculatedWidth,c=s.calculatedHeight;return Ce(l)&&Ce(c)?h.createElement(KN,{width:l,height:c},e.children):h.createElement(x7,_f({},e,{width:i,height:a,ref:t}))});function Cb(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 lm=()=>{var e,t=Cn(),n=Te(XH),r=Te(sm),i=(e=Te(om))===null||e===void 0?void 0:e.padding;return!t||!r||!i?n:{width:r.width-i.left-i.right,height:r.height-i.top-i.bottom,x:i.left,y:i.top}},b7={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},HN=()=>{var e;return(e=Te(vn))!==null&&e!==void 0?e:b7},Pb=()=>Te(ja),Ab=()=>Te(ka),w7=()=>Te(e=>e.layout.margin),lt=e=>e.layout.layoutType,go=()=>Te(lt),Eb=()=>{var e=go();if(e==="horizontal"||e==="vertical")return e},Tb=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},S7=()=>Te(Tb),j7=()=>{var e=go();return e!==void 0},Zu=e=>{var t=St(),n=Cn(),r=e.width,i=e.height,a=kb(),s=r,l=i;return a&&(s=a.width>0?a.width:r,l=a.height>0?a.height:i),h.useEffect(()=>{!n&&Fi(s)&&Fi(l)&&t(jH({width:s,height:l}))},[t,n,s,l]),null},VN=Symbol.for("immer-nothing"),Uk=Symbol.for("immer-draftable"),Er=Symbol.for("immer-state");function ai(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ku=Object.getPrototypeOf;function Tl(e){return!!e&&!!e[Er]}function ps(e){var t;return e?qN(e)||Array.isArray(e)||!!e[Uk]||!!((t=e.constructor)!=null&&t[Uk])||Ju(e)||um(e):!1}var k7=Object.prototype.constructor.toString(),Wk=new WeakMap;function qN(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let r=Wk.get(n);return r===void 0&&(r=Function.toString.call(n),Wk.set(n,r)),r===k7}function Rf(e,t,n=!0){cm(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function cm(e){const t=e[Er];return t?t.type_:Array.isArray(e)?1:Ju(e)?2:um(e)?3:0}function sx(e,t){return cm(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function YN(e,t,n){const r=cm(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function C7(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ju(e){return e instanceof Map}function um(e){return e instanceof Set}function No(e){return e.copy_||e.base_}function lx(e,t){if(Ju(e))return new Map(e);if(um(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=qN(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Er];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const s=i[a],l=r[s];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(r[s]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[s]})}return Object.create(ku(e),r)}else{const r=ku(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function Ib(e,t=!1){return dm(e)||Tl(e)||!ps(e)||(cm(e)>1&&Object.defineProperties(e,{set:Jd,add:Jd,clear:Jd,delete:Jd}),Object.freeze(e),t&&Object.values(e).forEach(n=>Ib(n,!0))),e}function P7(){ai(2)}var Jd={value:P7};function dm(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var A7={};function fs(e){const t=A7[e];return t||ai(0,e),t}var Cu;function GN(){return Cu}function E7(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Kk(e,t){t&&(fs("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function cx(e){ux(e),e.drafts_.forEach(T7),e.drafts_=null}function ux(e){e===Cu&&(Cu=e.parent_)}function Hk(e){return Cu=E7(Cu,e)}function T7(e){const t=e[Er];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Vk(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Er].modified_&&(cx(t),ai(4)),ps(e)&&(e=Df(t,e),t.parent_||Lf(t,e)),t.patches_&&fs("Patches").generateReplacementPatches_(n[Er].base_,e,t.patches_,t.inversePatches_)):e=Df(t,n,[]),cx(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==VN?e:void 0}function Df(e,t,n){if(dm(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Er];if(!i)return Rf(t,(a,s)=>qk(e,i,t,a,s,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return Lf(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let s=a,l=!1;i.type_===3&&(s=new Set(a),a.clear(),l=!0),Rf(s,(c,u)=>qk(e,i,a,c,u,n,l),r),Lf(e,a,!1),n&&e.patches_&&fs("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function qk(e,t,n,r,i,a,s){if(i==null||typeof i!="object"&&!s)return;const l=dm(i);if(!(l&&!s)){if(Tl(i)){const c=a&&t&&t.type_!==3&&!sx(t.assigned_,r)?a.concat(r):void 0,u=Df(e,i,c);if(YN(n,r,u),Tl(u))e.canAutoFreeze_=!1;else return}else s&&n.add(i);if(ps(i)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&l)return;Df(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(Ju(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&Lf(e,i)}}}function Lf(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ib(t,n)}function I7(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:GN(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=Ob;n&&(i=[r],a=Pu);const{revoke:s,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=s,l}var Ob={get(e,t){if(t===Er)return e;const n=No(e);if(!sx(n,t))return O7(e,n,t);const r=n[t];return e.finalized_||!ps(r)?r:r===Xg(e.base_,t)?(Qg(e),e.copy_[t]=px(r,e)):r},has(e,t){return t in No(e)},ownKeys(e){return Reflect.ownKeys(No(e))},set(e,t,n){const r=XN(No(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Xg(No(e),t),a=i==null?void 0:i[Er];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(C7(n,i)&&(n!==void 0||sx(e.base_,t)))return!0;Qg(e),dx(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Xg(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Qg(e),dx(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=No(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){ai(11)},getPrototypeOf(e){return ku(e.base_)},setPrototypeOf(){ai(12)}},Pu={};Rf(Ob,(e,t)=>{Pu[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Pu.deleteProperty=function(e,t){return Pu.set.call(this,e,t,void 0)};Pu.set=function(e,t,n){return Ob.set.call(this,e[0],t,n,e[0])};function Xg(e,t){const n=e[Er];return(n?No(n):e)[t]}function O7(e,t,n){var i;const r=XN(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function XN(e,t){if(!(t in e))return;let n=ku(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=ku(n)}}function dx(e){e.modified_||(e.modified_=!0,e.parent_&&dx(e.parent_))}function Qg(e){e.copy_||(e.copy_=lx(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var N7=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const a=n;n=t;const s=this;return function(c=a,...u){return s.produce(c,p=>n.call(this,p,...u))}}typeof n!="function"&&ai(6),r!==void 0&&typeof r!="function"&&ai(7);let i;if(ps(t)){const a=Hk(this),s=px(t,void 0);let l=!0;try{i=n(s),l=!1}finally{l?cx(a):ux(a)}return Kk(a,r),Vk(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===VN&&(i=void 0),this.autoFreeze_&&Ib(i,!0),r){const a=[],s=[];fs("Patches").generateReplacementPatches_(t,i,a,s),r(a,s)}return i}else ai(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...l)=>this.produceWithPatches(s,c=>t(c,...l));let r,i;return[this.produce(t,n,(s,l)=>{r=s,i=l}),r,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){ps(e)||ai(8),Tl(e)&&(e=M7(e));const t=Hk(this),n=px(e,void 0);return n[Er].isManual_=!0,ux(t),n}finishDraft(e,t){const n=e&&e[Er];(!n||!n.isManual_)&&ai(9);const{scope_:r}=n;return Kk(r,t),Vk(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=fs("Patches").applyPatches_;return Tl(e)?r(e,t):this.produce(e,i=>r(i,t))}};function px(e,t){const n=Ju(e)?fs("MapSet").proxyMap_(e,t):um(e)?fs("MapSet").proxySet_(e,t):I7(e,t);return(t?t.scope_:GN()).drafts_.push(n),n}function M7(e){return Tl(e)||ai(10,e),QN(e)}function QN(e){if(!ps(e)||dm(e))return e;const t=e[Er];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=lx(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=lx(e,!0);return Rf(n,(i,a)=>{YN(n,i,QN(a))},r),t&&(t.finalized_=!1),n}var _7=new N7;_7.produce;var R7={settings:{layout:"horizontal",align:"center",verticalAlign:"bottom",itemSorter:"value"},size:{width:0,height:0},payload:[]},ZN=Yn({name:"legend",initialState:R7,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:Dt()},replaceLegendPayload:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Ur(e).payload.indexOf(r);a>-1&&(e.payload[a]=i)},prepare:Dt()},removeLegendPayload:{reducer(e,t){var n=Ur(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:Dt()}}}),ed=ZN.actions,Yk=ed.setLegendSize,D7=ed.setLegendSettings,JN=ed.addLegendPayload,eM=ed.replaceLegendPayload,tM=ed.removeLegendPayload,L7=ZN.reducer,z7={};/**
|
|
420
|
+
* @license React
|
|
421
|
+
* use-sync-external-store-with-selector.production.js
|
|
422
|
+
*
|
|
423
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
424
|
+
*
|
|
425
|
+
* This source code is licensed under the MIT license found in the
|
|
426
|
+
* LICENSE file in the root directory of this source tree.
|
|
427
|
+
*/var td=h;function $7(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var B7=typeof Object.is=="function"?Object.is:$7,F7=td.useSyncExternalStore,U7=td.useRef,W7=td.useEffect,K7=td.useMemo,H7=td.useDebugValue;z7.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=U7(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=K7(function(){function c(m){if(!u){if(u=!0,p=m,m=r(m),i!==void 0&&s.hasValue){var g=s.value;if(i(g,m))return d=g}return d=m}if(g=d,B7(p,m))return g;var v=r(m);return i!==void 0&&i(g,v)?(p=m,g):(p=m,d=v)}var u=!1,p,d,f=n===void 0?null:n;return[function(){return c(t())},f===null?void 0:function(){return c(f())}]},[t,n,r,i]);var l=F7(e,a[0],a[1]);return W7(function(){s.hasValue=!0,s.value=l},[l]),H7(l),l};function V7(e){e()}function q7(){let e=null,t=null;return{clear(){e=null,t=null},notify(){V7(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var Gk={notify(){},get:()=>[]};function Y7(e,t){let n,r=Gk,i=0,a=!1;function s(v){p();const x=r.subscribe(v);let y=!1;return()=>{y||(y=!0,x(),d())}}function l(){r.notify()}function c(){g.onStateChange&&g.onStateChange()}function u(){return a}function p(){i++,n||(n=e.subscribe(c),r=q7())}function d(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=Gk)}function f(){a||(a=!0,p())}function m(){a&&(a=!1,d())}const g={addNestedSub:s,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:u,trySubscribe:f,tryUnsubscribe:m,getListeners:()=>r};return g}var G7=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",X7=G7(),Q7=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Z7=Q7(),J7=()=>X7||Z7?h.useLayoutEffect:h.useEffect,eV=J7();function Xk(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function tV(e,t){if(Xk(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!Xk(e[n[i]],t[n[i]]))return!1;return!0}var Zg=Symbol.for("react-redux-context"),Jg=typeof globalThis<"u"?globalThis:{};function nV(){if(!h.createContext)return{};const e=Jg[Zg]??(Jg[Zg]=new Map);let t=e.get(h.createContext);return t||(t=h.createContext(null),e.set(h.createContext,t)),t}var rV=nV();function iV(e){const{children:t,context:n,serverState:r,store:i}=e,a=h.useMemo(()=>{const c=Y7(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),s=h.useMemo(()=>i.getState(),[i]);eV(()=>{const{subscription:c}=a;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),s!==i.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[a,s]);const l=n||rV;return h.createElement(l.Provider,{value:a},t)}var aV=iV,oV=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function sV(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Ss(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(oV.has(r)){if(e[r]==null&&t[r]==null)continue;if(!tV(e[r],t[r]))return!1}else if(!sV(e[r],t[r]))return!1;return!0}var lV=["contextPayload"];function fx(){return fx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fx.apply(null,arguments)}function cV(e,t){return fV(e)||pV(e,t)||dV(e,t)||uV()}function uV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
428
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dV(e,t){if(e){if(typeof e=="string")return Qk(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qk(e,t):void 0}}function Qk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pV(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function fV(e){if(Array.isArray(e))return e}function Zk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Il(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Zk(Object(n),!0).forEach(function(r){hV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hV(e,t,n){return(t=mV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mV(e){var t=gV(e,"string");return typeof t=="symbol"?t:t+""}function gV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yV(e,t){if(e==null)return{};var n,r,i=vV(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function vV(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function xV(e){return e.value}function bV(e){var t=e.contextPayload,n=yV(e,lV),r=XO(t,e.payloadUniqBy,xV),i=Il(Il({},n),{},{payload:r});return h.isValidElement(e.content)?h.cloneElement(e.content,i):typeof e.content=="function"?h.createElement(e.content,i):h.createElement(HW,i)}function wV(e,t,n,r,i,a){var s=t.layout,l=t.align,c=t.verticalAlign,u,p;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(l==="center"&&s==="vertical"?u={left:((r||0)-a.width)/2}:u=l==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(c==="middle"?p={top:((i||0)-a.height)/2}:p=c==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),Il(Il({},u),p)}function SV(e){var t=e.align,n=e.layout,r=e.verticalAlign,i=e.itemSorter,a=St();return h.useLayoutEffect(()=>{a(D7({align:t,layout:n,verticalAlign:r,itemSorter:i}))},[a,t,n,r,i]),null}function jV(e){var t=e.width,n=e.height,r=St();return h.useLayoutEffect(()=>{r(Yk({width:t,height:n}))},[r,t,n]),h.useLayoutEffect(()=>()=>{r(Yk({width:0,height:0}))},[r]),null}function kV(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var CV={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",labelStyle:{},layout:"horizontal",verticalAlign:"bottom"};function PV(e){var t=dn(e,CV),n=xK(),r=BU(),i=w7(),a=t.width,s=t.height,l=t.wrapperStyle,c=t.portal,u=aN([n]),p=cV(u,2),d=p[0],f=p[1],m=Pb(),g=Ab();if(m==null||g==null)return null;var v=m-((i==null?void 0:i.left)||0)-((i==null?void 0:i.right)||0),x=kV(t.layout,s,a,v),y=c?l:Il(Il({position:"absolute",width:(x==null?void 0:x.width)||a||"auto",height:(x==null?void 0:x.height)||s||"auto"},wV(l,t,i,m,g,d)),l),b=c??r;if(b==null||n==null)return null;var w=h.createElement("div",{className:"recharts-legend-wrapper",style:y,ref:f},h.createElement(SV,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&h.createElement(jV,{width:d.width,height:d.height}),h.createElement(bV,fx({},t,x,{margin:i,chartWidth:m,chartHeight:g,contextPayload:n})));return Fu.createPortal(w,b)}var nl=h.memo(PV,Ss);nl.displayName="Legend";function hx(){return hx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hx.apply(null,arguments)}function Jk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function mc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Jk(Object(n),!0).forEach(function(r){AV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AV(e,t,n){return(t=EV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EV(e){var t=TV(e,"string");return typeof t=="symbol"?t:t+""}function TV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function IV(e,t){return _V(e)||MV(e,t)||NV(e,t)||OV()}function OV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
429
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NV(e,t){if(e){if(typeof e=="string")return eC(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?eC(e,t):void 0}}function eC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function MV(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function _V(e){if(Array.isArray(e))return e}function RV(e){return Array.isArray(e)&&Bi(e[0])&&Bi(e[1])?e.join(" ~ "):e}var Os={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1};function DV(e,t){return t==null?e:qh(e,t)}var LV=e=>{var t=e.separator,n=t===void 0?Os.separator:t,r=e.contentStyle,i=e.itemStyle,a=e.labelStyle,s=a===void 0?Os.labelStyle:a,l=e.payload,c=e.formatter,u=e.itemSorter,p=e.wrapperClassName,d=e.labelClassName,f=e.label,m=e.labelFormatter,g=e.accessibilityLayer,v=g===void 0?Os.accessibilityLayer:g,x=()=>{if(l&&l.length){var E={padding:0,margin:0},D=DV(l,u),O=D.map((_,R)=>{if(!_||_.type==="none")return null;var X=_.formatter||c||RV,V=_.value,I=_.name,$=V,H=I;if(X){var N=X(V,I,_,R,l);if(Array.isArray(N)){var U=IV(N,2);$=U[0],H=U[1]}else if(N!=null)$=N;else return null}var P=mc(mc({},Os.itemStyle),{},{color:_.color||Os.itemStyle.color},i);return h.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(R),style:P},Bi(H)?h.createElement("span",{className:"recharts-tooltip-item-name"},H):null,Bi(H)?h.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,h.createElement("span",{className:"recharts-tooltip-item-value"},$),h.createElement("span",{className:"recharts-tooltip-item-unit"},_.unit||""))});return h.createElement("ul",{className:"recharts-tooltip-item-list",style:E},O)}return null},y=mc(mc({},Os.contentStyle),r),b=mc({margin:0},s),w=!$t(f),S=w?f:"",k=mt("recharts-default-tooltip",p),j=mt("recharts-tooltip-label",d);w&&m&&l!==void 0&&l!==null&&(S=m(f,l));var A=v?{role:"status","aria-live":"assertive"}:{};return h.createElement("div",hx({className:k,style:y},A),h.createElement("p",{className:j,style:b},h.isValidElement(S)?S:"".concat(S)),x())},gc="recharts-tooltip-wrapper",zV={visibility:"hidden"};function $V(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return mt(gc,{["".concat(gc,"-right")]:Ce(n)&&t&&Ce(t.x)&&n>=t.x,["".concat(gc,"-left")]:Ce(n)&&t&&Ce(t.x)&&n<t.x,["".concat(gc,"-bottom")]:Ce(r)&&t&&Ce(t.y)&&r>=t.y,["".concat(gc,"-top")]:Ce(r)&&t&&Ce(t.y)&&r<t.y})}function tC(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offset,a=e.position,s=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(a&&Ce(a[r]))return a[r];var p=n[r]-l-(i>0?i:0),d=n[r]+i;if(t[r])return s[r]?p:d;var f=c[r];if(f==null)return 0;if(s[r]){var m=p,g=f;return m<g?Math.max(d,f):Math.max(p,f)}if(u==null)return 0;var v=d+l,x=f+u;return v>x?Math.max(p,f):Math.max(d,f)}function BV(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function FV(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTop,i=e.offsetLeft,a=e.position,s=e.reverseDirection,l=e.tooltipBox,c=e.useTranslate3d,u=e.viewBox,p,d,f;return l.height>0&&l.width>0&&n?(d=tC({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:s,tooltipDimension:l.width,viewBox:u,viewBoxDimension:u.width}),f=tC({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:s,tooltipDimension:l.height,viewBox:u,viewBoxDimension:u.height}),p=BV({translateX:d,translateY:f,useTranslate3d:c})):p=zV,{cssProperties:p,cssClasses:$V({translateX:d,translateY:f,coordinate:n})}}var UV=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),nd={isSsr:UV()};function WV(e,t){return qV(e)||VV(e,t)||HV(e,t)||KV()}function KV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
430
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HV(e,t){if(e){if(typeof e=="string")return nC(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nC(e,t):void 0}}function nC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function VV(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function qV(e){if(Array.isArray(e))return e}function nM(){var e=h.useState(()=>nd.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches),t=WV(e,2),n=t[0],r=t[1];return h.useEffect(()=>{if(window.matchMedia){var i=window.matchMedia("(prefers-reduced-motion: reduce)"),a=()=>{r(i.matches)};return i.addEventListener("change",a),()=>{i.removeEventListener("change",a)}}},[]),n}function rC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ns(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rC(Object(n),!0).forEach(function(r){YV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YV(e,t,n){return(t=GV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GV(e){var t=XV(e,"string");return typeof t=="symbol"?t:t+""}function XV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function QV(e,t){return tq(e)||eq(e,t)||JV(e,t)||ZV()}function ZV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
431
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JV(e,t){if(e){if(typeof e=="string")return iC(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?iC(e,t):void 0}}function iC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function eq(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function tq(e){if(Array.isArray(e))return e}function nq(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active){var t=typeof e.animationEasing=="string"?e.animationEasing:"ease";return"transform ".concat(e.animationDuration,"ms ").concat(t)}}function rq(e){var t,n,r,i,a,s,l=nM(),c=h.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}})),u=QV(c,2),p=u[0],d=u[1];h.useEffect(()=>{var y=b=>{if(b.key==="Escape"){var w,S,k,j;d({dismissed:!0,dismissedAtCoordinate:{x:(w=(S=e.coordinate)===null||S===void 0?void 0:S.x)!==null&&w!==void 0?w:0,y:(k=(j=e.coordinate)===null||j===void 0?void 0:j.y)!==null&&k!==void 0?k:0}})}};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),p.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==p.dismissedAtCoordinate.x||((a=(s=e.coordinate)===null||s===void 0?void 0:s.y)!==null&&a!==void 0?a:0)!==p.dismissedAtCoordinate.y)&&d(Ns(Ns({},p),{},{dismissed:!1}));var f=FV({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),m=f.cssClasses,g=f.cssProperties,v=e.hasPortalFromProps?{}:Ns(Ns({transition:nq({prefersReducedMotion:l,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},g),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),x=Ns(Ns({},v),{},{visibility:!p.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return h.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:m,style:x,ref:e.innerRef},e.children)}var iq=h.memo(rq),rM=()=>{var e;return(e=Te(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function mx(){return mx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mx.apply(null,arguments)}function aC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function oC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aC(Object(n),!0).forEach(function(r){aq(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aq(e,t,n){return(t=oq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oq(e){var t=sq(e,"string");return typeof t=="symbol"?t:t+""}function sq(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var sC={curveBasisClosed:aW,curveBasisOpen:oW,curveBasis:iW,curveBumpX:KU,curveBumpY:HU,curveLinearClosed:sW,curveLinear:Kh,curveMonotoneX:lW,curveMonotoneY:cW,curveNatural:uW,curveStep:dW,curveStepAfter:fW,curveStepBefore:pW},zf=e=>Je(e.x)&&Je(e.y),lC=e=>e.base!=null&&zf(e.base)&&zf(e),yc=e=>e.x,vc=e=>e.y,lq=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(qu(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=sC["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return sC[n]||Kh},cC={connectNulls:!1,type:"linear"},cq=e=>{var t=e.type,n=t===void 0?cC.type:t,r=e.points,i=r===void 0?[]:r,a=e.baseLine,s=e.layout,l=e.connectNulls,c=l===void 0?cC.connectNulls:l,u=lq(n,s),p=c?i.filter(zf):i;if(Array.isArray(a)){var d,f=i.map((y,b)=>oC(oC({},y),{},{base:a[b]}));s==="vertical"?d=Vd().y(vc).x1(yc).x0(y=>y.base.x):d=Vd().x(yc).y1(vc).y0(y=>y.base.y);var m=d.defined(lC).curve(u),g=c?f.filter(lC):f;return m(g)}var v;s==="vertical"&&Ce(a)?v=Vd().y(vc).x1(yc).x0(a):Ce(a)?v=Vd().x(yc).y1(vc).y0(a):v=bO().x(yc).y(vc);var x=v.defined(zf).curve(u);return x(p)},fl=e=>{var t=e.className,n=e.points,r=e.path,i=e.pathRef,a=go();if((!n||!n.length)&&!r)return null;var s={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},l=n&&n.length?cq(s):r;return h.createElement("path",mx({},er(e),hb(e),{className:mt("recharts-curve",t),d:l===null?void 0:l,ref:i}))},uq=["x","y","top","left","width","height","className"];function gx(){return gx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gx.apply(null,arguments)}function uC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function dq(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uC(Object(n),!0).forEach(function(r){pq(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pq(e,t,n){return(t=fq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fq(e){var t=hq(e,"string");return typeof t=="symbol"?t:t+""}function hq(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mq(e,t){if(e==null)return{};var n,r,i=gq(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function gq(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var yq=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),vq=e=>{var t=e.x,n=t===void 0?0:t,r=e.y,i=r===void 0?0:r,a=e.top,s=a===void 0?0:a,l=e.left,c=l===void 0?0:l,u=e.width,p=u===void 0?0:u,d=e.height,f=d===void 0?0:d,m=e.className,g=mq(e,uq),v=dq({x:n,y:i,top:s,left:c,width:p,height:f},g);return!Ce(n)||!Ce(i)||!Ce(p)||!Ce(f)||!Ce(s)||!Ce(c)?null:h.createElement("path",gx({},mr(v),{className:mt("recharts-cross",m),d:yq(n,i,p,f,s,c)}))};function xq(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}var $f=1e-4,iM=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],aM=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),dC=(e,t)=>n=>{var r=iM(e,t);return aM(r,n)},bq=(e,t)=>n=>{var r=iM(e,t),i=[...r.map((a,s)=>a*s).slice(1),0];return aM(i,n)},wq=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var r=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(r==null||r.length!==4)return null;var i=r.map(a=>parseFloat(a));return[i[0],i[1],i[2],i[3]]},Sq=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(n.length===1)switch(n[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=wq(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},jq=(e,t,n,r)=>{var i=dC(e,n),a=dC(t,r),s=bq(e,n),l=u=>u>1?1:u<0?0:u,c=u=>{for(var p=u>1?1:u,d=p,f=0;f<8;++f){var m=i(d)-p,g=s(d);if(Math.abs(m-p)<$f||g<$f)return a(d);d=l(d-m/g)}return a(d)};return c.isStepper=!1,c},pC=function(){return jq(...Sq(...arguments))},kq=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,i=t.damping,a=i===void 0?8:i,s=t.dt,l=s===void 0?16.67:s,c=1,u=[0],p=0,d=0,f=1e4,m=0;m<f;){var g=-(p-c)*r,v=d*a;if(d+=(g-v)*l/1e3,p+=d*l/1e3,u.push(p),Math.abs(p-c)<$f&&Math.abs(d)<$f)break;m++}u[u.length-1]=c;var x=u.length-1;return y=>{var b,w,S;if(y<=0)return 0;if(y>=1)return c;var k=y*x,j=Math.floor(k),A=k-j;return((b=u[j])!==null&&b!==void 0?b:0)+(((w=u[j+1])!==null&&w!==void 0?w:0)-((S=u[j])!==null&&S!==void 0?S:0))*A}},Cq=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return pC(e);case"spring":return kq();default:if(e.split("(")[0]==="cubic-bezier")return pC(e)}return typeof e=="function"?e:null},Pq=(e,t,n)=>{var r,i=a=>{var s=t.tick(a);if(t.getState()==="active"){if(n(t.getInterpolated()),t.getProgress()===1){t.complete(),r=void 0;return}r=e.setTimeout(i,s);return}r=e.setTimeout(i,s)};return r=e.setTimeout(i,0),()=>{var a;return(a=r)===null||a===void 0?void 0:a()}},oM=h.createContext(Pq);oM.Provider;function Aq(e){var t=h.useContext(oM);return h.useMemo(()=>e??t,[e,t])}function Eq(e,t,n){return(t=Tq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tq(e){var t=Iq(e,"string");return typeof t=="symbol"?t:t+""}function Iq(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var fC="init",hC="pending",mC="active",Oq="completed";function ey(e){return Math.max(0,e)}class Nq{getAnimationStartedTime(){return this.animationStartedTime}getBeginStartedTime(){return this.beginStartedTime}constructor(t){var n;Eq(this,"state",fC),this.animationId=t.animationId,this.onAnimationEnd=t.onAnimationEnd,this.animationDuration=ey(t.animationDuration),this.animationBegin=ey(t.animationBegin),this.progress=0,this.from=t.from,this.to=t.to,this.easing=t.easing,(n=t.onAnimationStart)===null||n===void 0||n.call(t)}getState(){return this.state}getEasing(){return this.easing}getAnimationDuration(){return this.animationDuration}tick(t){if(this.getState()===fC)return this.state=hC,this.beginStartedTime=t,this.animationBegin;if(this.getState()===hC){if(this.beginStartedTime==null)throw new Error;var n=t-this.beginStartedTime;return n>=this.animationBegin?(this.state=mC,this.animationStartedTime=t,this.nextAnimationUpdate(0)):ey(this.animationBegin-n)}if(this.getState()===mC){if(this.animationStartedTime==null)throw new Error;var r=t-this.animationStartedTime;return this.setProgress(r/this.animationDuration),this.nextAnimationUpdate(r)}return 0}setProgress(t){this.progress=Math.min(1,Math.max(0,t))}getProgress(){return this.progress}complete(){if(this.progress=1,this.state==="active"){var t;(t=this.onAnimationEnd)===null||t===void 0||t.call(this)}this.state=Oq}getFrom(){return this.from}getTo(){return this.to}getAnimationId(){return this.animationId}getAnimationBegin(){return this.animationBegin}}class Mq extends Nq{nextAnimationUpdate(){return 0}getInterpolated(){return this.easing(Ot(this.getFrom(),this.getTo(),this.getProgress()))}}class _q{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=s=>{s-r>=n?t(s):i=requestAnimationFrame(a)};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function Rq(e,t){return $q(e)||zq(e,t)||Lq(e,t)||Dq()}function Dq(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
432
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lq(e,t){if(e){if(typeof e=="string")return gC(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gC(e,t):void 0}}function gC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function zq(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function $q(e){if(Array.isArray(e))return e}var Bq={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},yC=0,ty=1;function sM(e){var t=dn(e,Bq),n=t.animationId,r=t.isActive,i=t.canBegin,a=t.duration,s=t.easing,l=t.begin,c=t.onAnimationEnd,u=t.onAnimationStart,p=t.children,d=nM(),f=r==="auto"?!nd.isSsr&&!d:r,m=Aq(t.animationController),g=h.useState(f?yC:ty),v=Rq(g,2),x=v[0],y=v[1];return h.useEffect(()=>{f||y(ty)},[f]),h.useEffect(()=>{var b=Cq(s);if(!f||!i||b==null)return ho;var w=new _q,S=new Mq({animationId:n,easing:b,animationDuration:a,animationBegin:l,onAnimationStart:u,onAnimationEnd:c,from:yC,to:ty});return m(w,S,y)},[m,n,f,i,a,s,l,u,c]),p(Number(x))}function lM(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=h.useRef(bu(t)),r=h.useRef(e);return r.current!==e&&(n.current=bu(t),r.current=e),n.current}var Fq=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),Uq=(e,t,n)=>e.map(r=>"".concat(Fq(r)," ").concat(t,"ms ").concat(n)).join(","),Wq=["radius"],Kq=["radius"],vC,xC,bC,wC,SC,jC,kC,CC,PC,AC;function EC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function TC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EC(Object(n),!0).forEach(function(r){Hq(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hq(e,t,n){return(t=Vq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vq(e){var t=qq(e,"string");return typeof t=="symbol"?t:t+""}function qq(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bf(){return Bf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bf.apply(null,arguments)}function IC(e,t){if(e==null)return{};var n,r,i=Yq(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Yq(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Gq(e,t){return Jq(e)||Zq(e,t)||Qq(e,t)||Xq()}function Xq(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
433
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qq(e,t){if(e){if(typeof e=="string")return OC(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?OC(e,t):void 0}}function OC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Zq(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Jq(e){if(Array.isArray(e))return e}function xi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var NC=(e,t,n,r,i)=>{var a=oa(n),s=oa(r),l=Math.min(Math.abs(a)/2,Math.abs(s)/2),c=s>=0?1:-1,u=a>=0?1:-1,p=s>=0&&a>=0||s<0&&a<0?1:0,d;if(l>0&&Array.isArray(i)){for(var f=[0,0,0,0],m=0,g=4;m<g;m++){var v,x=(v=i[m])!==null&&v!==void 0?v:0;f[m]=x>l?l:x}d=Rn(vC||(vC=xi(["M",",",""])),e,t+c*f[0]),f[0]>0&&(d+=Rn(xC||(xC=xi(["A ",",",",0,0,",",",",",""])),f[0],f[0],p,e+u*f[0],t)),d+=Rn(bC||(bC=xi(["L ",",",""])),e+n-u*f[1],t),f[1]>0&&(d+=Rn(wC||(wC=xi(["A ",",",",0,0,",`,
|
|
434
|
+
`,",",""])),f[1],f[1],p,e+n,t+c*f[1])),d+=Rn(SC||(SC=xi(["L ",",",""])),e+n,t+r-c*f[2]),f[2]>0&&(d+=Rn(jC||(jC=xi(["A ",",",",0,0,",`,
|
|
435
|
+
`,",",""])),f[2],f[2],p,e+n-u*f[2],t+r)),d+=Rn(kC||(kC=xi(["L ",",",""])),e+u*f[3],t+r),f[3]>0&&(d+=Rn(CC||(CC=xi(["A ",",",",0,0,",`,
|
|
436
|
+
`,",",""])),f[3],f[3],p,e,t+r-c*f[3])),d+="Z"}else if(l>0&&i===+i&&i>0){var y=Math.min(l,i);d=Rn(PC||(PC=xi(["M ",",",`
|
|
437
|
+
A `,",",",0,0,",",",",",`
|
|
438
|
+
L `,",",`
|
|
439
|
+
A `,",",",0,0,",",",",",`
|
|
440
|
+
L `,",",`
|
|
441
|
+
A `,",",",0,0,",",",",",`
|
|
442
|
+
L `,",",`
|
|
443
|
+
A `,",",",0,0,",",",","," Z"])),e,t+c*y,y,y,p,e+u*y,t,e+n-u*y,t,y,y,p,e+n,t+c*y,e+n,t+r-c*y,y,y,p,e+n-u*y,t+r,e+u*y,t+r,y,y,p,e,t+r-c*y)}else d=Rn(AC||(AC=xi(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return d},MC={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},cM=e=>{var t=dn(e,MC),n=h.useRef(null),r=h.useState(-1),i=Gq(r,2),a=i[0],s=i[1];h.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var N=n.current.getTotalLength();N&&s(N)}catch{}},[]);var l=t.x,c=t.y,u=t.width,p=t.height,d=t.radius,f=t.className,m=t.animationEasing,g=t.animationDuration,v=t.animationBegin,x=t.isAnimationActive,y=t.isUpdateAnimationActive,b=h.useRef(u),w=h.useRef(p),S=h.useRef(l),k=h.useRef(c),j=h.useMemo(()=>({x:l,y:c,width:u,height:p,radius:d}),[l,c,u,p,d]),A=lM(j,"rectangle-");if(l!==+l||c!==+c||u!==+u||p!==+p||u===0||p===0)return null;var E=mt("recharts-rectangle",f);if(!y){var D=mr(t);D.radius;var O=IC(D,Wq);return h.createElement("path",Bf({},O,{x:oa(l),y:oa(c),width:oa(u),height:oa(p),radius:typeof d=="number"?d:void 0,className:E,d:NC(l,c,u,p,d)}))}var _=b.current,R=w.current,X=S.current,V=k.current,I="0px ".concat(a===-1?1:a,"px"),$="".concat(a,"px ").concat(a,"px"),H=Uq(["strokeDasharray"],g,typeof m=="string"?m:MC.animationEasing);return h.createElement(sM,{animationId:A,key:A,canBegin:a>0,duration:g,easing:m,isActive:y,begin:v},N=>{var U=Ot(_,u,N),P=Ot(R,p,N),W=Ot(X,l,N),se=Ot(V,c,N);n.current&&(b.current=U,w.current=P,S.current=W,k.current=se);var T;x?N>0?T={transition:H,strokeDasharray:$}:T={strokeDasharray:I}:T={strokeDasharray:$};var he=mr(t);he.radius;var ye=IC(he,Kq);return h.createElement("path",Bf({},ye,{radius:typeof d=="number"?d:void 0,className:E,d:NC(W,se,U,P,d),ref:n,style:TC(TC({},T),t.style)}))})};function _C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function RC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_C(Object(n),!0).forEach(function(r){eY(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_C(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eY(e,t,n){return(t=tY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tY(e){var t=nY(e,"string");return typeof t=="symbol"?t:t+""}function nY(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ff=Math.PI/180,rY=e=>e*180/Math.PI,cn=(e,t,n,r)=>({x:e+Math.cos(-Ff*r)*n,y:t+Math.sin(-Ff*r)*n}),uM=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},iY=(e,t)=>{var n=e.x,r=e.y,i=t.x,a=t.y;return Math.sqrt((n-i)**2+(r-a)**2)},aY=(e,t)=>{var n=e.x,r=e.y,i=t.cx,a=t.cy,s=iY({x:n,y:r},{x:i,y:a});if(s<=0)return{radius:s,angle:0};var l=(n-i)/s,c=Math.acos(l);return r>a&&(c=2*Math.PI-c),{radius:s,angle:rY(c),angleInRadian:c}},oY=e=>{var t=e.startAngle,n=e.endAngle,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},sY=(e,t)=>{var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),a=Math.floor(r/360),s=Math.min(i,a);return e+s*360},lY=(e,t)=>{var n=e.relativeX,r=e.relativeY,i=aY({x:n,y:r},t),a=i.radius,s=i.angle,l=t.innerRadius,c=t.outerRadius;if(a<l||a>c||a===0)return null;var u=oY(t),p=u.startAngle,d=u.endAngle,f=s,m;if(p<=d){for(;f>d;)f-=360;for(;f<p;)f+=360;m=f>=p&&f<=d}else{for(;f>p;)f-=360;for(;f<d;)f+=360;m=f>=d&&f<=p}return m?RC(RC({},t),{},{radius:a,angle:sY(f,t)}):null};function dM(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle,s=cn(t,n,r,i),l=cn(t,n,r,a);return{points:[s,l],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var DC,LC,zC,$C,BC,FC,UC;function yx(){return yx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yx.apply(null,arguments)}function Uo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var cY=(e,t)=>{var n=jn(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},ep=e=>{var t=e.cx,n=e.cy,r=e.radius,i=e.angle,a=e.sign,s=e.isExternal,l=e.cornerRadius,c=e.cornerIsExternal,u=l*(s?1:-1)+r,p=Math.asin(l/u)/Ff,d=c?i:i+a*p,f=cn(t,n,u,d),m=cn(t,n,r,d),g=c?i-a*p:i,v=cn(t,n,u*Math.cos(p*Ff),g);return{center:f,circleTangency:m,lineTangency:v,theta:p}},pM=e=>{var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.startAngle,s=e.endAngle,l=cY(a,s),c=a+l,u=cn(t,n,i,a),p=cn(t,n,i,c),d=Rn(DC||(DC=Uo(["M ",",",`
|
|
444
|
+
A `,",",`,0,
|
|
445
|
+
`,",",`,
|
|
446
|
+
`,",",`
|
|
447
|
+
`])),u.x,u.y,i,i,+(Math.abs(l)>180),+(a>c),p.x,p.y);if(r>0){var f=cn(t,n,r,a),m=cn(t,n,r,c);d+=Rn(LC||(LC=Uo(["L ",",",`
|
|
448
|
+
A `,",",`,0,
|
|
449
|
+
`,",",`,
|
|
450
|
+
`,","," Z"])),m.x,m.y,r,r,+(Math.abs(l)>180),+(a<=c),f.x,f.y)}else d+=Rn(zC||(zC=Uo(["L ",","," Z"])),t,n);return d},uY=e=>{var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.cornerRadius,s=e.forceCornerRadius,l=e.cornerIsExternal,c=e.startAngle,u=e.endAngle,p=jn(u-c),d=ep({cx:t,cy:n,radius:i,angle:c,sign:p,cornerRadius:a,cornerIsExternal:l}),f=d.circleTangency,m=d.lineTangency,g=d.theta,v=ep({cx:t,cy:n,radius:i,angle:u,sign:-p,cornerRadius:a,cornerIsExternal:l}),x=v.circleTangency,y=v.lineTangency,b=v.theta,w=l?Math.abs(c-u):Math.abs(c-u)-g-b;if(w<0)return s?Rn($C||($C=Uo(["M ",",",`
|
|
451
|
+
a`,",",",0,0,1,",`,0
|
|
452
|
+
a`,",",",0,0,1,",`,0
|
|
453
|
+
`])),m.x,m.y,a,a,a*2,a,a,-a*2):pM({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:u});var S=Rn(BC||(BC=Uo(["M ",",",`
|
|
454
|
+
A`,",",",0,0,",",",",",`
|
|
455
|
+
A`,",",",0,",",",",",",",`
|
|
456
|
+
A`,",",",0,0,",",",",",`
|
|
457
|
+
`])),m.x,m.y,a,a,+(p<0),f.x,f.y,i,i,+(w>180),+(p<0),x.x,x.y,a,a,+(p<0),y.x,y.y);if(r>0){var k=ep({cx:t,cy:n,radius:r,angle:c,sign:p,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),j=k.circleTangency,A=k.lineTangency,E=k.theta,D=ep({cx:t,cy:n,radius:r,angle:u,sign:-p,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),O=D.circleTangency,_=D.lineTangency,R=D.theta,X=l?Math.abs(c-u):Math.abs(c-u)-E-R;if(X<0&&a===0)return"".concat(S,"L").concat(t,",").concat(n,"Z");S+=Rn(FC||(FC=Uo(["L",",",`
|
|
458
|
+
A`,",",",0,0,",",",",",`
|
|
459
|
+
A`,",",",0,",",",",",",",`
|
|
460
|
+
A`,",",",0,0,",",",",","Z"])),_.x,_.y,a,a,+(p<0),O.x,O.y,r,r,+(X>180),+(p>0),j.x,j.y,a,a,+(p<0),A.x,A.y)}else S+=Rn(UC||(UC=Uo(["L",",","Z"])),t,n);return S},dY={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},fM=e=>{var t=dn(e,dY),n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,s=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,p=t.endAngle,d=t.className;if(a<i||u===p)return null;var f=mt("recharts-sector",d),m=a-i,g=Hn(s,m,0,!0),v;return g>0&&Math.abs(u-p)<360?v=uY({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(g,m/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:p}):v=pM({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:u,endAngle:p}),h.createElement("path",yx({},mr(t),{className:f,d:v}))};function pY(e,t,n){if(e==="horizontal")return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e==="vertical")return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(LO(t)){if(e==="centric"){var r=t.cx,i=t.cy,a=t.innerRadius,s=t.outerRadius,l=t.angle,c=cn(r,i,a,l),u=cn(r,i,s,l);return[{x:c.x,y:c.y},{x:u.x,y:u.y}]}return dM(t)}}function fY(e){return rN(e)?NaN:Number(e)}function ny(e){return e?(e=fY(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function hM(e,t,n){n&&typeof n!="number"&&Xv(e,t,n)&&(t=n=void 0),e=ny(e),t===void 0?(t=e,e=0):t=ny(t),n=n===void 0?e<t?1:-1:ny(n);const r=Math.max(Math.ceil((t-e)/(n||1)),0),i=new Array(r);for(let a=0;a<r;a++)i[a]=e,e+=n;return i}var hi=e=>e.chartData,rd=G([hi],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),id=(e,t,n,r)=>r?rd(e):hi(e),mM=(e,t,n)=>n?rd(e):hi(e),hY=G([id],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t!=null?t.slice(n,r+1):[]}),mY=G([rd],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t!=null?t.slice(n,r+1):[]}),gY=G([hi],e=>{var t=e.chartData,n=e.dataStartIndex,r=e.dataEndIndex;return t!=null?t.slice(n,r+1):[]});function Nb(e,t){return bY(e)||xY(e,t)||vY(e,t)||yY()}function yY(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
461
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vY(e,t){if(e){if(typeof e=="string")return WC(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?WC(e,t):void 0}}function WC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function xY(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function bY(e){if(Array.isArray(e))return e}function Di(e){if(Array.isArray(e)&&e.length===2){var t=Nb(e,2),n=t[0],r=t[1];if(Je(n)&&Je(r))return!0}return!1}function KC(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function gM(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var n=Nb(e,2),r=n[0],i=n[1],a,s;if(Je(r))a=r;else if(typeof r=="function")return;if(Je(i))s=i;else if(typeof i=="function")return;var l=[a,s];if(Di(l))return l}}function wY(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(Di(r))return KC(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var i=Nb(e,2),a=i[0],s=i[1],l,c;if(a==="auto")t!=null&&(l=Math.min(...t));else if(Ce(a))l=a;else if(typeof a=="function")try{t!=null&&(l=a(t==null?void 0:t[0]))}catch{}else if(typeof a=="string"&&Rk.test(a)){var u=Rk.exec(a);if(u==null||u[1]==null||t==null)l=void 0;else{var p=+u[1];l=t[0]-p}}else l=t==null?void 0:t[0];if(s==="auto")t!=null&&(c=Math.max(...t));else if(Ce(s))c=s;else if(typeof s=="function")try{t!=null&&(c=s(t==null?void 0:t[1]))}catch{}else if(typeof s=="string"&&Dk.test(s)){var d=Dk.exec(s);if(d==null||d[1]==null||t==null)c=void 0;else{var f=+d[1];c=t[1]+f}}else c=t==null?void 0:t[1];var m=[l,c];if(Di(m))return t==null?m:KC(m,t,n)}}}var Hl=1e9,SY={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},_b,Wt=!0,qr="[DecimalError] ",Jo=qr+"Invalid argument: ",Mb=qr+"Exponent out of range: ",Vl=Math.floor,Mo=Math.pow,jY=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,br,wn=1e7,Lt=7,yM=9007199254740991,Uf=Vl(yM/Lt),Me={};Me.absoluteValue=Me.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Me.comparedTo=Me.cmp=function(e){var t,n,r,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(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};Me.decimalPlaces=Me.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Lt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Me.dividedBy=Me.div=function(e){return ua(this,new this.constructor(e))};Me.dividedToIntegerBy=Me.idiv=function(e){var t=this,n=t.constructor;return At(ua(t,new n(e),0,1),n.precision)};Me.equals=Me.eq=function(e){return!this.cmp(e)};Me.exponent=function(){return un(this)};Me.greaterThan=Me.gt=function(e){return this.cmp(e)>0};Me.greaterThanOrEqualTo=Me.gte=function(e){return this.cmp(e)>=0};Me.isInteger=Me.isint=function(){return this.e>this.d.length-2};Me.isNegative=Me.isneg=function(){return this.s<0};Me.isPositive=Me.ispos=function(){return this.s>0};Me.isZero=function(){return this.s===0};Me.lessThan=Me.lt=function(e){return this.cmp(e)<0};Me.lessThanOrEqualTo=Me.lte=function(e){return this.cmp(e)<1};Me.logarithm=Me.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(br))throw Error(qr+"NaN");if(n.s<1)throw Error(qr+(n.s?"NaN":"-Infinity"));return n.eq(br)?new r(0):(Wt=!1,t=ua(Au(n,a),Au(e,a),a),Wt=!0,At(t,i))};Me.minus=Me.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?bM(t,e):vM(t,(e.s=-e.s,e))};Me.modulo=Me.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(qr+"NaN");return n.s?(Wt=!1,t=ua(n,e,0,1).times(e),Wt=!0,n.minus(t)):At(new r(n),i)};Me.naturalExponential=Me.exp=function(){return xM(this)};Me.naturalLogarithm=Me.ln=function(){return Au(this)};Me.negated=Me.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Me.plus=Me.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?vM(t,e):bM(t,(e.s=-e.s,e))};Me.precision=Me.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Jo+e);if(t=un(i)+1,r=i.d.length-1,n=r*Lt+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Me.squareRoot=Me.sqrt=function(){var e,t,n,r,i,a,s,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(qr+"NaN")}for(e=un(l),Wt=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=Mi(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Vl((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),r=new c(t)):r=new c(i.toString()),n=c.precision,i=s=n+3;;)if(a=r,r=a.plus(ua(l,a,s+2)).times(.5),Mi(a.d).slice(0,s)===(t=Mi(r.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(At(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;s+=4}return Wt=!0,At(r,n)};Me.times=Me.mul=function(e){var t,n,r,i,a,s,l,c,u,p=this,d=p.constructor,f=p.d,m=(e=new d(e)).d;if(!p.s||!e.s)return new d(0);for(e.s*=p.s,n=p.e+e.e,c=f.length,u=m.length,c<u&&(a=f,f=m,m=a,s=c,c=u,u=s),a=[],s=c+u,r=s;r--;)a.push(0);for(r=u;--r>=0;){for(t=0,i=c+r;i>r;)l=a[i]+m[r]*f[i-r-1]+t,a[i--]=l%wn|0,t=l/wn|0;a[i]=(a[i]+t)%wn|0}for(;!a[--s];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,Wt?At(e,d.precision):e};Me.toDecimalPlaces=Me.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Ui(e,0,Hl),t===void 0?t=r.rounding:Ui(t,0,8),At(n,e+un(n)+1,t))};Me.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=hs(r,!0):(Ui(e,0,Hl),t===void 0?t=i.rounding:Ui(t,0,8),r=At(new i(r),e+1,t),n=hs(r,!0,e+1)),n};Me.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?hs(i):(Ui(e,0,Hl),t===void 0?t=a.rounding:Ui(t,0,8),r=At(new a(i),e+un(i)+1,t),n=hs(r.abs(),!1,e+un(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Me.toInteger=Me.toint=function(){var e=this,t=e.constructor;return At(new t(e),un(e)+1,t.rounding)};Me.toNumber=function(){return+this};Me.toPower=Me.pow=function(e){var t,n,r,i,a,s,l=this,c=l.constructor,u=12,p=+(e=new c(e));if(!e.s)return new c(br);if(l=new c(l),!l.s){if(e.s<1)throw Error(qr+"Infinity");return l}if(l.eq(br))return l;if(r=c.precision,e.eq(br))return At(l,r);if(t=e.e,n=e.d.length-1,s=t>=n,a=l.s,s){if((n=p<0?-p:p)<=yM){for(i=new c(br),t=Math.ceil(r/Lt+4),Wt=!1;n%2&&(i=i.times(l),VC(i.d,t)),n=Vl(n/2),n!==0;)l=l.times(l),VC(l.d,t);return Wt=!0,e.s<0?new c(br).div(i):At(i,r)}}else if(a<0)throw Error(qr+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,Wt=!1,i=e.times(Au(l,r+u)),Wt=!0,i=xM(i),i.s=a,i};Me.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=un(i),r=hs(i,n<=a.toExpNeg||n>=a.toExpPos)):(Ui(e,1,Hl),t===void 0?t=a.rounding:Ui(t,0,8),i=At(new a(i),e,t),n=un(i),r=hs(i,e<=n||n<=a.toExpNeg,e)),r};Me.toSignificantDigits=Me.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Ui(e,1,Hl),t===void 0?t=r.rounding:Ui(t,0,8)),At(new r(n),e,t)};Me.toString=Me.valueOf=Me.val=Me.toJSON=Me[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=un(e),n=e.constructor;return hs(e,t<=n.toExpNeg||t>=n.toExpPos)};function vM(e,t){var n,r,i,a,s,l,c,u,p=e.constructor,d=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),Wt?At(t,d):t;if(c=e.d,u=t.d,s=e.e,i=t.e,c=c.slice(),a=s-i,a){for(a<0?(r=c,a=-a,l=u.length):(r=u,i=s,l=c.length),s=Math.ceil(d/Lt),l=s>l?s+1:l+1,a>l&&(a=l,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(l=c.length,a=u.length,l-a<0&&(a=l,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/wn|0,c[a]%=wn;for(n&&(c.unshift(n),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,Wt?At(t,d):t}function Ui(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Jo+e)}function Mi(e){var t,n,r,i=e.length-1,a="",s=e[0];if(i>0){for(a+=s,t=1;t<i;t++)r=e[t]+"",n=Lt-r.length,n&&(a+=$a(n)),a+=r;s=e[t],r=s+"",n=Lt-r.length,n&&(a+=$a(n))}else if(s===0)return"0";for(;s%10===0;)s/=10;return a+s}var ua=function(){function e(r,i){var a,s=0,l=r.length;for(r=r.slice();l--;)a=r[l]*i+s,r[l]=a%wn|0,s=a/wn|0;return s&&r.unshift(s),r}function t(r,i,a,s){var l,c;if(a!=s)c=a>s?1:-1;else for(l=c=0;l<a;l++)if(r[l]!=i[l]){c=r[l]>i[l]?1:-1;break}return c}function n(r,i,a){for(var s=0;a--;)r[a]-=s,s=r[a]<i[a]?1:0,r[a]=s*wn+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,s){var l,c,u,p,d,f,m,g,v,x,y,b,w,S,k,j,A,E,D=r.constructor,O=r.s==i.s?1:-1,_=r.d,R=i.d;if(!r.s)return new D(r);if(!i.s)throw Error(qr+"Division by zero");for(c=r.e-i.e,A=R.length,k=_.length,m=new D(O),g=m.d=[],u=0;R[u]==(_[u]||0);)++u;if(R[u]>(_[u]||0)&&--c,a==null?b=a=D.precision:s?b=a+(un(r)-un(i))+1:b=a,b<0)return new D(0);if(b=b/Lt+2|0,u=0,A==1)for(p=0,R=R[0],b++;(u<k||p)&&b--;u++)w=p*wn+(_[u]||0),g[u]=w/R|0,p=w%R|0;else{for(p=wn/(R[0]+1)|0,p>1&&(R=e(R,p),_=e(_,p),A=R.length,k=_.length),S=A,v=_.slice(0,A),x=v.length;x<A;)v[x++]=0;E=R.slice(),E.unshift(0),j=R[0],R[1]>=wn/2&&++j;do p=0,l=t(R,v,A,x),l<0?(y=v[0],A!=x&&(y=y*wn+(v[1]||0)),p=y/j|0,p>1?(p>=wn&&(p=wn-1),d=e(R,p),f=d.length,x=v.length,l=t(d,v,f,x),l==1&&(p--,n(d,A<f?E:R,f))):(p==0&&(l=p=1),d=R.slice()),f=d.length,f<x&&d.unshift(0),n(v,d,x),l==-1&&(x=v.length,l=t(R,v,A,x),l<1&&(p++,n(v,A<x?E:R,x))),x=v.length):l===0&&(p++,v=[0]),g[u++]=p,l&&v[0]?v[x++]=_[S]||0:(v=[_[S]],x=1);while((S++<k||v[0]!==void 0)&&b--)}return g[0]||g.shift(),m.e=c,At(m,s?a+un(m)+1:a)}}();function xM(e,t){var n,r,i,a,s,l,c=0,u=0,p=e.constructor,d=p.precision;if(un(e)>16)throw Error(Mb+un(e));if(!e.s)return new p(br);for(Wt=!1,l=d,s=new p(.03125);e.abs().gte(.1);)e=e.times(s),u+=5;for(r=Math.log(Mo(2,u))/Math.LN10*2+5|0,l+=r,n=i=a=new p(br),p.precision=l;;){if(i=At(i.times(e),l),n=n.times(++c),s=a.plus(ua(i,n,l)),Mi(s.d).slice(0,l)===Mi(a.d).slice(0,l)){for(;u--;)a=At(a.times(a),l);return p.precision=d,t==null?(Wt=!0,At(a,d)):a}a=s}}function un(e){for(var t=e.e*Lt,n=e.d[0];n>=10;n/=10)t++;return t}function ry(e,t,n){if(t>e.LN10.sd())throw Wt=!0,n&&(e.precision=n),Error(qr+"LN10 precision limit exceeded");return At(new e(e.LN10),t)}function $a(e){for(var t="";e--;)t+="0";return t}function Au(e,t){var n,r,i,a,s,l,c,u,p,d=1,f=10,m=e,g=m.d,v=m.constructor,x=v.precision;if(m.s<1)throw Error(qr+(m.s?"NaN":"-Infinity"));if(m.eq(br))return new v(0);if(t==null?(Wt=!1,u=x):u=t,m.eq(10))return t==null&&(Wt=!0),ry(v,u);if(u+=f,v.precision=u,n=Mi(g),r=n.charAt(0),a=un(m),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)m=m.times(e),n=Mi(m.d),r=n.charAt(0),d++;a=un(m),r>1?(m=new v("0."+n),a++):m=new v(r+"."+n.slice(1))}else return c=ry(v,u+2,x).times(a+""),m=Au(new v(r+"."+n.slice(1)),u-f).plus(c),v.precision=x,t==null?(Wt=!0,At(m,x)):m;for(l=s=m=ua(m.minus(br),m.plus(br),u),p=At(m.times(m),u),i=3;;){if(s=At(s.times(p),u),c=l.plus(ua(s,new v(i),u)),Mi(c.d).slice(0,u)===Mi(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(ry(v,u+2,x).times(a+""))),l=ua(l,new v(d),u),v.precision=x,t==null?(Wt=!0,At(l,x)):l;l=c,i+=2}}function HC(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=Vl(n/Lt),e.d=[],r=(n+1)%Lt,n<0&&(r+=Lt),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=Lt;r<i;)e.d.push(+t.slice(r,r+=Lt));t=t.slice(r),r=Lt-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),Wt&&(e.e>Uf||e.e<-Uf))throw Error(Mb+n)}else e.s=0,e.e=0,e.d=[0];return e}function At(e,t,n){var r,i,a,s,l,c,u,p,d=e.d;for(s=1,a=d[0];a>=10;a/=10)s++;if(r=t-s,r<0)r+=Lt,i=t,u=d[p=0];else{if(p=Math.ceil((r+1)/Lt),a=d.length,p>=a)return e;for(u=a=d[p],s=1;a>=10;a/=10)s++;r%=Lt,i=r-Lt+s}if(n!==void 0&&(a=Mo(10,s-i-1),l=u/a%10|0,c=t<0||d[p+1]!==void 0||u%a,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?i>0?u/Mo(10,s-i):0:d[p-1])%10&1||n==(e.s<0?8:7))),t<1||!d[0])return c?(a=un(e),d.length=1,t=t-a-1,d[0]=Mo(10,(Lt-t%Lt)%Lt),e.e=Vl(-t/Lt)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(r==0?(d.length=p,a=1,p--):(d.length=p+1,a=Mo(10,Lt-r),d[p]=i>0?(u/Mo(10,s-i)%Mo(10,i)|0)*a:0),c)for(;;)if(p==0){(d[0]+=a)==wn&&(d[0]=1,++e.e);break}else{if(d[p]+=a,d[p]!=wn)break;d[p--]=0,a=1}for(r=d.length;d[--r]===0;)d.pop();if(Wt&&(e.e>Uf||e.e<-Uf))throw Error(Mb+un(e));return e}function bM(e,t){var n,r,i,a,s,l,c,u,p,d,f=e.constructor,m=f.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new f(e),Wt?At(t,m):t;if(c=e.d,d=t.d,r=t.e,u=e.e,c=c.slice(),s=u-r,s){for(p=s<0,p?(n=c,s=-s,l=d.length):(n=d,r=u,l=c.length),i=Math.max(Math.ceil(m/Lt),l)+2,s>i&&(s=i,n.length=1),n.reverse(),i=s;i--;)n.push(0);n.reverse()}else{for(i=c.length,l=d.length,p=i<l,p&&(l=i),i=0;i<l;i++)if(c[i]!=d[i]){p=c[i]<d[i];break}s=0}for(p&&(n=c,c=d,d=n,t.s=-t.s),l=c.length,i=d.length-l;i>0;--i)c[l++]=0;for(i=d.length;i>s;){if(c[--i]<d[i]){for(a=i;a&&c[--a]===0;)c[a]=wn-1;--c[a],c[i]+=wn}c[i]-=d[i]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,Wt?At(t,m):t):new f(0)}function hs(e,t,n){var r,i=un(e),a=Mi(e.d),s=a.length;return t?(n&&(r=n-s)>0?a=a.charAt(0)+"."+a.slice(1)+$a(r):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+$a(-i-1)+a,n&&(r=n-s)>0&&(a+=$a(r))):i>=s?(a+=$a(i+1-s),n&&(r=n-i-1)>0&&(a=a+"."+$a(r))):((r=i+1)<s&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-s)>0&&(i+1===s&&(a+="."),a+=$a(r))),e.s<0?"-"+a:a}function VC(e,t){if(e.length>t)return e.length=t,!0}function wM(e){var t,n,r;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(Jo+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 HC(s,a.toString())}else if(typeof a!="string")throw Error(Jo+a);if(a.charCodeAt(0)===45?(a=a.slice(1),s.s=-1):s.s=1,jY.test(a))HC(s,a);else throw Error(Jo+a)}if(i.prototype=Me,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=wM,i.config=i.set=kY,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function kY(e){if(!e||typeof e!="object")throw Error(qr+"Object expected");var t,n,r,i=["precision",1,Hl,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(Vl(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Jo+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Jo+n+": "+r);return this}var _b=wM(SY);br=new _b(1);const st=_b;function SM(e){var t;return e===0?t=1:t=Math.floor(new st(e).abs().log(10).toNumber())+1,t}function jM(e,t,n){for(var r=new st(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}function Eu(e,t){return EY(e)||AY(e,t)||PY(e,t)||CY()}function CY(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
462
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PY(e,t){if(e){if(typeof e=="string")return qC(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qC(e,t):void 0}}function qC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function AY(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function EY(e){if(Array.isArray(e))return e}var kM=e=>{var t=Eu(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]},Rb=(e,t,n)=>{if(e.lte(0))return new st(0);var r=SM(e.toNumber()),i=new st(10).pow(r),a=e.div(i),s=r!==1?.05:.1,l=new st(Math.ceil(a.div(s).toNumber())).add(n).mul(s),c=l.mul(i);return t?new st(c.toNumber()):new st(Math.ceil(c.toNumber()))},CM=(e,t,n)=>{var r;if(e.lte(0))return new st(0);var i=[1,2,2.5,5],a=e.toNumber(),s=Math.floor(new st(a).abs().log(10).toNumber()),l=new st(10).pow(s),c=e.div(l).toNumber(),u=i.findIndex(m=>m>=c-1e-10);if(u===-1&&(l=l.mul(10),u=0),u+=n,u>=i.length){var p=Math.floor(u/i.length);u%=i.length,l=l.mul(new st(10).pow(p))}var d=(r=i[u])!==null&&r!==void 0?r:1,f=new st(d).mul(l);return t?f:new st(Math.ceil(f.toNumber()))},TY=(e,t,n)=>{var r=new st(1),i=new st(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new st(10).pow(SM(e)-1),i=new st(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new st(Math.floor(e)))}else e===0?i=new st(Math.floor((t-1)/2)):n||(i=new st(Math.floor(e)));for(var s=Math.floor((t-1)/2),l=[],c=0;c<t;c++)l.push(i.add(new st(c-s).mul(r)).toNumber());return l},PM=function(t,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Rb;if(!Number.isFinite((n-t)/(r-1)))return{step:new st(0),tickMin:new st(0),tickMax:new st(0)};var l=s(new st(n).sub(t).div(r-1),i,a),c;t<=0&&n>=0?c=new st(0):(c=new st(t).add(n).div(2),c=c.sub(new st(c).mod(l)));var u=Math.ceil(c.sub(t).div(l).toNumber()),p=Math.ceil(new st(n).sub(c).div(l).toNumber()),d=u+p+1;return d>r?PM(t,n,r,i,a+1,s):(d<r&&(p=n>0?p+(r-d):p,u=n>0?u:u+(r-d)),{step:l,tickMin:c.sub(new st(u).mul(l)),tickMax:c.add(new st(p).mul(l))})},YC=function(t){var n=Eu(t,2),r=n[0],i=n[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",c=Math.max(a,2),u=kM([r,i]),p=Eu(u,2),d=p[0],f=p[1];if(d===-1/0||f===1/0){var m=f===1/0?[d,...Array(a-1).fill(1/0)]:[...Array(a-1).fill(-1/0),f];return r>i?m.reverse():m}if(d===f)return TY(d,a,s);var g=l==="snap125"?CM:Rb,v=PM(d,f,c,s,0,g),x=v.step,y=v.tickMin,b=v.tickMax,w=jM(y,b.add(new st(.1).mul(x)),x);return r>i?w.reverse():w},GC=function(t,n){var r=Eu(t,2),i=r[0],a=r[1],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",c=kM([i,a]),u=Eu(c,2),p=u[0],d=u[1];if(p===-1/0||d===1/0)return[i,a];if(p===d)return[p];var f=l==="snap125"?CM:Rb,m=Math.max(n,2),g=f(new st(d).sub(p).div(m-1),s,0),v=[...jM(new st(p),new st(d),g),d];return s===!1&&(v=v.map(x=>Math.round(x))),i>a?v.reverse():v},AM=e=>e.rootProps.maxBarSize,IY=e=>e.rootProps.barGap,EM=e=>e.rootProps.barCategoryGap,OY=e=>e.rootProps.barSize,ad=e=>e.rootProps.stackOffset,TM=e=>e.rootProps.reverseStackOrder,Db=e=>e.options.chartName,Lb=e=>e.rootProps.syncId,IM=e=>e.rootProps.syncMethod,zb=e=>e.options.eventEmitter,NY=e=>e.rootProps.baseValue,an={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},jo={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},bi={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},pm=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function fm(e,t,n){if(n!=="auto")return n;if(e!=null)return fi(e,t)?"category":"number"}function XC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Wf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XC(Object(n),!0).forEach(function(r){MY(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MY(e,t,n){return(t=_Y(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _Y(e){var t=RY(e,"string");return typeof t=="symbol"?t:t+""}function RY(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var QC={allowDataOverflow:jo.allowDataOverflow,allowDecimals:jo.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:jo.angleAxisId,includeHidden:!1,name:void 0,reversed:jo.reversed,scale:jo.scale,tick:jo.tick,tickCount:void 0,ticks:void 0,type:jo.type,unit:void 0,niceTicks:"auto"},ZC={allowDataOverflow:bi.allowDataOverflow,allowDecimals:bi.allowDecimals,allowDuplicatedCategory:bi.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:bi.radiusAxisId,includeHidden:bi.includeHidden,name:void 0,reversed:bi.reversed,scale:bi.scale,tick:bi.tick,tickCount:bi.tickCount,ticks:void 0,type:bi.type,unit:void 0,niceTicks:"auto"},DY=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},$b=G([DY,Tb],(e,t)=>{var n;if(e!=null)return e;var r=(n=fm(t,"angleAxis",QC.type))!==null&&n!==void 0?n:"category";return Wf(Wf({},QC),{},{type:r})}),LY=(e,t)=>e.polarAxis.radiusAxis[t],Bb=G([LY,Tb],(e,t)=>{var n;if(e!=null)return e;var r=(n=fm(t,"radiusAxis",ZC.type))!==null&&n!==void 0?n:"category";return Wf(Wf({},ZC),{},{type:r})}),hm=e=>e.polarOptions,Fb=G([ja,ka,vn],uM),OM=G([hm,Fb],(e,t)=>{if(e!=null)return Hn(e.innerRadius,t,0)}),NM=G([hm,Fb],(e,t)=>{if(e!=null)return Hn(e.outerRadius,t,t*.8)}),zY=e=>{if(e==null)return[0,0];var t=e.startAngle,n=e.endAngle;return[t,n]},MM=G([hm],zY);G([$b,MM],pm);var _M=G([Fb,OM,NM],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});G([Bb,_M],pm);var RM=G([lt,hm,OM,NM,ja,ka],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var s=t.cx,l=t.cy,c=t.startAngle,u=t.endAngle;return{cx:Hn(s,i,i/2),cy:Hn(l,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:u,clockWise:!1}}}),Qt=(e,t)=>t,od=(e,t,n)=>n;function mm(e){return e==null?void 0:e.id}function DM(e,t,n){var r=t.chartData,i=r===void 0?[]:r,a=n.allowDuplicatedCategory,s=n.dataKey,l=new Map;return e.forEach(c=>{var u,p=(u=c.data)!==null&&u!==void 0?u:i;if(!(p==null||p.length===0)){var d=mm(c);p.forEach((f,m)=>{var g=s==null||a?m:String(ht(f,s,null)),v=ht(f,c.dataKey,0),x;l.has(g)?x=l.get(g):x={},Object.assign(x,{[d]:v}),l.set(g,x)})}}),Array.from(l.values())}function gm(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 vm(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function $Y(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var Pn=e=>{var t=lt(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},ql=e=>e.tooltip.settings.axisId;function Ub(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:function(a){function s(){return a.apply(this,arguments)}return s.toString=function(){return a.toString()},s}(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var s=i[0],l=i[1];return s<=l?a>=s&&a<=l:a>=l&&a<=s},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,s)=>{var l=e(a);if(l!=null){if(e.bandwidth&&s!==null&&s!==void 0&&s.position){var c=e.bandwidth();switch(s.position){case"middle":l+=c/2;break;case"end":l+=c;break}}return l}}}}}var LM=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Di(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];Je(a)&&((n===void 0||a<n)&&(n=a),(r===void 0||a>r)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function no(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function BY(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Wb(e){let t,n,r;e.length!==2?(t=no,n=(l,c)=>no(e(l),c),r=(l,c)=>e(l)-c):(t=e===no||e===BY?e:FY,n=e,r=e);function i(l,c,u=0,p=l.length){if(u<p){if(t(c,c)!==0)return p;do{const d=u+p>>>1;n(l[d],c)<0?u=d+1:p=d}while(u<p)}return u}function a(l,c,u=0,p=l.length){if(u<p){if(t(c,c)!==0)return p;do{const d=u+p>>>1;n(l[d],c)<=0?u=d+1:p=d}while(u<p)}return u}function s(l,c,u=0,p=l.length){const d=i(l,c,u,p-1);return d>u&&r(l[d-1],c)>-r(l[d],c)?d-1:d}return{left:i,center:s,right:a}}function FY(){return 0}function zM(e){return e===null?NaN:+e}function*UY(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const WY=Wb(no),sd=WY.right;Wb(zM).center;class JC extends Map{constructor(t,n=VY){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(eP(this,t))}has(t){return super.has(eP(this,t))}set(t,n){return super.set(KY(this,t),n)}delete(t){return super.delete(HY(this,t))}}function eP({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function KY({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function HY({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function VY(e){return e!==null&&typeof e=="object"?e.valueOf():e}function qY(e=no){if(e===no)return $M;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function $M(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const YY=Math.sqrt(50),GY=Math.sqrt(10),XY=Math.sqrt(2);function Kf(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),s=a>=YY?10:a>=GY?5:a>=XY?2:1;let l,c,u;return i<0?(u=Math.pow(10,-i)/s,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,i)*s,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=n&&n<2?Kf(e,t,n*2):[l,c,u]}function vx(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,s]=r?Kf(t,e,n):Kf(e,t,n);if(!(a>=i))return[];const l=a-i+1,c=new Array(l);if(r)if(s<0)for(let u=0;u<l;++u)c[u]=(a-u)/-s;else for(let u=0;u<l;++u)c[u]=(a-u)*s;else if(s<0)for(let u=0;u<l;++u)c[u]=(i+u)/-s;else for(let u=0;u<l;++u)c[u]=(i+u)*s;return c}function xx(e,t,n){return t=+t,e=+e,n=+n,Kf(e,t,n)[2]}function bx(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?xx(t,e,n):xx(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function tP(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function nP(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function BM(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?$M:qY(i);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,p=Math.log(c),d=.5*Math.exp(2*p/3),f=.5*Math.sqrt(p*d*(c-d)/c)*(u-c/2<0?-1:1),m=Math.max(n,Math.floor(t-u*d/c+f)),g=Math.min(r,Math.floor(t+(c-u)*d/c+f));BM(e,t,m,g,i)}const a=e[t];let s=n,l=r;for(xc(e,n,t),i(e[r],a)>0&&xc(e,n,r);s<l;){for(xc(e,s,l),++s,--l;i(e[s],a)<0;)++s;for(;i(e[l],a)>0;)--l}i(e[n],a)===0?xc(e,n,l):(++l,xc(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function xc(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function QY(e,t,n){if(e=Float64Array.from(UY(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return nP(e);if(t>=1)return tP(e);var r,i=(r-1)*t,a=Math.floor(i),s=tP(BM(e,a).subarray(0,a+1)),l=nP(e.subarray(a+1));return s+(l-s)*(i-a)}}function ZY(e,t,n=zM){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),s=+n(e[a],a,e),l=+n(e[a+1],a+1,e);return s+(l-s)*(i-a)}}function JY(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function Yr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ca(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 wx=Symbol("implicit");function Kb(){var e=new JC,t=[],n=[],r=wx;function i(a){let s=e.get(a);if(s===void 0){if(r!==wx)return r;e.set(a,s=t.push(a)-1)}return n[s%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new JC;for(const s of a)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Kb(t,n).unknown(r)},Yr.apply(i,arguments),i}function Hb(){var e=Kb().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,s,l=!1,c=0,u=0,p=.5;delete e.unknown;function d(){var f=t().length,m=i<r,g=m?i:r,v=m?r:i;a=(v-g)/Math.max(1,f-c+u*2),l&&(a=Math.floor(a)),g+=(v-g-a*(f-c))*p,s=a*(1-c),l&&(g=Math.round(g),s=Math.round(s));var x=JY(f).map(function(y){return g+a*y});return n(m?x.reverse():x)}return e.domain=function(f){return arguments.length?(t(f),d()):t()},e.range=function(f){return arguments.length?([r,i]=f,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(f){return[r,i]=f,r=+r,i=+i,l=!0,d()},e.bandwidth=function(){return s},e.step=function(){return a},e.round=function(f){return arguments.length?(l=!!f,d()):l},e.padding=function(f){return arguments.length?(c=Math.min(1,u=+f),d()):c},e.paddingInner=function(f){return arguments.length?(c=Math.min(1,f),d()):c},e.paddingOuter=function(f){return arguments.length?(u=+f,d()):u},e.align=function(f){return arguments.length?(p=Math.max(0,Math.min(1,f)),d()):p},e.copy=function(){return Hb(t(),[r,i]).round(l).paddingInner(c).paddingOuter(u).align(p)},Yr.apply(d(),arguments)}function FM(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return FM(t())},e}function eG(){return FM(Hb.apply(null,arguments).paddingInner(1))}function Vb(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function UM(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ld(){}var Tu=.7,Hf=1/Tu,hl="\\s*([+-]?\\d+)\\s*",Iu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Li="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",tG=/^#([0-9a-f]{3,8})$/,nG=new RegExp(`^rgb\\(${hl},${hl},${hl}\\)$`),rG=new RegExp(`^rgb\\(${Li},${Li},${Li}\\)$`),iG=new RegExp(`^rgba\\(${hl},${hl},${hl},${Iu}\\)$`),aG=new RegExp(`^rgba\\(${Li},${Li},${Li},${Iu}\\)$`),oG=new RegExp(`^hsl\\(${Iu},${Li},${Li}\\)$`),sG=new RegExp(`^hsla\\(${Iu},${Li},${Li},${Iu}\\)$`),rP={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};Vb(ld,Ou,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:iP,formatHex:iP,formatHex8:lG,formatHsl:cG,formatRgb:aP,toString:aP});function iP(){return this.rgb().formatHex()}function lG(){return this.rgb().formatHex8()}function cG(){return WM(this).formatHsl()}function aP(){return this.rgb().formatRgb()}function Ou(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=tG.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?oP(t):n===3?new ur(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?tp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?tp(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=nG.exec(e))?new ur(t[1],t[2],t[3],1):(t=rG.exec(e))?new ur(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=iG.exec(e))?tp(t[1],t[2],t[3],t[4]):(t=aG.exec(e))?tp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=oG.exec(e))?cP(t[1],t[2]/100,t[3]/100,1):(t=sG.exec(e))?cP(t[1],t[2]/100,t[3]/100,t[4]):rP.hasOwnProperty(e)?oP(rP[e]):e==="transparent"?new ur(NaN,NaN,NaN,0):null}function oP(e){return new ur(e>>16&255,e>>8&255,e&255,1)}function tp(e,t,n,r){return r<=0&&(e=t=n=NaN),new ur(e,t,n,r)}function uG(e){return e instanceof ld||(e=Ou(e)),e?(e=e.rgb(),new ur(e.r,e.g,e.b,e.opacity)):new ur}function Sx(e,t,n,r){return arguments.length===1?uG(e):new ur(e,t,n,r??1)}function ur(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Vb(ur,Sx,UM(ld,{brighter(e){return e=e==null?Hf:Math.pow(Hf,e),new ur(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Tu:Math.pow(Tu,e),new ur(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ur(es(this.r),es(this.g),es(this.b),Vf(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:sP,formatHex:sP,formatHex8:dG,formatRgb:lP,toString:lP}));function sP(){return`#${Wo(this.r)}${Wo(this.g)}${Wo(this.b)}`}function dG(){return`#${Wo(this.r)}${Wo(this.g)}${Wo(this.b)}${Wo((isNaN(this.opacity)?1:this.opacity)*255)}`}function lP(){const e=Vf(this.opacity);return`${e===1?"rgb(":"rgba("}${es(this.r)}, ${es(this.g)}, ${es(this.b)}${e===1?")":`, ${e})`}`}function Vf(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 Wo(e){return e=es(e),(e<16?"0":"")+e.toString(16)}function cP(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new oi(e,t,n,r)}function WM(e){if(e instanceof oi)return new oi(e.h,e.s,e.l,e.opacity);if(e instanceof ld||(e=Ou(e)),!e)return new oi;if(e instanceof oi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),s=NaN,l=a-i,c=(a+i)/2;return l?(t===a?s=(n-r)/l+(n<r)*6:n===a?s=(r-t)/l+2:s=(t-n)/l+4,l/=c<.5?a+i:2-a-i,s*=60):l=c>0&&c<1?0:s,new oi(s,l,c,e.opacity)}function pG(e,t,n,r){return arguments.length===1?WM(e):new oi(e,t,n,r??1)}function oi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Vb(oi,pG,UM(ld,{brighter(e){return e=e==null?Hf:Math.pow(Hf,e),new oi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Tu:Math.pow(Tu,e),new oi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ur(iy(e>=240?e-240:e+120,i,r),iy(e,i,r),iy(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new oi(uP(this.h),np(this.s),np(this.l),Vf(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=Vf(this.opacity);return`${e===1?"hsl(":"hsla("}${uP(this.h)}, ${np(this.s)*100}%, ${np(this.l)*100}%${e===1?")":`, ${e})`}`}}));function uP(e){return e=(e||0)%360,e<0?e+360:e}function np(e){return Math.max(0,Math.min(1,e||0))}function iy(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const qb=e=>()=>e;function fG(e,t){return function(n){return e+n*t}}function hG(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function mG(e){return(e=+e)==1?KM:function(t,n){return n-t?hG(t,n,e):qb(isNaN(t)?n:t)}}function KM(e,t){var n=t-e;return n?fG(e,n):qb(isNaN(e)?t:e)}const dP=function e(t){var n=mG(t);function r(i,a){var s=n((i=Sx(i)).r,(a=Sx(a)).r),l=n(i.g,a.g),c=n(i.b,a.b),u=KM(i.opacity,a.opacity);return function(p){return i.r=s(p),i.g=l(p),i.b=c(p),i.opacity=u(p),i+""}}return r.gamma=e,r}(1);function gG(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function yG(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function vG(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),s;for(s=0;s<r;++s)i[s]=Yl(e[s],t[s]);for(;s<n;++s)a[s]=t[s];return function(l){for(s=0;s<r;++s)a[s]=i[s](l);return a}}function xG(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function qf(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function bG(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Yl(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var jx=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ay=new RegExp(jx.source,"g");function wG(e){return function(){return e}}function SG(e){return function(t){return e(t)+""}}function jG(e,t){var n=jx.lastIndex=ay.lastIndex=0,r,i,a,s=-1,l=[],c=[];for(e=e+"",t=t+"";(r=jx.exec(e))&&(i=ay.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),l[s]?l[s]+=a:l[++s]=a),(r=r[0])===(i=i[0])?l[s]?l[s]+=i:l[++s]=i:(l[++s]=null,c.push({i:s,x:qf(r,i)})),n=ay.lastIndex;return n<t.length&&(a=t.slice(n),l[s]?l[s]+=a:l[++s]=a),l.length<2?c[0]?SG(c[0].x):wG(t):(t=c.length,function(u){for(var p=0,d;p<t;++p)l[(d=c[p]).i]=d.x(u);return l.join("")})}function Yl(e,t){var n=typeof t,r;return t==null||n==="boolean"?qb(t):(n==="number"?qf:n==="string"?(r=Ou(t))?(t=r,dP):jG:t instanceof Ou?dP:t instanceof Date?xG:yG(t)?gG:Array.isArray(t)?vG:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?bG:qf)(e,t)}function Yb(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function kG(e,t){t===void 0&&(t=e,e=Yl);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(s){var l=Math.max(0,Math.min(r-1,Math.floor(s*=r)));return a[l](s-l)}}function CG(e){return function(){return e}}function Yf(e){return+e}var pP=[0,1];function Zn(e){return e}function kx(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:CG(isNaN(t)?NaN:.5)}function PG(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function AG(e,t,n){var r=e[0],i=e[1],a=t[0],s=t[1];return i<r?(r=kx(i,r),a=n(s,a)):(r=kx(r,i),a=n(a,s)),function(l){return a(r(l))}}function EG(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),s=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<r;)i[s]=kx(e[s],e[s+1]),a[s]=n(t[s],t[s+1]);return function(l){var c=sd(e,l,1,r)-1;return a[c](i[c](l))}}function cd(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function xm(){var e=pP,t=pP,n=Yl,r,i,a,s=Zn,l,c,u;function p(){var f=Math.min(e.length,t.length);return s!==Zn&&(s=PG(e[0],e[f-1])),l=f>2?EG:AG,c=u=null,d}function d(f){return f==null||isNaN(f=+f)?a:(c||(c=l(e.map(r),t,n)))(r(s(f)))}return d.invert=function(f){return s(i((u||(u=l(t,e.map(r),qf)))(f)))},d.domain=function(f){return arguments.length?(e=Array.from(f,Yf),p()):e.slice()},d.range=function(f){return arguments.length?(t=Array.from(f),p()):t.slice()},d.rangeRound=function(f){return t=Array.from(f),n=Yb,p()},d.clamp=function(f){return arguments.length?(s=f?!0:Zn,p()):s!==Zn},d.interpolate=function(f){return arguments.length?(n=f,p()):n},d.unknown=function(f){return arguments.length?(a=f,d):a},function(f,m){return r=f,i=m,p()}}function Gb(){return xm()(Zn,Zn)}function TG(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Gf(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Ol(e){return e=Gf(Math.abs(e)),e?e[1]:NaN}function IG(e,t){return function(n,r){for(var i=n.length,a=[],s=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),a.push(n.substring(i-=l,i+l)),!((c+=l+1)>r));)l=e[s=(s+1)%e.length];return a.reverse().join(t)}}function OG(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var NG=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Nu(e){if(!(t=NG.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]})}Nu.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 MG(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Xf;function _G(e,t){var n=Gf(e,t);if(!n)return Xf=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Xf=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=r.length;return a===s?r:a>s?r+new Array(a-s+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Gf(e,Math.max(0,t+a-1))[0]}function fP(e,t){var n=Gf(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const hP={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:TG,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)=>fP(e*100,t),r:fP,s:_G,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function mP(e){return e}var gP=Array.prototype.map,yP=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function RG(e){var t=e.grouping===void 0||e.thousands===void 0?mP:IG(gP.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?mP:OG(gP.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(d,f){d=Nu(d);var m=d.fill,g=d.align,v=d.sign,x=d.symbol,y=d.zero,b=d.width,w=d.comma,S=d.precision,k=d.trim,j=d.type;j==="n"?(w=!0,j="g"):hP[j]||(S===void 0&&(S=12),k=!0,j="g"),(y||m==="0"&&g==="=")&&(y=!0,m="0",g="=");var A=(f&&f.prefix!==void 0?f.prefix:"")+(x==="$"?n:x==="#"&&/[boxX]/.test(j)?"0"+j.toLowerCase():""),E=(x==="$"?r:/[%p]/.test(j)?s:"")+(f&&f.suffix!==void 0?f.suffix:""),D=hP[j],O=/[defgprs%]/.test(j);S=S===void 0?6:/[gprs]/.test(j)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function _(R){var X=A,V=E,I,$,H;if(j==="c")V=D(R)+V,R="";else{R=+R;var N=R<0||1/R<0;if(R=isNaN(R)?c:D(Math.abs(R),S),k&&(R=MG(R)),N&&+R==0&&v!=="+"&&(N=!1),X=(N?v==="("?v:l:v==="-"||v==="("?"":v)+X,V=(j==="s"&&!isNaN(R)&&Xf!==void 0?yP[8+Xf/3]:"")+V+(N&&v==="("?")":""),O){for(I=-1,$=R.length;++I<$;)if(H=R.charCodeAt(I),48>H||H>57){V=(H===46?i+R.slice(I+1):R.slice(I))+V,R=R.slice(0,I);break}}}w&&!y&&(R=t(R,1/0));var U=X.length+R.length+V.length,P=U<b?new Array(b-U+1).join(m):"";switch(w&&y&&(R=t(P+R,P.length?b-V.length:1/0),P=""),g){case"<":R=X+R+V+P;break;case"=":R=X+P+R+V;break;case"^":R=P.slice(0,U=P.length>>1)+X+R+V+P.slice(U);break;default:R=P+X+R+V;break}return a(R)}return _.toString=function(){return d+""},_}function p(d,f){var m=Math.max(-8,Math.min(8,Math.floor(Ol(f)/3)))*3,g=Math.pow(10,-m),v=u((d=Nu(d),d.type="f",d),{suffix:yP[8+m/3]});return function(x){return v(g*x)}}return{format:u,formatPrefix:p}}var rp,Qb,HM;DG({thousands:",",grouping:[3],currency:["$",""]});function DG(e){return rp=RG(e),Qb=rp.format,HM=rp.formatPrefix,rp}function LG(e){return Math.max(0,-Ol(Math.abs(e)))}function zG(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ol(t)/3)))*3-Ol(Math.abs(e)))}function $G(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ol(t)-Ol(e))+1}function VM(e,t,n,r){var i=bx(e,t,n),a;switch(r=Nu(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=zG(i,s))&&(r.precision=a),HM(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=$G(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=LG(i))&&(r.precision=a-(r.type==="%")*2);break}}return Qb(r)}function yo(e){var t=e.domain;return e.ticks=function(n){var r=t();return vx(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return VM(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,s=r[i],l=r[a],c,u,p=10;for(l<s&&(u=s,s=l,l=u,u=i,i=a,a=u);p-- >0;){if(u=xx(s,l,n),u===c)return r[i]=s,r[a]=l,t(r);if(u>0)s=Math.floor(s/u)*u,l=Math.ceil(l/u)*u;else if(u<0)s=Math.ceil(s*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function qM(){var e=Gb();return e.copy=function(){return cd(e,qM())},Yr.apply(e,arguments),yo(e)}function YM(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Yf),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return YM(e).unknown(t)},e=arguments.length?Array.from(e,Yf):[0,1],yo(n)}function GM(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],s;return a<i&&(s=n,n=r,r=s,s=i,i=a,a=s),e[n]=t.floor(i),e[r]=t.ceil(a),e}function vP(e){return Math.log(e)}function xP(e){return Math.exp(e)}function BG(e){return-Math.log(-e)}function FG(e){return-Math.exp(-e)}function UG(e){return isFinite(e)?+("1e"+e):e<0?0:e}function WG(e){return e===10?UG:e===Math.E?Math.exp:t=>Math.pow(e,t)}function KG(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 bP(e){return(t,n)=>-e(-t,n)}function Zb(e){const t=e(vP,xP),n=t.domain;let r=10,i,a;function s(){return i=KG(r),a=WG(r),n()[0]<0?(i=bP(i),a=bP(a),e(BG,FG)):e(vP,xP),t}return t.base=function(l){return arguments.length?(r=+l,s()):r},t.domain=function(l){return arguments.length?(n(l),s()):n()},t.ticks=l=>{const c=n();let u=c[0],p=c[c.length-1];const d=p<u;d&&([u,p]=[p,u]);let f=i(u),m=i(p),g,v;const x=l==null?10:+l;let y=[];if(!(r%1)&&m-f<x){if(f=Math.floor(f),m=Math.ceil(m),u>0){for(;f<=m;++f)for(g=1;g<r;++g)if(v=f<0?g/a(-f):g*a(f),!(v<u)){if(v>p)break;y.push(v)}}else for(;f<=m;++f)for(g=r-1;g>=1;--g)if(v=f>0?g/a(-f):g*a(f),!(v<u)){if(v>p)break;y.push(v)}y.length*2<x&&(y=vx(u,p,x))}else y=vx(f,m,Math.min(m-f,x)).map(a);return d?y.reverse():y},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Nu(c)).precision==null&&(c.trim=!0),c=Qb(c)),l===1/0)return c;const u=Math.max(1,r*l/t.ticks().length);return p=>{let d=p/a(Math.round(i(p)));return d*r<r-.5&&(d*=r),d<=u?c(p):""}},t.nice=()=>n(GM(n(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),t}function XM(){const e=Zb(xm()).domain([1,10]);return e.copy=()=>cd(e,XM()).base(e.base()),Yr.apply(e,arguments),e}function wP(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function SP(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Jb(e){var t=1,n=e(wP(t),SP(t));return n.constant=function(r){return arguments.length?e(wP(t=+r),SP(t)):t},yo(n)}function QM(){var e=Jb(xm());return e.copy=function(){return cd(e,QM()).constant(e.constant())},Yr.apply(e,arguments)}function jP(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function HG(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function VG(e){return e<0?-e*e:e*e}function e1(e){var t=e(Zn,Zn),n=1;function r(){return n===1?e(Zn,Zn):n===.5?e(HG,VG):e(jP(n),jP(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},yo(t)}function t1(){var e=e1(xm());return e.copy=function(){return cd(e,t1()).exponent(e.exponent())},Yr.apply(e,arguments),e}function qG(){return t1.apply(null,arguments).exponent(.5)}function kP(e){return Math.sign(e)*e*e}function YG(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function ZM(){var e=Gb(),t=[0,1],n=!1,r;function i(a){var s=YG(e(a));return isNaN(s)?r:n?Math.round(s):s}return i.invert=function(a){return e.invert(kP(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,Yf)).map(kP)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return ZM(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Yr.apply(i,arguments),yo(i)}function JM(){var e=[],t=[],n=[],r;function i(){var s=0,l=Math.max(1,t.length);for(n=new Array(l-1);++s<l;)n[s-1]=ZY(e,s/l);return a}function a(s){return s==null||isNaN(s=+s)?r:t[sd(n,s)]}return a.invertExtent=function(s){var l=t.indexOf(s);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},a.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let l of s)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(no),i()},a.range=function(s){return arguments.length?(t=Array.from(s),i()):t.slice()},a.unknown=function(s){return arguments.length?(r=s,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return JM().domain(e).range(t).unknown(r)},Yr.apply(a,arguments)}function e_(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function s(c){return c!=null&&c<=c?i[sd(r,c,0,n)]:a}function l(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return s}return s.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},s.range=function(c){return arguments.length?(n=(i=Array.from(c)).length-1,l()):i.slice()},s.invertExtent=function(c){var u=i.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},s.unknown=function(c){return arguments.length&&(a=c),s},s.thresholds=function(){return r.slice()},s.copy=function(){return e_().domain([e,t]).range(i).unknown(a)},Yr.apply(yo(s),arguments)}function t_(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[sd(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=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?(n=a,i):n},i.copy=function(){return t_().domain(e).range(t).unknown(n)},Yr.apply(i,arguments)}const oy=new Date,sy=new Date;function xn(e,t,n,r){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),l=i.ceil(a);return a-s<l-a?s:l},i.offset=(a,s)=>(t(a=new Date(+a),s==null?1:Math.floor(s)),a),i.range=(a,s,l)=>{const c=[];if(a=i.ceil(a),l=l==null?1:Math.floor(l),!(a<s)||!(l>0))return c;let u;do c.push(u=new Date(+a)),t(a,l),e(a);while(u<a&&a<s);return c},i.filter=a=>xn(s=>{if(s>=s)for(;e(s),!a(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;t(s,-1),!a(s););else for(;--l>=0;)for(;t(s,1),!a(s););}),n&&(i.count=(a,s)=>(oy.setTime(+a),sy.setTime(+s),e(oy),e(sy),Math.floor(n(oy,sy))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?s=>r(s)%a===0:s=>i.count(0,s)%a===0):i)),i}const Qf=xn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Qf.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?xn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Qf);Qf.range;const sa=1e3,Wr=sa*60,la=Wr*60,ya=la*24,n1=ya*7,CP=ya*30,ly=ya*365,Ko=xn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*sa)},(e,t)=>(t-e)/sa,e=>e.getUTCSeconds());Ko.range;const r1=xn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*sa)},(e,t)=>{e.setTime(+e+t*Wr)},(e,t)=>(t-e)/Wr,e=>e.getMinutes());r1.range;const i1=xn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Wr)},(e,t)=>(t-e)/Wr,e=>e.getUTCMinutes());i1.range;const a1=xn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*sa-e.getMinutes()*Wr)},(e,t)=>{e.setTime(+e+t*la)},(e,t)=>(t-e)/la,e=>e.getHours());a1.range;const o1=xn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*la)},(e,t)=>(t-e)/la,e=>e.getUTCHours());o1.range;const ud=xn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Wr)/ya,e=>e.getDate()-1);ud.range;const bm=xn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ya,e=>e.getUTCDate()-1);bm.range;const n_=xn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ya,e=>Math.floor(e/ya));n_.range;function js(e){return xn(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Wr)/n1)}const wm=js(0),Zf=js(1),GG=js(2),XG=js(3),Nl=js(4),QG=js(5),ZG=js(6);wm.range;Zf.range;GG.range;XG.range;Nl.range;QG.range;ZG.range;function ks(e){return xn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/n1)}const Sm=ks(0),Jf=ks(1),JG=ks(2),eX=ks(3),Ml=ks(4),tX=ks(5),nX=ks(6);Sm.range;Jf.range;JG.range;eX.range;Ml.range;tX.range;nX.range;const s1=xn(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());s1.range;const l1=xn(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());l1.range;const va=xn(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());va.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:xn(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});va.range;const xa=xn(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());xa.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:xn(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});xa.range;function r_(e,t,n,r,i,a){const s=[[Ko,1,sa],[Ko,5,5*sa],[Ko,15,15*sa],[Ko,30,30*sa],[a,1,Wr],[a,5,5*Wr],[a,15,15*Wr],[a,30,30*Wr],[i,1,la],[i,3,3*la],[i,6,6*la],[i,12,12*la],[r,1,ya],[r,2,2*ya],[n,1,n1],[t,1,CP],[t,3,3*CP],[e,1,ly]];function l(u,p,d){const f=p<u;f&&([u,p]=[p,u]);const m=d&&typeof d.range=="function"?d:c(u,p,d),g=m?m.range(u,+p+1):[];return f?g.reverse():g}function c(u,p,d){const f=Math.abs(p-u)/d,m=Wb(([,,x])=>x).right(s,f);if(m===s.length)return e.every(bx(u/ly,p/ly,d));if(m===0)return Qf.every(Math.max(bx(u,p,d),1));const[g,v]=s[f/s[m-1][2]<s[m][2]/f?m-1:m];return g.every(v)}return[l,c]}const[rX,iX]=r_(xa,l1,Sm,n_,o1,i1),[aX,oX]=r_(va,s1,wm,ud,a1,r1);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 uy(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 bc(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function sX(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,s=e.shortDays,l=e.months,c=e.shortMonths,u=wc(i),p=Sc(i),d=wc(a),f=Sc(a),m=wc(s),g=Sc(s),v=wc(l),x=Sc(l),y=wc(c),b=Sc(c),w={a:H,A:N,b:U,B:P,c:null,d:OP,e:OP,f:IX,g:BX,G:UX,H:AX,I:EX,j:TX,L:i_,m:OX,M:NX,p:W,q:se,Q:_P,s:RP,S:MX,u:_X,U:RX,V:DX,w:LX,W:zX,x:null,X:null,y:$X,Y:FX,Z:WX,"%":MP},S={a:T,A:he,b:ye,B:Z,c:null,d:NP,e:NP,f:qX,g:rQ,G:aQ,H:KX,I:HX,j:VX,L:o_,m:YX,M:GX,p:le,q:Se,Q:_P,s:RP,S:XX,u:QX,U:ZX,V:JX,w:eQ,W:tQ,x:null,X:null,y:nQ,Y:iQ,Z:oQ,"%":MP},k={a:O,A:_,b:R,B:X,c:V,d:TP,e:TP,f:jX,g:EP,G:AP,H:IP,I:IP,j:xX,L:SX,m:vX,M:bX,p:D,q:yX,Q:CX,s:PX,S:wX,u:pX,U:fX,V:hX,w:dX,W:mX,x:I,X:$,y:EP,Y:AP,Z:gX,"%":kX};w.x=j(n,w),w.X=j(r,w),w.c=j(t,w),S.x=j(n,S),S.X=j(r,S),S.c=j(t,S);function j(Q,ne){return function(pe){var ie=[],_e=-1,ke=0,te=Q.length,De,Ve,Le;for(pe instanceof Date||(pe=new Date(+pe));++_e<te;)Q.charCodeAt(_e)===37&&(ie.push(Q.slice(ke,_e)),(Ve=PP[De=Q.charAt(++_e)])!=null?De=Q.charAt(++_e):Ve=De==="e"?" ":"0",(Le=ne[De])&&(De=Le(pe,Ve)),ie.push(De),ke=_e+1);return ie.push(Q.slice(ke,_e)),ie.join("")}}function A(Q,ne){return function(pe){var ie=bc(1900,void 0,1),_e=E(ie,Q,pe+="",0),ke,te;if(_e!=pe.length)return null;if("Q"in ie)return new Date(ie.Q);if("s"in ie)return new Date(ie.s*1e3+("L"in ie?ie.L:0));if(ne&&!("Z"in ie)&&(ie.Z=0),"p"in ie&&(ie.H=ie.H%12+ie.p*12),ie.m===void 0&&(ie.m="q"in ie?ie.q:0),"V"in ie){if(ie.V<1||ie.V>53)return null;"w"in ie||(ie.w=1),"Z"in ie?(ke=uy(bc(ie.y,0,1)),te=ke.getUTCDay(),ke=te>4||te===0?Jf.ceil(ke):Jf(ke),ke=bm.offset(ke,(ie.V-1)*7),ie.y=ke.getUTCFullYear(),ie.m=ke.getUTCMonth(),ie.d=ke.getUTCDate()+(ie.w+6)%7):(ke=cy(bc(ie.y,0,1)),te=ke.getDay(),ke=te>4||te===0?Zf.ceil(ke):Zf(ke),ke=ud.offset(ke,(ie.V-1)*7),ie.y=ke.getFullYear(),ie.m=ke.getMonth(),ie.d=ke.getDate()+(ie.w+6)%7)}else("W"in ie||"U"in ie)&&("w"in ie||(ie.w="u"in ie?ie.u%7:"W"in ie?1:0),te="Z"in ie?uy(bc(ie.y,0,1)).getUTCDay():cy(bc(ie.y,0,1)).getDay(),ie.m=0,ie.d="W"in ie?(ie.w+6)%7+ie.W*7-(te+5)%7:ie.w+ie.U*7-(te+6)%7);return"Z"in ie?(ie.H+=ie.Z/100|0,ie.M+=ie.Z%100,uy(ie)):cy(ie)}}function E(Q,ne,pe,ie){for(var _e=0,ke=ne.length,te=pe.length,De,Ve;_e<ke;){if(ie>=te)return-1;if(De=ne.charCodeAt(_e++),De===37){if(De=ne.charAt(_e++),Ve=k[De in PP?ne.charAt(_e++):De],!Ve||(ie=Ve(Q,pe,ie))<0)return-1}else if(De!=pe.charCodeAt(ie++))return-1}return ie}function D(Q,ne,pe){var ie=u.exec(ne.slice(pe));return ie?(Q.p=p.get(ie[0].toLowerCase()),pe+ie[0].length):-1}function O(Q,ne,pe){var ie=m.exec(ne.slice(pe));return ie?(Q.w=g.get(ie[0].toLowerCase()),pe+ie[0].length):-1}function _(Q,ne,pe){var ie=d.exec(ne.slice(pe));return ie?(Q.w=f.get(ie[0].toLowerCase()),pe+ie[0].length):-1}function R(Q,ne,pe){var ie=y.exec(ne.slice(pe));return ie?(Q.m=b.get(ie[0].toLowerCase()),pe+ie[0].length):-1}function X(Q,ne,pe){var ie=v.exec(ne.slice(pe));return ie?(Q.m=x.get(ie[0].toLowerCase()),pe+ie[0].length):-1}function V(Q,ne,pe){return E(Q,t,ne,pe)}function I(Q,ne,pe){return E(Q,n,ne,pe)}function $(Q,ne,pe){return E(Q,r,ne,pe)}function H(Q){return s[Q.getDay()]}function N(Q){return a[Q.getDay()]}function U(Q){return c[Q.getMonth()]}function P(Q){return l[Q.getMonth()]}function W(Q){return i[+(Q.getHours()>=12)]}function se(Q){return 1+~~(Q.getMonth()/3)}function T(Q){return s[Q.getUTCDay()]}function he(Q){return a[Q.getUTCDay()]}function ye(Q){return c[Q.getUTCMonth()]}function Z(Q){return l[Q.getUTCMonth()]}function le(Q){return i[+(Q.getUTCHours()>=12)]}function Se(Q){return 1+~~(Q.getUTCMonth()/3)}return{format:function(Q){var ne=j(Q+="",w);return ne.toString=function(){return Q},ne},parse:function(Q){var ne=A(Q+="",!1);return ne.toString=function(){return Q},ne},utcFormat:function(Q){var ne=j(Q+="",S);return ne.toString=function(){return Q},ne},utcParse:function(Q){var ne=A(Q+="",!0);return ne.toString=function(){return Q},ne}}}var PP={"-":"",_:" ",0:"0"},An=/^\s*\d+/,lX=/^%/,cX=/[\\^$*+?|[\]().{}]/g;function gt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function uX(e){return e.replace(cX,"\\$&")}function wc(e){return new RegExp("^(?:"+e.map(uX).join("|")+")","i")}function Sc(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function dX(e,t,n){var r=An.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function pX(e,t,n){var r=An.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function fX(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function hX(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function mX(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function AP(e,t,n){var r=An.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function EP(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function gX(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function yX(e,t,n){var r=An.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function vX(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function TP(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function xX(e,t,n){var r=An.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function IP(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function bX(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function wX(e,t,n){var r=An.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function SX(e,t,n){var r=An.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function jX(e,t,n){var r=An.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function kX(e,t,n){var r=lX.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function CX(e,t,n){var r=An.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function PX(e,t,n){var r=An.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function OP(e,t){return gt(e.getDate(),t,2)}function AX(e,t){return gt(e.getHours(),t,2)}function EX(e,t){return gt(e.getHours()%12||12,t,2)}function TX(e,t){return gt(1+ud.count(va(e),e),t,3)}function i_(e,t){return gt(e.getMilliseconds(),t,3)}function IX(e,t){return i_(e,t)+"000"}function OX(e,t){return gt(e.getMonth()+1,t,2)}function NX(e,t){return gt(e.getMinutes(),t,2)}function MX(e,t){return gt(e.getSeconds(),t,2)}function _X(e){var t=e.getDay();return t===0?7:t}function RX(e,t){return gt(wm.count(va(e)-1,e),t,2)}function a_(e){var t=e.getDay();return t>=4||t===0?Nl(e):Nl.ceil(e)}function DX(e,t){return e=a_(e),gt(Nl.count(va(e),e)+(va(e).getDay()===4),t,2)}function LX(e){return e.getDay()}function zX(e,t){return gt(Zf.count(va(e)-1,e),t,2)}function $X(e,t){return gt(e.getFullYear()%100,t,2)}function BX(e,t){return e=a_(e),gt(e.getFullYear()%100,t,2)}function FX(e,t){return gt(e.getFullYear()%1e4,t,4)}function UX(e,t){var n=e.getDay();return e=n>=4||n===0?Nl(e):Nl.ceil(e),gt(e.getFullYear()%1e4,t,4)}function WX(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+gt(t/60|0,"0",2)+gt(t%60,"0",2)}function NP(e,t){return gt(e.getUTCDate(),t,2)}function KX(e,t){return gt(e.getUTCHours(),t,2)}function HX(e,t){return gt(e.getUTCHours()%12||12,t,2)}function VX(e,t){return gt(1+bm.count(xa(e),e),t,3)}function o_(e,t){return gt(e.getUTCMilliseconds(),t,3)}function qX(e,t){return o_(e,t)+"000"}function YX(e,t){return gt(e.getUTCMonth()+1,t,2)}function GX(e,t){return gt(e.getUTCMinutes(),t,2)}function XX(e,t){return gt(e.getUTCSeconds(),t,2)}function QX(e){var t=e.getUTCDay();return t===0?7:t}function ZX(e,t){return gt(Sm.count(xa(e)-1,e),t,2)}function s_(e){var t=e.getUTCDay();return t>=4||t===0?Ml(e):Ml.ceil(e)}function JX(e,t){return e=s_(e),gt(Ml.count(xa(e),e)+(xa(e).getUTCDay()===4),t,2)}function eQ(e){return e.getUTCDay()}function tQ(e,t){return gt(Jf.count(xa(e)-1,e),t,2)}function nQ(e,t){return gt(e.getUTCFullYear()%100,t,2)}function rQ(e,t){return e=s_(e),gt(e.getUTCFullYear()%100,t,2)}function iQ(e,t){return gt(e.getUTCFullYear()%1e4,t,4)}function aQ(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Ml(e):Ml.ceil(e),gt(e.getUTCFullYear()%1e4,t,4)}function oQ(){return"+0000"}function MP(){return"%"}function _P(e){return+e}function RP(e){return Math.floor(+e/1e3)}var Ms,l_,c_;sQ({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 sQ(e){return Ms=sX(e),l_=Ms.format,Ms.parse,c_=Ms.utcFormat,Ms.utcParse,Ms}function lQ(e){return new Date(e)}function cQ(e){return e instanceof Date?+e:+new Date(+e)}function c1(e,t,n,r,i,a,s,l,c,u){var p=Gb(),d=p.invert,f=p.domain,m=u(".%L"),g=u(":%S"),v=u("%I:%M"),x=u("%I %p"),y=u("%a %d"),b=u("%b %d"),w=u("%B"),S=u("%Y");function k(j){return(c(j)<j?m:l(j)<j?g:s(j)<j?v:a(j)<j?x:r(j)<j?i(j)<j?y:b:n(j)<j?w:S)(j)}return p.invert=function(j){return new Date(d(j))},p.domain=function(j){return arguments.length?f(Array.from(j,cQ)):f().map(lQ)},p.ticks=function(j){var A=f();return e(A[0],A[A.length-1],j??10)},p.tickFormat=function(j,A){return A==null?k:u(A)},p.nice=function(j){var A=f();return(!j||typeof j.range!="function")&&(j=t(A[0],A[A.length-1],j??10)),j?f(GM(A,j)):p},p.copy=function(){return cd(p,c1(e,t,n,r,i,a,s,l,c,u))},p}function uQ(){return Yr.apply(c1(aX,oX,va,s1,wm,ud,a1,r1,Ko,l_).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function dQ(){return Yr.apply(c1(rX,iX,xa,l1,Sm,bm,o1,i1,Ko,c_).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function jm(){var e=0,t=1,n,r,i,a,s=Zn,l=!1,c;function u(d){return d==null||isNaN(d=+d)?c:s(i===0?.5:(d=(a(d)-n)*i,l?Math.max(0,Math.min(1,d)):d))}u.domain=function(d){return arguments.length?([e,t]=d,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(d){return arguments.length?(l=!!d,u):l},u.interpolator=function(d){return arguments.length?(s=d,u):s};function p(d){return function(f){var m,g;return arguments.length?([m,g]=f,s=d(m,g),u):[s(0),s(1)]}}return u.range=p(Yl),u.rangeRound=p(Yb),u.unknown=function(d){return arguments.length?(c=d,u):c},function(d){return a=d,n=d(e),r=d(t),i=n===r?0:1/(r-n),u}}function vo(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function u_(){var e=yo(jm()(Zn));return e.copy=function(){return vo(e,u_())},Ca.apply(e,arguments)}function d_(){var e=Zb(jm()).domain([1,10]);return e.copy=function(){return vo(e,d_()).base(e.base())},Ca.apply(e,arguments)}function p_(){var e=Jb(jm());return e.copy=function(){return vo(e,p_()).constant(e.constant())},Ca.apply(e,arguments)}function u1(){var e=e1(jm());return e.copy=function(){return vo(e,u1()).exponent(e.exponent())},Ca.apply(e,arguments)}function pQ(){return u1.apply(null,arguments).exponent(.5)}function f_(){var e=[],t=Zn;function n(r){if(r!=null&&!isNaN(r=+r))return t((sd(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(no),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>QY(e,a/r))},n.copy=function(){return f_(t).domain(e)},Ca.apply(n,arguments)}function km(){var e=0,t=.5,n=1,r=1,i,a,s,l,c,u=Zn,p,d=!1,f;function m(v){return isNaN(v=+v)?f:(v=.5+((v=+p(v))-a)*(r*v<r*a?l:c),u(d?Math.max(0,Math.min(1,v)):v))}m.domain=function(v){return arguments.length?([e,t,n]=v,i=p(e=+e),a=p(t=+t),s=p(n=+n),l=i===a?0:.5/(a-i),c=a===s?0:.5/(s-a),r=a<i?-1:1,m):[e,t,n]},m.clamp=function(v){return arguments.length?(d=!!v,m):d},m.interpolator=function(v){return arguments.length?(u=v,m):u};function g(v){return function(x){var y,b,w;return arguments.length?([y,b,w]=x,u=kG(v,[y,b,w]),m):[u(0),u(.5),u(1)]}}return m.range=g(Yl),m.rangeRound=g(Yb),m.unknown=function(v){return arguments.length?(f=v,m):f},function(v){return p=v,i=v(e),a=v(t),s=v(n),l=i===a?0:.5/(a-i),c=a===s?0:.5/(s-a),r=a<i?-1:1,m}}function h_(){var e=yo(km()(Zn));return e.copy=function(){return vo(e,h_())},Ca.apply(e,arguments)}function m_(){var e=Zb(km()).domain([.1,1,10]);return e.copy=function(){return vo(e,m_()).base(e.base())},Ca.apply(e,arguments)}function g_(){var e=Jb(km());return e.copy=function(){return vo(e,g_()).constant(e.constant())},Ca.apply(e,arguments)}function d1(){var e=e1(km());return e.copy=function(){return vo(e,d1()).exponent(e.exponent())},Ca.apply(e,arguments)}function fQ(){return d1.apply(null,arguments).exponent(.5)}const y_=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Hb,scaleDiverging:h_,scaleDivergingLog:m_,scaleDivergingPow:d1,scaleDivergingSqrt:fQ,scaleDivergingSymlog:g_,scaleIdentity:YM,scaleImplicit:wx,scaleLinear:qM,scaleLog:XM,scaleOrdinal:Kb,scalePoint:eG,scalePow:t1,scaleQuantile:JM,scaleQuantize:e_,scaleRadial:ZM,scaleSequential:u_,scaleSequentialLog:d_,scaleSequentialPow:u1,scaleSequentialQuantile:f_,scaleSequentialSqrt:pQ,scaleSequentialSymlog:p_,scaleSqrt:qG,scaleSymlog:QM,scaleThreshold:t_,scaleTime:uQ,scaleUtc:dQ,tickFormat:VM},Symbol.toStringTag,{value:"Module"}));function hQ(e){var t=y_;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(qu(e));if(n in t&&typeof t[n]=="function")return t[n]()}function DP(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=hQ(e);if(r!=null)return r.domain(t).range(n),r}}function p1(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?DP(e.scale,n,r):DP(t,n,r)}function mQ(e){return"scale".concat(qu(e))}function gQ(e){return mQ(e)in y_}var v_=(e,t,n)=>{if(e!=null){var r=e.scale,i=e.type;if(r==="auto")return i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!t)?"point":i==="category"?"band":"linear";if(typeof r=="string")return gQ(r)?r:"point"}};function yQ(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var a=Math.floor((n+r)/2);(i?e[a]<t:e[a]>t)?n=a+1:r=a}return n}function x_(e,t){if(e){var n=t??e.domain(),r=n.map(a=>{var s;return(s=e(a))!==null&&s!==void 0?s:0}),i=e.range();if(!(n.length===0||i.length<2))return a=>{var s,l,c=yQ(r,a);if(c<=0)return n[0];if(c>=n.length)return n[n.length-1];var u=(s=r[c-1])!==null&&s!==void 0?s:0,p=(l=r[c])!==null&&l!==void 0?l:0;return Math.abs(a-u)<=Math.abs(a-p)?n[c-1]:n[c]}}}function vQ(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):x_(e,void 0)}function LP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function eh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LP(Object(n),!0).forEach(function(r){xQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xQ(e,t,n){return(t=bQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bQ(e){var t=wQ(e,"string");return typeof t=="symbol"?t:t+""}function wQ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function b_(e,t){return CQ(e)||kQ(e,t)||jQ(e,t)||SQ()}function SQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
463
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jQ(e,t){if(e){if(typeof e=="string")return zP(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zP(e,t):void 0}}function zP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function kQ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function CQ(e){if(Array.isArray(e))return e}var Cx=[0,"auto"],fn={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,niceTicks:"auto"},w_=(e,t)=>e.cartesianAxis.xAxis[t],Pa=(e,t)=>{var n=w_(e,t);return n??fn},hn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:Cx,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,niceTicks:"auto",width:Qu},S_=(e,t)=>e.cartesianAxis.yAxis[t],Aa=(e,t)=>{var n=S_(e,t);return n??hn},PQ={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:""},f1=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??PQ},tn=(e,t,n)=>{switch(t){case"xAxis":return Pa(e,n);case"yAxis":return Aa(e,n);case"zAxis":return f1(e,n);case"angleAxis":return $b(e,n);case"radiusAxis":return Bb(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},AQ=(e,t,n)=>{switch(t){case"xAxis":return Pa(e,n);case"yAxis":return Aa(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Gl=(e,t,n)=>{switch(t){case"xAxis":return Pa(e,n);case"yAxis":return Aa(e,n);case"angleAxis":return $b(e,n);case"radiusAxis":return Bb(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},j_=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function h1(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var dd=e=>e.graphicalItems.cartesianItems,EQ=G([Qt,od],h1),m1=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),Xl=G([dd,tn,EQ],m1,{memoizeOptions:{resultEqualityCheck:vm}}),k_=G([Xl],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(gm)),C_=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),TQ=G([Xl],C_),g1=e=>e.map(t=>t.data).filter(Boolean).flat(1),IQ=G([Xl],e=>e.some(t=>!t.data)),P_=G([Xl],g1,{memoizeOptions:{resultEqualityCheck:vm}}),y1=(e,t)=>{var n=t.chartData,r=n===void 0?[]:n,i=t.dataStartIndex,a=t.dataEndIndex;return e.length>0?e:r.slice(i,a+1)},v1=G([P_,id],y1),A_=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:ht(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:ht(i,r)}))):e.map(r=>({value:r})),E_=(e,t,n,r,i,a)=>{var s=r.chartData,l=s===void 0?[]:s,c=r.dataStartIndex,u=r.dataEndIndex,p=A_(e,t,n);if(i&&(t==null?void 0:t.dataKey)!=null&&a.length>0){var d=l.slice(c,u+1),f=d.map(m=>({value:ht(m,t.dataKey)})).filter(m=>m.value!=null);return[...f,...p]}return p},pd=G([v1,tn,Xl,id,IQ,P_],E_);function ml(e){if(Bi(e)||e instanceof Date){var t=Number(e);if(Je(t))return t}}function $P(e){if(Array.isArray(e)){var t=[ml(e[0]),ml(e[1])];return Di(t)?t:void 0}var n=ml(e);if(n!=null)return[n,n]}function Wi(e){return e.map(ml).filter(cr)}function OQ(e,t){var n=ml(e),r=ml(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var NQ=G([pd],e=>e==null?void 0:e.map(t=>t.value).sort(OQ));function T_(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function MQ(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!ui(t))r=t;else if(Array.isArray(t)){var i=Wi(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:Wi(n.flatMap(a=>{var s=ht(e,a.dataKey),l,c;if(Array.isArray(s)){var u=b_(s,2);l=u[0],c=u[1]}else l=c=s;if(!(!Je(l)||!Je(c)))return[r-l,r+c]}))}var bn=e=>{var t=Pn(e),n=ql(e);return Gl(e,t,n)},_l=G([bn],e=>e==null?void 0:e.dataKey),_Q=G([k_,id,bn],DM),I_=(e,t,n,r)=>{var i={},a=t.reduce((s,l)=>{if(l.stackId==null)return s;var c=s[l.stackId];return c==null&&(c=[]),c.push(l),s[l.stackId]=c,s},i);return Object.fromEntries(Object.entries(a).map(s=>{var l=b_(s,2),c=l[0],u=l[1],p=r?[...u].reverse():u,d=p.map(mm);return[c,{stackedData:_H(e,d,n),graphicalItems:p}]}))},th=G([_Q,k_,ad,TM],I_),O_=(e,t,n,r)=>{var i=t.dataStartIndex,a=t.dataEndIndex;if(r==null&&n!=="zAxis")return zH(e,i,a)},RQ=G([tn],e=>e.allowDataOverflow),x1=e=>{var t;if(e==null||!("domain"in e))return Cx;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Wi(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:Cx},b1=G([tn],x1),w1=G([b1,RQ],gM),DQ=G([th,hi,Qt,w1],O_,{memoizeOptions:{resultEqualityCheck:ym}}),Cm=e=>e.errorBars,LQ=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>T_(n,r)),nh=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);if(i.length!==0){var a=i.flat(),s=Math.min(...a),l=Math.max(...a);return[s,l]}},S1=function(t,n,r,i,a){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],l,c;if(r.length>0&&r.forEach(u=>{var p,d=u.data!=null?[...u.data]:s,f=(p=i[u.id])===null||p===void 0?void 0:p.filter(m=>T_(a,m));d.forEach(m=>{var g,v=ht(m,(g=n.dataKey)!==null&&g!==void 0?g:u.dataKey),x=MQ(m,v,f);if(x.length>=2){var y=Math.min(...x),b=Math.max(...x);(l==null||y<l)&&(l=y),(c==null||b>c)&&(c=b)}var w=$P(v);w!=null&&(l=l==null?w[0]:Math.min(l,w[0]),c=c==null?w[1]:Math.max(c,w[1]))})}),(n==null?void 0:n.dataKey)!=null&&r.length===0&&t.forEach(u=>{var p=$P(ht(u,n.dataKey));p!=null&&(l=l==null?p[0]:Math.min(l,p[0]),c=c==null?p[1]:Math.max(c,p[1]))}),Je(l)&&Je(c))return[l,c]},zQ=G([v1,tn,TQ,Cm,Qt,hY],S1,{memoizeOptions:{resultEqualityCheck:ym}});function $Q(e){var t=e.value;if(Bi(t)||t instanceof Date)return t}var BQ=(e,t,n)=>{var r=e.map($Q).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&MO(r))?hM(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},N_=e=>e.referenceElements.dots,Ql=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),FQ=G([N_,Qt,od],Ql),M_=e=>e.referenceElements.areas,UQ=G([M_,Qt,od],Ql),__=e=>e.referenceElements.lines,WQ=G([__,Qt,od],Ql),R_=(e,t)=>{if(e!=null){var n=Wi(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},KQ=G(FQ,Qt,R_),D_=(e,t)=>{if(e!=null){var n=Wi(e.flatMap(r=>[t==="xAxis"?r.x1:r.y1,t==="xAxis"?r.x2:r.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},HQ=G([UQ,Qt],D_);function VQ(e){var t;if(e.x!=null)return Wi([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Wi(n)}function qQ(e){var t;if(e.y!=null)return Wi([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Wi(n)}var L_=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?VQ(r):qQ(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},YQ=G([WQ,Qt],L_),GQ=G(KQ,YQ,HQ,(e,t,n)=>nh(e,n,t)),j1=(e,t,n,r,i,a,s,l)=>{if(n!=null)return n;var c=s==="vertical"&&l==="xAxis"||s==="horizontal"&&l==="yAxis",u=c?nh(r,a,i):nh(a,i);return wY(t,u,e.allowDataOverflow)},XQ=G([tn,b1,w1,DQ,zQ,GQ,lt,Qt],j1,{memoizeOptions:{resultEqualityCheck:ym}}),QQ=[0,1],k1=(e,t,n,r,i,a,s)=>{if(!((e==null||n==null||n.length===0)&&s===void 0)){var l=e.dataKey,c=e.type,u=fi(t,a);if(u&&l==null){var p;return hM(0,(p=n==null?void 0:n.length)!==null&&p!==void 0?p:0)}return c==="category"?BQ(r,e,u):i==="expand"&&!u?QQ:s}},C1=G([tn,lt,v1,pd,ad,Qt,XQ],k1),xo=G([tn,j_,Db],v_),P1=(e,t,n)=>{var r=t.niceTicks;if(r!=="none"){var i=x1(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&Di(e)){if(a)return YC(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return GC(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&Di(e))return YC(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&Di(e))return GC(e,t.tickCount,t.allowDecimals,"adaptive")}}},A1=G([C1,Gl,xo],P1),E1=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&Di(t)&&Array.isArray(n)&&n.length>0){var i,a,s=t[0],l=(i=n[0])!==null&&i!==void 0?i:0,c=t[1],u=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(s,l),Math.max(c,u)]}return t},ZQ=G([tn,C1,A1,Qt],E1),JQ=G(pd,tn,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Wi(e.map(d=>d.value))).sort((d,f)=>d-f),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var s=a-i;if(s===0)return 1/0;for(var l=0;l<r.length-1;l++){var c=r[l],u=r[l+1];if(!(c==null||u==null)){var p=u-c;n=Math.min(n,p)}}return n/s}}),z_=G(JQ,lt,EM,vn,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!Je(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var s=Hn(n,e*a),l=e*a/2;return l-s-(l-s)/a*s}return 0}),eZ=(e,t,n)=>{var r=Pa(e,t);return r==null||typeof r.padding!="string"?0:z_(e,"xAxis",t,n,r.padding)},tZ=(e,t,n)=>{var r=Aa(e,t);return r==null||typeof r.padding!="string"?0:z_(e,"yAxis",t,n,r.padding)},nZ=G(Pa,eZ,(e,t)=>{var n,r;if(e==null)return{left:0,right:0};var i=e.padding;return typeof i=="string"?{left:t,right:t}:{left:((n=i.left)!==null&&n!==void 0?n:0)+t,right:((r=i.right)!==null&&r!==void 0?r:0)+t}}),rZ=G(Aa,tZ,(e,t)=>{var n,r;if(e==null)return{top:0,bottom:0};var i=e.padding;return typeof i=="string"?{top:t,bottom:t}:{top:((n=i.top)!==null&&n!==void 0?n:0)+t,bottom:((r=i.bottom)!==null&&r!==void 0?r:0)+t}}),$_=G([vn,nZ,sm,om,(e,t,n)=>n],(e,t,n,r,i)=>{var a=r.padding;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),B_=G([vn,lt,rZ,sm,om,(e,t,n)=>n],(e,t,n,r,i,a)=>{var s=i.padding;return a?[r.height-s.bottom,s.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),fd=(e,t,n,r)=>{var i;switch(t){case"xAxis":return $_(e,n,r);case"yAxis":return B_(e,n,r);case"zAxis":return(i=f1(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return MM(e);case"radiusAxis":return _M(e,n);default:return}},F_=G([tn,fd],pm),iZ=G([xo,ZQ],LM),T1=G([tn,xo,iZ,F_],p1),U_=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var i=n.type,a=n.scale,s=fi(e,r);if(s&&(i==="number"||a!=="auto"))return t.map(l=>l.value)}},I1=G([lt,pd,Gl,Qt],U_),Pm=G([T1],Ub);G([T1],vQ);G([T1,NQ],x_);G([Xl,Cm,Qt],LQ);function W_(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Am=(e,t)=>t,Em=(e,t,n)=>n,aZ=G(im,Am,Em,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(W_)),oZ=G(am,Am,Em,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(W_)),K_=(e,t)=>({width:e.width,height:t.height}),sZ=(e,t)=>{var n=typeof t.width=="number"?t.width:Qu;return{width:n,height:e.height}},H_=G(vn,Pa,K_),lZ=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},cZ=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},uZ=G(ka,vn,aZ,Am,Em,(e,t,n,r,i)=>{var a={},s;return n.forEach(l=>{var c=K_(t,l);s==null&&(s=lZ(t,r,e));var u=r==="top"&&!i||r==="bottom"&&i;a[l.id]=s-Number(u)*c.height,s+=(u?-1:1)*c.height}),a}),dZ=G(ja,vn,oZ,Am,Em,(e,t,n,r,i)=>{var a={},s;return n.forEach(l=>{var c=sZ(t,l);s==null&&(s=cZ(t,r,e));var u=r==="left"&&!i||r==="right"&&i;a[l.id]=s-Number(u)*c.width,s+=(u?-1:1)*c.width}),a}),pZ=(e,t)=>{var n=Pa(e,t);if(n!=null)return uZ(e,n.orientation,n.mirror)},fZ=G([vn,Pa,pZ,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),hZ=(e,t)=>{var n=Aa(e,t);if(n!=null)return dZ(e,n.orientation,n.mirror)},mZ=G([vn,Aa,hZ,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),V_=G(vn,Aa,(e,t)=>{var n=typeof t.width=="number"?t.width:Qu;return{width:n,height:e.height}}),BP=(e,t,n)=>{switch(t){case"xAxis":return H_(e,n).width;case"yAxis":return V_(e,n).height;default:return}},q_=(e,t,n,r)=>{if(n!=null){var i=n.allowDuplicatedCategory,a=n.type,s=n.dataKey,l=fi(e,r),c=t.map(p=>p.value),u=c.filter(p=>p!=null);if(s&&l&&a==="category"&&i&&MO(u))return c}},O1=G([lt,pd,tn,Qt],q_),FP=G([lt,AQ,xo,Pm,O1,I1,fd,A1,Qt],(e,t,n,r,i,a,s,l,c)=>{if(t!=null){var u=fi(e,c);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:c,categoricalDomain:a,duplicateDomain:i,isCategorical:u,niceTicks:l,range:s,realScaleType:n,scale:r}}}),gZ=(e,t,n,r,i,a,s,l,c)=>{if(!(t==null||r==null)){var u=fi(e,c),p=t.type,d=t.ticks,f=t.tickCount,m=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,g=p==="category"&&r.bandwidth?r.bandwidth()/m:0;g=c==="angleAxis"&&a!=null&&a.length>=2?jn(a[0]-a[1])*2*g:g;var v=d||i;return v?v.map((x,y)=>{var b=s?s.indexOf(x):x,w=r.map(b);return Je(w)?{index:y,coordinate:w+g,value:x,offset:g}:null}).filter(cr):u&&l?l.map((x,y)=>{var b=r.map(x);return Je(b)?{coordinate:b+g,value:x,index:y,offset:g}:null}).filter(cr):r.ticks?r.ticks(f).map((x,y)=>{var b=r.map(x);return Je(b)?{coordinate:b+g,value:x,index:y,offset:g}:null}).filter(cr):r.domain().map((x,y)=>{var b=r.map(x);return Je(b)?{coordinate:b+g,value:s?s[x]:x,index:y,offset:g}:null}).filter(cr)}},Y_=G([lt,Gl,xo,Pm,A1,fd,O1,I1,Qt],gZ),yZ=(e,t,n,r,i,a,s)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var l=fi(e,s),c=t.tickCount,u=0;return u=s==="angleAxis"&&(r==null?void 0:r.length)>=2?jn(r[0]-r[1])*2*u:u,l&&a?a.map((p,d)=>{var f=n.map(p);return Je(f)?{coordinate:f+u,value:p,index:d,offset:u}:null}).filter(cr):n.ticks?n.ticks(c).map((p,d)=>{var f=n.map(p);return Je(f)?{coordinate:f+u,value:p,index:d,offset:u}:null}).filter(cr):n.domain().map((p,d)=>{var f=n.map(p);return Je(f)?{coordinate:f+u,value:i?i[p]:p,index:d,offset:u}:null}).filter(cr)}},Ki=G([lt,Gl,Pm,fd,O1,I1,Qt],yZ),Hi=G(tn,Pm,(e,t)=>{if(!(e==null||t==null))return eh(eh({},e),{},{scale:t})}),vZ=G([tn,xo,C1,F_],p1),xZ=G([vZ],Ub);G((e,t,n)=>f1(e,n),xZ,(e,t)=>{if(!(e==null||t==null))return eh(eh({},e),{},{scale:t})});var bZ=G([lt,im,am],(e,t,n)=>{switch(e){case"horizontal":return t.some(r=>r.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(r=>r.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),wZ=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};G([wZ],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var a of e){var s=Math.abs(a.coordinate-t);s<r&&(r=s,i=a)}return(n=i)===null||n===void 0?void 0:n.value}});var G_=e=>e.options.defaultTooltipEventType,X_=e=>e.options.validateTooltipEventTypes;function Q_(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function hd(e,t){var n=G_(e),r=X_(e);return Q_(t,n,r)}function SZ(e){return Te(t=>hd(t,e))}var Z_=(e,t)=>{var n,r=Number(t);if(!(ui(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},jZ=e=>e.tooltip.settings,Wa={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},kZ={itemInteraction:{click:Wa,hover:Wa},axisInteraction:{click:Wa,hover:Wa},keyboardInteraction:Wa,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}},J_=Yn({name:"tooltip",initialState:kZ,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:Dt()},replaceTooltipEntrySettings:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Ur(e).tooltipItemPayloads.indexOf(r);a>-1&&(e.tooltipItemPayloads[a]=i)},prepare:Dt()},removeTooltipEntrySettings:{reducer(e,t){var n=Ur(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:Dt()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,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.syncInteraction.sourceViewBox=void 0,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.syncInteraction.sourceViewBox=void 0,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.syncInteraction.sourceViewBox=void 0,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}}}),Gr=J_.actions,CZ=Gr.addTooltipEntrySettings,PZ=Gr.replaceTooltipEntrySettings,AZ=Gr.removeTooltipEntrySettings,EZ=Gr.setTooltipSettingsState,eR=Gr.setActiveMouseOverItemIndex,TZ=Gr.mouseLeaveItem,tR=Gr.mouseLeaveChart,IZ=Gr.setActiveClickItemIndex,nR=Gr.setMouseOverAxisIndex,OZ=Gr.setMouseClickAxisIndex,Nc=Gr.setSyncInteraction,rh=Gr.setKeyboardInteraction,NZ=J_.reducer;function UP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ip(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UP(Object(n),!0).forEach(function(r){MZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MZ(e,t,n){return(t=_Z(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _Z(e){var t=RZ(e,"string");return typeof t=="symbol"?t:t+""}function RZ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function DZ(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function LZ(e){return e.index!=null}var rR=(e,t,n,r)=>{if(t==null)return Wa;var i=DZ(e,t,n);if(i==null)return Wa;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(LZ(i)){if(a)return ip(ip({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return ip(ip({},Wa),{},{coordinate:i.coordinate})};function zZ(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function $Z(e,t){var n=zZ(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),s=Math.max(r,i);return n>=a&&n<=s}function BZ(e,t,n){if(n==null||t==null)return!0;var r=ht(e,t);return r==null||!Di(n)?!0:$Z(r,n)}var qc=(e,t,n,r)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!Je(a))return i;var s=0,l=1/0;t.length>0&&(l=t.length-1);var c=Math.max(s,Math.min(a,l)),u=t[c];return u==null||BZ(u,n,r)?String(c):null},iR=(e,t,n,r,i,a,s)=>{if(a!=null){var l=s[0],c=l==null?void 0:l.getPosition(a);if(c!=null)return c;var u=i==null?void 0:i[Number(a)];if(u)switch(n){case"horizontal":return{x:u.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:u.coordinate}}}},aR=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(s=>{var l;return((l=s.settings)===null||l===void 0?void 0:l.graphicalItemId)===i})},oR=e=>e.options.tooltipPayloadSearcher,Zl=e=>e.tooltip;function WP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function KP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WP(Object(n),!0).forEach(function(r){FZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function FZ(e,t,n){return(t=UZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UZ(e){var t=WZ(e,"string");return typeof t=="symbol"?t:t+""}function WZ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function KZ(e){if(typeof e=="string"||typeof e=="number")return e}function HZ(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function VZ(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function HP(e){if(typeof e=="string")return e}function qZ(e){if(!(e==null||typeof e!="object")){var t="name"in e?KZ(e.name):void 0,n="unit"in e?HZ(e.unit):void 0,r="dataKey"in e?VZ(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?HP(e.color):void 0,s="fill"in e?HP(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:s}}}function YZ(e,t){return e??t}var sR=(e,t,n,r,i,a,s)=>{if(!(t==null||a==null)){var l=n.chartData,c=n.computedData,u=n.dataStartIndex,p=n.dataEndIndex,d=[];return e.reduce((f,m)=>{var g,v=m.dataDefinedOnItem,x=m.settings,y=YZ(v,l),b=Array.isArray(y)?RN(y,u,p):y,w=(g=x==null?void 0:x.dataKey)!==null&&g!==void 0?g:r,S=x==null?void 0:x.nameKey,k;if(r&&Array.isArray(b)&&!Array.isArray(b[0])&&s==="axis"?k=_O(b,r,i):k=a(b,t,c,S),Array.isArray(k))k.forEach(A=>{var E,D,O=qZ(A),_=O==null?void 0:O.name,R=O==null?void 0:O.dataKey,X=O==null?void 0:O.payload,V=KP(KP({},x),{},{name:_,unit:O==null?void 0:O.unit,color:(E=O==null?void 0:O.color)!==null&&E!==void 0?E:x==null?void 0:x.color,fill:(D=O==null?void 0:O.fill)!==null&&D!==void 0?D:x==null?void 0:x.fill});f.push(Lk({tooltipEntrySettings:V,dataKey:R,payload:X,value:ht(X,R),name:_==null?void 0:String(_)}))});else{var j;f.push(Lk({tooltipEntrySettings:x,dataKey:w,payload:k,value:ht(k,w),name:(j=ht(k,S))!==null&&j!==void 0?j:x==null?void 0:x.name}))}return f},d)}},N1=G([bn,j_,Db],v_),GZ=G([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),XZ=G([Pn,ql],h1),Cs=G([GZ,bn,XZ],m1,{memoizeOptions:{resultEqualityCheck:vm}}),QZ=G([Cs],e=>e.filter(gm)),lR=G([Cs],g1,{memoizeOptions:{resultEqualityCheck:vm}}),ZZ=G([Cs],e=>e.some(t=>!t.data)),ms=G([lR,hi],y1),JZ=G([QZ,hi,bn],DM),M1=G([ms,bn,Cs,hi,ZZ,lR],E_),cR=G([bn],x1),eJ=G([bn],e=>e.allowDataOverflow),uR=G([cR,eJ],gM),tJ=G([Cs],e=>e.filter(gm)),nJ=G([JZ,tJ,ad,TM],I_),rJ=G([nJ,hi,Pn,uR],O_),iJ=G([Cs],C_),aJ=G([ms,bn,iJ,Cm,Pn,gY],S1,{memoizeOptions:{resultEqualityCheck:ym}}),oJ=G([N_,Pn,ql],Ql),sJ=G([oJ,Pn],R_),lJ=G([M_,Pn,ql],Ql),cJ=G([lJ,Pn],D_),uJ=G([__,Pn,ql],Ql),dJ=G([uJ,Pn],L_),pJ=G([sJ,dJ,cJ],nh),fJ=G([bn,cR,uR,rJ,aJ,pJ,lt,Pn],j1),Rl=G([bn,lt,ms,M1,ad,Pn,fJ],k1),hJ=G([Rl,bn,N1],P1),mJ=G([bn,Rl,hJ,Pn],E1),dR=e=>{var t=Pn(e),n=ql(e),r=!1;return fd(e,t,n,r)},pR=G([bn,dR],pm),gJ=G([bn,N1,mJ,pR],p1),fR=G([gJ],Ub),yJ=G([lt,M1,bn,Pn],q_),vJ=G([lt,M1,bn,Pn],U_),xJ=(e,t,n,r,i,a,s,l)=>{if(t){var c=t.type,u=fi(e,l);if(r){var p=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,d=c==="category"&&r.bandwidth?r.bandwidth()/p:0;return d=l==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?jn(i[0]-i[1])*2*d:d,u&&s?s.map((f,m)=>{var g=r.map(f);return Je(g)?{coordinate:g+d,value:f,index:m,offset:d}:null}).filter(cr):r.domain().map((f,m)=>{var g=r.map(f);return Je(g)?{coordinate:g+d,value:a?a[f]:f,index:m,offset:d}:null}).filter(cr)}}},Ea=G([lt,bn,N1,fR,dR,yJ,vJ,Pn],xJ),_1=G([G_,X_,jZ],(e,t,n)=>Q_(n.shared,e,t)),hR=e=>e.tooltip.settings.trigger,R1=e=>e.tooltip.settings.defaultIndex,md=G([Zl,_1,hR,R1],rR),so=G([md,ms,_l,Rl],qc),mR=G([Ea,so],Z_),D1=G([md],e=>{if(e)return e.dataKey}),gR=G([md],e=>{if(e)return e.graphicalItemId}),yR=G([Zl,_1,hR,R1],aR),bJ=G([ja,ka,lt,vn,Ea,R1,yR],iR),wJ=G([md,bJ],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),SJ=G([md],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),jJ=G([yR,so,hi,_l,mR,oR,_1],sR),kJ=G([jJ],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function VP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function qP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VP(Object(n),!0).forEach(function(r){CJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CJ(e,t,n){return(t=PJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PJ(e){var t=AJ(e,"string");return typeof t=="symbol"?t:t+""}function AJ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var EJ=()=>Te(bn),TJ=()=>{var e=EJ(),t=Te(Ea),n=Te(fR);return oo(!e||!n?void 0:qP(qP({},e),{},{scale:n}),t)};function YP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _s(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YP(Object(n),!0).forEach(function(r){IJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function IJ(e,t,n){return(t=OJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OJ(e){var t=NJ(e,"string");return typeof t=="symbol"?t:t+""}function NJ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var MJ=(e,t,n,r)=>{var i=t.find(a=>a&&a.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.relativeY};if(e==="vertical")return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},_J=(e,t,n,r)=>{var i=t.find(u=>u&&u.index===n);if(i){if(e==="centric"){var a=i.coordinate,s=r.radius;return _s(_s(_s({},r),cn(r.cx,r.cy,s,a)),{},{angle:a,radius:s})}var l=i.coordinate,c=r.angle;return _s(_s(_s({},r),cn(r.cx,r.cy,l,c)),{},{angle:c,radius:l})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function RJ(e,t){var n=e.relativeX,r=e.relativeY;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var vR=(e,t,n,r,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(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var l=0;l<s;l++){var c,u,p,d,f,m=l>0?(c=n[l-1])===null||c===void 0?void 0:c.coordinate:(u=n[s-1])===null||u===void 0?void 0:u.coordinate,g=(p=n[l])===null||p===void 0?void 0:p.coordinate,v=l>=s-1?(d=n[0])===null||d===void 0?void 0:d.coordinate:(f=n[l+1])===null||f===void 0?void 0:f.coordinate,x=void 0;if(!(m==null||g==null||v==null))if(jn(g-m)!==jn(v-g)){var y=[];if(jn(v-g)===jn(i[1]-i[0])){x=v;var b=g+i[1]-i[0];y[0]=Math.min(b,(b+m)/2),y[1]=Math.max(b,(b+m)/2)}else{x=m;var w=v+i[1]-i[0];y[0]=Math.min(g,(w+g)/2),y[1]=Math.max(g,(w+g)/2)}var S=[Math.min(g,(x+g)/2),Math.max(g,(x+g)/2)];if(e>S[0]&&e<=S[1]||e>=y[0]&&e<=y[1]){var k;return(k=n[l])===null||k===void 0?void 0:k.index}}else{var j=Math.min(m,v),A=Math.max(m,v);if(e>(j+g)/2&&e<=(A+g)/2){var E;return(E=n[l])===null||E===void 0?void 0:E.index}}}else if(t)for(var D=0;D<s;D++){var O=t[D];if(O!=null){var _=t[D+1],R=t[D-1];if(D===0&&_!=null&&e<=(O.coordinate+_.coordinate)/2||D===s-1&&R!=null&&e>(O.coordinate+R.coordinate)/2||D>0&&D<s-1&&R!=null&&_!=null&&e>(O.coordinate+R.coordinate)/2&&e<=(O.coordinate+_.coordinate)/2)return O.index}}return-1},xR=()=>Te(Db),L1=(e,t)=>t,bR=(e,t,n)=>n,z1=(e,t,n,r)=>r,DJ=G(Ea,e=>qh(e,t=>t.coordinate)),$1=G([Zl,L1,bR,z1],rR),B1=G([$1,ms,_l,Rl],qc),LJ=(e,t,n)=>{if(t!=null){var r=Zl(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},wR=G([Zl,L1,bR,z1],aR),ih=G([ja,ka,lt,vn,Ea,z1,wR],iR),zJ=G([$1,ih],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),SR=G([Ea,B1],Z_),$J=G([wR,B1,hi,_l,SR,oR,L1],sR),BJ=G([$1,B1],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),FJ=(e,t,n,r,i,a,s)=>{if(!(!e||!n||!r||!i)&&RJ(e,s)){var l=$H(e,t),c=vR(l,a,i,n,r),u=MJ(t,i,c,e);return{activeIndex:String(c),activeCoordinate:u}}},UJ=(e,t,n,r,i,a,s)=>{if(!(!e||!r||!i||!a||!n)){var l=lY(e,n);if(l){var c=BH(l,t),u=vR(c,s,a,r,i),p=_J(t,a,u,l);return{activeIndex:String(u),activeCoordinate:p}}}},WJ=(e,t,n,r,i,a,s,l)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?FJ(e,t,r,i,a,s,l):UJ(e,t,n,r,i,a,s)},KJ=G(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),HJ=G(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(an)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:$Y}});function GP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function XP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GP(Object(n),!0).forEach(function(r){VJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VJ(e,t,n){return(t=qJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qJ(e){var t=YJ(e,"string");return typeof t=="symbol"?t:t+""}function YJ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var GJ={},XJ={zIndexMap:Object.values(an).reduce((e,t)=>XP(XP({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),GJ)},QJ=new Set(Object.values(an));function ZJ(e){return QJ.has(e)}var jR=Yn({name:"zIndex",initialState:XJ,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:Dt()},unregisterZIndexPortal:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!ZJ(n)&&delete e.zIndexMap[n])},prepare:Dt()},registerZIndexPortalElement:{reducer:(e,t)=>{var n=t.payload,r=n.zIndex,i=n.element,a=n.isPanorama;e.zIndexMap[r]?a?e.zIndexMap[r].panoramaElement=i:e.zIndexMap[r].element=i:e.zIndexMap[r]={consumers:0,element:a?void 0:i,panoramaElement:a?i:void 0}},prepare:Dt()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var n=t.payload.zIndex;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:Dt()}}}),Tm=jR.actions,JJ=Tm.registerZIndexPortal,dy=Tm.unregisterZIndexPortal,eee=Tm.registerZIndexPortalElement,tee=Tm.unregisterZIndexPortalElement,nee=jR.reducer;function ir(e){var t=e.zIndex,n=e.children,r=j7(),i=r&&t!==void 0&&t!==0,a=Cn(),s=h.useRef(void 0),l=h.useRef(new Set),c=St(),u=Te(d=>KJ(d,t,a));if(h.useLayoutEffect(()=>{if(!i){var d=l.current;d.forEach(m=>{c(dy({zIndex:m}))}),d.clear(),s.current=void 0;return}if(l.current.has(t)||(c(JJ({zIndex:t})),l.current.add(t)),u){s.current=u;var f=l.current;f.forEach(m=>{m!==t&&(c(dy({zIndex:m})),f.delete(m))})}},[c,t,i,u]),h.useLayoutEffect(()=>{var d=l.current;return()=>{d.forEach(f=>{c(dy({zIndex:f}))}),d.clear()}},[c]),!i)return n;var p=u??s.current;return p?Fu.createPortal(n,p):null}function Px(){return Px=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Px.apply(null,arguments)}function QP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ap(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QP(Object(n),!0).forEach(function(r){ree(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ree(e,t,n){return(t=iee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iee(e){var t=aee(e,"string");return typeof t=="symbol"?t:t+""}function aee(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function oee(e){var t=e.cursor,n=e.cursorComp,r=e.cursorProps;return h.isValidElement(t)?h.cloneElement(t,r):h.createElement(n,r)}function see(e){var t,n=e.coordinate,r=e.payload,i=e.index,a=e.offset,s=e.tooltipAxisBandSize,l=e.layout,c=e.cursor,u=e.tooltipEventType,p=e.chartName,d=n,f=r,m=i;if(!c||!d||p!=="ScatterChart"&&u!=="axis")return null;var g,v,x;if(p==="ScatterChart")g=d,v=vq,x=an.cursorLine;else if(p==="BarChart")g=xq(l,d,a,s),v=cM,x=an.cursorRectangle;else if(l==="radial"&&LO(d)){var y=dM(d),b=y.cx,w=y.cy,S=y.radius,k=y.startAngle,j=y.endAngle;g={cx:b,cy:w,startAngle:k,endAngle:j,innerRadius:S,outerRadius:S},v=fM,x=an.cursorLine}else g={points:pY(l,d,a)},v=fl,x=an.cursorLine;var A=typeof c=="object"&&"className"in c?c.className:void 0,E=ap(ap(ap(ap({stroke:"#ccc",pointerEvents:"none"},a),g),ls(c)),{},{payload:f,payloadIndex:m,className:mt("recharts-tooltip-cursor",A)});return h.createElement(ir,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:x},h.createElement(oee,{cursor:c,cursorComp:v,cursorProps:E}))}function lee(e){var t=TJ(),n=HN(),r=go(),i=xR();return t==null||n==null||r==null||i==null?null:h.createElement(see,Px({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var kR=h.createContext(null),cee=()=>h.useContext(kR),CR={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,u,p){this.fn=c,this.context=u,this.once=p||!1}function a(c,u,p,d,f){if(typeof p!="function")throw new TypeError("The listener must be a function");var m=new i(p,d||c,f),g=n?n+u:u;return c._events[g]?c._events[g].fn?c._events[g]=[c._events[g],m]:c._events[g].push(m):(c._events[g]=m,c._eventsCount++),c}function s(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],p,d;if(this._eventsCount===0)return u;for(d in p=this._events)t.call(p,d)&&u.push(n?d.slice(1):d);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(p)):u},l.prototype.listeners=function(u){var p=n?n+u:u,d=this._events[p];if(!d)return[];if(d.fn)return[d.fn];for(var f=0,m=d.length,g=new Array(m);f<m;f++)g[f]=d[f].fn;return g},l.prototype.listenerCount=function(u){var p=n?n+u:u,d=this._events[p];return d?d.fn?1:d.length:0},l.prototype.emit=function(u,p,d,f,m,g){var v=n?n+u:u;if(!this._events[v])return!1;var x=this._events[v],y=arguments.length,b,w;if(x.fn){switch(x.once&&this.removeListener(u,x.fn,void 0,!0),y){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,p),!0;case 3:return x.fn.call(x.context,p,d),!0;case 4:return x.fn.call(x.context,p,d,f),!0;case 5:return x.fn.call(x.context,p,d,f,m),!0;case 6:return x.fn.call(x.context,p,d,f,m,g),!0}for(w=1,b=new Array(y-1);w<y;w++)b[w-1]=arguments[w];x.fn.apply(x.context,b)}else{var S=x.length,k;for(w=0;w<S;w++)switch(x[w].once&&this.removeListener(u,x[w].fn,void 0,!0),y){case 1:x[w].fn.call(x[w].context);break;case 2:x[w].fn.call(x[w].context,p);break;case 3:x[w].fn.call(x[w].context,p,d);break;case 4:x[w].fn.call(x[w].context,p,d,f);break;default:if(!b)for(k=1,b=new Array(y-1);k<y;k++)b[k-1]=arguments[k];x[w].fn.apply(x[w].context,b)}}return!0},l.prototype.on=function(u,p,d){return a(this,u,p,d,!1)},l.prototype.once=function(u,p,d){return a(this,u,p,d,!0)},l.prototype.removeListener=function(u,p,d,f){var m=n?n+u:u;if(!this._events[m])return this;if(!p)return s(this,m),this;var g=this._events[m];if(g.fn)g.fn===p&&(!f||g.once)&&(!d||g.context===d)&&s(this,m);else{for(var v=0,x=[],y=g.length;v<y;v++)(g[v].fn!==p||f&&!g[v].once||d&&g[v].context!==d)&&x.push(g[v]);x.length?this._events[m]=x.length===1?x[0]:x:s(this,m)}return this},l.prototype.removeAllListeners=function(u){var p;return u?(p=n?n+u:u,this._events[p]&&s(this,p)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l})(CR);var uee=CR.exports;const dee=Ll(uee);var Mu=new dee,Ax="recharts.syncEvent.tooltip",ZP="recharts.syncEvent.brush",gd=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!ui(n))return e[n]}},pee={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},PR=Yn({name:"options",initialState:pee,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),fee=PR.reducer,hee=PR.actions.createEventEmitter;function mee(e){return e.tooltip.syncInteraction}var gee={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},AR=Yn({name:"chartData",initialState:gee,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 n=t.payload,r=n.startIndex,i=n.endIndex;r!=null&&(e.dataStartIndex=r),i!=null&&(e.dataEndIndex=i)}}}),F1=AR.actions,JP=F1.setChartData,yee=F1.setDataStartEndIndexes;F1.setComputedData;var vee=AR.reducer,xee=["x","y"];function eA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eA(Object(n),!0).forEach(function(r){bee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bee(e,t,n){return(t=wee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wee(e){var t=See(e,"string");return typeof t=="symbol"?t:t+""}function See(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jee(e,t){if(e==null)return{};var n,r,i=kee(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function kee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Cee(){var e=Te(Lb),t=Te(zb),n=St(),r=Te(IM),i=Te(Ea),a=go(),s=lm(),l=Te(c=>c.rootProps.className);h.useEffect(()=>{if(e==null)return ho;var c=(u,p,d)=>{if(t!==d&&e===u){if(p.payload.active===!1){n(Nc({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var f;if(s&&p!==null&&p!==void 0&&(f=p.payload)!==null&&f!==void 0&&f.coordinate&&p.payload.sourceViewBox){var m=p.payload.coordinate,g=m.x,v=m.y,x=jee(m,xee),y=p.payload.sourceViewBox,b=y.x,w=y.y,S=y.width,k=y.height,j=Rs(Rs({},x),{},{x:s.x+(S?(g-b)/S:0)*s.width,y:s.y+(k?(v-w)/k:0)*s.height});n(Rs(Rs({},p),{},{payload:Rs(Rs({},p.payload),{},{coordinate:j})}))}else n(p);return}if(i!=null){var A;if(typeof r=="function"){var E={activeTooltipIndex:p.payload.index==null?void 0:Number(p.payload.index),isTooltipActive:p.payload.active,activeIndex:p.payload.index==null?void 0:Number(p.payload.index),activeLabel:p.payload.label,activeDataKey:p.payload.dataKey,activeCoordinate:p.payload.coordinate},D=r(i,E);A=i[D]}else r==="value"&&(A=i.find(H=>String(H.value)===p.payload.label));var O=p.payload.coordinate;if(O==null||s==null){n(Nc({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(A==null){n(Nc({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:void 0}));return}var _=O.x,R=O.y,X=Math.min(_,s.x+s.width),V=Math.min(R,s.y+s.height),I={x:a==="horizontal"?A.coordinate:X,y:a==="horizontal"?V:A.coordinate},$=Nc({active:p.payload.active,coordinate:I,dataKey:p.payload.dataKey,index:String(A.index),label:p.payload.label,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:p.payload.graphicalItemId});n($)}}};return Mu.on(Ax,c),()=>{Mu.off(Ax,c)}},[l,n,t,e,r,i,a,s])}function Pee(){var e=Te(Lb),t=Te(zb),n=St();h.useEffect(()=>{if(e==null)return ho;var r=(i,a,s)=>{t!==s&&e===i&&n(yee(a))};return Mu.on(ZP,r),()=>{Mu.off(ZP,r)}},[n,t,e])}function Aee(){var e=St();h.useEffect(()=>{e(hee())},[e]),Cee(),Pee()}function Eee(e,t,n,r,i,a){var s=Te(g=>LJ(g,e,t)),l=Te(gR),c=Te(zb),u=Te(Lb),p=Te(IM),d=Te(mee),f=(d==null?void 0:d.sourceViewBox)!=null,m=lm();h.useEffect(()=>{if(!f&&u!=null&&c!=null){var g=Nc({active:a,coordinate:n,dataKey:s,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:m,graphicalItemId:l});Mu.emit(Ax,u,g,c)}},[f,n,s,l,i,r,c,u,p,a,m])}function tA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function nA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tA(Object(n),!0).forEach(function(r){Tee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tee(e,t,n){return(t=Iee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Iee(e){var t=Oee(e,"string");return typeof t=="symbol"?t:t+""}function Oee(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nee(e,t){return Dee(e)||Ree(e,t)||_ee(e,t)||Mee()}function Mee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
464
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _ee(e,t){if(e){if(typeof e=="string")return rA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rA(e,t):void 0}}function rA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ree(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Dee(e){if(Array.isArray(e))return e}function Lee(e){return e.dataKey}function zee(e,t){return h.isValidElement(e)?h.cloneElement(e,t):typeof e=="function"?h.createElement(e,t):h.createElement(LV,t)}var iA=[],$ee={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 Do(e){var t,n,r=dn(e,$ee),i=r.active,a=r.allowEscapeViewBox,s=r.animationDuration,l=r.animationEasing,c=r.content,u=r.filterNull,p=r.isAnimationActive,d=r.offset,f=r.payloadUniqBy,m=r.position,g=r.reverseDirection,v=r.useTranslate3d,x=r.wrapperStyle,y=r.cursor,b=r.shared,w=r.trigger,S=r.defaultIndex,k=r.portal,j=r.axisId,A=St(),E=typeof S=="number"?String(S):S;h.useEffect(()=>{A(EZ({shared:b,trigger:w,axisId:j,active:i,defaultIndex:E}))},[A,b,w,j,i,E]);var D=lm(),O=rM(),_=SZ(b),R=(t=Te(pe=>BJ(pe,_,w,E)))!==null&&t!==void 0?t:{},X=R.activeIndex,V=R.isActive,I=Te(pe=>$J(pe,_,w,E)),$=Te(pe=>SR(pe,_,w,E)),H=Te(pe=>zJ(pe,_,w,E)),N=I,U=cee(),P=(n=i??V)!==null&&n!==void 0?n:!1,W=aN([N,P]),se=Nee(W,2),T=se[0],he=se[1],ye=_==="axis"?$:void 0;Eee(_,w,H,ye,X,P);var Z=k??U;if(Z==null||D==null||_==null)return null;var le=N??iA;P||(le=iA),u&&le.length&&(le=XO(le.filter(pe=>pe.value!=null&&(pe.hide!==!0||r.includeHidden)),f,Lee));var Se=le.length>0,Q=nA(nA({},r),{},{payload:le,label:ye,active:P,activeIndex:X,coordinate:H,accessibilityLayer:O}),ne=h.createElement(iq,{allowEscapeViewBox:a,animationDuration:s,animationEasing:l,isAnimationActive:p,active:P,coordinate:H,hasPayload:Se,offset:d,position:m,reverseDirection:g,useTranslate3d:v,viewBox:D,wrapperStyle:x,lastBoundingBox:T,innerRef:he,hasPortalFromProps:!!k},zee(c,Q));return h.createElement(h.Fragment,null,Fu.createPortal(ne,Z),P&&h.createElement(lee,{cursor:y,tooltipEventType:_,coordinate:H,payload:le,index:X}))}var yd=e=>null;yd.displayName="Cell";function Bee(e,t,n){return(t=Fee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fee(e){var t=Uee(e,"string");return typeof t=="symbol"?t:t+""}function Uee(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Wee{constructor(t){Bee(this,"cache",new Map),this.maxSize=t}get(t){var n=this.cache.get(t);return n!==void 0&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var r=this.cache.keys().next().value;r!=null&&this.cache.delete(r)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function aA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Kee(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aA(Object(n),!0).forEach(function(r){Hee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hee(e,t,n){return(t=Vee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vee(e){var t=qee(e,"string");return typeof t=="symbol"?t:t+""}function qee(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Yee={cacheSize:2e3,enableCache:!0},ER=Kee({},Yee),oA=new Wee(ER.cacheSize),Gee={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},sA="recharts_measurement_span";function Xee(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",s=t.letterSpacing||"",l=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(s,"|").concat(l)}var lA=(e,t)=>{try{var n=document.getElementById(sA);n||(n=document.createElement("span"),n.setAttribute("id",sA),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,Gee,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},Yc=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||nd.isSsr)return{width:0,height:0};if(!ER.enableCache)return lA(t,n);var r=Xee(t,n),i=oA.get(r);if(i)return i;var a=lA(t,n);return oA.set(r,a),a},TR;function ah(e,t){return ete(e)||Jee(e,t)||Zee(e,t)||Qee()}function Qee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
465
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zee(e,t){if(e){if(typeof e=="string")return cA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cA(e,t):void 0}}function cA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Jee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function ete(e){if(Array.isArray(e))return e}function tte(e,t,n){return(t=nte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nte(e){var t=rte(e,"string");return typeof t=="symbol"?t:t+""}function rte(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var uA=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,dA=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,ite=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,ate=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,ote={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},ste=["cm","mm","pt","pc","in","Q","px"];function lte(e){return ste.includes(e)}var rl="NaN";function cte(e,t){return e*ote[t]}class Dn{static parse(t){var n,r=(n=ate.exec(t))!==null&&n!==void 0?n:[],i=ah(r,3),a=i[1],s=i[2];return a==null?Dn.NaN:new Dn(parseFloat(a),s??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,ui(t)&&(this.unit=""),n!==""&&!ite.test(n)&&(this.num=NaN,this.unit=""),lte(n)&&(this.num=cte(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Dn(NaN,""):new Dn(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Dn(NaN,""):new Dn(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Dn(NaN,""):new Dn(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Dn(NaN,""):new Dn(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return ui(this.num)}}TR=Dn;tte(Dn,"NaN",new TR(NaN,""));function IR(e){if(e==null||e.includes(rl))return rl;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=uA.exec(t))!==null&&n!==void 0?n:[],i=ah(r,4),a=i[1],s=i[2],l=i[3],c=Dn.parse(a??""),u=Dn.parse(l??""),p=s==="*"?c.multiply(u):c.divide(u);if(p.isNaN())return rl;t=t.replace(uA,p.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,f=(d=dA.exec(t))!==null&&d!==void 0?d:[],m=ah(f,4),g=m[1],v=m[2],x=m[3],y=Dn.parse(g??""),b=Dn.parse(x??""),w=v==="+"?y.add(b):y.subtract(b);if(w.isNaN())return rl;t=t.replace(dA,w.toString())}return t}var pA=/\(([^()]*)\)/;function ute(e){for(var t=e,n;(n=pA.exec(t))!=null;){var r=n,i=ah(r,2),a=i[1];t=t.replace(pA,IR(a))}return t}function dte(e){var t=e.replace(/\s+/g,"");return t=ute(t),t=IR(t),t}function pte(e){try{return dte(e)}catch{return rl}}function py(e){var t=pte(e.slice(5,-1));return t===rl?"":t}var fte=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],hte=["dx","dy","angle","className","breakAll"];function Ex(){return Ex=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ex.apply(null,arguments)}function fA(e,t){if(e==null)return{};var n,r,i=mte(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function mte(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function hA(e,t){return xte(e)||vte(e,t)||yte(e,t)||gte()}function gte(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
466
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yte(e,t){if(e){if(typeof e=="string")return mA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mA(e,t):void 0}}function mA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function vte(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function xte(e){if(Array.isArray(e))return e}var OR=/[ \f\n\r\t\v\u2028\u2029]+/,NR=e=>{var t=e.children,n=e.breakAll,r=e.style;try{var i=[];$t(t)||(n?i=t.toString().split(""):i=t.toString().split(OR));var a=i.map(l=>({word:l,width:Yc(l,r).width})),s=n?0:Yc(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:s}}catch{return null}};function MR(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function bte(e){return $t(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var _R=(e,t,n,r)=>e.reduce((i,a)=>{var s=a.word,l=a.width,c=i[i.length-1];if(c&&l!=null&&(t==null||r||c.width+l+n<Number(t)))c.words.push(s),c.width+=l+n;else{var u={words:[s],width:l};i.push(u)}return i},[]),RR=e=>e.reduce((t,n)=>t.width>n.width?t:n),wte="…",gA=(e,t,n,r,i,a,s,l)=>{var c=e.slice(0,t),u=NR({breakAll:n,style:r,children:c+wte});if(!u)return[!1,[]];var p=_R(u.wordsWithComputedWidth,a,s,l),d=p.length>i||RR(p).width>Number(a);return[d,p]},Ste=(e,t,n,r,i)=>{var a=e.maxLines,s=e.children,l=e.style,c=e.breakAll,u=Ce(a),p=String(s),d=_R(t,r,n,i);if(!u||i)return d;var f=d.length>a||RR(d).width>Number(r);if(!f)return d;for(var m=0,g=p.length-1,v=0,x;m<=g&&v<=p.length-1;){var y=Math.floor((m+g)/2),b=y-1,w=gA(p,b,c,l,a,r,n,i),S=hA(w,2),k=S[0],j=S[1],A=gA(p,y,c,l,a,r,n,i),E=hA(A,1),D=E[0];if(!k&&!D&&(m=y+1),k&&D&&(g=y-1),!k&&D){x=j;break}v++}return x||d},yA=e=>{var t=$t(e)?[]:e.toString().split(OR);return[{words:t,width:void 0}]},jte=e=>{var t=e.width,n=e.scaleToFit,r=e.children,i=e.style,a=e.breakAll,s=e.maxLines;if((t||n)&&!nd.isSsr){var l,c,u=NR({breakAll:a,children:r,style:i});if(u){var p=u.wordsWithComputedWidth,d=u.spaceWidth;l=p,c=d}else return yA(r);return Ste({breakAll:a,children:r,maxLines:s,style:i},l,c,t,!!n)}return yA(r)},DR="#808080",kte={angle:0,breakAll:!1,capHeight:"0.71em",fill:DR,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Im=h.forwardRef((e,t)=>{var n=dn(e,kte),r=n.x,i=n.y,a=n.lineHeight,s=n.capHeight,l=n.fill,c=n.scaleToFit,u=n.textAnchor,p=n.verticalAnchor,d=fA(n,fte),f=h.useMemo(()=>jte({breakAll:d.breakAll,children:d.children,maxLines:d.maxLines,scaleToFit:c,style:d.style,width:d.width}),[d.breakAll,d.children,d.maxLines,c,d.style,d.width]),m=d.dx,g=d.dy,v=d.angle,x=d.className,y=d.breakAll,b=fA(d,hte);if(!Bi(r)||!Bi(i)||f.length===0)return null;var w=Number(r)+(Ce(m)?m:0),S=Number(i)+(Ce(g)?g:0);if(!Je(w)||!Je(S))return null;var k;switch(p){case"start":k=py("calc(".concat(s,")"));break;case"middle":k=py("calc(".concat((f.length-1)/2," * -").concat(a," + (").concat(s," / 2))"));break;default:k=py("calc(".concat(f.length-1," * -").concat(a,")"));break}var j=[],A=f[0];if(c&&A!=null){var E=A.width,D=d.width;j.push("scale(".concat(Ce(D)&&Ce(E)?D/E:1,")"))}return v&&j.push("rotate(".concat(v,", ").concat(w,", ").concat(S,")")),j.length&&(b.transform=j.join(" ")),h.createElement("text",Ex({},mr(b),{ref:t,x:w,y:S,className:mt("recharts-text",x),textAnchor:u,fill:l.includes("url")?DR:l}),f.map((O,_)=>{var R=O.words.join(y?"":" ");return h.createElement("tspan",{x:w,dy:_===0?k:a,key:"".concat(R,"-").concat(_)},R)}))});Im.displayName="Text";function vA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vA(Object(n),!0).forEach(function(r){Cte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cte(e,t,n){return(t=Pte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pte(e){var t=Ate(e,"string");return typeof t=="symbol"?t:t+""}function Ate(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ete=e=>{var t=e.viewBox,n=e.position,r=e.offset,i=r===void 0?0:r,a=e.parentViewBox,s=Cb(t),l=s.x,c=s.y,u=s.height,p=s.upperWidth,d=s.lowerWidth,f=l,m=l+(p-d)/2,g=(f+m)/2,v=(p+d)/2,x=f+p/2,y=u>=0?1:-1,b=y*i,w=y>0?"end":"start",S=y>0?"start":"end",k=p>=0?1:-1,j=k*i,A=k>0?"end":"start",E=k>0?"start":"end",D=a;if(n==="top"){var O={x:f+p/2,y:c-b,horizontalAnchor:"middle",verticalAnchor:w};return D&&(O.height=Math.max(c-D.y,0),O.width=p),O}if(n==="bottom"){var _={x:m+d/2,y:c+u+b,horizontalAnchor:"middle",verticalAnchor:S};return D&&(_.height=Math.max(D.y+D.height-(c+u),0),_.width=d),_}if(n==="left"){var R={x:g-j,y:c+u/2,horizontalAnchor:A,verticalAnchor:"middle"};return D&&(R.width=Math.max(R.x-D.x,0),R.height=u),R}if(n==="right"){var X={x:g+v+j,y:c+u/2,horizontalAnchor:E,verticalAnchor:"middle"};return D&&(X.width=Math.max(D.x+D.width-X.x,0),X.height=u),X}var V=D?{width:v,height:u}:{};return n==="insideLeft"?wi({x:g+j,y:c+u/2,horizontalAnchor:E,verticalAnchor:"middle"},V):n==="insideRight"?wi({x:g+v-j,y:c+u/2,horizontalAnchor:A,verticalAnchor:"middle"},V):n==="insideTop"?wi({x:f+p/2,y:c+b,horizontalAnchor:"middle",verticalAnchor:S},V):n==="insideBottom"?wi({x:m+d/2,y:c+u-b,horizontalAnchor:"middle",verticalAnchor:w},V):n==="insideTopLeft"?wi({x:f+j,y:c+b,horizontalAnchor:E,verticalAnchor:S},V):n==="insideTopRight"?wi({x:f+p-j,y:c+b,horizontalAnchor:A,verticalAnchor:S},V):n==="insideBottomLeft"?wi({x:m+j,y:c+u-b,horizontalAnchor:E,verticalAnchor:w},V):n==="insideBottomRight"?wi({x:m+d-j,y:c+u-b,horizontalAnchor:A,verticalAnchor:w},V):n&&typeof n=="object"&&(Ce(n.x)||us(n.x))&&(Ce(n.y)||us(n.y))?wi({x:l+Hn(n.x,v),y:c+Hn(n.y,u),horizontalAnchor:"end",verticalAnchor:"end"},V):wi({x,y:c+u/2,horizontalAnchor:"middle",verticalAnchor:"middle"},V)},Tte=["labelRef"],Ite=["content"];function xA(e,t){if(e==null)return{};var n,r,i=Ote(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ote(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function bA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Mc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bA(Object(n),!0).forEach(function(r){Nte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nte(e,t,n){return(t=Mte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mte(e){var t=_te(e,"string");return typeof t=="symbol"?t:t+""}function _te(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ra(){return ra=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ra.apply(null,arguments)}var LR=h.createContext(null),Rte=e=>{var t=e.x,n=e.y,r=e.upperWidth,i=e.lowerWidth,a=e.width,s=e.height,l=e.children,c=h.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:s}),[t,n,r,i,a,s]);return h.createElement(LR.Provider,{value:c},l)},zR=()=>{var e=h.useContext(LR),t=lm();return e||(t?Cb(t):void 0)},Dte=h.createContext(null),Lte=()=>{var e=h.useContext(Dte),t=Te(RM);return e||t},zte=e=>{var t=e.value,n=e.formatter,r=$t(e.children)?t:e.children;return typeof n=="function"?n(r):r},U1=e=>e!=null&&typeof e=="function",$te=(e,t)=>{var n=jn(t-e),r=Math.min(Math.abs(t-e),360);return n*r},Bte=(e,t,n,r,i)=>{var a=e.offset,s=e.className,l=i.cx,c=i.cy,u=i.innerRadius,p=i.outerRadius,d=i.startAngle,f=i.endAngle,m=i.clockWise,g=(u+p)/2,v=$te(d,f),x=v>=0?1:-1,y,b;switch(t){case"insideStart":y=d+x*a,b=m;break;case"insideEnd":y=f-x*a,b=!m;break;case"end":y=f+x*a,b=m;break;default:throw new Error("Unsupported position ".concat(t))}b=v<=0?b:!b;var w=cn(l,c,g,y),S=cn(l,c,g,y+(b?1:-1)*359),k="M".concat(w.x,",").concat(w.y,`
|
|
467
|
+
A`).concat(g,",").concat(g,",0,1,").concat(b?0:1,`,
|
|
468
|
+
`).concat(S.x,",").concat(S.y),j=$t(e.id)?bu("recharts-radial-line-"):e.id;return h.createElement("text",ra({},r,{dominantBaseline:"central",className:mt("recharts-radial-bar-label",s)}),h.createElement("defs",null,h.createElement("path",{id:j,d:k})),h.createElement("textPath",{xlinkHref:"#".concat(j)},n))},Fte=(e,t,n)=>{var r=e.cx,i=e.cy,a=e.innerRadius,s=e.outerRadius,l=e.startAngle,c=e.endAngle,u=(l+c)/2;if(n==="outside"){var p=cn(r,i,s+t,u),d=p.x,f=p.y;return{x:d,y:f,textAnchor:d>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var m=(a+s)/2,g=cn(r,i,m,u),v=g.x,x=g.y;return{x:v,y:x,textAnchor:"middle",verticalAnchor:"middle"}},Lp=e=>e!=null&&"cx"in e&&Ce(e.cx),Ute={angle:0,offset:5,zIndex:an.label,position:"middle",textBreakAll:!1};function Wte(e){if(!Lp(e))return e;var t=e.cx,n=e.cy,r=e.outerRadius,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function Ba(e){var t=dn(e,Ute),n=t.viewBox,r=t.parentViewBox,i=t.position,a=t.value,s=t.children,l=t.content,c=t.className,u=c===void 0?"":c,p=t.textBreakAll,d=t.labelRef,f=Lte(),m=zR(),g=i==="center"?m:f??m,v,x,y;n==null?v=g:Lp(n)?v=n:v=Cb(n);var b=Wte(v);if(!v||$t(a)&&$t(s)&&!h.isValidElement(l)&&typeof l!="function")return null;var w=Mc(Mc({},t),{},{viewBox:v});if(h.isValidElement(l)){w.labelRef;var S=xA(w,Tte);return h.cloneElement(l,S)}if(typeof l=="function"){w.content;var k=xA(w,Ite);if(x=h.createElement(l,k),h.isValidElement(x))return x}else x=zte(t);var j=mr(t);if(Lp(v)){if(i==="insideStart"||i==="insideEnd"||i==="end")return Bte(t,i,x,j,v);y=Fte(v,t.offset,t.position)}else{if(!b)return null;var A=Ete({viewBox:b,position:i,offset:t.offset,parentViewBox:Lp(r)?void 0:r});y=Mc(Mc({x:A.x,y:A.y,textAnchor:A.horizontalAnchor,verticalAnchor:A.verticalAnchor},A.width!==void 0?{width:A.width}:{}),A.height!==void 0?{height:A.height}:{})}return h.createElement(ir,{zIndex:t.zIndex},h.createElement(Im,ra({ref:d,className:mt("recharts-label",u)},j,y,{textAnchor:MR(j.textAnchor)?j.textAnchor:y.textAnchor,breakAll:p}),x))}Ba.displayName="Label";var Kte=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?h.createElement(Ba,ra({key:"label-implicit"},r)):Bi(e)?h.createElement(Ba,ra({key:"label-implicit",value:e},r)):h.isValidElement(e)?e.type===Ba?h.cloneElement(e,Mc({key:"label-implicit"},r)):h.createElement(Ba,ra({key:"label-implicit",content:e},r)):U1(e)?h.createElement(Ba,ra({key:"label-implicit",content:e},r)):e&&typeof e=="object"?h.createElement(Ba,ra({},e,{key:"label-implicit"},r)):null};function Hte(e){var t=e.label,n=e.labelRef,r=zR();return Kte(t,r,n)||null}var Vte=["valueAccessor"],qte=["dataKey","clockWise","id","textBreakAll","zIndex"];function oh(){return oh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oh.apply(null,arguments)}function wA(e,t){if(e==null)return{};var n,r,i=Yte(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Yte(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Gte=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(bte(t))return t},$R=h.createContext(void 0),W1=$R.Provider,BR=h.createContext(void 0),Xte=BR.Provider;function Qte(){return h.useContext($R)}function Zte(){return h.useContext(BR)}function zp(e){var t=e.valueAccessor,n=t===void 0?Gte:t,r=wA(e,Vte),i=r.dataKey;r.clockWise;var a=r.id,s=r.textBreakAll,l=r.zIndex,c=wA(r,qte),u=Qte(),p=Zte(),d=u||p;return!d||!d.length?null:h.createElement(ir,{zIndex:l??an.label},h.createElement(Xt,{className:"recharts-label-list"},d.map((f,m)=>{var g,v=$t(i)?n(f,m):ht(f.payload,i),x=$t(a)?{}:{id:"".concat(a,"-").concat(m)};return h.createElement(Ba,oh({key:"label-".concat(m)},mr(f),c,x,{fill:(g=r.fill)!==null&&g!==void 0?g:f.fill,parentViewBox:f.parentViewBox,value:v,textBreakAll:s,viewBox:f.viewBox,index:m,zIndex:0}))})))}zp.displayName="LabelList";function Om(e){var t=e.label;return t?t===!0?h.createElement(zp,{key:"labelList-implicit"}):h.isValidElement(t)||U1(t)?h.createElement(zp,{key:"labelList-implicit",content:t}):typeof t=="object"?h.createElement(zp,oh({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Tx(){return Tx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tx.apply(null,arguments)}var FR=e=>{var t=e.cx,n=e.cy,r=e.r,i=e.className,a=mt("recharts-dot",i);return Ce(t)&&Ce(n)&&Ce(r)?h.createElement("circle",Tx({},er(e),hb(e),{className:a,cx:t,cy:n,r})):null},UR=e=>e.graphicalItems.polarItems,Jte=G([Qt,od],h1),Nm=G([UR,tn,Jte],m1),ene=G([Nm],g1),Mm=G([ene,rd],y1),tne=G([Mm,tn,Nm],A_);G([Mm,tn,Nm],(e,t,n)=>n.length>0?e.flatMap(r=>n.flatMap(i=>{var a,s=ht(r,(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(r=>({value:ht(r,t.dataKey),errorDomain:[]})):e.map(r=>({value:r,errorDomain:[]})));var SA=()=>{},nne=G([Mm,tn,Nm,Cm,Qt,mY],S1),rne=G([tn,b1,w1,SA,nne,SA,lt,Qt],j1),WR=G([tn,lt,Mm,tne,ad,Qt,rne],k1),ine=G([WR,Gl,xo],P1),ane=G([tn,WR,ine,Qt],E1);G([xo,ane],LM);var one={radiusAxis:{},angleAxis:{}},KR=Yn({name:"polarAxis",initialState:one,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]}}}),_m=KR.actions;_m.addRadiusAxis;_m.removeRadiusAxis;_m.addAngleAxis;_m.removeAngleAxis;var sne=KR.reducer;function HR(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}function jA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jA(Object(n),!0).forEach(function(r){lne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lne(e,t,n){return(t=cne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cne(e){var t=une(e,"string");return typeof t=="symbol"?t:t+""}function une(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var dne=(e,t)=>t,K1=G([UR,dne],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),pne=[],H1=(e,t,n)=>(n==null?void 0:n.length)===0?pne:n,VR=G([rd,K1,H1],(e,t,n)=>{var r=e.chartData;if(t!=null){var i;if((t==null?void 0:t.data)!=null&&t.data.length>0?i=t.data:i=r,(!i||!i.length)&&n!=null&&(i=n.map(a=>kA(kA({},t.presentationProps),a.props))),i!=null)return i}}),fne=G([VR,K1,H1],(e,t,n)=>{if(!(e==null||t==null))return e.map((r,i)=>{var a,s=ht(r,t.nameKey,t.name),l;return n!=null&&(a=n[i])!==null&&a!==void 0&&(a=a.props)!==null&&a!==void 0&&a.fill?l=n[i].props.fill:typeof r=="object"&&r!=null&&"fill"in r?l=r.fill:l=t.fill,{value:mo(s,t.dataKey),dataKey:t.dataKey,color:l,payload:r,type:t.legendType}})}),hne=G([VR,K1,H1,vn],(e,t,n,r)=>{if(!(t==null||e==null))return Cre({offset:r,pieSettings:t,displayedData:e,cells:n})}),qR={exports:{}},Et={};/**
|
|
469
|
+
* @license React
|
|
470
|
+
* react-is.production.js
|
|
471
|
+
*
|
|
472
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
473
|
+
*
|
|
474
|
+
* This source code is licensed under the MIT license found in the
|
|
475
|
+
* LICENSE file in the root directory of this source tree.
|
|
476
|
+
*/var V1=Symbol.for("react.transitional.element"),q1=Symbol.for("react.portal"),Rm=Symbol.for("react.fragment"),Dm=Symbol.for("react.strict_mode"),Lm=Symbol.for("react.profiler"),zm=Symbol.for("react.consumer"),$m=Symbol.for("react.context"),Bm=Symbol.for("react.forward_ref"),Fm=Symbol.for("react.suspense"),Um=Symbol.for("react.suspense_list"),Wm=Symbol.for("react.memo"),Km=Symbol.for("react.lazy"),mne=Symbol.for("react.view_transition"),gne=Symbol.for("react.client.reference");function Xr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case V1:switch(e=e.type,e){case Rm:case Lm:case Dm:case Fm:case Um:case mne:return e;default:switch(e=e&&e.$$typeof,e){case $m:case Bm:case Km:case Wm:return e;case zm:return e;default:return t}}case q1:return t}}}Et.ContextConsumer=zm;Et.ContextProvider=$m;Et.Element=V1;Et.ForwardRef=Bm;Et.Fragment=Rm;Et.Lazy=Km;Et.Memo=Wm;Et.Portal=q1;Et.Profiler=Lm;Et.StrictMode=Dm;Et.Suspense=Fm;Et.SuspenseList=Um;Et.isContextConsumer=function(e){return Xr(e)===zm};Et.isContextProvider=function(e){return Xr(e)===$m};Et.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===V1};Et.isForwardRef=function(e){return Xr(e)===Bm};Et.isFragment=function(e){return Xr(e)===Rm};Et.isLazy=function(e){return Xr(e)===Km};Et.isMemo=function(e){return Xr(e)===Wm};Et.isPortal=function(e){return Xr(e)===q1};Et.isProfiler=function(e){return Xr(e)===Lm};Et.isStrictMode=function(e){return Xr(e)===Dm};Et.isSuspense=function(e){return Xr(e)===Fm};Et.isSuspenseList=function(e){return Xr(e)===Um};Et.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Rm||e===Lm||e===Dm||e===Fm||e===Um||typeof e=="object"&&e!==null&&(e.$$typeof===Km||e.$$typeof===Wm||e.$$typeof===$m||e.$$typeof===zm||e.$$typeof===Bm||e.$$typeof===gne||e.getModuleId!==void 0)};Et.typeOf=Xr;qR.exports=Et;var yne=qR.exports,CA=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",PA=null,fy=null,YR=e=>{if(e===PA&&Array.isArray(fy))return fy;var t=[];return h.Children.forEach(e,n=>{$t(n)||(yne.isFragment(n)?t=t.concat(YR(n.props.children)):t.push(n))}),fy=t,PA=e,t};function Y1(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>CA(i)):r=[CA(t)],YR(e).forEach(i=>{var a=$i(i,"type.displayName")||$i(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var G1=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function AA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function EA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AA(Object(n),!0).forEach(function(r){vne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vne(e,t,n){return(t=xne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xne(e){var t=bne(e,"string");return typeof t=="symbol"?t:t+""}function bne(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function GR(e,t){return EA(EA({},t),e)}function wne(e){return h.isValidElement(e)?e.props:e}function Sne(e,t){return h.cloneElement(e,GR(wne(e),t))}function jne(e){if("index"in e){var t=e.index;return typeof t=="number"||typeof t=="string"?t:void 0}}function kne(e){return"isActive"in e&&e.isActive===!0}function Hm(e){var t=e.option,n=e.DefaultShape,r=e.shapeProps,i=e.activeClassName,a=i===void 0?"recharts-active-shape":i,s=e.inActiveClassName,l=s===void 0?"recharts-shape":s,c=jne(r),u;return h.isValidElement(t)?u=Sne(t,r):t===n?u=h.createElement(n,r):typeof t=="function"?u=t(r,c):typeof t=="object"?u=h.createElement(n,GR(t,r)):u=h.createElement(n,r),kne(r)?h.createElement(Xt,{className:a},u):h.createElement(Xt,{className:l},u)}var X1=(e,t,n)=>{var r=St();return(i,a)=>s=>{e==null||e(i,a,s),r(eR({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},Q1=e=>{var t=St();return(n,r)=>i=>{e==null||e(n,r,i),t(TZ())}},Z1=(e,t,n)=>{var r=St();return(i,a)=>s=>{e==null||e(i,a,s),r(IZ({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function Vm(e){var t=e.tooltipEntrySettings,n=St(),r=Cn(),i=h.useRef(null);return h.useLayoutEffect(()=>{r||(i.current===null?n(CZ(t)):i.current!==t&&n(PZ({prev:i.current,next:t})),i.current=t)},[t,n,r]),h.useLayoutEffect(()=>()=>{i.current&&(n(AZ(i.current)),i.current=null)},[n]),null}function J1(e){var t=e.legendPayload,n=St(),r=Cn(),i=h.useRef(null);return h.useLayoutEffect(()=>{r||(i.current===null?n(JN(t)):i.current!==t&&n(eM({prev:i.current,next:t})),i.current=t)},[n,r,t]),h.useLayoutEffect(()=>()=>{i.current&&(n(tM(i.current)),i.current=null)},[n]),null}function Cne(e){var t=e.legendPayload,n=St(),r=Te(lt),i=h.useRef(null);return h.useLayoutEffect(()=>{r!=="centric"&&r!=="radial"||(i.current===null?n(JN(t)):i.current!==t&&n(eM({prev:i.current,next:t})),i.current=t)},[n,r,t]),h.useLayoutEffect(()=>()=>{i.current&&(n(tM(i.current)),i.current=null)},[n]),null}function Pne(e,t){return Ine(e)||Tne(e,t)||Ene(e,t)||Ane()}function Ane(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
477
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ene(e,t){if(e){if(typeof e=="string")return TA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?TA(e,t):void 0}}function TA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Tne(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Ine(e){if(Array.isArray(e))return e}var qm="index",ew="append";function tw(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=[];for(var i of n)r.push({status:"removed",prev:i});for(var a=0;a<t.length;a++){var s=e[a],l=t[a];s!=null?r.push({status:"matched",prev:s,next:l}):r.push({status:"added",next:l})}return r}function One(e,t){var n=e.length/t.length,r=t.map((i,a)=>e[Math.floor(a*n)]);return tw(r,t)}function Nne(e,t){var n=t.map((r,i)=>e[i]);return tw(n,t)}function Mne(e,t){for(var n=new Map,r=0;r<e.length;r++){var i=e[r];if(i!=null){var a=t(i,r);a!=null&&!n.has(a)&&n.set(a,i)}}return n}function _ne(e,t,n){var r=Mne(e,n),i=new Set,a=t.map((d,f)=>{var m=n(d,f);if(m!=null){var g=r.get(m);if(g!==void 0)return i.add(m),g}}),s=[];for(var l of r){var c=Pne(l,2),u=c[0],p=c[1];i.has(u)||s.push(p)}return tw(a,t,s)}function Ix(e,t,n){return t==null?null:e==null?t.map(r=>({status:"added",next:r})):n===qm?One(e,t):n===ew?Nne(e,t):_ne(e,t,n)}function XR(e,t){var n=h.useRef(e),r=h.useRef(t.current),i=h.useRef(!0);n.current!==e&&(n.current=e,r.current=t.current,i.current=!1);var a=h.useCallback(function(s,l){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(l===0){i.current=!0;return}l===1&&(r.current=s),l>0&&i.current&&c&&(t.current=s)},[t]);return{startValue:r.current,syncStepValue:a}}function Rne(e,t){return $ne(e)||zne(e,t)||Lne(e,t)||Dne()}function Dne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
478
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lne(e,t){if(e){if(typeof e=="string")return IA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?IA(e,t):void 0}}function IA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function zne(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function $ne(e){if(Array.isArray(e))return e}function Ym(e,t){var n=h.useState(!1),r=Rne(n,2),i=r[0],a=r[1],s=h.useCallback(()=>{typeof e=="function"&&e(),a(!0)},[e]),l=h.useCallback(()=>{typeof t=="function"&&t(),a(!1)},[t]);return{isAnimating:i,handleAnimationStart:s,handleAnimationEnd:l}}function Gm(e){var t,n=e.animationInput,r=e.animationIdPrefix,i=e.items,a=e.previousItemsRef,s=e.isAnimationActive,l=e.animationBegin,c=e.animationDuration,u=e.animationEasing,p=e.onAnimationStart,d=e.onAnimationEnd,f=e.animationInterpolateFn,m=e.animationMatchBy,g=e.shouldUpdatePreviousRef,v=e.children,x=e.layout,y=lM(n,r),b=XR(y,a),w=(t=b.startValue)!==null&&t!==void 0?t:null,S=Ix(w,i,m??qm);return h.createElement(sM,{animationId:y,begin:l,duration:c,isActive:s,easing:u,onAnimationEnd:d,onAnimationStart:p,key:y},k=>{var j=w==null,A=i==null?i:f(S,k,x),E=g?g(k):k>0;return b.syncStepValue(A,k,E),A==null?null:v(A,k,j)})}var hy;function Bne(e,t){return Kne(e)||Wne(e,t)||Une(e,t)||Fne()}function Fne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
479
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Une(e,t){if(e){if(typeof e=="string")return OA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?OA(e,t):void 0}}function OA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Wne(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Kne(e){if(Array.isArray(e))return e}var Hne=()=>{var e=h.useState(()=>bu("uid-")),t=Bne(e,1),n=t[0];return n},QR=(hy=rE.useId)!==null&&hy!==void 0?hy:Hne;function Vne(e,t){var n=QR();return t||(e?"".concat(e,"-").concat(n):n)}var qne=h.createContext(void 0),Xm=e=>{var t=e.id,n=e.type,r=e.children,i=Vne("recharts-".concat(n),t);return h.createElement(qne.Provider,{value:i},r(i))},Yne={cartesianItems:[],polarItems:[]},ZR=Yn({name:"graphicalItems",initialState:Yne,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Dt()},replaceCartesianGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Ur(e).cartesianItems.indexOf(r);a>-1&&(e.cartesianItems[a]=i)},prepare:Dt()},removeCartesianGraphicalItem:{reducer(e,t){var n=Ur(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:Dt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Dt()},removePolarGraphicalItem:{reducer(e,t){var n=Ur(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:Dt()},replacePolarGraphicalItem:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next,a=Ur(e).polarItems.indexOf(r);a>-1&&(e.polarItems[a]=i)},prepare:Dt()}}}),Jl=ZR.actions,Gne=Jl.addCartesianGraphicalItem,Xne=Jl.replaceCartesianGraphicalItem,Qne=Jl.removeCartesianGraphicalItem,Zne=Jl.addPolarGraphicalItem,Jne=Jl.removePolarGraphicalItem,ere=Jl.replacePolarGraphicalItem,tre=ZR.reducer,nre=e=>{var t=St(),n=h.useRef(null);return h.useLayoutEffect(()=>{n.current===null?t(Gne(e)):n.current!==e&&t(Xne({prev:n.current,next:e})),n.current=e},[t,e]),h.useLayoutEffect(()=>()=>{n.current&&(t(Qne(n.current)),n.current=null)},[t]),null},nw=h.memo(nre),rre=e=>{var t=St(),n=h.useRef(null);return h.useLayoutEffect(()=>{n.current===null?t(Zne(e)):n.current!==e&&t(ere({prev:n.current,next:e})),n.current=e},[t,e]),h.useLayoutEffect(()=>()=>{n.current&&(t(Jne(n.current)),n.current=null)},[t]),null},ire=h.memo(rre),are=["key"],ore=["onMouseEnter","onClick","onMouseLeave"],sre=["id"],lre=["id"];function gs(){return gs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gs.apply(null,arguments)}function Qm(e,t){if(e==null)return{};var n,r,i=cre(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function cre(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function NA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ft(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NA(Object(n),!0).forEach(function(r){ure(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ure(e,t,n){return(t=dre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dre(e){var t=pre(e,"string");return typeof t=="symbol"?t:t+""}function pre(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var JR=fM;function fre(e){var t=h.useMemo(()=>Y1(e.children,yd),[e.children]),n=Te(r=>fne(r,e.id,t));return n==null?null:h.createElement(Cne,{legendPayload:n})}function hre(e){if(!(e==null||typeof e=="boolean"||typeof e=="function")){if(h.isValidElement(e)){var t,n=(t=e.props)===null||t===void 0?void 0:t.fill;return typeof n=="string"?n:void 0}var r=e.fill;return typeof r=="string"?r:void 0}}var mre=h.memo(e=>{var t=e.dataKey,n=e.nameKey,r=e.sectors,i=e.stroke,a=e.strokeWidth,s=e.fill,l=e.name,c=e.hide,u=e.tooltipType,p=e.id,d=e.activeShape,f=hre(d),m=r.map(v=>{var x=v.tooltipPayload;return f==null||x==null?x:x.map(y=>Ft(Ft({},y),{},{color:f,fill:f}))}),g={dataDefinedOnItem:m,getPosition:v=>{var x;return(x=r[Number(v)])===null||x===void 0?void 0:x.tooltipPosition},settings:{stroke:i,strokeWidth:a,fill:s,dataKey:t,nameKey:n,name:mo(l,t),hide:c,type:u,color:s,unit:"",graphicalItemId:p}};return h.createElement(Vm,{tooltipEntrySettings:g})}),gre=(e,t)=>e>t?"start":e<t?"end":"middle",yre=(e,t,n)=>Hn(typeof t=="function"?t(e):t,n,n*.8),vre=(e,t,n)=>{var r=t.top,i=t.left,a=t.width,s=t.height,l=uM(a,s),c=i+Hn(e.cx,a,a/2),u=r+Hn(e.cy,s,s/2),p=Hn(e.innerRadius,l,0),d=yre(n,e.outerRadius,l),f=e.maxRadius||Math.sqrt(a*a+s*s)/2;return{cx:c,cy:u,innerRadius:p,outerRadius:d,maxRadius:f}},xre=(e,t)=>{var n=jn(t-e),r=Math.min(Math.abs(t-e),360);return n*r},bre=(e,t)=>{if(h.isValidElement(e))return h.cloneElement(e,t);if(typeof e=="function")return e(t);var n=mt("recharts-pie-label-line",typeof e!="boolean"?e.className:"");t.key;var r=Qm(t,are);return h.createElement(fl,gs({},r,{type:"linear",className:n}))},wre=(e,t,n)=>{if(h.isValidElement(e))return h.cloneElement(e,t);var r=n;if(typeof e=="function"&&(r=e(t),h.isValidElement(r)))return r;var i=mt("recharts-pie-label-text",HR(e));return h.createElement(Im,gs({},t,{alignmentBaseline:"middle",className:i}),r)};function Sre(e){var t=e.sectors,n=e.props,r=e.showLabels,i=n.label,a=n.labelLine,s=n.dataKey;if(!r||!i||!t)return null;var l=er(n),c=ls(i),u=ls(a),p=typeof i=="object"&&"offsetRadius"in i&&typeof i.offsetRadius=="number"&&i.offsetRadius||20,d=t.map((f,m)=>{var g=(f.startAngle+f.endAngle)/2,v=cn(f.cx,f.cy,f.outerRadius+p,g),x=Ft(Ft(Ft(Ft({},l),f),{},{stroke:"none"},c),{},{index:m,textAnchor:gre(v.x,f.cx)},v),y=Ft(Ft(Ft(Ft({},l),f),{},{fill:"none",stroke:f.fill},u),{},{index:m,points:[cn(f.cx,f.cy,f.outerRadius,g),v],key:"line"});return h.createElement(ir,{zIndex:an.label,key:"label-".concat(f.startAngle,"-").concat(f.endAngle,"-").concat(f.midAngle,"-").concat(m)},h.createElement(Xt,null,a&&bre(a,y),wre(i,x,ht(f,s))))});return h.createElement(Xt,{className:"recharts-pie-labels"},d)}function jre(e){var t=e.sectors,n=e.props,r=e.showLabels,i=n.label;return typeof i=="object"&&i!=null&&"position"in i?h.createElement(Om,{label:i}):h.createElement(Sre,{sectors:t,props:n,showLabels:r})}function kre(e){var t=e.sectors,n=e.activeShape,r=e.inactiveShape,i=e.allOtherPieProps,a=e.shape,s=e.id,l=e.animationElapsedTime,c=e.isAnimating,u=e.isEntrance,p=Te(so),d=Te(D1),f=Te(gR),m=i.onMouseEnter,g=i.onClick,v=i.onMouseLeave,x=Qm(i,ore),y=X1(m,i.dataKey,s),b=Q1(v),w=Z1(g,i.dataKey,s);return t==null||t.length===0?null:h.createElement(h.Fragment,null,t.map((S,k)=>{if((S==null?void 0:S.startAngle)===0&&(S==null?void 0:S.endAngle)===0&&t.length!==1)return null;var j=f==null||f===s,A=String(k)===p&&(d==null||i.dataKey===d)&&j,E=p?r:null,D=n&&A?n:E,O=Ft(Ft({},S),{},{stroke:S.stroke,tabIndex:-1,index:k,isActive:A,animationElapsedTime:l,isAnimating:c,isEntrance:u,[BN]:k,[FN]:s});return h.createElement(Xt,gs({key:"sector-".concat(S==null?void 0:S.startAngle,"-").concat(S==null?void 0:S.endAngle,"-").concat(S.midAngle,"-").concat(k),tabIndex:-1,className:"recharts-pie-sector"},Yu(x,S,k),{onMouseEnter:y(S,k),onMouseLeave:b(S,k),onClick:w(S,k)}),h.createElement(Hm,{option:D??a,DefaultShape:JR,shapeProps:O}))}))}function Cre(e){var t,n=e.pieSettings,r=e.displayedData,i=e.cells,a=e.offset,s=n.cornerRadius,l=n.startAngle,c=n.endAngle,u=n.dataKey,p=n.nameKey,d=n.tooltipType,f=Math.abs(n.minAngle),m=xre(l,c),g=Math.abs(m),v=r.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,x=r.filter(E=>ht(E,u,0)!==0).length,y=(g>=360?x:x-1)*v,b=r.reduce((E,D)=>{var O=ht(D,u,0);return E+(Ce(O)?O:0)},0),w=f>0&&b>0&&r.some(E=>{var D=ht(E,u,0),O=(Ce(D)?D:0)/b;return D!==0&&O*g<f}),S=w?f:0,k=g-x*S-y,j;if(b>0){var A;j=r.map((E,D)=>{var O=ht(E,u,0),_=ht(E,p,D),R=vre(n,a,E),X=(Ce(O)?O:0)/b,V,I=Ft(Ft({},E),i&&i[D]&&i[D].props),$=I!=null&&"fill"in I&&typeof I.fill=="string"?I.fill:n.fill;D?V=A.endAngle+jn(m)*v*(O!==0?1:0):V=l;var H=V+jn(m)*((O!==0?S:0)+X*k),N=(V+H)/2,U=(R.innerRadius+R.outerRadius)/2,P=[{name:_,value:O,payload:I,dataKey:u,type:d,color:$,fill:$,graphicalItemId:n.id}],W=cn(R.cx,R.cy,U,N);return A=Ft(Ft(Ft(Ft({},n.presentationProps),{},{percent:X,cornerRadius:typeof s=="string"?parseFloat(s):s,name:_,tooltipPayload:P,midAngle:N,middleRadius:U,tooltipPosition:W},I),R),{},{value:O,dataKey:u,startAngle:V,endAngle:H,payload:I,paddingAngle:O!==0?jn(m)*v:0}),A})}return j}function Pre(e){var t=e.showLabels,n=e.sectors,r=e.children,i=h.useMemo(()=>!t||!n?[]:n.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})),[n,t]);return h.createElement(Xte,{value:t?i:void 0},r)}var Are=(e,t)=>{if(e==null)return[];var n=[],r=e.find(a=>a.status!=="removed"),i=r?r.next.startAngle:0;return e.forEach((a,s)=>{if(a.status!=="removed"){var l=s>0?$i(a.next,"paddingAngle",0):0;if(a.status==="matched"){var c=Ot(a.prev.endAngle-a.prev.startAngle,a.next.endAngle-a.next.startAngle,t),u=Ft(Ft({},a.next),{},{startAngle:i+l,endAngle:i+c+l});n.push(u),i=u.endAngle}else{var p=Ot(0,a.next.endAngle-a.next.startAngle,t),d=Ft(Ft({},a.next),{},{startAngle:i+l,endAngle:i+p+l});n.push(d),i=d.endAngle}}}),n};function Ere(e){var t=e.props,n=e.previousSectorsRef,r=e.id,i=t.sectors,a=t.activeShape,s=t.inactiveShape,l=t.animationInterpolateFn,c=Ym(t.onAnimationStart,t.onAnimationEnd),u=c.isAnimating,p=c.handleAnimationStart,d=c.handleAnimationEnd,f=S7();return f==null?null:h.createElement(Pre,{showLabels:!u,sectors:i},h.createElement(Gm,{animationInput:t,animationIdPrefix:"recharts-pie-",items:i,previousItemsRef:n,isAnimationActive:t.isAnimationActive,animationBegin:t.animationBegin,animationDuration:t.animationDuration,animationEasing:t.animationEasing,onAnimationStart:p,onAnimationEnd:d,animationInterpolateFn:l,animationMatchBy:t.animationMatchBy,layout:f},(m,g,v)=>h.createElement(Xt,null,h.createElement(kre,{sectors:m,activeShape:a,inactiveShape:s,allOtherPieProps:t,shape:t.shape,id:r,animationElapsedTime:g,isAnimating:u||g<1,isEntrance:v}))),h.createElement(jre,{showLabels:!u,sectors:i,props:t}),t.children)}var Tre={animationBegin:400,animationDuration:1500,animationEasing:"ease",animationInterpolateFn:Are,animationMatchBy:ew,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,shape:JR,startAngle:0,stroke:"#fff",zIndex:an.area};function Ire(e){var t=e.id,n=Qm(e,sre),r=e.hide,i=e.className,a=e.rootTabIndex,s=h.useMemo(()=>Y1(e.children,yd),[e.children]),l=Te(p=>hne(p,t,s)),c=h.useRef(null),u=mt("recharts-pie",i);return r||l==null?(c.current=null,h.createElement(Xt,{tabIndex:a,className:u})):h.createElement(ir,{zIndex:e.zIndex},h.createElement(mre,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:l,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t,activeShape:e.activeShape}),h.createElement(Xt,{tabIndex:a,className:u},h.createElement(Ere,{props:Ft(Ft({},n),{},{sectors:l}),previousSectorsRef:c,id:t})))}function Ore(e){var t=dn(e,Tre),n=t.id,r=Qm(t,lre),i=er(r);return h.createElement(Xm,{id:n,type:"pie"},a=>h.createElement(h.Fragment,null,h.createElement(ire,{type:"pie",id:a,data:r.data,dataKey:r.dataKey,hide:r.hide,angleAxisId:0,radiusAxisId:0,name:r.name,nameKey:r.nameKey,tooltipType:r.tooltipType,legendType:r.legendType,fill:r.fill,cx:r.cx,cy:r.cy,startAngle:r.startAngle,endAngle:r.endAngle,paddingAngle:r.paddingAngle,minAngle:r.minAngle,innerRadius:r.innerRadius,outerRadius:r.outerRadius,cornerRadius:r.cornerRadius,presentationProps:i,maxRadius:t.maxRadius}),h.createElement(fre,gs({},r,{id:a})),h.createElement(Ire,gs({},r,{id:a}))))}var eD=Ore;eD.displayName="Pie";var Nre=["points"];function MA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function my(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MA(Object(n),!0).forEach(function(r){Mre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mre(e,t,n){return(t=_re(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _re(e){var t=Rre(e,"string");return typeof t=="symbol"?t:t+""}function Rre(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sh(){return sh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sh.apply(null,arguments)}function Dre(e,t){if(e==null)return{};var n,r,i=Lre(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Lre(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function zre(e){var t=e.option,n=e.dotProps,r=e.className;if(h.isValidElement(t))return h.cloneElement(t,n);if(typeof t=="function")return t(n);var i=mt(r,typeof t!="boolean"?t.className:""),a=n??{};a.points;var s=Dre(a,Nre);return h.createElement(FR,sh({},s,{className:i}))}function $re(e,t){return e==null?!1:t?!0:e.length===1}function tD(e){var t=e.points,n=e.dot,r=e.className,i=e.dotClassName,a=e.dataKey,s=e.baseProps,l=e.needClip,c=e.clipPathId,u=e.zIndex,p=u===void 0?an.scatter:u;if(!$re(t,n))return null;var d=G1(n),f=MU(n),m=t.map((v,x)=>{var y,b,w=my(my(my({r:3},s),f),{},{index:x,cx:(y=v.x)!==null&&y!==void 0?y:void 0,cy:(b=v.y)!==null&&b!==void 0?b:void 0,dataKey:a,value:v.value,payload:v.payload,points:t});return h.createElement(zre,{key:"dot-".concat(x),option:n,dotProps:w,className:i})}),g={};return l&&c!=null&&(g.clipPath="url(#clipPath-".concat(d?"":"dots-").concat(c,")")),h.createElement(ir,{zIndex:p},h.createElement(Xt,sh({className:r},g),m))}function _A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function RA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_A(Object(n),!0).forEach(function(r){Bre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_A(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bre(e,t,n){return(t=Fre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fre(e){var t=Ure(e,"string");return typeof t=="symbol"?t:t+""}function Ure(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var nD=0,Wre={xAxis:{},yAxis:{},zAxis:{}},rD=Yn({name:"cartesianAxis",initialState:Wre,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:Dt()},replaceXAxis:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next;e.xAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.xAxis[r.id],e.xAxis[i.id]=i)},prepare:Dt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:Dt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:Dt()},replaceYAxis:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next;e.yAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.yAxis[r.id],e.yAxis[i.id]=i)},prepare:Dt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:Dt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:Dt()},replaceZAxis:{reducer(e,t){var n=t.payload,r=n.prev,i=n.next;e.zAxis[r.id]!==void 0&&(r.id!==i.id&&delete e.zAxis[r.id],e.zAxis[i.id]=i)},prepare:Dt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:Dt()},updateYAxisWidth(e,t){var n=t.payload,r=n.id,i=n.width,a=e.yAxis[r];if(a){var s,l=a.widthHistory||[];if(l.length===3&&l[0]===l[2]&&i===l[1]&&i!==a.width&&Math.abs(i-((s=l[0])!==null&&s!==void 0?s:0))<=1)return;var c=[...l,i].slice(-3);e.yAxis[r]=RA(RA({},a),{},{width:i,widthHistory:c})}}}}),Vi=rD.actions,Kre=Vi.addXAxis,Hre=Vi.replaceXAxis,Vre=Vi.removeXAxis,qre=Vi.addYAxis,Yre=Vi.replaceYAxis,Gre=Vi.removeYAxis;Vi.addZAxis;Vi.replaceZAxis;Vi.removeZAxis;var Xre=Vi.updateYAxisWidth,Qre=rD.reducer,Zre=G([vn],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),Jre=G([Zre,ja,ka],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),Zm=()=>Te(Jre),eie=()=>Te(kJ);function DA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DA(Object(n),!0).forEach(function(r){tie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tie(e,t,n){return(t=nie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nie(e){var t=rie(e,"string");return typeof t=="symbol"?t:t+""}function rie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var iie=e=>{var t=e.point,n=e.childIndex,r=e.mainColor,i=e.activeDot,a=e.dataKey,s=e.clipPath;if(i===!1||t.x==null||t.y==null)return null;var l={index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},c=gy(gy(gy({},l),ls(i)),hb(i)),u;return h.isValidElement(i)?u=h.cloneElement(i,c):typeof i=="function"?u=i(c):u=h.createElement(FR,c),h.createElement(Xt,{className:"recharts-active-dot",clipPath:s},u)};function Ox(e){var t=e.points,n=e.mainColor,r=e.activeDot,i=e.itemDataKey,a=e.clipPath,s=e.zIndex,l=s===void 0?an.activeDot:s,c=Te(so),u=eie();if(t==null||u==null)return null;var p=t.find(d=>u.includes(d.payload));return $t(p)?null:h.createElement(ir,{zIndex:l},h.createElement(iie,{point:p,childIndex:Number(c),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}function aie(e,t){return cie(e)||lie(e,t)||sie(e,t)||oie()}function oie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
480
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sie(e,t){if(e){if(typeof e=="string")return LA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?LA(e,t):void 0}}function LA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function lie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function cie(e){if(Array.isArray(e))return e}var zA=(e,t,n)=>{var r=n??e;if(!$t(r))return Hn(r,t,0)},uie=(e,t,n)=>{var r={},i=e.filter(gm),a=e.filter(u=>u.stackId==null),s=i.reduce((u,p)=>{var d=u[p.stackId];return d==null&&(d=[]),d.push(p),u[p.stackId]=d,u},r),l=Object.entries(s).map(u=>{var p,d=aie(u,2),f=d[0],m=d[1],g=m.map(x=>x.dataKey),v=zA(t,n,(p=m[0])===null||p===void 0?void 0:p.barSize);return{stackId:f,dataKeys:g,barSize:v}}),c=a.map(u=>{var p=[u.dataKey].filter(f=>f!=null),d=zA(t,n,u.barSize);return{stackId:void 0,dataKeys:p,barSize:d}});return[...l,...c]};function $A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function op(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$A(Object(n),!0).forEach(function(r){die(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$A(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function die(e,t,n){return(t=pie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pie(e){var t=fie(e,"string");return typeof t=="symbol"?t:t+""}function fie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hie(e,t,n,r,i){var a,s=r.length;if(!(s<1)){var l=Hn(e,n,0,!0),c,u=[];if(Je((a=r[0])===null||a===void 0?void 0:a.barSize)){var p=!1,d=n/s,f=r.reduce((b,w)=>b+(w.barSize||0),0);f+=(s-1)*l,f>=n&&(f-=(s-1)*l,l=0),f>=n&&d>0&&(p=!0,d*=.9,f=s*d);var m=Math.round((n-f)/2),g={offset:m-l,size:0};c=r.reduce((b,w)=>{var S,k={stackId:w.stackId,dataKeys:w.dataKeys,position:{offset:g.offset+g.size+l,size:p?d:(S=w.barSize)!==null&&S!==void 0?S:0}},j=[...b,k];return g=k.position,j},u)}else{var v=Hn(t,n,0,!0);n-2*v-(s-1)*l<=0&&(l=0);var x=(n-2*v-(s-1)*l)/s;x>1&&(x=Math.round(x));var y=Je(i)?Math.min(x,i):x;c=r.reduce((b,w,S)=>[...b,{stackId:w.stackId,dataKeys:w.dataKeys,position:{offset:v+(x+l)*S+(x-y)/2,size:y}}],u)}return c}}var mie=(e,t,n,r,i,a,s)=>{var l=$t(s)?t:s,c=hie(n,r,i!==a?i:a,e,l);return i!==a&&c!=null&&(c=c.map(u=>op(op({},u),{},{position:op(op({},u.position),{},{offset:u.position.offset-i/2})}))),c},gie=(e,t)=>{var n=mm(t);if(!(!e||n==null||t==null)){var r=t.stackId;if(r!=null){var i=e[r];if(i){var a=i.stackedData;if(a)return a.find(s=>s.key===n)}}}},yie=(e,t)=>{if(!(e==null||t==null)){var n=e.find(r=>r.stackId===t.stackId&&t.dataKey!=null&&r.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function vie(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&Je(e.zIndex)?e.zIndex:t}var iD=e=>{var t=e.chartData,n=St(),r=Cn();return h.useEffect(()=>r?()=>{}:(n(JP(t)),()=>{n(JP(void 0))}),[t,n,r]),null},BA={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},aD=Yn({name:"brush",initialState:BA,reducers:{setBrushSettings(e,t){return t.payload==null?BA:t.payload}}});aD.actions.setBrushSettings;var xie=aD.reducer;function bie(e){return(e%180+180)%180}var wie=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=bie(i),s=a*Math.PI/180,l=Math.atan(r/n),c=s>l&&s<Math.PI-l?r/Math.sin(s):n/Math.cos(s);return Math.abs(c)},Sie={dots:[],areas:[],lines:[]},oD=Yn({name:"referenceElements",initialState:Sie,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Ur(e).dots.findIndex(r=>r===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=Ur(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=Ur(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),ec=oD.actions;ec.addDot;ec.removeDot;ec.addArea;ec.removeArea;ec.addLine;ec.removeLine;var jie=oD.reducer;function kie(e,t){return Eie(e)||Aie(e,t)||Pie(e,t)||Cie()}function Cie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
481
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pie(e,t){if(e){if(typeof e=="string")return FA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?FA(e,t):void 0}}function FA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Aie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Eie(e){if(Array.isArray(e))return e}var Tie=h.createContext(void 0),Iie=e=>{var t=e.children,n=h.useState("".concat(bu("recharts"),"-clip")),r=kie(n,1),i=r[0],a=Zm();if(a==null)return null;var s=a.x,l=a.y,c=a.width,u=a.height;return h.createElement(Tie.Provider,{value:i},h.createElement("defs",null,h.createElement("clipPath",{id:i},h.createElement("rect",{x:s,y:l,height:u,width:c}))),t)};function sD(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var i=e[r];i!==void 0&&n.push(i)}return n}function Oie(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return wie(r,n)}function Nie(e,t,n){var r=n==="width",i=e.x,a=e.y,s=e.width,l=e.height;return t===1?{start:r?i:a,end:r?i+s:a+l}:{start:r?i+s:a+l,end:r?i:a}}function _u(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function Mie(e,t){return sD(e,t+1)}function _ie(e,t,n,r,i){for(var a=(r||[]).slice(),s=t.start,l=t.end,c=0,u=1,p=s,d=function(){var g=r==null?void 0:r[c];if(g===void 0)return{v:sD(r,u)};var v=c,x,y=()=>(x===void 0&&(x=n(g,v)),x),b=g.coordinate,w=c===0||_u(e,b,y,p,l);w||(c=0,p=s,u+=1),w&&(p=b+e*(y()/2+i),c+=u)},f;u<=a.length;)if(f=d(),f)return f.v;return[]}function Rie(e,t,n,r,i){var a=(r||[]).slice(),s=a.length;if(s===0)return[];for(var l=t.start,c=t.end,u=1;u<=s;u++){for(var p=(s-1)%u,d=l,f=!0,m=function(){var S=r[v];if(S==null)return 0;var k=v,j,A=()=>(j===void 0&&(j=n(S,k)),j),E=S.coordinate,D=v===p||_u(e,E,A,d,c);if(!D)return f=!1,1;D&&(d=E+e*(A()/2+i))},g,v=p;v<s&&(g=m(),!(g!==0&&g===1));v+=u);if(f){for(var x=[],y=p;y<s;y+=u){var b=r[y];b!=null&&x.push(b)}return x}}return[]}function UA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Un(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UA(Object(n),!0).forEach(function(r){Die(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Die(e,t,n){return(t=Lie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lie(e){var t=zie(e,"string");return typeof t=="symbol"?t:t+""}function zie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $ie(e,t,n,r,i){for(var a=(r||[]).slice(),s=a.length,l=t.start,c=t.end,u=function(f){var m=a[f];if(m==null)return 1;var g=m,v,x=()=>(v===void 0&&(v=n(m,f)),v);if(f===s-1){var y=e*(g.coordinate+e*x()/2-c);a[f]=g=Un(Un({},g),{},{tickCoord:y>0?g.coordinate-y*e:g.coordinate})}else a[f]=g=Un(Un({},g),{},{tickCoord:g.coordinate});if(g.tickCoord!=null){var b=_u(e,g.tickCoord,x,l,c);b&&(c=g.tickCoord-e*(x()/2+i),a[f]=Un(Un({},g),{},{isShow:!0}))}},p=s-1;p>=0;p--)u(p);return a}function Bie(e,t,n,r,i,a){var s=(r||[]).slice(),l=s.length,c=t.start,u=t.end;if(a){var p=r[l-1];if(p!=null){var d=n(p,l-1),f=e*(p.coordinate+e*d/2-u);if(s[l-1]=p=Un(Un({},p),{},{tickCoord:f>0?p.coordinate-f*e:p.coordinate}),p.tickCoord!=null){var m=_u(e,p.tickCoord,()=>d,c,u);m&&(u=p.tickCoord-e*(d/2+i),s[l-1]=Un(Un({},p),{},{isShow:!0}))}}}for(var g=a?l-1:l,v=function(b){var w=s[b];if(w==null)return 1;var S=w,k,j=()=>(k===void 0&&(k=n(w,b)),k);if(b===0){var A=e*(S.coordinate-e*j()/2-c);s[b]=S=Un(Un({},S),{},{tickCoord:A<0?S.coordinate-A*e:S.coordinate})}else s[b]=S=Un(Un({},S),{},{tickCoord:S.coordinate});if(S.tickCoord!=null){var E=_u(e,S.tickCoord,j,c,u);E&&(c=S.tickCoord+e*(j()/2+i),s[b]=Un(Un({},S),{},{isShow:!0}))}},x=0;x<g;x++)v(x);return s}function rw(e,t,n){var r=e.tick,i=e.ticks,a=e.viewBox,s=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,p=e.unit,d=e.angle;if(!i||!i.length||!r)return[];if(Ce(c)||nd.isSsr){var f;return(f=Mie(i,Ce(c)?c:0))!==null&&f!==void 0?f:[]}var m=[],g=l==="top"||l==="bottom"?"width":"height",v=p&&g==="width"?Yc(p,{fontSize:t,letterSpacing:n}):{width:0,height:0},x=(k,j)=>{var A=typeof u=="function"?u(k.value,j):k.value;return g==="width"?Oie(Yc(A,{fontSize:t,letterSpacing:n}),v,d):Yc(A,{fontSize:t,letterSpacing:n})[g]},y=i[0],b=i[1],w=i.length>=2&&y!=null&&b!=null?jn(b.coordinate-y.coordinate):1,S=Nie(a,w,g);return c==="equidistantPreserveStart"?_ie(w,S,x,i,s):c==="equidistantPreserveEnd"?Rie(w,S,x,i,s):(c==="preserveStart"||c==="preserveStartEnd"?m=Bie(w,S,x,i,s,c==="preserveStartEnd"):m=$ie(w,S,x,i,s),m.filter(k=>k.isShow))}var Fie=e=>{var t=e.ticks,n=e.label,r=e.labelGapWithTick,i=r,a=e.tickSize,s=a===void 0?0:a,l=e.tickMargin,c=l===void 0?0:l,u=0;if(t){Array.from(t).forEach(m=>{if(m){var g=m.getBoundingClientRect();g.width>u&&(u=g.width)}});var p=n?n.getBoundingClientRect().width:0,d=s+c,f=u+d+p+(n?i:0);return Math.round(f)}return 0},Uie={xAxis:{},yAxis:{}},lD=Yn({name:"renderedTicks",initialState:Uie,reducers:{setRenderedTicks:(e,t)=>{var n=t.payload,r=n.axisType,i=n.axisId,a=n.ticks;e[r][i]=a},removeRenderedTicks:(e,t)=>{var n=t.payload,r=n.axisType,i=n.axisId;delete e[r][i]}}}),cD=lD.actions,Wie=cD.setRenderedTicks,Kie=cD.removeRenderedTicks,Hie=lD.reducer,Vie=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function WA(e,t){return Xie(e)||Gie(e,t)||Yie(e,t)||qie()}function qie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
482
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yie(e,t){if(e){if(typeof e=="string")return KA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?KA(e,t):void 0}}function KA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Gie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Xie(e){if(Array.isArray(e))return e}function Qie(e,t){if(e==null)return{};var n,r,i=Zie(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Zie(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ys(){return ys=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ys.apply(null,arguments)}function HA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Jt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HA(Object(n),!0).forEach(function(r){Jie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jie(e,t,n){return(t=eae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eae(e){var t=tae(e,"string");return typeof t=="symbol"?t:t+""}function tae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var da={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:an.axis};function nae(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=e.orientation,s=e.mirror,l=e.axisLine,c=e.otherSvgProps;if(!l)return null;var u=Jt(Jt(Jt({},c),er(l)),{},{fill:"none"});if(a==="top"||a==="bottom"){var p=+(a==="top"&&!s||a==="bottom"&&s);u=Jt(Jt({},u),{},{x1:t,y1:n+p*i,x2:t+r,y2:n+p*i})}else{var d=+(a==="left"&&!s||a==="right"&&s);u=Jt(Jt({},u),{},{x1:t+d*r,y1:n,x2:t+d*r,y2:n+i})}return h.createElement("line",ys({},u,{className:mt("recharts-cartesian-axis-line",$i(l,"className"))}))}function rae(e,t,n,r,i,a,s,l,c){var u,p,d,f,m,g,v=l?-1:1,x=e.tickSize||s,y=Ce(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":u=p=e.coordinate,f=n+ +!l*i,d=f-v*x,g=d-v*c,m=y;break;case"left":d=f=e.coordinate,p=t+ +!l*r,u=p-v*x,m=u-v*c,g=y;break;case"right":d=f=e.coordinate,p=t+ +l*r,u=p+v*x,m=u+v*c,g=y;break;default:u=p=e.coordinate,f=n+ +l*i,d=f+v*x,g=d+v*c,m=y;break}return{line:{x1:u,y1:d,x2:p,y2:f},tick:{x:m,y:g}}}function iae(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function aae(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function oae(e){var t=e.option,n=e.tickProps,r=e.value,i,a=mt(n.className,"recharts-cartesian-axis-tick-value");if(h.isValidElement(t))i=h.cloneElement(t,Jt(Jt({},n),{},{className:a}));else if(typeof t=="function")i=t(Jt(Jt({},n),{},{className:a}));else{var s="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(s=mt(s,HR(t))),i=h.createElement(Im,ys({},n,{className:s}),r)}return i}function sae(e){var t=e.ticks,n=e.axisType,r=e.axisId,i=St();return h.useEffect(()=>{if(r==null||n==null)return ho;var a=t.map(s=>({value:s.value,coordinate:s.coordinate,offset:s.offset,index:s.index}));return i(Wie({ticks:a,axisId:r,axisType:n})),()=>{i(Kie({axisId:r,axisType:n}))}},[i,t,r,n]),null}var lae=h.forwardRef((e,t)=>{var n=e.ticks,r=n===void 0?[]:n,i=e.tick,a=e.tickLine,s=e.stroke,l=e.tickFormatter,c=e.unit,u=e.padding,p=e.tickTextProps,d=e.orientation,f=e.mirror,m=e.x,g=e.y,v=e.width,x=e.height,y=e.tickSize,b=e.tickMargin,w=e.fontSize,S=e.letterSpacing,k=e.getTicksConfig,j=e.events,A=e.axisType,E=e.axisId,D=rw(Jt(Jt({},k),{},{ticks:r}),w,S),O=er(k),_=ls(i),R=MR(O.textAnchor)?O.textAnchor:iae(d,f),X=aae(d,f),V={};typeof a=="object"&&(V=a);var I=Jt(Jt({},O),{},{fill:"none"},V),$=D.map(U=>Jt({entry:U},rae(U,m,g,v,x,d,y,f,b))),H=$.map(U=>{var P=U.entry,W=U.line;return h.createElement(Xt,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(P.value,"-").concat(P.coordinate,"-").concat(P.tickCoord)},a&&h.createElement("line",ys({},I,W,{className:mt("recharts-cartesian-axis-tick-line",$i(a,"className"))})))}),N=$.map((U,P)=>{var W,se,T=U.entry,he=U.tick,ye=Jt(Jt(Jt(Jt({verticalAnchor:X},O),{},{textAnchor:R,stroke:"none",fill:s},he),{},{index:P,payload:T,visibleTicksCount:D.length,tickFormatter:l,padding:u},p),{},{angle:(W=(se=p==null?void 0:p.angle)!==null&&se!==void 0?se:O.angle)!==null&&W!==void 0?W:0}),Z=Jt(Jt({},ye),_);return h.createElement(Xt,ys({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(T.value,"-").concat(T.coordinate,"-").concat(T.tickCoord)},Yu(j,T,P)),i&&h.createElement(oae,{option:i,tickProps:Z,value:"".concat(typeof l=="function"?l(T.value,P):T.value).concat(c||"")}))});return h.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(A,"-ticks")},h.createElement(sae,{ticks:D,axisId:E,axisType:A}),N.length>0&&h.createElement(ir,{zIndex:an.label},h.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(A,"-tick-labels"),ref:t},N)),H.length>0&&h.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(A,"-tick-lines")},H))}),cae=h.forwardRef((e,t)=>{var n=e.axisLine,r=e.width,i=e.height,a=e.className,s=e.hide,l=e.ticks,c=e.axisType,u=e.axisId,p=Qie(e,Vie),d=h.useState(""),f=WA(d,2),m=f[0],g=f[1],v=h.useState(""),x=WA(v,2),y=x[0],b=x[1],w=h.useRef(null);h.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var k;return Fie({ticks:w.current,label:(k=e.labelRef)===null||k===void 0?void 0:k.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var S=h.useCallback(k=>{if(k){var j=k.getElementsByClassName("recharts-cartesian-axis-tick-value");w.current=j;var A=j[0];if(A){var E=window.getComputedStyle(A),D=E.fontSize,O=E.letterSpacing;(D!==m||O!==y)&&(g(D),b(O))}}},[m,y]);return s||r!=null&&r<=0||i!=null&&i<=0?null:h.createElement(ir,{zIndex:e.zIndex},h.createElement(Xt,{className:mt("recharts-cartesian-axis",a)},h.createElement(nae,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:er(e)}),h.createElement(lae,{ref:S,axisType:c,events:p,fontSize:m,getTicksConfig:e,height:e.height,letterSpacing:y,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:l,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:u}),h.createElement(Rte,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},h.createElement(Hte,{label:e.label,labelRef:e.labelRef}),e.children)))}),iw=h.forwardRef((e,t)=>{var n=dn(e,da);return h.createElement(cae,ys({},n,{ref:t}))});iw.displayName="CartesianAxis";var uae=["x1","y1","x2","y2","key"],dae=["offset"],pae=["xAxisId","yAxisId"],fae=["xAxisId","yAxisId"];function VA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Kn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VA(Object(n),!0).forEach(function(r){hae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hae(e,t,n){return(t=mae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mae(e){var t=gae(e,"string");return typeof t=="symbol"?t:t+""}function gae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ho(){return Ho=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ho.apply(null,arguments)}function lh(e,t){if(e==null)return{};var n,r,i=yae(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function yae(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var vae=e=>{var t=e.fill;if(!t||t==="none")return null;var n=e.fillOpacity,r=e.x,i=e.y,a=e.width,s=e.height,l=e.ry;return h.createElement("rect",{x:r,y:i,ry:l,width:a,height:s,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function uD(e){var t=e.option,n=e.lineItemProps,r;if(h.isValidElement(t))r=h.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,a=n.x1,s=n.y1,l=n.x2,c=n.y2,u=n.key,p=lh(n,uae),d=(i=er(p))!==null&&i!==void 0?i:{};d.offset;var f=lh(d,dae);r=h.createElement("line",Ho({},f,{x1:a,y1:s,x2:l,y2:c,fill:"none",key:u}))}return r}function xae(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0?!0:r,a=e.horizontalPoints;if(!i||!a||!a.length)return null;e.xAxisId,e.yAxisId;var s=lh(e,pae),l=a.map((c,u)=>{var p=Kn(Kn({},s),{},{x1:t,y1:c,x2:t+n,y2:c,key:"line-".concat(u),index:u});return h.createElement(uD,{key:"line-".concat(u),option:i,lineItemProps:p})});return h.createElement("g",{className:"recharts-cartesian-grid-horizontal"},l)}function bae(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0?!0:r,a=e.verticalPoints;if(!i||!a||!a.length)return null;e.xAxisId,e.yAxisId;var s=lh(e,fae),l=a.map((c,u)=>{var p=Kn(Kn({},s),{},{x1:c,y1:t,x2:c,y2:t+n,key:"line-".concat(u),index:u});return h.createElement(uD,{option:i,lineItemProps:p,key:"line-".concat(u)})});return h.createElement("g",{className:"recharts-cartesian-grid-vertical"},l)}function wae(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,a=e.width,s=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length||l==null)return null;var p=l.map(f=>Math.round(f+i-i)).sort((f,m)=>f-m);i!==p[0]&&p.unshift(0);var d=p.map((f,m)=>{var g=p[m+1],v=g==null,x=v?i+s-f:g-f;if(x<=0)return null;var y=m%t.length;return h.createElement("rect",{key:"react-".concat(m),y:f,x:r,height:x,width:a,stroke:"none",fill:t[y],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return h.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function Sae(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,i=e.fillOpacity,a=e.x,s=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!n||!r||!r.length)return null;var p=u.map(f=>Math.round(f+a-a)).sort((f,m)=>f-m);a!==p[0]&&p.unshift(0);var d=p.map((f,m)=>{var g=p[m+1],v=g==null,x=v?a+l-f:g-f;if(x<=0)return null;var y=m%r.length;return h.createElement("rect",{key:"react-".concat(m),x:f,y:s,width:x,height:c,stroke:"none",fill:r[y],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return h.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var jae=(e,t)=>{var n=e.xAxis,r=e.width,i=e.height,a=e.offset;return DN(rw(Kn(Kn(Kn({},da),n),{},{ticks:LN(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},kae=(e,t)=>{var n=e.yAxis,r=e.width,i=e.height,a=e.offset;return DN(rw(Kn(Kn(Kn({},da),n),{},{ticks:LN(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},Cae={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:an.grid};function Vo(e){var t=Pb(),n=Ab(),r=HN(),i=Kn(Kn({},dn(e,Cae)),{},{x:Ce(e.x)?e.x:r.left,y:Ce(e.y)?e.y:r.top,width:Ce(e.width)?e.width:r.width,height:Ce(e.height)?e.height:r.height}),a=i.xAxisId,s=i.yAxisId,l=i.x,c=i.y,u=i.width,p=i.height,d=i.syncWithTicks,f=i.horizontalValues,m=i.verticalValues,g=Cn(),v=Te(D=>FP(D,"xAxis",a,g)),x=Te(D=>FP(D,"yAxis",s,g));if(!Fi(u)||!Fi(p)||!Ce(l)||!Ce(c))return null;var y=i.verticalCoordinatesGenerator||jae,b=i.horizontalCoordinatesGenerator||kae,w=i.horizontalPoints,S=i.verticalPoints;if((!w||!w.length)&&typeof b=="function"){var k=f&&f.length,j=b({yAxis:x?Kn(Kn({},x),{},{ticks:k?f:x.ticks}):void 0,width:t??u,height:n??p,offset:r},k?!0:d);Mf(Array.isArray(j),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof j,"]")),Array.isArray(j)&&(w=j)}if((!S||!S.length)&&typeof y=="function"){var A=m&&m.length,E=y({xAxis:v?Kn(Kn({},v),{},{ticks:A?m:v.ticks}):void 0,width:t??u,height:n??p,offset:r},A?!0:d);Mf(Array.isArray(E),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof E,"]")),Array.isArray(E)&&(S=E)}return h.createElement(ir,{zIndex:i.zIndex},h.createElement("g",{className:"recharts-cartesian-grid"},h.createElement(vae,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),h.createElement(wae,Ho({},i,{horizontalPoints:w})),h.createElement(Sae,Ho({},i,{verticalPoints:S})),h.createElement(xae,Ho({},i,{offset:r,horizontalPoints:w,xAxis:v,yAxis:x})),h.createElement(bae,Ho({},i,{offset:r,verticalPoints:S,xAxis:v,yAxis:x}))))}Vo.displayName="CartesianGrid";var Pae=["animationElapsedTime","isAnimating","isEntrance","visibleLength","strokeDasharray","connectNulls"];function Nx(){return Nx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nx.apply(null,arguments)}function Aae(e,t){if(e==null)return{};var n,r,i=Eae(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Eae(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Tae(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function dD(e,t){return"".concat(t,"px ").concat(e,"px")}function Iae(e){return e.length%2!==0?[...e,...e]:e}function Oae(e,t){for(var n=[],r=0;r<t;++r)n.push(...e);return n}function Nae(e,t,n){var r=Iae(n),i=r.reduce((m,g)=>m+g,0);if(!i)return dD(t,e);for(var a=Math.floor(e/i),s=e%i,l=[],c=0,u=0;c<r.length;u+=(p=r[c])!==null&&p!==void 0?p:0,++c){var p,d=r[c];if(d!=null&&u+d>s){l=[...r.slice(0,c),s-u];break}}var f=l.length%2===0?[0,t]:[t];return[...Oae(r,a),...l,...f].map(m=>"".concat(m,"px")).join(", ")}function Mae(e,t,n){if(e){var r="".concat(e).split(/[,\s]+/gim).map(i=>parseFloat(i));return Nae(n,t,r)}return dD(t,n)}function _ae(e){e.animationElapsedTime,e.isAnimating,e.isEntrance;var t=e.visibleLength,n=e.strokeDasharray,r=e.connectNulls,i=Aae(e,Pae),a=r??!1,s;if(t!=null){var l,c=i.pathRef,u=Tae((l=c==null?void 0:c.current)!==null&&l!==void 0?l:null);s=Mae(n,u,t)}else n!=null&&(s=String(n));return h.createElement(fl,Nx({},i,{connectNulls:a,strokeDasharray:s}))}function Rae(e){var t=h.useRef(0),n=h.useRef(0),r=h.useRef(!1),i=h.useRef(e);return i.current!==e&&(t.current=n.current,i.current=e),h.useCallback((a,s)=>{if(r.current)return null;var l=Math.min(oa(t.current+a*s),s);return a>0&&s>0&&(n.current=Math.max(n.current,l),l>=s)?(r.current=!0,null):l},[])}var Dae={},pD=Yn({name:"errorBars",initialState:Dae,reducers:{addErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.errorBar;e[r]||(e[r]=[]),e[r].push(i)},replaceErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.prev,a=n.next;e[r]&&(e[r]=e[r].map(s=>s.dataKey===i.dataKey&&s.direction===i.direction?a:s))},removeErrorBar:(e,t)=>{var n=t.payload,r=n.itemId,i=n.errorBar;e[r]&&(e[r]=e[r].filter(a=>a.dataKey!==i.dataKey||a.direction!==i.direction))}}}),aw=pD.actions;aw.addErrorBar;aw.replaceErrorBar;aw.removeErrorBar;var Lae=pD.reducer,zae=["children"];function $ae(e,t){if(e==null)return{};var n,r,i=Bae(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Bae(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Fae={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},Uae=h.createContext(Fae);function fD(e){var t=e.children,n=$ae(e,zae);return h.createElement(Uae.Provider,{value:n},t)}function Jm(e,t){var n,r,i=Te(u=>Pa(u,e)),a=Te(u=>Aa(u,t)),s=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:fn.allowDataOverflow,l=(r=a==null?void 0:a.allowDataOverflow)!==null&&r!==void 0?r:hn.allowDataOverflow,c=s||l;return{needClip:c,needClipX:s,needClipY:l}}function ow(e){var t=e.xAxisId,n=e.yAxisId,r=e.clipPathId,i=Zm(),a=Jm(t,n),s=a.needClipX,l=a.needClipY,c=a.needClip,u=Te(w=>$_(w,t,!1)),p=Te(w=>B_(w,n,!1));if(!c||!i)return null;var d=i.x,f=i.y,m=i.width,g=i.height,v=s&&u?Math.min(u[0],u[1]):d-m/2,x=l&&p?Math.min(p[0],p[1]):f-g/2,y=s&&u?Math.abs(u[1]-u[0]):m*2,b=l&&p?Math.abs(p[1]-p[0]):g*2;return h.createElement("clipPath",{id:"clipPath-".concat(r)},h.createElement("rect",{x:v,y:x,width:y,height:b}))}var hD=(e,t,n,r)=>Hi(e,"xAxis",t,r),mD=(e,t,n,r)=>Ki(e,"xAxis",t,r),gD=(e,t,n,r)=>Hi(e,"yAxis",n,r),yD=(e,t,n,r)=>Ki(e,"yAxis",n,r),Wae=G([lt,hD,gD,mD,yD],(e,t,n,r,i)=>fi(e,"xAxis")?oo(t,r,!1):oo(n,i,!1)),Kae=(e,t,n,r,i)=>i;function Hae(e){return e.type==="line"}var Vae=G([dd,Kae],(e,t)=>e.filter(Hae).find(n=>n.id===t)),qae=G([lt,hD,gD,mD,yD,Vae,Wae,id],(e,t,n,r,i,a,s,l)=>{var c=l.chartData,u=l.dataStartIndex,p=l.dataEndIndex;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||s==null||e!=="horizontal"&&e!=="vertical")){var d=a.dataKey,f=a.data,m;if(f!=null&&f.length>0?m=f:m=c==null?void 0:c.slice(u,p+1),m!=null)return hoe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:d,bandSize:s,displayedData:m})}});function vD(e){var t=ls(e),n=3,r=2;if(t!=null){var i=t.r,a=t.strokeWidth,s=Number(i),l=Number(a);return(Number.isNaN(s)||s<0)&&(s=n),(Number.isNaN(l)||l<0)&&(l=r),{r:s,strokeWidth:l}}return{r:n,strokeWidth:r}}var Yae=["id"],Gae=["type","layout","connectNulls","needClip","shape","strokeDasharray"],Xae=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function ch(){return ch=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ch.apply(null,arguments)}function sw(e,t){if(e==null)return{};var n,r,i=Qae(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Qae(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function qA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ai(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qA(Object(n),!0).forEach(function(r){Zae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zae(e,t,n){return(t=Jae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jae(e){var t=eoe(e,"string");return typeof t=="symbol"?t:t+""}function eoe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function toe(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function noe(e){var t=0,n=0;for(var r of e)r.status==="matched"&&r.prev.x!=null&&r.next.x!=null&&(t+=r.next.x-r.prev.x,n++);return n>0?t/n:0}var roe=(e,t)=>{if(e==null)return[];if(t===1)return e.flatMap(l=>l.status==="removed"?[]:[l.next]);var n=noe(e),r=[];for(var i of e)if(i.status==="matched")r.push(Ai(Ai({},i.next),{},{x:Ot(i.prev.x,i.next.x,t),y:Ot(i.prev.y,i.next.y,t)}));else if(i.status==="added")if(i.next.x!=null){var a=i.next.x-n;r.push(Ai(Ai({},i.next),{},{x:Ot(a,i.next.x,t),y:i.next.y}))}else r.push(i.next);else if(i.status==="removed"&&i.prev.x!=null){var s=i.prev.x+n;r.push(Ai(Ai({},i.prev),{},{x:Ot(i.prev.x,s,t),y:i.prev.y}))}return r},lw={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",animationInterpolateFn:roe,animationMatchBy:qm,connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",shape:_ae,stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:an.line,type:"linear"},ioe=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.legendType,a=e.hide;return[{inactive:a,dataKey:t,type:i,color:r,value:mo(n,t),payload:e}]},aoe=h.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,s=e.name,l=e.hide,c=e.unit,u=e.tooltipType,p=e.id,d={dataDefinedOnItem:n,getPosition:ho,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:mo(s,t),hide:l,type:u,color:r,unit:c,graphicalItemId:p}};return h.createElement(Vm,{tooltipEntrySettings:d})});function ooe(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.dot,a=r.dataKey,s=r.needClip;r.id;var l=sw(r,Yae),c=er(l);return h.createElement(tD,{points:n,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:c,needClip:s,clipPathId:t})}function soe(e){var t=e.showLabels,n=e.children,r=e.points,i=h.useMemo(()=>r==null?void 0:r.map(a=>{var s,l,c={x:(s=a.x)!==null&&s!==void 0?s:0,y:(l=a.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Ai(Ai({},c),{},{value:a.value,payload:a.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[r]);return h.createElement(W1,{value:t?i:void 0},n)}function loe(e){var t=e.clipPathId,n=e.pathRef,r=e.points,i=e.props,a=e.animationElapsedTime,s=e.isAnimating,l=e.isEntrance,c=e.visibleLength,u=i.type,p=i.layout,d=i.connectNulls,f=i.needClip,m=i.shape,g=i.strokeDasharray,v=sw(i,Gae),x=Ai(Ai({},mr(v)),{},{fill:"none",className:"recharts-line-curve",clipPath:f?"url(#clipPath-".concat(t,")"):void 0,points:r,type:u,layout:p,connectNulls:d,strokeDasharray:g??i.strokeDasharray,pathRef:n,animationElapsedTime:a,isAnimating:s,isEntrance:i.animateNewValues?l:!1,visibleLength:c});return h.createElement(h.Fragment,null,(r==null?void 0:r.length)>1&&h.createElement(Hm,{option:m,DefaultShape:lw.shape,shapeProps:x}),h.createElement(ooe,{points:r,clipPathId:t,props:i}))}function coe(e){var t=e.clipPathId,n=e.props,r=e.pathRef,i=e.previousPointsRef,a=n.points,s=n.isAnimationActive,l=n.animationBegin,c=n.animationDuration,u=n.animationEasing,p=n.animationMatchBy,d=n.animationInterpolateFn,f=n.layout,m=toe(r.current),g=Ym(n.onAnimationStart,n.onAnimationEnd),v=g.isAnimating,x=g.handleAnimationStart,y=g.handleAnimationEnd,b=!v,w=Rae(a),S=h.useCallback(k=>k>0&&m>0,[m]);return h.createElement(soe,{points:a,showLabels:b},n.children,h.createElement(Gm,{animationInput:a,animationIdPrefix:"recharts-line-",items:a,previousItemsRef:i,isAnimationActive:s,animationBegin:l,animationDuration:c,animationEasing:u,onAnimationStart:x,onAnimationEnd:y,animationInterpolateFn:d,animationMatchBy:p,shouldUpdatePreviousRef:S,layout:f},(k,j,A)=>{var E=v||j<1,D=E?w(j,m):null;return h.createElement(loe,{props:n,points:k,clipPathId:t,pathRef:r,animationElapsedTime:j,isAnimating:E,isEntrance:A,visibleLength:D})}),h.createElement(Om,{label:n.label}))}function uoe(e){var t=e.clipPathId,n=e.props,r=h.useRef(null),i=h.useRef(null);return h.createElement(coe,{props:n,clipPathId:t,previousPointsRef:r,pathRef:i})}var doe=(e,t)=>{var n,r;return{x:(n=e.x)!==null&&n!==void 0?n:void 0,y:(r=e.y)!==null&&r!==void 0?r:void 0,value:e.value,errorVal:ht(e.payload,t)}};class poe extends h.Component{render(){var t=this.props,n=t.hide,r=t.dot,i=t.points,a=t.className,s=t.xAxisId,l=t.yAxisId,c=t.top,u=t.left,p=t.width,d=t.height,f=t.id,m=t.needClip,g=t.zIndex;if(n)return null;var v=mt("recharts-line",a),x=f,y=vD(r),b=y.r,w=y.strokeWidth,S=G1(r),k=b*2+w,j=m?"url(#clipPath-".concat(S?"":"dots-").concat(x,")"):void 0;return h.createElement(ir,{zIndex:g},h.createElement(Xt,{className:v},m&&h.createElement("defs",null,h.createElement(ow,{clipPathId:x,xAxisId:s,yAxisId:l}),!S&&h.createElement("clipPath",{id:"clipPath-dots-".concat(x)},h.createElement("rect",{x:u-k/2,y:c-k/2,width:p+k,height:d+k}))),h.createElement(fD,{xAxisId:s,yAxisId:l,data:i,dataPointFormatter:doe,errorBarOffset:0},h.createElement(uoe,{props:this.props,clipPathId:x}))),h.createElement(Ox,{activeDot:this.props.activeDot,points:i,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:j}))}}function foe(e){var t=dn(e,lw),n=t.activeDot,r=t.animateNewValues,i=t.animationBegin,a=t.animationDuration,s=t.animationEasing,l=t.connectNulls,c=t.dot,u=t.hide,p=t.isAnimationActive,d=t.label,f=t.legendType,m=t.xAxisId,g=t.yAxisId,v=t.id,x=sw(t,Xae),y=Jm(m,g),b=y.needClip,w=Zm(),S=go(),k=Cn(),j=Te(_=>qae(_,m,g,k,v));if(S!=="horizontal"&&S!=="vertical"||j==null||w==null)return null;var A=w.height,E=w.width,D=w.x,O=w.y;return h.createElement(poe,ch({},x,{id:v,connectNulls:l,dot:c,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:s,isAnimationActive:p,hide:u,label:d,legendType:f,xAxisId:m,yAxisId:g,points:j,layout:S,height:A,width:E,left:D,top:O,needClip:b}))}function hoe(e){var t=e.layout,n=e.xAxis,r=e.yAxis,i=e.xAxisTicks,a=e.yAxisTicks,s=e.dataKey,l=e.bandSize,c=e.displayedData;return c.map((u,p)=>{var d=ht(u,s);if(t==="horizontal"){var f=Nf({axis:n,ticks:i,bandSize:l,entry:u,index:p}),m=$t(d)?null:r.scale.map(d);return{x:f,y:m??null,value:d,payload:u}}var g=$t(d)?null:n.scale.map(d),v=Nf({axis:r,ticks:a,bandSize:l,entry:u,index:p});return g==null||v==null?null:{x:g,y:v,value:d,payload:u}}).filter(Boolean)}function moe(e){var t=dn(e,lw),n=Cn();return h.createElement(Xm,{id:t.id,type:"line"},r=>h.createElement(h.Fragment,null,h.createElement(J1,{legendPayload:ioe(t)}),h.createElement(aoe,{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:r}),h.createElement(nw,{type:"line",id:r,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),h.createElement(foe,ch({},t,{id:r}))))}var ts=h.memo(moe,Ss);ts.displayName="Line";function qi(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.xAxisId)!==null&&n!==void 0?n:nD}function Yi(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.yAxisId)!==null&&n!==void 0?n:nD}var xD=(e,t,n)=>Hi(e,"xAxis",qi(e,t),n),bD=(e,t,n)=>Ki(e,"xAxis",qi(e,t),n),wD=(e,t,n)=>Hi(e,"yAxis",Yi(e,t),n),SD=(e,t,n)=>Ki(e,"yAxis",Yi(e,t),n),goe=G([lt,xD,wD,bD,SD],(e,t,n,r,i)=>fi(e,"xAxis")?oo(t,r,!1):oo(n,i,!1)),yoe=(e,t)=>t,jD=G([dd,yoe],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),kD=e=>{var t=lt(e),n=fi(t,"xAxis");return n?"yAxis":"xAxis"},voe=(e,t)=>{var n=kD(e);return n==="yAxis"?Yi(e,t):qi(e,t)},xoe=(e,t,n)=>th(e,kD(e),voe(e,t),n),boe=G([jD,xoe],(e,t)=>{var n;if(!(e==null||t==null)){var r=e.stackId,i=mm(e);if(!(r==null||i==null)){var a=(n=t[r])===null||n===void 0?void 0:n.stackedData,s=a==null?void 0:a.find(l=>l.key===i);if(s!=null)return s.map(l=>[l[0],l[1]])}}}),woe=G([lt,xD,wD,bD,SD,boe,mM,goe,jD,NY],(e,t,n,r,i,a,s,l,c,u)=>{var p=s.chartData,d=s.dataStartIndex,f=s.dataEndIndex;if(!(c==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||l==null)){var m=c.data,g;if(m&&m.length>0?g=m:g=p==null?void 0:p.slice(d,f+1),g!=null)return qoe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:d,areaSettings:c,stackedData:a,displayedData:g,chartBaseValue:u,bandSize:l})}}),Soe=["animationElapsedTime","isAnimating","isEntrance","layout","isRange","stroke","connectNulls"],joe=["id","baseLine"];function Gc(){return Gc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gc.apply(null,arguments)}function YA(e,t){if(e==null)return{};var n,r,i=koe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function koe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Coe(e){var t,n,r=e.alpha,i=e.baseLine,a=e.points,s=e.strokeWidth,l=(t=a[0])===null||t===void 0?void 0:t.x,c=(n=a[a.length-1])===null||n===void 0?void 0:n.x;if(!Je(l)||!Je(c))return null;var u=r*Math.abs(l-c),p=Math.max(...a.map(d=>d.y||0));return Ce(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(d=>d.y||0),p)),Ce(p)?h.createElement("rect",{x:l<c?l:l-u,y:0,width:u,height:Math.floor(p+(s?parseInt("".concat(s),10):1))}):null}function Poe(e){var t,n,r=e.alpha,i=e.baseLine,a=e.points,s=e.strokeWidth,l=(t=a[0])===null||t===void 0?void 0:t.y,c=(n=a[a.length-1])===null||n===void 0?void 0:n.y;if(!Je(l)||!Je(c))return null;var u=r*Math.abs(l-c),p=Math.max(...a.map(d=>d.x||0));return Ce(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(d=>d.x||0),p)),Ce(p)?h.createElement("rect",{x:0,y:l<c?l:l-u,width:p+(s?parseInt("".concat(s),10):1),height:Math.floor(u)}):null}function Aoe(e){var t=e.alpha,n=e.layout,r=e.points,i=e.baseLine,a=e.strokeWidth;return n==="vertical"?h.createElement(Poe,{alpha:t,points:r,baseLine:i,strokeWidth:a}):h.createElement(Coe,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function Eoe(e){var t=e.animationElapsedTime,n=t===void 0?1:t,r=e.isAnimating,i=r===void 0?!1:r,a=e.isEntrance,s=a===void 0?!1:a,l=e.layout,c=e.isRange,u=e.stroke,p=e.connectNulls,d=YA(e,Soe),f=l==="vertical"?"vertical":"horizontal",m=p??!1,g=QR(),v=d.id,x=d.baseLine,y=YA(d,joe),b=er(y),w=h.createElement(fl,Gc({},d,{id:v,baseLine:x,connectNulls:m,stroke:"none",className:"recharts-area-area",layout:f})),S=u!=="none"&&h.createElement(fl,Gc({},b,{className:"recharts-area-curve",layout:f,type:d.type,connectNulls:m,fill:"none",stroke:u,points:d.points})),k=u!=="none"&&c&&Array.isArray(x)&&h.createElement(fl,Gc({},b,{className:"recharts-area-curve",layout:f,type:d.type,connectNulls:m,fill:"none",stroke:u,points:x}));if(s&&(i||n<1)){var j;return h.createElement(Xt,null,h.createElement("defs",null,h.createElement("clipPath",{id:g},h.createElement(Aoe,{alpha:n,points:(j=d.points)!==null&&j!==void 0?j:[],baseLine:x,layout:f,strokeWidth:d.strokeWidth}))),h.createElement(Xt,{clipPath:"url(#".concat(g,")")},w,S,k))}return h.createElement(h.Fragment,null,w,S,k)}var Toe=["id"],Ioe=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function uh(){return uh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uh.apply(null,arguments)}function CD(e,t){if(e==null)return{};var n,r,i=Ooe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ooe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function GA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Dl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GA(Object(n),!0).forEach(function(r){Noe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Noe(e,t,n){return(t=Moe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Moe(e){var t=_oe(e,"string");return typeof t=="symbol"?t:t+""}function _oe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Roe=(e,t)=>e==null?[]:t===1?e.flatMap(n=>n.status==="removed"?[]:[n.next]):e.flatMap(n=>n.status==="matched"?[Dl(Dl({},n.next),{},{x:Ot(n.prev.x,n.next.x,t),y:Ot(n.prev.y,n.next.y,t)})]:n.status==="added"?[n.next]:[]),PD={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",animationMatchBy:qm,animationInterpolateFn:Roe,connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,shape:Eoe,xAxisId:0,yAxisId:0,zIndex:an.area};function dh(e,t){return e&&e!=="none"?e:t}var Doe=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.fill,a=e.legendType,s=e.hide;return[{inactive:s,dataKey:t,type:a,color:dh(r,i),value:mo(n,t),payload:e}]},Loe=h.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,s=e.name,l=e.hide,c=e.unit,u=e.tooltipType,p=e.id,d={dataDefinedOnItem:n,getPosition:ho,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:mo(s,t),hide:l,type:u,color:dh(r,a),unit:c,graphicalItemId:p}};return h.createElement(Vm,{tooltipEntrySettings:d})});function zoe(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.needClip,a=r.dot,s=r.dataKey,l=er(r);return h.createElement(tD,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:s,baseProps:l,needClip:i,clipPathId:t})}function $oe(e){var t=e.showLabels,n=e.children,r=e.points,i=r.map(a=>{var s,l,c={x:(s=a.x)!==null&&s!==void 0?s:0,y:(l=a.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Dl(Dl({},c),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:c,fill:void 0})});return h.createElement(W1,{value:t?i:void 0},n)}function Boe(e){var t=e.points,n=e.baseLine,r=e.needClip,i=e.clipPathId,a=e.props,s=e.animationElapsedTime,l=e.isAnimating,c=e.isEntrance,u=a.layout,p=a.type,d=a.stroke,f=a.connectNulls,m=a.isRange,g=a.shape,v=a.id,x=CD(a,Toe),y=mr(x),b=Dl(Dl({},y),{},{id:v,points:t,connectNulls:f,type:p,baseLine:n,layout:u,stroke:d,isRange:m,animationElapsedTime:s,isAnimating:l,isEntrance:c});return h.createElement(h.Fragment,null,(t==null?void 0:t.length)>1&&h.createElement(Xt,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},h.createElement(Hm,{option:g,DefaultShape:PD.shape,shapeProps:b})),h.createElement(zoe,{points:t,props:x,clipPathId:i}))}function Foe(e,t,n){if(Ce(e)){var r=Ce(t)?t:void 0;return Ot(r,e,n)}if($t(e)||ui(e)){var i=Ce(t)?t:void 0;return Ot(i,0,n)}return e}function Uoe(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=e.previousPointsRef,a=e.previousBaselineRef,s=r.points,l=r.baseLine,c=r.isAnimationActive,u=r.animationBegin,p=r.animationDuration,d=r.animationEasing,f=r.animationMatchBy,m=r.animationInterpolateFn,g=h.useMemo(()=>({points:s,baseLine:l}),[s,l]),v=XR(g,a),x=Eb(),y=Ym(r.onAnimationStart,r.onAnimationEnd),b=y.isAnimating,w=y.handleAnimationStart,S=y.handleAnimationEnd,k=v.startValue;if(x==null)return null;var j;return Array.isArray(l)&&Array.isArray(k)?j=Ix(k,l,f):Array.isArray(l)?j=Ix(null,l,f):j=null,h.createElement(Gm,{animationInput:g,animationIdPrefix:"recharts-area-",items:s,previousItemsRef:i,isAnimationActive:c,animationBegin:u,animationDuration:p,animationEasing:d,onAnimationStart:w,onAnimationEnd:S,animationInterpolateFn:m,animationMatchBy:f,layout:x},(A,E,D)=>{var O;return E===1?O=l:Array.isArray(l)?O=m(j,E,x):O=D?l:Foe(l,k,E),v.syncStepValue(O,E),h.createElement($oe,{showLabels:!b,points:s},r.children,h.createElement(Boe,{points:A,baseLine:O,needClip:t,clipPathId:n,props:r,animationElapsedTime:E,isAnimating:b||E<1,isEntrance:D}),h.createElement(Om,{label:r.label}))})}function Woe(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=h.useRef(null),a=h.useRef();return h.createElement(Uoe,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class Koe extends h.PureComponent{render(){var t=this.props,n=t.hide,r=t.dot,i=t.points,a=t.className,s=t.top,l=t.left,c=t.needClip,u=t.xAxisId,p=t.yAxisId,d=t.width,f=t.height,m=t.id,g=t.baseLine,v=t.zIndex;if(n)return null;var x=mt("recharts-area",a),y=m,b=vD(r),w=b.r,S=b.strokeWidth,k=G1(r),j=w*2+S,A=c?"url(#clipPath-".concat(k?"":"dots-").concat(y,")"):void 0;return h.createElement(ir,{zIndex:v},h.createElement(Xt,{className:x},c&&h.createElement("defs",null,h.createElement(ow,{clipPathId:y,xAxisId:u,yAxisId:p}),!k&&h.createElement("clipPath",{id:"clipPath-dots-".concat(y)},h.createElement("rect",{x:l-j/2,y:s-j/2,width:d+j,height:f+j}))),h.createElement(Woe,{needClip:c,clipPathId:y,props:this.props})),h.createElement(Ox,{points:i,mainColor:dh(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:A}),this.props.isRange&&Array.isArray(g)&&h.createElement(Ox,{points:g,mainColor:dh(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:A}))}}function Hoe(e){var t,n=e.activeDot,r=e.animationBegin,i=e.animationDuration,a=e.animationEasing,s=e.connectNulls,l=e.dot,c=e.fill,u=e.fillOpacity,p=e.hide,d=e.isAnimationActive,f=e.legendType,m=e.stroke,g=e.xAxisId,v=e.yAxisId,x=CD(e,Ioe),y=go(),b=xR(),w=Jm(g,v),S=w.needClip,k=Cn(),j=(t=Te(I=>woe(I,e.id,k)))!==null&&t!==void 0?t:{},A=j.points,E=j.isRange,D=j.baseLine,O=Zm();if(y!=="horizontal"&&y!=="vertical"||O==null||b!=="AreaChart"&&b!=="ComposedChart")return null;var _=O.height,R=O.width,X=O.x,V=O.y;return!A||!A.length?null:h.createElement(Koe,uh({},x,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,baseLine:D,connectNulls:s,dot:l,fill:c,fillOpacity:u,height:_,hide:p,layout:y,isAnimationActive:d,isRange:E,legendType:f,needClip:S,points:A,stroke:m,width:R,left:X,top:V,xAxisId:g,yAxisId:v}))}var Voe=(e,t,n,r,i)=>{var a=n??t;if(Ce(a))return a;var s=e==="horizontal"?i:r,l=s.scale.domain();if(s.type==="number"){var c=Math.max(l[0],l[1]),u=Math.min(l[0],l[1]);return a==="dataMin"?u:a==="dataMax"||c<0?c:Math.max(Math.min(l[0],l[1]),0)}return a==="dataMin"?l[0]:a==="dataMax"?l[1]:l[0]};function qoe(e){var t=e.areaSettings,n=t.connectNulls,r=t.baseValue,i=t.dataKey,a=e.stackedData,s=e.layout,l=e.chartBaseValue,c=e.xAxis,u=e.yAxis,p=e.displayedData,d=e.dataStartIndex,f=e.xAxisTicks,m=e.yAxisTicks,g=e.bandSize,v=a&&a.length,x=Voe(s,l,r,c,u),y=s==="horizontal",b=!1,w=p.map((k,j)=>{var A,E,D,O;if(v)O=a[d+j];else{var _=ht(k,i);Array.isArray(_)?(O=_,b=!0):O=[x,_]}var R=(A=(E=O)===null||E===void 0?void 0:E[1])!==null&&A!==void 0?A:null,X=R==null||v&&!n&&ht(k,i)==null;if(y){var V;return{x:Nf({axis:c,ticks:f,bandSize:g,entry:k,index:j}),y:X?null:(V=u.scale.map(R))!==null&&V!==void 0?V:null,value:O,payload:k}}return{x:X?null:(D=c.scale.map(R))!==null&&D!==void 0?D:null,y:Nf({axis:u,ticks:m,bandSize:g,entry:k,index:j}),value:O,payload:k}}),S;return v||b?S=w.map(k=>{var j,A=Array.isArray(k.value)?k.value[0]:null;if(y){var E;return{x:k.x,y:A!=null&&k.y!=null&&(E=u.scale.map(A))!==null&&E!==void 0?E:null,payload:k.payload}}return{x:A!=null&&(j=c.scale.map(A))!==null&&j!==void 0?j:null,y:k.y,payload:k.payload}}):S=y?u.scale.map(x):c.scale.map(x),{points:w,baseLine:S??0,isRange:b}}function Yoe(e){var t=dn(e,PD),n=Cn();return h.createElement(Xm,{id:t.id,type:"area"},r=>h.createElement(h.Fragment,null,h.createElement(J1,{legendPayload:Doe(t)}),h.createElement(Loe,{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:r}),h.createElement(nw,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:zN(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),h.createElement(Hoe,uh({},t,{id:r}))))}var ph=h.memo(Yoe,Ss);ph.displayName="Area";var Goe="Invariant failed";function Xoe(e,t){throw new Error(Goe)}var Qoe=["option"];function Zoe(e,t){if(e==null)return{};var n,r,i=Joe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Joe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var cw=cM;function uw(e){var t=e.option,n=Zoe(e,Qoe);return h.createElement(Hm,{option:t,DefaultShape:cw,shapeProps:n,activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"})}var ese=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(Ce(t))return t;var a=Ce(r)||$t(r);return a?t(r,i):(a||Xoe(),n)}},tse=(e,t,n)=>n,nse=(e,t)=>t,vd=G([dd,nse],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),rse=G([vd],e=>e==null?void 0:e.maxBarSize),ise=(e,t,n,r)=>r,ase=G([lt,dd,qi,Yi,tse],(e,t,n,r,i)=>t.filter(a=>e==="horizontal"?a.xAxisId===n:a.yAxisId===r).filter(a=>a.isPanorama===i).filter(a=>a.hide===!1).filter(a=>a.type==="bar")),ose=(e,t,n)=>{var r=lt(e),i=qi(e,t),a=Yi(e,t);if(!(i==null||a==null))return r==="horizontal"?th(e,"yAxis",a,n):th(e,"xAxis",i,n)},sse=(e,t)=>{var n=lt(e),r=qi(e,t),i=Yi(e,t);if(!(r==null||i==null))return n==="horizontal"?BP(e,"xAxis",r):BP(e,"yAxis",i)},lse=G([ase,OY,sse],uie),cse=(e,t,n)=>{var r,i,a=vd(e,t);if(a==null)return 0;var s=qi(e,t),l=Yi(e,t);if(s==null||l==null)return 0;var c=lt(e),u=AM(e),p=a.maxBarSize,d=$t(p)?u:p,f,m;return c==="horizontal"?(f=Hi(e,"xAxis",s,n),m=Ki(e,"xAxis",s,n)):(f=Hi(e,"yAxis",l,n),m=Ki(e,"yAxis",l,n)),(r=(i=oo(f,m,!0))!==null&&i!==void 0?i:d)!==null&&r!==void 0?r:0},AD=(e,t,n)=>{var r=lt(e),i=qi(e,t),a=Yi(e,t);if(!(i==null||a==null)){var s,l;return r==="horizontal"?(s=Hi(e,"xAxis",i,n),l=Ki(e,"xAxis",i,n)):(s=Hi(e,"yAxis",a,n),l=Ki(e,"yAxis",a,n)),oo(s,l)}},use=G([lse,AM,IY,EM,cse,AD,rse],mie),dse=(e,t,n)=>{var r=qi(e,t);if(r!=null)return Hi(e,"xAxis",r,n)},pse=(e,t,n)=>{var r=Yi(e,t);if(r!=null)return Hi(e,"yAxis",r,n)},fse=(e,t,n)=>{var r=qi(e,t);if(r!=null)return Ki(e,"xAxis",r,n)},hse=(e,t,n)=>{var r=Yi(e,t);if(r!=null)return Ki(e,"yAxis",r,n)},mse=G([use,vd],yie),gse=G([ose,vd],gie),yse=G([vn,jb,dse,pse,fse,hse,mse,lt,mM,AD,gse,vd,ise],(e,t,n,r,i,a,s,l,c,u,p,d,f)=>{var m=c.chartData,g=c.dataStartIndex,v=c.dataEndIndex;if(!(d==null||s==null||t==null||l!=="horizontal"&&l!=="vertical"||n==null||r==null||i==null||a==null||u==null)){var x=d.data,y;if(x!=null&&x.length>0?y=x:y=m==null?void 0:m.slice(g,v+1),y!=null)return Xse({layout:l,barSettings:d,pos:s,parentViewBox:t,bandSize:u,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:p,displayedData:y,offset:e,cells:f,dataStartIndex:g})}}),vse=["index"];function Mx(){return Mx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mx.apply(null,arguments)}function xse(e,t){if(e==null)return{};var n,r,i=bse(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function bse(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var ED=h.createContext(void 0),wse=e=>{var t=h.useContext(ED);if(t!=null)return t.stackId;if(e!=null)return zN(e)},Sse=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),jse=e=>{var t=h.useContext(ED);if(t!=null){var n=t.stackId;return"url(#".concat(Sse(n,e),")")}},TD=e=>{var t=e.index,n=xse(e,vse),r=jse(t);return h.createElement(Xt,Mx({className:"recharts-bar-stack-layer",clipPath:r},n))},kse=["onMouseEnter","onMouseLeave","onClick"],Cse=["value","background","tooltipPosition"],Pse=["id"],Ase=["onMouseEnter","onClick","onMouseLeave"];function XA(e,t){return Ose(e)||Ise(e,t)||Tse(e,t)||Ese()}function Ese(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
483
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tse(e,t){if(e){if(typeof e=="string")return QA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?QA(e,t):void 0}}function QA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ise(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Ose(e){if(Array.isArray(e))return e}function lo(){return lo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lo.apply(null,arguments)}function ZA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function mn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZA(Object(n),!0).forEach(function(r){Nse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nse(e,t,n){return(t=Mse(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mse(e){var t=_se(e,"string");return typeof t=="symbol"?t:t+""}function _se(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fh(e,t){if(e==null)return{};var n,r,i=Rse(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Rse(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Dse=e=>{var t=e.dataKey,n=e.name,r=e.fill,i=e.legendType,a=e.hide;return[{inactive:a,dataKey:t,type:i,color:r,value:mo(n,t),payload:e}]},Lse=h.memo(e=>{var t=e.dataKey,n=e.stroke,r=e.strokeWidth,i=e.fill,a=e.name,s=e.hide,l=e.unit,c=e.tooltipType,u=e.id,p={dataDefinedOnItem:void 0,getPosition:ho,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:mo(a,t),hide:s,type:c,color:i,unit:l,graphicalItemId:u}};return h.createElement(Vm,{tooltipEntrySettings:p})});function zse(e){var t=Te(so),n=e.data,r=e.dataKey,i=e.background,a=e.allOtherBarProps,s=a.onMouseEnter,l=a.onMouseLeave,c=a.onClick,u=fh(a,kse),p=X1(s,r,a.id),d=Q1(l),f=Z1(c,r,a.id);if(!i||n==null)return null;var m=ls(i);return h.createElement(ir,{zIndex:vie(i,an.barBackground)},n.map((g,v)=>{g.value;var x=g.background;g.tooltipPosition;var y=fh(g,Cse);if(!x)return null;var b=p(g,g.originalDataIndex),w=d(g,g.originalDataIndex),S=f(g,g.originalDataIndex),k=mn(mn(mn(mn(mn({option:i,isActive:String(g.originalDataIndex)===t},y),{},{fill:"#eee"},x),m),Yu(u,g,v)),{},{onMouseEnter:b,onMouseLeave:w,onClick:S,dataKey:r,index:v,className:"recharts-bar-background-rectangle"});return h.createElement(uw,lo({key:"background-bar-".concat(v)},k))}))}function $se(e){var t=e.showLabels,n=e.children,r=e.rects,i=r==null?void 0:r.map(a=>{var s={x:a.x,y:a.y,width:a.width,lowerWidth:a.width,upperWidth:a.width,height:a.height};return mn(mn({},s),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:s,fill:a.fill})});return h.createElement(W1,{value:t?i:void 0},n)}function Bse(e){var t=e.shape,n=e.activeBar,r=e.baseProps,i=e.entry,a=e.index,s=e.dataKey,l=Te(so),c=Te(D1),u=n&&String(i.originalDataIndex)===l&&(c==null||s===c),p=h.useState(!1),d=XA(p,2),f=d[0],m=d[1],g=h.useState(!1),v=XA(g,2),x=v[0],y=v[1];h.useEffect(()=>{var A;return u?(m(!0),A=requestAnimationFrame(()=>{y(!0)})):y(!1),()=>{cancelAnimationFrame(A)}},[u]);var b=h.useCallback(()=>{u||m(!1)},[u]),w=u&&x,S=u||f,k;u?n===!0?k=t:k=n:k=t;var j=h.createElement(uw,lo({},r,{name:String(r.name)},i,{isActive:w,option:k,index:a,dataKey:s,animationElapsedTime:e.animationElapsedTime,isAnimating:e.isAnimating,isEntrance:e.isEntrance,onTransitionEnd:b}));return S?h.createElement(ir,{zIndex:an.activeBar},h.createElement(TD,{index:i.originalDataIndex},j)):j}function Fse(e){var t=e.shape,n=e.baseProps,r=e.entry,i=e.index,a=e.dataKey;return h.createElement(uw,lo({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a,animationElapsedTime:e.animationElapsedTime,isAnimating:e.isAnimating,isEntrance:e.isEntrance}))}function Use(e){var t,n=e.data,r=e.props,i=e.animationElapsedTime,a=e.isAnimating,s=e.isEntrance,l=(t=er(r))!==null&&t!==void 0?t:{},c=l.id,u=fh(l,Pse),p=r.shape,d=r.dataKey,f=r.activeBar,m=r.onMouseEnter,g=r.onClick,v=r.onMouseLeave,x=fh(r,Ase),y=X1(m,d,c),b=Q1(v),w=Z1(g,d,c);return n?h.createElement(h.Fragment,null,n.map((S,k)=>h.createElement(TD,lo({index:S.originalDataIndex,key:"rectangle-".concat(S==null?void 0:S.x,"-").concat(S==null?void 0:S.y,"-").concat(S==null?void 0:S.value,"-").concat(k),className:"recharts-bar-rectangle"},Yu(x,S,k),{onMouseEnter:y(S,S.originalDataIndex),onMouseLeave:b(S,S.originalDataIndex),onClick:w(S,S.originalDataIndex)}),f?h.createElement(Bse,{shape:p,activeBar:f,baseProps:u,entry:S,index:k,dataKey:d,animationElapsedTime:i,isAnimating:a,isEntrance:s}):h.createElement(Fse,{shape:p,baseProps:u,entry:S,index:k,dataKey:d,animationElapsedTime:i,isAnimating:a,isEntrance:s})))):null}var Wse=(e,t,n)=>e==null?[]:t===1?e.flatMap(r=>r.status==="removed"?[]:[r.next]):e.flatMap(r=>{if(r.status==="removed")return n==="horizontal"?[mn(mn({},r.prev),{},{height:Ot(r.prev.height,0,t),y:Ot(r.prev.y,r.prev.y+r.prev.height,t)})]:[mn(mn({},r.prev),{},{width:Ot(r.prev.width,0,t)})];if(r.status==="matched")return[mn(mn({},r.next),{},{x:Ot(r.prev.x,r.next.x,t),y:Ot(r.prev.y,r.next.y,t),width:Ot(r.prev.width,r.next.width,t),height:Ot(r.prev.height,r.next.height,t)})];var i=r.next;return n==="horizontal"?[mn(mn({},i),{},{height:Ot(0,i.height,t),y:Ot(i.stackedBarStart,i.y,t)})]:[mn(mn({},i),{},{width:Ot(0,i.width,t),x:Ot(i.stackedBarStart,i.x,t)})]});function Kse(e){var t=e.props,n=e.previousRectanglesRef,r=t.data,i=t.isAnimationActive,a=t.animationBegin,s=t.animationDuration,l=t.animationEasing,c=t.animationInterpolateFn,u=t.layout,p=Ym(t.onAnimationStart,t.onAnimationEnd),d=p.isAnimating,f=p.handleAnimationStart,m=p.handleAnimationEnd;return h.createElement($se,{showLabels:!d,rects:r},h.createElement(Gm,{animationInput:r,animationIdPrefix:"recharts-bar-",items:r,previousItemsRef:n,isAnimationActive:i,animationBegin:a,animationDuration:s,animationEasing:l,onAnimationStart:f,onAnimationEnd:m,animationInterpolateFn:c,animationMatchBy:t.animationMatchBy,layout:u},(g,v,x)=>h.createElement(Xt,null,h.createElement(Use,{props:t,data:g,animationElapsedTime:v,isAnimating:d||v<1,isEntrance:x}))),h.createElement(Om,{label:t.label}),t.children)}function Hse(e){var t=h.useRef(null);return h.createElement(Kse,{previousRectanglesRef:t,props:e})}var ID=0,Vse=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:ht(e,t)}};class qse extends h.PureComponent{render(){var t=this.props,n=t.hide,r=t.data,i=t.dataKey,a=t.className,s=t.xAxisId,l=t.yAxisId,c=t.needClip,u=t.background,p=t.id;if(n||r==null)return null;var d=mt("recharts-bar",a),f=p;return h.createElement(Xt,{className:d,id:p},c&&h.createElement("defs",null,h.createElement(ow,{clipPathId:f,xAxisId:s,yAxisId:l})),h.createElement(Xt,{className:"recharts-bar-rectangles",clipPath:c?"url(#clipPath-".concat(f,")"):void 0},h.createElement(zse,{data:r,dataKey:i,background:u,allOtherBarProps:this.props}),h.createElement(Hse,this.props)))}}var Yse={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",animationInterpolateFn:Wse,animationMatchBy:ew,background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:ID,shape:cw,xAxisId:0,yAxisId:0,zIndex:an.bar};function Gse(e){var t=e.xAxisId,n=e.yAxisId,r=e.hide,i=e.legendType,a=e.minPointSize,s=e.activeBar,l=e.animationBegin,c=e.animationDuration,u=e.animationEasing,p=e.isAnimationActive,d=Jm(t,n),f=d.needClip,m=go(),g=Cn(),v=Y1(e.children,yd),x=Te(w=>yse(w,e.id,g,v));if(m!=="vertical"&&m!=="horizontal")return null;var y,b=x==null?void 0:x[0];return b==null||b.height==null||b.width==null?y=0:y=m==="vertical"?b.height/2:b.width/2,h.createElement(fD,{xAxisId:t,yAxisId:n,data:x,dataPointFormatter:Vse,errorBarOffset:y},h.createElement(qse,lo({},e,{layout:m,needClip:f,data:x,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:s,animationBegin:l,animationDuration:c,animationEasing:u,isAnimationActive:p})))}function Xse(e){var t=e.layout,n=e.barSettings,r=n.dataKey,i=n.minPointSize,a=n.hasCustomShape,s=e.pos,l=e.bandSize,c=e.xAxis,u=e.yAxis,p=e.xAxisTicks,d=e.yAxisTicks,f=e.stackedData,m=e.displayedData,g=e.offset,v=e.cells,x=e.parentViewBox,y=e.dataStartIndex,b=t==="horizontal"?u:c,w=f?b.scale.domain():null,S=RH({numericAxis:b}),k=b.scale.map(S);return m.map((j,A)=>{var E,D,O,_,R,X;if(f){var V=f[A+y];if(V==null)return null;E=IH(V,w)}else E=ht(j,r),Array.isArray(E)||(E=[S,E]);var I=ese(i,ID)(E[1],A);if(t==="horizontal"){var $,H=u.scale.map(E[0]),N=u.scale.map(E[1]);if(H==null||N==null)return null;D=_k({axis:c,ticks:p,bandSize:l,offset:s.offset,entry:j,index:A}),O=($=N??H)!==null&&$!==void 0?$:void 0,_=s.size;var U=H-N;if(R=ui(U)?0:U,X={x:D,y:g.top,width:_,height:g.height},Math.abs(I)>0&&Math.abs(R)<Math.abs(I)){var P=jn(R||I)*(Math.abs(I)-Math.abs(R));O-=P,R+=P}}else{var W=c.scale.map(E[0]),se=c.scale.map(E[1]);if(W==null||se==null)return null;if(D=W,O=_k({axis:u,ticks:d,bandSize:l,offset:s.offset,entry:j,index:A}),_=se-W,R=s.size,X={x:g.left,y:O,width:g.width,height:R},Math.abs(I)>0&&Math.abs(_)<Math.abs(I)){var T=jn(_||I)*(Math.abs(I)-Math.abs(_));_+=T}}if(D==null||O==null||_==null||R==null||!a&&(_===0||R===0))return null;var he=mn(mn({},j),{},{stackedBarStart:k,x:D,y:O,width:_,height:R,value:f?E:E[1],payload:j,background:X,tooltipPosition:{x:D+_/2,y:O+R/2},parentViewBox:x,originalDataIndex:A},v&&v[A]&&v[A].props);return he}).filter(Boolean)}function Qse(e){var t=dn(e,Yse),n=wse(t.stackId),r=Cn();return h.createElement(Xm,{id:t.id,type:"bar"},i=>h.createElement(h.Fragment,null,h.createElement(J1,{legendPayload:Dse(t)}),h.createElement(Lse,{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}),h.createElement(nw,{type:"bar",id:i,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r,hasCustomShape:t.shape!=null&&t.shape!==cw}),h.createElement(ir,{zIndex:t.zIndex},h.createElement(Gse,lo({},t,{id:i})))))}var OD=h.memo(Qse,Ss);OD.displayName="Bar";var Zse=["domain","range"],Jse=["domain","range"];function JA(e,t){if(e==null)return{};var n,r,i=ele(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ele(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function e2(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 ND(e,t){if(e===t)return!0;var n=e.domain,r=e.range,i=JA(e,Zse),a=t.domain,s=t.range,l=JA(t,Jse);return!e2(n,a)||!e2(r,s)?!1:Ss(i,l)}var tle=["type"],nle=["dangerouslySetInnerHTML","ticks","scale"],rle=["id","scale"];function _x(){return _x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_x.apply(null,arguments)}function t2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function n2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?t2(Object(n),!0).forEach(function(r){ile(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ile(e,t,n){return(t=ale(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ale(e){var t=ole(e,"string");return typeof t=="symbol"?t:t+""}function ole(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rx(e,t){if(e==null)return{};var n,r,i=sle(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function sle(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function lle(e){var t=St(),n=h.useRef(null),r=Eb(),i=e.type,a=Rx(e,tle),s=fm(r,"xAxis",i),l=h.useMemo(()=>{if(s!=null)return n2(n2({},a),{},{type:s})},[a,s]);return h.useLayoutEffect(()=>{l!=null&&(n.current===null?t(Kre(l)):n.current!==l&&t(Hre({prev:n.current,next:l})),n.current=l)},[l,t]),h.useLayoutEffect(()=>()=>{n.current&&(t(Vre(n.current)),n.current=null)},[t]),null}var cle=e=>{var t=e.xAxisId,n=e.className,r=Te(jb),i=Cn(),a="xAxis",s=Te(f=>Y_(f,a,t,i)),l=Te(f=>H_(f,t)),c=Te(f=>fZ(f,t)),u=Te(f=>w_(f,t));if(l==null||c==null||u==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var p=Rx(e,nle);u.id,u.scale;var d=Rx(u,rle);return h.createElement(iw,_x({},p,d,{x:c.x,y:c.y,width:l.width,height:l.height,className:mt("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:s,axisType:a,axisId:t}))},ule={allowDataOverflow:fn.allowDataOverflow,allowDecimals:fn.allowDecimals,allowDuplicatedCategory:fn.allowDuplicatedCategory,angle:fn.angle,axisLine:da.axisLine,height:fn.height,hide:!1,includeHidden:fn.includeHidden,interval:fn.interval,label:!1,minTickGap:fn.minTickGap,mirror:fn.mirror,orientation:fn.orientation,padding:fn.padding,reversed:fn.reversed,scale:fn.scale,tick:fn.tick,tickCount:fn.tickCount,tickLine:da.tickLine,tickSize:da.tickSize,type:fn.type,niceTicks:fn.niceTicks,xAxisId:0},dle=e=>{var t=dn(e,ule);return h.createElement(h.Fragment,null,h.createElement(lle,{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,niceTicks:t.niceTicks}),h.createElement(cle,t))},qo=h.memo(dle,ND);qo.displayName="XAxis";var ple=["type"],fle=["dangerouslySetInnerHTML","ticks","scale"],hle=["id","scale"];function Dx(){return Dx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dx.apply(null,arguments)}function r2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function i2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?r2(Object(n),!0).forEach(function(r){mle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mle(e,t,n){return(t=gle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gle(e){var t=yle(e,"string");return typeof t=="symbol"?t:t+""}function yle(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Lx(e,t){if(e==null)return{};var n,r,i=vle(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function vle(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function xle(e){var t=St(),n=h.useRef(null),r=Eb(),i=e.type,a=Lx(e,ple),s=fm(r,"yAxis",i),l=h.useMemo(()=>{if(s!=null)return i2(i2({},a),{},{type:s})},[s,a]);return h.useLayoutEffect(()=>{l!=null&&(n.current===null?t(qre(l)):n.current!==l&&t(Yre({prev:n.current,next:l})),n.current=l)},[l,t]),h.useLayoutEffect(()=>()=>{n.current&&(t(Gre(n.current)),n.current=null)},[t]),null}function ble(e){var t=e.yAxisId,n=e.className,r=e.width,i=e.label,a=h.useRef(null),s=h.useRef(null),l=Te(jb),c=Cn(),u=St(),p="yAxis",d=Te(y=>V_(y,t)),f=Te(y=>mZ(y,t)),m=Te(y=>Y_(y,p,t,c)),g=Te(y=>S_(y,t));if(h.useLayoutEffect(()=>{if(!(r!=="auto"||!d||U1(i)||h.isValidElement(i)||g==null)){var y=a.current;if(y){var b=y.getCalculatedWidth();Math.round(d.width)!==Math.round(b)&&u(Xre({id:t,width:b}))}}},[m,d,u,i,t,r,g]),d==null||f==null||g==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var v=Lx(e,fle);g.id,g.scale;var x=Lx(g,hle);return h.createElement(iw,Dx({},v,x,{ref:a,labelRef:s,x:f.x,y:f.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:d.width,height:d.height,className:mt("recharts-".concat(p," ").concat(p),n),viewBox:l,ticks:m,axisType:p,axisId:t}))}var wle={allowDataOverflow:hn.allowDataOverflow,allowDecimals:hn.allowDecimals,allowDuplicatedCategory:hn.allowDuplicatedCategory,angle:hn.angle,axisLine:da.axisLine,hide:!1,includeHidden:hn.includeHidden,interval:hn.interval,label:!1,minTickGap:hn.minTickGap,mirror:hn.mirror,orientation:hn.orientation,padding:hn.padding,reversed:hn.reversed,scale:hn.scale,tick:hn.tick,tickCount:hn.tickCount,tickLine:da.tickLine,tickSize:da.tickSize,type:hn.type,niceTicks:hn.niceTicks,width:hn.width,yAxisId:0},Sle=e=>{var t=dn(e,wle);return h.createElement(h.Fragment,null,h.createElement(xle,{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,niceTicks:t.niceTicks}),h.createElement(ble,t))},Yo=h.memo(Sle,ND);Yo.displayName="YAxis";var jle=(e,t)=>t,dw=G([jle,lt,RM,Pn,pR,Ea,DJ,vn],WJ);function kle(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function pw(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(kle(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var s=(l,c)=>({relativeX:Math.round((l-t.left)/n),relativeY:Math.round((c-t.top)/r)});return"touches"in e?Array.from(e.touches).map(l=>s(l.clientX,l.clientY)):s(e.clientX,e.clientY)}var MD=Ar("mouseClick"),_D=Xu();_D.startListening({actionCreator:MD,effect:(e,t)=>{var n=e.payload,r=dw(t.getState(),pw(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(OZ({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var zx=Ar("mouseMove"),RD=Xu(),Ds=null,ko=null,yy=null;RD.startListening({actionCreator:zx,effect:(e,t)=>{var n=e.payload,r=t.getState(),i=r.eventSettings,a=i.throttleDelay,s=i.throttledEvents,l=s==="all"||(s==null?void 0:s.includes("mousemove"));Ds!==null&&(cancelAnimationFrame(Ds),Ds=null),ko!==null&&(typeof a!="number"||!l)&&(clearTimeout(ko),ko=null),yy=pw(n);var c=()=>{var u=t.getState(),p=hd(u,u.tooltip.settings.shared);if(!yy){Ds=null,ko=null;return}if(p==="axis"){var d=dw(u,yy);(d==null?void 0:d.activeIndex)!=null?t.dispatch(nR({activeIndex:d.activeIndex,activeDataKey:void 0,activeCoordinate:d.activeCoordinate})):t.dispatch(tR())}Ds=null,ko=null};if(!l){c();return}a==="raf"?Ds=requestAnimationFrame(c):typeof a=="number"&&ko===null&&(ko=setTimeout(c,a))}});function Cle(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 a2={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},DD=Yn({name:"rootProps",initialState:a2,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:a2.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}}}),Ple=DD.reducer,Ale=DD.actions.updateOptions,Ele=null,Tle={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},LD=Yn({name:"polarOptions",initialState:Ele,reducers:Tle}),Ile=LD.actions.updatePolarOptions,Ole=LD.reducer,zD=Ar("keyDown"),$D=Ar("focus"),BD=Ar("blur"),eg=Xu(),Ls=null,Co=null,sp=null;eg.startListening({actionCreator:zD,effect:(e,t)=>{sp=e.payload,Ls!==null&&(cancelAnimationFrame(Ls),Ls=null);var n=t.getState(),r=n.eventSettings,i=r.throttleDelay,a=r.throttledEvents,s=a==="all"||a.includes("keydown");Co!==null&&(typeof i!="number"||!s)&&(clearTimeout(Co),Co=null);var l=()=>{try{var c=t.getState(),u=c.rootProps.accessibilityLayer!==!1;if(!u)return;var p=c.tooltip.keyboardInteraction,d=sp;if(d!=="ArrowRight"&&d!=="ArrowLeft"&&d!=="Enter")return;var f=qc(p,ms(c),_l(c),Rl(c)),m=f==null?-1:Number(f),g=!Number.isFinite(m)||m<0,v=Ea(c),x=ms(c),y=hd(c,c.tooltip.settings.shared);if(d==="Enter"){if(g)return;var b=ih(c,y,"hover",String(p.index));t.dispatch(rh({active:!p.active,activeIndex:p.index,activeCoordinate:b}));return}var w=bZ(c),S=w==="left-to-right"?1:-1,k=d==="ArrowRight"?1:-1,j;if(g){var A=_l(c),E=Rl(c),D=k*S,O=I=>({active:!1,index:String(I),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(j=-1,D>0){for(var _=0;_<x.length;_++)if(qc(O(_),x,A,E)!=null){j=_;break}}else for(var R=x.length-1;R>=0;R--)if(qc(O(R),x,A,E)!=null){j=R;break}if(j<0)return}else{j=m+k*S;var X=(v==null?void 0:v.length)||x.length;if(X===0||j>=X||j<0)return}var V=ih(c,y,"hover",String(j));t.dispatch(rh({active:!0,activeIndex:j.toString(),activeCoordinate:V}))}finally{Ls=null,Co=null}};if(!s){l();return}i==="raf"?Ls=requestAnimationFrame(l):typeof i=="number"&&Co===null&&(l(),sp=null,Co=setTimeout(()=>{sp?l():(Co=null,Ls=null)},i))}});eg.startListening({actionCreator:$D,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var i=n.tooltip.keyboardInteraction;if(!i.active&&i.index==null){var a="0",s=hd(n,n.tooltip.settings.shared),l=ih(n,s,"hover",String(a));t.dispatch(rh({active:!0,activeIndex:a,activeCoordinate:l}))}}}});eg.startListening({actionCreator:BD,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var i=n.tooltip.keyboardInteraction;i.active&&t.dispatch(rh({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function FD(e){e.persist();var t=e.currentTarget;return new Proxy(e,{get:(n,r)=>{if(r==="currentTarget")return t;var i=Reflect.get(n,r);return typeof i=="function"?i.bind(n):i}})}var Rr=Ar("externalEvent"),UD=Xu(),lp=new Map,jc=new Map,vy=new Map;UD.startListening({actionCreator:Rr,effect:(e,t)=>{var n=e.payload,r=n.handler,i=n.reactEvent;if(r!=null){var a=i.type,s=FD(i);vy.set(a,{handler:r,reactEvent:s});var l=lp.get(a);l!==void 0&&(cancelAnimationFrame(l),lp.delete(a));var c=t.getState(),u=c.eventSettings,p=u.throttleDelay,d=u.throttledEvents,f=d,m=f==="all"||(f==null?void 0:f.includes(a)),g=jc.get(a);g!==void 0&&(typeof p!="number"||!m)&&(clearTimeout(g),jc.delete(a));var v=()=>{var b=vy.get(a);try{if(!b)return;var w=b.handler,S=b.reactEvent,k=t.getState(),j={activeCoordinate:wJ(k),activeDataKey:D1(k),activeIndex:so(k),activeLabel:mR(k),activeTooltipIndex:so(k),isTooltipActive:SJ(k)};w&&w(j,S)}finally{lp.delete(a),jc.delete(a),vy.delete(a)}};if(!m){v();return}if(p==="raf"){var x=requestAnimationFrame(v);lp.set(a,x)}else if(typeof p=="number"){if(!jc.has(a)){v();var y=setTimeout(v,p);jc.set(a,y)}}else v()}}});var Nle=G([Zl],e=>e.tooltipItemPayloads),Mle=G([Nle,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(a=>a.settings.graphicalItemId===n);if(r!=null){var i=r.getPosition;if(i!=null)return i(t)}}}),WD=Ar("touchMove"),KD=Xu(),Po=null,Ma=null,o2=null,kc=null;KD.startListening({actionCreator:WD,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){kc=FD(n);var r=t.getState(),i=r.eventSettings,a=i.throttleDelay,s=i.throttledEvents,l=s==="all"||s.includes("touchmove");Po!==null&&(cancelAnimationFrame(Po),Po=null),Ma!==null&&(typeof a!="number"||!l)&&(clearTimeout(Ma),Ma=null),o2=Array.from(n.touches).map(u=>pw({clientX:u.clientX,clientY:u.clientY,currentTarget:n.currentTarget}));var c=()=>{if(kc!=null){var u=t.getState(),p=hd(u,u.tooltip.settings.shared);if(p==="axis"){var d,f=(d=o2)===null||d===void 0?void 0:d[0];if(f==null){Po=null,Ma=null;return}var m=dw(u,f);(m==null?void 0:m.activeIndex)!=null&&t.dispatch(nR({activeIndex:m.activeIndex,activeDataKey:void 0,activeCoordinate:m.activeCoordinate}))}else if(p==="item"){var g,v=kc.touches[0];if(document.elementFromPoint==null||v==null)return;var x=document.elementFromPoint(v.clientX,v.clientY);if(!x||!x.getAttribute)return;var y=x.getAttribute(BN),b=(g=x.getAttribute(FN))!==null&&g!==void 0?g:void 0,w=Cs(u).find(j=>j.id===b);if(y==null||w==null||b==null)return;var S=w.dataKey,k=Mle(u,y,b);t.dispatch(eR({activeDataKey:S,activeIndex:y,activeCoordinate:k,activeGraphicalItemId:b}))}Po=null,Ma=null}};if(!l){c();return}a==="raf"?Po=requestAnimationFrame(c):typeof a=="number"&&Ma===null&&(c(),kc=null,Ma=setTimeout(()=>{kc?c():(Ma=null,Po=null)},a))}}});var fw={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},HD=Yn({name:"eventSettings",initialState:fw,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),_le=HD.actions.setEventSettings,Rle=HD.reducer,Dle=sN({brush:xie,cartesianAxis:Qre,chartData:vee,errorBars:Lae,eventSettings:Rle,graphicalItems:tre,layout:CH,legend:L7,options:fee,polarAxis:sne,polarOptions:Ole,referenceElements:jie,renderedTicks:Hie,rootProps:Ple,tooltip:NZ,zIndex:nee}),Lle=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return XK({reducer:Dle,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([_D.middleware,RD.middleware,eg.middleware,UD.middleware,KD.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(SN({type:"raf"}))},devTools:{serialize:{replacer:Cle},name:"recharts-".concat(n)}})};function VD(e){var t=e.preloadedState,n=e.children,r=e.reduxStoreName,i=Cn(),a=h.useRef(null);if(i)return n;a.current==null&&(a.current=Lle(t,r));var s=gb;return h.createElement(aV,{context:s,store:a.current},n)}function zle(e){var t=e.layout,n=e.margin,r=St(),i=Cn();return h.useEffect(()=>{i||(r(SH(t)),r(wH(n)))},[r,i,t,n]),null}var qD=h.memo(zle,Ss);function YD(e){var t=St();return h.useEffect(()=>{t(Ale(e))},[t,e]),null}var $le=e=>{var t=St();return h.useEffect(()=>{t(_le(e))},[t,e]),null},GD=h.memo($le,Ss);function s2(e){var t=e.zIndex,n=e.isPanorama,r=h.useRef(null),i=St();return h.useLayoutEffect(()=>(r.current&&i(eee({zIndex:t,element:r.current,isPanorama:n})),()=>{i(tee({zIndex:t,isPanorama:n}))}),[i,t,n]),h.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function l2(e){var t=e.children,n=e.isPanorama,r=Te(HJ);if(!r||r.length===0)return t;var i=r.filter(s=>s<0),a=r.filter(s=>s>0);return h.createElement(h.Fragment,null,i.map(s=>h.createElement(s2,{key:s,zIndex:s,isPanorama:n})),t,a.map(s=>h.createElement(s2,{key:s,zIndex:s,isPanorama:n})))}var Ble=["children"];function Fle(e,t){if(e==null)return{};var n,r,i=Ule(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ule(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function hh(){return hh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hh.apply(null,arguments)}var Wle={width:"100%",height:"100%",display:"block"},Kle=h.forwardRef((e,t)=>{var n=Pb(),r=Ab(),i=rM();if(!Fi(n)||!Fi(r))return null;var a=e.children,s=e.otherAttributes,l=e.title,c=e.desc,u,p;return s!=null&&(typeof s.tabIndex=="number"?u=s.tabIndex:u=i?0:void 0,typeof s.role=="string"?p=s.role:p=i?"application":void 0),h.createElement(lb,hh({},s,{title:l,desc:c,role:p,tabIndex:u,width:n,height:r,style:Wle,ref:t}),a)}),Hle=e=>{var t=e.children,n=Te(sm);if(!n)return null;var r=n.width,i=n.height,a=n.y,s=n.x;return h.createElement(lb,{width:r,height:i,x:s,y:a},t)},c2=h.forwardRef((e,t)=>{var n=e.children,r=Fle(e,Ble),i=Cn();return i?h.createElement(Hle,null,h.createElement(l2,{isPanorama:!0},n)):h.createElement(Kle,hh({ref:t},r),h.createElement(l2,{isPanorama:!1},n))});function Vle(e,t){return Xle(e)||Gle(e,t)||Yle(e,t)||qle()}function qle(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
484
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yle(e,t){if(e){if(typeof e=="string")return u2(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u2(e,t):void 0}}function u2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Gle(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function Xle(e){if(Array.isArray(e))return e}function Qle(){var e=St(),t=h.useState(null),n=Vle(t,2),r=n[0],i=n[1],a=Te(FH);return h.useEffect(()=>{if(r!=null){var s=r.getBoundingClientRect(),l=s.width/r.offsetWidth;Je(l)&&l!==a&&e(kH(l))}},[r,e,a]),i}function d2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Zle(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?d2(Object(n),!0).forEach(function(r){Jle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jle(e,t,n){return(t=ece(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ece(e){var t=tce(e,"string");return typeof t=="symbol"?t:t+""}function tce(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ro(){return ro=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ro.apply(null,arguments)}function mh(e,t){return ace(e)||ice(e,t)||rce(e,t)||nce()}function nce(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
485
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rce(e,t){if(e){if(typeof e=="string")return p2(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p2(e,t):void 0}}function p2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ice(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,l=[],c=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(p){u=!0,i=p}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return l}}function ace(e){if(Array.isArray(e))return e}var oce=()=>(Aee(),null);function gh(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var sce=h.forwardRef((e,t)=>{var n,r,i=h.useRef(null),a=h.useState({containerWidth:gh((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:gh((r=e.style)===null||r===void 0?void 0:r.height)}),s=mh(a,2),l=s[0],c=s[1],u=h.useCallback((d,f)=>{c(m=>{var g=Math.round(d),v=Math.round(f);return m.containerWidth===g&&m.containerHeight===v?m:{containerWidth:g,containerHeight:v}})},[]),p=h.useCallback(d=>{if(typeof t=="function"&&t(d),i.current!=null&&(i.current.disconnect(),i.current=null),d!=null&&typeof ResizeObserver<"u"){var f=d.getBoundingClientRect(),m=f.width,g=f.height;u(m,g);var v=y=>{var b=y[0];if(b!=null){var w=b.contentRect,S=w.width,k=w.height;u(S,k)}},x=new ResizeObserver(v);x.observe(d),i.current=x}},[t,u]);return h.useEffect(()=>()=>{var d=i.current;d!=null&&d.disconnect()},[u]),h.createElement(h.Fragment,null,h.createElement(Zu,{width:l.containerWidth,height:l.containerHeight}),h.createElement("div",ro({ref:p},e)))}),lce=h.forwardRef((e,t)=>{var n=e.width,r=e.height,i=h.useState({containerWidth:gh(n),containerHeight:gh(r)}),a=mh(i,2),s=a[0],l=a[1],c=h.useCallback((p,d)=>{l(f=>{var m=Math.round(p),g=Math.round(d);return f.containerWidth===m&&f.containerHeight===g?f:{containerWidth:m,containerHeight:g}})},[]),u=h.useCallback(p=>{if(typeof t=="function"&&t(p),p!=null){var d=p.getBoundingClientRect(),f=d.width,m=d.height;c(f,m)}},[t,c]);return h.createElement(h.Fragment,null,h.createElement(Zu,{width:s.containerWidth,height:s.containerHeight}),h.createElement("div",ro({ref:u},e)))}),cce=h.forwardRef((e,t)=>{var n=e.width,r=e.height;return h.createElement(h.Fragment,null,h.createElement(Zu,{width:n,height:r}),h.createElement("div",ro({ref:t},e)))}),uce=h.forwardRef((e,t)=>{var n=e.width,r=e.height;return typeof n=="string"||typeof r=="string"?h.createElement(lce,ro({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?h.createElement(cce,ro({},e,{width:n,height:r,ref:t})):h.createElement(h.Fragment,null,h.createElement(Zu,{width:n,height:r}),h.createElement("div",ro({ref:t},e)))});function dce(e){return e?sce:uce}var pce=h.forwardRef((e,t)=>{var n=e.children,r=e.className,i=e.height,a=e.onClick,s=e.onContextMenu,l=e.onDoubleClick,c=e.onMouseDown,u=e.onMouseEnter,p=e.onMouseLeave,d=e.onMouseMove,f=e.onMouseUp,m=e.onTouchEnd,g=e.onTouchMove,v=e.onTouchStart,x=e.style,y=e.width,b=e.responsive,w=e.dispatchTouchEvents,S=w===void 0?!0:w,k=h.useRef(null),j=St(),A=h.useState(null),E=mh(A,2),D=E[0],O=E[1],_=h.useState(null),R=mh(_,2),X=R[0],V=R[1],I=Qle(),$=kb(),H=($==null?void 0:$.width)>0?$.width:y,N=($==null?void 0:$.height)>0?$.height:i,U=h.useCallback(te=>{I(te),typeof t=="function"&&t(te),O(te),V(te),te!=null&&(k.current=te)},[I,t,O,V]),P=h.useCallback(te=>{j(MD(te)),j(Rr({handler:a,reactEvent:te}))},[j,a]),W=h.useCallback(te=>{j(zx(te)),j(Rr({handler:u,reactEvent:te}))},[j,u]),se=h.useCallback(te=>{j(tR()),j(Rr({handler:p,reactEvent:te}))},[j,p]),T=h.useCallback(te=>{j(zx(te)),j(Rr({handler:d,reactEvent:te}))},[j,d]),he=h.useCallback(()=>{j($D())},[j]),ye=h.useCallback(()=>{j(BD())},[j]),Z=h.useCallback(te=>{j(zD(te.key))},[j]),le=h.useCallback(te=>{j(Rr({handler:s,reactEvent:te}))},[j,s]),Se=h.useCallback(te=>{j(Rr({handler:l,reactEvent:te}))},[j,l]),Q=h.useCallback(te=>{j(Rr({handler:c,reactEvent:te}))},[j,c]),ne=h.useCallback(te=>{j(Rr({handler:f,reactEvent:te}))},[j,f]),pe=h.useCallback(te=>{j(Rr({handler:v,reactEvent:te}))},[j,v]),ie=h.useCallback(te=>{S&&j(WD(te)),j(Rr({handler:g,reactEvent:te}))},[j,S,g]),_e=h.useCallback(te=>{j(Rr({handler:m,reactEvent:te}))},[j,m]),ke=dce(b);return h.createElement(kR.Provider,{value:D},h.createElement(hO.Provider,{value:X},h.createElement(ke,{width:H??(x==null?void 0:x.width),height:N??(x==null?void 0:x.height),className:mt("recharts-wrapper",r),style:Zle({position:"relative",cursor:"default",width:H,height:N},x),onClick:P,onContextMenu:le,onDoubleClick:Se,onFocus:he,onBlur:ye,onKeyDown:Z,onMouseDown:Q,onMouseEnter:W,onMouseLeave:se,onMouseMove:T,onMouseUp:ne,onTouchEnd:_e,onTouchMove:ie,onTouchStart:pe,ref:U},h.createElement(oce,null),n)))}),fce=["width","height","responsive","children","className","style","compact","title","desc"];function hce(e,t){if(e==null)return{};var n,r,i=mce(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function mce(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var XD=h.forwardRef((e,t)=>{var n=e.width,r=e.height,i=e.responsive,a=e.children,s=e.className,l=e.style,c=e.compact,u=e.title,p=e.desc,d=hce(e,fce),f=er(d);return c?h.createElement(h.Fragment,null,h.createElement(Zu,{width:n,height:r}),h.createElement(c2,{otherAttributes:f,title:u,desc:p},a)):h.createElement(pce,{className:s,style:l,width:n,height:r,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},h.createElement(c2,{otherAttributes:f,title:u,desc:p,ref:t},h.createElement(Iie,null,a)))});function $x(){return $x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$x.apply(null,arguments)}function f2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gce(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f2(Object(n),!0).forEach(function(r){yce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yce(e,t,n){return(t=vce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vce(e){var t=xce(e,"string");return typeof t=="symbol"?t:t+""}function xce(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var bce={top:5,right:5,bottom:5,left:5},wce=gce({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:bce,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},fw),tg=h.forwardRef(function(t,n){var r,i=dn(t.categoricalChartProps,wce),a=t.chartName,s=t.defaultTooltipEventType,l=t.validateTooltipEventTypes,c=t.tooltipPayloadSearcher,u=t.categoricalChartProps,p={chartName:a,defaultTooltipEventType:s,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,eventEmitter:void 0};return h.createElement(VD,{preloadedState:{options:p},reduxStoreName:(r=u.id)!==null&&r!==void 0?r:a},h.createElement(iD,{chartData:u.data}),h.createElement(qD,{layout:i.layout,margin:i.margin}),h.createElement(GD,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),h.createElement(YD,{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}),h.createElement(XD,$x({},i,{ref:n})))}),Sce=["axis"],Bx=h.forwardRef((e,t)=>h.createElement(tg,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Sce,tooltipPayloadSearcher:gd,categoricalChartProps:e,ref:t})),jce=["axis","item"],kce=h.forwardRef((e,t)=>h.createElement(tg,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:jce,tooltipPayloadSearcher:gd,categoricalChartProps:e,ref:t}));function Cce(e){var t=St();return h.useEffect(()=>{t(Ile(e))},[t,e]),null}var Pce=["layout"];function Fx(){return Fx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fx.apply(null,arguments)}function Ace(e,t){if(e==null)return{};var n,r,i=Ece(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ece(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function h2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Tce(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?h2(Object(n),!0).forEach(function(r){Ice(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ice(e,t,n){return(t=Oce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oce(e){var t=Nce(e,"string");return typeof t=="symbol"?t:t+""}function Nce(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Mce={top:5,right:5,bottom:5,left:5},QD=Tce({accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:Mce,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},fw),_ce=h.forwardRef(function(t,n){var r,i=dn(t.categoricalChartProps,QD),a=i.layout,s=Ace(i,Pce),l=t.chartName,c=t.defaultTooltipEventType,u=t.validateTooltipEventTypes,p=t.tooltipPayloadSearcher,d={chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:p,eventEmitter:void 0};return h.createElement(VD,{preloadedState:{options:d},reduxStoreName:(r=i.id)!==null&&r!==void 0?r:l},h.createElement(iD,{chartData:i.data}),h.createElement(qD,{layout:a,margin:i.margin}),h.createElement(GD,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),h.createElement(YD,{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}),h.createElement(Cce,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),h.createElement(XD,Fx({},s,{ref:n})))});function m2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function g2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?m2(Object(n),!0).forEach(function(r){Rce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rce(e,t,n){return(t=Dce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dce(e){var t=Lce(e,"string");return typeof t=="symbol"?t:t+""}function Lce(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zce=["item"],$ce=g2(g2({},QD),{},{layout:"centric",startAngle:0,endAngle:360}),Bce=h.forwardRef((e,t)=>{var n=dn(e,$ce);return h.createElement(_ce,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:zce,tooltipPayloadSearcher:gd,categoricalChartProps:n,ref:t})}),Fce=["axis"],Uce=h.forwardRef((e,t)=>h.createElement(tg,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Fce,tooltipPayloadSearcher:gd,categoricalChartProps:e,ref:t})),Wce=["axis"],Kce=h.forwardRef((e,t)=>h.createElement(tg,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Wce,tooltipPayloadSearcher:gd,categoricalChartProps:e,ref:t}));const Hce={background:"var(--bg-card)",borderRadius:"16px",border:"1px solid var(--border-primary)",padding:"20px",marginTop:"24px"},Vce={padding:"6px 12px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",cursor:"pointer",fontSize:"13px"},xy={padding:"6px 12px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)",fontSize:"13px"};function cp(e){return e?e>=1e3?`${(e/1e3).toFixed(2)}s`:`${Math.round(e)}ms`:"-"}function _a(e){return e?Math.round(e).toLocaleString():"-"}function qce(e){return`${(e*100).toFixed(1)}%`}function Yce(e,t){return e?e.slice(-t):[]}function Gce(){const[e,t]=h.useState("service"),[n,r]=h.useState("ttft"),[i,a]=h.useState(24),[s,l]=h.useState("overview"),[c,u]=h.useState(null),[p,d]=h.useState(null),[f,m]=h.useState(null),[g,v]=h.useState(null),[x,y]=h.useState("desc"),[b,w]=h.useState([]),[S,k]=h.useState([]),[j,A]=h.useState(null),[E,D]=h.useState(null),[O,_]=h.useState(null),[R,X]=h.useState(!1),[V,I]=h.useState(null),$=h.useCallback(async()=>{X(!0),I(null);try{s==="overview"?e==="service"?w(await Y.getPerformanceServicesOverview()||[]):k(await Y.getPerformanceVendors()||[]):s==="vendor"&&c?A(await Y.getPerformanceVendor(c)):s==="service"&&p?D(await Y.getPerformanceService(p)):s==="model"&&p&&f&&_(await Y.getPerformanceModel(p,f))}catch(te){I((te==null?void 0:te.message)||"加载失败")}finally{X(!1)}},[e,s,c,p,f]);h.useEffect(()=>{$()},[$]);const H=te=>{t(te),l("overview"),u(null),d(null),m(null),A(null),D(null),_(null),v(null)},N=te=>{u(te),d(null),m(null),A(null),D(null),_(null),l("vendor"),v(null)},U=te=>{d(te),m(null),D(null),_(null),l("service"),v(null)},P=te=>{m(te),_(null),l("model"),v(null)},W=()=>{u(null),d(null),m(null),l("overview"),v(null)},se=()=>{d(null),m(null),D(null),l("vendor"),v(null)},T=h.useMemo(()=>s==="overview"&&e==="service"?b.map(te=>({id:te.serviceId,name:te.serviceName||te.serviceId,vendorName:te.vendorName,derived:te.derived,onClick:()=>U(te.serviceId)})):s==="overview"&&e==="vendor"?S.map(te=>({id:te.vendorId,name:te.vendorName||te.vendorId,derived:te.derived,onClick:()=>N(te.vendorId)})):s==="vendor"&&j?j.services.map(te=>({id:te.serviceId,name:te.serviceName||te.serviceId,vendorName:j.vendorName,derived:te.derived,onClick:()=>U(te.serviceId)})):s==="service"&&E?E.models.map(te=>({id:te.model,name:te.model,vendorName:E.vendorName,serviceName:E.serviceName,derived:te.derived,onClick:()=>P(te.model)})):[],[s,e,b,S,j,E]),he=h.useMemo(()=>{if(!g)return T;const te=x==="asc"?1:-1;return[...T].sort((De,Ve)=>{const Le=De.derived[g]??0,We=Ve.derived[g]??0;return(Le-We)*te})},[T,g,x]),ye=te=>{g===te?y(De=>De==="asc"?"desc":"asc"):(v(te),y("desc"))},Z=te=>g!==te?" ⇅":x==="asc"?" ▲":" ▼",le=(()=>{if(s==="vendor")return j==null?void 0:j.hourly;if(s==="service")return E==null?void 0:E.hourly;if(s==="model")return O==null?void 0:O.hourly})(),Q=Yce(le,i).map(te=>n==="tokens"?{hour:te.hour.slice(11),inputTokens:te.inputTokens||0,outputTokens:te.outputTokens||0,totalTokens:te.totalTokens||0}:{hour:te.hour.slice(11),value:n==="ttft"?te.avgTtftMs:te.avgTpm}),ne=s==="overview"&&e==="service"||s==="vendor"||s==="service",pe=s==="service",ie=s==="overview"&&e==="vendor"?"供应商":s==="service"?"模型":"API 服务",_e=n==="ttft"?"首 Token 返回时间":n==="tpm"?"吞吐 TPM":"Token量",ke=s==="model"?O==null?void 0:O.derived:void 0;return o.jsxs("div",{style:Hce,children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px",flexWrap:"wrap",gap:"8px"},children:[o.jsx("h3",{style:{margin:0,fontSize:"18px",color:"var(--text-primary)"},children:"⚡ 服务性能 / 测速统计"}),s!=="overview"&&o.jsxs("div",{style:{display:"flex",gap:"6px",alignItems:"center",flexWrap:"wrap",fontSize:"13px"},children:[o.jsx("span",{onClick:W,style:by,children:e==="service"?"全部 API 服务":"全部供应商"}),e==="vendor"&&c&&o.jsxs(o.Fragment,{children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"›"}),s==="vendor"?o.jsx("span",{style:{color:"var(--text-primary)"},children:(j==null?void 0:j.vendorName)||c}):o.jsx("span",{onClick:se,style:by,children:(j==null?void 0:j.vendorName)||c})]}),E&&(s==="service"||s==="model")&&o.jsxs(o.Fragment,{children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"›"}),s==="service"?o.jsx("span",{style:{color:"var(--text-primary)"},children:E.serviceName||p}):o.jsx("span",{onClick:()=>{m(null),_(null),l("service"),v(null)},style:by,children:E.serviceName||p})]}),f&&s==="model"&&o.jsxs(o.Fragment,{children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"›"}),o.jsx("span",{style:{color:"var(--text-primary)"},children:f})]})]})]}),o.jsx("p",{style:{margin:"0 0 16px 0",color:"var(--text-muted)",fontSize:"13px"},children:"全局统计,与认证模式无关。首 Token 返回时间 = 请求发起到首个 token 的延迟;TPM = 生成阶段每分钟吐出的 token 数(基于真实流量被动采集)。"}),o.jsxs("div",{style:{display:"flex",gap:"12px",marginBottom:"16px",flexWrap:"wrap"},children:[s==="overview"&&o.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[o.jsx("label",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"维度:"}),o.jsxs("select",{style:xy,value:e,onChange:te=>H(te.target.value),children:[o.jsx("option",{value:"service",children:"API 服务"}),o.jsx("option",{value:"vendor",children:"供应商"})]})]}),s!=="overview"&&o.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[o.jsx("label",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"指标:"}),o.jsxs("select",{style:xy,value:n,onChange:te=>r(te.target.value),children:[o.jsx("option",{value:"ttft",children:"首 Token 返回时间"}),o.jsx("option",{value:"tpm",children:"吞吐 TPM"}),o.jsx("option",{value:"tokens",children:"Token量"})]})]}),o.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[o.jsx("label",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"时段:"}),o.jsxs("select",{style:xy,value:i,onChange:te=>a(Number(te.target.value)),children:[o.jsx("option",{value:24,children:"近 24 小时"}),o.jsx("option",{value:168,children:"近 7 天"}),o.jsx("option",{value:720,children:"近 30 天"})]})]}),o.jsx("button",{style:Vce,onClick:$,children:"🔄 刷新"})]}),V&&o.jsx("div",{style:{color:"#e74c3c",marginBottom:"12px"},children:V}),(()=>{const te=(ne?1:0)+(pe?1:0),De=n==="tokens"?3:2,Ve=1+te+De+2;return o.jsx("div",{style:{overflowX:"auto"},children:o.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"13px"},children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{style:Si,children:ie}),ne&&o.jsx("th",{style:Si,children:"供应商"}),pe&&o.jsx("th",{style:Si,children:"API 服务"}),n==="tokens"?o.jsxs(o.Fragment,{children:[o.jsx("th",{style:Si,children:"输入Token"}),o.jsx("th",{style:Si,children:"输出Token"}),o.jsxs("th",{style:{...Si,cursor:"pointer",userSelect:"none"},onClick:()=>ye("totalTokens"),children:["总Token",Z("totalTokens")]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("th",{style:{...Si,cursor:"pointer",userSelect:"none"},onClick:()=>ye("avgTtftMs"),children:["平均首Token",Z("avgTtftMs")]}),o.jsxs("th",{style:{...Si,cursor:"pointer",userSelect:"none"},onClick:()=>ye("avgTpm"),children:["平均 TPM",Z("avgTpm")]})]}),o.jsx("th",{style:Si,children:"样本数"}),o.jsxs("th",{style:{...Si,cursor:"pointer",userSelect:"none"},onClick:()=>ye("successRate"),children:["成功率",Z("successRate")]})]})}),o.jsxs("tbody",{children:[R&&o.jsx("tr",{children:o.jsx("td",{style:_r,colSpan:Ve,align:"center",children:"加载中..."})}),!R&&he.length===0&&o.jsx("tr",{children:o.jsx("td",{style:{..._r,color:"var(--text-muted)"},colSpan:Ve,align:"center",children:"暂无数据"})}),!R&&he.map(Le=>o.jsxs("tr",{style:Xce,children:[o.jsx("td",{style:_r,children:o.jsx("span",{style:{color:"var(--text-primary)",cursor:"pointer",textDecoration:"underline"},onClick:Le.onClick,children:Le.name})}),ne&&o.jsx("td",{style:{..._r,color:"var(--text-muted)"},children:Le.vendorName||"-"}),pe&&o.jsx("td",{style:{..._r,color:"var(--text-muted)"},children:Le.serviceName||"-"}),n==="tokens"?o.jsxs(o.Fragment,{children:[o.jsx("td",{style:_r,children:Le.derived.totalInputTokens!=null?_a(Le.derived.totalInputTokens):"-"}),o.jsx("td",{style:_r,children:Le.derived.totalOutputTokens!=null?_a(Le.derived.totalOutputTokens):"-"}),o.jsx("td",{style:_r,children:Le.derived.totalTokens!=null?_a(Le.derived.totalTokens):"-"})]}):o.jsxs(o.Fragment,{children:[o.jsx("td",{style:_r,children:cp(Le.derived.avgTtftMs)}),o.jsx("td",{style:_r,children:Le.derived.count>0?_a(Le.derived.avgTpm):"-"})]}),o.jsx("td",{style:_r,children:Le.derived.count}),o.jsx("td",{style:_r,children:qce(Le.derived.successRate)})]},Le.id))]})]})})})(),s!=="overview"&&o.jsxs("div",{style:{marginTop:"24px"},children:[o.jsxs("h4",{style:{margin:"0 0 12px 0",fontSize:"15px",color:"var(--text-primary)"},children:[_e," · 按小时走势",ke&&n!=="tokens"&&o.jsxs("span",{style:{marginLeft:"12px",fontSize:"12px",color:"var(--text-muted)"},children:["最小 ",n==="ttft"?cp(ke.minTtftMs):_a(ke.minTps?ke.minTps*60:void 0)," / 最大 ",n==="ttft"?cp(ke.maxTtftMs):_a(ke.maxTps?ke.maxTps*60:void 0)]})]}),Q.length===0?o.jsx("div",{style:{color:"var(--text-muted)",padding:"24px",textAlign:"center"},children:"暂无走势数据"}):o.jsx(Fs,{width:"100%",height:260,children:n==="tokens"?o.jsxs(Kce,{data:Q,margin:{top:8,right:16,bottom:0,left:8},children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:"perfTotalTokens",x1:"0",y1:"0",x2:"0",y2:"1",children:[o.jsx("stop",{offset:"0%",stopColor:"#667eea",stopOpacity:.35}),o.jsx("stop",{offset:"100%",stopColor:"#667eea",stopOpacity:.04})]})}),o.jsx(Vo,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(qo,{dataKey:"hour",stroke:"var(--text-muted)",fontSize:12}),o.jsx(Yo,{stroke:"var(--text-muted)",fontSize:12}),o.jsx(Do,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px"},formatter:(te,De)=>[_a(Number(te)),De]}),o.jsx(nl,{wrapperStyle:{fontSize:12}}),o.jsx(ph,{type:"monotone",dataKey:"totalTokens",name:"总Token",stroke:"#667eea",strokeWidth:2,fill:"url(#perfTotalTokens)",dot:!1}),o.jsx(ts,{type:"monotone",dataKey:"inputTokens",name:"输入Token",stroke:"#37d67a",strokeWidth:2,dot:!1}),o.jsx(ts,{type:"monotone",dataKey:"outputTokens",name:"输出Token",stroke:"#f5a623",strokeWidth:2,dot:!1})]}):o.jsxs(Bx,{data:Q,margin:{top:8,right:16,bottom:0,left:8},children:[o.jsx(Vo,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(qo,{dataKey:"hour",stroke:"var(--text-muted)",fontSize:12}),o.jsx(Yo,{stroke:"var(--text-muted)",fontSize:12}),o.jsx(Do,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px"},formatter:te=>[n==="ttft"?cp(Number(te)):_a(Number(te)),_e]}),o.jsx(ts,{type:"monotone",dataKey:"value",stroke:"#667eea",strokeWidth:2,dot:!1,name:_e})]})})]})]})}const Si={textAlign:"left",padding:"10px 12px",borderBottom:"2px solid var(--border-primary)",color:"var(--text-muted)",fontWeight:500,fontSize:"12px"},_r={padding:"10px 12px",borderBottom:"1px solid var(--border-primary)",color:"var(--text-primary)"},by={color:"var(--text-primary)",cursor:"pointer",textDecoration:"underline",textDecorationColor:"transparent"},Xce={transition:"background 0.15s"},y2=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#06b6d4","#f97316"];function Qce(){const[e,t]=h.useState(null),[n,r]=h.useState(!0),[i,a]=h.useState(30);h.useEffect(()=>{s()},[i]);const s=async()=>{try{r(!0);const d=await Y.getStatistics(i);t(d)}catch(d){console.error("Failed to load statistics:",d)}finally{r(!1)}},l=d=>d>=1e6?`${(d/1e6).toFixed(1)}M`:d>=1e3?`${(d/1e3).toFixed(1)}K`:d.toString(),c=d=>{if(d>=60){const f=Math.floor(d/60),m=d%60;return`${f}h ${m}m`}return`${d}m`};if(n)return o.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"60vh"},children:o.jsx("div",{style:{fontSize:"18px",color:"var(--text-muted)"},children:"加载统计数据中..."})});if(!e)return o.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"60vh"},children:o.jsx("div",{style:{fontSize:"18px",color:"var(--text-muted)"},children:"暂无统计数据"})});const u={"image-understanding":"图像理解","high-iq":"高智商","long-context":"长上下文",thinking:"思考模式",background:"后台任务","model-mapping":"模型顶替",default:"默认请求"},p=e.timeline.map(d=>({date:d.date,codingTime:Math.round(d.totalInputTokens/250+d.totalOutputTokens/100)}));return o.jsxs("div",{children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"24px"},children:[o.jsxs("div",{children:[o.jsx("h1",{style:{margin:0,fontSize:"28px",fontWeight:"bold",color:"var(--text-primary)"},children:"📊 数据统计"}),o.jsx("p",{style:{margin:"4px 0 0 0",color:"var(--text-muted)"},children:"查看您的 AI 编程助手使用情况分析"})]}),o.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"center"},children:[o.jsx("label",{style:{color:"var(--text-primary)",fontWeight:"500"},children:"统计周期:"}),o.jsxs("select",{value:i,onChange:d=>a(Number(d.target.value)),style:{padding:"8px 16px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)",fontSize:"14px",cursor:"pointer"},children:[o.jsx("option",{value:7,children:"最近 7 天"}),o.jsx("option",{value:30,children:"最近 30 天"}),o.jsx("option",{value:90,children:"最近 90 天"})]}),o.jsx("button",{onClick:s,style:{padding:"8px 16px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-card)",color:"var(--text-primary)",fontSize:"14px",cursor:"pointer"},children:"🔄 刷新"})]})]}),o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(240px, 1fr))",gap:"16px",marginBottom:"24px"},children:[o.jsxs("div",{style:{background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",padding:"20px",borderRadius:"16px",color:"white",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)"},children:[o.jsx("div",{style:{fontSize:"14px",opacity:.9,marginBottom:"8px"},children:"总请求数"}),o.jsx("div",{style:{fontSize:"32px",fontWeight:"bold"},children:l(e.overview.totalRequests)})]}),o.jsxs("div",{style:{background:"linear-gradient(135deg, #f093fb 0%, #f5576c 100%)",padding:"20px",borderRadius:"16px",color:"white",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)"},children:[o.jsx("div",{style:{fontSize:"14px",opacity:.9,marginBottom:"8px"},children:"总 Tokens"}),o.jsx("div",{style:{fontSize:"32px",fontWeight:"bold"},children:l(e.overview.totalTokens)})]}),o.jsxs("div",{style:{background:"linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)",padding:"20px",borderRadius:"16px",color:"white",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)"},children:[o.jsx("div",{style:{fontSize:"14px",opacity:.9,marginBottom:"8px"},children:"编程时长"}),o.jsx("div",{style:{fontSize:"32px",fontWeight:"bold"},children:c(e.overview.totalCodingTime)})]}),o.jsxs("div",{style:{background:"linear-gradient(135deg, #14a042 0%, #38f9d7 100%)",padding:"20px",borderRadius:"16px",color:"white",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)"},children:[o.jsx("div",{style:{fontSize:"14px",opacity:.9,marginBottom:"8px"},children:"成功率"}),o.jsxs("div",{style:{fontSize:"32px",fontWeight:"bold"},children:[e.overview.successRate.toFixed(1),"%"]})]}),o.jsxs("div",{style:{background:"linear-gradient(135deg, #fa709a 0%, #fee140 100%)",padding:"20px",borderRadius:"16px",color:"white",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)"},children:[o.jsx("div",{style:{fontSize:"14px",opacity:.9,marginBottom:"8px"},children:"平均响应时间"}),o.jsxs("div",{style:{fontSize:"32px",fontWeight:"bold"},children:[e.overview.avgResponseTime.toFixed(2),"ms"]})]}),o.jsxs("div",{style:{background:"linear-gradient(135deg, #30cfd0 0%, #330867 100%)",padding:"20px",borderRadius:"16px",color:"white",boxShadow:"0 4px 6px rgba(0, 0, 0, 0.1)"},children:[o.jsx("div",{style:{fontSize:"14px",opacity:.9,marginBottom:"8px"},children:"配置统计"}),o.jsxs("div",{style:{fontSize:"14px",marginTop:"8px"},children:[e.overview.totalVendors," 供应商 · ",e.overview.totalServices," 服务 · ",e.overview.totalRoutes," 路由"]})]})]}),o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(500px, 1fr))",gap:"20px",marginBottom:"24px"},children:[o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"📈 请求趋势"}),o.jsx(Fs,{width:"100%",height:300,children:o.jsxs(Uce,{data:e.timeline,children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:"colorRequests",x1:"0",y1:"0",x2:"0",y2:"1",children:[o.jsx("stop",{offset:"5%",stopColor:"#8884d8",stopOpacity:.8}),o.jsx("stop",{offset:"95%",stopColor:"#8884d8",stopOpacity:0})]})}),o.jsx(Vo,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(qo,{dataKey:"date",stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>bt(d).format("MM/DD")}),o.jsx(Yo,{stroke:"var(--text-muted)",fontSize:12}),o.jsx(Do,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"},labelFormatter:d=>bt(d).format("YYYY-MM-DD")}),o.jsx(nl,{}),o.jsx(ph,{type:"monotone",dataKey:"totalRequests",name:"请求数",stroke:"#8884d8",fillOpacity:1,fill:"url(#colorRequests)"})]})})]}),o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"🔢 Token 使用趋势"}),o.jsx(Fs,{width:"100%",height:300,children:o.jsxs(Bx,{data:e.timeline,children:[o.jsx(Vo,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(qo,{dataKey:"date",stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>bt(d).format("MM/DD")}),o.jsx(Yo,{stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>d?l(Number(d)):""}),o.jsx(Do,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"},labelFormatter:d=>bt(d).format("YYYY-MM-DD"),formatter:d=>d?l(Number(d)):""}),o.jsx(nl,{}),o.jsx(ts,{type:"monotone",dataKey:"totalInputTokens",name:"输入 Tokens",stroke:"#10b981",strokeWidth:2,dot:!1}),o.jsx(ts,{type:"monotone",dataKey:"totalOutputTokens",name:"输出 Tokens",stroke:"#f59e0b",strokeWidth:2,dot:!1})]})})]}),o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"⏱️ 每日编程时长趋势"}),o.jsx(Fs,{width:"100%",height:300,children:o.jsxs(Bx,{data:p,children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:"colorCodingTime",x1:"0",y1:"0",x2:"0",y2:"1",children:[o.jsx("stop",{offset:"5%",stopColor:"#8b5cf6",stopOpacity:.8}),o.jsx("stop",{offset:"95%",stopColor:"#8b5cf6",stopOpacity:0})]})}),o.jsx(Vo,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(qo,{dataKey:"date",stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>bt(d).format("MM/DD")}),o.jsx(Yo,{stroke:"var(--text-muted)",fontSize:12,tickFormatter:d=>d!=null?d>=60?`${Math.round(Number(d)/60)}h`:`${Number(d)}m`:""}),o.jsx(Do,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"},labelFormatter:d=>bt(d).format("YYYY-MM-DD"),formatter:d=>d!=null?c(Number(d)):""}),o.jsx(nl,{}),o.jsx(ph,{type:"monotone",dataKey:"codingTime",name:"编程时长",stroke:"#8b5cf6",fillOpacity:1,fill:"url(#colorCodingTime)"}),o.jsx(ts,{type:"monotone",dataKey:"codingTime",name:"编程时长",stroke:"#8b5cf6",strokeWidth:3,dot:{fill:"#8b5cf6",r:4},activeDot:{r:6}})]})}),o.jsx("div",{style:{marginTop:"12px",padding:"12px",background:"var(--bg-secondary)",borderRadius:"8px",fontSize:"14px",color:"var(--text-muted)",textAlign:"center"},children:"💡 编程时长基于 tokens 估算(阅读速度 250 tokens/分钟,编码速度 100 tokens/分钟)"})]}),o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"🏢 供应商使用分布"}),o.jsx(Fs,{width:"100%",height:300,children:o.jsxs(kce,{data:e.byVendor,children:[o.jsx(Vo,{strokeDasharray:"3 3",stroke:"var(--border-primary)"}),o.jsx(qo,{dataKey:"vendorName",stroke:"var(--text-muted)",fontSize:12,angle:-45,textAnchor:"end",height:80}),o.jsx(Yo,{stroke:"var(--text-muted)",fontSize:12}),o.jsx(Do,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"}}),o.jsx(nl,{}),o.jsx(OD,{dataKey:"totalRequests",name:"请求数",fill:"#3b82f6"})]})})]}),o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"📋 请求类型分布"}),o.jsx(Fs,{width:"100%",height:300,children:o.jsxs(Bce,{children:[o.jsx(eD,{data:e.contentTypeDistribution,cx:"50%",cy:"50%",labelLine:!0,label:d=>`${u[d.contentType]||d.contentType} (${d.percentage}%)`,outerRadius:80,fill:"#8884d8",dataKey:"count",children:e.contentTypeDistribution.map((d,f)=>o.jsx(yd,{fill:y2[f%y2.length]},`cell-${f}`))}),o.jsx(Do,{contentStyle:{background:"var(--bg-card)",border:"1px solid var(--border-primary)",borderRadius:"8px",color:"var(--text-primary)"},formatter:(d,f,m)=>{var b,w;const g=d??0,v=((b=m.payload)==null?void 0:b.percentage)??0,x=((w=m.payload)==null?void 0:w.contentType)||"",y=u[x]||x;return`${g} (${v}%) - ${y}`}})]})})]})]}),o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(400px, 1fr))",gap:"20px"},children:[o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"🎯 按编程工具统计"}),o.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[o.jsx("thead",{children:o.jsxs("tr",{style:{borderBottom:"2px solid var(--border-primary)"},children:[o.jsx("th",{style:{padding:"12px",textAlign:"left",color:"var(--text-muted)",fontSize:"14px"},children:"类型"}),o.jsx("th",{style:{padding:"12px",textAlign:"right",color:"var(--text-muted)",fontSize:"14px"},children:"请求数"}),o.jsx("th",{style:{padding:"12px",textAlign:"right",color:"var(--text-muted)",fontSize:"14px"},children:"Tokens"})]})}),o.jsx("tbody",{children:e.byTargetType.map(d=>o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-secondary)"},children:[o.jsx("td",{style:{padding:"12px",color:"var(--text-primary)"},children:d.targetType==="claude-code"?"Claude Code":"Codex"}),o.jsx("td",{style:{padding:"12px",textAlign:"right",color:"var(--text-primary)"},children:l(d.totalRequests)}),o.jsx("td",{style:{padding:"12px",textAlign:"right",color:"var(--text-primary)"},children:l(d.totalTokens)})]},d.targetType))})]})]}),o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"🤖 按模型统计"}),o.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[o.jsx("thead",{children:o.jsxs("tr",{style:{borderBottom:"2px solid var(--border-primary)"},children:[o.jsx("th",{style:{padding:"12px",textAlign:"left",color:"var(--text-muted)",fontSize:"14px"},children:"模型"}),o.jsx("th",{style:{padding:"12px",textAlign:"right",color:"var(--text-muted)",fontSize:"14px"},children:"请求数"}),o.jsx("th",{style:{padding:"12px",textAlign:"right",color:"var(--text-muted)",fontSize:"14px"},children:"Tokens"})]})}),o.jsx("tbody",{children:e.byModel.slice(0,10).map(d=>o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-secondary)"},children:[o.jsx("td",{style:{padding:"12px",color:"var(--text-primary)",maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis"},children:d.modelName}),o.jsx("td",{style:{padding:"12px",textAlign:"right",color:"var(--text-primary)"},children:l(d.totalRequests)}),o.jsx("td",{style:{padding:"12px",textAlign:"right",color:"var(--text-primary)"},children:l(d.totalTokens)})]},d.modelName))})]})]}),o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"🔧 按服务商API服务统计"}),o.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[o.jsx("thead",{children:o.jsxs("tr",{style:{borderBottom:"2px solid var(--border-primary)"},children:[o.jsx("th",{style:{padding:"12px",textAlign:"left",color:"var(--text-muted)",fontSize:"14px"},children:"服务"}),o.jsx("th",{style:{padding:"12px",textAlign:"right",color:"var(--text-muted)",fontSize:"14px"},children:"请求数"}),o.jsx("th",{style:{padding:"12px",textAlign:"right",color:"var(--text-muted)",fontSize:"14px"},children:"Tokens"})]})}),o.jsx("tbody",{children:e.byService.slice(0,10).map(d=>o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-secondary)"},children:[o.jsxs("td",{style:{padding:"12px",color:"var(--text-primary)"},children:[o.jsx("div",{style:{fontSize:"14px",fontWeight:"bold"},children:d.serviceName}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)"},children:d.vendorName})]}),o.jsx("td",{style:{padding:"12px",textAlign:"right",color:"var(--text-primary)"},children:l(d.totalRequests)}),o.jsx("td",{style:{padding:"12px",textAlign:"right",color:"var(--text-primary)"},children:l(d.totalTokens)})]},d.serviceId))})]})]}),o.jsxs("div",{style:{background:"var(--bg-card)",padding:"20px",borderRadius:"16px",border:"1px solid var(--border-primary)"},children:[o.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",color:"var(--text-primary)"},children:"💰 Token 详细统计"}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"12px",background:"var(--bg-secondary)",borderRadius:"8px"},children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"输入 Tokens"}),o.jsx("span",{style:{color:"var(--text-primary)",fontWeight:"bold"},children:l(e.overview.totalInputTokens)})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"12px",background:"var(--bg-secondary)",borderRadius:"8px"},children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"输出 Tokens"}),o.jsx("span",{style:{color:"var(--text-primary)",fontWeight:"bold"},children:l(e.overview.totalOutputTokens)})]}),e.overview.totalCacheReadTokens>0&&o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"12px",background:"var(--bg-secondary)",borderRadius:"8px"},children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"缓存读取 Tokens"}),o.jsx("span",{style:{color:"var(--text-primary)",fontWeight:"bold"},children:l(e.overview.totalCacheReadTokens)})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"12px",background:"var(--bg-secondary)",borderRadius:"8px"},children:[o.jsx("span",{style:{color:"var(--text-muted)"},children:"总计 Tokens"}),o.jsx("span",{style:{color:"var(--text-primary)",fontWeight:"bold"},children:l(e.overview.totalTokens)})]}),o.jsxs("div",{style:{marginTop:"8px",padding:"12px",background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",borderRadius:"8px",color:"white"},children:[o.jsx("div",{style:{fontSize:"12px",opacity:.9},children:"预估节省"}),o.jsxs("div",{style:{fontSize:"20px",fontWeight:"bold",marginTop:"4px"},children:["$",(e.overview.totalTokens/1e6*15).toFixed(2)]}),o.jsx("div",{style:{fontSize:"12px",opacity:.9,marginTop:"4px"},children:"按 $15/1M tokens 估算"})]})]})]})]}),o.jsx(Gce,{})]})}function v2({isOpen:e,onClose:t,title:n,children:r,showCloseButton:i=!0,closeOnOverlayClick:a=!1,maxWidth:s="600px"}){return e?o.jsxs("div",{className:"modal-overlay",style:{zIndex:1e6},onClick:l=>{a||l.stopPropagation()},children:[i&&o.jsx("button",{type:"button",className:"modal-close-btn",onClick:t,"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:s,width:"90%"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:n})}),r]})})]}):null}function Zce(){const[e,t]=h.useState(!1),[n,r]=h.useState([]),[i,a]=h.useState(!0),[s,l]=h.useState({skillId:null,skillName:"",isDeleting:!1}),[c,u]=h.useState(!1),[p,d]=h.useState({name:"",description:"",instruction:"",link:"",targets:[]}),[f,m]=h.useState(!1),[g,v]=h.useState(!1),[x,y]=h.useState(""),[b,w]=h.useState(""),[S,k]=h.useState(!1),[j,A]=h.useState([]),[E,D]=h.useState(!1),[O,_]=h.useState({skill:null,isInstalling:!1,targetType:null,status:"idle",message:"",progress:0,selectedTargets:[]}),R=async()=>{try{a(!0);const Z=await Y.getInstalledSkills();r(Z)}catch(Z){console.error("Failed to load installed skills:",Z),K.error("加载已安装 Skills 失败")}finally{a(!1)}};h.useEffect(()=>{R()},[]);const X=async()=>{const Z=b.trim();if(!Z){K.warning("请输入需求描述后再搜索");return}try{k(!0),D(!0);const Se=(await Y.searchSkills(Z)).sort((Q,ne)=>{const pe=Q.stars??0;return(ne.stars??0)-pe});A(Se)}catch(le){console.error("Failed to search skills:",le),K.error("搜索失败,请稍后重试")}finally{k(!1)}},V=Z=>{_({skill:Z,isInstalling:!1,targetType:null,status:"idle",message:"",progress:0,selectedTargets:[]})},I=()=>{O.isInstalling||_({skill:null,isInstalling:!1,targetType:null,status:"idle",message:"",progress:0,selectedTargets:[]})},$=(Z,le)=>{_(Se=>({...Se,selectedTargets:le?[...Se.selectedTargets,Z]:Se.selectedTargets.filter(Q=>Q!==Z)}))},H=async()=>{var Z;if(O.skill)try{_(Se=>({...Se,isInstalling:!0,status:"preparing",message:"正在准备安装...",progress:0})),_(Se=>({...Se,status:"downloading",message:"正在从GitHub下载..."}));const le=await Y.installSkill(O.skill,O.selectedTargets[0]);if(le.success){const Se=O.selectedTargets,Q=(Z=le.installedSkill)==null?void 0:Z.id;if(!Q){_(pe=>({...pe,status:"error",message:"安装返回数据异常"})),K.error("安装返回数据异常");return}let ne=0;for(const pe of Se)(await Y.enableSkill(Q,pe)).success&&ne++;_(pe=>({...pe,status:"completed",message:Se.length>0?`安装完成!已启用 ${ne}/${Se.length} 个目标`:"安装完成!可在列表中启用目标",progress:100})),Se.length>0?K.success(`已安装到 ${Se.map(pe=>pe==="claude-code"?"Claude Code":"Codex").join(", ")}`):K.success("安装完成!可在列表中启用目标"),await R()}else _(Se=>({...Se,status:"error",message:le.message?`${le.message}。如多次失败,可尝试在设置中配置代理`:"安装失败,请稍后重试"})),K.error(le.message?`${le.message}。如多次失败,可尝试在设置中配置代理`:"安装失败,请稍后重试")}catch(le){console.error("Failed to install skill:",le),_(Se=>({...Se,status:"error",message:"安装失败,请稍后重试。如多次失败,可尝试在设置中配置代理"})),K.error("安装失败,请稍后重试。如多次失败,可尝试在设置中配置代理")}finally{setTimeout(()=>{_(le=>({...le,skill:null,isInstalling:!1,targetType:null,status:"idle",message:"",progress:0,selectedTargets:[]}))},2e3)}},N=async(Z,le,Se)=>{try{Se?(await Y.enableSkill(Z,le),K.success(`已启用 ${le==="claude-code"?"Claude Code":"Codex"}`)):(await Y.disableSkill(Z,le),K.success(`已禁用 ${le==="claude-code"?"Claude Code":"Codex"}`)),await R()}catch(Q){console.error("Failed to toggle skill:",Q),K.error("操作失败,请稍后重试")}},U=Z=>{l({skillId:Z.id,skillName:Z.name,isDeleting:!1})},P=()=>{s.isDeleting||l({skillId:null,skillName:"",isDeleting:!1})},W=async()=>{if(s.skillId)try{l(Z=>({...Z,isDeleting:!0})),await Y.deleteSkill(s.skillId),K.success("已删除 Skill"),await R(),P()}catch(Z){console.error("Failed to delete skill:",Z),K.error("删除失败,请稍后重试"),l(le=>({...le,isDeleting:!1}))}},se=()=>{try{const Z=x.trim();if(!Z){K.error("请粘贴 SKILL.md 内容");return}let le="",Se="",Q=Z;if(Z.startsWith("---")){const ne=Z.indexOf("---",3);if(ne!==-1){const pe=Z.slice(3,ne),ie=Z.match(/^#\s+(.+)$/m);le=ie?ie[1].trim():"";const _e=pe.split(`
|
|
486
|
+
`);for(const ke of _e)ke.startsWith("name:")?le=ke.replace("name:","").trim():ke.startsWith("description:")&&(Se=ke.replace("description:","").trim());Q=Z.slice(ne+3).trim(),Q=Q.replace(/^##\s+指令\n*/,"").trim()}}else{const ne=Z.match(/^#\s+(.+)$/m);ne&&(le=ne[1].trim())}if(!le){K.error("无法解析 Skill 名称");return}d(ne=>({...ne,name:le,description:Se||ne.description,instruction:Q||ne.instruction})),v(!1),y(""),K.success("解析成功")}catch(Z){console.error("Failed to parse skill:",Z),K.error("解析失败,请检查格式")}},T=async Z=>{var le;if(Z.preventDefault(),!p.name.trim()){K.error("请填写 Skill 名称");return}if(!p.description.trim()){K.error("请填写描述");return}if(!p.instruction.trim()){K.error("请填写指令");return}try{m(!0);const Se=await Y.createLocalSkill({name:p.name.trim(),description:p.description.trim(),instruction:p.instruction.trim(),link:p.link.trim()||void 0,targets:p.targets});if(Se.success){K.success("Skill 创建成功"),u(!1),d({name:"",description:"",instruction:"",link:"",targets:[]}),await R();for(const Q of p.targets)(le=Se.installedSkill)!=null&&le.id&&await Y.enableSkill(Se.installedSkill.id,Q)}else K.error(Se.message||"创建失败")}catch(Se){console.error("Failed to create skill:",Se),K.error("创建失败,请稍后重试")}finally{m(!1)}},he=()=>i?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"正在加载已安装 Skills..."})}):n.length===0?o.jsxs("div",{className:"empty-state",children:[o.jsx("p",{children:"当前没有检测到全局 Skills"}),o.jsx("span",{children:"你可以在“发现”中搜索并安装新的 Skills。"})]}):o.jsx("div",{className:"skills-grid",children:n.map(Z=>o.jsxs("div",{className:"card skill-card",style:{display:"flex",flexDirection:"column"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"12px"},children:[o.jsx("div",{className:"skill-title",style:{flex:1},children:Z.name}),o.jsxs("div",{style:{display:"flex",gap:"8px",flexShrink:0},children:[Z.githubUrl&&o.jsx("a",{href:Z.githubUrl,target:"_blank",rel:"noopener noreferrer",className:"btn btn-secondary",style:{padding:"6px 12px",fontSize:"12px",textDecoration:"none",display:"inline-flex",alignItems:"center"},children:"查看详情"}),o.jsx("button",{className:"btn btn-danger",onClick:()=>U(Z),style:{padding:"6px 12px",fontSize:"12px"},children:"删除"})]})]}),o.jsxs("div",{style:{flex:1},children:[o.jsx("div",{className:"skill-description",children:Z.description||"暂无描述"}),o.jsxs("div",{style:{marginTop:"8px",fontSize:"12px",color:"var(--text-muted)"},children:["安装时间: ",new Date(Z.installedAt).toLocaleDateString("zh-CN")]})]}),o.jsxs("div",{style:{marginTop:"auto",paddingTop:"16px",borderTop:"1px solid var(--border-color)",display:"flex",gap:"24px"},children:[o.jsx(tk,{skillId:Z.id,targetType:"claude-code",enabled:Z.enabledTargets.includes("claude-code"),onChange:N}),o.jsx(tk,{skillId:Z.id,targetType:"codex",enabled:Z.enabledTargets.includes("codex"),onChange:N})]})]},Z.id))}),ye=()=>o.jsxs("div",{className:"skills-discover",children:[o.jsxs("div",{className:"card skills-search-card",children:[o.jsxs("div",{className:"skills-search-header",children:[o.jsx("h3",{children:"描述你的需求,我会帮你找到你需要的 Skills"}),o.jsx("p",{children:"例如:帮我写 TypeScript 类型定义、自动生成测试用例、优化 React 性能"})]}),o.jsx("textarea",{rows:4,value:b,onChange:Z=>w(Z.target.value),placeholder:"请输入你的需求...",className:"skills-search-input"}),o.jsx("div",{className:"skills-search-actions",children:o.jsx("button",{className:"btn btn-primary",onClick:X,disabled:S,children:S?"搜索中...":"搜索"})})]}),o.jsxs("div",{className:"skills-results",children:[S&&o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"正在进行 AI 搜索..."})}),!S&&E&&j.length===0&&o.jsxs("div",{className:"empty-state",children:[o.jsx("p",{children:"没有找到匹配的 Skills"}),o.jsx("span",{children:"试试换个描述或添加更多细节。"})]}),!S&&j.length>0&&o.jsx("div",{className:"skills-grid",children:j.map(Z=>o.jsxs("div",{className:"card skill-card",children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"12px"},children:[o.jsx("div",{className:"skill-title",style:{flex:1},children:Z.name}),Z.stars!==void 0&&Z.stars>0&&o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",color:"#f39c12",fontSize:"14px",flexShrink:0},children:[o.jsx("span",{children:"⭐"}),o.jsx("span",{style:{fontWeight:"600"},children:Z.stars})]})]}),Z.tags&&Z.tags.length>0&&o.jsx("div",{className:"skill-tags",children:Z.tags.map(le=>o.jsx("span",{className:"badge badge-secondary",children:le},le))}),o.jsx("div",{className:"skill-description",children:Z.description||"暂无描述"}),o.jsxs("div",{className:"skills-result-actions",children:[Z.url?o.jsx("a",{className:"btn btn-secondary",href:Z.url,target:"_blank",rel:"noopener noreferrer",style:{marginLeft:"8px"},children:"查看"}):null,o.jsx("button",{className:"btn btn-secondary",onClick:()=>V(Z),children:"安装"})]})]},Z.id))})]})]});return o.jsxs("div",{children:[o.jsxs("div",{className:"skills-header-row",children:[o.jsxs("div",{className:"page-header",children:[o.jsx("h1",{children:"Skills 管理"}),o.jsx("p",{children:"管理 Claude Code 与 Codex 的全局技能,并发现新的生产力增强 Skills。"})]}),o.jsxs("div",{className:"skills-header-actions",children:[!e&&o.jsx("button",{className:"btn btn-secondary skills-discover-btn",onClick:()=>u(!0),style:{marginRight:"8px"},children:"新增"}),o.jsx("button",{className:"btn btn-secondary skills-discover-btn",onClick:()=>t(Z=>!Z),children:e?"返回":"发现"})]})]}),e?ye():he(),O.skill&&o.jsxs("div",{className:"modal-overlay",style:{zIndex:1e6},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:I,disabled:O.isInstalling,"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"520px"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:O.status==="idle"?"选择安装目标":O.status==="completed"?"安装完成":O.status==="error"?"安装失败":"正在安装"})}),o.jsx("div",{className:"modal-body",style:{padding:"0 20px 10px"},children:O.status==="idle"?o.jsxs(o.Fragment,{children:[o.jsxs("p",{style:{marginBottom:"12px",color:"var(--text-muted)"},children:["即将安装:",o.jsx("strong",{children:O.skill.name})]}),O.skill.description&&o.jsx("p",{style:{marginBottom:"12px",color:"var(--text-muted)",fontSize:"14px"},children:O.skill.description}),o.jsxs("div",{style:{marginTop:"20px"},children:[o.jsx("p",{style:{fontSize:"14px",color:"var(--text-muted)",marginBottom:"12px"},children:"选择安装目标(可多选):"}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:O.selectedTargets.includes("claude-code"),onChange:Z=>$("claude-code",Z.target.checked),style:{width:"18px",height:"18px",cursor:"pointer"}}),o.jsx("span",{style:{fontSize:"14px"},children:"Claude Code"})]}),o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:O.selectedTargets.includes("codex"),onChange:Z=>$("codex",Z.target.checked),style:{width:"18px",height:"18px",cursor:"pointer"}}),o.jsx("span",{style:{fontSize:"14px"},children:"Codex"})]})]})]})]}):o.jsxs("div",{style:{padding:"20px 0"},children:[o.jsx("div",{style:{height:"8px",backgroundColor:"var(--bg-secondary)",borderRadius:"4px",overflow:"hidden",marginBottom:"16px"},children:o.jsx("div",{style:{width:`${O.progress}%`,height:"100%",backgroundColor:O.status==="error"?"var(--error-color)":"var(--primary-color)",transition:"width 0.3s ease"}})}),o.jsx("p",{style:{textAlign:"center",color:"var(--text-muted)",marginBottom:"8px"},children:O.message}),O.status==="error"&&o.jsx("p",{style:{textAlign:"center",color:"var(--error)",fontSize:"14px"},children:O.message})]})}),o.jsx("div",{className:"modal-footer",style:{justifyContent:O.status!=="idle"?"center":"space-between"},children:O.status==="idle"?o.jsxs(o.Fragment,{children:[o.jsx("button",{className:"btn btn-secondary",onClick:I,disabled:O.isInstalling,children:"取消"}),o.jsx("button",{className:"btn btn-primary",onClick:H,disabled:O.isInstalling,children:"确定安装"})]}):O.status==="completed"||O.status==="error"?o.jsx("button",{className:"btn btn-primary",onClick:I,children:"关闭"}):o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("div",{className:"spinner",style:{width:"16px",height:"16px",border:"2px solid var(--bg-secondary)",borderTopColor:"var(--primary-color)",borderRadius:"50%"}}),o.jsx("span",{style:{color:"var(--text-muted)"},children:"正在处理..."})]})})]})})]}),s.skillId&&o.jsxs("div",{className:"modal-overlay",style:{zIndex:1000001},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:P,disabled:s.isDeleting,"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"400px"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"确认删除"})}),o.jsxs("div",{className:"modal-body",style:{padding:"0 20px 10px"},children:[o.jsxs("p",{style:{color:"var(--text-muted)"},children:["确定要删除 Skill ",o.jsx("strong",{children:s.skillName})," 吗?"]}),o.jsx("p",{style:{color:"var(--text-muted)",fontSize:"14px",marginTop:"8px"},children:"这将删除该Skill及其所有平台的软链接,且无法恢复。"})]}),o.jsxs("div",{className:"modal-footer",style:{justifyContent:"space-between"},children:[o.jsx("button",{className:"btn btn-secondary",onClick:P,disabled:s.isDeleting,children:"取消"}),o.jsx("button",{className:"btn btn-danger",onClick:W,disabled:s.isDeleting,children:s.isDeleting?"删除中...":"确认删除"})]})]})})]}),c&&o.jsx(v2,{isOpen:c,onClose:()=>u(!1),title:"新增 Skill",closeOnOverlayClick:!1,children:o.jsxs("form",{onSubmit:T,children:[o.jsxs("div",{style:{padding:"20px"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[o.jsx("small",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"从其他来源复制的 SKILL.md 内容可直接粘贴解析"}),o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>v(!0),style:{padding:"6px 16px",fontSize:"13px"},children:"解析"})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["名称 ",o.jsx("span",{style:{color:"#e74c3c"},children:"*"})]}),o.jsx("input",{type:"text",value:p.name,onChange:Z=>d(le=>({...le,name:Z.target.value})),placeholder:"输入 Skill 名称",required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["描述 ",o.jsx("span",{style:{color:"#e74c3c"},children:"*"})]}),o.jsx("input",{type:"text",value:p.description,onChange:Z=>d(le=>({...le,description:Z.target.value})),placeholder:"简要描述这个 Skill 的功能",required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["指令 ",o.jsx("span",{style:{color:"#e74c3c"},children:"*"})]}),o.jsx("small",{style:{display:"block",marginBottom:"8px",color:"#666",fontSize:"12px",lineHeight:"1.5"},children:"当这个 Skill 被触发时,你希望模型遵循哪些规则或信息"}),o.jsx("textarea",{value:p.instruction,onChange:Z=>d(le=>({...le,instruction:Z.target.value})),placeholder:`当这个 Skill 被触发时,你希望模型遵循哪些规则或信息,例如:
|
|
487
|
+
# codemap
|
|
488
|
+
## 命令
|
|
489
|
+
## 使用场景
|
|
490
|
+
## 输出解释
|
|
491
|
+
## 示例`,rows:10,style:{fontFamily:"monospace",fontSize:"13px"},required:!0})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"链接(可选)"}),o.jsx("input",{type:"url",value:p.link,onChange:Z=>d(le=>({...le,link:Z.target.value})),placeholder:"https://example.com 或 GitHub 仓库地址"}),o.jsx("small",{style:{display:"block",marginTop:"4px",color:"#666",fontSize:"12px"},children:"Skill 相关文档或资源链接"})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{children:["安装目标 ",o.jsx("span",{style:{color:"#e74c3c"},children:"*"})]}),o.jsxs("div",{style:{display:"flex",gap:"20px",marginTop:"8px"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer",whiteSpace:"nowrap"},children:[o.jsx("input",{type:"checkbox",checked:p.targets.includes("claude-code"),onChange:Z=>{Z.target.checked?d(le=>({...le,targets:[...le.targets,"claude-code"]})):d(le=>({...le,targets:le.targets.filter(Se=>Se!=="claude-code")}))}}),"Claude Code"]}),o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:p.targets.includes("codex"),onChange:Z=>{Z.target.checked?d(le=>({...le,targets:[...le.targets,"codex"]})):d(le=>({...le,targets:le.targets.filter(Se=>Se!=="codex")}))}}),"Codex"]})]})]}),o.jsx("div",{style:{marginTop:"16px",padding:"12px",background:"var(--bg-tertiary)",borderRadius:"8px"},children:o.jsxs("small",{style:{color:"var(--text-muted)",fontSize:"12px",lineHeight:"1.6"},children:["💡 提示:Skill 创建后,可通过 ",o.jsxs("code",{style:{background:"var(--bg-secondary)",padding:"2px 6px",borderRadius:"4px"},children:["~/.aicodeswitch/skills/",p.name||"skill-name"]})," 路径对 Skill 内容进行二次编辑"]})})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>u(!1),disabled:f,children:"取消"}),o.jsx("button",{type:"submit",className:"btn btn-primary",disabled:f,children:f?"创建中...":"确认创建"})]})]})}),g&&o.jsxs(v2,{isOpen:g,onClose:()=>{v(!1),y("")},title:"解析 SKILL.md",closeOnOverlayClick:!1,children:[o.jsxs("div",{style:{padding:"20px"},children:[o.jsx("p",{style:{color:"var(--text-muted)",fontSize:"14px",marginBottom:"12px"},children:"直接粘贴从其他地方复制的 SKILL.md 内容,系统将自动解析填充到表单中。"}),o.jsx("textarea",{value:x,onChange:Z=>y(Z.target.value),placeholder:`---
|
|
492
|
+
name: skill-name
|
|
493
|
+
description: Skill 描述
|
|
494
|
+
---
|
|
495
|
+
|
|
496
|
+
# Skill 名称
|
|
497
|
+
|
|
498
|
+
Skill 描述
|
|
499
|
+
|
|
500
|
+
## 指令
|
|
501
|
+
|
|
502
|
+
技能指令内容...`,rows:15,style:{width:"100%",fontFamily:"monospace",fontSize:"13px",padding:"12px",border:"1px solid var(--border-color)",borderRadius:"8px",background:"var(--bg-primary)",color:"var(--text-primary)",resize:"vertical"}})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>{v(!1),y("")},children:"取消"}),o.jsx("button",{type:"button",className:"btn btn-primary",onClick:se,children:"解析并填充"})]})]})]})}const Jce=[{id:"glm-vision",name:"GLM 视觉理解",description:"提供图像理解能力,支持多种视觉场景分析",type:"stdio",command:"npx",args:["-y","@z_ai/mcp-server"],env:{Z_AI_MODE:"ZHIPU"},apiKeyIn:"headers"},{id:"glm-web-search",name:"GLM 联网搜索",description:"提供网络搜索能力,实时获取最新信息",type:"http",url:"https://open.bigmodel.cn/api/mcp/web_search_prime/mcp",apiKeyIn:"headers"},{id:"glm-web-reader",name:"GLM 网页读取",description:"提供网页内容读取和解析能力",type:"http",url:"https://open.bigmodel.cn/api/mcp/web_reader/mcp",apiKeyIn:"headers"},{id:"glm-zread",name:"GLM 开源仓库",description:"提供开源仓库代码搜索和阅读能力",type:"http",url:"https://open.bigmodel.cn/api/mcp/zread/mcp",apiKeyIn:"headers"},{id:"minimax-coding-plan",name:"MiniMax Coding Plan",description:"提供网络搜索和图片理解能力",type:"stdio",command:"uvx",args:["-y","minimax-coding-plan-mcp"],env:{MINIMAX_API_HOST:"https://api.minimaxi.com"},apiKeyIn:"env",apiKeyEnvName:"MINIMAX_API_KEY"}];function eue(){var X,V;const[e,t]=h.useState([]),[n,r]=h.useState(!0),[i,a]=h.useState(!1),[s,l]=h.useState(null),[c,u]=h.useState({name:"",description:"",type:"stdio",command:"",args:"",url:"",headers:"",env:"",targets:[]}),[p,d]=h.useState(!1),[f,m]=h.useState({mcpId:null,mcpName:"",isDeleting:!1}),[g,v]=h.useState({isOpen:!1,step:"select",message:"",installingMCPName:null,apiKey:"",selectedDefinition:null}),x=async()=>{try{r(!0);const I=await Y.getMCPs();t(I)}catch(I){console.error("Failed to load MCPs:",I),K.error("加载 MCP 工具失败")}finally{r(!1)}};h.useEffect(()=>{x()},[]);const y=()=>{l(null),u({name:"",description:"",type:"stdio",command:"",args:"",url:"",headers:"",env:"",targets:[]}),a(!0)},b=I=>{l(I),u({name:I.name,description:I.description||"",type:I.type,command:I.command||"",args:I.args?I.args.join(" "):"",url:I.url||"",headers:I.headers?JSON.stringify(I.headers,null,2):"",env:I.env?JSON.stringify(I.env,null,2):"",targets:I.targets||[]}),a(!0)},w=()=>{p||(a(!1),l(null))},S=async I=>{var $,H;if(I.preventDefault(),!c.name.trim()){K.error("请填写 MCP 名称");return}if(c.type==="stdio"&&!c.command){K.error("请填写命令");return}if((c.type==="http"||c.type==="sse")&&!c.url){K.error("请填写 URL");return}try{d(!0);const N={},U={};if(c.env)try{Object.assign(N,JSON.parse(c.env))}catch{K.error("环境变量格式错误,请使用有效的 JSON 格式");return}if(c.headers)try{Object.assign(U,JSON.parse(c.headers))}catch{K.error("请求头格式错误,请使用有效的 JSON 格式");return}const P={name:c.name.trim(),description:c.description.trim(),type:c.type,command:($=c.command)==null?void 0:$.trim(),args:c.args?c.args.trim().split(/\s+/):void 0,url:(H=c.url)==null?void 0:H.trim(),headers:Object.keys(U).length>0?U:void 0,env:Object.keys(N).length>0?N:void 0,targets:c.targets};s?(await Y.updateMCP(s.id,P),K.success("MCP 工具已更新")):(await Y.createMCP(P),K.success("MCP 工具已添加")),a(!1),l(null),await x()}catch(N){console.error("Failed to save MCP:",N),K.error("保存失败,请稍后重试")}finally{d(!1)}},k=I=>{m({mcpId:I.id,mcpName:I.name,isDeleting:!1})},j=()=>{f.isDeleting||m({mcpId:null,mcpName:"",isDeleting:!1})},A=async()=>{if(f.mcpId)try{m(I=>({...I,isDeleting:!0})),await Y.deleteMCP(f.mcpId),K.success("已删除 MCP 工具"),await x(),j()}catch(I){console.error("Failed to delete MCP:",I),K.error("删除失败,请稍后重试"),m($=>({...$,isDeleting:!1}))}},E=()=>{v({isOpen:!0,step:"select",message:"",installingMCPName:null,apiKey:"",selectedDefinition:null})},D=()=>{g.installingMCPName||v({isOpen:!1,step:"select",message:"",installingMCPName:null,apiKey:"",selectedDefinition:null})},O=I=>{v($=>({...$,step:"input-api-key",selectedDefinition:I}))},_=async()=>{var I;if(!g.apiKey.trim()){K.error("请填写 API Key");return}if(g.selectedDefinition)try{const $=g.selectedDefinition;v(he=>({...he,step:"installing",message:"正在安装...",installingMCPName:$.name}));const H=$.apiKeyEnvName||"Z_AI_API_KEY",N=$.apiKeyIn==="env",U=[];$.env&&Object.entries($.env).forEach(([he,ye])=>{ye!==void 0&&U.push([he,ye])}),N&&U.push([H,g.apiKey.trim()]);const P=U.length>0?Object.fromEntries(U):void 0,se=$.apiKeyIn==="headers"?{Authorization:`Bearer ${g.apiKey.trim()}`}:void 0,T={name:$.name,description:$.description,type:$.type,command:$.command,args:$.args,url:$.url,env:P,headers:se,targets:["claude-code","codex"]};await Y.createMCP(T),v(he=>({...he,step:"completed",message:`成功安装 ${$.name}`,installingMCPName:null})),K.success(`已安装 ${$.name}`),await x()}catch($){console.error(`Failed to install ${(I=g.selectedDefinition)==null?void 0:I.id}:`,$),v(H=>({...H,step:"error",message:"安装失败,请稍后重试",installingMCPName:null})),K.error("安装失败,请稍后重试")}},R=I=>{switch(I){case"stdio":return"命令行";case"http":return"HTTP";case"sse":return"SSE";default:return I}};return o.jsxs("div",{children:[o.jsxs("div",{className:"page-header",style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[o.jsxs("div",{children:[o.jsx("h1",{children:"MCP 管理"}),o.jsx("p",{children:"管理 Model Context Protocol (MCP) 工具,扩展 Claude Code 和 Codex 的能力"})]}),o.jsxs("div",{style:{display:"flex",gap:"12px"},children:[o.jsxs("button",{className:"btn btn-secondary",onClick:E,style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("span",{children:"⚡"}),o.jsx("span",{children:"一键安装 MCP"})]}),o.jsx("button",{className:"btn btn-primary",onClick:y,children:"添加 MCP 工具"})]})]}),n?o.jsx("div",{className:"empty-state",children:o.jsx("p",{children:"正在加载 MCP 工具..."})}):e.length===0?o.jsxs("div",{className:"empty-state",children:[o.jsx("p",{children:"当前没有安装 MCP 工具"}),o.jsx("span",{children:'你可以点击"添加 MCP 工具"或"一键安装 MCP"来添加工具。'})]}):o.jsx("div",{className:"mcp-grid",style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(400px, 1fr))",gap:"16px",marginTop:"24px"},children:e.map(I=>{var $,H,N;return o.jsxs("div",{className:"card mcp-card",style:{display:"flex",flexDirection:"column"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"12px"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flex:1,minWidth:0},children:[o.jsx("div",{className:"mcp-title",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:I.name}),o.jsx("div",{className:"badge badge-secondary",children:R(I.type)})]}),o.jsxs("div",{style:{display:"flex",gap:"6px",flexShrink:0},children:[o.jsx("button",{className:"btn btn-secondary",onClick:()=>b(I),style:{padding:"6px 14px",fontSize:"13px"},children:"编辑"}),o.jsx("button",{className:"btn btn-danger",onClick:()=>k(I),style:{padding:"6px 14px",fontSize:"13px"},children:"删除"})]})]}),I.description&&o.jsx("div",{className:"mcp-description",style:{marginTop:"12px",color:"var(--text-muted)",fontSize:"14px"},children:I.description}),o.jsxs("div",{style:{marginTop:"12px",fontSize:"12px",color:"var(--text-muted)"},children:["安装时间: ",new Date(I.createdAt).toLocaleDateString("zh-CN")]}),I.type==="stdio"&&I.command&&o.jsxs("div",{style:{marginTop:"8px",fontSize:"12px",fontFamily:"monospace",color:"var(--text-muted)"},children:["命令: ",I.command," ",($=I.args)==null?void 0:$.join(" ")]}),(I.type==="http"||I.type==="sse")&&I.url&&o.jsxs("div",{style:{marginTop:"8px",fontSize:"12px",color:"var(--text-muted)"},children:["URL: ",I.url]}),o.jsx("div",{style:{marginTop:"auto",paddingTop:"16px",borderTop:"1px solid var(--border-color)",display:"flex",alignItems:"center"},children:o.jsxs("div",{style:{display:"flex",gap:"24px"},children:[o.jsx(Pl,{checked:((H=I.targets)==null?void 0:H.includes("claude-code"))??!1,onChange:async U=>{const P=I.targets||[],W=U?[...P,"claude-code"]:P.filter(se=>se!=="claude-code");await Y.updateMCP(I.id,{targets:W}),await x()},label:"Claude Code",labelPosition:"right"}),o.jsx(Pl,{checked:((N=I.targets)==null?void 0:N.includes("codex"))??!1,onChange:async U=>{const P=I.targets||[],W=U?[...P,"codex"]:P.filter(se=>se!=="codex");await Y.updateMCP(I.id,{targets:W}),await x()},label:"Codex",labelPosition:"right"})]})})]},I.id)})}),i&&o.jsxs("div",{className:"modal-overlay",style:{zIndex:1e6},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:w,disabled:p,"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"600px",maxHeight:"80vh",overflow:"auto"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:s?"编辑 MCP 工具":"添加 MCP 工具"})}),o.jsxs("form",{onSubmit:S,children:[o.jsxs("div",{className:"modal-body",style:{padding:"0 20px 10px"},children:[o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{htmlFor:"mcp-name",children:["MCP 名称 ",o.jsx("span",{className:"required",children:"*"})]}),o.jsx("input",{id:"mcp-name",type:"text",value:c.name,onChange:I=>u({...c,name:I.target.value}),placeholder:"例如:GLM 视觉理解",disabled:p})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{htmlFor:"mcp-description",children:"描述"}),o.jsx("textarea",{id:"mcp-description",rows:2,value:c.description,onChange:I=>u({...c,description:I.target.value}),placeholder:"描述该 MCP 工具的功能",disabled:p})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{htmlFor:"mcp-type",children:["类型 ",o.jsx("span",{className:"required",children:"*"})]}),o.jsxs("select",{id:"mcp-type",value:c.type,onChange:I=>u({...c,type:I.target.value}),disabled:p,children:[o.jsx("option",{value:"stdio",children:"命令行 (stdio)"}),o.jsx("option",{value:"http",children:"HTTP"}),o.jsx("option",{value:"sse",children:"SSE"})]})]}),c.type==="stdio"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{htmlFor:"mcp-command",children:["命令 ",o.jsx("span",{className:"required",children:"*"})]}),o.jsx("input",{id:"mcp-command",type:"text",value:c.command,onChange:I=>u({...c,command:I.target.value}),placeholder:"例如:npx",disabled:p})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{htmlFor:"mcp-args",children:"参数(空格分隔)"}),o.jsx("input",{id:"mcp-args",type:"text",value:c.args,onChange:I=>u({...c,args:I.target.value}),placeholder:"例如:-y @z_ai/mcp-server",disabled:p})]})]}),(c.type==="http"||c.type==="sse")&&o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{htmlFor:"mcp-url",children:["URL ",o.jsx("span",{className:"required",children:"*"})]}),o.jsx("input",{id:"mcp-url",type:"url",value:c.url,onChange:I=>u({...c,url:I.target.value}),placeholder:"例如:https://api.example.com/mcp",disabled:p})]}),(c.type==="http"||c.type==="sse")&&o.jsxs("div",{className:"form-group",children:[o.jsx("label",{htmlFor:"mcp-headers",children:"请求头 (JSON)"}),o.jsx("textarea",{id:"mcp-headers",rows:3,value:c.headers,onChange:I=>u({...c,headers:I.target.value}),placeholder:'{\\n "Authorization": "Bearer your-token"\\n}',disabled:p,style:{fontFamily:"monospace",fontSize:"13px"}})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{htmlFor:"mcp-env",children:"环境变量 (JSON)"}),o.jsx("textarea",{id:"mcp-env",rows:3,value:c.env,onChange:I=>u({...c,env:I.target.value}),placeholder:'{\\n "API_KEY": "your-key"\\n}',disabled:p,style:{fontFamily:"monospace",fontSize:"13px"}})]}),o.jsxs("div",{className:"form-group",children:[o.jsx("label",{children:"启用目标"}),o.jsxs("div",{style:{display:"flex",gap:"16px"},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:c.targets.includes("claude-code"),onChange:I=>u({...c,targets:I.target.checked?[...c.targets,"claude-code"]:c.targets.filter($=>$!=="claude-code")}),style:{width:"16px",height:"16px",cursor:"pointer"},disabled:p}),o.jsx("span",{children:"Claude Code"})]}),o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:c.targets.includes("codex"),onChange:I=>u({...c,targets:I.target.checked?[...c.targets,"codex"]:c.targets.filter($=>$!=="codex")}),style:{width:"16px",height:"16px",cursor:"pointer"},disabled:p}),o.jsx("span",{children:"Codex"})]})]})]})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-secondary",type:"button",onClick:w,disabled:p,children:"取消"}),o.jsx("button",{className:"btn btn-primary",type:"submit",disabled:p,children:p?"保存中...":s?"保存":"添加"})]})]})]})})]}),f.mcpId&&o.jsxs("div",{className:"modal-overlay",style:{zIndex:1000001},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:j,disabled:f.isDeleting,"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"400px"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"确认删除"})}),o.jsx("div",{className:"modal-body",style:{padding:"0 20px 10px"},children:o.jsxs("p",{style:{color:"var(--text-muted)"},children:['确定要删除 MCP 工具 "',o.jsx("strong",{children:f.mcpName}),'" 吗?此操作无法撤销。']})}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-secondary",onClick:j,disabled:f.isDeleting,children:"取消"}),o.jsx("button",{className:"btn btn-danger",onClick:A,disabled:f.isDeleting,children:f.isDeleting?"删除中...":"删除"})]})]})})]}),g.isOpen&&o.jsxs("div",{className:"modal-overlay",style:{zIndex:1000002},children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:D,disabled:g.installingMCPName!==null,"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"700px"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"一键安装 MCP 工具"})}),o.jsxs("div",{className:"modal-body",style:{padding:"0 20px 10px"},children:[g.step==="select"&&o.jsxs(o.Fragment,{children:[o.jsx("p",{style:{fontSize:"14px",color:"var(--text-muted)",marginBottom:"20px"},children:"点击下方的卡片,快速安装 MCP 工具到您的系统中:"}),o.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(280px, 1fr))",gap:"16px"},children:Jce.map(I=>{const $=e.some(H=>H.name===I.name);return o.jsxs("div",{className:"card",style:{padding:"16px",cursor:$?"not-allowed":"pointer",transition:"all 0.2s ease",opacity:$?.7:1},onClick:()=>!$&&O(I),children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"8px"},children:[o.jsx("div",{style:{fontWeight:"600",fontSize:"16px"},children:I.name}),o.jsxs("div",{style:{display:"flex",gap:"8px"},children:[$&&o.jsx("div",{className:"badge badge-success",style:{fontSize:"12px"},children:"已安装"}),o.jsx("div",{className:"badge badge-secondary",style:{fontSize:"12px"},children:R(I.type)})]})]}),o.jsx("div",{style:{fontSize:"13px",color:"var(--text-muted)",marginBottom:"12px"},children:I.description}),o.jsx("button",{className:"btn btn-primary",style:{width:"100%"},disabled:$,children:$?"已安装":"安装"})]},I.id)})})]}),g.step==="input-api-key"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{style:{textAlign:"center",marginBottom:"16px"},children:[o.jsx("h3",{style:{fontSize:"18px",marginBottom:"8px"},children:(X=g.selectedDefinition)==null?void 0:X.name}),o.jsx("p",{style:{fontSize:"14px",color:"var(--text-muted)"},children:(V=g.selectedDefinition)==null?void 0:V.description})]}),o.jsxs("div",{className:"form-group",children:[o.jsxs("label",{htmlFor:"quick-install-api-key",children:["API Key ",o.jsx("span",{className:"required",children:"*"})]}),o.jsx("input",{id:"quick-install-api-key",type:"password",value:g.apiKey,onChange:I=>v({...g,apiKey:I.target.value}),placeholder:"请输入您的 API Key",disabled:g.installingMCPName!==null,autoFocus:!0}),o.jsx("p",{style:{fontSize:"12px",color:"var(--text-muted)",marginTop:"4px"},children:"API Key 将用于此 MCP 工具的认证。您可以访问相应的开放平台获取。"})]}),o.jsxs("div",{className:"modal-footer",children:[o.jsx("button",{className:"btn btn-secondary",onClick:()=>v(I=>({...I,step:"select",selectedDefinition:null})),disabled:g.installingMCPName!==null,children:"返回"}),o.jsx("button",{className:"btn btn-primary",onClick:_,disabled:g.installingMCPName!==null||!g.apiKey.trim(),children:g.installingMCPName?"安装中...":"开始安装"})]})]}),g.step==="installing"&&o.jsxs("div",{style:{padding:"20px 0",textAlign:"center"},children:[o.jsx("div",{className:"spinner",style:{width:"32px",height:"32px",margin:"0 auto 16px"}}),o.jsx("p",{style:{color:"var(--text-muted)"},children:g.message}),o.jsxs("p",{style:{fontSize:"14px",marginTop:"8px",color:"var(--text-muted)"},children:["正在安装 ",o.jsx("strong",{children:g.installingMCPName}),"..."]})]}),g.step==="completed"&&o.jsxs("div",{style:{padding:"20px 0",textAlign:"center"},children:[o.jsx("div",{style:{fontSize:"48px",marginBottom:"16px"},children:"✅"}),o.jsx("p",{style:{fontSize:"16px",marginBottom:"8px"},children:g.message}),o.jsx("p",{style:{fontSize:"14px",color:"var(--text-muted)"},children:"MCP 工具已启用到 Claude Code 和 Codex,您可以在列表中查看详情。"})]}),g.step==="error"&&o.jsxs("div",{style:{padding:"20px 0",textAlign:"center"},children:[o.jsx("div",{style:{fontSize:"48px",marginBottom:"16px"},children:"❌"}),o.jsx("p",{style:{fontSize:"16px",marginBottom:"8px"},children:g.message})]})]}),o.jsx("div",{className:"modal-footer",style:{justifyContent:(g.step==="select"||g.step==="input-api-key","center")},children:(g.step==="completed"||g.step==="error")&&o.jsx("button",{className:"btn btn-primary",onClick:D,children:"关闭"})})]})})]})]})}function ZD({keyName:e,apiKey:t,guide:n,onClose:r}){const i=a=>{navigator.clipboard.writeText(a).then(()=>K.success("已复制"))};return o.jsxs("div",{className:"modal-overlay",onClick:r,children:[o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"700px",padding:"28px"},onClick:a=>a.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:r,style:{top:"12px",right:"12px",width:"36px",height:"36px",fontSize:"24px"},"aria-label":"关闭",children:"×"}),o.jsx("h3",{style:{margin:"0 0 4px",fontSize:"20px"},children:"📋 接入指引"}),o.jsxs("p",{style:{margin:"0 0 22px",color:"var(--text-tertiary)",fontSize:"13px"},children:["密钥「",e,"」的接入配置"]}),n?(()=>{const a=Object.values(n).flatMap(l=>Object.keys(l.envVars||{})),s=Math.max(...a.map(l=>l.length),0);return o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"16px",marginBottom:"20px"},children:Object.entries(n).map(([l,c])=>{const u=Object.entries(c.envVars);return o.jsxs("div",{className:"ak-guide-section",children:[o.jsx("div",{className:"ak-guide-section-header",children:c.description}),o.jsx("div",{style:{padding:"14px 16px"},children:u.map(([p,d])=>o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0",marginBottom:"8px",fontSize:"13px"},children:[o.jsx("span",{className:"ak-guide-env-name",style:{minWidth:`${s*8.5}px`},children:p}),o.jsx("span",{style:{color:"var(--text-secondary)",margin:"0 8px"},children:"="}),o.jsx("code",{className:"ak-guide-env-value",children:d}),o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>i(d),style:{flexShrink:0,padding:"4px 8px",marginLeft:"8px"},children:"复制"})]},p))})]},l)})})})():o.jsxs("div",{style:{marginBottom:"20px",textAlign:"center",padding:"30px 0"},children:[o.jsx("div",{style:{fontSize:"36px",marginBottom:"8px"},children:"🔑"}),o.jsx("div",{style:{fontWeight:600,fontSize:"15px",marginBottom:"12px"},children:"API Key"}),o.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:o.jsx("code",{style:{padding:"12px 16px",borderRadius:"8px",background:"var(--bg-primary-solid)",fontSize:"14px",fontFamily:'"SF Mono", "Fira Code", monospace',border:"2px dashed var(--color-primary)"},children:t})}),o.jsx("span",{style:{fontSize:"11px",color:"var(--text-tertiary)",display:"block",marginTop:"8px"},children:"完整 Key 仅在创建时展示,此处仅显示掩码"})]}),o.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:o.jsx("button",{onClick:r,className:"ak-modal-btn-secondary",children:"关闭"})})]}),o.jsx("style",{children:`
|
|
503
|
+
.ak-guide-section {
|
|
504
|
+
border-radius: 10px;
|
|
505
|
+
border: 1px solid var(--border-primary);
|
|
506
|
+
overflow: hidden;
|
|
507
|
+
background: var(--bg-primary-solid);
|
|
508
|
+
}
|
|
509
|
+
.ak-guide-section-header {
|
|
510
|
+
padding: 10px 16px;
|
|
511
|
+
border-bottom: 1px solid var(--border-primary);
|
|
512
|
+
background: var(--bg-secondary);
|
|
513
|
+
fontWeight: 600;
|
|
514
|
+
font-size: 14px;
|
|
515
|
+
}
|
|
516
|
+
.ak-guide-env-name {
|
|
517
|
+
color: var(--color-accent, #8b5cf6);
|
|
518
|
+
fontWeight: 600;
|
|
519
|
+
fontFamily: "SF Mono", "Fira Code", monospace;
|
|
520
|
+
flexShrink: 0;
|
|
521
|
+
}
|
|
522
|
+
.ak-guide-env-value {
|
|
523
|
+
flex: 1;
|
|
524
|
+
padding: 6px 10px;
|
|
525
|
+
border-radius: 5px;
|
|
526
|
+
background: var(--bg-secondary);
|
|
527
|
+
wordBreak: break-all;
|
|
528
|
+
fontSize: 12px;
|
|
529
|
+
fontFamily: "SF Mono", "Fira Code", monospace;
|
|
530
|
+
}
|
|
531
|
+
[data-theme="dark"] .ak-guide-section {
|
|
532
|
+
background: #0C1F12;
|
|
533
|
+
border-color: rgba(167, 243, 208, 0.15);
|
|
534
|
+
}
|
|
535
|
+
[data-theme="dark"] .ak-guide-section-header {
|
|
536
|
+
background: rgba(30, 58, 40, 0.95);
|
|
537
|
+
border-color: rgba(167, 243, 208, 0.15);
|
|
538
|
+
}
|
|
539
|
+
[data-theme="dark"] .ak-guide-env-value {
|
|
540
|
+
background: rgba(30, 58, 40, 0.95);
|
|
541
|
+
}
|
|
542
|
+
`})]})}function tue(){const[e,t]=h.useState([]),[n,r]=h.useState([]),[i,a]=h.useState([]),[s,l]=h.useState([]),[c,u]=h.useState([]),[p,d]=h.useState(0),[f,m]=h.useState(1),g=20,[v,x]=h.useState(!0),[y,b]=h.useState(""),[w,S]=h.useState(""),[k,j]=h.useState(new Set),[A,E]=h.useState(!1),[D,O]=h.useState(null),[_,R]=h.useState(""),[X,V]=h.useState(""),[I,$]=h.useState(""),[H,N]=h.useState(!1),[U,P]=h.useState(()=>localStorage.getItem("policies-panel-open")==="true"),[W,se]=h.useState(null),[T,he]=h.useState(!1),[ye,Z]=h.useState(""),[le,Se]=h.useState(""),[Q,ne]=h.useState("system"),[pe,ie]=h.useState(""),[_e,ke]=h.useState(""),[te,De]=h.useState(""),[Ve,Le]=h.useState(""),[We,pt]=h.useState(""),[qe,Xe]=h.useState([]),[Qe,et]=h.useState([]),[J,q]=h.useState("none"),[ue,M]=h.useState(""),[fe,ee]=h.useState([]),[xe,je]=h.useState(!1),Re=h.useRef(null),{confirm:ze}=Ku(),Ke=h.useRef(null);h.useEffect(()=>{if(!H)return;const B=z=>{Ke.current&&!Ke.current.contains(z.target)&&N(!1)};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[H]);const Ie=async()=>{x(!0);try{const B=await Y.getAccessKeys({page:f,pageSize:g,status:y||void 0,search:w||void 0});t(B.data),d(B.total)}catch(B){K.error("加载密钥列表失败: "+B.message)}finally{x(!1)}},Ge=async()=>{try{const[B,z,Pe]=await Promise.all([Y.getPolicies().catch(()=>[]),Y.getRoutes().catch(()=>[]),Y.getPolicyTemplates().catch(()=>[])]);r(B),a(z),l(Pe)}catch{}};h.useEffect(()=>{Ie()},[f,y,w]),h.useEffect(()=>{Ge()},[]),h.useEffect(()=>{Y.getWriteLocalRecords().then(u).catch(()=>{})},[e]);const L=async()=>{if(!_.trim()){K.error("请输入密钥名称");return}try{const B=await Y.createAccessKey({name:_.trim(),remark:X||void 0,policyId:I||void 0});E(!1),O(B),R(""),V(""),$(""),Ie()}catch(B){K.error("创建失败: "+B.message)}},ge=async B=>{try{await Y.updateAccessKey(B.id,{status:B.status==="active"?"disabled":"active"}),K.success(B.status==="active"?"已停用":"已启用"),Ie()}catch(z){K.error("操作失败: "+z.message)}},F=async B=>{if(await ze({message:`确定删除密钥「${B.name}」吗?`}))try{await Y.deleteAccessKey(B.id),K.success("已删除"),Ie()}catch(Pe){K.error("删除失败: "+Pe.message)}},de=async B=>{if(await ze({message:"重新生成后旧密钥将立即失效,确定继续吗?"}))try{const Pe=await Y.regenerateAccessKey(B.id);O({key:{...B,apiKey:Pe.apiKey},apiKey:Pe.apiKey}),Ie()}catch(Pe){K.error("重新生成失败: "+Pe.message)}},[ve,Ae]=h.useState(null),Ee=async B=>{try{const z=await Y.getAccessKeyGuide(B.id);Ae({key:B,guide:z})}catch(z){K.error("获取指引失败: "+z.message)}},Ye=async B=>{if(k.size!==0)try{await Y.batchUpdateAccessKeyStatus(Array.from(k),B),K.success(`已批量${B==="active"?"启用":"停用"} ${k.size} 个密钥`),j(new Set),N(!1),Ie()}catch(z){K.error("批量操作失败: "+z.message)}},tt=async()=>{if(!(k.size===0||!await ze({message:`确定删除选中的 ${k.size} 个密钥吗?`})))try{await Y.batchDeleteAccessKeys(Array.from(k)),K.success(`已删除 ${k.size} 个密钥`),j(new Set),N(!1),Ie()}catch(z){K.error("批量删除失败: "+z.message)}},at=async B=>{if(!(k.size===0||!B))try{await Y.batchBindAccessKeyPolicy(Array.from(k),B),K.success("已批量绑定策略"),j(new Set),N(!1),Ie()}catch(z){K.error("批量绑定失败: "+z.message)}},Ze=B=>{const z=new Set(k);z.has(B)?z.delete(B):z.add(B),j(z)},nn=()=>j(k.size===e.length?new Set:new Set(e.map(B=>B.id))),Kt=B=>navigator.clipboard.writeText(B).then(()=>K.success("已复制")),ct=()=>{Z(""),Se(""),ne(""),ie(""),ke(""),De(""),Le(""),pt(""),Xe([]),et([]),q("none"),M("")},Ht=B=>{var z,Pe,ot,Be,xt,Bt,gi;B?(se(B),Z(B.name),Se(B.description||""),ne(B.routeId||"system"),ie(((z=B.dailyTokenLimit)==null?void 0:z.toString())||""),ke(((Pe=B.monthlyTokenLimit)==null?void 0:Pe.toString())||""),De(((ot=B.dailyRequestLimit)==null?void 0:ot.toString())||""),Le(((Be=B.rpmLimit)==null?void 0:Be.toString())||""),pt(((xt=B.concurrentLimit)==null?void 0:xt.toString())||""),Xe(B.allowedModels||[]),et(B.blockedModels||[]),q((Bt=B.allowedModels)!=null&&Bt.length?"allow":(gi=B.blockedModels)!=null&&gi.length?"block":"none")):(se(null),ct()),he(!0),Zt()},Zt=async()=>{try{const B=await Y.getVendors(),z=new Map;(B||[]).forEach(Pe=>{const ot=Pe.name||"";(Pe.services||[]).forEach(Be=>{(Be.supportedModels||[]).forEach(xt=>{z.has(xt)||z.set(xt,new Set),z.get(xt).add(ot)})})}),ee(Array.from(z.entries()).map(([Pe,ot])=>({name:Pe,vendors:Array.from(ot)})).sort((Pe,ot)=>Pe.name.localeCompare(ot.name)))}catch{}},Tt=J==="allow"?qe:Qe,jt=ue.trim()?fe.filter(B=>B.name.toLowerCase().includes(ue.toLowerCase())&&!Tt.includes(B.name)):fe.filter(B=>!Tt.includes(B.name)),mi=B=>{var Pe,ot,Be,xt,Bt;const z=B.config;Z(z.name||""),Se(B.description),ie(((Pe=z.dailyTokenLimit)==null?void 0:Pe.toString())||""),ke(((ot=z.monthlyTokenLimit)==null?void 0:ot.toString())||""),De(((Be=z.dailyRequestLimit)==null?void 0:Be.toString())||""),Le(((xt=z.rpmLimit)==null?void 0:xt.toString())||""),pt(((Bt=z.concurrentLimit)==null?void 0:Bt.toString())||""),K.success(`已应用模板: ${B.name}`)},Gi=async()=>{if(!ye.trim()){K.error("请输入策略名称");return}const B={name:ye.trim(),description:le||void 0,routeId:Q==="system"?"system":Q||void 0,dailyTokenLimit:pe?Number(pe):void 0,monthlyTokenLimit:_e?Number(_e):void 0,dailyRequestLimit:te?Number(te):void 0,rpmLimit:Ve?Number(Ve):void 0,concurrentLimit:We?Number(We):void 0,allowedModels:J==="allow"?qe:void 0,blockedModels:J==="block"?Qe:void 0};try{W?(await Y.updatePolicy(W.id,B),K.success("策略已更新")):(await Y.createPolicy(B),K.success("策略已创建")),he(!1),Ge(),Ie()}catch(z){K.error("保存失败: "+z.message)}},Ta=async B=>{if(B.keyCount&&B.keyCount>0){K.error(`有 ${B.keyCount} 个密钥正在使用此策略,请先解除绑定`);return}if(await ze({message:`确定删除策略「${B.name}」吗?`}))try{await Y.deletePolicy(B.id),K.success("已删除"),Ge(),Ie()}catch(Pe){K.error("删除失败: "+Pe.message)}},ce=async B=>{try{await Y.duplicatePolicy(B.id),K.success("已复制"),Ge()}catch(z){K.error("复制失败: "+z.message)}},_t=(B,z)=>{const Pe=ue.trim();Pe&&!B.includes(Pe)&&(z([...B,Pe]),M(""))},En=B=>{var z;return(z=i.find(Pe=>Pe.id===B))==null?void 0:z.name},ar=B=>{const z=[];return B.dailyTokenLimit&&z.push(`日${B.dailyTokenLimit}k`),B.monthlyTokenLimit&&z.push(`月${B.monthlyTokenLimit}k`),B.dailyRequestLimit&&z.push(`日${B.dailyRequestLimit}次`),B.rpmLimit&&z.push(`RPM ${B.rpmLimit}`),B.concurrentLimit&&z.push(`并发${B.concurrentLimit}`),z.length>0?z.join(", "):"无限制"},Xi=Math.ceil(p/g),on={padding:"6px 10px",borderRadius:"4px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",boxSizing:"border-box",fontSize:"13px"};return o.jsxs("div",{className:"page-container",children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"24px"},children:[o.jsx("h2",{style:{margin:0},children:"API Key"}),o.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[o.jsx("button",{className:"btn btn-primary",onClick:()=>{E(!0),Ge()},style:{height:"45px"},children:"+ 创建密钥"}),o.jsxs("button",{className:`btn ${U?"btn-primary":"btn-secondary"}`,onClick:()=>{const B=!U;P(B),localStorage.setItem("policies-panel-open",String(B)),B&&Ge()},style:{height:"45px",display:"inline-flex",alignItems:"center",gap:"8px"},children:[o.jsx("span",{children:"📜 策略管理"}),n.length>0&&o.jsxs("span",{children:["(",n.length,")"]}),o.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",borderRadius:"50%",border:"2px solid #fff",background:U?"var(--color-success, #22c55e)":"transparent",flexShrink:0,transition:"all 0.25s"},children:U&&o.jsx("span",{style:{color:"#fff",fontSize:"12px",lineHeight:1},children:"✓"})})]})]})]}),o.jsxs("div",{style:{display:"flex",gap:"0",minHeight:0},children:[o.jsx("div",{style:{flex:1,minWidth:0,transition:"margin-right 0.35s ease",marginRight:U?"24px":"0"},children:o.jsxs("div",{className:"card",style:{marginBottom:"0"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[o.jsxs("div",{style:{display:"flex",gap:"10px"},children:[o.jsxs("select",{value:y,onChange:B=>{b(B.target.value),m(1)},style:on,children:[o.jsx("option",{value:"",children:"全部状态"}),o.jsx("option",{value:"active",children:"启用"}),o.jsx("option",{value:"disabled",children:"停用"})]}),o.jsx("input",{type:"text",placeholder:"搜索名称或备注...",value:w,onChange:B=>{S(B.target.value),m(1)},style:{...on,minWidth:"200px"}})]}),k.size>0&&o.jsxs("div",{ref:Ke,style:{position:"relative",flexShrink:0},children:[o.jsxs("button",{className:"ak-action-btn",onClick:()=>N(!H),children:["批量操作 (",k.size,") ▾"]}),H&&o.jsxs("div",{className:"ak-dropdown-menu",children:[o.jsx("button",{className:"dropdown-btn",onClick:()=>Ye("active"),children:"批量启用"}),o.jsx("button",{className:"dropdown-btn",onClick:()=>Ye("disabled"),children:"批量停用"}),o.jsx("hr",{style:{margin:"2px 0",border:"none",borderTop:"1px solid var(--border-primary)"}}),o.jsxs("select",{style:{width:"100%",border:"none",background:"none",padding:"6px 10px",cursor:"pointer",color:"var(--text-primary)"},onChange:B=>{B.target.value&&at(B.target.value)},children:[o.jsx("option",{value:"",children:"批量绑定策略..."}),n.map(B=>o.jsx("option",{value:B.id,children:B.name},B.id))]}),o.jsx("hr",{style:{margin:"2px 0",border:"none",borderTop:"1px solid var(--border-primary)"}}),o.jsx("button",{className:"dropdown-btn",style:{color:"var(--color-danger)"},onClick:tt,children:"批量删除"})]})]})]}),v?o.jsx("div",{style:{textAlign:"center",padding:"40px"},children:"加载中..."}):o.jsx("div",{style:{overflowX:"auto"},children:o.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[o.jsx("thead",{children:o.jsxs("tr",{style:{borderBottom:"2px solid var(--border-primary)"},children:[o.jsx("th",{style:{padding:"10px 12px",textAlign:"left",width:32},children:o.jsx("input",{type:"checkbox",checked:k.size===e.length&&e.length>0,onChange:nn})}),o.jsx("th",{style:{padding:"10px 12px",textAlign:"left"},children:"名称"}),o.jsx("th",{style:{padding:"10px 12px",textAlign:"left"},children:"API Key"}),o.jsx("th",{style:{padding:"10px 12px",textAlign:"left"},children:"策略"}),o.jsx("th",{style:{padding:"10px 12px",textAlign:"center",width:60},children:"状态"}),o.jsx("th",{style:{padding:"10px 12px",textAlign:"left",minWidth:90},children:"创建时间"}),o.jsx("th",{style:{padding:"10px 12px",textAlign:"left",minWidth:90},children:"最后活跃"}),o.jsx("th",{style:{padding:"10px 12px",textAlign:"center",width:120},children:"操作"})]})}),o.jsx("tbody",{children:e.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:8,style:{padding:"40px",textAlign:"center",color:"var(--text-tertiary)"},children:p===0?"暂无密钥,点击「创建密钥」开始":"无匹配结果"})}):e.map(B=>o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-primary)"},children:[o.jsx("td",{style:{padding:"10px 12px"},children:o.jsx("input",{type:"checkbox",checked:k.has(B.id),onChange:()=>Ze(B.id)})}),o.jsxs("td",{style:{padding:"10px 12px"},children:[o.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"6px",flexWrap:"wrap"},children:[o.jsx("a",{href:`#/access-keys/${B.id}`,style:{color:"var(--color-primary)",textDecoration:"none",fontWeight:500},children:B.name}),(()=>{const z=c.find(Pe=>Pe.accessKeyId===B.id);return z?z.targets.map(Pe=>o.jsx("span",{style:{display:"inline-block",padding:"1px 6px",borderRadius:"8px",fontSize:"11px",lineHeight:"16px",background:Pe==="claude-code"?"#cc7832":"#000",color:"#fff"},children:Pe==="claude-code"?"Claude Code":"Codex"},Pe)):null})()]}),B.remark&&o.jsx("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",marginTop:"2px"},children:B.remark})]}),o.jsx("td",{style:{padding:"10px 12px"},children:o.jsx("code",{style:{fontSize:"12px",background:"var(--bg-secondary)",padding:"2px 6px",borderRadius:"3px"},children:B.apiKey})}),o.jsx("td",{style:{padding:"10px 12px",fontSize:"13px"},children:B.policyName||o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"未配置"})}),o.jsx("td",{style:{padding:"10px 12px",textAlign:"center"},children:o.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",background:B.status==="active"?"#22c55e":"var(--text-tertiary)"},title:B.status==="active"?"启用":"停用"})}),o.jsx("td",{style:{padding:"10px 12px",fontSize:"13px",color:"var(--text-secondary)"},children:new Date(B.createdAt).toLocaleDateString()}),o.jsx("td",{style:{padding:"10px 12px",fontSize:"13px",color:"var(--text-secondary)"},children:B.lastActiveAt?new Date(B.lastActiveAt).toLocaleDateString():"-"}),o.jsx("td",{style:{padding:"10px 12px",textAlign:"center"},children:o.jsxs("div",{style:{display:"flex",gap:"4px",justifyContent:"center"},children:[o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>Ee(B),title:"接入指引",children:"📋"}),o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>ge(B),title:B.status==="active"?"停用":"启用",children:B.status==="active"?"⏸":"▶"}),o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>de(B),title:"重新生成",children:"🔄"}),o.jsx("button",{className:"btn btn-sm ak-action-btn ak-action-btn--danger",onClick:()=>F(B),title:"删除",children:"✕"})]})})]},B.id))})]})}),Xi>1&&o.jsxs("div",{style:{display:"flex",justifyContent:"center",gap:"8px",marginTop:"16px"},children:[o.jsx("button",{className:"btn btn-sm",disabled:f<=1,onClick:()=>m(f-1),children:"‹"}),o.jsxs("span",{style:{color:"var(--text-secondary)",fontSize:"14px"},children:[f,"/",Xi," · 共 ",p," 个"]}),o.jsx("button",{className:"btn btn-sm",disabled:f>=Xi,onClick:()=>m(f+1),children:"›"})]})]})}),o.jsx("div",{style:{width:U?"480px":"0",overflow:"hidden",transition:"width 0.35s ease, opacity 0.35s ease",opacity:U?1:0,flexShrink:0},children:o.jsx("div",{style:{width:"480px",height:"100%"},children:o.jsxs("div",{className:"card",style:{height:"100%",marginBottom:"0",display:"flex",flexDirection:"column"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingBottom:"16px",marginBottom:"16px",borderBottom:"1px solid var(--border-primary)",flexShrink:0},children:[o.jsx("h4",{style:{margin:0,fontSize:"16px"},children:"📜 策略管理"}),o.jsx("button",{className:"btn btn-primary btn-sm",onClick:()=>Ht(),children:"+ 创建策略"})]}),o.jsx("div",{style:{overflowY:"auto",flex:1},children:n.length===0?o.jsxs("div",{style:{textAlign:"center",padding:"40px 0",color:"var(--text-tertiary)",fontSize:"14px"},children:["暂无策略",o.jsx("br",{}),"点击「创建策略」开始配置"]}):o.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:n.map(B=>o.jsxs("div",{style:{padding:"16px",borderRadius:"12px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"8px"},children:[o.jsxs("div",{children:[o.jsxs("div",{style:{fontWeight:600,fontSize:"14px",marginBottom:"2px"},children:["📋 ",B.name]}),B.description&&o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"12px"},children:B.description})]}),o.jsxs("div",{style:{display:"flex",gap:"4px"},children:[o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>Ht(B),children:"编辑"}),o.jsx("button",{className:"btn btn-sm ak-action-btn",onClick:()=>ce(B),children:"复制"}),o.jsx("button",{className:"btn btn-sm ak-action-btn ak-action-btn--danger",onClick:()=>Ta(B),children:"删除"})]})]}),o.jsxs("div",{style:{display:"flex",gap:"16px",fontSize:"12px",color:"var(--text-secondary)"},children:[o.jsxs("span",{children:["🔗 路由: ",B.routeId&&B.routeId!=="system"?En(B.routeId)||o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"未绑定"}):o.jsx("span",{style:{color:"var(--accent-color, #4a90d9)"},children:"按系统默认"})]}),o.jsxs("span",{children:["🔑 Key: ",B.keyCount||0]}),o.jsxs("span",{children:["📊 配额: ",ar(B)]})]})]},B.id))})})]})})})]}),A&&o.jsx("div",{className:"modal-overlay",onClick:()=>E(!1),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"480px",padding:"28px"},onClick:B=>B.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>E(!1),style:{top:"12px",right:"12px",width:"36px",height:"36px",fontSize:"24px"},"aria-label":"关闭",children:"×"}),o.jsx("h3",{style:{margin:"0 0 6px",fontSize:"20px"},children:"创建接入密钥"}),o.jsx("p",{style:{margin:"0 0 20px",color:"var(--text-tertiary)",fontSize:"13px"},children:"生成一个以 sk_ 开头的 API Key,分发给团队成员使用"}),o.jsxs("div",{style:{marginBottom:"14px"},children:[o.jsxs("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:["名称 ",o.jsx("span",{style:{color:"var(--color-danger)"},children:"*"})]}),o.jsx("input",{type:"text",value:_,onChange:B=>R(B.target.value),placeholder:"例如:张三 - 前端组",autoFocus:!0,style:{...on,width:"100%",padding:"10px 14px",fontSize:"14px",borderRadius:"8px"}})]}),o.jsxs("div",{style:{marginBottom:"14px"},children:[o.jsxs("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:["备注 ",o.jsx("span",{style:{color:"var(--text-tertiary)",fontWeight:400,fontSize:"12px"},children:"(可选)"})]}),o.jsx("textarea",{value:X,onChange:B=>V(B.target.value),placeholder:"补充说明信息",style:{...on,width:"100%",padding:"10px 14px",minHeight:"52px",fontSize:"14px",borderRadius:"8px",resize:"vertical"}})]}),o.jsxs("div",{style:{marginBottom:"24px"},children:[o.jsxs("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:["策略 ",o.jsx("span",{style:{color:"var(--text-tertiary)",fontWeight:400,fontSize:"12px"},children:"(可选)"})]}),o.jsxs("select",{value:I,onChange:B=>$(B.target.value),style:{...on,width:"100%",padding:"10px 14px",fontSize:"14px",borderRadius:"8px",cursor:"pointer"},children:[o.jsx("option",{value:"",children:"稍后配置"}),n.map(B=>o.jsx("option",{value:B.id,children:B.name},B.id))]})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"10px"},children:[o.jsx("button",{onClick:()=>E(!1),className:"ak-modal-btn-secondary",children:"取消"}),o.jsx("button",{onClick:L,className:"ak-modal-btn-primary",children:"创建密钥"})]})]})}),D&&o.jsx("div",{className:"modal-overlay",onClick:()=>O(null),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"600px",padding:"28px"},onClick:B=>B.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>O(null),style:{top:"12px",right:"12px",width:"36px",height:"36px",fontSize:"24px"},"aria-label":"关闭",children:"×"}),o.jsxs("div",{style:{textAlign:"center",marginBottom:"20px"},children:[o.jsx("div",{style:{fontSize:"40px",marginBottom:"8px"},children:"🔑"}),o.jsx("h3",{style:{margin:"0",fontSize:"20px",color:"#22c55e"},children:"密钥创建成功"})]}),o.jsxs("div",{style:{background:"var(--bg-primary)",borderRadius:"10px",padding:"16px",border:"2px dashed #22c55e",marginBottom:"20px"},children:[o.jsx("div",{style:{fontSize:"11px",color:"var(--text-tertiary)",marginBottom:"8px",textTransform:"uppercase",letterSpacing:"1px"},children:"API Key"}),o.jsx("code",{style:{display:"block",fontSize:"16px",wordBreak:"break-all",lineHeight:1.6,fontFamily:'"SF Mono", "Fira Code", monospace',color:"var(--text-primary)"},children:D.apiKey})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"center",gap:"10px"},children:[o.jsx("button",{onClick:()=>Kt(D.apiKey),className:"ak-modal-btn-primary",children:"📋 复制 Key"}),o.jsx("button",{onClick:()=>O(null),className:"ak-modal-btn-secondary",children:"完成"})]})]})}),T&&o.jsx("div",{className:"modal-overlay",onClick:()=>he(!1),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"600px",padding:"28px"},onClick:B=>B.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>he(!1),style:{top:"12px",right:"12px",width:"36px",height:"36px",fontSize:"24px"},"aria-label":"关闭",children:"×"}),o.jsx("h3",{style:{margin:"0 0 4px",fontSize:"20px"},children:W?"编辑策略":"创建策略"}),o.jsx("p",{style:{margin:"0 0 22px",color:"var(--text-tertiary)",fontSize:"13px"},children:"配置路由、配额限制和模型过滤规则,多个密钥可复用同一策略"}),o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px",marginBottom:"18px"},children:[o.jsxs("div",{children:[o.jsxs("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:["名称 ",o.jsx("span",{style:{color:"var(--color-danger)"},children:"*"})]}),o.jsx("input",{type:"text",value:ye,onChange:B=>Z(B.target.value),placeholder:"例如:中度限制策略",style:{...on,width:"100%",padding:"10px 14px",fontSize:"14px",borderRadius:"8px"}})]}),o.jsxs("div",{children:[o.jsxs("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:["描述 ",o.jsx("span",{style:{color:"var(--text-tertiary)",fontWeight:400,fontSize:"12px"},children:"(可选)"})]}),o.jsx("input",{type:"text",value:le,onChange:B=>Se(B.target.value),placeholder:"适合普通开发者使用",style:{...on,width:"100%",padding:"10px 14px",fontSize:"14px",borderRadius:"8px"}})]})]}),o.jsxs("div",{style:{marginBottom:"18px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:"路由绑定"}),o.jsxs("select",{value:Q,onChange:B=>ne(B.target.value),style:{...on,width:"100%",padding:"10px 14px",fontSize:"14px",borderRadius:"8px",cursor:"pointer"},children:[o.jsx("option",{value:"system",children:"按系统默认"}),i.map(B=>o.jsx("option",{value:B.id,children:B.name},B.id))]})]}),o.jsxs("div",{style:{marginBottom:"18px"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[o.jsx("label",{style:{fontWeight:600,fontSize:"14px"},children:"配额限制"}),!W&&s.length>0&&o.jsxs("select",{style:{fontSize:"13px",padding:"6px 12px",borderRadius:"6px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",cursor:"pointer",color:"var(--text-secondary)"},onChange:B=>{B.target.value&&(mi(s[Number(B.target.value)]),B.target.value="")},children:[o.jsx("option",{value:"",children:"📋 使用模板..."}),s.map((B,z)=>o.jsxs("option",{value:String(z),children:[B.name," — ",B.description]},z))]})]}),o.jsx("div",{style:{background:"var(--bg-primary)",borderRadius:"10px",padding:"16px",border:"1px solid var(--border-primary)"},children:o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"12px"},children:[o.jsxs("div",{children:[o.jsx("label",{style:{display:"block",fontSize:"12px",color:"var(--text-tertiary)",marginBottom:"4px"},children:"日 Token (k)"}),o.jsx("input",{type:"number",value:pe,onChange:B=>ie(B.target.value),placeholder:"不限",style:{...on,width:"100%",padding:"9px 10px",borderRadius:"6px"}})]}),o.jsxs("div",{children:[o.jsx("label",{style:{display:"block",fontSize:"12px",color:"var(--text-tertiary)",marginBottom:"4px"},children:"月 Token (k)"}),o.jsx("input",{type:"number",value:_e,onChange:B=>ke(B.target.value),placeholder:"不限",style:{...on,width:"100%",padding:"9px 10px",borderRadius:"6px"}})]}),o.jsxs("div",{children:[o.jsx("label",{style:{display:"block",fontSize:"12px",color:"var(--text-tertiary)",marginBottom:"4px"},children:"日请求 (次)"}),o.jsx("input",{type:"number",value:te,onChange:B=>De(B.target.value),placeholder:"不限",style:{...on,width:"100%",padding:"9px 10px",borderRadius:"6px"}})]}),o.jsxs("div",{children:[o.jsx("label",{style:{display:"block",fontSize:"12px",color:"var(--text-tertiary)",marginBottom:"4px"},children:"RPM"}),o.jsx("input",{type:"number",value:Ve,onChange:B=>Le(B.target.value),placeholder:"不限",style:{...on,width:"100%",padding:"9px 10px",borderRadius:"6px"}})]}),o.jsxs("div",{children:[o.jsx("label",{style:{display:"block",fontSize:"12px",color:"var(--text-tertiary)",marginBottom:"4px"},children:"并发"}),o.jsx("input",{type:"number",value:We,onChange:B=>pt(B.target.value),placeholder:"不限",style:{...on,width:"100%",padding:"9px 10px",borderRadius:"6px"}})]})]})})]}),o.jsxs("div",{style:{marginBottom:"24px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:"模型过滤"}),o.jsxs("div",{style:{background:"var(--bg-primary)",borderRadius:"10px",padding:"14px",border:"1px solid var(--border-primary)"},children:[o.jsx("div",{style:{display:"flex",gap:"16px",marginBottom:J!=="none"?"12px":"0"},children:[{value:"none",label:"不限制",desc:"允许所有模型"},{value:"allow",label:"白名单",desc:"仅允许指定模型"},{value:"block",label:"黑名单",desc:"禁止指定模型"}].map(B=>o.jsxs("label",{className:`policy-model-opt ${J===B.value?"policy-model-opt--active":""}`,children:[o.jsx("input",{type:"radio",name:"modelMode",value:B.value,checked:J===B.value,onChange:()=>q(B.value),style:{display:"none"}}),o.jsx("div",{style:{fontWeight:600,fontSize:"14px",marginBottom:"2px"},children:B.label}),o.jsx("div",{style:{fontSize:"11px",color:"var(--text-tertiary)"},children:B.desc})]},B.value))}),J!=="none"&&o.jsxs("div",{children:[o.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"8px"},children:[o.jsxs("div",{style:{position:"relative",flex:1},children:[o.jsx("input",{ref:Re,type:"text",value:ue,onChange:B=>{M(B.target.value),je(!0)},onFocus:()=>je(!0),onBlur:()=>setTimeout(()=>je(!1),150),placeholder:fe.length>0?"搜索或输入模型名...":"输入模型名,回车确认...",autoFocus:!0,onKeyDown:B=>{B.key==="Enter"&&(B.preventDefault(),_t(J==="allow"?qe:Qe,J==="allow"?Xe:et)),B.key==="Escape"&&je(!1)},style:{...on,width:"100%",padding:"8px 12px",borderRadius:"6px",fontSize:"13px"}}),xe&&jt.length>0&&o.jsx("div",{className:"ak-model-suggest",children:jt.map(B=>o.jsxs("button",{className:"ak-model-suggest-item",onMouseDown:z=>{var Be;z.preventDefault();const Pe=J==="allow"?qe:Qe,ot=J==="allow"?Xe:et;Pe.includes(B.name)||ot([...Pe,B.name]),M(""),je(!1),(Be=Re.current)==null||Be.focus()},children:[o.jsx("span",{children:B.name}),o.jsx("span",{children:B.vendors.join(", ")})]},B.name))})]}),o.jsx("button",{className:"btn btn-primary btn-sm",style:{padding:"8px 14px",borderRadius:"6px"},onClick:()=>_t(J==="allow"?qe:Qe,J==="allow"?Xe:et),children:"添加"})]}),o.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",minHeight:"24px"},children:[(J==="allow"?qe:Qe).length===0&&o.jsx("span",{style:{fontSize:"12px",color:"var(--text-tertiary)",padding:"4px 0"},children:J==="allow"?"尚未添加模型,至少需要添加一个模型才能生效":"尚未添加模型,不添加则不对任何模型进行屏蔽"}),(J==="allow"?qe:Qe).map((B,z)=>o.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"4px 10px",background:"var(--bg-secondary)",borderRadius:"16px",fontSize:"13px",border:"1px solid var(--border-primary)"},children:[B,o.jsx("button",{style:{border:"none",background:"none",cursor:"pointer",padding:"0 2px",color:"var(--text-tertiary)",fontSize:"14px",lineHeight:1},onClick:()=>{(J==="allow"?Xe:et)((J==="allow"?qe:Qe).filter((Be,xt)=>xt!==z))},children:"×"})]},z))]})]})]})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"10px"},children:[o.jsx("button",{onClick:()=>he(!1),className:"ak-modal-btn-secondary",children:"取消"}),o.jsx("button",{onClick:Gi,className:"ak-modal-btn-primary",children:W?"保存修改":"创建策略"})]})]})}),ve&&o.jsx(ZD,{keyName:ve.key.name,apiKey:ve.key.apiKey,guide:ve.guide,onClose:()=>Ae(null)}),o.jsx("style",{children:`
|
|
543
|
+
.dropdown-btn {
|
|
544
|
+
display: block; width: 100%; padding: 6px 10px; text-align: left;
|
|
545
|
+
border: none; background: none; cursor: pointer; font-size: 13px;
|
|
546
|
+
color: var(--text-primary);
|
|
547
|
+
}
|
|
548
|
+
.dropdown-btn:hover { background: var(--bg-secondary); }
|
|
549
|
+
|
|
550
|
+
/* 操作按钮 - 列表/策略面板中的小按钮 */
|
|
551
|
+
.ak-action-btn {
|
|
552
|
+
padding: 4px 10px; border-radius: 6px;
|
|
553
|
+
border: 1px solid var(--border-primary);
|
|
554
|
+
background: var(--bg-secondary);
|
|
555
|
+
color: var(--text-secondary);
|
|
556
|
+
cursor: pointer; font-size: 13px;
|
|
557
|
+
transition: all 0.15s;
|
|
558
|
+
}
|
|
559
|
+
.ak-action-btn:hover {
|
|
560
|
+
background: var(--bg-route-item-hover);
|
|
561
|
+
border-color: var(--text-secondary);
|
|
562
|
+
}
|
|
563
|
+
.ak-action-btn--danger {
|
|
564
|
+
color: var(--accent-danger);
|
|
565
|
+
}
|
|
566
|
+
.ak-action-btn--danger:hover {
|
|
567
|
+
background: rgba(220, 38, 38, 0.1);
|
|
568
|
+
border-color: var(--accent-danger);
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
/* 模型自动补全下拉 */
|
|
572
|
+
.ak-model-suggest {
|
|
573
|
+
position: absolute; left: 0; right: 0; bottom: 100%; z-index: 50;
|
|
574
|
+
margin-top: 4px; max-height: 240px; overflow-y: auto;
|
|
575
|
+
background: var(--bg-primary-solid); border: 1px solid var(--border-primary);
|
|
576
|
+
border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.12);
|
|
577
|
+
padding: 4px 0;
|
|
578
|
+
}
|
|
579
|
+
.ak-model-suggest-item {
|
|
580
|
+
display: flex; justify-content: space-between; align-items: center; gap: 8px;
|
|
581
|
+
width: 100%; padding: 7px 12px;
|
|
582
|
+
border: none; background: none; cursor: pointer;
|
|
583
|
+
font-size: 13px; color: var(--text-primary); text-align: left;
|
|
584
|
+
}
|
|
585
|
+
.ak-model-suggest-item > span:first-child {
|
|
586
|
+
font-family: "SF Mono", "Fira Code", monospace;
|
|
587
|
+
white-space: nowrap;
|
|
588
|
+
}
|
|
589
|
+
.ak-model-suggest-item > span:last-child {
|
|
590
|
+
color: #999; font-size: 11px; white-space: nowrap; flex-shrink: 0;
|
|
591
|
+
}
|
|
592
|
+
[data-theme="dark"] .ak-model-suggest-item > span:last-child {
|
|
593
|
+
color: #888;
|
|
594
|
+
}
|
|
595
|
+
.ak-model-suggest-item:hover {
|
|
596
|
+
background: var(--bg-secondary);
|
|
597
|
+
}
|
|
598
|
+
[data-theme="dark"] .ak-model-suggest {
|
|
599
|
+
background: #0C1F12;
|
|
600
|
+
border-color: rgba(167, 243, 208, 0.2);
|
|
601
|
+
}
|
|
602
|
+
[data-theme="dark"] .ak-model-suggest-item:hover {
|
|
603
|
+
background: rgba(30, 58, 40, 0.95);
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
/* 批量操作按钮 */
|
|
607
|
+
.ak-action-btn[onClick] {
|
|
608
|
+
padding: 6px 12px;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
/* 下拉菜单 */
|
|
612
|
+
.ak-dropdown-menu {
|
|
613
|
+
position: absolute; right: 0; top: 100%; z-index: 100;
|
|
614
|
+
background: var(--bg-primary-solid);
|
|
615
|
+
border: 1px solid var(--border-primary);
|
|
616
|
+
border-radius: 6px;
|
|
617
|
+
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|
618
|
+
min-width: 140px; padding: 4px 0;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
/* 弹窗按钮 */
|
|
622
|
+
.ak-modal-btn-primary {
|
|
623
|
+
padding: 10px 28px; border-radius: 8px; border: none;
|
|
624
|
+
background: var(--color-primary, #3b82f6); color: #fff;
|
|
625
|
+
cursor: pointer; font-size: 14px; font-weight: 600;
|
|
626
|
+
transition: opacity 0.15s;
|
|
627
|
+
}
|
|
628
|
+
.ak-modal-btn-primary:hover { opacity: 0.9; }
|
|
629
|
+
|
|
630
|
+
.ak-modal-btn-secondary {
|
|
631
|
+
padding: 10px 24px; border-radius: 8px;
|
|
632
|
+
border: 1px solid var(--border-primary);
|
|
633
|
+
background: var(--bg-secondary);
|
|
634
|
+
color: var(--text-primary);
|
|
635
|
+
cursor: pointer; font-size: 14px; font-weight: 500;
|
|
636
|
+
transition: all 0.15s;
|
|
637
|
+
}
|
|
638
|
+
.ak-modal-btn-secondary:hover {
|
|
639
|
+
background: var(--bg-route-item-hover);
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
/* 模型过滤选项 */
|
|
643
|
+
.policy-model-opt {
|
|
644
|
+
cursor: pointer; padding: 10px 14px; border-radius: 8px;
|
|
645
|
+
flex: 1; text-align: center; transition: all 0.2s;
|
|
646
|
+
border: 1px solid var(--border-primary);
|
|
647
|
+
background: transparent;
|
|
648
|
+
}
|
|
649
|
+
.policy-model-opt:hover {
|
|
650
|
+
background: rgba(59,130,246,0.05);
|
|
651
|
+
}
|
|
652
|
+
.policy-model-opt--active {
|
|
653
|
+
border: 2px solid var(--color-primary, #3b82f6);
|
|
654
|
+
background: rgba(59,130,246,0.12);
|
|
655
|
+
}
|
|
656
|
+
.policy-model-opt--active:hover {
|
|
657
|
+
background: rgba(59,130,246,0.18);
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
/* ========== 深色模式 ========== */
|
|
661
|
+
[data-theme="dark"] .ak-action-btn {
|
|
662
|
+
background: rgba(30, 58, 40, 0.95);
|
|
663
|
+
border-color: rgba(167, 243, 208, 0.2);
|
|
664
|
+
color: #A7F3D0;
|
|
665
|
+
}
|
|
666
|
+
[data-theme="dark"] .ak-action-btn:hover {
|
|
667
|
+
background: rgba(40, 75, 52, 0.95);
|
|
668
|
+
border-color: rgba(167, 243, 208, 0.4);
|
|
669
|
+
}
|
|
670
|
+
[data-theme="dark"] .ak-action-btn--danger {
|
|
671
|
+
color: #EF4444;
|
|
672
|
+
}
|
|
673
|
+
[data-theme="dark"] .ak-action-btn--danger:hover {
|
|
674
|
+
background: rgba(239, 68, 68, 0.15);
|
|
675
|
+
border-color: rgba(239, 68, 68, 0.5);
|
|
676
|
+
}
|
|
677
|
+
[data-theme="dark"] .ak-dropdown-menu {
|
|
678
|
+
background: #0C1F12;
|
|
679
|
+
border-color: rgba(167, 243, 208, 0.2);
|
|
680
|
+
}
|
|
681
|
+
[data-theme="dark"] .ak-modal-btn-secondary {
|
|
682
|
+
background: rgba(30, 58, 40, 0.95);
|
|
683
|
+
border-color: rgba(167, 243, 208, 0.2);
|
|
684
|
+
color: #ECFEF5;
|
|
685
|
+
}
|
|
686
|
+
[data-theme="dark"] .ak-modal-btn-secondary:hover {
|
|
687
|
+
background: rgba(40, 75, 52, 0.95);
|
|
688
|
+
border-color: rgba(167, 243, 208, 0.35);
|
|
689
|
+
}
|
|
690
|
+
[data-theme="dark"] .policy-model-opt:hover {
|
|
691
|
+
background: rgba(96,165,250,0.12);
|
|
692
|
+
}
|
|
693
|
+
[data-theme="dark"] .policy-model-opt--active {
|
|
694
|
+
background: rgba(96,165,250,0.28);
|
|
695
|
+
border-color: #60a5fa;
|
|
696
|
+
}
|
|
697
|
+
[data-theme="dark"] .policy-model-opt--active:hover {
|
|
698
|
+
background: rgba(96,165,250,0.38);
|
|
699
|
+
}
|
|
700
|
+
[data-theme="dark"] .page-container select option {
|
|
701
|
+
background: #0C1F12;
|
|
702
|
+
color: #ECFEF5;
|
|
703
|
+
}
|
|
704
|
+
[data-theme="dark"] .page-container textarea,
|
|
705
|
+
[data-theme="dark"] .page-container input[type="text"],
|
|
706
|
+
[data-theme="dark"] .page-container input[type="number"] {
|
|
707
|
+
color-scheme: dark;
|
|
708
|
+
}
|
|
709
|
+
`})]})}function nue(){var ar,Xi,on,B;const{id:e}=u3(),t=Lh(),{confirm:n}=Ku(),[r,i]=h.useState(null),[a,s]=h.useState([]),[l,c]=h.useState([]),[u,p]=h.useState(!0),[d,f]=h.useState("info"),[m,g]=h.useState(null),[v,x]=h.useState([]),[y,b]=h.useState(30),[w,S]=h.useState([]),[k,j]=h.useState(0),[A,E]=h.useState(1),[D,O]=h.useState(20),[_,R]=h.useState(""),[X,V]=h.useState(""),[I,$]=h.useState(""),[H,N]=h.useState(""),[U,P]=h.useState(null),[W,se]=h.useState(!1),[T,he]=h.useState(10),ye=h.useRef(null),[Z,le]=h.useState(!1),[Se,Q]=h.useState(""),[ne,pe]=h.useState(""),[ie,_e]=h.useState(""),[ke,te]=h.useState(null),[De,Ve]=h.useState(!1),[Le,We]=h.useState({"claude-code":!0,codex:!0}),[pt,qe]=h.useState(!1),[Xe,Qe]=h.useState([]),[et,J]=h.useState(0),[q,ue]=h.useState(1),[M,fe]=h.useState(20),[ee,xe]=h.useState(""),[je,Re]=h.useState(""),[ze,Ke]=h.useState(null),[Ie,Ge]=h.useState([]),[L,ge]=h.useState(!1),[F,de]=h.useState(!1),[ve,Ae]=h.useState(10),Ee=h.useRef(null),Ye=h.useCallback(async()=>{if(e)try{const[z,Pe,ot]=await Promise.all([Y.getAccessKey(e).catch(()=>null),Y.getPolicies().catch(()=>[]),Y.getRoutes().catch(()=>[])]);if(!z){K.error("密钥不存在"),t("/access-keys");return}i(z),s(Pe),c(ot),Q(z.name),pe(z.remark||""),_e(z.policyId||"")}catch(z){K.error("加载数据失败: "+z.message)}finally{p(!1)}},[e,t]),tt=h.useCallback(async()=>{if(e)try{const[z,Pe]=await Promise.all([Y.getAccessKeyUsage(e).catch(()=>null),Y.getAccessKeyUsageTrend(e,y).catch(()=>[])]);g(z),x(Pe)}catch{}},[e,y]),at=h.useCallback(async()=>{if(e)try{const z=await Y.getAccessKeyLogs(e,{page:A,pageSize:D,startDate:_||void 0,endDate:X||void 0,contentType:I||void 0,search:H||void 0});S(z.data),j(z.total)}catch{}},[e,A,D,_,X,I,H]),Ze=h.useCallback(async()=>{if(e)try{const z=await Y.getAccessKeySessions(e,{page:q,pageSize:M,targetType:je||void 0,search:ee||void 0});Qe(z.data),J(z.total)}catch{}},[e,q,M,je,ee]);h.useEffect(()=>{Ye()},[Ye]),h.useEffect(()=>{d==="stats"&&tt(),d==="logs"&&at(),d==="sessions"&&Ze()},[d,tt,at,Ze]),h.useEffect(()=>{if(W&&d==="logs")return ye.current=setInterval(()=>{he(z=>z<=1?(at(),10):z-1)},1e3),()=>{ye.current&&clearInterval(ye.current)};ye.current&&clearInterval(ye.current),he(10)},[W,d,at]),h.useEffect(()=>{if(F&&d==="sessions")return Ee.current=setInterval(()=>{Ae(z=>z<=1?(Ze(),10):z-1)},1e3),()=>{Ee.current&&clearInterval(Ee.current)};Ee.current&&clearInterval(Ee.current),Ae(10)},[F,d,Ze]);const nn=async()=>{if(!(!e||!Se.trim()))try{await Y.updateAccessKey(e,{name:Se.trim(),remark:ne||void 0,policyId:ie||void 0}),K.success("已保存"),le(!1),Ye()}catch(z){K.error("保存失败: "+z.message)}},Kt=async()=>{if(r)try{await Y.updateAccessKey(r.id,{status:r.status==="active"?"disabled":"active"}),K.success(r.status==="active"?"已停用":"已启用"),Ye()}catch(z){K.error("操作失败: "+z.message)}},ct=async()=>{if(!(!r||!await n({message:"确定删除此密钥吗?删除后不可恢复。"})))try{await Y.deleteAccessKey(r.id),K.success("已删除"),t("/access-keys")}catch(Pe){K.error("删除失败: "+Pe.message)}},Ht=async()=>{if(r)try{const z=await Y.getAccessKeyGuide(r.id);te({key:r,guide:z})}catch(z){K.error("获取指引失败: "+z.message)}},Zt=async()=>{var z,Pe;if(r)try{const ot=await Y.getAccessKeyGuide(r.id),Be=((Pe=(z=ot==null?void 0:ot.claudeCode)==null?void 0:z.envVars)==null?void 0:Pe.ANTHROPIC_AUTH_TOKEN)||r.apiKey;await navigator.clipboard.writeText(Be),K.success("已复制到剪贴板")}catch{try{await navigator.clipboard.writeText(r.apiKey),K.success("已复制到剪贴板")}catch{K.error("复制失败")}}},Tt=async()=>{if(!r)return;const z=Object.entries(Le).filter(([,Pe])=>Pe).map(([Pe])=>Pe);if(z.length===0){K.error("请选择至少一个目标");return}qe(!0);try{await Y.writeAccessKeyToLocal(r.id,z),K.success("已写入本地配置文件"),Ve(!1)}catch(Pe){K.error("写入失败: "+(Pe.message||"未知错误"))}finally{qe(!1)}},jt=z=>z>=1e6?(z/1e6).toFixed(1)+"M":z>=1e3?(z/1e3).toFixed(1)+"k":String(z),mi=z=>z?new Date(z).toLocaleString():"-",Gi={width:"100%",padding:"8px 12px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",boxSizing:"border-box",fontSize:"14px"};if(u)return o.jsx("div",{style:{textAlign:"center",padding:"40px"},children:"加载中..."});if(!r)return null;const Ta=m&&m.lifetime.totalRequests>0?((m.lifetime.totalRequests-m.lifetime.errorCount)/m.lifetime.totalRequests*100).toFixed(1):"-",ce=Math.max(...v.map(z=>z.tokens),1),_t=Math.max(...v.map(z=>z.requests),1),En=[{key:"info",label:"基本信息"},{key:"policy",label:"策略"},{key:"stats",label:"统计"},{key:"logs",label:"日志"},{key:"sessions",label:"会话"}];return o.jsxs("div",{className:"page-container",children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginBottom:"20px"},children:[o.jsx("button",{className:"btn btn-secondary",onClick:()=>t("/access-keys"),children:"← 返回"}),o.jsx("h2",{style:{flex:1},children:r.name}),o.jsx("button",{className:"ak-action-btn",style:{padding:"6px 14px"},onClick:()=>le(!0),children:"编辑"}),o.jsx("button",{className:"ak-action-btn",style:{padding:"6px 14px"},onClick:()=>Ve(!0),children:"💾 写入本地"}),o.jsx("button",{className:"ak-action-btn",style:{padding:"6px 14px"},onClick:Kt,children:r.status==="active"?"停用":"启用"}),o.jsx("button",{className:"ak-action-btn ak-action-btn--danger",style:{padding:"6px 14px"},onClick:ct,children:"删除"})]}),o.jsx("div",{className:"ak-tab-bar",style:{display:"flex",gap:"0",borderBottom:"2px solid var(--border-primary)",marginBottom:"20px"},children:En.map(z=>o.jsx("button",{className:`ak-tab-btn ${d===z.key?"ak-tab-btn--active":""}`,onClick:()=>f(z.key),children:z.label},z.key))}),d==="info"&&o.jsx("div",{className:"card",children:o.jsxs("div",{style:{display:"grid",gridTemplateColumns:"140px 1fr",gap:"16px 20px",alignItems:"start"},children:[o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"API Key"}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.jsx("code",{style:{fontSize:"14px",padding:"4px 8px",background:"var(--bg-secondary)",borderRadius:"4px"},children:r.apiKey}),o.jsx("button",{className:"ak-action-btn",onClick:Zt,title:"复制",children:"📋"}),o.jsx("button",{className:"ak-action-btn",onClick:Ht,children:"接入指引"})]}),o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"策略"}),o.jsx("div",{style:{fontSize:"14px"},children:r.policyName||o.jsx("span",{style:{color:"var(--text-tertiary)"},children:"未配置"})}),o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"状态"}),o.jsxs("div",{style:{fontSize:"14px",display:"flex",alignItems:"center",gap:"6px"},children:[o.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",background:r.status==="active"?"var(--color-success, #22c55e)":"var(--text-tertiary)"}}),r.status==="active"?"启用":"停用"]}),o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"创建时间"}),o.jsx("div",{style:{fontSize:"14px"},children:mi(r.createdAt)}),o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"最后活跃"}),o.jsx("div",{style:{fontSize:"14px"},children:mi(r.lastActiveAt)}),o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"备注"}),o.jsx("div",{style:{fontSize:"14px",color:r.remark?"var(--text-primary)":"var(--text-tertiary)"},children:r.remark||"无"}),m&&o.jsxs(o.Fragment,{children:[o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"累计 Token"}),o.jsx("div",{style:{fontSize:"14px"},children:jt(m.lifetime.totalTokens)}),o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px",paddingTop:"4px"},children:"累计请求"}),o.jsx("div",{style:{fontSize:"14px"},children:m.lifetime.totalRequests})]})]})}),d==="policy"&&(()=>{var gi,bo,tc,Qi,Ia;const z=a.find(ut=>ut.id===r.policyId),Pe=z!=null&&z.routeId&&z.routeId!=="system"?(gi=l.find(ut=>ut.id===z.routeId))==null?void 0:gi.name:void 0,ot=ut=>{const pn=[];return ut.dailyTokenLimit&&pn.push(`日 ${ut.dailyTokenLimit}k Token`),ut.weeklyTokenLimit&&pn.push(`周 ${ut.weeklyTokenLimit}k Token`),ut.monthlyTokenLimit&&pn.push(`月 ${ut.monthlyTokenLimit}k Token`),ut.customTokenLimit&&ut.customTokenResetHours&&pn.push(`${ut.customTokenResetHours}h ${ut.customTokenLimit}k Token`),ut.dailyRequestLimit&&pn.push(`日 ${ut.dailyRequestLimit} 次请求`),ut.weeklyRequestLimit&&pn.push(`周 ${ut.weeklyRequestLimit} 次请求`),ut.monthlyRequestLimit&&pn.push(`月 ${ut.monthlyRequestLimit} 次请求`),ut.customRequestLimit&&ut.customRequestResetHours&&pn.push(`${ut.customRequestResetHours}h ${ut.customRequestLimit} 次请求`),ut.rpmLimit&&pn.push(`RPM ${ut.rpmLimit}`),ut.concurrentLimit&&pn.push(`并发 ${ut.concurrentLimit}`),pn.length>0?pn:null},Be=(bo=z==null?void 0:z.allowedModels)!=null&&bo.length?z.allowedModels:(tc=z==null?void 0:z.blockedModels)!=null&&tc.length?z.blockedModels:null,xt=(Qi=z==null?void 0:z.allowedModels)!=null&&Qi.length?"allow":(Ia=z==null?void 0:z.blockedModels)!=null&&Ia.length?"block":"none";if(!z)return o.jsxs("div",{className:"card",style:{textAlign:"center",padding:"60px 20px"},children:[o.jsx("div",{style:{fontSize:"36px",marginBottom:"12px"},children:"📋"}),o.jsx("div",{style:{fontSize:"16px",fontWeight:500,marginBottom:"8px"},children:"未绑定策略"}),o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"13px"},children:"可在「编辑」弹窗中为此密钥绑定策略,以启用配额限制和模型过滤"})]});const Bt=ot(z);return o.jsxs("div",{className:"card",children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"},children:[o.jsxs("div",{children:[o.jsxs("h3",{style:{margin:"0 0 4px",fontSize:"18px"},children:["📋 ",z.name]}),z.description&&o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"13px"},children:z.description})]}),o.jsx("span",{style:{fontSize:"12px",color:"var(--text-tertiary)"},children:"只读 · 如需修改请前往策略管理"})]}),o.jsxs("div",{style:{display:"flex",gap:"4px",alignItems:"center",marginBottom:"20px",paddingBottom:"20px",borderBottom:"1px solid var(--border-primary)"},children:[o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px"},children:"绑定路由:"}),o.jsx("div",{style:{fontSize:"14px"},children:Pe?o.jsx("span",{children:Pe}):o.jsx("span",{style:{color:"var(--accent-color, #4a90d9)"},children:"按系统默认"})})]}),o.jsxs("div",{style:{marginBottom:"20px",paddingBottom:"20px",borderBottom:"1px solid var(--border-primary)"},children:[o.jsx("h4",{style:{margin:"0 0 12px",fontSize:"15px"},children:"📊 配额限制"}),Bt?o.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:Bt.map((ut,pn)=>o.jsx("span",{style:{display:"inline-block",padding:"6px 12px",borderRadius:"6px",background:"var(--bg-secondary)",fontSize:"13px",border:"1px solid var(--border-primary)"},children:ut},pn))}):o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px"},children:"无限制"})]}),o.jsxs("div",{children:[o.jsx("h4",{style:{margin:"0 0 12px",fontSize:"15px"},children:"🏷️ 模型过滤"}),xt==="none"?o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"14px"},children:"不限制,允许所有模型"}):o.jsxs("div",{children:[o.jsx("div",{style:{fontSize:"13px",marginBottom:"10px",color:"var(--text-secondary)"},children:xt==="allow"?"✅ 白名单模式 — 仅允许以下模型":"🚫 黑名单模式 — 禁止以下模型"}),o.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:Be.map((ut,pn)=>o.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"5px 12px",background:"var(--bg-secondary)",borderRadius:"16px",fontSize:"13px",border:"1px solid var(--border-primary)"},children:ut},pn))})]})]})]})})(),d==="stats"&&o.jsxs("div",{children:[m&&o.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:"12px",marginBottom:"20px"},children:[{label:"累计 Token",value:jt(m.lifetime.totalTokens)},{label:"累计请求",value:String(m.lifetime.totalRequests)},{label:"成功率",value:Ta+"%"},{label:"错误数",value:String(m.lifetime.errorCount)},{label:"输入 Token",value:jt(m.lifetime.inputTokens)},{label:"输出 Token",value:jt(m.lifetime.outputTokens)}].map(z=>o.jsxs("div",{className:"card",style:{padding:"16px",textAlign:"center",marginBottom:"0"},children:[o.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:"13px",marginBottom:"4px"},children:z.label}),o.jsx("div",{style:{fontSize:"20px",fontWeight:600},children:z.value})]},z.label))}),o.jsxs("div",{className:"card",children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[o.jsx("h4",{style:{margin:0},children:"消耗趋势"}),o.jsx("div",{style:{display:"flex",gap:"4px"},children:[7,30,90].map(z=>o.jsxs("button",{className:`ak-action-btn ${y===z?"ak-action-btn--active":""}`,style:{padding:"3px 10px",fontSize:"12px"},onClick:()=>b(z),children:[z,"天"]},z))})]}),v.length===0?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:"暂无趋势数据"}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{style:{marginBottom:"20px"},children:[o.jsx("div",{style:{fontSize:"13px",color:"var(--text-tertiary)",marginBottom:"8px"},children:"Token 消耗"}),o.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:"2px",height:"80px"},children:v.slice(-y).map((z,Pe)=>o.jsx("div",{style:{flex:1,minWidth:0,height:ce>0?`${Math.max(2,z.tokens/ce*100)}%`:"2px",background:"var(--color-primary, #3b82f6)",borderRadius:"2px 2px 0 0",transition:"height 0.2s"},title:`${z.date}: ${jt(z.tokens)}`},Pe))}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"11px",color:"var(--text-tertiary)",marginTop:"4px"},children:[o.jsx("span",{children:(ar=v[0])==null?void 0:ar.date}),o.jsx("span",{children:(Xi=v[v.length-1])==null?void 0:Xi.date})]})]}),o.jsxs("div",{style:{marginBottom:"8px"},children:[o.jsx("div",{style:{fontSize:"13px",color:"var(--text-tertiary)",marginBottom:"8px"},children:"请求量"}),o.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:"2px",height:"60px"},children:v.slice(-y).map((z,Pe)=>o.jsx("div",{style:{flex:1,minWidth:0,height:_t>0?`${Math.max(2,z.requests/_t*100)}%`:"2px",background:"var(--color-success, #22c55e)",borderRadius:"2px 2px 0 0",transition:"height 0.2s"},title:`${z.date}: ${z.requests} 请求`},Pe))}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"11px",color:"var(--text-tertiary)",marginTop:"4px"},children:[o.jsx("span",{children:(on=v[0])==null?void 0:on.date}),o.jsx("span",{children:(B=v[v.length-1])==null?void 0:B.date})]})]}),o.jsxs("div",{children:[o.jsx("div",{style:{fontSize:"13px",color:"var(--text-tertiary)",marginBottom:"8px"},children:"错误数"}),o.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:"2px",height:"40px"},children:v.slice(-y).map((z,Pe)=>{const ot=Math.max(...v.map(Be=>Be.errors),1);return o.jsx("div",{style:{flex:1,minWidth:0,height:ot>0?`${Math.max(2,z.errors/ot*100)}%`:"2px",background:z.errors>0?"var(--accent-danger, #ef4444)":"var(--border-primary)",borderRadius:"2px 2px 0 0",transition:"height 0.2s"},title:`${z.date}: ${z.errors} 错误`},Pe)})})]})]})]})]}),d==="logs"&&o.jsxs("div",{children:[o.jsx("div",{className:"card",style:{marginBottom:"16px",padding:"12px 16px"},children:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap",flex:1,minWidth:0},children:[o.jsx("input",{type:"text",placeholder:"搜索路径、模型...",value:H,onChange:z=>{N(z.target.value),E(1)},style:{padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",fontSize:"13px",width:"180px"}}),o.jsxs("select",{value:I,onChange:z=>{$(z.target.value),E(1)},style:{padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",fontSize:"13px"},children:[o.jsx("option",{value:"",children:"全部类型"}),o.jsx("option",{value:"default",children:"默认"}),o.jsx("option",{value:"thinking",children:"思考"}),o.jsx("option",{value:"long-context",children:"长上下文"}),o.jsx("option",{value:"image-understanding",children:"图像理解"}),o.jsx("option",{value:"background",children:"后台"}),o.jsx("option",{value:"compact",children:"压缩"}),o.jsx("option",{value:"high-iq",children:"高智商"})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[o.jsx("label",{style:{fontSize:"13px",color:"var(--text-tertiary)"},children:"开始"}),o.jsx("input",{type:"date",value:_,onChange:z=>{R(z.target.value),E(1)},style:{padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",fontSize:"13px"}})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[o.jsx("label",{style:{fontSize:"13px",color:"var(--text-tertiary)"},children:"结束"}),o.jsx("input",{type:"date",value:X,onChange:z=>{V(z.target.value),E(1)},style:{padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",fontSize:"13px"}})]})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexShrink:0},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"13px",cursor:"pointer",color:"var(--text-tertiary)"},children:[o.jsx("input",{type:"checkbox",checked:W,onChange:z=>se(z.target.checked)}),"自动刷新 ",W&&o.jsxs("span",{style:{color:"var(--color-primary)"},children:["(",T,"s)"]})]}),o.jsx("button",{className:"ak-action-btn",onClick:()=>at(),style:{padding:"4px 12px"},children:"🔄 刷新"})]})]})}),o.jsx("div",{className:"card",children:w.length===0?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:"暂无请求记录"}):o.jsxs(o.Fragment,{children:[o.jsx("div",{style:{overflowX:"auto"},children:o.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"13px"},children:[o.jsx("thead",{children:o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-primary)"},children:[o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"时间"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"路径"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"模型"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"right"},children:"Token"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"right"},children:"耗时"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"center"},children:"状态"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"类型"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"center"},children:"操作"})]})}),o.jsx("tbody",{children:w.map(z=>{var Be,xt,Bt;const Pe=((Be=z.usage)==null?void 0:Be.totalTokens)||(((xt=z.usage)==null?void 0:xt.inputTokens)||0)+(((Bt=z.usage)==null?void 0:Bt.outputTokens)||0),ot=(z.statusCode||200)<400;return o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-primary)",cursor:"pointer"},onClick:()=>P(z),children:[o.jsx("td",{style:{padding:"8px 6px",whiteSpace:"nowrap"},children:new Date(z.timestamp).toLocaleString()}),o.jsx("td",{style:{padding:"8px 6px",maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:z.path||"-"}),o.jsx("td",{style:{padding:"8px 6px"},children:z.targetModel||z.requestModel||"-"}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"right"},children:jt(Pe)}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"right"},children:z.responseTime?(z.responseTime/1e3).toFixed(1)+"s":"-"}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"center"},children:o.jsx("span",{style:{display:"inline-block",padding:"2px 6px",borderRadius:"4px",fontSize:"12px",background:ot?"rgba(34,197,94,0.1)":"rgba(239,68,68,0.1)",color:ot?"var(--color-success, #22c55e)":"var(--accent-danger, #ef4444)"},children:z.statusCode||200})}),o.jsx("td",{style:{padding:"8px 6px"},children:z.contentType||"-"}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"center"},children:o.jsx("button",{className:"ak-action-btn",style:{padding:"2px 8px",fontSize:"12px"},onClick:gi=>{gi.stopPropagation(),P(z)},children:"详情"})})]},z.id)})})]})}),o.jsx("div",{style:{marginTop:"12px"},children:o.jsx(xu,{currentPage:A,totalItems:k,pageSize:D,onPageChange:E,onPageSizeChange:z=>{O(z),E(1)}})})]})})]}),d==="sessions"&&(()=>{const z=(Be,xt)=>{const Bt=xt-Be;return Bt<6e4?`${Math.floor(Bt/1e3)}秒`:Bt<36e5?`${Math.floor(Bt/6e4)}分钟`:`${Math.floor(Bt/36e5)}小时`},Pe=async Be=>{Ke(Be),ge(!0);try{const xt=await Y.getAccessKeySessionLogs(e,Be.id,1e4);Ge(xt)}catch{K.error("加载会话日志失败")}finally{ge(!1)}},ot=async()=>{if(!(!ze||L)){ge(!0);try{const Be=await Y.getAccessKeySessionLogs(e,ze.id,1e4);Ge(Be)}catch{}finally{ge(!1)}}};return o.jsxs("div",{children:[o.jsx("div",{className:"card",style:{marginBottom:"16px",padding:"12px 16px"},children:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap",flex:1,minWidth:0},children:[o.jsx("input",{type:"text",placeholder:"搜索标题或ID...",value:ee,onChange:Be=>{xe(Be.target.value),ue(1)},style:{padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",fontSize:"13px",width:"200px"}}),o.jsxs("select",{value:je,onChange:Be=>{Re(Be.target.value),ue(1)},style:{padding:"4px 8px",borderRadius:"6px",border:"1px solid var(--border-primary)",background:"var(--bg-secondary)",color:"var(--text-primary)",fontSize:"13px"},children:[o.jsx("option",{value:"",children:"全部类型"}),o.jsx("option",{value:"claude-code",children:"Claude Code"}),o.jsx("option",{value:"codex",children:"Codex"})]})]}),o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexShrink:0},children:[o.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"13px",cursor:"pointer",color:"var(--text-tertiary)"},children:[o.jsx("input",{type:"checkbox",checked:F,onChange:Be=>de(Be.target.checked)}),"自动刷新 ",F&&o.jsxs("span",{style:{color:"var(--color-primary)"},children:["(",ve,"s)"]})]}),o.jsx("button",{className:"ak-action-btn",onClick:()=>Ze(),style:{padding:"4px 12px"},children:"🔄 刷新"})]})]})}),o.jsx("div",{className:"card",children:Xe.length===0?o.jsx("div",{style:{textAlign:"center",padding:"20px",color:"var(--text-tertiary)"},children:"暂无会话记录"}):o.jsxs(o.Fragment,{children:[o.jsx("div",{style:{overflowX:"auto"},children:o.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"13px"},children:[o.jsx("thead",{children:o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-primary)"},children:[o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"标题"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"类型"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"right"},children:"请求数"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"right"},children:"Tokens"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"首次请求"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"最后请求"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"left"},children:"时长"}),o.jsx("th",{style:{padding:"8px 6px",textAlign:"center"},children:"操作"})]})}),o.jsx("tbody",{children:Xe.map(Be=>o.jsxs("tr",{style:{borderBottom:"1px solid var(--border-primary)",cursor:"pointer"},onClick:()=>Pe(Be),children:[o.jsx("td",{style:{padding:"8px 6px",maxWidth:"250px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Bo(Be.title)}),o.jsx("td",{style:{padding:"8px 6px"},children:o.jsx("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"4px",fontSize:"12px",background:Be.targetType==="claude-code"?"rgba(59,130,246,0.1)":"rgba(34,197,94,0.1)",color:Be.targetType==="claude-code"?"var(--color-primary, #3b82f6)":"var(--color-success, #22c55e)"},children:Be.targetType==="claude-code"?"Claude Code":"Codex"})}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"right"},children:Be.requestCount}),o.jsx("td",{style:{padding:"8px 6px",textAlign:"right"},children:jt(Be.totalTokens)}),o.jsx("td",{style:{padding:"8px 6px",whiteSpace:"nowrap"},children:new Date(Be.firstRequestAt).toLocaleDateString(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}),o.jsx("td",{style:{padding:"8px 6px",whiteSpace:"nowrap"},children:new Date(Be.lastRequestAt).toLocaleDateString(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}),o.jsx("td",{style:{padding:"8px 6px"},children:z(Be.firstRequestAt,Be.lastRequestAt)}),o.jsxs("td",{style:{padding:"8px 6px",textAlign:"center"},children:[o.jsx("button",{className:"ak-action-btn",style:{padding:"2px 8px",fontSize:"12px"},onClick:xt=>{xt.stopPropagation(),Pe(Be)},children:"详情"}),o.jsx("button",{className:"ak-action-btn",style:{padding:"2px 8px",fontSize:"12px",marginLeft:"4px"},onClick:xt=>{xt.stopPropagation(),Ke(Be),ge(!0),Y.getAccessKeySessionLogs(e,Be.id,1e4).then(Bt=>{Ge(Bt),ge(!1)}).catch(()=>ge(!1))},children:"对话"})]})]},Be.id))})]})}),o.jsx("div",{style:{marginTop:"12px"},children:o.jsx(xu,{currentPage:q,totalItems:et,pageSize:M,onPageChange:ue,onPageSizeChange:Be=>{fe(Be),ue(1)}})})]})}),ze&&o.jsx(ob,{session:ze,logs:Ie,logsLoading:L,onRefreshLogs:ot,onFetchNewLogs:async()=>ze?await Y.getAccessKeySessionLogs(e,ze.id,1e4):[],onClose:()=>{Ke(null),Ge([])}})]})})(),Z&&o.jsx("div",{className:"modal-overlay",onClick:()=>le(!1),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"480px",padding:"28px"},onClick:z=>z.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>le(!1),style:{top:"12px",right:"12px",width:"36px",height:"36px",fontSize:"24px"},"aria-label":"关闭",children:"×"}),o.jsx("h3",{style:{margin:"0 0 20px",fontSize:"20px"},children:"编辑密钥"}),o.jsxs("div",{style:{marginBottom:"14px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:"名称"}),o.jsx("input",{type:"text",value:Se,onChange:z=>Q(z.target.value),style:Gi})]}),o.jsxs("div",{style:{marginBottom:"14px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:"备注"}),o.jsx("textarea",{value:ne,onChange:z=>pe(z.target.value),style:{...Gi,minHeight:"60px",resize:"vertical"}})]}),o.jsxs("div",{style:{marginBottom:"24px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"6px",fontWeight:600,fontSize:"14px"},children:"策略"}),o.jsxs("select",{value:ie,onChange:z=>_e(z.target.value),style:{...Gi,cursor:"pointer"},children:[o.jsx("option",{value:"",children:"未配置"}),a.map(z=>o.jsx("option",{value:z.id,children:z.name},z.id))]})]}),o.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"10px"},children:[o.jsx("button",{onClick:()=>le(!1),className:"ak-modal-btn-secondary",children:"取消"}),o.jsx("button",{onClick:nn,className:"ak-modal-btn-primary",children:"保存"})]})]})}),U&&o.jsx(mf,{log:U,onClose:()=>P(null)}),ke&&o.jsx(ZD,{keyName:ke.key.name,apiKey:ke.key.apiKey,guide:ke.guide,onClose:()=>te(null)}),De&&o.jsx("div",{className:"modal-overlay",onClick:()=>Ve(!1),children:o.jsxs("div",{className:"modal",style:{minWidth:"auto",width:"420px",padding:"28px"},onClick:z=>z.stopPropagation(),children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>Ve(!1),style:{top:"12px",right:"12px",width:"36px",height:"36px",fontSize:"24px"},"aria-label":"关闭",children:"×"}),o.jsx("h3",{style:{margin:"0 0 16px",fontSize:"20px"},children:"写入本地配置"}),o.jsx("p",{style:{margin:"0 0 16px",fontSize:"14px",color:"var(--text-secondary)"},children:"将此密钥写入本地工具配置文件(仅更新认证字段,不影响其他配置)"}),o.jsx("div",{style:{marginBottom:"20px"},children:[{key:"claude-code",label:"Claude Code",desc:"~/.claude/settings.json → ANTHROPIC_AUTH_TOKEN"},{key:"codex",label:"Codex",desc:"~/.codex/auth.json → OPENAI_API_KEY"}].map(z=>o.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"12px",marginBottom:"8px",borderRadius:"8px",border:"1px solid var(--border-primary)",background:Le[z.key]?"var(--bg-secondary)":"transparent",cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:Le[z.key],onChange:Pe=>We(ot=>({...ot,[z.key]:Pe.target.checked})),style:{marginTop:"2px"}}),o.jsxs("div",{children:[o.jsx("div",{style:{fontWeight:600,fontSize:"14px"},children:z.label}),o.jsx("div",{style:{fontSize:"12px",color:"var(--text-tertiary)",marginTop:"2px"},children:z.desc})]})]},z.key))}),o.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"10px"},children:[o.jsx("button",{onClick:()=>Ve(!1),className:"ak-modal-btn-secondary",children:"取消"}),o.jsx("button",{onClick:Tt,className:"ak-modal-btn-primary",disabled:pt,children:pt?"写入中...":"确认写入"})]})]})}),o.jsx("style",{children:`
|
|
710
|
+
.ak-tab-btn {
|
|
711
|
+
padding: 10px 24px;
|
|
712
|
+
border: none;
|
|
713
|
+
background: transparent;
|
|
714
|
+
color: var(--text-tertiary);
|
|
715
|
+
font-size: 14px;
|
|
716
|
+
font-weight: 500;
|
|
717
|
+
cursor: pointer;
|
|
718
|
+
border-bottom: 2px solid transparent;
|
|
719
|
+
margin-bottom: -2px;
|
|
720
|
+
transition: all 0.15s;
|
|
721
|
+
}
|
|
722
|
+
.ak-tab-btn:hover {
|
|
723
|
+
color: var(--text-secondary);
|
|
724
|
+
}
|
|
725
|
+
.ak-tab-btn--active {
|
|
726
|
+
color: var(--color-primary, #3b82f6);
|
|
727
|
+
border-bottom-color: var(--color-primary, #3b82f6);
|
|
728
|
+
font-weight: 600;
|
|
729
|
+
}
|
|
730
|
+
.ak-action-btn {
|
|
731
|
+
padding: 4px 10px; border-radius: 6px;
|
|
732
|
+
border: 1px solid var(--border-primary);
|
|
733
|
+
background: var(--bg-secondary);
|
|
734
|
+
color: var(--text-secondary);
|
|
735
|
+
cursor: pointer; font-size: 13px;
|
|
736
|
+
transition: all 0.15s;
|
|
737
|
+
}
|
|
738
|
+
.ak-action-btn:hover {
|
|
739
|
+
background: var(--bg-route-item-hover);
|
|
740
|
+
border-color: var(--text-secondary);
|
|
741
|
+
}
|
|
742
|
+
.ak-action-btn--active {
|
|
743
|
+
background: var(--color-primary, #3b82f6);
|
|
744
|
+
color: #fff;
|
|
745
|
+
border-color: var(--color-primary, #3b82f6);
|
|
746
|
+
}
|
|
747
|
+
.ak-action-btn--danger {
|
|
748
|
+
color: var(--accent-danger);
|
|
749
|
+
}
|
|
750
|
+
.ak-action-btn--danger:hover {
|
|
751
|
+
background: rgba(220, 38, 38, 0.1);
|
|
752
|
+
border-color: var(--accent-danger);
|
|
753
|
+
}
|
|
754
|
+
.ak-modal-btn-primary {
|
|
755
|
+
padding: 10px 28px; border-radius: 8px; border: none;
|
|
756
|
+
background: var(--color-primary, #3b82f6); color: #fff;
|
|
757
|
+
cursor: pointer; font-size: 14px; font-weight: 600;
|
|
758
|
+
transition: opacity 0.15s;
|
|
759
|
+
}
|
|
760
|
+
.ak-modal-btn-primary:hover { opacity: 0.9; }
|
|
761
|
+
.ak-modal-btn-secondary {
|
|
762
|
+
padding: 10px 24px; border-radius: 8px;
|
|
763
|
+
border: 1px solid var(--border-primary);
|
|
764
|
+
background: var(--bg-secondary);
|
|
765
|
+
color: var(--text-primary);
|
|
766
|
+
cursor: pointer; font-size: 14px; font-weight: 500;
|
|
767
|
+
transition: all 0.15s;
|
|
768
|
+
}
|
|
769
|
+
.ak-modal-btn-secondary:hover {
|
|
770
|
+
background: var(--bg-route-item-hover);
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
/* 深色模式 */
|
|
774
|
+
[data-theme="dark"] .ak-action-btn {
|
|
775
|
+
background: rgba(30, 58, 40, 0.95);
|
|
776
|
+
border-color: rgba(167, 243, 208, 0.2);
|
|
777
|
+
color: #A7F3D0;
|
|
778
|
+
}
|
|
779
|
+
[data-theme="dark"] .ak-action-btn:hover {
|
|
780
|
+
background: rgba(40, 75, 52, 0.95);
|
|
781
|
+
border-color: rgba(167, 243, 208, 0.4);
|
|
782
|
+
}
|
|
783
|
+
[data-theme="dark"] .ak-action-btn--danger {
|
|
784
|
+
color: #EF4444;
|
|
785
|
+
}
|
|
786
|
+
[data-theme="dark"] .ak-action-btn--danger:hover {
|
|
787
|
+
background: rgba(239, 68, 68, 0.15);
|
|
788
|
+
border-color: rgba(239, 68, 68, 0.5);
|
|
789
|
+
}
|
|
790
|
+
[data-theme="dark"] .ak-modal-btn-secondary {
|
|
791
|
+
background: rgba(30, 58, 40, 0.95);
|
|
792
|
+
border-color: rgba(167, 243, 208, 0.2);
|
|
793
|
+
color: #ECFEF5;
|
|
794
|
+
}
|
|
795
|
+
[data-theme="dark"] .ak-modal-btn-secondary:hover {
|
|
796
|
+
background: rgba(40, 75, 52, 0.95);
|
|
797
|
+
border-color: rgba(167, 243, 208, 0.35);
|
|
798
|
+
}
|
|
799
|
+
[data-theme="dark"] .page-container select option {
|
|
800
|
+
background: #0C1F12;
|
|
801
|
+
color: #ECFEF5;
|
|
802
|
+
}
|
|
803
|
+
[data-theme="dark"] .page-container textarea,
|
|
804
|
+
[data-theme="dark"] .page-container input[type="text"],
|
|
805
|
+
[data-theme="dark"] .page-container input[type="date"] {
|
|
806
|
+
color-scheme: dark;
|
|
807
|
+
}
|
|
808
|
+
`})]})}function hw({size:e=16,x:t,y:n,style:r,className:i,title:a}){return o.jsxs("svg",{viewBox:"0 0 24 24",width:e,height:e,x:t,y:n,style:r,className:i,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":a??"Claude Code",children:[o.jsx("title",{children:a??"Claude Code"}),o.jsx("path",{clipRule:"evenodd",d:"M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z",fill:"#D97757",fillRule:"evenodd"})]})}function mw({size:e=16,x:t,y:n,style:r,className:i,title:a}){const l=`codex-grad-${h.useId().replace(/[:]/g,"")}`;return o.jsxs("svg",{viewBox:"0 0 24 24",width:e,height:e,x:t,y:n,style:r,className:i,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":a??"Codex",children:[o.jsx("title",{children:a??"Codex"}),o.jsx("path",{d:"M9.064 3.344a4.578 4.578 0 012.285-.312c1 .115 1.891.54 2.673 1.275.01.01.024.017.037.021a.09.09 0 00.043 0 4.55 4.55 0 013.046.275l.047.022.116.057a4.581 4.581 0 012.188 2.399c.209.51.313 1.041.315 1.595a4.24 4.24 0 01-.134 1.223.123.123 0 00.03.115c.594.607.988 1.33 1.183 2.17.289 1.425-.007 2.71-.887 3.854l-.136.166a4.548 4.548 0 01-2.201 1.388.123.123 0 00-.081.076c-.191.551-.383 1.023-.74 1.494-.9 1.187-2.222 1.846-3.711 1.838-1.187-.006-2.239-.44-3.157-1.302a.107.107 0 00-.105-.024c-.388.125-.78.143-1.204.138a4.441 4.441 0 01-1.945-.466 4.544 4.544 0 01-1.61-1.335c-.152-.202-.303-.392-.414-.617a5.81 5.81 0 01-.37-.961 4.582 4.582 0 01-.014-2.298.124.124 0 00.006-.056.085.085 0 00-.027-.048 4.467 4.467 0 01-1.034-1.651 3.896 3.896 0 01-.251-1.192 5.189 5.189 0 01.141-1.6c.337-1.112.982-1.985 1.933-2.618.212-.141.413-.251.601-.33.215-.089.43-.164.646-.227a.098.098 0 00.065-.066 4.51 4.51 0 01.829-1.615 4.535 4.535 0 011.837-1.388zm3.482 10.565a.637.637 0 000 1.272h3.636a.637.637 0 100-1.272h-3.636zM8.462 9.23a.637.637 0 00-1.106.631l1.272 2.224-1.266 2.136a.636.636 0 101.095.649l1.454-2.455a.636.636 0 00.005-.64L8.462 9.23z",fill:`url(#${l})`}),o.jsx("defs",{children:o.jsxs("linearGradient",{id:l,gradientUnits:"userSpaceOnUse",x1:"12",x2:"12",y1:"3",y2:"21",children:[o.jsx("stop",{stopColor:"#B1A7FF"}),o.jsx("stop",{offset:".5",stopColor:"#7A9DFF"}),o.jsx("stop",{offset:"1",stopColor:"#3941FF"})]})})]})}function JD({agent:e,...t}){return e==="codex"?o.jsx(mw,{...t}):o.jsx(hw,{...t})}const eL=h.createContext(null);function rue(){const e=h.useContext(eL);if(!e)throw new Error("useAgentNotifications must be used inside <AgentNotificationsProvider>");return e}function iue({children:e}){const[t,n]=h.useState(!1);h.useEffect(()=>{Y.getAgentMapNotify().then(i=>n(!!i.enabled)).catch(()=>{})},[]);const r=h.useCallback(()=>{n(i=>{const a=!i;return Y.setAgentMapNotify(a).catch(()=>{}),a})},[]);return o.jsx(eL.Provider,{value:{enabled:t,toggle:r},children:e})}const Ji=1e3,ea=700,Xc=36e5,gw=864e5,tL=.4,nL=4,yw={Read:"📖",Edit:"📝",Write:"📝",MultiEdit:"📝",Bash:"🔧",Glob:"🔍",Grep:"🔍",WebFetch:"🌐",WebSearch:"🌐",Agent:"🤖",Task:"🤖",NotebookEdit:"📓"},x2=8,aue=96;function b2(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return Math.abs(t)}const Ao=[[0,0],[1,400],[7,640],[30,720],[365,800]];function rL(e){if(!Number.isFinite(e)||e<=0)return Ao[0][1];for(let t=1;t<Ao.length;t++)if(e<=Ao[t][0]){const[n,r]=Ao[t-1],[i,a]=Ao[t],s=(e-n)/(i-n);return r+(a-r)*s}return Ao[Ao.length-1][1]}function w2(e,t,n){const r=Ji/2,i=ea/2,a=n-t,s=Number.isFinite(a)&&a>0?a/gw:0,l=rL(s),c=(b2(e)%360+(b2(e+"~j")%40-20))*(Math.PI/180);return{x:r+Math.cos(c)*l,y:i+Math.sin(c)*l}}const oue=[{days:1,tier:0,label:"1 天"},{days:7,tier:1,label:"7 天"},{days:30,tier:2,label:"30 天"},{days:365,tier:3,label:"1 年"}],sue=oue.map(e=>({days:e.days,tier:e.tier,label:e.label,r:rL(e.days)}));function Ux(e){const t=Date.now()-e;return t<6e4?`${Math.floor(t/1e3)}秒前`:t<36e5?`${Math.floor(t/6e4)}分钟前`:t<864e5?`${Math.floor(t/36e5)}小时前`:`${Math.floor(t/864e5)}天前`}function lue({item:e,pos:t,selected:n}){const r=e.requestCount||0,i=Math.min(r/100,1),a=x2+(aue-x2)*i,s=Math.round(a*.85);return o.jsxs("g",{transform:`translate(${t.x} ${t.y})`,className:`am-node am-node--${e.status}${n?" am-node--selected":""}`,"data-sid":e.sessionId,children:[o.jsx("circle",{r:a+6,className:"am-node-glow"}),o.jsx("circle",{r:a,className:"am-node-circle",vectorEffect:"non-scaling-stroke"}),e.agent==="codex"?o.jsx(mw,{size:s,x:-s/2,y:-s/2}):o.jsx(hw,{size:s,x:-s/2,y:-s/2}),o.jsx("text",{textAnchor:"middle",dy:a+16,className:"am-node-title",children:(e.title||e.sessionId.slice(-8)).slice(0,18)}),o.jsx("text",{textAnchor:"middle",dy:a+32,className:"am-node-activity",children:e.lastToolName?`${yw[e.lastToolName]||"•"} ${e.lastToolName}`:(e.lastActivitySummary||"").slice(0,20)||Ux(e.lastRequestAt)}),e.source==="access-key"&&o.jsxs("text",{textAnchor:"middle",dy:a+48,className:"am-node-source",children:["🔑 ",e.keyName||"key"]})]})}function cue({view:e,onView:t}){const n=i=>{const a=Ji/2,s=ea/2,{zoom:l,panX:c,panY:u}=e,p=Math.min(nL,Math.max(tL,l*i)),d=(a-c)/l,f=(s-u)/l;t({zoom:p,panX:a-d*p,panY:s-f*p})},r=Math.round(e.zoom*100);return o.jsxs("div",{className:"am-zoom",children:[o.jsx("button",{className:"am-zoom-btn",onClick:()=>n(1/1.2),title:"缩小",children:"−"}),o.jsxs("span",{className:"am-zoom-pct",children:[r,"%"]}),o.jsx("button",{className:"am-zoom-btn",onClick:()=>n(1.2),title:"放大",children:"+"}),o.jsx("button",{className:"am-zoom-btn",onClick:()=>t({zoom:1,panX:0,panY:0}),title:"重置缩放",children:"⟲"})]})}function uue({sessions:e,now:t,selectedId:n,onSelect:r,view:i,onView:a,focus:s}){const l=h.useRef(null),c=h.useRef(null),u=h.useRef(i);u.current=i;const[p,d]=h.useState(!1),f=h.useMemo(()=>{const w={};for(const S of e)w[S.sessionId]=w2(S.sessionId,S.firstRequestAt,t);return w},[e,t]),m=h.useCallback((w,S)=>{const k=l.current;if(!k)return null;const j=k.getScreenCTM();if(!j)return null;const A=k.createSVGPoint();A.x=w,A.y=S;const E=A.matrixTransform(j.inverse());return{x:E.x,y:E.y}},[]);h.useEffect(()=>{const w=l.current;if(!w)return;const S=k=>{k.preventDefault();const j=m(k.clientX,k.clientY);if(!j)return;const{zoom:A,panX:E,panY:D}=u.current,O=k.deltaY<0?1.15:1/1.15,_=Math.min(nL,Math.max(tL,A*O)),R=(j.x-E)/A,X=(j.y-D)/A;a({zoom:_,panX:j.x-R*_,panY:j.y-X*_})};return w.addEventListener("wheel",S,{passive:!1}),()=>w.removeEventListener("wheel",S)},[m,a,e.length]),h.useEffect(()=>{if(!s)return;const w=e.find(k=>k.sessionId===s.sessionId);if(!w)return;const S=w2(s.sessionId,w.firstRequestAt,Date.now());a(k=>({zoom:k.zoom,panX:Ji/2-S.x*k.zoom,panY:ea/2-S.y*k.zoom}))},[s==null?void 0:s.nonce]);const g=h.useRef(null),v=w=>{var A,E;if(w.button!==0)return;d(!0);let S=w.target,k=null;for(;S&&S!==w.currentTarget;){const D=S.getAttribute&&S.getAttribute("data-sid");if(D){k=D;break}S=S.parentElement}const j=m(w.clientX,w.clientY);g.current={startClient:{x:w.clientX,y:w.clientY},startVB:j||{x:0,y:0},panX:u.current.panX,panY:u.current.panY,moved:!1,sid:k},(E=(A=w.currentTarget).setPointerCapture)==null||E.call(A,w.pointerId)},x=w=>{const S=g.current;if(!S)return;!S.moved&&Math.hypot(w.clientX-S.startClient.x,w.clientY-S.startClient.y)>5&&(S.moved=!0,r(null));const k=m(w.clientX,w.clientY);k&&a(j=>({...j,panX:S.panX+(k.x-S.startVB.x),panY:S.panY+(k.y-S.startVB.y)}))},y=()=>{d(!1);const w=g.current;g.current=null,!(!w||w.moved)&&r(w.sid)},b=h.useMemo(()=>{const w=S=>S.sessionId===n?2:S.status==="active"||S.status==="error"?1:0;return[...e].sort((S,k)=>w(S)-w(k))},[e,n]);return o.jsxs("svg",{ref:l,className:"am-canvas",viewBox:`0 0 ${Ji} ${ea}`,preserveAspectRatio:"xMidYMid meet",onPointerDown:v,onPointerMove:x,onPointerUp:y,onPointerLeave:y,onPointerCancel:y,style:{cursor:p?"grabbing":"grab",touchAction:"none"},children:[o.jsx("rect",{x:0,y:0,width:Ji,height:ea,fill:"transparent"}),o.jsxs("g",{ref:c,transform:`translate(${i.panX} ${i.panY}) scale(${i.zoom})`,children:[o.jsx("circle",{cx:Ji/2,cy:ea/2,r:4,className:"am-center-mark"}),sue.map(w=>o.jsxs("g",{className:`am-ring am-ring--t${w.tier}`,children:[o.jsx("circle",{cx:Ji/2,cy:ea/2,r:w.r,fill:"none"}),o.jsx("text",{x:Ji/2,y:ea/2-w.r-6,textAnchor:"middle",className:"am-ring-label",children:w.label})]},`ring-${w.days}`)),e.filter(w=>w.status==="active").map(w=>{const S=f[w.sessionId];return S?o.jsx("line",{x1:Ji/2,y1:ea/2,x2:S.x,y2:S.y,className:"am-link am-link--active"},`l-${w.sessionId}`):null}),b.map(w=>{const S=f[w.sessionId];return S?o.jsx(lue,{item:w,pos:S,selected:w.sessionId===n},w.sessionId):null})]})]})}const S2={type:"change"},wy={type:"start"},j2={type:"end"},up=new $L,k2=new BL,due=Math.cos(70*U2.DEG2RAD);class pue extends zL{constructor(t,n){super(),this.object=t,this.domElement=n,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new nt,this.cursor=new nt,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:As.ROTATE,MIDDLE:As.DOLLY,RIGHT:As.PAN},this.touches={ONE:Es.ROTATE,TWO:Es.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return l.phi},this.getAzimuthalAngle=function(){return l.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(L){L.addEventListener("keydown",M),this._domElementKeyEvents=L},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",M),this._domElementKeyEvents=null},this.saveState=function(){r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=function(){r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(S2),r.update(),a=i.NONE},this.update=function(){const L=new nt,ge=new Zc().setFromUnitVectors(t.up,new nt(0,1,0)),F=ge.clone().invert(),de=new nt,ve=new Zc,Ae=new nt,Ee=2*Math.PI;return function(tt=null){const at=r.object.position;L.copy(at).sub(r.target),L.applyQuaternion(ge),l.setFromVector3(L),r.autoRotate&&a===i.NONE&&R(O(tt)),r.enableDamping?(l.theta+=c.theta*r.dampingFactor,l.phi+=c.phi*r.dampingFactor):(l.theta+=c.theta,l.phi+=c.phi);let Ze=r.minAzimuthAngle,nn=r.maxAzimuthAngle;isFinite(Ze)&&isFinite(nn)&&(Ze<-Math.PI?Ze+=Ee:Ze>Math.PI&&(Ze-=Ee),nn<-Math.PI?nn+=Ee:nn>Math.PI&&(nn-=Ee),Ze<=nn?l.theta=Math.max(Ze,Math.min(nn,l.theta)):l.theta=l.theta>(Ze+nn)/2?Math.max(Ze,l.theta):Math.min(nn,l.theta)),l.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,l.phi)),l.makeSafe(),r.enableDamping===!0?r.target.addScaledVector(p,r.dampingFactor):r.target.add(p),r.target.sub(r.cursor),r.target.clampLength(r.minTargetRadius,r.maxTargetRadius),r.target.add(r.cursor);let Kt=!1;if(r.zoomToCursor&&j||r.object.isOrthographicCamera)l.radius=P(l.radius);else{const ct=l.radius;l.radius=P(l.radius*u),Kt=ct!=l.radius}if(L.setFromSpherical(l),L.applyQuaternion(F),at.copy(r.target).add(L),r.object.lookAt(r.target),r.enableDamping===!0?(c.theta*=1-r.dampingFactor,c.phi*=1-r.dampingFactor,p.multiplyScalar(1-r.dampingFactor)):(c.set(0,0,0),p.set(0,0,0)),r.zoomToCursor&&j){let ct=null;if(r.object.isPerspectiveCamera){const Ht=L.length();ct=P(Ht*u);const Zt=Ht-ct;r.object.position.addScaledVector(S,Zt),r.object.updateMatrixWorld(),Kt=!!Zt}else if(r.object.isOrthographicCamera){const Ht=new nt(k.x,k.y,0);Ht.unproject(r.object);const Zt=r.object.zoom;r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/u)),r.object.updateProjectionMatrix(),Kt=Zt!==r.object.zoom;const Tt=new nt(k.x,k.y,0);Tt.unproject(r.object),r.object.position.sub(Tt).add(Ht),r.object.updateMatrixWorld(),ct=L.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),r.zoomToCursor=!1;ct!==null&&(this.screenSpacePanning?r.target.set(0,0,-1).transformDirection(r.object.matrix).multiplyScalar(ct).add(r.object.position):(up.origin.copy(r.object.position),up.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(up.direction))<due?t.lookAt(r.target):(k2.setFromNormalAndCoplanarPoint(r.object.up,r.target),up.intersectPlane(k2,r.target))))}else if(r.object.isOrthographicCamera){const ct=r.object.zoom;r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/u)),ct!==r.object.zoom&&(r.object.updateProjectionMatrix(),Kt=!0)}return u=1,j=!1,Kt||de.distanceToSquared(r.object.position)>s||8*(1-ve.dot(r.object.quaternion))>s||Ae.distanceToSquared(r.target)>s?(r.dispatchEvent(S2),de.copy(r.object.position),ve.copy(r.object.quaternion),Ae.copy(r.target),!0):!1}}(),this.dispose=function(){r.domElement.removeEventListener("contextmenu",xe),r.domElement.removeEventListener("pointerdown",We),r.domElement.removeEventListener("pointercancel",qe),r.domElement.removeEventListener("wheel",et),r.domElement.removeEventListener("pointermove",pt),r.domElement.removeEventListener("pointerup",qe),r.domElement.getRootNode().removeEventListener("keydown",q,{capture:!0}),r._domElementKeyEvents!==null&&(r._domElementKeyEvents.removeEventListener("keydown",M),r._domElementKeyEvents=null)};const r=this,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let a=i.NONE;const s=1e-6,l=new Dw,c=new Dw;let u=1;const p=new nt,d=new _n,f=new _n,m=new _n,g=new _n,v=new _n,x=new _n,y=new _n,b=new _n,w=new _n,S=new nt,k=new _n;let j=!1;const A=[],E={};let D=!1;function O(L){return L!==null?2*Math.PI/60*r.autoRotateSpeed*L:2*Math.PI/60/60*r.autoRotateSpeed}function _(L){const ge=Math.abs(L*.01);return Math.pow(.95,r.zoomSpeed*ge)}function R(L){c.theta-=L}function X(L){c.phi-=L}const V=function(){const L=new nt;return function(F,de){L.setFromMatrixColumn(de,0),L.multiplyScalar(-F),p.add(L)}}(),I=function(){const L=new nt;return function(F,de){r.screenSpacePanning===!0?L.setFromMatrixColumn(de,1):(L.setFromMatrixColumn(de,0),L.crossVectors(r.object.up,L)),L.multiplyScalar(F),p.add(L)}}(),$=function(){const L=new nt;return function(F,de){const ve=r.domElement;if(r.object.isPerspectiveCamera){const Ae=r.object.position;L.copy(Ae).sub(r.target);let Ee=L.length();Ee*=Math.tan(r.object.fov/2*Math.PI/180),V(2*F*Ee/ve.clientHeight,r.object.matrix),I(2*de*Ee/ve.clientHeight,r.object.matrix)}else r.object.isOrthographicCamera?(V(F*(r.object.right-r.object.left)/r.object.zoom/ve.clientWidth,r.object.matrix),I(de*(r.object.top-r.object.bottom)/r.object.zoom/ve.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}}();function H(L){r.object.isPerspectiveCamera||r.object.isOrthographicCamera?u/=L:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function N(L){r.object.isPerspectiveCamera||r.object.isOrthographicCamera?u*=L:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function U(L,ge){if(!r.zoomToCursor)return;j=!0;const F=r.domElement.getBoundingClientRect(),de=L-F.left,ve=ge-F.top,Ae=F.width,Ee=F.height;k.x=de/Ae*2-1,k.y=-(ve/Ee)*2+1,S.set(k.x,k.y,1).unproject(r.object).sub(r.object.position).normalize()}function P(L){return Math.max(r.minDistance,Math.min(r.maxDistance,L))}function W(L){d.set(L.clientX,L.clientY)}function se(L){U(L.clientX,L.clientX),y.set(L.clientX,L.clientY)}function T(L){g.set(L.clientX,L.clientY)}function he(L){f.set(L.clientX,L.clientY),m.subVectors(f,d).multiplyScalar(r.rotateSpeed);const ge=r.domElement;R(2*Math.PI*m.x/ge.clientHeight),X(2*Math.PI*m.y/ge.clientHeight),d.copy(f),r.update()}function ye(L){b.set(L.clientX,L.clientY),w.subVectors(b,y),w.y>0?H(_(w.y)):w.y<0&&N(_(w.y)),y.copy(b),r.update()}function Z(L){v.set(L.clientX,L.clientY),x.subVectors(v,g).multiplyScalar(r.panSpeed),$(x.x,x.y),g.copy(v),r.update()}function le(L){U(L.clientX,L.clientY),L.deltaY<0?N(_(L.deltaY)):L.deltaY>0&&H(_(L.deltaY)),r.update()}function Se(L){let ge=!1;switch(L.code){case r.keys.UP:L.ctrlKey||L.metaKey||L.shiftKey?X(2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):$(0,r.keyPanSpeed),ge=!0;break;case r.keys.BOTTOM:L.ctrlKey||L.metaKey||L.shiftKey?X(-2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):$(0,-r.keyPanSpeed),ge=!0;break;case r.keys.LEFT:L.ctrlKey||L.metaKey||L.shiftKey?R(2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):$(r.keyPanSpeed,0),ge=!0;break;case r.keys.RIGHT:L.ctrlKey||L.metaKey||L.shiftKey?R(-2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):$(-r.keyPanSpeed,0),ge=!0;break}ge&&(L.preventDefault(),r.update())}function Q(L){if(A.length===1)d.set(L.pageX,L.pageY);else{const ge=Ie(L),F=.5*(L.pageX+ge.x),de=.5*(L.pageY+ge.y);d.set(F,de)}}function ne(L){if(A.length===1)g.set(L.pageX,L.pageY);else{const ge=Ie(L),F=.5*(L.pageX+ge.x),de=.5*(L.pageY+ge.y);g.set(F,de)}}function pe(L){const ge=Ie(L),F=L.pageX-ge.x,de=L.pageY-ge.y,ve=Math.sqrt(F*F+de*de);y.set(0,ve)}function ie(L){r.enableZoom&&pe(L),r.enablePan&&ne(L)}function _e(L){r.enableZoom&&pe(L),r.enableRotate&&Q(L)}function ke(L){if(A.length==1)f.set(L.pageX,L.pageY);else{const F=Ie(L),de=.5*(L.pageX+F.x),ve=.5*(L.pageY+F.y);f.set(de,ve)}m.subVectors(f,d).multiplyScalar(r.rotateSpeed);const ge=r.domElement;R(2*Math.PI*m.x/ge.clientHeight),X(2*Math.PI*m.y/ge.clientHeight),d.copy(f)}function te(L){if(A.length===1)v.set(L.pageX,L.pageY);else{const ge=Ie(L),F=.5*(L.pageX+ge.x),de=.5*(L.pageY+ge.y);v.set(F,de)}x.subVectors(v,g).multiplyScalar(r.panSpeed),$(x.x,x.y),g.copy(v)}function De(L){const ge=Ie(L),F=L.pageX-ge.x,de=L.pageY-ge.y,ve=Math.sqrt(F*F+de*de);b.set(0,ve),w.set(0,Math.pow(b.y/y.y,r.zoomSpeed)),H(w.y),y.copy(b);const Ae=(L.pageX+ge.x)*.5,Ee=(L.pageY+ge.y)*.5;U(Ae,Ee)}function Ve(L){r.enableZoom&&De(L),r.enablePan&&te(L)}function Le(L){r.enableZoom&&De(L),r.enableRotate&&ke(L)}function We(L){r.enabled!==!1&&(A.length===0&&(r.domElement.setPointerCapture(L.pointerId),r.domElement.addEventListener("pointermove",pt),r.domElement.addEventListener("pointerup",qe)),!ze(L)&&(je(L),L.pointerType==="touch"?fe(L):Xe(L)))}function pt(L){r.enabled!==!1&&(L.pointerType==="touch"?ee(L):Qe(L))}function qe(L){switch(Re(L),A.length){case 0:r.domElement.releasePointerCapture(L.pointerId),r.domElement.removeEventListener("pointermove",pt),r.domElement.removeEventListener("pointerup",qe),r.dispatchEvent(j2),a=i.NONE;break;case 1:const ge=A[0],F=E[ge];fe({pointerId:ge,pageX:F.x,pageY:F.y});break}}function Xe(L){let ge;switch(L.button){case 0:ge=r.mouseButtons.LEFT;break;case 1:ge=r.mouseButtons.MIDDLE;break;case 2:ge=r.mouseButtons.RIGHT;break;default:ge=-1}switch(ge){case As.DOLLY:if(r.enableZoom===!1)return;se(L),a=i.DOLLY;break;case As.ROTATE:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enablePan===!1)return;T(L),a=i.PAN}else{if(r.enableRotate===!1)return;W(L),a=i.ROTATE}break;case As.PAN:if(L.ctrlKey||L.metaKey||L.shiftKey){if(r.enableRotate===!1)return;W(L),a=i.ROTATE}else{if(r.enablePan===!1)return;T(L),a=i.PAN}break;default:a=i.NONE}a!==i.NONE&&r.dispatchEvent(wy)}function Qe(L){switch(a){case i.ROTATE:if(r.enableRotate===!1)return;he(L);break;case i.DOLLY:if(r.enableZoom===!1)return;ye(L);break;case i.PAN:if(r.enablePan===!1)return;Z(L);break}}function et(L){r.enabled===!1||r.enableZoom===!1||a!==i.NONE||(L.preventDefault(),r.dispatchEvent(wy),le(J(L)),r.dispatchEvent(j2))}function J(L){const ge=L.deltaMode,F={clientX:L.clientX,clientY:L.clientY,deltaY:L.deltaY};switch(ge){case 1:F.deltaY*=16;break;case 2:F.deltaY*=100;break}return L.ctrlKey&&!D&&(F.deltaY*=10),F}function q(L){L.key==="Control"&&(D=!0,r.domElement.getRootNode().addEventListener("keyup",ue,{passive:!0,capture:!0}))}function ue(L){L.key==="Control"&&(D=!1,r.domElement.getRootNode().removeEventListener("keyup",ue,{passive:!0,capture:!0}))}function M(L){r.enabled===!1||r.enablePan===!1||Se(L)}function fe(L){switch(Ke(L),A.length){case 1:switch(r.touches.ONE){case Es.ROTATE:if(r.enableRotate===!1)return;Q(L),a=i.TOUCH_ROTATE;break;case Es.PAN:if(r.enablePan===!1)return;ne(L),a=i.TOUCH_PAN;break;default:a=i.NONE}break;case 2:switch(r.touches.TWO){case Es.DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;ie(L),a=i.TOUCH_DOLLY_PAN;break;case Es.DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;_e(L),a=i.TOUCH_DOLLY_ROTATE;break;default:a=i.NONE}break;default:a=i.NONE}a!==i.NONE&&r.dispatchEvent(wy)}function ee(L){switch(Ke(L),a){case i.TOUCH_ROTATE:if(r.enableRotate===!1)return;ke(L),r.update();break;case i.TOUCH_PAN:if(r.enablePan===!1)return;te(L),r.update();break;case i.TOUCH_DOLLY_PAN:if(r.enableZoom===!1&&r.enablePan===!1)return;Ve(L),r.update();break;case i.TOUCH_DOLLY_ROTATE:if(r.enableZoom===!1&&r.enableRotate===!1)return;Le(L),r.update();break;default:a=i.NONE}}function xe(L){r.enabled!==!1&&L.preventDefault()}function je(L){A.push(L.pointerId)}function Re(L){delete E[L.pointerId];for(let ge=0;ge<A.length;ge++)if(A[ge]==L.pointerId){A.splice(ge,1);return}}function ze(L){for(let ge=0;ge<A.length;ge++)if(A[ge]==L.pointerId)return!0;return!1}function Ke(L){let ge=E[L.pointerId];ge===void 0&&(ge=new _n,E[L.pointerId]=ge),ge.set(L.pageX,L.pageY)}function Ie(L){const ge=L.pointerId===A[0]?A[1]:A[0];return E[ge]}r.domElement.addEventListener("contextmenu",xe),r.domElement.addEventListener("pointerdown",We),r.domElement.addEventListener("pointercancel",qe),r.domElement.addEventListener("wheel",et,{passive:!1}),r.domElement.getRootNode().addEventListener("keydown",q,{passive:!0,capture:!0}),this.update()}}class Sy extends W2{constructor(t=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=t,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new _n(.5,.5),this.addEventListener("removed",function(){this.traverse(function(n){n.element instanceof Element&&n.element.parentNode!==null&&n.element.parentNode.removeChild(n.element)})})}copy(t,n){return super.copy(t,n),this.element=t.element.cloneNode(!0),this.center=t.center,this}}const zs=new nt,C2=new Hx,P2=new Hx,A2=new nt,E2=new nt;class fue{constructor(t={}){const n=this;let r,i,a,s;const l={objects:new WeakMap},c=t.element!==void 0?t.element:document.createElement("div");c.style.overflow="hidden",this.domElement=c,this.getSize=function(){return{width:r,height:i}},this.render=function(g,v){g.matrixWorldAutoUpdate===!0&&g.updateMatrixWorld(),v.parent===null&&v.matrixWorldAutoUpdate===!0&&v.updateMatrixWorld(),C2.copy(v.matrixWorldInverse),P2.multiplyMatrices(v.projectionMatrix,C2),p(g,g,v),m(g)},this.setSize=function(g,v){r=g,i=v,a=r/2,s=i/2,c.style.width=g+"px",c.style.height=v+"px"};function u(g){g.isCSS2DObject&&(g.element.style.display="none");for(let v=0,x=g.children.length;v<x;v++)u(g.children[v])}function p(g,v,x){if(g.visible===!1){u(g);return}if(g.isCSS2DObject){zs.setFromMatrixPosition(g.matrixWorld),zs.applyMatrix4(P2);const y=zs.z>=-1&&zs.z<=1&&g.layers.test(x.layers)===!0,b=g.element;b.style.display=y===!0?"":"none",y===!0&&(g.onBeforeRender(n,v,x),b.style.transform="translate("+-100*g.center.x+"%,"+-100*g.center.y+"%)translate("+(zs.x*a+a)+"px,"+(-zs.y*s+s)+"px)",b.parentNode!==c&&c.appendChild(b),g.onAfterRender(n,v,x));const w={distanceToCameraSquared:d(x,g)};l.objects.set(g,w)}for(let y=0,b=g.children.length;y<b;y++)p(g.children[y],v,x)}function d(g,v){return A2.setFromMatrixPosition(g.matrixWorld),E2.setFromMatrixPosition(v.matrixWorld),A2.distanceToSquared(E2)}function f(g){const v=[];return g.traverseVisible(function(x){x.isCSS2DObject&&v.push(x)}),v}function m(g){const v=f(g).sort(function(y,b){if(y.renderOrder!==b.renderOrder)return b.renderOrder-y.renderOrder;const w=l.objects.get(y).distanceToCameraSquared,S=l.objects.get(b).distanceToCameraSquared;return w-S}),x=v.length;for(let y=0,b=v.length;y<b;y++)v[y].element.style.zIndex=x-y}}}const T2=new Vx,dp=new nt;class iL extends FL{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const t=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],n=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],r=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(r),this.setAttribute("position",new Lw(t,3)),this.setAttribute("uv",new Lw(n,2))}applyMatrix4(t){const n=this.attributes.instanceStart,r=this.attributes.instanceEnd;return n!==void 0&&(n.applyMatrix4(t),r.applyMatrix4(t),n.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(t){let n;t instanceof Float32Array?n=t:Array.isArray(t)&&(n=new Float32Array(t));const r=new Ey(n,6,1);return this.setAttribute("instanceStart",new Us(r,3,0)),this.setAttribute("instanceEnd",new Us(r,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t){let n;t instanceof Float32Array?n=t:Array.isArray(t)&&(n=new Float32Array(t));const r=new Ey(n,6,1);return this.setAttribute("instanceColorStart",new Us(r,3,0)),this.setAttribute("instanceColorEnd",new Us(r,3,3)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new UL(t.geometry)),this}fromLineSegments(t){const n=t.geometry;return this.setPositions(n.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Vx);const t=this.attributes.instanceStart,n=this.attributes.instanceEnd;t!==void 0&&n!==void 0&&(this.boundingBox.setFromBufferAttribute(t),T2.setFromBufferAttribute(n),this.boundingBox.union(T2))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new K2),this.boundingBox===null&&this.computeBoundingBox();const t=this.attributes.instanceStart,n=this.attributes.instanceEnd;if(t!==void 0&&n!==void 0){const r=this.boundingSphere.center;this.boundingBox.getCenter(r);let i=0;for(let a=0,s=t.count;a<s;a++)dp.fromBufferAttribute(t,a),i=Math.max(i,r.distanceToSquared(dp)),dp.fromBufferAttribute(n,a),i=Math.max(i,r.distanceToSquared(dp));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(t){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(t)}}vp.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new _n(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};yp.line={uniforms:H2.merge([vp.common,vp.fog,vp.line]),vertexShader:`
|
|
809
|
+
#include <common>
|
|
810
|
+
#include <color_pars_vertex>
|
|
811
|
+
#include <fog_pars_vertex>
|
|
812
|
+
#include <logdepthbuf_pars_vertex>
|
|
813
|
+
#include <clipping_planes_pars_vertex>
|
|
814
|
+
|
|
815
|
+
uniform float linewidth;
|
|
816
|
+
uniform vec2 resolution;
|
|
817
|
+
|
|
818
|
+
attribute vec3 instanceStart;
|
|
819
|
+
attribute vec3 instanceEnd;
|
|
820
|
+
|
|
821
|
+
attribute vec3 instanceColorStart;
|
|
822
|
+
attribute vec3 instanceColorEnd;
|
|
823
|
+
|
|
824
|
+
#ifdef WORLD_UNITS
|
|
825
|
+
|
|
826
|
+
varying vec4 worldPos;
|
|
827
|
+
varying vec3 worldStart;
|
|
828
|
+
varying vec3 worldEnd;
|
|
829
|
+
|
|
830
|
+
#ifdef USE_DASH
|
|
831
|
+
|
|
832
|
+
varying vec2 vUv;
|
|
833
|
+
|
|
834
|
+
#endif
|
|
835
|
+
|
|
836
|
+
#else
|
|
837
|
+
|
|
838
|
+
varying vec2 vUv;
|
|
839
|
+
|
|
840
|
+
#endif
|
|
841
|
+
|
|
842
|
+
#ifdef USE_DASH
|
|
843
|
+
|
|
844
|
+
uniform float dashScale;
|
|
845
|
+
attribute float instanceDistanceStart;
|
|
846
|
+
attribute float instanceDistanceEnd;
|
|
847
|
+
varying float vLineDistance;
|
|
848
|
+
|
|
849
|
+
#endif
|
|
850
|
+
|
|
851
|
+
void trimSegment( const in vec4 start, inout vec4 end ) {
|
|
852
|
+
|
|
853
|
+
// trim end segment so it terminates between the camera plane and the near plane
|
|
854
|
+
|
|
855
|
+
// conservative estimate of the near plane
|
|
856
|
+
float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column
|
|
857
|
+
float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column
|
|
858
|
+
float nearEstimate = - 0.5 * b / a;
|
|
859
|
+
|
|
860
|
+
float alpha = ( nearEstimate - start.z ) / ( end.z - start.z );
|
|
861
|
+
|
|
862
|
+
end.xyz = mix( start.xyz, end.xyz, alpha );
|
|
863
|
+
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
void main() {
|
|
867
|
+
|
|
868
|
+
#ifdef USE_COLOR
|
|
869
|
+
|
|
870
|
+
vColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;
|
|
871
|
+
|
|
872
|
+
#endif
|
|
873
|
+
|
|
874
|
+
#ifdef USE_DASH
|
|
875
|
+
|
|
876
|
+
vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;
|
|
877
|
+
vUv = uv;
|
|
878
|
+
|
|
879
|
+
#endif
|
|
880
|
+
|
|
881
|
+
float aspect = resolution.x / resolution.y;
|
|
882
|
+
|
|
883
|
+
// camera space
|
|
884
|
+
vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );
|
|
885
|
+
vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );
|
|
886
|
+
|
|
887
|
+
#ifdef WORLD_UNITS
|
|
888
|
+
|
|
889
|
+
worldStart = start.xyz;
|
|
890
|
+
worldEnd = end.xyz;
|
|
891
|
+
|
|
892
|
+
#else
|
|
893
|
+
|
|
894
|
+
vUv = uv;
|
|
895
|
+
|
|
896
|
+
#endif
|
|
897
|
+
|
|
898
|
+
// special case for perspective projection, and segments that terminate either in, or behind, the camera plane
|
|
899
|
+
// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space
|
|
900
|
+
// but we need to perform ndc-space calculations in the shader, so we must address this issue directly
|
|
901
|
+
// perhaps there is a more elegant solution -- WestLangley
|
|
902
|
+
|
|
903
|
+
bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column
|
|
904
|
+
|
|
905
|
+
if ( perspective ) {
|
|
906
|
+
|
|
907
|
+
if ( start.z < 0.0 && end.z >= 0.0 ) {
|
|
908
|
+
|
|
909
|
+
trimSegment( start, end );
|
|
910
|
+
|
|
911
|
+
} else if ( end.z < 0.0 && start.z >= 0.0 ) {
|
|
912
|
+
|
|
913
|
+
trimSegment( end, start );
|
|
914
|
+
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
// clip space
|
|
920
|
+
vec4 clipStart = projectionMatrix * start;
|
|
921
|
+
vec4 clipEnd = projectionMatrix * end;
|
|
922
|
+
|
|
923
|
+
// ndc space
|
|
924
|
+
vec3 ndcStart = clipStart.xyz / clipStart.w;
|
|
925
|
+
vec3 ndcEnd = clipEnd.xyz / clipEnd.w;
|
|
926
|
+
|
|
927
|
+
// direction
|
|
928
|
+
vec2 dir = ndcEnd.xy - ndcStart.xy;
|
|
929
|
+
|
|
930
|
+
// account for clip-space aspect ratio
|
|
931
|
+
dir.x *= aspect;
|
|
932
|
+
dir = normalize( dir );
|
|
933
|
+
|
|
934
|
+
#ifdef WORLD_UNITS
|
|
935
|
+
|
|
936
|
+
vec3 worldDir = normalize( end.xyz - start.xyz );
|
|
937
|
+
vec3 tmpFwd = normalize( mix( start.xyz, end.xyz, 0.5 ) );
|
|
938
|
+
vec3 worldUp = normalize( cross( worldDir, tmpFwd ) );
|
|
939
|
+
vec3 worldFwd = cross( worldDir, worldUp );
|
|
940
|
+
worldPos = position.y < 0.5 ? start: end;
|
|
941
|
+
|
|
942
|
+
// height offset
|
|
943
|
+
float hw = linewidth * 0.5;
|
|
944
|
+
worldPos.xyz += position.x < 0.0 ? hw * worldUp : - hw * worldUp;
|
|
945
|
+
|
|
946
|
+
// don't extend the line if we're rendering dashes because we
|
|
947
|
+
// won't be rendering the endcaps
|
|
948
|
+
#ifndef USE_DASH
|
|
949
|
+
|
|
950
|
+
// cap extension
|
|
951
|
+
worldPos.xyz += position.y < 0.5 ? - hw * worldDir : hw * worldDir;
|
|
952
|
+
|
|
953
|
+
// add width to the box
|
|
954
|
+
worldPos.xyz += worldFwd * hw;
|
|
955
|
+
|
|
956
|
+
// endcaps
|
|
957
|
+
if ( position.y > 1.0 || position.y < 0.0 ) {
|
|
958
|
+
|
|
959
|
+
worldPos.xyz -= worldFwd * 2.0 * hw;
|
|
960
|
+
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
#endif
|
|
964
|
+
|
|
965
|
+
// project the worldpos
|
|
966
|
+
vec4 clip = projectionMatrix * worldPos;
|
|
967
|
+
|
|
968
|
+
// shift the depth of the projected points so the line
|
|
969
|
+
// segments overlap neatly
|
|
970
|
+
vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;
|
|
971
|
+
clip.z = clipPose.z * clip.w;
|
|
972
|
+
|
|
973
|
+
#else
|
|
974
|
+
|
|
975
|
+
vec2 offset = vec2( dir.y, - dir.x );
|
|
976
|
+
// undo aspect ratio adjustment
|
|
977
|
+
dir.x /= aspect;
|
|
978
|
+
offset.x /= aspect;
|
|
979
|
+
|
|
980
|
+
// sign flip
|
|
981
|
+
if ( position.x < 0.0 ) offset *= - 1.0;
|
|
982
|
+
|
|
983
|
+
// endcaps
|
|
984
|
+
if ( position.y < 0.0 ) {
|
|
985
|
+
|
|
986
|
+
offset += - dir;
|
|
987
|
+
|
|
988
|
+
} else if ( position.y > 1.0 ) {
|
|
989
|
+
|
|
990
|
+
offset += dir;
|
|
991
|
+
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
// adjust for linewidth
|
|
995
|
+
offset *= linewidth;
|
|
996
|
+
|
|
997
|
+
// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...
|
|
998
|
+
offset /= resolution.y;
|
|
999
|
+
|
|
1000
|
+
// select end
|
|
1001
|
+
vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;
|
|
1002
|
+
|
|
1003
|
+
// back to clip space
|
|
1004
|
+
offset *= clip.w;
|
|
1005
|
+
|
|
1006
|
+
clip.xy += offset;
|
|
1007
|
+
|
|
1008
|
+
#endif
|
|
1009
|
+
|
|
1010
|
+
gl_Position = clip;
|
|
1011
|
+
|
|
1012
|
+
vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation
|
|
1013
|
+
|
|
1014
|
+
#include <logdepthbuf_vertex>
|
|
1015
|
+
#include <clipping_planes_vertex>
|
|
1016
|
+
#include <fog_vertex>
|
|
1017
|
+
|
|
1018
|
+
}
|
|
1019
|
+
`,fragmentShader:`
|
|
1020
|
+
uniform vec3 diffuse;
|
|
1021
|
+
uniform float opacity;
|
|
1022
|
+
uniform float linewidth;
|
|
1023
|
+
|
|
1024
|
+
#ifdef USE_DASH
|
|
1025
|
+
|
|
1026
|
+
uniform float dashOffset;
|
|
1027
|
+
uniform float dashSize;
|
|
1028
|
+
uniform float gapSize;
|
|
1029
|
+
|
|
1030
|
+
#endif
|
|
1031
|
+
|
|
1032
|
+
varying float vLineDistance;
|
|
1033
|
+
|
|
1034
|
+
#ifdef WORLD_UNITS
|
|
1035
|
+
|
|
1036
|
+
varying vec4 worldPos;
|
|
1037
|
+
varying vec3 worldStart;
|
|
1038
|
+
varying vec3 worldEnd;
|
|
1039
|
+
|
|
1040
|
+
#ifdef USE_DASH
|
|
1041
|
+
|
|
1042
|
+
varying vec2 vUv;
|
|
1043
|
+
|
|
1044
|
+
#endif
|
|
1045
|
+
|
|
1046
|
+
#else
|
|
1047
|
+
|
|
1048
|
+
varying vec2 vUv;
|
|
1049
|
+
|
|
1050
|
+
#endif
|
|
1051
|
+
|
|
1052
|
+
#include <common>
|
|
1053
|
+
#include <color_pars_fragment>
|
|
1054
|
+
#include <fog_pars_fragment>
|
|
1055
|
+
#include <logdepthbuf_pars_fragment>
|
|
1056
|
+
#include <clipping_planes_pars_fragment>
|
|
1057
|
+
|
|
1058
|
+
vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {
|
|
1059
|
+
|
|
1060
|
+
float mua;
|
|
1061
|
+
float mub;
|
|
1062
|
+
|
|
1063
|
+
vec3 p13 = p1 - p3;
|
|
1064
|
+
vec3 p43 = p4 - p3;
|
|
1065
|
+
|
|
1066
|
+
vec3 p21 = p2 - p1;
|
|
1067
|
+
|
|
1068
|
+
float d1343 = dot( p13, p43 );
|
|
1069
|
+
float d4321 = dot( p43, p21 );
|
|
1070
|
+
float d1321 = dot( p13, p21 );
|
|
1071
|
+
float d4343 = dot( p43, p43 );
|
|
1072
|
+
float d2121 = dot( p21, p21 );
|
|
1073
|
+
|
|
1074
|
+
float denom = d2121 * d4343 - d4321 * d4321;
|
|
1075
|
+
|
|
1076
|
+
float numer = d1343 * d4321 - d1321 * d4343;
|
|
1077
|
+
|
|
1078
|
+
mua = numer / denom;
|
|
1079
|
+
mua = clamp( mua, 0.0, 1.0 );
|
|
1080
|
+
mub = ( d1343 + d4321 * ( mua ) ) / d4343;
|
|
1081
|
+
mub = clamp( mub, 0.0, 1.0 );
|
|
1082
|
+
|
|
1083
|
+
return vec2( mua, mub );
|
|
1084
|
+
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
void main() {
|
|
1088
|
+
|
|
1089
|
+
#include <clipping_planes_fragment>
|
|
1090
|
+
|
|
1091
|
+
#ifdef USE_DASH
|
|
1092
|
+
|
|
1093
|
+
if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps
|
|
1094
|
+
|
|
1095
|
+
if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX
|
|
1096
|
+
|
|
1097
|
+
#endif
|
|
1098
|
+
|
|
1099
|
+
float alpha = opacity;
|
|
1100
|
+
|
|
1101
|
+
#ifdef WORLD_UNITS
|
|
1102
|
+
|
|
1103
|
+
// Find the closest points on the view ray and the line segment
|
|
1104
|
+
vec3 rayEnd = normalize( worldPos.xyz ) * 1e5;
|
|
1105
|
+
vec3 lineDir = worldEnd - worldStart;
|
|
1106
|
+
vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );
|
|
1107
|
+
|
|
1108
|
+
vec3 p1 = worldStart + lineDir * params.x;
|
|
1109
|
+
vec3 p2 = rayEnd * params.y;
|
|
1110
|
+
vec3 delta = p1 - p2;
|
|
1111
|
+
float len = length( delta );
|
|
1112
|
+
float norm = len / linewidth;
|
|
1113
|
+
|
|
1114
|
+
#ifndef USE_DASH
|
|
1115
|
+
|
|
1116
|
+
#ifdef USE_ALPHA_TO_COVERAGE
|
|
1117
|
+
|
|
1118
|
+
float dnorm = fwidth( norm );
|
|
1119
|
+
alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );
|
|
1120
|
+
|
|
1121
|
+
#else
|
|
1122
|
+
|
|
1123
|
+
if ( norm > 0.5 ) {
|
|
1124
|
+
|
|
1125
|
+
discard;
|
|
1126
|
+
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
#endif
|
|
1130
|
+
|
|
1131
|
+
#endif
|
|
1132
|
+
|
|
1133
|
+
#else
|
|
1134
|
+
|
|
1135
|
+
#ifdef USE_ALPHA_TO_COVERAGE
|
|
1136
|
+
|
|
1137
|
+
// artifacts appear on some hardware if a derivative is taken within a conditional
|
|
1138
|
+
float a = vUv.x;
|
|
1139
|
+
float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
|
|
1140
|
+
float len2 = a * a + b * b;
|
|
1141
|
+
float dlen = fwidth( len2 );
|
|
1142
|
+
|
|
1143
|
+
if ( abs( vUv.y ) > 1.0 ) {
|
|
1144
|
+
|
|
1145
|
+
alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );
|
|
1146
|
+
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
#else
|
|
1150
|
+
|
|
1151
|
+
if ( abs( vUv.y ) > 1.0 ) {
|
|
1152
|
+
|
|
1153
|
+
float a = vUv.x;
|
|
1154
|
+
float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
|
|
1155
|
+
float len2 = a * a + b * b;
|
|
1156
|
+
|
|
1157
|
+
if ( len2 > 1.0 ) discard;
|
|
1158
|
+
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
#endif
|
|
1162
|
+
|
|
1163
|
+
#endif
|
|
1164
|
+
|
|
1165
|
+
vec4 diffuseColor = vec4( diffuse, alpha );
|
|
1166
|
+
|
|
1167
|
+
#include <logdepthbuf_fragment>
|
|
1168
|
+
#include <color_fragment>
|
|
1169
|
+
|
|
1170
|
+
gl_FragColor = vec4( diffuseColor.rgb, alpha );
|
|
1171
|
+
|
|
1172
|
+
#include <tonemapping_fragment>
|
|
1173
|
+
#include <colorspace_fragment>
|
|
1174
|
+
#include <fog_fragment>
|
|
1175
|
+
#include <premultiplied_alpha_fragment>
|
|
1176
|
+
|
|
1177
|
+
}
|
|
1178
|
+
`};class il extends WL{constructor(t){super({type:"LineMaterial",uniforms:H2.clone(yp.line.uniforms),vertexShader:yp.line.vertexShader,fragmentShader:yp.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(t)}get color(){return this.uniforms.diffuse.value}set color(t){this.uniforms.diffuse.value=t}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(t){t===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(t){this.uniforms.linewidth&&(this.uniforms.linewidth.value=t)}get dashed(){return"USE_DASH"in this.defines}set dashed(t){t===!0!==this.dashed&&(this.needsUpdate=!0),t===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(t){this.uniforms.dashScale.value=t}get dashSize(){return this.uniforms.dashSize.value}set dashSize(t){this.uniforms.dashSize.value=t}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(t){this.uniforms.dashOffset.value=t}get gapSize(){return this.uniforms.gapSize.value}set gapSize(t){this.uniforms.gapSize.value=t}get opacity(){return this.uniforms.opacity.value}set opacity(t){this.uniforms&&(this.uniforms.opacity.value=t)}get resolution(){return this.uniforms.resolution.value}set resolution(t){this.uniforms.resolution.value.copy(t)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(t){this.defines&&(t===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),t===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const jy=new Ru,I2=new nt,O2=new nt,Tn=new Ru,In=new Ru,ji=new Ru,ky=new nt,Cy=new Hx,Mn=new KL,N2=new nt,pp=new Vx,fp=new K2,ki=new Ru;let Oi,ns;function M2(e,t,n){return ki.set(0,0,-t,1).applyMatrix4(e.projectionMatrix),ki.multiplyScalar(1/ki.w),ki.x=ns/n.width,ki.y=ns/n.height,ki.applyMatrix4(e.projectionMatrixInverse),ki.multiplyScalar(1/ki.w),Math.abs(Math.max(ki.x,ki.y))}function hue(e,t){const n=e.matrixWorld,r=e.geometry,i=r.attributes.instanceStart,a=r.attributes.instanceEnd,s=Math.min(r.instanceCount,i.count);for(let l=0,c=s;l<c;l++){Mn.start.fromBufferAttribute(i,l),Mn.end.fromBufferAttribute(a,l),Mn.applyMatrix4(n);const u=new nt,p=new nt;Oi.distanceSqToSegment(Mn.start,Mn.end,p,u),p.distanceTo(u)<ns*.5&&t.push({point:p,pointOnLine:u,distance:Oi.origin.distanceTo(p),object:e,face:null,faceIndex:l,uv:null,uv1:null})}}function mue(e,t,n){const r=t.projectionMatrix,a=e.material.resolution,s=e.matrixWorld,l=e.geometry,c=l.attributes.instanceStart,u=l.attributes.instanceEnd,p=Math.min(l.instanceCount,c.count),d=-t.near;Oi.at(1,ji),ji.w=1,ji.applyMatrix4(t.matrixWorldInverse),ji.applyMatrix4(r),ji.multiplyScalar(1/ji.w),ji.x*=a.x/2,ji.y*=a.y/2,ji.z=0,ky.copy(ji),Cy.multiplyMatrices(t.matrixWorldInverse,s);for(let f=0,m=p;f<m;f++){if(Tn.fromBufferAttribute(c,f),In.fromBufferAttribute(u,f),Tn.w=1,In.w=1,Tn.applyMatrix4(Cy),In.applyMatrix4(Cy),Tn.z>d&&In.z>d)continue;if(Tn.z>d){const w=Tn.z-In.z,S=(Tn.z-d)/w;Tn.lerp(In,S)}else if(In.z>d){const w=In.z-Tn.z,S=(In.z-d)/w;In.lerp(Tn,S)}Tn.applyMatrix4(r),In.applyMatrix4(r),Tn.multiplyScalar(1/Tn.w),In.multiplyScalar(1/In.w),Tn.x*=a.x/2,Tn.y*=a.y/2,In.x*=a.x/2,In.y*=a.y/2,Mn.start.copy(Tn),Mn.start.z=0,Mn.end.copy(In),Mn.end.z=0;const v=Mn.closestPointToPointParameter(ky,!0);Mn.at(v,N2);const x=U2.lerp(Tn.z,In.z,v),y=x>=-1&&x<=1,b=ky.distanceTo(N2)<ns*.5;if(y&&b){Mn.start.fromBufferAttribute(c,f),Mn.end.fromBufferAttribute(u,f),Mn.start.applyMatrix4(s),Mn.end.applyMatrix4(s);const w=new nt,S=new nt;Oi.distanceSqToSegment(Mn.start,Mn.end,S,w),n.push({point:S,pointOnLine:w,distance:Oi.origin.distanceTo(S),object:e,face:null,faceIndex:f,uv:null,uv1:null})}}}class gue extends Da{constructor(t=new iL,n=new il({color:Math.random()*16777215})){super(t,n),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const t=this.geometry,n=t.attributes.instanceStart,r=t.attributes.instanceEnd,i=new Float32Array(2*n.count);for(let s=0,l=0,c=n.count;s<c;s++,l+=2)I2.fromBufferAttribute(n,s),O2.fromBufferAttribute(r,s),i[l]=l===0?0:i[l-1],i[l+1]=i[l]+I2.distanceTo(O2);const a=new Ey(i,2,1);return t.setAttribute("instanceDistanceStart",new Us(a,1,0)),t.setAttribute("instanceDistanceEnd",new Us(a,1,1)),this}raycast(t,n){const r=this.material.worldUnits,i=t.camera;i===null&&!r&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const a=t.params.Line2!==void 0&&t.params.Line2.threshold||0;Oi=t.ray;const s=this.matrixWorld,l=this.geometry,c=this.material;ns=c.linewidth+a,l.boundingSphere===null&&l.computeBoundingSphere(),fp.copy(l.boundingSphere).applyMatrix4(s);let u;if(r)u=ns*.5;else{const d=Math.max(i.near,fp.distanceToPoint(Oi.origin));u=M2(i,d,c.resolution)}if(fp.radius+=u,Oi.intersectsSphere(fp)===!1)return;l.boundingBox===null&&l.computeBoundingBox(),pp.copy(l.boundingBox).applyMatrix4(s);let p;if(r)p=ns*.5;else{const d=Math.max(i.near,pp.distanceToPoint(Oi.origin));p=M2(i,d,c.resolution)}pp.expandByScalar(p),Oi.intersectsBox(pp)!==!1&&(r?hue(this,n):mue(this,i,n))}onBeforeRender(t){const n=this.material.uniforms;n&&n.resolution&&(t.getViewport(jy),this.material.uniforms.resolution.value.set(jy.z,jy.w))}}class Wx extends iL{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(t){const n=t.length-3,r=new Float32Array(2*n);for(let i=0;i<n;i+=3)r[2*i]=t[i],r[2*i+1]=t[i+1],r[2*i+2]=t[i+2],r[2*i+3]=t[i+3],r[2*i+4]=t[i+4],r[2*i+5]=t[i+5];return super.setPositions(r),this}setColors(t){const n=t.length-3,r=new Float32Array(2*n);for(let i=0;i<n;i+=3)r[2*i]=t[i],r[2*i+1]=t[i+1],r[2*i+2]=t[i+2],r[2*i+3]=t[i+3],r[2*i+4]=t[i+4],r[2*i+5]=t[i+5];return super.setColors(r),this}fromLine(t){const n=t.geometry;return this.setPositions(n.attributes.position.array),this}}class hp extends gue{constructor(t=new Wx,n=new il({color:Math.random()*16777215})){super(t,n),this.isLine2=!0,this.type="Line2"}}const yue=864e5,vue=1e6,Cc=[0,1,7,30,365],xue=[32,48,48,32],Pc=(()=>{const e=[0];let t=0;for(const n of xue)t+=n,e.push(t);return e})(),Ei=new nt(0,0,0);function Kx(e){if(!Number.isFinite(e)||e<=0)return 0;for(let t=1;t<Cc.length;t++)if(e<=Cc[t]){const n=(e-Cc[t-1])/(Cc[t]-Cc[t-1]);return Pc[t-1]+(Pc[t]-Pc[t-1])*n}return Pc[Pc.length-1]}const yh=.7,aL=4,Qc=10;function bue(e){return Math.min((e||0)/100,1)}function _2(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return Math.abs(t)}function wue(e){const t=Math.max(0,e|0);return t<=0?0:Math.max(0,Math.min(1,Math.log10(t+1)/Math.log10(vue+1)))}const R2=[9,9,18,36,72,144],D2=[0,1e4,1e5,1e6,1e7,1e8,1e9];function Sue(){const e=[[D2[0],0]];let t=0;for(let n=0;n<R2.length;n++)t+=R2[n],e.push([D2[n+1],t]);return e}const $s=Sue(),Py=[[1e4,_o(1e4)],[1e5,_o(1e5)],[1e6,_o(1e6)],[1e7,_o(1e7)],[1e8,_o(1e8)],[1e9,_o(1e9)]];function _o(e){const t=Math.max(0,e|0);if(t<=0)return 0;for(let n=1;n<$s.length;n++)if(t<=$s[n][0]){const[r,i]=$s[n-1],[a,s]=$s[n],l=(t-r)/(a-r);return i+(s-i)*l}return $s[$s.length-1][1]}function jue(e){return _o(e)}function kue(e){return e>=1e9?`${e/1e9}B`:e>=1e6?`${e/1e6}M`:e>=1e3?`${e/1e3}k`:`${e}`}function Cue(e){const t=bue(e),n=Math.max(0,Math.min(Qc-1,Math.round(t*(Qc-1))));return{radius:yh+(aL-yh)*(n/(Qc-1)),bucket:n}}function Pue(e,t){const n=t-e.firstRequestAt,r=Number.isFinite(n)&&n>0?n/yue:0,i=(_2(e.sessionId)%360+(_2(e.sessionId+"~j")%40-20))*(Math.PI/180),a=Kx(r),s=Math.cos(i)*a,l=Math.sin(i)*a,c=wue(e.totalTokens),u=jue(e.totalTokens),p=new nt(s,u,l);let d=null;const f=e.inputTokens|0,m=e.outputTokens|0;if(f>0&&m>0){const y=Math.min(f/(f+m),.85);d=new nt(Ei.x+(p.x-Ei.x)*y,Ei.y+(p.y-Ei.y)*y,Ei.z+(p.z-Ei.z)*y)}const{radius:g,bucket:v}=Cue(e.requestCount);return{pos:p,radius:g,bucket:v,depth01:c,split:d}}const Aue='<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Claude Code</title><path clip-rule="evenodd" d="M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z" fill="#D97757" fill-rule="evenodd"></path></svg>',Eue=`<svg height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Codex</title><path clip-rule="evenodd" d="M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z" fill="url(#codex-gradient)" fill-rule="evenodd"></path><defs><linearGradient gradientUnits="userSpaceOnUse" id="codex-gradient" x1="12" x2="12" y1="3" y2="21"><stop stop-color="#B1A7FF"></stop><stop offset=".5" stop-color="#7A9DFF"></stop><stop offset="1" stop-color="#3941FF"></stop></linearGradient></defs></svg>
|
|
1179
|
+
`,L2=new nt(0,60,60),Ay=new nt(0,28,0),mp=new nt(0,.82,.58).normalize(),z2=.32,$2=54784;function Tue(e){const n=new cz(1,1,12,12),r=n.attributes.position,i=Math.abs(mp.y)<.9?new nt(0,1,0):new nt(0,0,1),a=new nt().crossVectors(mp,i).normalize(),s=new nt().crossVectors(mp,a).normalize(),l=new Zc,c=new Zc,u=new nt;for(let p=0;p<r.count;p++){const d=r.getX(p)*2*z2,f=r.getY(p)*2*z2;l.setFromAxisAngle(a,d),c.setFromAxisAngle(s,f),u.copy(mp).applyQuaternion(l).applyQuaternion(c).normalize();const m=e*1.003;r.setXYZ(p,u.x*m,u.y*m,u.z*m)}return r.needsUpdate=!0,n.computeVertexNormals(),n}const gp={active:"--accent-primary",idle:"--accent-warning",completed:"--border-secondary",error:"--accent-danger"};class Iue{constructor(t,n){$e(this,"container");$e(this,"cb");$e(this,"renderer");$e(this,"css2d");$e(this,"scene");$e(this,"camera");$e(this,"controls");$e(this,"raycaster",new HL);$e(this,"pointer",new _n);$e(this,"clock",new VL);$e(this,"nodes",new Map);$e(this,"links",new Map);$e(this,"pickables",[]);$e(this,"sphereGeoms",[]);$e(this,"glowGeoms",[]);$e(this,"decalGeoms",[]);$e(this,"ringPivot");$e(this,"ringMesh");$e(this,"ringMat");$e(this,"floor");$e(this,"floorRings",[]);$e(this,"apexMat");$e(this,"apexMesh");$e(this,"axisMat");$e(this,"axisLine");$e(this,"axisLabels",[]);$e(this,"ringLabels",[]);$e(this,"palette");$e(this,"completedNodeColor");$e(this,"bgColor");$e(this,"logoTexCache",new Map);$e(this,"logoImg",{});$e(this,"selectedId",null);$e(this,"showAllLabels",!1);$e(this,"showLinks",!1);$e(this,"focusTarget",null);$e(this,"rafId",0);$e(this,"running",!1);$e(this,"disposed",!1);$e(this,"downClient",{x:0,y:0});$e(this,"downCamPos",new nt);$e(this,"downCamQuat",new Zc);$e(this,"pointerDownTime",0);$e(this,"ro");$e(this,"mo");$e(this,"probeEl");$e(this,"onPointerDown",t=>{this.downClient={x:t.clientX,y:t.clientY},this.downCamPos.copy(this.camera.position),this.downCamQuat.copy(this.camera.quaternion),this.pointerDownTime=performance.now()});$e(this,"onPointerUp",t=>{const n=Math.hypot(t.clientX-this.downClient.x,t.clientY-this.downClient.y),r=this.camera.position.distanceTo(this.downCamPos)>1e-4||Math.abs(this.camera.quaternion.dot(this.downCamQuat))<.9995,i=performance.now()-this.pointerDownTime;if(n>5||r||i>350)return;const a=this.renderer.domElement.getBoundingClientRect();this.pointer.x=(t.clientX-a.left)/a.width*2-1,this.pointer.y=-((t.clientY-a.top)/a.height)*2+1,this.raycaster.setFromCamera(this.pointer,this.camera);const s=this.raycaster.intersectObjects(this.pickables,!1);if(s.length>0){const l=s[0].object,c=this.findByMesh(l);this.cb.onSelect(c?c.sessionId:null)}else this.cb.onSelect(null)});$e(this,"onContextLost",t=>{var n,r;t.preventDefault(),this.running=!1,cancelAnimationFrame(this.rafId),(r=(n=this.cb).onContextLost)==null||r.call(n)});$e(this,"onVisibility",()=>{document.hidden?(this.running=!1,cancelAnimationFrame(this.rafId)):!this.disposed&&!this.running&&(this.running=!0,this.clock.getDelta(),this.loop())});$e(this,"loop",()=>{if(!this.running||this.disposed)return;this.rafId=requestAnimationFrame(this.loop);const t=Math.min(this.clock.getDelta(),.05),n=this.clock.elapsedTime,r=1-Math.exp(-t*6);for(const i of this.nodes.values())i.group.position.lerp(i.targetPos,r),i.glow.visible&&(i.glowMat.opacity=(.4+Math.sin(n*2)*.2)*.5,i.glow.scale.setScalar(1+Math.sin(n*2)*.05)),i.inFlight>0?i.sphere.scale.setScalar(1+Math.sin(n*6)*.05):i.sphere.scale.x!==1&&i.sphere.scale.setScalar(1);if(this.selectedId&&this.ringPivot.visible){const i=this.nodes.get(this.selectedId);i?(this.ringPivot.position.copy(i.group.position),this.ringPivot.rotation.y+=t*.8):this.ringPivot.visible=!1}this.focusTarget&&(this.camera.position.lerp(this.focusTarget.cam,1-Math.exp(-t*3)),this.controls.target.lerp(this.focusTarget.look,1-Math.exp(-t*3)),this.camera.position.distanceTo(this.focusTarget.cam)<.1&&(this.focusTarget=null)),this.controls.update(),this.renderer.render(this.scene,this.camera),this.css2d.render(this.scene,this.camera)});this.container=t,this.cb=n,this.probeEl=document.createElement("div"),this.probeEl.style.position="absolute",this.probeEl.style.visibility="hidden",this.probeEl.style.pointerEvents="none";try{this.build()}catch(r){throw this.dispose(),r}}build(){const t=this.container.clientWidth||800,n=this.container.clientHeight||600;this.renderer=new qL({antialias:!0,alpha:!0,powerPreference:"high-performance"}),this.renderer.setPixelRatio(Math.min(window.devicePixelRatio,2)),this.renderer.setSize(t,n),this.renderer.setClearColor(0,0),this.renderer.toneMapping=YL,this.renderer.toneMappingExposure=1.05,this.renderer.outputColorSpace=zw,this.renderer.domElement.style.position="absolute",this.renderer.domElement.style.inset="0",this.renderer.domElement.style.width="100%",this.renderer.domElement.style.height="100%",this.renderer.domElement.style.display="block",this.renderer.domElement.style.cursor="grab",this.container.appendChild(this.renderer.domElement),this.renderer.domElement.addEventListener("webglcontextlost",this.onContextLost,!1),this.css2d=new fue,this.css2d.setSize(t,n);const r=this.css2d.domElement;r.style.position="absolute",r.style.inset="0",r.style.width="100%",r.style.height="100%",r.style.pointerEvents="none",this.container.appendChild(r),this.scene=new GL,this.refreshPalette(),this.scene.background=null,this.scene.fog=new XL(this.bgColor.getHex(),250,3e3),this.camera=new QL(50,t/n,.1,3e4),this.camera.position.copy(L2),this.camera.lookAt(Ay);const i=new ZL(16777215,.85);this.scene.add(i);const a=new JL(16777215,1);a.position.set(150,500,200),this.scene.add(a);const s=new ez(16767392,.6,2e3,1.2);s.position.set(0,150,0),this.scene.add(s),this.controls=new pue(this.camera,this.renderer.domElement),this.controls.target.copy(Ay),this.controls.enableDamping=!0,this.controls.dampingFactor=.08,this.controls.rotateSpeed=.7,this.controls.zoomSpeed=.9,this.controls.panSpeed=.8,this.controls.minDistance=6,this.controls.maxDistance=6e3,this.controls.maxPolarAngle=Math.PI*.49,this.controls.addEventListener("start",()=>{this.focusTarget=null,this.renderer.domElement.style.cursor="grabbing"}),this.controls.addEventListener("end",()=>{this.renderer.domElement.style.cursor="grab"});for(let p=0;p<Qc;p++){const d=this.bucketRadius(p);this.sphereGeoms.push(new $w(d,32,24)),this.glowGeoms.push(new $w(d*1.55,24,16)),this.decalGeoms.push(Tue(d))}const l=Kx(365)+14;this.floor=new Da(new Bw(l,96),new Ts({color:this.palette.completed,transparent:!0,opacity:.05,side:rc})),this.floor.rotation.x=-Math.PI/2,this.scene.add(this.floor);const c=[1,7,30,365];for(const p of c){const d=Kx(p),f=new Ts({color:this.palette.completed,transparent:!0,opacity:.2,side:rc}),m=new Da(new tz(d-1,d+1,128),f);m.rotation.x=-Math.PI/2,m.position.y=.01,this.scene.add(m),this.floorRings.push({mesh:m,mat:f});const g=document.createElement("div");g.className="am-axis-label",g.style.pointerEvents="none",g.textContent=p>=365?"1年":`${p} 天`;const v=new Sy(g);v.position.set(d,.6,0),this.scene.add(v),this.ringLabels.push(v)}this.apexMat=new Ts({color:this.palette.completed,side:rc}),this.apexMesh=new Da(new Bw(.7,32),this.apexMat),this.apexMesh.rotation.x=-Math.PI/2,this.apexMesh.position.set(0,.02,0),this.scene.add(this.apexMesh),this.ringMat=new Ts({color:this.palette.active.clone(),transparent:!0,opacity:.85,side:rc}),this.ringMesh=new Da(new nz(1,.05,12,80),this.ringMat),this.ringMesh.rotation.x=Math.PI*.42,this.ringPivot=new W2,this.ringPivot.add(this.ringMesh),this.ringPivot.visible=!1,this.scene.add(this.ringPivot),this.buildAxis(t,n);const u=this.renderer.domElement;u.addEventListener("pointerdown",this.onPointerDown),u.addEventListener("pointerup",this.onPointerUp),this.ro=new ResizeObserver(()=>this.resize()),this.ro.observe(this.container),this.mo=new MutationObserver(()=>this.refreshTheme()),this.mo.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),document.addEventListener("visibilitychange",this.onVisibility),this.running=!0,this.clock.start(),this.loop()}bucketRadius(t){return yh+(aL-yh)*(t/(Qc-1))}getDecalTex(t){const n=this.logoTexCache.get(t);if(n)return n;const r=256,i=document.createElement("canvas");i.width=i.height=r;const a=i.getContext("2d");a.imageSmoothingEnabled=!0,a.imageSmoothingQuality="high";const s=new rz(i);s.colorSpace=zw,s.generateMipmaps=!0,s.minFilter=iz,s.magFilter=az,s.anisotropy=8,this.logoTexCache.set(t,s);const c=Math.round(r*.8),u=(r-c)/2;return this.ensureLogoImg(t).then(p=>{a.drawImage(p,u,u,c,c),s.needsUpdate=!0}),s}applyDecalTint(t,n){n==="completed"?(t.opacity=.32,t.color.set(10133670)):n==="idle"?(t.opacity=.8,t.color.set(16777215)):(t.opacity=1,t.color.set(16777215))}applyNodeAppearance(t){const n=t.sessionId===this.selectedId,r=t.status==="completed";n?(t.sphereMat.wireframe=!1,t.sphereMat.transparent=!1,t.sphereMat.opacity=1,t.decalMat.opacity=1,t.decalMat.color.set(16777215)):(t.sphereMat.transparent=r,t.sphereMat.opacity=r?.7:1,t.sphereMat.wireframe=r,this.applyDecalTint(t.decalMat,t.status))}ensureLogoImg(t){const n=this.logoImg[t];if(n&&n.complete)return Promise.resolve(n);const i=(t==="codex"?Eue:Aue).replace(/width="[^"]*"/,'width="512"').replace(/height="[^"]*"/,'height="512"'),a="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(i),s=n||new Image;s.crossOrigin="anonymous";const l=new Promise(c=>{s.onload=()=>{this.logoImg[t]=s,c(s)},s.onerror=()=>c(s)});return s.src=a,l}buildAxis(t,n){const r=Py[Py.length-1][1]+6;this.axisMat=new il({color:this.palette.completed.getHex(),linewidth:2,transparent:!0,opacity:.5,dashed:!0,dashScale:1,dashSize:.4,gapSize:.25}),this.axisMat.resolution=new _n(t,n);const i=new Wx;i.setPositions([0,0,0,0,r,0]),this.axisLine=new hp(i,this.axisMat),this.axisLine.computeLineDistances(),this.scene.add(this.axisLine);for(const[a,s]of Py){const l=document.createElement("div");l.className="am-axis-label",l.style.pointerEvents="none",l.textContent=kue(a);const c=new Sy(l);c.position.set(.6,s,0),this.scene.add(c),this.axisLabels.push(c)}}refreshPalette(){this.palette={active:this.resolveColor(gp.active),idle:this.resolveColor(gp.idle),completed:this.resolveColor(gp.completed),error:this.resolveColor(gp.error)},this.bgColor=this.resolveColor("--bg-primary-solid"),this.completedNodeColor=new Fw(document.documentElement.getAttribute("data-theme")==="dark"?"#4ADE80":"#86EFAC")}resolveColor(t){this.probeEl.parentElement||document.body.appendChild(this.probeEl),this.probeEl.style.color=`var(${t})`;const n=getComputedStyle(this.probeEl).color||"rgb(128,128,128)";return new Fw(n)}refreshTheme(){this.refreshPalette(),this.scene.fog&&this.scene.fog.color.copy(this.bgColor);for(const t of this.nodes.values()){const n=t.status==="completed";t.sphereMat.color.copy(n?this.completedNodeColor:this.palette[t.status]),t.glowMat.color.copy(this.palette[t.status])}for(const t of this.links.values())t.bgMat.color.copy(this.palette.active),t.segInMat.color.copy(this.palette.active),t.segOutMat.color.setHex($2);this.floor.material.color.copy(this.palette.completed);for(const t of this.floorRings)t.mat.color.copy(this.palette.completed);if(this.apexMat.color.copy(this.palette.completed),this.selectedId){const t=this.nodes.get(this.selectedId);t&&this.ringMat.color.copy(t.status==="completed"?this.completedNodeColor:this.palette[t.status])}this.axisMat&&this.axisMat.color.copy(this.palette.completed)}update(t,n){if(this.disposed)return;const r=new Set(t.map(i=>i.sessionId));for(const i of t){const a=Pue(i,n),s=this.nodes.get(i.sessionId);s?this.updateNode(s,i,a):this.createNode(i,a);const l=this.links.get(i.sessionId);l?this.updateLink(l,a):this.createLink(i.sessionId,a)}for(const[i,a]of[...this.nodes.entries()])if(!r.has(i)){this.disposeNode(a),this.nodes.delete(i);const s=this.links.get(i);s&&(this.disposeLink(s),this.links.delete(i))}this.selectedId&&!this.nodes.has(this.selectedId)&&this.applySelection(null),this.refreshPickables()}createNode(t,n){const r=new Uw;r.position.copy(n.pos);const i=this.sphereGeoms[n.bucket],a=t.status==="completed",s=new oz({color:(a?this.completedNodeColor:this.palette[t.status]).clone(),roughness:.5,metalness:.1,transparent:a,opacity:a?.7:1,wireframe:a}),l=new Da(i,s);r.add(l);const c=new Ts({color:this.palette[t.status].clone(),transparent:!0,opacity:0,side:lz,depthWrite:!1,blending:sz}),u=new Da(this.glowGeoms[n.bucket],c);u.visible=t.status==="active",r.add(u);const p=new Ts({map:this.getDecalTex(t.agent),transparent:!0,depthWrite:!1,side:rc});this.applyDecalTint(p,t.status);const d=new Da(this.decalGeoms[n.bucket],p);l.add(d);const f=t.sessionId,m=document.createElement("div");m.className="am-node-label";const g=this.showAllLabels?"auto":"none";m.style.pointerEvents=g,m.style.cursor=g==="auto"?"pointer":"default",m.addEventListener("click",w=>{w.stopPropagation(),this.cb.onSelect(f)});const v=document.createElement("div");v.className="am-node-label-title";const x=document.createElement("div");x.className="am-node-label-sub",m.appendChild(v),m.appendChild(x);const y=new Sy(m);y.position.set(0,-n.radius*1.8,0),r.add(y),this.scene.add(r);const b={sessionId:t.sessionId,group:r,sphere:l,sphereMat:s,glow:u,glowMat:c,decal:d,decalMat:p,labelEl:m,label:y,targetPos:n.pos.clone(),status:t.status,radius:n.radius,bucket:n.bucket,depth01:n.depth01,inFlight:t.inFlight|0,split:n.split?n.split.clone():null};this.nodes.set(t.sessionId,b),this.writeLabel(b,t),this.syncLabel(b),this.applyNodeAppearance(b)}updateNode(t,n,r){if(t.targetPos.copy(r.pos),t.depth01=r.depth01,t.inFlight=n.inFlight|0,t.split=r.split?r.split.clone():null,r.bucket!==t.bucket&&(t.bucket=r.bucket,t.radius=r.radius,t.sphere.geometry=this.sphereGeoms[r.bucket],t.glow.geometry=this.glowGeoms[r.bucket],t.decal.geometry=this.decalGeoms[r.bucket],t.label.position.set(0,-r.radius*1.8,0),this.selectedId===t.sessionId&&this.ringMesh.scale.setScalar(r.radius*1.8)),n.status!==t.status){t.status=n.status;const a=n.status==="completed"?this.completedNodeColor:this.palette[n.status];t.sphereMat.color.copy(a),t.glowMat.color.copy(this.palette[n.status]),t.glow.visible=n.status==="active",this.applyNodeAppearance(t),t.sessionId===this.selectedId&&this.showRing(t)}this.writeLabel(t,n),this.syncLabel(t)}writeLabel(t,n){const r=t.labelEl.firstChild,i=t.labelEl.lastChild;r.textContent=(n.title||n.sessionId.slice(-8)).slice(0,20);const a=[];n.totalTokens>0&&a.push(`${this.formatTokens(n.totalTokens)} tok`),n.lastToolName&&a.push(n.lastToolName),n.source==="access-key"&&n.keyName&&a.push(`🔑 ${n.keyName}`),i.textContent=a.join(" · ")}syncLabel(t){t.label.visible=this.showAllLabels||t.sessionId===this.selectedId}setLabelsVisible(t){if(this.showAllLabels===t)return;this.showAllLabels=t;const n=t?"auto":"none";for(const r of this.nodes.values())r.labelEl.style.pointerEvents=n,r.labelEl.style.cursor=n==="auto"?"pointer":"default",this.syncLabel(r)}formatTokens(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(t>=1e4?0:1)}k`:`${t}`}createLink(t,n){const r=new Uw,i=this.container.clientWidth||800,a=this.container.clientHeight||600,s=new _n(i,a),l=!!n.split,c=new il({color:this.palette.active.getHex(),linewidth:3,transparent:!0,opacity:.85+n.depth01*.15,dashed:!1});c.resolution=s;const u=new hp(this.makeLineGeo(Ei,n.pos),c),p=new il({color:this.palette.active.getHex(),linewidth:3,transparent:!0,opacity:.95});p.resolution=s;const d=new il({color:$2,linewidth:3,transparent:!0,opacity:.95});d.resolution=s;const f=n.split??n.pos,m=new hp(this.makeLineGeo(Ei,f),p),g=new hp(this.makeLineGeo(f,n.pos),d);u.visible=!l,m.visible=l,g.visible=l,r.add(u,m,g),r.visible=this.linkVisible(t),this.scene.add(r),this.links.set(t,{group:r,bg:u,bgMat:c,segIn:m,segInMat:p,segOut:g,segOutMat:d})}linkVisible(t){return this.showLinks||t===this.selectedId}setLinksVisible(t){if(this.showLinks!==t){this.showLinks=t;for(const[n,r]of this.links)r.group.visible=this.linkVisible(n)}}updateLink(t,n){const r=!!n.split,i=n.split??n.pos;this.setLineGeo(t.bg.geometry,Ei,n.pos),t.bgMat.opacity=.85+n.depth01*.15,this.setLineGeo(t.segIn.geometry,Ei,i),this.setLineGeo(t.segOut.geometry,i,n.pos),t.bg.visible=!r,t.segIn.visible=r,t.segOut.visible=r}makeLineGeo(t,n){const r=new Wx;return r.setPositions([t.x,t.y,t.z,n.x,n.y,n.z]),r}setLineGeo(t,n,r){t.setPositions([n.x,n.y,n.z,r.x,r.y,r.z])}setSelected(t){this.selectedId!==t&&this.applySelection(t)}showRing(t){this.ringMat.color.copy(t.status==="completed"?this.completedNodeColor:this.palette[t.status]),this.ringMesh.scale.setScalar(t.radius*1.8),this.ringPivot.visible=!0}applySelection(t){const n=this.selectedId;if(this.selectedId=t,n){const a=this.nodes.get(n);a&&(this.applyNodeAppearance(a),this.syncLabel(a));const s=this.links.get(n);s&&(s.group.visible=this.linkVisible(n))}if(!t){this.ringPivot.visible=!1;return}const r=this.nodes.get(t);if(!r){this.ringPivot.visible=!1;return}const i=this.links.get(t);i&&(i.group.visible=this.linkVisible(t)),this.applyNodeAppearance(r),this.syncLabel(r),this.showRing(r)}focusSession(t){const n=this.nodes.get(t);if(!n)return;this.applySelection(t);const r=new nt(0,4,14);this.focusTarget={cam:n.targetPos.clone().add(r),look:n.targetPos.clone()}}resetCamera(){this.focusTarget={cam:L2.clone(),look:Ay.clone()}}refreshPickables(){this.pickables=[];for(const t of this.nodes.values())this.pickables.push(t.sphere)}findByMesh(t){for(const n of this.nodes.values())if(n.sphere===t)return n;return null}resize(){if(this.disposed)return;const t=this.container.clientWidth||800,n=this.container.clientHeight||600;this.camera.aspect=t/n,this.camera.updateProjectionMatrix(),this.renderer.setSize(t,n),this.css2d.setSize(t,n);const r=new _n(t,n);for(const i of this.links.values())i.bgMat.resolution=r,i.segInMat.resolution=r,i.segOutMat.resolution=r;this.axisMat&&(this.axisMat.resolution=r)}dispose(){var r,i,a,s,l,c,u,p;if(this.disposed)return;this.disposed=!0,this.running=!1,cancelAnimationFrame(this.rafId),document.removeEventListener("visibilitychange",this.onVisibility),(r=this.ro)==null||r.disconnect(),(i=this.mo)==null||i.disconnect();const t=(a=this.renderer)==null?void 0:a.domElement;t&&(t.removeEventListener("pointerdown",this.onPointerDown),t.removeEventListener("pointerup",this.onPointerUp),t.removeEventListener("webglcontextlost",this.onContextLost));for(const d of[...this.nodes.values()])this.disposeNode(d);this.nodes.clear();for(const d of[...this.links.values()])this.disposeLink(d);this.links.clear();for(const d of this.sphereGeoms)d.dispose();for(const d of this.glowGeoms)d.dispose();for(const d of this.decalGeoms)d.dispose();this.ringMesh.geometry.dispose(),this.ringMat.dispose(),this.floor.geometry.dispose(),this.floor.material.dispose();for(const d of this.floorRings)d.mesh.geometry.dispose(),d.mat.dispose();this.apexMesh.geometry.dispose(),this.apexMat.dispose(),this.axisLine&&(this.axisLine.geometry.dispose(),this.axisMat.dispose());for(const d of this.axisLabels)d.element.remove(),d.removeFromParent();this.axisLabels=[],(s=this.controls)==null||s.dispose();for(const d of this.logoTexCache.values())d.dispose();this.logoTexCache.clear(),(l=this.renderer)==null||l.dispose(),t!=null&&t.parentElement&&t.parentElement.removeChild(t);const n=(c=this.css2d)==null?void 0:c.domElement;n!=null&&n.parentElement&&n.parentElement.removeChild(n),this.probeEl.parentElement&&this.probeEl.parentElement.removeChild(this.probeEl),(p=(u=this.renderer)==null?void 0:u.forceContextLoss)==null||p.call(u)}disposeNode(t){this.scene.remove(t.group),t.sphereMat.dispose(),t.glowMat.dispose(),t.decalMat.dispose(),t.labelEl.remove(),t.label.removeFromParent()}disposeLink(t){this.scene.remove(t.group),t.bg.geometry.dispose(),t.segIn.geometry.dispose(),t.segOut.geometry.dispose(),t.bgMat.dispose(),t.segInMat.dispose(),t.segOutMat.dispose()}}function Oue({sessions:e,now:t,selectedId:n,onSelect:r,showLabels:i,showLinks:a,focus:s,resetNonce:l,onContextLost:c}){const u=h.useRef(null),p=h.useRef(null);return h.useEffect(()=>{if(!u.current)return;let d;try{d=new Iue(u.current,{onSelect:r,onContextLost:c})}catch{c();return}return p.current=d,()=>{d.dispose(),p.current=null}},[]),h.useEffect(()=>{var d;(d=p.current)==null||d.update(e,t)},[e,t]),h.useEffect(()=>{var d;(d=p.current)==null||d.setSelected(n)},[n]),h.useEffect(()=>{var d;(d=p.current)==null||d.setLabelsVisible(i)},[i]),h.useEffect(()=>{var d;(d=p.current)==null||d.setLinksVisible(a)},[a]),h.useEffect(()=>{var d;s&&((d=p.current)==null||d.focusSession(s.sessionId))},[s==null?void 0:s.nonce]),h.useEffect(()=>{var d;l!==0&&((d=p.current)==null||d.resetCamera())},[l]),o.jsx("div",{ref:u,className:"am-canvas am-canvas-3d"})}const Nue={active:"进行中",idle:"空闲",completed:"已完成",error:"异常"},B2=[{key:"all",label:"全部",ms:0},{key:"1h",label:"近 1 小时",ms:Xc},{key:"6h",label:"近 6 小时",ms:6*Xc},{key:"24h",label:"近 24 小时",ms:24*Xc},{key:"7d",label:"近 7 天",ms:7*gw}];function F2(e,t){const n=new Date(e);return t<=gw?`${n.getHours().toString().padStart(2,"0")}:00`:`${n.getMonth()+1}/${n.getDate()}`}function Mue(e){if(e.length===0)return"";if(e.length===1)return`M ${e[0].x} ${e[0].y}`;const t=[`M ${e[0].x} ${e[0].y}`];for(let n=0;n<e.length-1;n++){const r=e[n-1]||e[n],i=e[n],a=e[n+1],s=e[n+2]||a,l=i.x+(a.x-r.x)/6,c=i.y+(a.y-r.y)/6,u=a.x-(s.x-i.x)/6,p=a.y-(s.y-i.y)/6;t.push(`C ${l.toFixed(2)} ${c.toFixed(2)}, ${u.toFixed(2)} ${p.toFixed(2)}, ${a.x.toFixed(2)} ${a.y.toFixed(2)}`)}return t.join(" ")}function _ue({sessions:e,start:t,end:n}){const s=h.useMemo(()=>{const m=Math.max(1,n-t),g=Math.max(1,Math.min(96,Math.round(m/Xc))),v=new Array(g).fill(0);for(const x of e){const y=x.lastRequestAt;if(y<t||y>n)continue;let b=Math.floor((y-t)/(m/g));b<0&&(b=0),b>=g&&(b=g-1),v[b]++}return v},[e,t,n]),l=Math.max(1,...s),c=s.reduce((m,g)=>m+g,0),u=n-t,p=s.map((m,g)=>({x:s.length===1?220/2:g/(s.length-1)*218+1,y:41-m/l*(44-2*3)})),d=Mue(p),f=p.length>0?`${d} L ${p[p.length-1].x.toFixed(2)} 44 L ${p[0].x.toFixed(2)} 44 Z`:"";return o.jsxs("div",{className:"am-trend",title:`区间内会话最后活动分布:共 ${c} 个会话(按小时统计)`,children:[o.jsx("span",{className:"am-trend-label",children:"会话趋势"}),o.jsxs("svg",{className:"am-trend-svg",viewBox:"0 0 220 44",preserveAspectRatio:"none",children:[o.jsx("defs",{children:o.jsxs("linearGradient",{id:"am-trend-grad",x1:"0",y1:"0",x2:"0",y2:"1",children:[o.jsx("stop",{offset:"0%",stopColor:"var(--accent-primary)",stopOpacity:"0.35"}),o.jsx("stop",{offset:"100%",stopColor:"var(--accent-primary)",stopOpacity:"0.02"})]})}),f&&o.jsx("path",{d:f,fill:"url(#am-trend-grad)",stroke:"none"}),d&&o.jsx("path",{d,fill:"none",stroke:"var(--accent-primary)",strokeWidth:"1.5",vectorEffect:"non-scaling-stroke",strokeLinecap:"round",strokeLinejoin:"round"})]}),o.jsxs("span",{className:"am-trend-axis",children:[F2(t,u)," – ",F2(n,u)]})]})}function Rue({events:e}){if(e.length===0)return o.jsx("div",{className:"am-empty",children:"暂无活动记录(发起一次请求后会出现)"});const t=[...e].sort((r,i)=>i.ts-r.ts),n=[];for(const r of t){const i=`${r.kind}|${r.toolName||""}|${r.summary||""}`,a=n[n.length-1];if(a&&a.key===i){a.count+=1;continue}n.push({key:i,kind:r.kind,toolName:r.toolName,summary:r.summary||r.kind,count:1,ts:r.ts})}return o.jsx("div",{className:"am-path",children:n.map((r,i)=>{const a=r.kind==="prompt"?"💬":r.kind==="thinking"?"💭":r.kind==="error"?"⚠️":r.kind==="cancelled"?"🚫":r.kind==="response"?"💬":yw[r.toolName||""]||"•";return o.jsxs("div",{className:`am-path-item am-path-item--${r.kind}`,children:[o.jsxs("div",{className:"am-path-rail",children:[o.jsx("div",{className:"am-path-dot"}),i<n.length-1&&o.jsx("div",{className:"am-path-line"})]}),o.jsxs("div",{className:"am-path-body",children:[o.jsxs("div",{className:"am-path-head",children:[o.jsx("span",{className:"am-path-icon",children:a}),o.jsx("span",{className:"am-path-summary",children:r.summary}),o.jsx("span",{className:"am-path-time",children:new Date(r.ts).toLocaleTimeString()}),r.count>1&&o.jsxs("span",{className:"am-path-count",children:["×",r.count]})]}),r.kind==="prompt"&&o.jsx("div",{className:"am-path-prompt",children:r.summary})]})]},r.key+i)})})}function Due({events:e,onSelectSession:t}){return e.length===0?o.jsx("div",{className:"am-feed-empty",children:"等待实时活动…"}):o.jsx("div",{className:"am-feed",children:e.slice(0,80).map(n=>o.jsxs("div",{className:`am-feed-row am-feed-row--${n.kind}${t?" am-feed-row--clickable":""}`,onClick:t?()=>t(n.sessionId):void 0,title:t?"点击定位到地图节点并展开详情":void 0,children:[o.jsx("span",{className:"am-feed-time",children:new Date(n.ts).toLocaleTimeString()}),o.jsx(JD,{agent:n.agent,size:13,className:"am-feed-agent"}),o.jsx("span",{className:"am-feed-icon",children:n.kind==="prompt"?"💬":n.kind==="error"?"⚠️":n.kind==="cancelled"?"🚫":yw[n.toolName||""]||"•"}),o.jsx("span",{className:"am-feed-summary",children:n.summary})]},n.id))})}function yt({icon:e,label:t,desc:n}){return o.jsxs("div",{className:"am-legend-row",children:[o.jsx("span",{className:"am-legend-ic",children:e}),o.jsxs("span",{className:"am-legend-text",children:[o.jsx("span",{className:"am-legend-label",children:t}),o.jsx("span",{className:"am-legend-desc",children:n})]})]})}function Ra({title:e,children:t}){return o.jsxs("div",{className:"am-legend-group",children:[o.jsx("div",{className:"am-legend-group-title",children:e}),t]})}function Lue({onClose:e}){return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"am-popover-overlay",onClick:e}),o.jsxs("div",{className:"am-popover am-popover--wide",children:[o.jsxs("div",{className:"am-popover-head",children:[o.jsx("span",{children:"🗺️ 地图符号说明"}),o.jsx("button",{className:"am-popover-close",onClick:e,"aria-label":"关闭",children:"×"})]}),o.jsxs("div",{className:"am-popover-body am-legend-grid",children:[o.jsxs("div",{className:"am-legend-col",children:[o.jsxs(Ra,{title:"客户端类型(节点中心图标)",children:[o.jsx(yt,{icon:o.jsx(hw,{size:16}),label:"Claude Code",desc:"该 Session 来自 Claude Code 客户端"}),o.jsx(yt,{icon:o.jsx(mw,{size:16}),label:"Codex",desc:"该 Session 来自 Codex 客户端"})]}),o.jsxs(Ra,{title:"节点状态(颜色 + 光晕)",children:[o.jsx(yt,{icon:o.jsx("i",{className:"am-dot am-dot--active"}),label:"进行中",desc:"最近 60 秒内有请求,或有在途请求(脉冲发光)"}),o.jsx(yt,{icon:o.jsx("i",{className:"am-dot am-dot--idle"}),label:"空闲",desc:"超过 60 秒无新请求,但 10 分钟内有过活动"}),o.jsx(yt,{icon:o.jsx("i",{className:"am-dot am-dot--completed"}),label:"已完成",desc:"超过 10 分钟无活动,且末轮正常结束(变暗、虚线)"}),o.jsx(yt,{icon:o.jsx("i",{className:"am-dot am-dot--error"}),label:"异常",desc:"末次请求失败(上游 5xx),红色脉冲"})]}),o.jsxs(Ra,{title:"距离分档(同心圆,按时间阶梯 1/7/30/365 天)",children:[o.jsx(yt,{icon:o.jsx("span",{className:"am-ring-swatch",style:{color:"var(--accent-success)"}}),label:"1 天临界",desc:"圈内在 1 天内开始的会话;圈外是更早的会话"}),o.jsx(yt,{icon:o.jsx("span",{className:"am-ring-swatch",style:{color:"var(--accent-warning)"}}),label:"7 天临界",desc:"1–7 天前开始的会话落在本圈与 1 天圈之间"}),o.jsx(yt,{icon:o.jsx("span",{className:"am-ring-swatch",style:{color:"#6BA8E5"}}),label:"30 天临界",desc:"7–30 天前开始的会话落在本圈与 7 天圈之间"}),o.jsx(yt,{icon:o.jsx("span",{className:"am-ring-swatch",style:{color:"#6BA8E5"}}),label:"1 年临界(最外圈)",desc:"30 天–1 年前开始的会话落在本圈与 30 天圈之间;超过 1 年的会话游离在本圈之外(最外围)"})]})]}),o.jsxs("div",{className:"am-legend-col",children:[o.jsxs(Ra,{title:"节点装饰",children:[o.jsx(yt,{icon:o.jsx("span",{children:"🔑"}),label:"接入密钥来源",desc:"节点下方钥匙标记,走 AccessKey 接入密钥流量"}),o.jsx(yt,{icon:o.jsx("span",{className:"am-ic-center"}),label:"中心点",desc:"画布中心圆点,进行中节点会与它连线"})]}),o.jsxs(Ra,{title:"节点位置与尺寸",children:[o.jsx(yt,{icon:o.jsx("span",{children:"🎯"}),label:"距中心距离 = 会话开始时间",desc:"以会话开始时间(firstRequestAt)按龄分档:1 天内居内侧(分布最宽),1–5 天、5–10 天依次外扩,10 天以上在最外围。内圈带宽最大、越往外越紧凑,落定后不漂移"}),o.jsx(yt,{icon:o.jsx("span",{children:"🔵"}),label:"节点大小 = 对话轮数",desc:"默认较小,仅随对话轮数(requestCount)增长并封顶,越大代表历史对话轮数越多"})]}),o.jsxs(Ra,{title:"操作",children:[o.jsx(yt,{icon:o.jsx("span",{className:"am-ic-mouse",children:"🖱"}),label:"缩放 / 平移",desc:"2D:滚轮缩放、拖拽平移、短按选中;3D:拖拽旋转、滚轮缩放、右键平移、点击选中"}),o.jsx(yt,{icon:o.jsx("span",{className:"am-ic-chart",children:"📈"}),label:"时间筛选",desc:"点 topbar「时间筛选」按预设区间过滤;趋势曲线仅作参考"})]})]}),o.jsx("div",{className:"am-legend-col",children:o.jsxs(Ra,{title:"3D 视图操作与标识",children:[o.jsx(yt,{icon:o.jsx("span",{children:"🧊"}),label:"进入 / 退出 3D",desc:"右下角「2D / 3D」分段切换;3D 使用 WebGL,若环境不支持会自动回退到 2D(此时 3D 按钮置灰)。3D 与 2D 是两套完全独立的画布,互不影响"}),o.jsx(yt,{icon:o.jsx("span",{className:"am-ic-mouse",children:"🖱"}),label:"鼠标操作",desc:"左键按住拖拽 = 环绕旋转视角;滚轮 = 以光标为中心缩放;右键(或双指)按住拖拽 = 平移;在节点上单击 = 选中并展开详情,点空白 = 取消选中。一旦开始拖拽,复位/定位的自动过渡会立即停止,视角完全交给用户"}),o.jsx(yt,{icon:o.jsx("span",{children:"🕹️"}),label:"连线 / 标签 / 复位",desc:"3D 模式下右下角额外出现「连线」「标签」「复位」三个按钮:连线 = 开关中心点到各节点的 Token 连线(默认开,关闭后选中节点的连线仍显示);标签 = 切换是否显示所有节点文字(默认只显示选中节点的文字);复位 = 把相机平滑回到初始机位"}),o.jsx(yt,{icon:o.jsx("span",{children:"📐"}),label:"中心纵轴 = Token 量尺",desc:"底部中心点垂直向上一根虚线纵轴,标注 10k / 100k / 1M / 10M / 100M / 1B 临界刻度;节点高度由 Token 总量驱动(阶梯式分段、每跨一档放大但不超过 2 倍),Token 越多越往上长"}),o.jsx(yt,{icon:o.jsx("span",{children:"🌀"}),label:"地面同心圆 = 会话年龄",desc:"底部平面同心圆按时间阶梯对齐到 1 天 / 7 天 / 30 天 / 1 年 临界(段长比 20/30/30/20,1 天段最长):越靠中心 = 会话越新(刚创建),越往外 = 会话开始得越早;超过 1 年的节点游离在最外圈之外。节点距中心的水平距离由会话开始时间决定,落定后不漂移"}),o.jsx(yt,{icon:o.jsx("span",{children:"🎨"}),label:"节点颜色 / 形态",desc:"进行中=主色(带脉冲发光圈)、空闲=黄色、异常=红色(快频脉冲)、已完成=浅绿线框球(半透明、不遮挡视野)。in-flight 请求中的节点球体会轻微呼吸缩放"})]})}),o.jsx("div",{className:"am-legend-col",children:o.jsxs(Ra,{title:"活动路径 / 活动流图标",children:[o.jsx(yt,{icon:o.jsx("span",{children:"💬"}),label:"提问 / 回复",desc:"用户提问或模型回复"}),o.jsx(yt,{icon:o.jsx("span",{children:"💭"}),label:"思考",desc:"模型推理思考过程"}),o.jsx(yt,{icon:o.jsx("span",{children:"⚠️"}),label:"错误",desc:"请求失败"}),o.jsx(yt,{icon:o.jsx("span",{children:"📖"}),label:"Read",desc:"读取文件"}),o.jsx(yt,{icon:o.jsx("span",{children:"📝"}),label:"Edit / Write",desc:"编辑 / 写入文件"}),o.jsx(yt,{icon:o.jsx("span",{children:"🔧"}),label:"Bash",desc:"执行终端命令"}),o.jsx(yt,{icon:o.jsx("span",{children:"🔍"}),label:"Grep / Glob",desc:"搜索内容 / 匹配文件"}),o.jsx(yt,{icon:o.jsx("span",{children:"🌐"}),label:"WebFetch / WebSearch",desc:"抓取网页 / 联网搜索"}),o.jsx(yt,{icon:o.jsx("span",{children:"🤖"}),label:"Agent / Task",desc:"调用子 Agent"})]})})]})]})]})}function zue(){const[e,t]=h.useState(new Map),[n,r]=h.useState([]),[i,a]=h.useState(null),[s,l]=h.useState(null),[c,u]=h.useState([]),[p,d]=h.useState(null),[f,m]=h.useState([]),[g,v]=h.useState(!1),[x,y]=h.useState(null),[b,w]=h.useState({loading:!1}),[S,k]=h.useState(!0),j=h.useCallback(()=>k(ee=>!ee),[]),[A,E]=h.useState(!1),[D,O]=h.useState(!1),{enabled:_,toggle:R}=rue(),[X,V]=h.useState(!1),[I,$]=h.useState({zoom:1,panX:0,panY:0}),[H,N]=h.useState(!1),[U,P]=h.useState(!1),[W,se]=h.useState(!1),[T,he]=h.useState(!1),[ye,Z]=h.useState(null),[le,Se]=h.useState(0);h.useEffect(()=>{const ee=Y.streamAgentMap({onInit:xe=>{V(!0);const je=new Map;for(const Re of xe.sessions)je.set(Re.sessionId,Re);t(je),r(xe.events),a(xe.stats)},onSessionUpdate:xe=>t(je=>{const Re=new Map(je);return Re.set(xe.sessionId,xe),Re}),onActivity:xe=>r(je=>[xe,...je].slice(0,500)),onStats:xe=>a(xe),onError:()=>V(!1)});return()=>ee.abort()},[]);const[,Q]=h.useState(0);h.useEffect(()=>{const ee=setInterval(()=>Q(xe=>(xe+1)%1e9),1e4);return()=>clearInterval(ee)},[]);const ne=h.useCallback(async ee=>{try{u(await Y.getAgentMapSessionEvents(ee))}catch{u([])}},[]),pe=h.useCallback(async(ee,xe,je)=>ee==="access-key"&&je?Y.getAccessKeySessionLogs(je,xe,1e4):Y.getSessionLogs(xe,1e4),[]),ie=h.useCallback(ee=>{const xe=ee.source==="access-key"?"access-key":"global";d({id:ee.sessionId,targetType:ee.agent,title:ee.title,firstRequestAt:ee.firstRequestAt,lastRequestAt:ee.lastRequestAt,requestCount:ee.requestCount,totalTokens:ee.totalTokens}),m([]),y({source:xe,keyId:ee.keyId,sessionId:ee.sessionId}),v(!0),pe(xe,ee.sessionId,ee.keyId).then(je=>m(je)).catch(je=>console.error("Failed to load session logs:",je)).finally(()=>v(!1))},[pe]),_e=h.useCallback(()=>{d(null),m([]),y(null),v(!1)},[]);h.useEffect(()=>{s?ne(s):u([])},[s,ne]);const ke=s?e.get(s):null;h.useEffect(()=>{s&&ne(s)},[ke==null?void 0:ke.lastRequestAt]),h.useEffect(()=>{if(!s){w({loading:!1});return}const ee=e.get(s);if(!ee){w({loading:!1});return}if(ee.source==="access-key"){w({loading:!1,unavailable:!0});return}if(ee.projectPath){w({loading:!1,projectPath:ee.projectPath});return}w({loading:!0});let xe=!0;return Y.getAgentMapSessionMeta(s).then(je=>{xe&&w({loading:!1,projectPath:je.projectPath})}).catch(()=>{xe&&w({loading:!1})}),()=>{xe=!1}},[s,ke==null?void 0:ke.projectPath]);const te=h.useCallback(ee=>{e.has(ee)&&(l(ee),Ve("all"),k(!0),Z({sessionId:ee,nonce:Date.now()}))},[e]),[De,Ve]=h.useState("all"),Le=Math.floor(Date.now()/1e4)*1e4,We=B2.find(ee=>ee.key===De).ms,pt=De!=="all",qe=h.useMemo(()=>De==="all"?null:{start:Le-We,end:Le},[De,Le,We]),Xe=h.useMemo(()=>Array.from(e.values()),[e]),Qe=h.useMemo(()=>qe?Xe.filter(ee=>ee.lastRequestAt>=qe.start&&ee.lastRequestAt<=qe.end):Xe,[Xe,qe]),et=h.useRef(null);ke&&(et.current=ke);const J=ke??(s?et.current:null);h.useEffect(()=>{s||(et.current=null)},[s]);const q=h.useCallback(ee=>{l(ee),ee&&k(!0)},[]),ue=n.length?n[n.length-1].ts:Le,M=De==="all"?Math.min(ue,Le-24*Xc):Le-We,fe=Le;return o.jsxs("div",{className:"am-page",children:[o.jsxs("div",{className:"am-header",children:[o.jsxs("div",{className:"am-title",children:[o.jsx("h2",{children:"🗺️ 任务雷达"}),o.jsx("span",{className:`am-conn${X?" am-conn--on":""}`,children:X?"● 实时":"○ 连接中"})]}),o.jsxs("div",{className:"am-stats",children:[o.jsxs("span",{className:"am-stat am-stat--active",children:["进行中 ",o.jsx("b",{children:(i==null?void 0:i.activeSessions)??0})]}),o.jsxs("span",{className:"am-stat am-stat--idle",children:["空闲 ",o.jsx("b",{children:(i==null?void 0:i.idleSessions)??0})]}),o.jsxs("span",{className:"am-stat am-stat--completed",children:["已完成 ",o.jsx("b",{children:(i==null?void 0:i.completedSessions)??0})]}),o.jsxs("span",{className:"am-stat am-stat--error",children:["异常 ",o.jsx("b",{children:(i==null?void 0:i.errorSessions)??0})]}),o.jsxs("span",{className:"am-stat",children:["在途 ",o.jsx("b",{children:(i==null?void 0:i.inFlightRequests)??0})]}),o.jsxs("span",{className:"am-stat",children:["显示 ",o.jsx("b",{children:Qe.length}),"/",Xe.length]})]}),o.jsxs("div",{className:"am-actions",children:[o.jsxs("button",{className:"am-btn am-toggle-btn",onClick:()=>{O(ee=>!ee),E(!1)},title:D?"收起时间筛选":"展开时间筛选",children:[o.jsx("span",{children:"时间筛选"}),o.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"transform 0.18s",transform:D?"rotate(180deg)":"none"},children:o.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),o.jsxs("button",{className:"am-btn am-toggle-btn",onClick:()=>{E(ee=>!ee),O(!1)},title:"符号说明",children:[o.jsx("span",{children:"符号说明"}),o.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"transform 0.18s",transform:A?"rotate(180deg)":"none"},children:o.jsx("polyline",{points:"6 9 12 15 18 9"})})]}),o.jsxs("div",{className:"am-notify-switch",title:_?"已开启:每个会话的一轮任务结束时(请求完成、流结束,或停滞超过阈值)会弹一次系统通知":"开启:每个会话的一轮任务结束时(请求完成、流结束,或停滞超过阈值)会弹一次系统通知",children:[o.jsx(Pl,{checked:_,onChange:R,label:"🔔 通知"}),_&&o.jsx("button",{type:"button",className:"am-notify-test",onClick:()=>Y.testAgentMapNotify(),title:"发一条测试通知,验证系统是否真的弹(若没弹,请在系统设置里允许 AICodeSwitch/终端 的通知)",children:"测试"})]})]}),A&&o.jsx(Lue,{onClose:()=>E(!1)})]}),D&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"am-popover-overlay",onClick:()=>O(!1)}),o.jsxs("div",{className:"am-popover am-popover--time",children:[o.jsxs("div",{className:"am-popover-head",children:[o.jsx("span",{children:"🕒 时间筛选"}),o.jsx("button",{className:"am-popover-close",onClick:()=>O(!1),"aria-label":"关闭",children:"×"})]}),o.jsxs("div",{className:"am-timefilter",children:[o.jsx("div",{className:"am-timepresets",children:B2.map(ee=>o.jsx("button",{className:`am-chip${De===ee.key?" am-chip--active":""}`,onClick:()=>Ve(ee.key),children:ee.label},ee.key))}),o.jsx(_ue,{sessions:Xe,start:M,end:fe})]}),pt&&o.jsxs("div",{className:"am-timefilter-hint",children:["已筛选:",new Date(qe.start).toLocaleString()," → 现在 · 显示 ",Qe.length,"/",Xe.length]})]})]}),o.jsxs("div",{className:"am-main",children:[o.jsxs("div",{className:"am-canvas-wrap",children:[Xe.length===0?o.jsxs("div",{className:"am-empty-canvas",children:[o.jsx("div",{className:"am-empty-icon",children:"🌌"}),o.jsx("p",{children:"暂无 Session"}),o.jsx("p",{className:"am-empty-hint",children:"启动 Claude Code 或 Codex 开始编程,节点会实时出现在这里"})]}):H&&!U?o.jsx(Oue,{sessions:Qe,now:Le,selectedId:s,onSelect:q,showLabels:W,showLinks:T,focus:ye,resetNonce:le,onContextLost:()=>P(!0)}):o.jsx(uue,{sessions:Qe,now:Le,selectedId:s,onSelect:q,view:I,onView:$,focus:ye}),o.jsxs("div",{className:"am-legend",children:[o.jsxs("span",{children:[o.jsx("i",{className:"am-dot am-dot--active"})," 进行中"]}),o.jsxs("span",{children:[o.jsx("i",{className:"am-dot am-dot--idle"})," 空闲"]}),o.jsxs("span",{children:[o.jsx("i",{className:"am-dot am-dot--completed"})," 已完成"]}),o.jsxs("span",{children:[o.jsx("i",{className:"am-dot am-dot--error"})," 异常"]})]}),o.jsxs("div",{className:"am-float-controls",children:[o.jsxs("div",{className:"am-view-toggle",role:"group","aria-label":"2D / 3D 视图切换",children:[o.jsx("button",{className:`am-view-btn${H?"":" am-view-btn--active"}`,onClick:()=>N(!1),title:"2D 平面视图(默认)",children:"2D"}),o.jsx("button",{className:`am-view-btn${H?" am-view-btn--active":""}${U?" am-view-btn--disabled":""}`,onClick:()=>{U||N(!0)},disabled:U,title:U?"WebGL 不可用,已回退到 2D":"3D 场景视图(Three.js):自由轨道旋转/缩放/平移",children:"3D"})]}),H&&!U?o.jsxs("div",{className:"am-view-toggle",role:"group","aria-label":"3D 显示控制",children:[o.jsx("button",{className:`am-view-btn am-view-btn--link${T?" am-view-btn--active":""}`,onClick:()=>he(ee=>!ee),title:T?"隐藏中心点到节点的 Token 连线(选中节点的连线仍显示)":"显示中心点到节点的 Token 连线",children:"连线"}),o.jsx("button",{className:`am-view-btn am-view-btn--label${W?" am-view-btn--active":""}`,onClick:()=>se(ee=>!ee),title:W?"隐藏所有节点标签(仅保留选中节点)":"显示所有节点标签",children:"标签"}),o.jsx("button",{className:"am-view-btn",onClick:()=>Se(ee=>ee+1),title:"复位视角",children:"复位"})]}):o.jsx(cue,{view:I,onView:$})]})]}),o.jsxs("div",{className:"am-feed-wrap",children:[o.jsx("button",{className:"am-feed-toggle",onClick:j,title:S?"收起侧栏":"展开侧栏","aria-label":S?"收起侧栏":"展开侧栏",children:o.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:S?o.jsx("polyline",{points:"9 18 15 12 9 6"}):o.jsx("polyline",{points:"15 18 9 12 15 6"})})}),S&&o.jsx("aside",{className:"am-feed-sidebar",children:J?o.jsxs("div",{className:"am-detail am-detail--sidebar",children:[o.jsxs("div",{className:"am-detail-head",children:[o.jsxs("span",{className:`am-badge am-badge--${J.status}`,children:[o.jsx(JD,{agent:J.agent,size:14})," ",Nue[J.status]]}),o.jsx("button",{className:"am-detail-close",onClick:()=>l(null),title:"返回活动流",children:"×"})]}),o.jsxs("div",{className:"am-detail-body",children:[o.jsx("h3",{className:"am-detail-title",children:J.title||J.sessionId}),o.jsxs("div",{className:"am-detail-meta",children:[o.jsxs("div",{children:["请求轮次:",o.jsx("b",{children:J.requestCount})]}),o.jsxs("div",{children:["输入 Token:",o.jsx("b",{children:(J.inputTokens||0).toLocaleString()})]}),o.jsxs("div",{children:["输出 Token:",o.jsx("b",{children:(J.outputTokens||0).toLocaleString()})]}),o.jsxs("div",{children:["累计 Token:",o.jsx("b",{children:(J.totalTokens||0).toLocaleString()})]}),o.jsxs("div",{children:["最近模型:",o.jsx("b",{children:J.lastModel||"-"})]}),o.jsxs("div",{className:"am-detail-path",children:["项目路径:",b.projectPath?o.jsx("code",{title:b.projectPath,children:b.projectPath}):b.unavailable?o.jsx("span",{className:"am-detail-path-na",children:"接入密钥会话,无法读取本地项目信息"}):b.loading?o.jsx("span",{className:"am-detail-path-na",children:"解析中…"}):o.jsx("span",{className:"am-detail-path-na",children:"未识别"})]}),o.jsxs("div",{children:["首/末:",o.jsx("b",{children:Ux(J.firstRequestAt)})," · ",o.jsx("b",{children:Ux(J.lastRequestAt)})]})]}),o.jsx("div",{className:"am-detail-section-title",children:"活动路径"}),o.jsx(Rue,{events:c})]}),o.jsxs("div",{className:"am-detail-footer",children:[o.jsx("button",{className:"am-btn am-btn--ghost",onClick:()=>ne(J.sessionId),children:"刷新活动"}),o.jsx("button",{className:"am-btn am-btn--ghost",disabled:J.source==="access-key"&&!J.keyId,onClick:()=>ie(J),children:"会话详情"})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"am-feed-head",children:[o.jsx("span",{children:"📜 全局活动流"}),o.jsx("span",{className:"am-feed-count",children:n.length})]}),o.jsx(Due,{events:n,onSelectSession:te})]})})]})]}),p&&x&&o.jsx(ob,{session:p,logs:f,logsLoading:g,onRefreshLogs:async()=>{if(x){v(!0);try{const ee=await pe(x.source,x.sessionId,x.keyId);m(ee)}catch(ee){console.error("Failed to refresh session logs:",ee)}finally{v(!1)}}},onFetchNewLogs:async()=>{if(!x)return[];const ee=await pe(x.source,x.sessionId,x.keyId);return m(ee),ee},onClose:_e})]})}function Jr({children:e,text:t,showTooltip:n}){const[r,i]=h.useState(!1),[a,s]=h.useState(null),l=h.useRef(null),c=()=>{if(n){if(l.current){const p=l.current.getBoundingClientRect();s({left:p.right+12,top:p.top+p.height/2})}i(!0)}},u=()=>{i(!1)};return o.jsxs("div",{ref:l,className:"nav-item-with-tooltip",onMouseEnter:c,onMouseLeave:u,children:[e,n&&r&&a&&Fu.createPortal(o.jsx("div",{className:"nav-tooltip",style:{left:a.left,top:a.top},children:t}),document.body)]})}const $ue=""+new URL("logo-CRx_w1Ov.png",import.meta.url).href,Bue=`升级到 v6.0.0 版本将会有破坏性影响,你需要注意:
|
|
1180
|
+
|
|
1181
|
+
* 我们升级了日志系统,以解决老的日志系统所带来的存储问题。新日志系统会迁移你的日志数据,但是,为了确保日志数据不丢失,我们会在下一个版本中才删除老的日志文件,这也就意味着你的电脑上可能同时存在两份日志文件,占用空间。为了节约你的电脑磁盘空间,你可以在运行一段时间感觉正常之后,删除 \`~/.aicodeswitch/fs-db/logs\` 目录来移除老的日志文件。
|
|
1182
|
+
|
|
1183
|
+
本次升级带来了新的大功能:
|
|
1184
|
+
|
|
1185
|
+
* 「任务雷达」功能,帮助你时刻掌握当前任务状态,历史任务分布,通过对任务雷达的分析,你可以掌握自己的编程习惯,从而作出适当的调整。
|
|
1186
|
+
`;function Fue(){const e=Lh(),[t,n]=h.useState("light"),[r,i]=h.useState(!1),[a,s]=h.useState(!1),[l,c]=h.useState(!1),[u,p]=h.useState(!1),[d,f]=h.useState(!1),[m,g]=h.useState(null),[v,x]=h.useState(null),[y,b]=h.useState(!1),w=OF(),[S,k]=h.useState(!1),[j,A]=h.useState(!1),[E,D]=h.useState(""),[O,_]=h.useState(""),[R,X]=h.useState(!0),[V,I]=h.useState(!1),[$,H]=h.useState(""),[N,U]=h.useState(!1);h.useEffect(()=>{const Q=localStorage.getItem("theme")||"light";n(Q),document.documentElement.setAttribute("data-theme",Q),localStorage.getItem("sidebar-collapsed")==="true"&&p(!0)},[]),h.useEffect(()=>{const Q=async()=>{try{const pe=await Y.checkVersion();f(pe.hasUpdate),g(pe.latestVersion),x(pe.currentVersion)}catch(pe){console.error("Failed to check version:",pe)}};Q();const ne=setInterval(Q,6e4);return()=>clearInterval(ne)},[]),h.useEffect(()=>{(async()=>{try{const ne=await Y.getAuthStatus();if(k(ne.enabled),!ne.enabled){A(!0),X(!1);return}if(!localStorage.getItem("auth_token")){X(!1);return}try{await Y.getVendors(),A(!0)}catch{}}catch(ne){console.error("Failed to check auth status:",ne)}finally{X(!1)}})()},[]),h.useEffect(()=>{(async()=>{if(!N)try{const ne=await Y.getUpgrade();ne.shouldShow&&ne.content&&(H(ne.content),I(!0)),U(!0)}catch(ne){console.error("Failed to check upgrade:",ne)}})()},[N]),h.useEffect(()=>{(async()=>{try{(await Y.getVendors()).length===0&&!a&&(i(!0),s(!0))}catch(ne){console.error("Failed to check vendors:",ne)}})()},[a]);const P=()=>{const Q=t==="light"?"dark":"light";n(Q),document.documentElement.setAttribute("data-theme",Q),localStorage.setItem("theme",Q)},W=()=>{p(!u),localStorage.setItem("sidebar-collapsed",(!u).toString())},se=h.useRef(null),[T,he]=h.useState({scrollable:!1,atTop:!0,atBottom:!0});h.useEffect(()=>{const Q=se.current;if(!Q)return;const ne=()=>{const ke=Q.scrollHeight-Q.clientHeight>2;he({scrollable:ke,atTop:Q.scrollTop<=1,atBottom:Q.scrollTop+Q.clientHeight>=Q.scrollHeight-1})};ne();let pe=0;const ie=()=>{cancelAnimationFrame(pe),pe=requestAnimationFrame(ne)},_e=new ResizeObserver(ie);return _e.observe(Q),Q.addEventListener("scroll",ie,{passive:!0}),()=>{cancelAnimationFrame(pe),_e.disconnect(),Q.removeEventListener("scroll",ie)}},[S,u]);const ye=T.scrollable,Z=()=>{i(!1),e("/vendors")},le=async()=>{try{await Y.acknowledgeUpgrade()}catch(Q){console.error("Failed to acknowledge upgrade:",Q)}I(!1)},Se=async Q=>{if(Q.preventDefault(),_(""),!E.trim()){_("请输入鉴权码");return}try{const ne=await Y.login(E);localStorage.setItem("auth_token",ne.token),A(!0),D("")}catch(ne){ne instanceof Error?_(ne.message||"登录失败,请检查鉴权码"):_("登录失败,请检查鉴权码")}};return R?o.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",fontSize:"18px",color:"var(--text-secondary)"},children:"加载中..."}):S&&!j?o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>{},"aria-label":"关闭",disabled:!0,style:{opacity:.3,cursor:"not-allowed"},children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"400px"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"🔐 系统鉴权"})}),o.jsxs("form",{onSubmit:Se,children:[o.jsxs("div",{style:{padding:"20px 0"},children:[o.jsx("p",{style:{marginBottom:"16px",lineHeight:"1.6",color:"var(--text-secondary)"},children:"系统已启用鉴权保护,请输入鉴权码以继续访问。"}),o.jsxs("div",{style:{marginBottom:"16px"},children:[o.jsx("label",{style:{display:"block",marginBottom:"8px",fontWeight:"500"},children:"鉴权码"}),o.jsx("input",{type:"password",value:E,onChange:Q=>D(Q.target.value),placeholder:"请输入鉴权码",style:{width:"100%",padding:"10px 12px",border:"1px solid var(--border-color)",borderRadius:"6px",fontSize:"14px",boxSizing:"border-box"},autoFocus:!0})]}),O&&o.jsx("div",{style:{padding:"10px 12px",backgroundColor:"#fee",border:"1px solid #fcc",borderRadius:"6px",color:"#c33",fontSize:"14px",marginBottom:"16px"},children:O})]}),o.jsx("div",{className:"modal-footer",children:o.jsx("button",{type:"submit",className:"btn btn-primary",style:{width:"100%"},children:"登录"})})]})]})})]}):o.jsxs("div",{className:"app",children:[o.jsxs("nav",{className:`sidebar ${u?"collapsed":""}`,children:[o.jsxs("div",{className:"logo",children:[o.jsx("img",{src:$ue,alt:"AI Code Switch Logo",className:"logo-image"}),o.jsx("h2",{children:"AI Code Switch"})]}),o.jsxs("div",{className:"nav-menu-wrap",children:[o.jsxs("ul",{className:"nav-menu",ref:se,children:[o.jsx("li",{children:o.jsx(Jr,{text:"路由管理",showTooltip:u,children:o.jsxs(Zr,{to:"/routes",children:[o.jsx("span",{className:"nav-icon",children:"🌏"}),o.jsx("span",{className:"nav-text",children:"路由管理"})]})})}),o.jsx("li",{children:o.jsx(Jr,{text:"供应商管理",showTooltip:u,children:o.jsxs(Zr,{to:"/vendors",children:[o.jsx("span",{className:"nav-icon",children:"🏭"}),o.jsx("span",{className:"nav-text",children:"供应商管理"})]})})}),o.jsx("li",{children:o.jsx(Jr,{text:"Skills 管理",showTooltip:u,children:o.jsxs(Zr,{to:"/skills",children:[o.jsx("span",{className:"nav-icon",children:"🧩"}),o.jsx("span",{className:"nav-text",children:"Skills 管理"})]})})}),o.jsx("li",{children:o.jsx(Jr,{text:"MCP 管理",showTooltip:u,children:o.jsxs(Zr,{to:"/mcp",children:[o.jsx("span",{className:"nav-icon",children:"🧰"}),o.jsx("span",{className:"nav-text",children:"MCP 管理"})]})})}),S&&o.jsxs(o.Fragment,{children:[o.jsx("li",{className:"nav-divider",children:o.jsx("hr",{style:{border:"none",borderTop:"1px solid var(--border-primary)",margin:"4px 8px"}})}),o.jsx("li",{children:o.jsx(Jr,{text:"API Key",showTooltip:u,children:o.jsxs(Zr,{to:"/access-keys",children:[o.jsx("span",{className:"nav-icon",children:"🔑"}),o.jsx("span",{className:"nav-text",children:"API Key"})]})})})]}),o.jsx("li",{className:"nav-divider",children:o.jsx("hr",{style:{border:"none",borderTop:"1px solid var(--border-primary)",margin:"4px 8px"}})}),o.jsx("li",{children:o.jsx(Jr,{text:"任务雷达",showTooltip:u,children:o.jsxs(Zr,{to:"/agent-map",children:[o.jsx("span",{className:"nav-icon",children:"🗺️"}),o.jsx("span",{className:"nav-text",children:"任务雷达"})]})})}),o.jsx("li",{children:o.jsx(Jr,{text:"数据统计",showTooltip:u,children:o.jsxs(Zr,{to:"/statistics",children:[o.jsx("span",{className:"nav-icon",children:"📊"}),o.jsx("span",{className:"nav-text",children:"数据统计"})]})})}),!S&&o.jsxs(o.Fragment,{children:[o.jsx("li",{children:o.jsx(Jr,{text:"会话",showTooltip:u,children:o.jsxs(Zr,{to:"/sessions",children:[o.jsx("span",{className:"nav-icon",children:"💬"}),o.jsx("span",{className:"nav-text",children:"会话"})]})})}),o.jsx("li",{children:o.jsx(Jr,{text:"日志",showTooltip:u,children:o.jsxs(Zr,{to:"/logs",children:[o.jsx("span",{className:"nav-icon",children:"🪵"}),o.jsx("span",{className:"nav-text",children:"日志"})]})})})]}),o.jsx("li",{children:o.jsx(Jr,{text:"设置",showTooltip:u,children:o.jsxs(Zr,{to:"/settings",children:[o.jsx("span",{className:"nav-icon",children:"⚙️"}),o.jsx("span",{className:"nav-text",children:"设置"})]})})}),o.jsx("li",{children:o.jsx(Jr,{text:"使用说明",showTooltip:u,children:o.jsxs(Zr,{to:"/usage",children:[o.jsx("span",{className:"nav-icon",children:"📖"}),o.jsx("span",{className:"nav-text",children:"使用说明"})]})})})]}),ye&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`nav-scroll-shadow nav-scroll-shadow--top${T.atTop?" is-hidden":""}`,"aria-hidden":"true"}),o.jsx("div",{className:`nav-scroll-shadow nav-scroll-shadow--bottom${T.atBottom?" is-hidden":""}`,"aria-hidden":"true",children:o.jsx("span",{className:"nav-scroll-wheel",children:o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o.jsx("rect",{x:"6",y:"3",width:"12",height:"18",rx:"6"}),o.jsx("line",{x1:"12",y1:"7",x2:"12",y2:"11"})]})})})]})]}),o.jsxs("div",{className:"theme-toggle",children:[o.jsx("button",{onClick:P,className:"theme-mode-btn",children:t==="dark"?"🌙":"☀️"}),o.jsx("a",{href:"https://github.com/tangshuang/aicodeswitch",target:"_blank",rel:"noopener noreferrer",className:"github-link",title:"GitHub",children:o.jsx("svg",{viewBox:"0 0 16 16",width:"20",height:"20",fill:"currentColor",children:o.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})})}),v&&o.jsx("div",{className:`version-info-wrapper ${d?"has-update":""}`,onClick:()=>b(!0),style:{cursor:"pointer"},children:o.jsxs("div",{className:"version-info",children:["v",v,d&&o.jsx("span",{className:"version-badge"})]})}),o.jsx("button",{onClick:W,className:"sidebar-toggle-btn",title:u?"展开侧边栏":"收起侧边栏",children:u?"»":"«"})]})]}),o.jsx("main",{className:"main-content",children:o.jsxs(P3,{children:[o.jsx(Xn,{path:"/",element:o.jsx(pc,{to:"/routes",replace:!0})}),o.jsx(Xn,{path:"/agent-map",element:o.jsx(zue,{})}),o.jsx(Xn,{path:"/statistics",element:o.jsx(Qce,{})}),o.jsx(Xn,{path:"/routes",element:o.jsx(eU,{})}),o.jsx(Xn,{path:"/vendors",element:o.jsx(DF,{})}),o.jsx(Xn,{path:"/skills",element:o.jsx(Zce,{})}),o.jsx(Xn,{path:"/mcp",element:o.jsx(eue,{})}),o.jsx(Xn,{path:"/access-keys",element:S?o.jsx(tue,{}):o.jsx(pc,{to:"/"})}),o.jsx(Xn,{path:"/access-keys/:id",element:S?o.jsx(nue,{}):o.jsx(pc,{to:"/"})}),o.jsx(Xn,{path:"/sessions",element:S?o.jsx(pc,{to:"/"}):o.jsx(CU,{})}),o.jsx(Xn,{path:"/logs",element:S?o.jsx(pc,{to:"/"}):o.jsx(mU,{})}),o.jsx(Xn,{path:"/write-config",element:o.jsx(AU,{})}),o.jsx(Xn,{path:"/settings",element:o.jsx(PU,{})}),o.jsx(Xn,{path:"/usage",element:o.jsx(TU,{})})]})}),r&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>i(!1),"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"⚠️ 需要配置供应商"})}),o.jsxs("div",{style:{padding:"20px 0"},children:[o.jsx("p",{style:{marginBottom:"16px",lineHeight:"1.6"},children:"检测到系统中没有配置任何API供应商。在没有供应商的情况下,路由将无法正常工作。"}),o.jsx("p",{style:{marginBottom:"0",lineHeight:"1.6",fontWeight:"500"},children:"请先添加至少一个供应商,然后再配置路由规则。"})]}),o.jsxs("div",{className:"modal-footer",style:{justifyContent:"space-between"},children:[o.jsx("button",{type:"button",className:"btn",style:{background:"linear-gradient(135deg, #8B5CF6, #7C3AED)",color:"white",position:"relative",overflow:"hidden"},onClick:()=>{i(!1),c(!0)},children:"一键配置"}),o.jsxs("div",{style:{display:"flex",gap:"10px"},children:[o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>i(!1),children:"稍后"}),o.jsx("button",{type:"button",className:"btn btn-secondary",onClick:Z,children:"前往供应商管理"})]})]})]})})]}),o.jsx(aO,{show:l,onClose:()=>c(!1),onComplete:()=>s(!0)}),V&&o.jsx("div",{className:"modal-overlay",children:o.jsx("div",{className:"modal",style:{maxWidth:"800px",maxHeight:"80vh",overflow:"auto"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"📋 升级提示"})}),o.jsx("div",{className:"modal-body",children:o.jsx("div",{className:"markdown-content",children:o.jsx(Vc,{children:$})})}),o.jsx("div",{className:"modal-footer",children:o.jsx("button",{type:"button",className:"btn btn-primary",onClick:le,children:"我知道了"})})]})})}),y&&o.jsxs("div",{className:"modal-overlay",children:[o.jsx("button",{type:"button",className:"modal-close-btn",onClick:()=>b(!1),"aria-label":"关闭",children:"×"}),o.jsx("div",{className:"modal",style:{maxWidth:"700px",maxHeight:"80vh",overflow:"auto"},children:o.jsxs("div",{className:"modal-container",children:[o.jsx("div",{className:"modal-header",children:o.jsx("h2",{children:"📦 版本信息"})}),o.jsxs("div",{style:{padding:"20px 0"},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px",backgroundColor:"var(--bg-secondary)",borderRadius:"8px",marginBottom:"20px"},children:[o.jsxs("div",{children:[o.jsx("div",{style:{fontSize:"12px",color:"var(--text-secondary)",marginBottom:"4px"},children:"当前版本"}),o.jsxs("div",{style:{fontSize:"18px",fontWeight:"600"},children:["v",v]})]}),d?o.jsxs(o.Fragment,{children:[o.jsx("div",{style:{fontSize:"24px",color:"var(--text-secondary)"},children:"→"}),o.jsxs("div",{style:{textAlign:"right"},children:[o.jsx("div",{style:{fontSize:"12px",color:"var(--text-secondary)",marginBottom:"4px"},children:"最新版本"}),o.jsxs("div",{style:{fontSize:"18px",fontWeight:"600"},children:["v",m]})]})]}):o.jsx("div",{style:{padding:"6px 12px",backgroundColor:"#d4edda",color:"#155724",borderRadius:"4px",fontSize:"14px",fontWeight:"500"},children:"已是最新版本"})]}),d&&o.jsxs("div",{style:{padding:"16px",backgroundColor:"var(--bg-info-blue)",border:"1px solid var(--border-info-blue)",borderRadius:"8px",marginBottom:"20px"},children:[o.jsx("div",{style:{fontSize:"14px",marginBottom:"8px",fontWeight:"500",color:"var(--text-primary)"},children:"更新命令:"}),o.jsx("code",{style:{display:"block",padding:"8px 12px",backgroundColor:"var(--bg-secondary)",border:"1px solid var(--border-primary)",borderRadius:"4px",fontSize:"13px",color:"var(--accent-danger)"},children:"npm i -g aicodeswitch@latest"})]}),d?w?o.jsx("div",{className:"markdown-content",style:{maxHeight:"400px",overflow:"auto"},children:o.jsx(Vc,{children:w})}):null:o.jsxs("div",{className:"markdown-content",children:[o.jsx("h4",{style:{marginBottom:12},children:"当前版本提示:"}),o.jsx(Vc,{children:Bue})]})]}),o.jsx("div",{className:"modal-footer",children:o.jsx("button",{type:"button",className:"btn btn-primary",onClick:()=>b(!1),children:"关闭"})})]})})]})]})}function Uue(){return o.jsx(_3,{children:o.jsx(NF,{children:o.jsx(UF,{children:o.jsxs(iue,{children:[o.jsx(Fue,{}),o.jsx(_F,{})]})})})})}Ty.createRoot(document.getElementById("root")).render(o.jsx(nE.StrictMode,{children:o.jsx(Uue,{})}));
|