@inspectr/mcplab 0.1.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/README.md +762 -0
- package/dist/app/android-chrome-192x192.png +0 -0
- package/dist/app/android-chrome-512x512.png +0 -0
- package/dist/app/apple-touch-icon.png +0 -0
- package/dist/app/assets/index-DT-Z4AVG.js +249 -0
- package/dist/app/assets/index-EP4WAY8u.css +1 -0
- package/dist/app/favicon-16x16.png +0 -0
- package/dist/app/favicon-32x32.png +0 -0
- package/dist/app/favicon.svg +13 -0
- package/dist/app/index.html +26 -0
- package/dist/app/inspectr_logo_color.svg +9 -0
- package/dist/app/mcp.png +0 -0
- package/dist/app/mcp.svg +1 -0
- package/dist/app/robots.txt +14 -0
- package/dist/app/site.webmanifest +1 -0
- package/dist/app-server/app-context.d.ts +164 -0
- package/dist/app-server/app-context.d.ts.map +1 -0
- package/dist/app-server/app-context.js +2 -0
- package/dist/app-server/app-context.js.map +1 -0
- package/dist/app-server/assistant-common.d.ts +41 -0
- package/dist/app-server/assistant-common.d.ts.map +1 -0
- package/dist/app-server/assistant-common.js +104 -0
- package/dist/app-server/assistant-common.js.map +1 -0
- package/dist/app-server/config-store.d.ts +15 -0
- package/dist/app-server/config-store.d.ts.map +1 -0
- package/dist/app-server/config-store.js +67 -0
- package/dist/app-server/config-store.js.map +1 -0
- package/dist/app-server/dev-mcp.d.ts +6 -0
- package/dist/app-server/dev-mcp.d.ts.map +1 -0
- package/dist/app-server/dev-mcp.js +71 -0
- package/dist/app-server/dev-mcp.js.map +1 -0
- package/dist/app-server/evals-routes.d.ts +22 -0
- package/dist/app-server/evals-routes.d.ts.map +1 -0
- package/dist/app-server/evals-routes.js +135 -0
- package/dist/app-server/evals-routes.js.map +1 -0
- package/dist/app-server/http.d.ts +5 -0
- package/dist/app-server/http.d.ts.map +1 -0
- package/dist/app-server/http.js +31 -0
- package/dist/app-server/http.js.map +1 -0
- package/dist/app-server/index.d.ts +3 -0
- package/dist/app-server/index.d.ts.map +1 -0
- package/dist/app-server/index.js +2 -0
- package/dist/app-server/index.js.map +1 -0
- package/dist/app-server/jobs.d.ts +15 -0
- package/dist/app-server/jobs.d.ts.map +1 -0
- package/dist/app-server/jobs.js +11 -0
- package/dist/app-server/jobs.js.map +1 -0
- package/dist/app-server/libraries-store.d.ts +15 -0
- package/dist/app-server/libraries-store.d.ts.map +1 -0
- package/dist/app-server/libraries-store.js +61 -0
- package/dist/app-server/libraries-store.js.map +1 -0
- package/dist/app-server/markdown-reports.d.ts +12 -0
- package/dist/app-server/markdown-reports.d.ts.map +1 -0
- package/dist/app-server/markdown-reports.js +145 -0
- package/dist/app-server/markdown-reports.js.map +1 -0
- package/dist/app-server/oauth-debugger-domain.d.ts +230 -0
- package/dist/app-server/oauth-debugger-domain.d.ts.map +1 -0
- package/dist/app-server/oauth-debugger-domain.js +1098 -0
- package/dist/app-server/oauth-debugger-domain.js.map +1 -0
- package/dist/app-server/oauth-debugger.d.ts +20 -0
- package/dist/app-server/oauth-debugger.d.ts.map +1 -0
- package/dist/app-server/oauth-debugger.js +193 -0
- package/dist/app-server/oauth-debugger.js.map +1 -0
- package/dist/app-server/provider-models.d.ts +8 -0
- package/dist/app-server/provider-models.d.ts.map +1 -0
- package/dist/app-server/provider-models.js +60 -0
- package/dist/app-server/provider-models.js.map +1 -0
- package/dist/app-server/result-assistant-domain.d.ts +87 -0
- package/dist/app-server/result-assistant-domain.d.ts.map +1 -0
- package/dist/app-server/result-assistant-domain.js +212 -0
- package/dist/app-server/result-assistant-domain.js.map +1 -0
- package/dist/app-server/result-assistant.d.ts +22 -0
- package/dist/app-server/result-assistant.d.ts.map +1 -0
- package/dist/app-server/result-assistant.js +328 -0
- package/dist/app-server/result-assistant.js.map +1 -0
- package/dist/app-server/router.d.ts +4 -0
- package/dist/app-server/router.d.ts.map +1 -0
- package/dist/app-server/router.js +374 -0
- package/dist/app-server/router.js.map +1 -0
- package/dist/app-server/runs-routes.d.ts +44 -0
- package/dist/app-server/runs-routes.d.ts.map +1 -0
- package/dist/app-server/runs-routes.js +555 -0
- package/dist/app-server/runs-routes.js.map +1 -0
- package/dist/app-server/runs-store.d.ts +23 -0
- package/dist/app-server/runs-store.d.ts.map +1 -0
- package/dist/app-server/runs-store.js +84 -0
- package/dist/app-server/runs-store.js.map +1 -0
- package/dist/app-server/scenario-assistant-domain.d.ts +162 -0
- package/dist/app-server/scenario-assistant-domain.d.ts.map +1 -0
- package/dist/app-server/scenario-assistant-domain.js +269 -0
- package/dist/app-server/scenario-assistant-domain.js.map +1 -0
- package/dist/app-server/scenario-assistant.d.ts +29 -0
- package/dist/app-server/scenario-assistant.d.ts.map +1 -0
- package/dist/app-server/scenario-assistant.js +246 -0
- package/dist/app-server/scenario-assistant.js.map +1 -0
- package/dist/app-server/settings-store.d.ts +4 -0
- package/dist/app-server/settings-store.d.ts.map +1 -0
- package/dist/app-server/settings-store.js +32 -0
- package/dist/app-server/settings-store.js.map +1 -0
- package/dist/app-server/snapshots-routes.d.ts +24 -0
- package/dist/app-server/snapshots-routes.d.ts.map +1 -0
- package/dist/app-server/snapshots-routes.js +82 -0
- package/dist/app-server/snapshots-routes.js.map +1 -0
- package/dist/app-server/static-serving.d.ts +17 -0
- package/dist/app-server/static-serving.d.ts.map +1 -0
- package/dist/app-server/static-serving.js +64 -0
- package/dist/app-server/static-serving.js.map +1 -0
- package/dist/app-server/store-utils.d.ts +5 -0
- package/dist/app-server/store-utils.d.ts.map +1 -0
- package/dist/app-server/store-utils.js +26 -0
- package/dist/app-server/store-utils.js.map +1 -0
- package/dist/app-server/tool-analysis-domain.d.ts +146 -0
- package/dist/app-server/tool-analysis-domain.d.ts.map +1 -0
- package/dist/app-server/tool-analysis-domain.js +556 -0
- package/dist/app-server/tool-analysis-domain.js.map +1 -0
- package/dist/app-server/tool-analysis-storage.d.ts +41 -0
- package/dist/app-server/tool-analysis-storage.d.ts.map +1 -0
- package/dist/app-server/tool-analysis-storage.js +110 -0
- package/dist/app-server/tool-analysis-storage.js.map +1 -0
- package/dist/app-server/tool-analysis.d.ts +22 -0
- package/dist/app-server/tool-analysis.d.ts.map +1 -0
- package/dist/app-server/tool-analysis.js +271 -0
- package/dist/app-server/tool-analysis.js.map +1 -0
- package/dist/app-server/types.d.ts +28 -0
- package/dist/app-server/types.d.ts.map +1 -0
- package/dist/app-server/types.js +2 -0
- package/dist/app-server/types.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +544 -0
- package/dist/cli.js.map +1 -0
- package/dist/snapshot.d.ts +80 -0
- package/dist/snapshot.d.ts.map +1 -0
- package/dist/snapshot.js +401 -0
- package/dist/snapshot.js.map +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
function h7(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var Ep=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dy={exports:{}},Ou={},Ly={exports:{}},_t={};var qE;function m7(){if(qE)return _t;qE=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function g(B){return B===null||typeof B!="object"?null:(B=p&&B[p]||B["@@iterator"],typeof B=="function"?B:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,w={};function x(B,$,ee){this.props=B,this.context=$,this.refs=w,this.updater=ee||y}x.prototype.isReactComponent={},x.prototype.setState=function(B,$){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,$,"setState")},x.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function S(){}S.prototype=x.prototype;function N(B,$,ee){this.props=B,this.context=$,this.refs=w,this.updater=ee||y}var A=N.prototype=new S;A.constructor=N,j(A,x.prototype),A.isPureReactComponent=!0;var P=Array.isArray,E=Object.prototype.hasOwnProperty,O={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function R(B,$,ee){var V,J={},ge=null,ie=null;if($!=null)for(V in $.ref!==void 0&&(ie=$.ref),$.key!==void 0&&(ge=""+$.key),$)E.call($,V)&&!k.hasOwnProperty(V)&&(J[V]=$[V]);var ce=arguments.length-2;if(ce===1)J.children=ee;else if(1<ce){for(var oe=Array(ce),xe=0;xe<ce;xe++)oe[xe]=arguments[xe+2];J.children=oe}if(B&&B.defaultProps)for(V in ce=B.defaultProps,ce)J[V]===void 0&&(J[V]=ce[V]);return{$$typeof:e,type:B,key:ge,ref:ie,props:J,_owner:O.current}}function D(B,$){return{$$typeof:e,type:B.type,key:$,ref:B.ref,props:B.props,_owner:B._owner}}function U(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function z(B){var $={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(ee){return $[ee]})}var L=/\/+/g;function G(B,$){return typeof B=="object"&&B!==null&&B.key!=null?z(""+B.key):$.toString(36)}function q(B,$,ee,V,J){var ge=typeof B;(ge==="undefined"||ge==="boolean")&&(B=null);var ie=!1;if(B===null)ie=!0;else switch(ge){case"string":case"number":ie=!0;break;case"object":switch(B.$$typeof){case e:case t:ie=!0}}if(ie)return ie=B,J=J(ie),B=V===""?"."+G(ie,0):V,P(J)?(ee="",B!=null&&(ee=B.replace(L,"$&/")+"/"),q(J,$,ee,"",function(xe){return xe})):J!=null&&(U(J)&&(J=D(J,ee+(!J.key||ie&&ie.key===J.key?"":(""+J.key).replace(L,"$&/")+"/")+B)),$.push(J)),1;if(ie=0,V=V===""?".":V+":",P(B))for(var ce=0;ce<B.length;ce++){ge=B[ce];var oe=V+G(ge,ce);ie+=q(ge,$,ee,oe,J)}else if(oe=g(B),typeof oe=="function")for(B=oe.call(B),ce=0;!(ge=B.next()).done;)ge=ge.value,oe=V+G(ge,ce++),ie+=q(ge,$,ee,oe,J);else if(ge==="object")throw $=String(B),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.");return ie}function H(B,$,ee){if(B==null)return B;var V=[],J=0;return q(B,V,"","",function(ge){return $.call(ee,ge,J++)}),V}function X(B){if(B._status===-1){var $=B._result;$=$(),$.then(function(ee){(B._status===0||B._status===-1)&&(B._status=1,B._result=ee)},function(ee){(B._status===0||B._status===-1)&&(B._status=2,B._result=ee)}),B._status===-1&&(B._status=0,B._result=$)}if(B._status===1)return B._result.default;throw B._result}var Z={current:null},I={transition:null},F={ReactCurrentDispatcher:Z,ReactCurrentBatchConfig:I,ReactCurrentOwner:O};function Q(){throw Error("act(...) is not supported in production builds of React.")}return _t.Children={map:H,forEach:function(B,$,ee){H(B,function(){$.apply(this,arguments)},ee)},count:function(B){var $=0;return H(B,function(){$++}),$},toArray:function(B){return H(B,function($){return $})||[]},only:function(B){if(!U(B))throw Error("React.Children.only expected to receive a single React element child.");return B}},_t.Component=x,_t.Fragment=n,_t.Profiler=a,_t.PureComponent=N,_t.StrictMode=r,_t.Suspense=d,_t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=F,_t.act=Q,_t.cloneElement=function(B,$,ee){if(B==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+B+".");var V=j({},B.props),J=B.key,ge=B.ref,ie=B._owner;if($!=null){if($.ref!==void 0&&(ge=$.ref,ie=O.current),$.key!==void 0&&(J=""+$.key),B.type&&B.type.defaultProps)var ce=B.type.defaultProps;for(oe in $)E.call($,oe)&&!k.hasOwnProperty(oe)&&(V[oe]=$[oe]===void 0&&ce!==void 0?ce[oe]:$[oe])}var oe=arguments.length-2;if(oe===1)V.children=ee;else if(1<oe){ce=Array(oe);for(var xe=0;xe<oe;xe++)ce[xe]=arguments[xe+2];V.children=ce}return{$$typeof:e,type:B.type,key:J,ref:ge,props:V,_owner:ie}},_t.createContext=function(B){return B={$$typeof:o,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},B.Provider={$$typeof:i,_context:B},B.Consumer=B},_t.createElement=R,_t.createFactory=function(B){var $=R.bind(null,B);return $.type=B,$},_t.createRef=function(){return{current:null}},_t.forwardRef=function(B){return{$$typeof:c,render:B}},_t.isValidElement=U,_t.lazy=function(B){return{$$typeof:h,_payload:{_status:-1,_result:B},_init:X}},_t.memo=function(B,$){return{$$typeof:f,type:B,compare:$===void 0?null:$}},_t.startTransition=function(B){var $=I.transition;I.transition={};try{B()}finally{I.transition=$}},_t.unstable_act=Q,_t.useCallback=function(B,$){return Z.current.useCallback(B,$)},_t.useContext=function(B){return Z.current.useContext(B)},_t.useDebugValue=function(){},_t.useDeferredValue=function(B){return Z.current.useDeferredValue(B)},_t.useEffect=function(B,$){return Z.current.useEffect(B,$)},_t.useId=function(){return Z.current.useId()},_t.useImperativeHandle=function(B,$,ee){return Z.current.useImperativeHandle(B,$,ee)},_t.useInsertionEffect=function(B,$){return Z.current.useInsertionEffect(B,$)},_t.useLayoutEffect=function(B,$){return Z.current.useLayoutEffect(B,$)},_t.useMemo=function(B,$){return Z.current.useMemo(B,$)},_t.useReducer=function(B,$,ee){return Z.current.useReducer(B,$,ee)},_t.useRef=function(B){return Z.current.useRef(B)},_t.useState=function(B){return Z.current.useState(B)},_t.useSyncExternalStore=function(B,$,ee){return Z.current.useSyncExternalStore(B,$,ee)},_t.useTransition=function(){return Z.current.useTransition()},_t.version="18.3.1",_t}var WE;function bS(){return WE||(WE=1,Ly.exports=m7()),Ly.exports}var VE;function v7(){if(VE)return Ou;VE=1;var e=bS(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(c,d,f){var h,p={},g=null,y=null;f!==void 0&&(g=""+f),d.key!==void 0&&(g=""+d.key),d.ref!==void 0&&(y=d.ref);for(h in d)r.call(d,h)&&!i.hasOwnProperty(h)&&(p[h]=d[h]);if(c&&c.defaultProps)for(h in d=c.defaultProps,d)p[h]===void 0&&(p[h]=d[h]);return{$$typeof:t,type:c,key:g,ref:y,props:p,_owner:a.current}}return Ou.Fragment=n,Ou.jsx=o,Ou.jsxs=o,Ou}var HE;function g7(){return HE||(HE=1,Dy.exports=v7()),Dy.exports}var s=g7(),_p={},Fy={exports:{}},Cr={},By={exports:{}},zy={};var KE;function y7(){return KE||(KE=1,(function(e){function t(I,F){var Q=I.length;I.push(F);e:for(;0<Q;){var B=Q-1>>>1,$=I[B];if(0<a($,F))I[B]=F,I[Q]=$,Q=B;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var F=I[0],Q=I.pop();if(Q!==F){I[0]=Q;e:for(var B=0,$=I.length,ee=$>>>1;B<ee;){var V=2*(B+1)-1,J=I[V],ge=V+1,ie=I[ge];if(0>a(J,Q))ge<$&&0>a(ie,J)?(I[B]=ie,I[ge]=Q,B=ge):(I[B]=J,I[V]=Q,B=V);else if(ge<$&&0>a(ie,Q))I[B]=ie,I[ge]=Q,B=ge;else break e}}return F}function a(I,F){var Q=I.sortIndex-F.sortIndex;return Q!==0?Q:I.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,c=o.now();e.unstable_now=function(){return o.now()-c}}var d=[],f=[],h=1,p=null,g=3,y=!1,j=!1,w=!1,x=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(I){for(var F=n(f);F!==null;){if(F.callback===null)r(f);else if(F.startTime<=I)r(f),F.sortIndex=F.expirationTime,t(d,F);else break;F=n(f)}}function P(I){if(w=!1,A(I),!j)if(n(d)!==null)j=!0,X(E);else{var F=n(f);F!==null&&Z(P,F.startTime-I)}}function E(I,F){j=!1,w&&(w=!1,S(R),R=-1),y=!0;var Q=g;try{for(A(F),p=n(d);p!==null&&(!(p.expirationTime>F)||I&&!z());){var B=p.callback;if(typeof B=="function"){p.callback=null,g=p.priorityLevel;var $=B(p.expirationTime<=F);F=e.unstable_now(),typeof $=="function"?p.callback=$:p===n(d)&&r(d),A(F)}else r(d);p=n(d)}if(p!==null)var ee=!0;else{var V=n(f);V!==null&&Z(P,V.startTime-F),ee=!1}return ee}finally{p=null,g=Q,y=!1}}var O=!1,k=null,R=-1,D=5,U=-1;function z(){return!(e.unstable_now()-U<D)}function L(){if(k!==null){var I=e.unstable_now();U=I;var F=!0;try{F=k(!0,I)}finally{F?G():(O=!1,k=null)}}else O=!1}var G;if(typeof N=="function")G=function(){N(L)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,H=q.port2;q.port1.onmessage=L,G=function(){H.postMessage(null)}}else G=function(){x(L,0)};function X(I){k=I,O||(O=!0,G())}function Z(I,F){R=x(function(){I(e.unstable_now())},F)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(I){I.callback=null},e.unstable_continueExecution=function(){j||y||(j=!0,X(E))},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(I){switch(g){case 1:case 2:case 3:var F=3;break;default:F=g}var Q=g;g=F;try{return I()}finally{g=Q}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(I,F){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var Q=g;g=I;try{return F()}finally{g=Q}},e.unstable_scheduleCallback=function(I,F,Q){var B=e.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?B+Q:B):Q=B,I){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=Q+$,I={id:h++,callback:F,priorityLevel:I,startTime:Q,expirationTime:$,sortIndex:-1},Q>B?(I.sortIndex=Q,t(f,I),n(d)===null&&I===n(f)&&(w?(S(R),R=-1):w=!0,Z(P,Q-B))):(I.sortIndex=$,t(d,I),j||y||(j=!0,X(E))),I},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(I){var F=g;return function(){var Q=g;g=F;try{return I.apply(this,arguments)}finally{g=Q}}}})(zy)),zy}var GE;function x7(){return GE||(GE=1,By.exports=y7()),By.exports}var YE;function b7(){if(YE)return Cr;YE=1;var e=bS(),t=x7();function n(l){for(var u="https://reactjs.org/docs/error-decoder.html?invariant="+l,m=1;m<arguments.length;m++)u+="&args[]="+encodeURIComponent(arguments[m]);return"Minified React error #"+l+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,a={};function i(l,u){o(l,u),o(l+"Capture",u)}function o(l,u){for(a[l]=u,l=0;l<u.length;l++)r.add(u[l])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},p={};function g(l){return d.call(p,l)?!0:d.call(h,l)?!1:f.test(l)?p[l]=!0:(h[l]=!0,!1)}function y(l,u,m,b){if(m!==null&&m.type===0)return!1;switch(typeof u){case"function":case"symbol":return!0;case"boolean":return b?!1:m!==null?!m.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function j(l,u,m,b){if(u===null||typeof u>"u"||y(l,u,m,b))return!0;if(b)return!1;if(m!==null)switch(m.type){case 3:return!u;case 4:return u===!1;case 5:return isNaN(u);case 6:return isNaN(u)||1>u}return!1}function w(l,u,m,b,C,_,M){this.acceptsBooleans=u===2||u===3||u===4,this.attributeName=b,this.attributeNamespace=C,this.mustUseProperty=m,this.propertyName=l,this.type=u,this.sanitizeURL=_,this.removeEmptyString=M}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){x[l]=new w(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var u=l[0];x[u]=new w(u,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){x[l]=new w(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){x[l]=new w(l,2,!1,l,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(l){x[l]=new w(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){x[l]=new w(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){x[l]=new w(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){x[l]=new w(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){x[l]=new w(l,5,!1,l.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function N(l){return l[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(l){var u=l.replace(S,N);x[u]=new w(u,1,!1,l,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(l){var u=l.replace(S,N);x[u]=new w(u,1,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var u=l.replace(S,N);x[u]=new w(u,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){x[l]=new w(l,1,!1,l.toLowerCase(),null,!1,!1)}),x.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){x[l]=new w(l,1,!1,l.toLowerCase(),null,!0,!0)});function A(l,u,m,b){var C=x.hasOwnProperty(u)?x[u]:null;(C!==null?C.type!==0:b||!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(j(u,m,C,b)&&(m=null),b||C===null?g(u)&&(m===null?l.removeAttribute(u):l.setAttribute(u,""+m)):C.mustUseProperty?l[C.propertyName]=m===null?C.type===3?!1:"":m:(u=C.attributeName,b=C.attributeNamespace,m===null?l.removeAttribute(u):(C=C.type,m=C===3||C===4&&m===!0?"":""+m,b?l.setAttributeNS(b,u,m):l.setAttribute(u,m))))}var P=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,E=Symbol.for("react.element"),O=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),U=Symbol.for("react.provider"),z=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),Z=Symbol.for("react.offscreen"),I=Symbol.iterator;function F(l){return l===null||typeof l!="object"?null:(l=I&&l[I]||l["@@iterator"],typeof l=="function"?l:null)}var Q=Object.assign,B;function $(l){if(B===void 0)try{throw Error()}catch(m){var u=m.stack.trim().match(/\n( *(at )?)/);B=u&&u[1]||""}return`
|
|
2
|
+
`+B+l}var ee=!1;function V(l,u){if(!l||ee)return"";ee=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(u)if(u=function(){throw Error()},Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(me){var b=me}Reflect.construct(l,[],u)}else{try{u.call()}catch(me){b=me}l.call(u.prototype)}else{try{throw Error()}catch(me){b=me}l()}}catch(me){if(me&&b&&typeof me.stack=="string"){for(var C=me.stack.split(`
|
|
3
|
+
`),_=b.stack.split(`
|
|
4
|
+
`),M=C.length-1,Y=_.length-1;1<=M&&0<=Y&&C[M]!==_[Y];)Y--;for(;1<=M&&0<=Y;M--,Y--)if(C[M]!==_[Y]){if(M!==1||Y!==1)do if(M--,Y--,0>Y||C[M]!==_[Y]){var te=`
|
|
5
|
+
`+C[M].replace(" at new "," at ");return l.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",l.displayName)),te}while(1<=M&&0<=Y);break}}}finally{ee=!1,Error.prepareStackTrace=m}return(l=l?l.displayName||l.name:"")?$(l):""}function J(l){switch(l.tag){case 5:return $(l.type);case 16:return $("Lazy");case 13:return $("Suspense");case 19:return $("SuspenseList");case 0:case 2:case 15:return l=V(l.type,!1),l;case 11:return l=V(l.type.render,!1),l;case 1:return l=V(l.type,!0),l;default:return""}}function ge(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case k:return"Fragment";case O:return"Portal";case D:return"Profiler";case R:return"StrictMode";case G:return"Suspense";case q:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case z:return(l.displayName||"Context")+".Consumer";case U:return(l._context.displayName||"Context")+".Provider";case L:var u=l.render;return l=l.displayName,l||(l=u.displayName||u.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case H:return u=l.displayName||null,u!==null?u:ge(l.type)||"Memo";case X:u=l._payload,l=l._init;try{return ge(l(u))}catch{}}return null}function ie(l){var u=l.type;switch(l.tag){case 24:return"Cache";case 9:return(u.displayName||"Context")+".Consumer";case 10:return(u._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=u.render,l=l.displayName||l.name||"",u.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return u;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ge(u);case 8:return u===R?"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 u=="function")return u.displayName||u.name||null;if(typeof u=="string")return u}return null}function ce(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function oe(l){var u=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function xe(l){var u=oe(l)?"checked":"value",m=Object.getOwnPropertyDescriptor(l.constructor.prototype,u),b=""+l[u];if(!l.hasOwnProperty(u)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var C=m.get,_=m.set;return Object.defineProperty(l,u,{configurable:!0,get:function(){return C.call(this)},set:function(M){b=""+M,_.call(this,M)}}),Object.defineProperty(l,u,{enumerable:m.enumerable}),{getValue:function(){return b},setValue:function(M){b=""+M},stopTracking:function(){l._valueTracker=null,delete l[u]}}}}function Oe(l){l._valueTracker||(l._valueTracker=xe(l))}function pe(l){if(!l)return!1;var u=l._valueTracker;if(!u)return!0;var m=u.getValue(),b="";return l&&(b=oe(l)?l.checked?"true":"false":l.value),l=b,l!==m?(u.setValue(l),!0):!1}function ve(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function Ce(l,u){var m=u.checked;return Q({},u,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??l._wrapperState.initialChecked})}function Le(l,u){var m=u.defaultValue==null?"":u.defaultValue,b=u.checked!=null?u.checked:u.defaultChecked;m=ce(u.value!=null?u.value:m),l._wrapperState={initialChecked:b,initialValue:m,controlled:u.type==="checkbox"||u.type==="radio"?u.checked!=null:u.value!=null}}function se(l,u){u=u.checked,u!=null&&A(l,"checked",u,!1)}function de(l,u){se(l,u);var m=ce(u.value),b=u.type;if(m!=null)b==="number"?(m===0&&l.value===""||l.value!=m)&&(l.value=""+m):l.value!==""+m&&(l.value=""+m);else if(b==="submit"||b==="reset"){l.removeAttribute("value");return}u.hasOwnProperty("value")?Fe(l,u.type,m):u.hasOwnProperty("defaultValue")&&Fe(l,u.type,ce(u.defaultValue)),u.checked==null&&u.defaultChecked!=null&&(l.defaultChecked=!!u.defaultChecked)}function Ne(l,u,m){if(u.hasOwnProperty("value")||u.hasOwnProperty("defaultValue")){var b=u.type;if(!(b!=="submit"&&b!=="reset"||u.value!==void 0&&u.value!==null))return;u=""+l._wrapperState.initialValue,m||u===l.value||(l.value=u),l.defaultValue=u}m=l.name,m!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,m!==""&&(l.name=m)}function Fe(l,u,m){(u!=="number"||ve(l.ownerDocument)!==l)&&(m==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+m&&(l.defaultValue=""+m))}var je=Array.isArray;function $e(l,u,m,b){if(l=l.options,u){u={};for(var C=0;C<m.length;C++)u["$"+m[C]]=!0;for(m=0;m<l.length;m++)C=u.hasOwnProperty("$"+l[m].value),l[m].selected!==C&&(l[m].selected=C),C&&b&&(l[m].defaultSelected=!0)}else{for(m=""+ce(m),u=null,C=0;C<l.length;C++){if(l[C].value===m){l[C].selected=!0,b&&(l[C].defaultSelected=!0);return}u!==null||l[C].disabled||(u=l[C])}u!==null&&(u.selected=!0)}}function et(l,u){if(u.dangerouslySetInnerHTML!=null)throw Error(n(91));return Q({},u,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function xt(l,u){var m=u.value;if(m==null){if(m=u.children,u=u.defaultValue,m!=null){if(u!=null)throw Error(n(92));if(je(m)){if(1<m.length)throw Error(n(93));m=m[0]}u=m}u==null&&(u=""),m=u}l._wrapperState={initialValue:ce(m)}}function Jt(l,u){var m=ce(u.value),b=ce(u.defaultValue);m!=null&&(m=""+m,m!==l.value&&(l.value=m),u.defaultValue==null&&l.defaultValue!==m&&(l.defaultValue=m)),b!=null&&(l.defaultValue=""+b)}function ye(l){var u=l.textContent;u===l._wrapperState.initialValue&&u!==""&&u!==null&&(l.value=u)}function We(l){switch(l){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 Ye(l,u){return l==null||l==="http://www.w3.org/1999/xhtml"?We(u):l==="http://www.w3.org/2000/svg"&&u==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var Ot,Dt=(function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(u,m,b,C){MSApp.execUnsafeLocalFunction(function(){return l(u,m,b,C)})}:l})(function(l,u){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=u;else{for(Ot=Ot||document.createElement("div"),Ot.innerHTML="<svg>"+u.valueOf().toString()+"</svg>",u=Ot.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;u.firstChild;)l.appendChild(u.firstChild)}});function kt(l,u){if(u){var m=l.firstChild;if(m&&m===l.lastChild&&m.nodeType===3){m.nodeValue=u;return}}l.textContent=u}var Zt={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},Sn=["Webkit","ms","Moz","O"];Object.keys(Zt).forEach(function(l){Sn.forEach(function(u){u=u+l.charAt(0).toUpperCase()+l.substring(1),Zt[u]=Zt[l]})});function tr(l,u,m){return u==null||typeof u=="boolean"||u===""?"":m||typeof u!="number"||u===0||Zt.hasOwnProperty(l)&&Zt[l]?(""+u).trim():u+"px"}function nr(l,u){l=l.style;for(var m in u)if(u.hasOwnProperty(m)){var b=m.indexOf("--")===0,C=tr(m,u[m],b);m==="float"&&(m="cssFloat"),b?l.setProperty(m,C):l[m]=C}}var ba=Q({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 En(l,u){if(u){if(ba[l]&&(u.children!=null||u.dangerouslySetInnerHTML!=null))throw Error(n(137,l));if(u.dangerouslySetInnerHTML!=null){if(u.children!=null)throw Error(n(60));if(typeof u.dangerouslySetInnerHTML!="object"||!("__html"in u.dangerouslySetInnerHTML))throw Error(n(61))}if(u.style!=null&&typeof u.style!="object")throw Error(n(62))}}function Or(l,u){if(l.indexOf("-")===-1)return typeof u.is=="string";switch(l){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 kr=null;function yr(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var _n=null,Rn=null,yn=null;function Tn(l){if(l=mu(l)){if(typeof _n!="function")throw Error(n(280));var u=l.stateNode;u&&(u=Uf(u),_n(l.stateNode,l.type,u))}}function ue(l){Rn?yn?yn.push(l):yn=[l]:Rn=l}function Ie(){if(Rn){var l=Rn,u=yn;if(yn=Rn=null,Tn(l),u)for(l=0;l<u.length;l++)Tn(u[l])}}function ct(l,u){return l(u)}function bt(){}var Wt=!1;function on(l,u,m){if(Wt)return l(u,m);Wt=!0;try{return ct(l,u,m)}finally{Wt=!1,(Rn!==null||yn!==null)&&(bt(),Ie())}}function Pt(l,u){var m=l.stateNode;if(m===null)return null;var b=Uf(m);if(b===null)return null;m=b[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(b=!b.disabled)||(l=l.type,b=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!b;break e;default:l=!1}if(l)return null;if(m&&typeof m!="function")throw Error(n(231,u,typeof m));return m}var rr=!1;if(c)try{var ln={};Object.defineProperty(ln,"passive",{get:function(){rr=!0}}),window.addEventListener("test",ln,ln),window.removeEventListener("test",ln,ln)}catch{rr=!1}function Xt(l,u,m,b,C,_,M,Y,te){var me=Array.prototype.slice.call(arguments,3);try{u.apply(m,me)}catch(Ee){this.onError(Ee)}}var xr=!1,wa=null,ja=!1,ei=null,Gi={onError:function(l){xr=!0,wa=l}};function Go(l,u,m,b,C,_,M,Y,te){xr=!1,wa=null,Xt.apply(Gi,arguments)}function ti(l,u,m,b,C,_,M,Y,te){if(Go.apply(this,arguments),xr){if(xr){var me=wa;xr=!1,wa=null}else throw Error(n(198));ja||(ja=!0,ei=me)}}function Rr(l){var u=l,m=l;if(l.alternate)for(;u.return;)u=u.return;else{l=u;do u=l,(u.flags&4098)!==0&&(m=u.return),l=u.return;while(l)}return u.tag===3?m:null}function Yi(l){if(l.tag===13){var u=l.memoizedState;if(u===null&&(l=l.alternate,l!==null&&(u=l.memoizedState)),u!==null)return u.dehydrated}return null}function Ka(l){if(Rr(l)!==l)throw Error(n(188))}function Xc(l){var u=l.alternate;if(!u){if(u=Rr(l),u===null)throw Error(n(188));return u!==l?null:l}for(var m=l,b=u;;){var C=m.return;if(C===null)break;var _=C.alternate;if(_===null){if(b=C.return,b!==null){m=b;continue}break}if(C.child===_.child){for(_=C.child;_;){if(_===m)return Ka(C),l;if(_===b)return Ka(C),u;_=_.sibling}throw Error(n(188))}if(m.return!==b.return)m=C,b=_;else{for(var M=!1,Y=C.child;Y;){if(Y===m){M=!0,m=C,b=_;break}if(Y===b){M=!0,b=C,m=_;break}Y=Y.sibling}if(!M){for(Y=_.child;Y;){if(Y===m){M=!0,m=_,b=C;break}if(Y===b){M=!0,b=_,m=C;break}Y=Y.sibling}if(!M)throw Error(n(189))}}if(m.alternate!==b)throw Error(n(190))}if(m.tag!==3)throw Error(n(188));return m.stateNode.current===m?l:u}function Yo(l){return l=Xc(l),l!==null?ea(l):null}function ea(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var u=ea(l);if(u!==null)return u;l=l.sibling}return null}var Ga=t.unstable_scheduleCallback,Sa=t.unstable_cancelCallback,Qc=t.unstable_shouldYield,K=t.unstable_requestPaint,he=t.unstable_now,at=t.unstable_getCurrentPriorityLevel,T=t.unstable_ImmediatePriority,ne=t.unstable_UserBlockingPriority,be=t.unstable_NormalPriority,_e=t.unstable_LowPriority,rt=t.unstable_IdlePriority,Ge=null,vt=null;function Be(l){if(vt&&typeof vt.onCommitFiberRoot=="function")try{vt.onCommitFiberRoot(Ge,l,void 0,(l.current.flags&128)===128)}catch{}}var Ct=Math.clz32?Math.clz32:xn,Vt=Math.log,Lt=Math.LN2;function xn(l){return l>>>=0,l===0?32:31-(Vt(l)/Lt|0)|0}var Tr=64,Xi=4194304;function Na(l){switch(l&-l){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 l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function Xo(l,u){var m=l.pendingLanes;if(m===0)return 0;var b=0,C=l.suspendedLanes,_=l.pingedLanes,M=m&268435455;if(M!==0){var Y=M&~C;Y!==0?b=Na(Y):(_&=M,_!==0&&(b=Na(_)))}else M=m&~C,M!==0?b=Na(M):_!==0&&(b=Na(_));if(b===0)return 0;if(u!==0&&u!==b&&(u&C)===0&&(C=b&-b,_=u&-u,C>=_||C===16&&(_&4194240)!==0))return u;if((b&4)!==0&&(b|=m&16),u=l.entangledLanes,u!==0)for(l=l.entanglements,u&=b;0<u;)m=31-Ct(u),C=1<<m,b|=l[m],u&=~C;return b}function Cf(l,u){switch(l){case 1:case 2:case 4:return u+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 u+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 Af(l,u){for(var m=l.suspendedLanes,b=l.pingedLanes,C=l.expirationTimes,_=l.pendingLanes;0<_;){var M=31-Ct(_),Y=1<<M,te=C[M];te===-1?((Y&m)===0||(Y&b)!==0)&&(C[M]=Cf(Y,u)):te<=u&&(l.expiredLanes|=Y),_&=~Y}}function Ir(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function bC(){var l=Tr;return Tr<<=1,(Tr&4194240)===0&&(Tr=64),l}function sg(l){for(var u=[],m=0;31>m;m++)u.push(l);return u}function Jc(l,u,m){l.pendingLanes|=u,u!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,u=31-Ct(u),l[u]=m}function Mz(l,u){var m=l.pendingLanes&~u;l.pendingLanes=u,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=u,l.mutableReadLanes&=u,l.entangledLanes&=u,u=l.entanglements;var b=l.eventTimes;for(l=l.expirationTimes;0<m;){var C=31-Ct(m),_=1<<C;u[C]=0,b[C]=-1,l[C]=-1,m&=~_}}function ig(l,u){var m=l.entangledLanes|=u;for(l=l.entanglements;m;){var b=31-Ct(m),C=1<<b;C&u|l[b]&u&&(l[b]|=u),m&=~C}}var Ht=0;function wC(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var jC,og,SC,NC,CC,lg=!1,Ef=[],ni=null,ri=null,ai=null,Zc=new Map,eu=new Map,si=[],$z="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 AC(l,u){switch(l){case"focusin":case"focusout":ni=null;break;case"dragenter":case"dragleave":ri=null;break;case"mouseover":case"mouseout":ai=null;break;case"pointerover":case"pointerout":Zc.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":eu.delete(u.pointerId)}}function tu(l,u,m,b,C,_){return l===null||l.nativeEvent!==_?(l={blockedOn:u,domEventName:m,eventSystemFlags:b,nativeEvent:_,targetContainers:[C]},u!==null&&(u=mu(u),u!==null&&og(u)),l):(l.eventSystemFlags|=b,u=l.targetContainers,C!==null&&u.indexOf(C)===-1&&u.push(C),l)}function Dz(l,u,m,b,C){switch(u){case"focusin":return ni=tu(ni,l,u,m,b,C),!0;case"dragenter":return ri=tu(ri,l,u,m,b,C),!0;case"mouseover":return ai=tu(ai,l,u,m,b,C),!0;case"pointerover":var _=C.pointerId;return Zc.set(_,tu(Zc.get(_)||null,l,u,m,b,C)),!0;case"gotpointercapture":return _=C.pointerId,eu.set(_,tu(eu.get(_)||null,l,u,m,b,C)),!0}return!1}function EC(l){var u=Qi(l.target);if(u!==null){var m=Rr(u);if(m!==null){if(u=m.tag,u===13){if(u=Yi(m),u!==null){l.blockedOn=u,CC(l.priority,function(){SC(m)});return}}else if(u===3&&m.stateNode.current.memoizedState.isDehydrated){l.blockedOn=m.tag===3?m.stateNode.containerInfo:null;return}}}l.blockedOn=null}function _f(l){if(l.blockedOn!==null)return!1;for(var u=l.targetContainers;0<u.length;){var m=ug(l.domEventName,l.eventSystemFlags,u[0],l.nativeEvent);if(m===null){m=l.nativeEvent;var b=new m.constructor(m.type,m);kr=b,m.target.dispatchEvent(b),kr=null}else return u=mu(m),u!==null&&og(u),l.blockedOn=m,!1;u.shift()}return!0}function _C(l,u,m){_f(l)&&m.delete(u)}function Lz(){lg=!1,ni!==null&&_f(ni)&&(ni=null),ri!==null&&_f(ri)&&(ri=null),ai!==null&&_f(ai)&&(ai=null),Zc.forEach(_C),eu.forEach(_C)}function nu(l,u){l.blockedOn===u&&(l.blockedOn=null,lg||(lg=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Lz)))}function ru(l){function u(C){return nu(C,l)}if(0<Ef.length){nu(Ef[0],l);for(var m=1;m<Ef.length;m++){var b=Ef[m];b.blockedOn===l&&(b.blockedOn=null)}}for(ni!==null&&nu(ni,l),ri!==null&&nu(ri,l),ai!==null&&nu(ai,l),Zc.forEach(u),eu.forEach(u),m=0;m<si.length;m++)b=si[m],b.blockedOn===l&&(b.blockedOn=null);for(;0<si.length&&(m=si[0],m.blockedOn===null);)EC(m),m.blockedOn===null&&si.shift()}var Qo=P.ReactCurrentBatchConfig,Pf=!0;function Fz(l,u,m,b){var C=Ht,_=Qo.transition;Qo.transition=null;try{Ht=1,cg(l,u,m,b)}finally{Ht=C,Qo.transition=_}}function Bz(l,u,m,b){var C=Ht,_=Qo.transition;Qo.transition=null;try{Ht=4,cg(l,u,m,b)}finally{Ht=C,Qo.transition=_}}function cg(l,u,m,b){if(Pf){var C=ug(l,u,m,b);if(C===null)Eg(l,u,b,Of,m),AC(l,b);else if(Dz(C,l,u,m,b))b.stopPropagation();else if(AC(l,b),u&4&&-1<$z.indexOf(l)){for(;C!==null;){var _=mu(C);if(_!==null&&jC(_),_=ug(l,u,m,b),_===null&&Eg(l,u,b,Of,m),_===C)break;C=_}C!==null&&b.stopPropagation()}else Eg(l,u,b,null,m)}}var Of=null;function ug(l,u,m,b){if(Of=null,l=yr(b),l=Qi(l),l!==null)if(u=Rr(l),u===null)l=null;else if(m=u.tag,m===13){if(l=Yi(u),l!==null)return l;l=null}else if(m===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;l=null}else u!==l&&(l=null);return Of=l,null}function PC(l){switch(l){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(at()){case T:return 1;case ne:return 4;case be:case _e:return 16;case rt:return 536870912;default:return 16}default:return 16}}var ii=null,dg=null,kf=null;function OC(){if(kf)return kf;var l,u=dg,m=u.length,b,C="value"in ii?ii.value:ii.textContent,_=C.length;for(l=0;l<m&&u[l]===C[l];l++);var M=m-l;for(b=1;b<=M&&u[m-b]===C[_-b];b++);return kf=C.slice(l,1<b?1-b:void 0)}function Rf(l){var u=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&u===13&&(l=13)):l=u,l===10&&(l=13),32<=l||l===13?l:0}function Tf(){return!0}function kC(){return!1}function Mr(l){function u(m,b,C,_,M){this._reactName=m,this._targetInst=C,this.type=b,this.nativeEvent=_,this.target=M,this.currentTarget=null;for(var Y in l)l.hasOwnProperty(Y)&&(m=l[Y],this[Y]=m?m(_):_[Y]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?Tf:kC,this.isPropagationStopped=kC,this}return Q(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var m=this.nativeEvent;m&&(m.preventDefault?m.preventDefault():typeof m.returnValue!="unknown"&&(m.returnValue=!1),this.isDefaultPrevented=Tf)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=Tf)},persist:function(){},isPersistent:Tf}),u}var Jo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fg=Mr(Jo),au=Q({},Jo,{view:0,detail:0}),zz=Mr(au),pg,hg,su,If=Q({},au,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vg,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==su&&(su&&l.type==="mousemove"?(pg=l.screenX-su.screenX,hg=l.screenY-su.screenY):hg=pg=0,su=l),pg)},movementY:function(l){return"movementY"in l?l.movementY:hg}}),RC=Mr(If),Uz=Q({},If,{dataTransfer:0}),qz=Mr(Uz),Wz=Q({},au,{relatedTarget:0}),mg=Mr(Wz),Vz=Q({},Jo,{animationName:0,elapsedTime:0,pseudoElement:0}),Hz=Mr(Vz),Kz=Q({},Jo,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),Gz=Mr(Kz),Yz=Q({},Jo,{data:0}),TC=Mr(Yz),Xz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Qz={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"},Jz={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Zz(l){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(l):(l=Jz[l])?!!u[l]:!1}function vg(){return Zz}var e6=Q({},au,{key:function(l){if(l.key){var u=Xz[l.key]||l.key;if(u!=="Unidentified")return u}return l.type==="keypress"?(l=Rf(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?Qz[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vg,charCode:function(l){return l.type==="keypress"?Rf(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?Rf(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),t6=Mr(e6),n6=Q({},If,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),IC=Mr(n6),r6=Q({},au,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vg}),a6=Mr(r6),s6=Q({},Jo,{propertyName:0,elapsedTime:0,pseudoElement:0}),i6=Mr(s6),o6=Q({},If,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),l6=Mr(o6),c6=[9,13,27,32],gg=c&&"CompositionEvent"in window,iu=null;c&&"documentMode"in document&&(iu=document.documentMode);var u6=c&&"TextEvent"in window&&!iu,MC=c&&(!gg||iu&&8<iu&&11>=iu),$C=" ",DC=!1;function LC(l,u){switch(l){case"keyup":return c6.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function FC(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Zo=!1;function d6(l,u){switch(l){case"compositionend":return FC(u);case"keypress":return u.which!==32?null:(DC=!0,$C);case"textInput":return l=u.data,l===$C&&DC?null:l;default:return null}}function f6(l,u){if(Zo)return l==="compositionend"||!gg&&LC(l,u)?(l=OC(),kf=dg=ii=null,Zo=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return MC&&u.locale!=="ko"?null:u.data;default:return null}}var p6={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 BC(l){var u=l&&l.nodeName&&l.nodeName.toLowerCase();return u==="input"?!!p6[l.type]:u==="textarea"}function zC(l,u,m,b){ue(b),u=Ff(u,"onChange"),0<u.length&&(m=new fg("onChange","change",null,m,b),l.push({event:m,listeners:u}))}var ou=null,lu=null;function h6(l){sA(l,0)}function Mf(l){var u=al(l);if(pe(u))return l}function m6(l,u){if(l==="change")return u}var UC=!1;if(c){var yg;if(c){var xg="oninput"in document;if(!xg){var qC=document.createElement("div");qC.setAttribute("oninput","return;"),xg=typeof qC.oninput=="function"}yg=xg}else yg=!1;UC=yg&&(!document.documentMode||9<document.documentMode)}function WC(){ou&&(ou.detachEvent("onpropertychange",VC),lu=ou=null)}function VC(l){if(l.propertyName==="value"&&Mf(lu)){var u=[];zC(u,lu,l,yr(l)),on(h6,u)}}function v6(l,u,m){l==="focusin"?(WC(),ou=u,lu=m,ou.attachEvent("onpropertychange",VC)):l==="focusout"&&WC()}function g6(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return Mf(lu)}function y6(l,u){if(l==="click")return Mf(u)}function x6(l,u){if(l==="input"||l==="change")return Mf(u)}function b6(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var Ca=typeof Object.is=="function"?Object.is:b6;function cu(l,u){if(Ca(l,u))return!0;if(typeof l!="object"||l===null||typeof u!="object"||u===null)return!1;var m=Object.keys(l),b=Object.keys(u);if(m.length!==b.length)return!1;for(b=0;b<m.length;b++){var C=m[b];if(!d.call(u,C)||!Ca(l[C],u[C]))return!1}return!0}function HC(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function KC(l,u){var m=HC(l);l=0;for(var b;m;){if(m.nodeType===3){if(b=l+m.textContent.length,l<=u&&b>=u)return{node:m,offset:u-l};l=b}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=HC(m)}}function GC(l,u){return l&&u?l===u?!0:l&&l.nodeType===3?!1:u&&u.nodeType===3?GC(l,u.parentNode):"contains"in l?l.contains(u):l.compareDocumentPosition?!!(l.compareDocumentPosition(u)&16):!1:!1}function YC(){for(var l=window,u=ve();u instanceof l.HTMLIFrameElement;){try{var m=typeof u.contentWindow.location.href=="string"}catch{m=!1}if(m)l=u.contentWindow;else break;u=ve(l.document)}return u}function bg(l){var u=l&&l.nodeName&&l.nodeName.toLowerCase();return u&&(u==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||u==="textarea"||l.contentEditable==="true")}function w6(l){var u=YC(),m=l.focusedElem,b=l.selectionRange;if(u!==m&&m&&m.ownerDocument&&GC(m.ownerDocument.documentElement,m)){if(b!==null&&bg(m)){if(u=b.start,l=b.end,l===void 0&&(l=u),"selectionStart"in m)m.selectionStart=u,m.selectionEnd=Math.min(l,m.value.length);else if(l=(u=m.ownerDocument||document)&&u.defaultView||window,l.getSelection){l=l.getSelection();var C=m.textContent.length,_=Math.min(b.start,C);b=b.end===void 0?_:Math.min(b.end,C),!l.extend&&_>b&&(C=b,b=_,_=C),C=KC(m,_);var M=KC(m,b);C&&M&&(l.rangeCount!==1||l.anchorNode!==C.node||l.anchorOffset!==C.offset||l.focusNode!==M.node||l.focusOffset!==M.offset)&&(u=u.createRange(),u.setStart(C.node,C.offset),l.removeAllRanges(),_>b?(l.addRange(u),l.extend(M.node,M.offset)):(u.setEnd(M.node,M.offset),l.addRange(u)))}}for(u=[],l=m;l=l.parentNode;)l.nodeType===1&&u.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof m.focus=="function"&&m.focus(),m=0;m<u.length;m++)l=u[m],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var j6=c&&"documentMode"in document&&11>=document.documentMode,el=null,wg=null,uu=null,jg=!1;function XC(l,u,m){var b=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;jg||el==null||el!==ve(b)||(b=el,"selectionStart"in b&&bg(b)?b={start:b.selectionStart,end:b.selectionEnd}:(b=(b.ownerDocument&&b.ownerDocument.defaultView||window).getSelection(),b={anchorNode:b.anchorNode,anchorOffset:b.anchorOffset,focusNode:b.focusNode,focusOffset:b.focusOffset}),uu&&cu(uu,b)||(uu=b,b=Ff(wg,"onSelect"),0<b.length&&(u=new fg("onSelect","select",null,u,m),l.push({event:u,listeners:b}),u.target=el)))}function $f(l,u){var m={};return m[l.toLowerCase()]=u.toLowerCase(),m["Webkit"+l]="webkit"+u,m["Moz"+l]="moz"+u,m}var tl={animationend:$f("Animation","AnimationEnd"),animationiteration:$f("Animation","AnimationIteration"),animationstart:$f("Animation","AnimationStart"),transitionend:$f("Transition","TransitionEnd")},Sg={},QC={};c&&(QC=document.createElement("div").style,"AnimationEvent"in window||(delete tl.animationend.animation,delete tl.animationiteration.animation,delete tl.animationstart.animation),"TransitionEvent"in window||delete tl.transitionend.transition);function Df(l){if(Sg[l])return Sg[l];if(!tl[l])return l;var u=tl[l],m;for(m in u)if(u.hasOwnProperty(m)&&m in QC)return Sg[l]=u[m];return l}var JC=Df("animationend"),ZC=Df("animationiteration"),eA=Df("animationstart"),tA=Df("transitionend"),nA=new Map,rA="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 oi(l,u){nA.set(l,u),i(u,[l])}for(var Ng=0;Ng<rA.length;Ng++){var Cg=rA[Ng],S6=Cg.toLowerCase(),N6=Cg[0].toUpperCase()+Cg.slice(1);oi(S6,"on"+N6)}oi(JC,"onAnimationEnd"),oi(ZC,"onAnimationIteration"),oi(eA,"onAnimationStart"),oi("dblclick","onDoubleClick"),oi("focusin","onFocus"),oi("focusout","onBlur"),oi(tA,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var du="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(" "),C6=new Set("cancel close invalid load scroll toggle".split(" ").concat(du));function aA(l,u,m){var b=l.type||"unknown-event";l.currentTarget=m,ti(b,u,void 0,l),l.currentTarget=null}function sA(l,u){u=(u&4)!==0;for(var m=0;m<l.length;m++){var b=l[m],C=b.event;b=b.listeners;e:{var _=void 0;if(u)for(var M=b.length-1;0<=M;M--){var Y=b[M],te=Y.instance,me=Y.currentTarget;if(Y=Y.listener,te!==_&&C.isPropagationStopped())break e;aA(C,Y,me),_=te}else for(M=0;M<b.length;M++){if(Y=b[M],te=Y.instance,me=Y.currentTarget,Y=Y.listener,te!==_&&C.isPropagationStopped())break e;aA(C,Y,me),_=te}}}if(ja)throw l=ei,ja=!1,ei=null,l}function cn(l,u){var m=u[Tg];m===void 0&&(m=u[Tg]=new Set);var b=l+"__bubble";m.has(b)||(iA(u,l,2,!1),m.add(b))}function Ag(l,u,m){var b=0;u&&(b|=4),iA(m,l,b,u)}var Lf="_reactListening"+Math.random().toString(36).slice(2);function fu(l){if(!l[Lf]){l[Lf]=!0,r.forEach(function(m){m!=="selectionchange"&&(C6.has(m)||Ag(m,!1,l),Ag(m,!0,l))});var u=l.nodeType===9?l:l.ownerDocument;u===null||u[Lf]||(u[Lf]=!0,Ag("selectionchange",!1,u))}}function iA(l,u,m,b){switch(PC(u)){case 1:var C=Fz;break;case 4:C=Bz;break;default:C=cg}m=C.bind(null,u,m,l),C=void 0,!rr||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(C=!0),b?C!==void 0?l.addEventListener(u,m,{capture:!0,passive:C}):l.addEventListener(u,m,!0):C!==void 0?l.addEventListener(u,m,{passive:C}):l.addEventListener(u,m,!1)}function Eg(l,u,m,b,C){var _=b;if((u&1)===0&&(u&2)===0&&b!==null)e:for(;;){if(b===null)return;var M=b.tag;if(M===3||M===4){var Y=b.stateNode.containerInfo;if(Y===C||Y.nodeType===8&&Y.parentNode===C)break;if(M===4)for(M=b.return;M!==null;){var te=M.tag;if((te===3||te===4)&&(te=M.stateNode.containerInfo,te===C||te.nodeType===8&&te.parentNode===C))return;M=M.return}for(;Y!==null;){if(M=Qi(Y),M===null)return;if(te=M.tag,te===5||te===6){b=_=M;continue e}Y=Y.parentNode}}b=b.return}on(function(){var me=_,Ee=yr(m),ke=[];e:{var Ae=nA.get(l);if(Ae!==void 0){var Ve=fg,Ze=l;switch(l){case"keypress":if(Rf(m)===0)break e;case"keydown":case"keyup":Ve=t6;break;case"focusin":Ze="focus",Ve=mg;break;case"focusout":Ze="blur",Ve=mg;break;case"beforeblur":case"afterblur":Ve=mg;break;case"click":if(m.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ve=RC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ve=qz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ve=a6;break;case JC:case ZC:case eA:Ve=Hz;break;case tA:Ve=i6;break;case"scroll":Ve=zz;break;case"wheel":Ve=l6;break;case"copy":case"cut":case"paste":Ve=Gz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ve=IC}var tt=(u&4)!==0,Nn=!tt&&l==="scroll",le=tt?Ae!==null?Ae+"Capture":null:Ae;tt=[];for(var re=me,fe;re!==null;){fe=re;var Me=fe.stateNode;if(fe.tag===5&&Me!==null&&(fe=Me,le!==null&&(Me=Pt(re,le),Me!=null&&tt.push(pu(re,Me,fe)))),Nn)break;re=re.return}0<tt.length&&(Ae=new Ve(Ae,Ze,null,m,Ee),ke.push({event:Ae,listeners:tt}))}}if((u&7)===0){e:{if(Ae=l==="mouseover"||l==="pointerover",Ve=l==="mouseout"||l==="pointerout",Ae&&m!==kr&&(Ze=m.relatedTarget||m.fromElement)&&(Qi(Ze)||Ze[xs]))break e;if((Ve||Ae)&&(Ae=Ee.window===Ee?Ee:(Ae=Ee.ownerDocument)?Ae.defaultView||Ae.parentWindow:window,Ve?(Ze=m.relatedTarget||m.toElement,Ve=me,Ze=Ze?Qi(Ze):null,Ze!==null&&(Nn=Rr(Ze),Ze!==Nn||Ze.tag!==5&&Ze.tag!==6)&&(Ze=null)):(Ve=null,Ze=me),Ve!==Ze)){if(tt=RC,Me="onMouseLeave",le="onMouseEnter",re="mouse",(l==="pointerout"||l==="pointerover")&&(tt=IC,Me="onPointerLeave",le="onPointerEnter",re="pointer"),Nn=Ve==null?Ae:al(Ve),fe=Ze==null?Ae:al(Ze),Ae=new tt(Me,re+"leave",Ve,m,Ee),Ae.target=Nn,Ae.relatedTarget=fe,Me=null,Qi(Ee)===me&&(tt=new tt(le,re+"enter",Ze,m,Ee),tt.target=fe,tt.relatedTarget=Nn,Me=tt),Nn=Me,Ve&&Ze)t:{for(tt=Ve,le=Ze,re=0,fe=tt;fe;fe=nl(fe))re++;for(fe=0,Me=le;Me;Me=nl(Me))fe++;for(;0<re-fe;)tt=nl(tt),re--;for(;0<fe-re;)le=nl(le),fe--;for(;re--;){if(tt===le||le!==null&&tt===le.alternate)break t;tt=nl(tt),le=nl(le)}tt=null}else tt=null;Ve!==null&&oA(ke,Ae,Ve,tt,!1),Ze!==null&&Nn!==null&&oA(ke,Nn,Ze,tt,!0)}}e:{if(Ae=me?al(me):window,Ve=Ae.nodeName&&Ae.nodeName.toLowerCase(),Ve==="select"||Ve==="input"&&Ae.type==="file")var st=m6;else if(BC(Ae))if(UC)st=x6;else{st=g6;var ut=v6}else(Ve=Ae.nodeName)&&Ve.toLowerCase()==="input"&&(Ae.type==="checkbox"||Ae.type==="radio")&&(st=y6);if(st&&(st=st(l,me))){zC(ke,st,m,Ee);break e}ut&&ut(l,Ae,me),l==="focusout"&&(ut=Ae._wrapperState)&&ut.controlled&&Ae.type==="number"&&Fe(Ae,"number",Ae.value)}switch(ut=me?al(me):window,l){case"focusin":(BC(ut)||ut.contentEditable==="true")&&(el=ut,wg=me,uu=null);break;case"focusout":uu=wg=el=null;break;case"mousedown":jg=!0;break;case"contextmenu":case"mouseup":case"dragend":jg=!1,XC(ke,m,Ee);break;case"selectionchange":if(j6)break;case"keydown":case"keyup":XC(ke,m,Ee)}var dt;if(gg)e:{switch(l){case"compositionstart":var gt="onCompositionStart";break e;case"compositionend":gt="onCompositionEnd";break e;case"compositionupdate":gt="onCompositionUpdate";break e}gt=void 0}else Zo?LC(l,m)&&(gt="onCompositionEnd"):l==="keydown"&&m.keyCode===229&&(gt="onCompositionStart");gt&&(MC&&m.locale!=="ko"&&(Zo||gt!=="onCompositionStart"?gt==="onCompositionEnd"&&Zo&&(dt=OC()):(ii=Ee,dg="value"in ii?ii.value:ii.textContent,Zo=!0)),ut=Ff(me,gt),0<ut.length&&(gt=new TC(gt,l,null,m,Ee),ke.push({event:gt,listeners:ut}),dt?gt.data=dt:(dt=FC(m),dt!==null&&(gt.data=dt)))),(dt=u6?d6(l,m):f6(l,m))&&(me=Ff(me,"onBeforeInput"),0<me.length&&(Ee=new TC("onBeforeInput","beforeinput",null,m,Ee),ke.push({event:Ee,listeners:me}),Ee.data=dt))}sA(ke,u)})}function pu(l,u,m){return{instance:l,listener:u,currentTarget:m}}function Ff(l,u){for(var m=u+"Capture",b=[];l!==null;){var C=l,_=C.stateNode;C.tag===5&&_!==null&&(C=_,_=Pt(l,m),_!=null&&b.unshift(pu(l,_,C)),_=Pt(l,u),_!=null&&b.push(pu(l,_,C))),l=l.return}return b}function nl(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function oA(l,u,m,b,C){for(var _=u._reactName,M=[];m!==null&&m!==b;){var Y=m,te=Y.alternate,me=Y.stateNode;if(te!==null&&te===b)break;Y.tag===5&&me!==null&&(Y=me,C?(te=Pt(m,_),te!=null&&M.unshift(pu(m,te,Y))):C||(te=Pt(m,_),te!=null&&M.push(pu(m,te,Y)))),m=m.return}M.length!==0&&l.push({event:u,listeners:M})}var A6=/\r\n?/g,E6=/\u0000|\uFFFD/g;function lA(l){return(typeof l=="string"?l:""+l).replace(A6,`
|
|
6
|
+
`).replace(E6,"")}function Bf(l,u,m){if(u=lA(u),lA(l)!==u&&m)throw Error(n(425))}function zf(){}var _g=null,Pg=null;function Og(l,u){return l==="textarea"||l==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var kg=typeof setTimeout=="function"?setTimeout:void 0,_6=typeof clearTimeout=="function"?clearTimeout:void 0,cA=typeof Promise=="function"?Promise:void 0,P6=typeof queueMicrotask=="function"?queueMicrotask:typeof cA<"u"?function(l){return cA.resolve(null).then(l).catch(O6)}:kg;function O6(l){setTimeout(function(){throw l})}function Rg(l,u){var m=u,b=0;do{var C=m.nextSibling;if(l.removeChild(m),C&&C.nodeType===8)if(m=C.data,m==="/$"){if(b===0){l.removeChild(C),ru(u);return}b--}else m!=="$"&&m!=="$?"&&m!=="$!"||b++;m=C}while(m);ru(u)}function li(l){for(;l!=null;l=l.nextSibling){var u=l.nodeType;if(u===1||u===3)break;if(u===8){if(u=l.data,u==="$"||u==="$!"||u==="$?")break;if(u==="/$")return null}}return l}function uA(l){l=l.previousSibling;for(var u=0;l;){if(l.nodeType===8){var m=l.data;if(m==="$"||m==="$!"||m==="$?"){if(u===0)return l;u--}else m==="/$"&&u++}l=l.previousSibling}return null}var rl=Math.random().toString(36).slice(2),Ya="__reactFiber$"+rl,hu="__reactProps$"+rl,xs="__reactContainer$"+rl,Tg="__reactEvents$"+rl,k6="__reactListeners$"+rl,R6="__reactHandles$"+rl;function Qi(l){var u=l[Ya];if(u)return u;for(var m=l.parentNode;m;){if(u=m[xs]||m[Ya]){if(m=u.alternate,u.child!==null||m!==null&&m.child!==null)for(l=uA(l);l!==null;){if(m=l[Ya])return m;l=uA(l)}return u}l=m,m=l.parentNode}return null}function mu(l){return l=l[Ya]||l[xs],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function al(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function Uf(l){return l[hu]||null}var Ig=[],sl=-1;function ci(l){return{current:l}}function un(l){0>sl||(l.current=Ig[sl],Ig[sl]=null,sl--)}function nn(l,u){sl++,Ig[sl]=l.current,l.current=u}var ui={},ar=ci(ui),br=ci(!1),Ji=ui;function il(l,u){var m=l.type.contextTypes;if(!m)return ui;var b=l.stateNode;if(b&&b.__reactInternalMemoizedUnmaskedChildContext===u)return b.__reactInternalMemoizedMaskedChildContext;var C={},_;for(_ in m)C[_]=u[_];return b&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=u,l.__reactInternalMemoizedMaskedChildContext=C),C}function wr(l){return l=l.childContextTypes,l!=null}function qf(){un(br),un(ar)}function dA(l,u,m){if(ar.current!==ui)throw Error(n(168));nn(ar,u),nn(br,m)}function fA(l,u,m){var b=l.stateNode;if(u=u.childContextTypes,typeof b.getChildContext!="function")return m;b=b.getChildContext();for(var C in b)if(!(C in u))throw Error(n(108,ie(l)||"Unknown",C));return Q({},m,b)}function Wf(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||ui,Ji=ar.current,nn(ar,l),nn(br,br.current),!0}function pA(l,u,m){var b=l.stateNode;if(!b)throw Error(n(169));m?(l=fA(l,u,Ji),b.__reactInternalMemoizedMergedChildContext=l,un(br),un(ar),nn(ar,l)):un(br),nn(br,m)}var bs=null,Vf=!1,Mg=!1;function hA(l){bs===null?bs=[l]:bs.push(l)}function T6(l){Vf=!0,hA(l)}function di(){if(!Mg&&bs!==null){Mg=!0;var l=0,u=Ht;try{var m=bs;for(Ht=1;l<m.length;l++){var b=m[l];do b=b(!0);while(b!==null)}bs=null,Vf=!1}catch(C){throw bs!==null&&(bs=bs.slice(l+1)),Ga(T,di),C}finally{Ht=u,Mg=!1}}return null}var ol=[],ll=0,Hf=null,Kf=0,ta=[],na=0,Zi=null,ws=1,js="";function eo(l,u){ol[ll++]=Kf,ol[ll++]=Hf,Hf=l,Kf=u}function mA(l,u,m){ta[na++]=ws,ta[na++]=js,ta[na++]=Zi,Zi=l;var b=ws;l=js;var C=32-Ct(b)-1;b&=~(1<<C),m+=1;var _=32-Ct(u)+C;if(30<_){var M=C-C%5;_=(b&(1<<M)-1).toString(32),b>>=M,C-=M,ws=1<<32-Ct(u)+C|m<<C|b,js=_+l}else ws=1<<_|m<<C|b,js=l}function $g(l){l.return!==null&&(eo(l,1),mA(l,1,0))}function Dg(l){for(;l===Hf;)Hf=ol[--ll],ol[ll]=null,Kf=ol[--ll],ol[ll]=null;for(;l===Zi;)Zi=ta[--na],ta[na]=null,js=ta[--na],ta[na]=null,ws=ta[--na],ta[na]=null}var $r=null,Dr=null,hn=!1,Aa=null;function vA(l,u){var m=ia(5,null,null,0);m.elementType="DELETED",m.stateNode=u,m.return=l,u=l.deletions,u===null?(l.deletions=[m],l.flags|=16):u.push(m)}function gA(l,u){switch(l.tag){case 5:var m=l.type;return u=u.nodeType!==1||m.toLowerCase()!==u.nodeName.toLowerCase()?null:u,u!==null?(l.stateNode=u,$r=l,Dr=li(u.firstChild),!0):!1;case 6:return u=l.pendingProps===""||u.nodeType!==3?null:u,u!==null?(l.stateNode=u,$r=l,Dr=null,!0):!1;case 13:return u=u.nodeType!==8?null:u,u!==null?(m=Zi!==null?{id:ws,overflow:js}:null,l.memoizedState={dehydrated:u,treeContext:m,retryLane:1073741824},m=ia(18,null,null,0),m.stateNode=u,m.return=l,l.child=m,$r=l,Dr=null,!0):!1;default:return!1}}function Lg(l){return(l.mode&1)!==0&&(l.flags&128)===0}function Fg(l){if(hn){var u=Dr;if(u){var m=u;if(!gA(l,u)){if(Lg(l))throw Error(n(418));u=li(m.nextSibling);var b=$r;u&&gA(l,u)?vA(b,m):(l.flags=l.flags&-4097|2,hn=!1,$r=l)}}else{if(Lg(l))throw Error(n(418));l.flags=l.flags&-4097|2,hn=!1,$r=l}}}function yA(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;$r=l}function Gf(l){if(l!==$r)return!1;if(!hn)return yA(l),hn=!0,!1;var u;if((u=l.tag!==3)&&!(u=l.tag!==5)&&(u=l.type,u=u!=="head"&&u!=="body"&&!Og(l.type,l.memoizedProps)),u&&(u=Dr)){if(Lg(l))throw xA(),Error(n(418));for(;u;)vA(l,u),u=li(u.nextSibling)}if(yA(l),l.tag===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(n(317));e:{for(l=l.nextSibling,u=0;l;){if(l.nodeType===8){var m=l.data;if(m==="/$"){if(u===0){Dr=li(l.nextSibling);break e}u--}else m!=="$"&&m!=="$!"&&m!=="$?"||u++}l=l.nextSibling}Dr=null}}else Dr=$r?li(l.stateNode.nextSibling):null;return!0}function xA(){for(var l=Dr;l;)l=li(l.nextSibling)}function cl(){Dr=$r=null,hn=!1}function Bg(l){Aa===null?Aa=[l]:Aa.push(l)}var I6=P.ReactCurrentBatchConfig;function vu(l,u,m){if(l=m.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(m._owner){if(m=m._owner,m){if(m.tag!==1)throw Error(n(309));var b=m.stateNode}if(!b)throw Error(n(147,l));var C=b,_=""+l;return u!==null&&u.ref!==null&&typeof u.ref=="function"&&u.ref._stringRef===_?u.ref:(u=function(M){var Y=C.refs;M===null?delete Y[_]:Y[_]=M},u._stringRef=_,u)}if(typeof l!="string")throw Error(n(284));if(!m._owner)throw Error(n(290,l))}return l}function Yf(l,u){throw l=Object.prototype.toString.call(u),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":l))}function bA(l){var u=l._init;return u(l._payload)}function wA(l){function u(le,re){if(l){var fe=le.deletions;fe===null?(le.deletions=[re],le.flags|=16):fe.push(re)}}function m(le,re){if(!l)return null;for(;re!==null;)u(le,re),re=re.sibling;return null}function b(le,re){for(le=new Map;re!==null;)re.key!==null?le.set(re.key,re):le.set(re.index,re),re=re.sibling;return le}function C(le,re){return le=xi(le,re),le.index=0,le.sibling=null,le}function _(le,re,fe){return le.index=fe,l?(fe=le.alternate,fe!==null?(fe=fe.index,fe<re?(le.flags|=2,re):fe):(le.flags|=2,re)):(le.flags|=1048576,re)}function M(le){return l&&le.alternate===null&&(le.flags|=2),le}function Y(le,re,fe,Me){return re===null||re.tag!==6?(re=ky(fe,le.mode,Me),re.return=le,re):(re=C(re,fe),re.return=le,re)}function te(le,re,fe,Me){var st=fe.type;return st===k?Ee(le,re,fe.props.children,Me,fe.key):re!==null&&(re.elementType===st||typeof st=="object"&&st!==null&&st.$$typeof===X&&bA(st)===re.type)?(Me=C(re,fe.props),Me.ref=vu(le,re,fe),Me.return=le,Me):(Me=xp(fe.type,fe.key,fe.props,null,le.mode,Me),Me.ref=vu(le,re,fe),Me.return=le,Me)}function me(le,re,fe,Me){return re===null||re.tag!==4||re.stateNode.containerInfo!==fe.containerInfo||re.stateNode.implementation!==fe.implementation?(re=Ry(fe,le.mode,Me),re.return=le,re):(re=C(re,fe.children||[]),re.return=le,re)}function Ee(le,re,fe,Me,st){return re===null||re.tag!==7?(re=lo(fe,le.mode,Me,st),re.return=le,re):(re=C(re,fe),re.return=le,re)}function ke(le,re,fe){if(typeof re=="string"&&re!==""||typeof re=="number")return re=ky(""+re,le.mode,fe),re.return=le,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case E:return fe=xp(re.type,re.key,re.props,null,le.mode,fe),fe.ref=vu(le,null,re),fe.return=le,fe;case O:return re=Ry(re,le.mode,fe),re.return=le,re;case X:var Me=re._init;return ke(le,Me(re._payload),fe)}if(je(re)||F(re))return re=lo(re,le.mode,fe,null),re.return=le,re;Yf(le,re)}return null}function Ae(le,re,fe,Me){var st=re!==null?re.key:null;if(typeof fe=="string"&&fe!==""||typeof fe=="number")return st!==null?null:Y(le,re,""+fe,Me);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case E:return fe.key===st?te(le,re,fe,Me):null;case O:return fe.key===st?me(le,re,fe,Me):null;case X:return st=fe._init,Ae(le,re,st(fe._payload),Me)}if(je(fe)||F(fe))return st!==null?null:Ee(le,re,fe,Me,null);Yf(le,fe)}return null}function Ve(le,re,fe,Me,st){if(typeof Me=="string"&&Me!==""||typeof Me=="number")return le=le.get(fe)||null,Y(re,le,""+Me,st);if(typeof Me=="object"&&Me!==null){switch(Me.$$typeof){case E:return le=le.get(Me.key===null?fe:Me.key)||null,te(re,le,Me,st);case O:return le=le.get(Me.key===null?fe:Me.key)||null,me(re,le,Me,st);case X:var ut=Me._init;return Ve(le,re,fe,ut(Me._payload),st)}if(je(Me)||F(Me))return le=le.get(fe)||null,Ee(re,le,Me,st,null);Yf(re,Me)}return null}function Ze(le,re,fe,Me){for(var st=null,ut=null,dt=re,gt=re=0,Hn=null;dt!==null&><fe.length;gt++){dt.index>gt?(Hn=dt,dt=null):Hn=dt.sibling;var Tt=Ae(le,dt,fe[gt],Me);if(Tt===null){dt===null&&(dt=Hn);break}l&&dt&&Tt.alternate===null&&u(le,dt),re=_(Tt,re,gt),ut===null?st=Tt:ut.sibling=Tt,ut=Tt,dt=Hn}if(gt===fe.length)return m(le,dt),hn&&eo(le,gt),st;if(dt===null){for(;gt<fe.length;gt++)dt=ke(le,fe[gt],Me),dt!==null&&(re=_(dt,re,gt),ut===null?st=dt:ut.sibling=dt,ut=dt);return hn&&eo(le,gt),st}for(dt=b(le,dt);gt<fe.length;gt++)Hn=Ve(dt,le,gt,fe[gt],Me),Hn!==null&&(l&&Hn.alternate!==null&&dt.delete(Hn.key===null?gt:Hn.key),re=_(Hn,re,gt),ut===null?st=Hn:ut.sibling=Hn,ut=Hn);return l&&dt.forEach(function(bi){return u(le,bi)}),hn&&eo(le,gt),st}function tt(le,re,fe,Me){var st=F(fe);if(typeof st!="function")throw Error(n(150));if(fe=st.call(fe),fe==null)throw Error(n(151));for(var ut=st=null,dt=re,gt=re=0,Hn=null,Tt=fe.next();dt!==null&&!Tt.done;gt++,Tt=fe.next()){dt.index>gt?(Hn=dt,dt=null):Hn=dt.sibling;var bi=Ae(le,dt,Tt.value,Me);if(bi===null){dt===null&&(dt=Hn);break}l&&dt&&bi.alternate===null&&u(le,dt),re=_(bi,re,gt),ut===null?st=bi:ut.sibling=bi,ut=bi,dt=Hn}if(Tt.done)return m(le,dt),hn&&eo(le,gt),st;if(dt===null){for(;!Tt.done;gt++,Tt=fe.next())Tt=ke(le,Tt.value,Me),Tt!==null&&(re=_(Tt,re,gt),ut===null?st=Tt:ut.sibling=Tt,ut=Tt);return hn&&eo(le,gt),st}for(dt=b(le,dt);!Tt.done;gt++,Tt=fe.next())Tt=Ve(dt,le,gt,Tt.value,Me),Tt!==null&&(l&&Tt.alternate!==null&&dt.delete(Tt.key===null?gt:Tt.key),re=_(Tt,re,gt),ut===null?st=Tt:ut.sibling=Tt,ut=Tt);return l&&dt.forEach(function(p7){return u(le,p7)}),hn&&eo(le,gt),st}function Nn(le,re,fe,Me){if(typeof fe=="object"&&fe!==null&&fe.type===k&&fe.key===null&&(fe=fe.props.children),typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case E:e:{for(var st=fe.key,ut=re;ut!==null;){if(ut.key===st){if(st=fe.type,st===k){if(ut.tag===7){m(le,ut.sibling),re=C(ut,fe.props.children),re.return=le,le=re;break e}}else if(ut.elementType===st||typeof st=="object"&&st!==null&&st.$$typeof===X&&bA(st)===ut.type){m(le,ut.sibling),re=C(ut,fe.props),re.ref=vu(le,ut,fe),re.return=le,le=re;break e}m(le,ut);break}else u(le,ut);ut=ut.sibling}fe.type===k?(re=lo(fe.props.children,le.mode,Me,fe.key),re.return=le,le=re):(Me=xp(fe.type,fe.key,fe.props,null,le.mode,Me),Me.ref=vu(le,re,fe),Me.return=le,le=Me)}return M(le);case O:e:{for(ut=fe.key;re!==null;){if(re.key===ut)if(re.tag===4&&re.stateNode.containerInfo===fe.containerInfo&&re.stateNode.implementation===fe.implementation){m(le,re.sibling),re=C(re,fe.children||[]),re.return=le,le=re;break e}else{m(le,re);break}else u(le,re);re=re.sibling}re=Ry(fe,le.mode,Me),re.return=le,le=re}return M(le);case X:return ut=fe._init,Nn(le,re,ut(fe._payload),Me)}if(je(fe))return Ze(le,re,fe,Me);if(F(fe))return tt(le,re,fe,Me);Yf(le,fe)}return typeof fe=="string"&&fe!==""||typeof fe=="number"?(fe=""+fe,re!==null&&re.tag===6?(m(le,re.sibling),re=C(re,fe),re.return=le,le=re):(m(le,re),re=ky(fe,le.mode,Me),re.return=le,le=re),M(le)):m(le,re)}return Nn}var ul=wA(!0),jA=wA(!1),Xf=ci(null),Qf=null,dl=null,zg=null;function Ug(){zg=dl=Qf=null}function qg(l){var u=Xf.current;un(Xf),l._currentValue=u}function Wg(l,u,m){for(;l!==null;){var b=l.alternate;if((l.childLanes&u)!==u?(l.childLanes|=u,b!==null&&(b.childLanes|=u)):b!==null&&(b.childLanes&u)!==u&&(b.childLanes|=u),l===m)break;l=l.return}}function fl(l,u){Qf=l,zg=dl=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&u)!==0&&(jr=!0),l.firstContext=null)}function ra(l){var u=l._currentValue;if(zg!==l)if(l={context:l,memoizedValue:u,next:null},dl===null){if(Qf===null)throw Error(n(308));dl=l,Qf.dependencies={lanes:0,firstContext:l}}else dl=dl.next=l;return u}var to=null;function Vg(l){to===null?to=[l]:to.push(l)}function SA(l,u,m,b){var C=u.interleaved;return C===null?(m.next=m,Vg(u)):(m.next=C.next,C.next=m),u.interleaved=m,Ss(l,b)}function Ss(l,u){l.lanes|=u;var m=l.alternate;for(m!==null&&(m.lanes|=u),m=l,l=l.return;l!==null;)l.childLanes|=u,m=l.alternate,m!==null&&(m.childLanes|=u),m=l,l=l.return;return m.tag===3?m.stateNode:null}var fi=!1;function Hg(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function NA(l,u){l=l.updateQueue,u.updateQueue===l&&(u.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function Ns(l,u){return{eventTime:l,lane:u,tag:0,payload:null,callback:null,next:null}}function pi(l,u,m){var b=l.updateQueue;if(b===null)return null;if(b=b.shared,(Rt&2)!==0){var C=b.pending;return C===null?u.next=u:(u.next=C.next,C.next=u),b.pending=u,Ss(l,m)}return C=b.interleaved,C===null?(u.next=u,Vg(b)):(u.next=C.next,C.next=u),b.interleaved=u,Ss(l,m)}function Jf(l,u,m){if(u=u.updateQueue,u!==null&&(u=u.shared,(m&4194240)!==0)){var b=u.lanes;b&=l.pendingLanes,m|=b,u.lanes=m,ig(l,m)}}function CA(l,u){var m=l.updateQueue,b=l.alternate;if(b!==null&&(b=b.updateQueue,m===b)){var C=null,_=null;if(m=m.firstBaseUpdate,m!==null){do{var M={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};_===null?C=_=M:_=_.next=M,m=m.next}while(m!==null);_===null?C=_=u:_=_.next=u}else C=_=u;m={baseState:b.baseState,firstBaseUpdate:C,lastBaseUpdate:_,shared:b.shared,effects:b.effects},l.updateQueue=m;return}l=m.lastBaseUpdate,l===null?m.firstBaseUpdate=u:l.next=u,m.lastBaseUpdate=u}function Zf(l,u,m,b){var C=l.updateQueue;fi=!1;var _=C.firstBaseUpdate,M=C.lastBaseUpdate,Y=C.shared.pending;if(Y!==null){C.shared.pending=null;var te=Y,me=te.next;te.next=null,M===null?_=me:M.next=me,M=te;var Ee=l.alternate;Ee!==null&&(Ee=Ee.updateQueue,Y=Ee.lastBaseUpdate,Y!==M&&(Y===null?Ee.firstBaseUpdate=me:Y.next=me,Ee.lastBaseUpdate=te))}if(_!==null){var ke=C.baseState;M=0,Ee=me=te=null,Y=_;do{var Ae=Y.lane,Ve=Y.eventTime;if((b&Ae)===Ae){Ee!==null&&(Ee=Ee.next={eventTime:Ve,lane:0,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null});e:{var Ze=l,tt=Y;switch(Ae=u,Ve=m,tt.tag){case 1:if(Ze=tt.payload,typeof Ze=="function"){ke=Ze.call(Ve,ke,Ae);break e}ke=Ze;break e;case 3:Ze.flags=Ze.flags&-65537|128;case 0:if(Ze=tt.payload,Ae=typeof Ze=="function"?Ze.call(Ve,ke,Ae):Ze,Ae==null)break e;ke=Q({},ke,Ae);break e;case 2:fi=!0}}Y.callback!==null&&Y.lane!==0&&(l.flags|=64,Ae=C.effects,Ae===null?C.effects=[Y]:Ae.push(Y))}else Ve={eventTime:Ve,lane:Ae,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},Ee===null?(me=Ee=Ve,te=ke):Ee=Ee.next=Ve,M|=Ae;if(Y=Y.next,Y===null){if(Y=C.shared.pending,Y===null)break;Ae=Y,Y=Ae.next,Ae.next=null,C.lastBaseUpdate=Ae,C.shared.pending=null}}while(!0);if(Ee===null&&(te=ke),C.baseState=te,C.firstBaseUpdate=me,C.lastBaseUpdate=Ee,u=C.shared.interleaved,u!==null){C=u;do M|=C.lane,C=C.next;while(C!==u)}else _===null&&(C.shared.lanes=0);ao|=M,l.lanes=M,l.memoizedState=ke}}function AA(l,u,m){if(l=u.effects,u.effects=null,l!==null)for(u=0;u<l.length;u++){var b=l[u],C=b.callback;if(C!==null){if(b.callback=null,b=m,typeof C!="function")throw Error(n(191,C));C.call(b)}}}var gu={},Xa=ci(gu),yu=ci(gu),xu=ci(gu);function no(l){if(l===gu)throw Error(n(174));return l}function Kg(l,u){switch(nn(xu,u),nn(yu,l),nn(Xa,gu),l=u.nodeType,l){case 9:case 11:u=(u=u.documentElement)?u.namespaceURI:Ye(null,"");break;default:l=l===8?u.parentNode:u,u=l.namespaceURI||null,l=l.tagName,u=Ye(u,l)}un(Xa),nn(Xa,u)}function pl(){un(Xa),un(yu),un(xu)}function EA(l){no(xu.current);var u=no(Xa.current),m=Ye(u,l.type);u!==m&&(nn(yu,l),nn(Xa,m))}function Gg(l){yu.current===l&&(un(Xa),un(yu))}var vn=ci(0);function ep(l){for(var u=l;u!==null;){if(u.tag===13){var m=u.memoizedState;if(m!==null&&(m=m.dehydrated,m===null||m.data==="$?"||m.data==="$!"))return u}else if(u.tag===19&&u.memoizedProps.revealOrder!==void 0){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===l)break;for(;u.sibling===null;){if(u.return===null||u.return===l)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var Yg=[];function Xg(){for(var l=0;l<Yg.length;l++)Yg[l]._workInProgressVersionPrimary=null;Yg.length=0}var tp=P.ReactCurrentDispatcher,Qg=P.ReactCurrentBatchConfig,ro=0,gn=null,In=null,Wn=null,np=!1,bu=!1,wu=0,M6=0;function sr(){throw Error(n(321))}function Jg(l,u){if(u===null)return!1;for(var m=0;m<u.length&&m<l.length;m++)if(!Ca(l[m],u[m]))return!1;return!0}function Zg(l,u,m,b,C,_){if(ro=_,gn=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,tp.current=l===null||l.memoizedState===null?F6:B6,l=m(b,C),bu){_=0;do{if(bu=!1,wu=0,25<=_)throw Error(n(301));_+=1,Wn=In=null,u.updateQueue=null,tp.current=z6,l=m(b,C)}while(bu)}if(tp.current=sp,u=In!==null&&In.next!==null,ro=0,Wn=In=gn=null,np=!1,u)throw Error(n(300));return l}function ey(){var l=wu!==0;return wu=0,l}function Qa(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Wn===null?gn.memoizedState=Wn=l:Wn=Wn.next=l,Wn}function aa(){if(In===null){var l=gn.alternate;l=l!==null?l.memoizedState:null}else l=In.next;var u=Wn===null?gn.memoizedState:Wn.next;if(u!==null)Wn=u,In=l;else{if(l===null)throw Error(n(310));In=l,l={memoizedState:In.memoizedState,baseState:In.baseState,baseQueue:In.baseQueue,queue:In.queue,next:null},Wn===null?gn.memoizedState=Wn=l:Wn=Wn.next=l}return Wn}function ju(l,u){return typeof u=="function"?u(l):u}function ty(l){var u=aa(),m=u.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=l;var b=In,C=b.baseQueue,_=m.pending;if(_!==null){if(C!==null){var M=C.next;C.next=_.next,_.next=M}b.baseQueue=C=_,m.pending=null}if(C!==null){_=C.next,b=b.baseState;var Y=M=null,te=null,me=_;do{var Ee=me.lane;if((ro&Ee)===Ee)te!==null&&(te=te.next={lane:0,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null}),b=me.hasEagerState?me.eagerState:l(b,me.action);else{var ke={lane:Ee,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null};te===null?(Y=te=ke,M=b):te=te.next=ke,gn.lanes|=Ee,ao|=Ee}me=me.next}while(me!==null&&me!==_);te===null?M=b:te.next=Y,Ca(b,u.memoizedState)||(jr=!0),u.memoizedState=b,u.baseState=M,u.baseQueue=te,m.lastRenderedState=b}if(l=m.interleaved,l!==null){C=l;do _=C.lane,gn.lanes|=_,ao|=_,C=C.next;while(C!==l)}else C===null&&(m.lanes=0);return[u.memoizedState,m.dispatch]}function ny(l){var u=aa(),m=u.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=l;var b=m.dispatch,C=m.pending,_=u.memoizedState;if(C!==null){m.pending=null;var M=C=C.next;do _=l(_,M.action),M=M.next;while(M!==C);Ca(_,u.memoizedState)||(jr=!0),u.memoizedState=_,u.baseQueue===null&&(u.baseState=_),m.lastRenderedState=_}return[_,b]}function _A(){}function PA(l,u){var m=gn,b=aa(),C=u(),_=!Ca(b.memoizedState,C);if(_&&(b.memoizedState=C,jr=!0),b=b.queue,ry(RA.bind(null,m,b,l),[l]),b.getSnapshot!==u||_||Wn!==null&&Wn.memoizedState.tag&1){if(m.flags|=2048,Su(9,kA.bind(null,m,b,C,u),void 0,null),Vn===null)throw Error(n(349));(ro&30)!==0||OA(m,u,C)}return C}function OA(l,u,m){l.flags|=16384,l={getSnapshot:u,value:m},u=gn.updateQueue,u===null?(u={lastEffect:null,stores:null},gn.updateQueue=u,u.stores=[l]):(m=u.stores,m===null?u.stores=[l]:m.push(l))}function kA(l,u,m,b){u.value=m,u.getSnapshot=b,TA(u)&&IA(l)}function RA(l,u,m){return m(function(){TA(u)&&IA(l)})}function TA(l){var u=l.getSnapshot;l=l.value;try{var m=u();return!Ca(l,m)}catch{return!0}}function IA(l){var u=Ss(l,1);u!==null&&Oa(u,l,1,-1)}function MA(l){var u=Qa();return typeof l=="function"&&(l=l()),u.memoizedState=u.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ju,lastRenderedState:l},u.queue=l,l=l.dispatch=L6.bind(null,gn,l),[u.memoizedState,l]}function Su(l,u,m,b){return l={tag:l,create:u,destroy:m,deps:b,next:null},u=gn.updateQueue,u===null?(u={lastEffect:null,stores:null},gn.updateQueue=u,u.lastEffect=l.next=l):(m=u.lastEffect,m===null?u.lastEffect=l.next=l:(b=m.next,m.next=l,l.next=b,u.lastEffect=l)),l}function $A(){return aa().memoizedState}function rp(l,u,m,b){var C=Qa();gn.flags|=l,C.memoizedState=Su(1|u,m,void 0,b===void 0?null:b)}function ap(l,u,m,b){var C=aa();b=b===void 0?null:b;var _=void 0;if(In!==null){var M=In.memoizedState;if(_=M.destroy,b!==null&&Jg(b,M.deps)){C.memoizedState=Su(u,m,_,b);return}}gn.flags|=l,C.memoizedState=Su(1|u,m,_,b)}function DA(l,u){return rp(8390656,8,l,u)}function ry(l,u){return ap(2048,8,l,u)}function LA(l,u){return ap(4,2,l,u)}function FA(l,u){return ap(4,4,l,u)}function BA(l,u){if(typeof u=="function")return l=l(),u(l),function(){u(null)};if(u!=null)return l=l(),u.current=l,function(){u.current=null}}function zA(l,u,m){return m=m!=null?m.concat([l]):null,ap(4,4,BA.bind(null,u,l),m)}function ay(){}function UA(l,u){var m=aa();u=u===void 0?null:u;var b=m.memoizedState;return b!==null&&u!==null&&Jg(u,b[1])?b[0]:(m.memoizedState=[l,u],l)}function qA(l,u){var m=aa();u=u===void 0?null:u;var b=m.memoizedState;return b!==null&&u!==null&&Jg(u,b[1])?b[0]:(l=l(),m.memoizedState=[l,u],l)}function WA(l,u,m){return(ro&21)===0?(l.baseState&&(l.baseState=!1,jr=!0),l.memoizedState=m):(Ca(m,u)||(m=bC(),gn.lanes|=m,ao|=m,l.baseState=!0),u)}function $6(l,u){var m=Ht;Ht=m!==0&&4>m?m:4,l(!0);var b=Qg.transition;Qg.transition={};try{l(!1),u()}finally{Ht=m,Qg.transition=b}}function VA(){return aa().memoizedState}function D6(l,u,m){var b=gi(l);if(m={lane:b,action:m,hasEagerState:!1,eagerState:null,next:null},HA(l))KA(u,m);else if(m=SA(l,u,m,b),m!==null){var C=ur();Oa(m,l,b,C),GA(m,u,b)}}function L6(l,u,m){var b=gi(l),C={lane:b,action:m,hasEagerState:!1,eagerState:null,next:null};if(HA(l))KA(u,C);else{var _=l.alternate;if(l.lanes===0&&(_===null||_.lanes===0)&&(_=u.lastRenderedReducer,_!==null))try{var M=u.lastRenderedState,Y=_(M,m);if(C.hasEagerState=!0,C.eagerState=Y,Ca(Y,M)){var te=u.interleaved;te===null?(C.next=C,Vg(u)):(C.next=te.next,te.next=C),u.interleaved=C;return}}catch{}m=SA(l,u,C,b),m!==null&&(C=ur(),Oa(m,l,b,C),GA(m,u,b))}}function HA(l){var u=l.alternate;return l===gn||u!==null&&u===gn}function KA(l,u){bu=np=!0;var m=l.pending;m===null?u.next=u:(u.next=m.next,m.next=u),l.pending=u}function GA(l,u,m){if((m&4194240)!==0){var b=u.lanes;b&=l.pendingLanes,m|=b,u.lanes=m,ig(l,m)}}var sp={readContext:ra,useCallback:sr,useContext:sr,useEffect:sr,useImperativeHandle:sr,useInsertionEffect:sr,useLayoutEffect:sr,useMemo:sr,useReducer:sr,useRef:sr,useState:sr,useDebugValue:sr,useDeferredValue:sr,useTransition:sr,useMutableSource:sr,useSyncExternalStore:sr,useId:sr,unstable_isNewReconciler:!1},F6={readContext:ra,useCallback:function(l,u){return Qa().memoizedState=[l,u===void 0?null:u],l},useContext:ra,useEffect:DA,useImperativeHandle:function(l,u,m){return m=m!=null?m.concat([l]):null,rp(4194308,4,BA.bind(null,u,l),m)},useLayoutEffect:function(l,u){return rp(4194308,4,l,u)},useInsertionEffect:function(l,u){return rp(4,2,l,u)},useMemo:function(l,u){var m=Qa();return u=u===void 0?null:u,l=l(),m.memoizedState=[l,u],l},useReducer:function(l,u,m){var b=Qa();return u=m!==void 0?m(u):u,b.memoizedState=b.baseState=u,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:u},b.queue=l,l=l.dispatch=D6.bind(null,gn,l),[b.memoizedState,l]},useRef:function(l){var u=Qa();return l={current:l},u.memoizedState=l},useState:MA,useDebugValue:ay,useDeferredValue:function(l){return Qa().memoizedState=l},useTransition:function(){var l=MA(!1),u=l[0];return l=$6.bind(null,l[1]),Qa().memoizedState=l,[u,l]},useMutableSource:function(){},useSyncExternalStore:function(l,u,m){var b=gn,C=Qa();if(hn){if(m===void 0)throw Error(n(407));m=m()}else{if(m=u(),Vn===null)throw Error(n(349));(ro&30)!==0||OA(b,u,m)}C.memoizedState=m;var _={value:m,getSnapshot:u};return C.queue=_,DA(RA.bind(null,b,_,l),[l]),b.flags|=2048,Su(9,kA.bind(null,b,_,m,u),void 0,null),m},useId:function(){var l=Qa(),u=Vn.identifierPrefix;if(hn){var m=js,b=ws;m=(b&~(1<<32-Ct(b)-1)).toString(32)+m,u=":"+u+"R"+m,m=wu++,0<m&&(u+="H"+m.toString(32)),u+=":"}else m=M6++,u=":"+u+"r"+m.toString(32)+":";return l.memoizedState=u},unstable_isNewReconciler:!1},B6={readContext:ra,useCallback:UA,useContext:ra,useEffect:ry,useImperativeHandle:zA,useInsertionEffect:LA,useLayoutEffect:FA,useMemo:qA,useReducer:ty,useRef:$A,useState:function(){return ty(ju)},useDebugValue:ay,useDeferredValue:function(l){var u=aa();return WA(u,In.memoizedState,l)},useTransition:function(){var l=ty(ju)[0],u=aa().memoizedState;return[l,u]},useMutableSource:_A,useSyncExternalStore:PA,useId:VA,unstable_isNewReconciler:!1},z6={readContext:ra,useCallback:UA,useContext:ra,useEffect:ry,useImperativeHandle:zA,useInsertionEffect:LA,useLayoutEffect:FA,useMemo:qA,useReducer:ny,useRef:$A,useState:function(){return ny(ju)},useDebugValue:ay,useDeferredValue:function(l){var u=aa();return In===null?u.memoizedState=l:WA(u,In.memoizedState,l)},useTransition:function(){var l=ny(ju)[0],u=aa().memoizedState;return[l,u]},useMutableSource:_A,useSyncExternalStore:PA,useId:VA,unstable_isNewReconciler:!1};function Ea(l,u){if(l&&l.defaultProps){u=Q({},u),l=l.defaultProps;for(var m in l)u[m]===void 0&&(u[m]=l[m]);return u}return u}function sy(l,u,m,b){u=l.memoizedState,m=m(b,u),m=m==null?u:Q({},u,m),l.memoizedState=m,l.lanes===0&&(l.updateQueue.baseState=m)}var ip={isMounted:function(l){return(l=l._reactInternals)?Rr(l)===l:!1},enqueueSetState:function(l,u,m){l=l._reactInternals;var b=ur(),C=gi(l),_=Ns(b,C);_.payload=u,m!=null&&(_.callback=m),u=pi(l,_,C),u!==null&&(Oa(u,l,C,b),Jf(u,l,C))},enqueueReplaceState:function(l,u,m){l=l._reactInternals;var b=ur(),C=gi(l),_=Ns(b,C);_.tag=1,_.payload=u,m!=null&&(_.callback=m),u=pi(l,_,C),u!==null&&(Oa(u,l,C,b),Jf(u,l,C))},enqueueForceUpdate:function(l,u){l=l._reactInternals;var m=ur(),b=gi(l),C=Ns(m,b);C.tag=2,u!=null&&(C.callback=u),u=pi(l,C,b),u!==null&&(Oa(u,l,b,m),Jf(u,l,b))}};function YA(l,u,m,b,C,_,M){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(b,_,M):u.prototype&&u.prototype.isPureReactComponent?!cu(m,b)||!cu(C,_):!0}function XA(l,u,m){var b=!1,C=ui,_=u.contextType;return typeof _=="object"&&_!==null?_=ra(_):(C=wr(u)?Ji:ar.current,b=u.contextTypes,_=(b=b!=null)?il(l,C):ui),u=new u(m,_),l.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=ip,l.stateNode=u,u._reactInternals=l,b&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=C,l.__reactInternalMemoizedMaskedChildContext=_),u}function QA(l,u,m,b){l=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(m,b),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(m,b),u.state!==l&&ip.enqueueReplaceState(u,u.state,null)}function iy(l,u,m,b){var C=l.stateNode;C.props=m,C.state=l.memoizedState,C.refs={},Hg(l);var _=u.contextType;typeof _=="object"&&_!==null?C.context=ra(_):(_=wr(u)?Ji:ar.current,C.context=il(l,_)),C.state=l.memoizedState,_=u.getDerivedStateFromProps,typeof _=="function"&&(sy(l,u,_,m),C.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(u=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),u!==C.state&&ip.enqueueReplaceState(C,C.state,null),Zf(l,m,C,b),C.state=l.memoizedState),typeof C.componentDidMount=="function"&&(l.flags|=4194308)}function hl(l,u){try{var m="",b=u;do m+=J(b),b=b.return;while(b);var C=m}catch(_){C=`
|
|
7
|
+
Error generating stack: `+_.message+`
|
|
8
|
+
`+_.stack}return{value:l,source:u,stack:C,digest:null}}function oy(l,u,m){return{value:l,source:null,stack:m??null,digest:u??null}}function ly(l,u){try{console.error(u.value)}catch(m){setTimeout(function(){throw m})}}var U6=typeof WeakMap=="function"?WeakMap:Map;function JA(l,u,m){m=Ns(-1,m),m.tag=3,m.payload={element:null};var b=u.value;return m.callback=function(){pp||(pp=!0,Sy=b),ly(l,u)},m}function ZA(l,u,m){m=Ns(-1,m),m.tag=3;var b=l.type.getDerivedStateFromError;if(typeof b=="function"){var C=u.value;m.payload=function(){return b(C)},m.callback=function(){ly(l,u)}}var _=l.stateNode;return _!==null&&typeof _.componentDidCatch=="function"&&(m.callback=function(){ly(l,u),typeof b!="function"&&(mi===null?mi=new Set([this]):mi.add(this));var M=u.stack;this.componentDidCatch(u.value,{componentStack:M!==null?M:""})}),m}function eE(l,u,m){var b=l.pingCache;if(b===null){b=l.pingCache=new U6;var C=new Set;b.set(u,C)}else C=b.get(u),C===void 0&&(C=new Set,b.set(u,C));C.has(m)||(C.add(m),l=n7.bind(null,l,u,m),u.then(l,l))}function tE(l){do{var u;if((u=l.tag===13)&&(u=l.memoizedState,u=u!==null?u.dehydrated!==null:!0),u)return l;l=l.return}while(l!==null);return null}function nE(l,u,m,b,C){return(l.mode&1)===0?(l===u?l.flags|=65536:(l.flags|=128,m.flags|=131072,m.flags&=-52805,m.tag===1&&(m.alternate===null?m.tag=17:(u=Ns(-1,1),u.tag=2,pi(m,u,1))),m.lanes|=1),l):(l.flags|=65536,l.lanes=C,l)}var q6=P.ReactCurrentOwner,jr=!1;function cr(l,u,m,b){u.child=l===null?jA(u,null,m,b):ul(u,l.child,m,b)}function rE(l,u,m,b,C){m=m.render;var _=u.ref;return fl(u,C),b=Zg(l,u,m,b,_,C),m=ey(),l!==null&&!jr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~C,Cs(l,u,C)):(hn&&m&&$g(u),u.flags|=1,cr(l,u,b,C),u.child)}function aE(l,u,m,b,C){if(l===null){var _=m.type;return typeof _=="function"&&!Oy(_)&&_.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(u.tag=15,u.type=_,sE(l,u,_,b,C)):(l=xp(m.type,null,b,u,u.mode,C),l.ref=u.ref,l.return=u,u.child=l)}if(_=l.child,(l.lanes&C)===0){var M=_.memoizedProps;if(m=m.compare,m=m!==null?m:cu,m(M,b)&&l.ref===u.ref)return Cs(l,u,C)}return u.flags|=1,l=xi(_,b),l.ref=u.ref,l.return=u,u.child=l}function sE(l,u,m,b,C){if(l!==null){var _=l.memoizedProps;if(cu(_,b)&&l.ref===u.ref)if(jr=!1,u.pendingProps=b=_,(l.lanes&C)!==0)(l.flags&131072)!==0&&(jr=!0);else return u.lanes=l.lanes,Cs(l,u,C)}return cy(l,u,m,b,C)}function iE(l,u,m){var b=u.pendingProps,C=b.children,_=l!==null?l.memoizedState:null;if(b.mode==="hidden")if((u.mode&1)===0)u.memoizedState={baseLanes:0,cachePool:null,transitions:null},nn(vl,Lr),Lr|=m;else{if((m&1073741824)===0)return l=_!==null?_.baseLanes|m:m,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:l,cachePool:null,transitions:null},u.updateQueue=null,nn(vl,Lr),Lr|=l,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},b=_!==null?_.baseLanes:m,nn(vl,Lr),Lr|=b}else _!==null?(b=_.baseLanes|m,u.memoizedState=null):b=m,nn(vl,Lr),Lr|=b;return cr(l,u,C,m),u.child}function oE(l,u){var m=u.ref;(l===null&&m!==null||l!==null&&l.ref!==m)&&(u.flags|=512,u.flags|=2097152)}function cy(l,u,m,b,C){var _=wr(m)?Ji:ar.current;return _=il(u,_),fl(u,C),m=Zg(l,u,m,b,_,C),b=ey(),l!==null&&!jr?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~C,Cs(l,u,C)):(hn&&b&&$g(u),u.flags|=1,cr(l,u,m,C),u.child)}function lE(l,u,m,b,C){if(wr(m)){var _=!0;Wf(u)}else _=!1;if(fl(u,C),u.stateNode===null)lp(l,u),XA(u,m,b),iy(u,m,b,C),b=!0;else if(l===null){var M=u.stateNode,Y=u.memoizedProps;M.props=Y;var te=M.context,me=m.contextType;typeof me=="object"&&me!==null?me=ra(me):(me=wr(m)?Ji:ar.current,me=il(u,me));var Ee=m.getDerivedStateFromProps,ke=typeof Ee=="function"||typeof M.getSnapshotBeforeUpdate=="function";ke||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(Y!==b||te!==me)&&QA(u,M,b,me),fi=!1;var Ae=u.memoizedState;M.state=Ae,Zf(u,b,M,C),te=u.memoizedState,Y!==b||Ae!==te||br.current||fi?(typeof Ee=="function"&&(sy(u,m,Ee,b),te=u.memoizedState),(Y=fi||YA(u,m,Y,b,Ae,te,me))?(ke||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount()),typeof M.componentDidMount=="function"&&(u.flags|=4194308)):(typeof M.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=b,u.memoizedState=te),M.props=b,M.state=te,M.context=me,b=Y):(typeof M.componentDidMount=="function"&&(u.flags|=4194308),b=!1)}else{M=u.stateNode,NA(l,u),Y=u.memoizedProps,me=u.type===u.elementType?Y:Ea(u.type,Y),M.props=me,ke=u.pendingProps,Ae=M.context,te=m.contextType,typeof te=="object"&&te!==null?te=ra(te):(te=wr(m)?Ji:ar.current,te=il(u,te));var Ve=m.getDerivedStateFromProps;(Ee=typeof Ve=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(Y!==ke||Ae!==te)&&QA(u,M,b,te),fi=!1,Ae=u.memoizedState,M.state=Ae,Zf(u,b,M,C);var Ze=u.memoizedState;Y!==ke||Ae!==Ze||br.current||fi?(typeof Ve=="function"&&(sy(u,m,Ve,b),Ze=u.memoizedState),(me=fi||YA(u,m,me,b,Ae,Ze,te)||!1)?(Ee||typeof M.UNSAFE_componentWillUpdate!="function"&&typeof M.componentWillUpdate!="function"||(typeof M.componentWillUpdate=="function"&&M.componentWillUpdate(b,Ze,te),typeof M.UNSAFE_componentWillUpdate=="function"&&M.UNSAFE_componentWillUpdate(b,Ze,te)),typeof M.componentDidUpdate=="function"&&(u.flags|=4),typeof M.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof M.componentDidUpdate!="function"||Y===l.memoizedProps&&Ae===l.memoizedState||(u.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||Y===l.memoizedProps&&Ae===l.memoizedState||(u.flags|=1024),u.memoizedProps=b,u.memoizedState=Ze),M.props=b,M.state=Ze,M.context=te,b=me):(typeof M.componentDidUpdate!="function"||Y===l.memoizedProps&&Ae===l.memoizedState||(u.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||Y===l.memoizedProps&&Ae===l.memoizedState||(u.flags|=1024),b=!1)}return uy(l,u,m,b,_,C)}function uy(l,u,m,b,C,_){oE(l,u);var M=(u.flags&128)!==0;if(!b&&!M)return C&&pA(u,m,!1),Cs(l,u,_);b=u.stateNode,q6.current=u;var Y=M&&typeof m.getDerivedStateFromError!="function"?null:b.render();return u.flags|=1,l!==null&&M?(u.child=ul(u,l.child,null,_),u.child=ul(u,null,Y,_)):cr(l,u,Y,_),u.memoizedState=b.state,C&&pA(u,m,!0),u.child}function cE(l){var u=l.stateNode;u.pendingContext?dA(l,u.pendingContext,u.pendingContext!==u.context):u.context&&dA(l,u.context,!1),Kg(l,u.containerInfo)}function uE(l,u,m,b,C){return cl(),Bg(C),u.flags|=256,cr(l,u,m,b),u.child}var dy={dehydrated:null,treeContext:null,retryLane:0};function fy(l){return{baseLanes:l,cachePool:null,transitions:null}}function dE(l,u,m){var b=u.pendingProps,C=vn.current,_=!1,M=(u.flags&128)!==0,Y;if((Y=M)||(Y=l!==null&&l.memoizedState===null?!1:(C&2)!==0),Y?(_=!0,u.flags&=-129):(l===null||l.memoizedState!==null)&&(C|=1),nn(vn,C&1),l===null)return Fg(u),l=u.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((u.mode&1)===0?u.lanes=1:l.data==="$!"?u.lanes=8:u.lanes=1073741824,null):(M=b.children,l=b.fallback,_?(b=u.mode,_=u.child,M={mode:"hidden",children:M},(b&1)===0&&_!==null?(_.childLanes=0,_.pendingProps=M):_=bp(M,b,0,null),l=lo(l,b,m,null),_.return=u,l.return=u,_.sibling=l,u.child=_,u.child.memoizedState=fy(m),u.memoizedState=dy,l):py(u,M));if(C=l.memoizedState,C!==null&&(Y=C.dehydrated,Y!==null))return W6(l,u,M,b,Y,C,m);if(_){_=b.fallback,M=u.mode,C=l.child,Y=C.sibling;var te={mode:"hidden",children:b.children};return(M&1)===0&&u.child!==C?(b=u.child,b.childLanes=0,b.pendingProps=te,u.deletions=null):(b=xi(C,te),b.subtreeFlags=C.subtreeFlags&14680064),Y!==null?_=xi(Y,_):(_=lo(_,M,m,null),_.flags|=2),_.return=u,b.return=u,b.sibling=_,u.child=b,b=_,_=u.child,M=l.child.memoizedState,M=M===null?fy(m):{baseLanes:M.baseLanes|m,cachePool:null,transitions:M.transitions},_.memoizedState=M,_.childLanes=l.childLanes&~m,u.memoizedState=dy,b}return _=l.child,l=_.sibling,b=xi(_,{mode:"visible",children:b.children}),(u.mode&1)===0&&(b.lanes=m),b.return=u,b.sibling=null,l!==null&&(m=u.deletions,m===null?(u.deletions=[l],u.flags|=16):m.push(l)),u.child=b,u.memoizedState=null,b}function py(l,u){return u=bp({mode:"visible",children:u},l.mode,0,null),u.return=l,l.child=u}function op(l,u,m,b){return b!==null&&Bg(b),ul(u,l.child,null,m),l=py(u,u.pendingProps.children),l.flags|=2,u.memoizedState=null,l}function W6(l,u,m,b,C,_,M){if(m)return u.flags&256?(u.flags&=-257,b=oy(Error(n(422))),op(l,u,M,b)):u.memoizedState!==null?(u.child=l.child,u.flags|=128,null):(_=b.fallback,C=u.mode,b=bp({mode:"visible",children:b.children},C,0,null),_=lo(_,C,M,null),_.flags|=2,b.return=u,_.return=u,b.sibling=_,u.child=b,(u.mode&1)!==0&&ul(u,l.child,null,M),u.child.memoizedState=fy(M),u.memoizedState=dy,_);if((u.mode&1)===0)return op(l,u,M,null);if(C.data==="$!"){if(b=C.nextSibling&&C.nextSibling.dataset,b)var Y=b.dgst;return b=Y,_=Error(n(419)),b=oy(_,b,void 0),op(l,u,M,b)}if(Y=(M&l.childLanes)!==0,jr||Y){if(b=Vn,b!==null){switch(M&-M){case 4:C=2;break;case 16:C=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:C=32;break;case 536870912:C=268435456;break;default:C=0}C=(C&(b.suspendedLanes|M))!==0?0:C,C!==0&&C!==_.retryLane&&(_.retryLane=C,Ss(l,C),Oa(b,l,C,-1))}return Py(),b=oy(Error(n(421))),op(l,u,M,b)}return C.data==="$?"?(u.flags|=128,u.child=l.child,u=r7.bind(null,l),C._reactRetry=u,null):(l=_.treeContext,Dr=li(C.nextSibling),$r=u,hn=!0,Aa=null,l!==null&&(ta[na++]=ws,ta[na++]=js,ta[na++]=Zi,ws=l.id,js=l.overflow,Zi=u),u=py(u,b.children),u.flags|=4096,u)}function fE(l,u,m){l.lanes|=u;var b=l.alternate;b!==null&&(b.lanes|=u),Wg(l.return,u,m)}function hy(l,u,m,b,C){var _=l.memoizedState;_===null?l.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:b,tail:m,tailMode:C}:(_.isBackwards=u,_.rendering=null,_.renderingStartTime=0,_.last=b,_.tail=m,_.tailMode=C)}function pE(l,u,m){var b=u.pendingProps,C=b.revealOrder,_=b.tail;if(cr(l,u,b.children,m),b=vn.current,(b&2)!==0)b=b&1|2,u.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=u.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&fE(l,m,u);else if(l.tag===19)fE(l,m,u);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===u)break e;for(;l.sibling===null;){if(l.return===null||l.return===u)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}b&=1}if(nn(vn,b),(u.mode&1)===0)u.memoizedState=null;else switch(C){case"forwards":for(m=u.child,C=null;m!==null;)l=m.alternate,l!==null&&ep(l)===null&&(C=m),m=m.sibling;m=C,m===null?(C=u.child,u.child=null):(C=m.sibling,m.sibling=null),hy(u,!1,C,m,_);break;case"backwards":for(m=null,C=u.child,u.child=null;C!==null;){if(l=C.alternate,l!==null&&ep(l)===null){u.child=C;break}l=C.sibling,C.sibling=m,m=C,C=l}hy(u,!0,m,null,_);break;case"together":hy(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function lp(l,u){(u.mode&1)===0&&l!==null&&(l.alternate=null,u.alternate=null,u.flags|=2)}function Cs(l,u,m){if(l!==null&&(u.dependencies=l.dependencies),ao|=u.lanes,(m&u.childLanes)===0)return null;if(l!==null&&u.child!==l.child)throw Error(n(153));if(u.child!==null){for(l=u.child,m=xi(l,l.pendingProps),u.child=m,m.return=u;l.sibling!==null;)l=l.sibling,m=m.sibling=xi(l,l.pendingProps),m.return=u;m.sibling=null}return u.child}function V6(l,u,m){switch(u.tag){case 3:cE(u),cl();break;case 5:EA(u);break;case 1:wr(u.type)&&Wf(u);break;case 4:Kg(u,u.stateNode.containerInfo);break;case 10:var b=u.type._context,C=u.memoizedProps.value;nn(Xf,b._currentValue),b._currentValue=C;break;case 13:if(b=u.memoizedState,b!==null)return b.dehydrated!==null?(nn(vn,vn.current&1),u.flags|=128,null):(m&u.child.childLanes)!==0?dE(l,u,m):(nn(vn,vn.current&1),l=Cs(l,u,m),l!==null?l.sibling:null);nn(vn,vn.current&1);break;case 19:if(b=(m&u.childLanes)!==0,(l.flags&128)!==0){if(b)return pE(l,u,m);u.flags|=128}if(C=u.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),nn(vn,vn.current),b)break;return null;case 22:case 23:return u.lanes=0,iE(l,u,m)}return Cs(l,u,m)}var hE,my,mE,vE;hE=function(l,u){for(var m=u.child;m!==null;){if(m.tag===5||m.tag===6)l.appendChild(m.stateNode);else if(m.tag!==4&&m.child!==null){m.child.return=m,m=m.child;continue}if(m===u)break;for(;m.sibling===null;){if(m.return===null||m.return===u)return;m=m.return}m.sibling.return=m.return,m=m.sibling}},my=function(){},mE=function(l,u,m,b){var C=l.memoizedProps;if(C!==b){l=u.stateNode,no(Xa.current);var _=null;switch(m){case"input":C=Ce(l,C),b=Ce(l,b),_=[];break;case"select":C=Q({},C,{value:void 0}),b=Q({},b,{value:void 0}),_=[];break;case"textarea":C=et(l,C),b=et(l,b),_=[];break;default:typeof C.onClick!="function"&&typeof b.onClick=="function"&&(l.onclick=zf)}En(m,b);var M;m=null;for(me in C)if(!b.hasOwnProperty(me)&&C.hasOwnProperty(me)&&C[me]!=null)if(me==="style"){var Y=C[me];for(M in Y)Y.hasOwnProperty(M)&&(m||(m={}),m[M]="")}else me!=="dangerouslySetInnerHTML"&&me!=="children"&&me!=="suppressContentEditableWarning"&&me!=="suppressHydrationWarning"&&me!=="autoFocus"&&(a.hasOwnProperty(me)?_||(_=[]):(_=_||[]).push(me,null));for(me in b){var te=b[me];if(Y=C?.[me],b.hasOwnProperty(me)&&te!==Y&&(te!=null||Y!=null))if(me==="style")if(Y){for(M in Y)!Y.hasOwnProperty(M)||te&&te.hasOwnProperty(M)||(m||(m={}),m[M]="");for(M in te)te.hasOwnProperty(M)&&Y[M]!==te[M]&&(m||(m={}),m[M]=te[M])}else m||(_||(_=[]),_.push(me,m)),m=te;else me==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,Y=Y?Y.__html:void 0,te!=null&&Y!==te&&(_=_||[]).push(me,te)):me==="children"?typeof te!="string"&&typeof te!="number"||(_=_||[]).push(me,""+te):me!=="suppressContentEditableWarning"&&me!=="suppressHydrationWarning"&&(a.hasOwnProperty(me)?(te!=null&&me==="onScroll"&&cn("scroll",l),_||Y===te||(_=[])):(_=_||[]).push(me,te))}m&&(_=_||[]).push("style",m);var me=_;(u.updateQueue=me)&&(u.flags|=4)}},vE=function(l,u,m,b){m!==b&&(u.flags|=4)};function Nu(l,u){if(!hn)switch(l.tailMode){case"hidden":u=l.tail;for(var m=null;u!==null;)u.alternate!==null&&(m=u),u=u.sibling;m===null?l.tail=null:m.sibling=null;break;case"collapsed":m=l.tail;for(var b=null;m!==null;)m.alternate!==null&&(b=m),m=m.sibling;b===null?u||l.tail===null?l.tail=null:l.tail.sibling=null:b.sibling=null}}function ir(l){var u=l.alternate!==null&&l.alternate.child===l.child,m=0,b=0;if(u)for(var C=l.child;C!==null;)m|=C.lanes|C.childLanes,b|=C.subtreeFlags&14680064,b|=C.flags&14680064,C.return=l,C=C.sibling;else for(C=l.child;C!==null;)m|=C.lanes|C.childLanes,b|=C.subtreeFlags,b|=C.flags,C.return=l,C=C.sibling;return l.subtreeFlags|=b,l.childLanes=m,u}function H6(l,u,m){var b=u.pendingProps;switch(Dg(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ir(u),null;case 1:return wr(u.type)&&qf(),ir(u),null;case 3:return b=u.stateNode,pl(),un(br),un(ar),Xg(),b.pendingContext&&(b.context=b.pendingContext,b.pendingContext=null),(l===null||l.child===null)&&(Gf(u)?u.flags|=4:l===null||l.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Aa!==null&&(Ay(Aa),Aa=null))),my(l,u),ir(u),null;case 5:Gg(u);var C=no(xu.current);if(m=u.type,l!==null&&u.stateNode!=null)mE(l,u,m,b,C),l.ref!==u.ref&&(u.flags|=512,u.flags|=2097152);else{if(!b){if(u.stateNode===null)throw Error(n(166));return ir(u),null}if(l=no(Xa.current),Gf(u)){b=u.stateNode,m=u.type;var _=u.memoizedProps;switch(b[Ya]=u,b[hu]=_,l=(u.mode&1)!==0,m){case"dialog":cn("cancel",b),cn("close",b);break;case"iframe":case"object":case"embed":cn("load",b);break;case"video":case"audio":for(C=0;C<du.length;C++)cn(du[C],b);break;case"source":cn("error",b);break;case"img":case"image":case"link":cn("error",b),cn("load",b);break;case"details":cn("toggle",b);break;case"input":Le(b,_),cn("invalid",b);break;case"select":b._wrapperState={wasMultiple:!!_.multiple},cn("invalid",b);break;case"textarea":xt(b,_),cn("invalid",b)}En(m,_),C=null;for(var M in _)if(_.hasOwnProperty(M)){var Y=_[M];M==="children"?typeof Y=="string"?b.textContent!==Y&&(_.suppressHydrationWarning!==!0&&Bf(b.textContent,Y,l),C=["children",Y]):typeof Y=="number"&&b.textContent!==""+Y&&(_.suppressHydrationWarning!==!0&&Bf(b.textContent,Y,l),C=["children",""+Y]):a.hasOwnProperty(M)&&Y!=null&&M==="onScroll"&&cn("scroll",b)}switch(m){case"input":Oe(b),Ne(b,_,!0);break;case"textarea":Oe(b),ye(b);break;case"select":case"option":break;default:typeof _.onClick=="function"&&(b.onclick=zf)}b=C,u.updateQueue=b,b!==null&&(u.flags|=4)}else{M=C.nodeType===9?C:C.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=We(m)),l==="http://www.w3.org/1999/xhtml"?m==="script"?(l=M.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof b.is=="string"?l=M.createElement(m,{is:b.is}):(l=M.createElement(m),m==="select"&&(M=l,b.multiple?M.multiple=!0:b.size&&(M.size=b.size))):l=M.createElementNS(l,m),l[Ya]=u,l[hu]=b,hE(l,u,!1,!1),u.stateNode=l;e:{switch(M=Or(m,b),m){case"dialog":cn("cancel",l),cn("close",l),C=b;break;case"iframe":case"object":case"embed":cn("load",l),C=b;break;case"video":case"audio":for(C=0;C<du.length;C++)cn(du[C],l);C=b;break;case"source":cn("error",l),C=b;break;case"img":case"image":case"link":cn("error",l),cn("load",l),C=b;break;case"details":cn("toggle",l),C=b;break;case"input":Le(l,b),C=Ce(l,b),cn("invalid",l);break;case"option":C=b;break;case"select":l._wrapperState={wasMultiple:!!b.multiple},C=Q({},b,{value:void 0}),cn("invalid",l);break;case"textarea":xt(l,b),C=et(l,b),cn("invalid",l);break;default:C=b}En(m,C),Y=C;for(_ in Y)if(Y.hasOwnProperty(_)){var te=Y[_];_==="style"?nr(l,te):_==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,te!=null&&Dt(l,te)):_==="children"?typeof te=="string"?(m!=="textarea"||te!=="")&&kt(l,te):typeof te=="number"&&kt(l,""+te):_!=="suppressContentEditableWarning"&&_!=="suppressHydrationWarning"&&_!=="autoFocus"&&(a.hasOwnProperty(_)?te!=null&&_==="onScroll"&&cn("scroll",l):te!=null&&A(l,_,te,M))}switch(m){case"input":Oe(l),Ne(l,b,!1);break;case"textarea":Oe(l),ye(l);break;case"option":b.value!=null&&l.setAttribute("value",""+ce(b.value));break;case"select":l.multiple=!!b.multiple,_=b.value,_!=null?$e(l,!!b.multiple,_,!1):b.defaultValue!=null&&$e(l,!!b.multiple,b.defaultValue,!0);break;default:typeof C.onClick=="function"&&(l.onclick=zf)}switch(m){case"button":case"input":case"select":case"textarea":b=!!b.autoFocus;break e;case"img":b=!0;break e;default:b=!1}}b&&(u.flags|=4)}u.ref!==null&&(u.flags|=512,u.flags|=2097152)}return ir(u),null;case 6:if(l&&u.stateNode!=null)vE(l,u,l.memoizedProps,b);else{if(typeof b!="string"&&u.stateNode===null)throw Error(n(166));if(m=no(xu.current),no(Xa.current),Gf(u)){if(b=u.stateNode,m=u.memoizedProps,b[Ya]=u,(_=b.nodeValue!==m)&&(l=$r,l!==null))switch(l.tag){case 3:Bf(b.nodeValue,m,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&Bf(b.nodeValue,m,(l.mode&1)!==0)}_&&(u.flags|=4)}else b=(m.nodeType===9?m:m.ownerDocument).createTextNode(b),b[Ya]=u,u.stateNode=b}return ir(u),null;case 13:if(un(vn),b=u.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(hn&&Dr!==null&&(u.mode&1)!==0&&(u.flags&128)===0)xA(),cl(),u.flags|=98560,_=!1;else if(_=Gf(u),b!==null&&b.dehydrated!==null){if(l===null){if(!_)throw Error(n(318));if(_=u.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(n(317));_[Ya]=u}else cl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;ir(u),_=!1}else Aa!==null&&(Ay(Aa),Aa=null),_=!0;if(!_)return u.flags&65536?u:null}return(u.flags&128)!==0?(u.lanes=m,u):(b=b!==null,b!==(l!==null&&l.memoizedState!==null)&&b&&(u.child.flags|=8192,(u.mode&1)!==0&&(l===null||(vn.current&1)!==0?Mn===0&&(Mn=3):Py())),u.updateQueue!==null&&(u.flags|=4),ir(u),null);case 4:return pl(),my(l,u),l===null&&fu(u.stateNode.containerInfo),ir(u),null;case 10:return qg(u.type._context),ir(u),null;case 17:return wr(u.type)&&qf(),ir(u),null;case 19:if(un(vn),_=u.memoizedState,_===null)return ir(u),null;if(b=(u.flags&128)!==0,M=_.rendering,M===null)if(b)Nu(_,!1);else{if(Mn!==0||l!==null&&(l.flags&128)!==0)for(l=u.child;l!==null;){if(M=ep(l),M!==null){for(u.flags|=128,Nu(_,!1),b=M.updateQueue,b!==null&&(u.updateQueue=b,u.flags|=4),u.subtreeFlags=0,b=m,m=u.child;m!==null;)_=m,l=b,_.flags&=14680066,M=_.alternate,M===null?(_.childLanes=0,_.lanes=l,_.child=null,_.subtreeFlags=0,_.memoizedProps=null,_.memoizedState=null,_.updateQueue=null,_.dependencies=null,_.stateNode=null):(_.childLanes=M.childLanes,_.lanes=M.lanes,_.child=M.child,_.subtreeFlags=0,_.deletions=null,_.memoizedProps=M.memoizedProps,_.memoizedState=M.memoizedState,_.updateQueue=M.updateQueue,_.type=M.type,l=M.dependencies,_.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),m=m.sibling;return nn(vn,vn.current&1|2),u.child}l=l.sibling}_.tail!==null&&he()>gl&&(u.flags|=128,b=!0,Nu(_,!1),u.lanes=4194304)}else{if(!b)if(l=ep(M),l!==null){if(u.flags|=128,b=!0,m=l.updateQueue,m!==null&&(u.updateQueue=m,u.flags|=4),Nu(_,!0),_.tail===null&&_.tailMode==="hidden"&&!M.alternate&&!hn)return ir(u),null}else 2*he()-_.renderingStartTime>gl&&m!==1073741824&&(u.flags|=128,b=!0,Nu(_,!1),u.lanes=4194304);_.isBackwards?(M.sibling=u.child,u.child=M):(m=_.last,m!==null?m.sibling=M:u.child=M,_.last=M)}return _.tail!==null?(u=_.tail,_.rendering=u,_.tail=u.sibling,_.renderingStartTime=he(),u.sibling=null,m=vn.current,nn(vn,b?m&1|2:m&1),u):(ir(u),null);case 22:case 23:return _y(),b=u.memoizedState!==null,l!==null&&l.memoizedState!==null!==b&&(u.flags|=8192),b&&(u.mode&1)!==0?(Lr&1073741824)!==0&&(ir(u),u.subtreeFlags&6&&(u.flags|=8192)):ir(u),null;case 24:return null;case 25:return null}throw Error(n(156,u.tag))}function K6(l,u){switch(Dg(u),u.tag){case 1:return wr(u.type)&&qf(),l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 3:return pl(),un(br),un(ar),Xg(),l=u.flags,(l&65536)!==0&&(l&128)===0?(u.flags=l&-65537|128,u):null;case 5:return Gg(u),null;case 13:if(un(vn),l=u.memoizedState,l!==null&&l.dehydrated!==null){if(u.alternate===null)throw Error(n(340));cl()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 19:return un(vn),null;case 4:return pl(),null;case 10:return qg(u.type._context),null;case 22:case 23:return _y(),null;case 24:return null;default:return null}}var cp=!1,or=!1,G6=typeof WeakSet=="function"?WeakSet:Set,Xe=null;function ml(l,u){var m=l.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(b){bn(l,u,b)}else m.current=null}function vy(l,u,m){try{m()}catch(b){bn(l,u,b)}}var gE=!1;function Y6(l,u){if(_g=Pf,l=YC(),bg(l)){if("selectionStart"in l)var m={start:l.selectionStart,end:l.selectionEnd};else e:{m=(m=l.ownerDocument)&&m.defaultView||window;var b=m.getSelection&&m.getSelection();if(b&&b.rangeCount!==0){m=b.anchorNode;var C=b.anchorOffset,_=b.focusNode;b=b.focusOffset;try{m.nodeType,_.nodeType}catch{m=null;break e}var M=0,Y=-1,te=-1,me=0,Ee=0,ke=l,Ae=null;t:for(;;){for(var Ve;ke!==m||C!==0&&ke.nodeType!==3||(Y=M+C),ke!==_||b!==0&&ke.nodeType!==3||(te=M+b),ke.nodeType===3&&(M+=ke.nodeValue.length),(Ve=ke.firstChild)!==null;)Ae=ke,ke=Ve;for(;;){if(ke===l)break t;if(Ae===m&&++me===C&&(Y=M),Ae===_&&++Ee===b&&(te=M),(Ve=ke.nextSibling)!==null)break;ke=Ae,Ae=ke.parentNode}ke=Ve}m=Y===-1||te===-1?null:{start:Y,end:te}}else m=null}m=m||{start:0,end:0}}else m=null;for(Pg={focusedElem:l,selectionRange:m},Pf=!1,Xe=u;Xe!==null;)if(u=Xe,l=u.child,(u.subtreeFlags&1028)!==0&&l!==null)l.return=u,Xe=l;else for(;Xe!==null;){u=Xe;try{var Ze=u.alternate;if((u.flags&1024)!==0)switch(u.tag){case 0:case 11:case 15:break;case 1:if(Ze!==null){var tt=Ze.memoizedProps,Nn=Ze.memoizedState,le=u.stateNode,re=le.getSnapshotBeforeUpdate(u.elementType===u.type?tt:Ea(u.type,tt),Nn);le.__reactInternalSnapshotBeforeUpdate=re}break;case 3:var fe=u.stateNode.containerInfo;fe.nodeType===1?fe.textContent="":fe.nodeType===9&&fe.documentElement&&fe.removeChild(fe.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Me){bn(u,u.return,Me)}if(l=u.sibling,l!==null){l.return=u.return,Xe=l;break}Xe=u.return}return Ze=gE,gE=!1,Ze}function Cu(l,u,m){var b=u.updateQueue;if(b=b!==null?b.lastEffect:null,b!==null){var C=b=b.next;do{if((C.tag&l)===l){var _=C.destroy;C.destroy=void 0,_!==void 0&&vy(u,m,_)}C=C.next}while(C!==b)}}function up(l,u){if(u=u.updateQueue,u=u!==null?u.lastEffect:null,u!==null){var m=u=u.next;do{if((m.tag&l)===l){var b=m.create;m.destroy=b()}m=m.next}while(m!==u)}}function gy(l){var u=l.ref;if(u!==null){var m=l.stateNode;l.tag,l=m,typeof u=="function"?u(l):u.current=l}}function yE(l){var u=l.alternate;u!==null&&(l.alternate=null,yE(u)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(u=l.stateNode,u!==null&&(delete u[Ya],delete u[hu],delete u[Tg],delete u[k6],delete u[R6])),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function xE(l){return l.tag===5||l.tag===3||l.tag===4}function bE(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||xE(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function yy(l,u,m){var b=l.tag;if(b===5||b===6)l=l.stateNode,u?m.nodeType===8?m.parentNode.insertBefore(l,u):m.insertBefore(l,u):(m.nodeType===8?(u=m.parentNode,u.insertBefore(l,m)):(u=m,u.appendChild(l)),m=m._reactRootContainer,m!=null||u.onclick!==null||(u.onclick=zf));else if(b!==4&&(l=l.child,l!==null))for(yy(l,u,m),l=l.sibling;l!==null;)yy(l,u,m),l=l.sibling}function xy(l,u,m){var b=l.tag;if(b===5||b===6)l=l.stateNode,u?m.insertBefore(l,u):m.appendChild(l);else if(b!==4&&(l=l.child,l!==null))for(xy(l,u,m),l=l.sibling;l!==null;)xy(l,u,m),l=l.sibling}var Xn=null,_a=!1;function hi(l,u,m){for(m=m.child;m!==null;)wE(l,u,m),m=m.sibling}function wE(l,u,m){if(vt&&typeof vt.onCommitFiberUnmount=="function")try{vt.onCommitFiberUnmount(Ge,m)}catch{}switch(m.tag){case 5:or||ml(m,u);case 6:var b=Xn,C=_a;Xn=null,hi(l,u,m),Xn=b,_a=C,Xn!==null&&(_a?(l=Xn,m=m.stateNode,l.nodeType===8?l.parentNode.removeChild(m):l.removeChild(m)):Xn.removeChild(m.stateNode));break;case 18:Xn!==null&&(_a?(l=Xn,m=m.stateNode,l.nodeType===8?Rg(l.parentNode,m):l.nodeType===1&&Rg(l,m),ru(l)):Rg(Xn,m.stateNode));break;case 4:b=Xn,C=_a,Xn=m.stateNode.containerInfo,_a=!0,hi(l,u,m),Xn=b,_a=C;break;case 0:case 11:case 14:case 15:if(!or&&(b=m.updateQueue,b!==null&&(b=b.lastEffect,b!==null))){C=b=b.next;do{var _=C,M=_.destroy;_=_.tag,M!==void 0&&((_&2)!==0||(_&4)!==0)&&vy(m,u,M),C=C.next}while(C!==b)}hi(l,u,m);break;case 1:if(!or&&(ml(m,u),b=m.stateNode,typeof b.componentWillUnmount=="function"))try{b.props=m.memoizedProps,b.state=m.memoizedState,b.componentWillUnmount()}catch(Y){bn(m,u,Y)}hi(l,u,m);break;case 21:hi(l,u,m);break;case 22:m.mode&1?(or=(b=or)||m.memoizedState!==null,hi(l,u,m),or=b):hi(l,u,m);break;default:hi(l,u,m)}}function jE(l){var u=l.updateQueue;if(u!==null){l.updateQueue=null;var m=l.stateNode;m===null&&(m=l.stateNode=new G6),u.forEach(function(b){var C=a7.bind(null,l,b);m.has(b)||(m.add(b),b.then(C,C))})}}function Pa(l,u){var m=u.deletions;if(m!==null)for(var b=0;b<m.length;b++){var C=m[b];try{var _=l,M=u,Y=M;e:for(;Y!==null;){switch(Y.tag){case 5:Xn=Y.stateNode,_a=!1;break e;case 3:Xn=Y.stateNode.containerInfo,_a=!0;break e;case 4:Xn=Y.stateNode.containerInfo,_a=!0;break e}Y=Y.return}if(Xn===null)throw Error(n(160));wE(_,M,C),Xn=null,_a=!1;var te=C.alternate;te!==null&&(te.return=null),C.return=null}catch(me){bn(C,u,me)}}if(u.subtreeFlags&12854)for(u=u.child;u!==null;)SE(u,l),u=u.sibling}function SE(l,u){var m=l.alternate,b=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(Pa(u,l),Ja(l),b&4){try{Cu(3,l,l.return),up(3,l)}catch(tt){bn(l,l.return,tt)}try{Cu(5,l,l.return)}catch(tt){bn(l,l.return,tt)}}break;case 1:Pa(u,l),Ja(l),b&512&&m!==null&&ml(m,m.return);break;case 5:if(Pa(u,l),Ja(l),b&512&&m!==null&&ml(m,m.return),l.flags&32){var C=l.stateNode;try{kt(C,"")}catch(tt){bn(l,l.return,tt)}}if(b&4&&(C=l.stateNode,C!=null)){var _=l.memoizedProps,M=m!==null?m.memoizedProps:_,Y=l.type,te=l.updateQueue;if(l.updateQueue=null,te!==null)try{Y==="input"&&_.type==="radio"&&_.name!=null&&se(C,_),Or(Y,M);var me=Or(Y,_);for(M=0;M<te.length;M+=2){var Ee=te[M],ke=te[M+1];Ee==="style"?nr(C,ke):Ee==="dangerouslySetInnerHTML"?Dt(C,ke):Ee==="children"?kt(C,ke):A(C,Ee,ke,me)}switch(Y){case"input":de(C,_);break;case"textarea":Jt(C,_);break;case"select":var Ae=C._wrapperState.wasMultiple;C._wrapperState.wasMultiple=!!_.multiple;var Ve=_.value;Ve!=null?$e(C,!!_.multiple,Ve,!1):Ae!==!!_.multiple&&(_.defaultValue!=null?$e(C,!!_.multiple,_.defaultValue,!0):$e(C,!!_.multiple,_.multiple?[]:"",!1))}C[hu]=_}catch(tt){bn(l,l.return,tt)}}break;case 6:if(Pa(u,l),Ja(l),b&4){if(l.stateNode===null)throw Error(n(162));C=l.stateNode,_=l.memoizedProps;try{C.nodeValue=_}catch(tt){bn(l,l.return,tt)}}break;case 3:if(Pa(u,l),Ja(l),b&4&&m!==null&&m.memoizedState.isDehydrated)try{ru(u.containerInfo)}catch(tt){bn(l,l.return,tt)}break;case 4:Pa(u,l),Ja(l);break;case 13:Pa(u,l),Ja(l),C=l.child,C.flags&8192&&(_=C.memoizedState!==null,C.stateNode.isHidden=_,!_||C.alternate!==null&&C.alternate.memoizedState!==null||(jy=he())),b&4&&jE(l);break;case 22:if(Ee=m!==null&&m.memoizedState!==null,l.mode&1?(or=(me=or)||Ee,Pa(u,l),or=me):Pa(u,l),Ja(l),b&8192){if(me=l.memoizedState!==null,(l.stateNode.isHidden=me)&&!Ee&&(l.mode&1)!==0)for(Xe=l,Ee=l.child;Ee!==null;){for(ke=Xe=Ee;Xe!==null;){switch(Ae=Xe,Ve=Ae.child,Ae.tag){case 0:case 11:case 14:case 15:Cu(4,Ae,Ae.return);break;case 1:ml(Ae,Ae.return);var Ze=Ae.stateNode;if(typeof Ze.componentWillUnmount=="function"){b=Ae,m=Ae.return;try{u=b,Ze.props=u.memoizedProps,Ze.state=u.memoizedState,Ze.componentWillUnmount()}catch(tt){bn(b,m,tt)}}break;case 5:ml(Ae,Ae.return);break;case 22:if(Ae.memoizedState!==null){AE(ke);continue}}Ve!==null?(Ve.return=Ae,Xe=Ve):AE(ke)}Ee=Ee.sibling}e:for(Ee=null,ke=l;;){if(ke.tag===5){if(Ee===null){Ee=ke;try{C=ke.stateNode,me?(_=C.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none"):(Y=ke.stateNode,te=ke.memoizedProps.style,M=te!=null&&te.hasOwnProperty("display")?te.display:null,Y.style.display=tr("display",M))}catch(tt){bn(l,l.return,tt)}}}else if(ke.tag===6){if(Ee===null)try{ke.stateNode.nodeValue=me?"":ke.memoizedProps}catch(tt){bn(l,l.return,tt)}}else if((ke.tag!==22&&ke.tag!==23||ke.memoizedState===null||ke===l)&&ke.child!==null){ke.child.return=ke,ke=ke.child;continue}if(ke===l)break e;for(;ke.sibling===null;){if(ke.return===null||ke.return===l)break e;Ee===ke&&(Ee=null),ke=ke.return}Ee===ke&&(Ee=null),ke.sibling.return=ke.return,ke=ke.sibling}}break;case 19:Pa(u,l),Ja(l),b&4&&jE(l);break;case 21:break;default:Pa(u,l),Ja(l)}}function Ja(l){var u=l.flags;if(u&2){try{e:{for(var m=l.return;m!==null;){if(xE(m)){var b=m;break e}m=m.return}throw Error(n(160))}switch(b.tag){case 5:var C=b.stateNode;b.flags&32&&(kt(C,""),b.flags&=-33);var _=bE(l);xy(l,_,C);break;case 3:case 4:var M=b.stateNode.containerInfo,Y=bE(l);yy(l,Y,M);break;default:throw Error(n(161))}}catch(te){bn(l,l.return,te)}l.flags&=-3}u&4096&&(l.flags&=-4097)}function X6(l,u,m){Xe=l,NE(l)}function NE(l,u,m){for(var b=(l.mode&1)!==0;Xe!==null;){var C=Xe,_=C.child;if(C.tag===22&&b){var M=C.memoizedState!==null||cp;if(!M){var Y=C.alternate,te=Y!==null&&Y.memoizedState!==null||or;Y=cp;var me=or;if(cp=M,(or=te)&&!me)for(Xe=C;Xe!==null;)M=Xe,te=M.child,M.tag===22&&M.memoizedState!==null?EE(C):te!==null?(te.return=M,Xe=te):EE(C);for(;_!==null;)Xe=_,NE(_),_=_.sibling;Xe=C,cp=Y,or=me}CE(l)}else(C.subtreeFlags&8772)!==0&&_!==null?(_.return=C,Xe=_):CE(l)}}function CE(l){for(;Xe!==null;){var u=Xe;if((u.flags&8772)!==0){var m=u.alternate;try{if((u.flags&8772)!==0)switch(u.tag){case 0:case 11:case 15:or||up(5,u);break;case 1:var b=u.stateNode;if(u.flags&4&&!or)if(m===null)b.componentDidMount();else{var C=u.elementType===u.type?m.memoizedProps:Ea(u.type,m.memoizedProps);b.componentDidUpdate(C,m.memoizedState,b.__reactInternalSnapshotBeforeUpdate)}var _=u.updateQueue;_!==null&&AA(u,_,b);break;case 3:var M=u.updateQueue;if(M!==null){if(m=null,u.child!==null)switch(u.child.tag){case 5:m=u.child.stateNode;break;case 1:m=u.child.stateNode}AA(u,M,m)}break;case 5:var Y=u.stateNode;if(m===null&&u.flags&4){m=Y;var te=u.memoizedProps;switch(u.type){case"button":case"input":case"select":case"textarea":te.autoFocus&&m.focus();break;case"img":te.src&&(m.src=te.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(u.memoizedState===null){var me=u.alternate;if(me!==null){var Ee=me.memoizedState;if(Ee!==null){var ke=Ee.dehydrated;ke!==null&&ru(ke)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}or||u.flags&512&&gy(u)}catch(Ae){bn(u,u.return,Ae)}}if(u===l){Xe=null;break}if(m=u.sibling,m!==null){m.return=u.return,Xe=m;break}Xe=u.return}}function AE(l){for(;Xe!==null;){var u=Xe;if(u===l){Xe=null;break}var m=u.sibling;if(m!==null){m.return=u.return,Xe=m;break}Xe=u.return}}function EE(l){for(;Xe!==null;){var u=Xe;try{switch(u.tag){case 0:case 11:case 15:var m=u.return;try{up(4,u)}catch(te){bn(u,m,te)}break;case 1:var b=u.stateNode;if(typeof b.componentDidMount=="function"){var C=u.return;try{b.componentDidMount()}catch(te){bn(u,C,te)}}var _=u.return;try{gy(u)}catch(te){bn(u,_,te)}break;case 5:var M=u.return;try{gy(u)}catch(te){bn(u,M,te)}}}catch(te){bn(u,u.return,te)}if(u===l){Xe=null;break}var Y=u.sibling;if(Y!==null){Y.return=u.return,Xe=Y;break}Xe=u.return}}var Q6=Math.ceil,dp=P.ReactCurrentDispatcher,by=P.ReactCurrentOwner,sa=P.ReactCurrentBatchConfig,Rt=0,Vn=null,Pn=null,Qn=0,Lr=0,vl=ci(0),Mn=0,Au=null,ao=0,fp=0,wy=0,Eu=null,Sr=null,jy=0,gl=1/0,As=null,pp=!1,Sy=null,mi=null,hp=!1,vi=null,mp=0,_u=0,Ny=null,vp=-1,gp=0;function ur(){return(Rt&6)!==0?he():vp!==-1?vp:vp=he()}function gi(l){return(l.mode&1)===0?1:(Rt&2)!==0&&Qn!==0?Qn&-Qn:I6.transition!==null?(gp===0&&(gp=bC()),gp):(l=Ht,l!==0||(l=window.event,l=l===void 0?16:PC(l.type)),l)}function Oa(l,u,m,b){if(50<_u)throw _u=0,Ny=null,Error(n(185));Jc(l,m,b),((Rt&2)===0||l!==Vn)&&(l===Vn&&((Rt&2)===0&&(fp|=m),Mn===4&&yi(l,Qn)),Nr(l,b),m===1&&Rt===0&&(u.mode&1)===0&&(gl=he()+500,Vf&&di()))}function Nr(l,u){var m=l.callbackNode;Af(l,u);var b=Xo(l,l===Vn?Qn:0);if(b===0)m!==null&&Sa(m),l.callbackNode=null,l.callbackPriority=0;else if(u=b&-b,l.callbackPriority!==u){if(m!=null&&Sa(m),u===1)l.tag===0?T6(PE.bind(null,l)):hA(PE.bind(null,l)),P6(function(){(Rt&6)===0&&di()}),m=null;else{switch(wC(b)){case 1:m=T;break;case 4:m=ne;break;case 16:m=be;break;case 536870912:m=rt;break;default:m=be}m=DE(m,_E.bind(null,l))}l.callbackPriority=u,l.callbackNode=m}}function _E(l,u){if(vp=-1,gp=0,(Rt&6)!==0)throw Error(n(327));var m=l.callbackNode;if(yl()&&l.callbackNode!==m)return null;var b=Xo(l,l===Vn?Qn:0);if(b===0)return null;if((b&30)!==0||(b&l.expiredLanes)!==0||u)u=yp(l,b);else{u=b;var C=Rt;Rt|=2;var _=kE();(Vn!==l||Qn!==u)&&(As=null,gl=he()+500,io(l,u));do try{e7();break}catch(Y){OE(l,Y)}while(!0);Ug(),dp.current=_,Rt=C,Pn!==null?u=0:(Vn=null,Qn=0,u=Mn)}if(u!==0){if(u===2&&(C=Ir(l),C!==0&&(b=C,u=Cy(l,C))),u===1)throw m=Au,io(l,0),yi(l,b),Nr(l,he()),m;if(u===6)yi(l,b);else{if(C=l.current.alternate,(b&30)===0&&!J6(C)&&(u=yp(l,b),u===2&&(_=Ir(l),_!==0&&(b=_,u=Cy(l,_))),u===1))throw m=Au,io(l,0),yi(l,b),Nr(l,he()),m;switch(l.finishedWork=C,l.finishedLanes=b,u){case 0:case 1:throw Error(n(345));case 2:oo(l,Sr,As);break;case 3:if(yi(l,b),(b&130023424)===b&&(u=jy+500-he(),10<u)){if(Xo(l,0)!==0)break;if(C=l.suspendedLanes,(C&b)!==b){ur(),l.pingedLanes|=l.suspendedLanes&C;break}l.timeoutHandle=kg(oo.bind(null,l,Sr,As),u);break}oo(l,Sr,As);break;case 4:if(yi(l,b),(b&4194240)===b)break;for(u=l.eventTimes,C=-1;0<b;){var M=31-Ct(b);_=1<<M,M=u[M],M>C&&(C=M),b&=~_}if(b=C,b=he()-b,b=(120>b?120:480>b?480:1080>b?1080:1920>b?1920:3e3>b?3e3:4320>b?4320:1960*Q6(b/1960))-b,10<b){l.timeoutHandle=kg(oo.bind(null,l,Sr,As),b);break}oo(l,Sr,As);break;case 5:oo(l,Sr,As);break;default:throw Error(n(329))}}}return Nr(l,he()),l.callbackNode===m?_E.bind(null,l):null}function Cy(l,u){var m=Eu;return l.current.memoizedState.isDehydrated&&(io(l,u).flags|=256),l=yp(l,u),l!==2&&(u=Sr,Sr=m,u!==null&&Ay(u)),l}function Ay(l){Sr===null?Sr=l:Sr.push.apply(Sr,l)}function J6(l){for(var u=l;;){if(u.flags&16384){var m=u.updateQueue;if(m!==null&&(m=m.stores,m!==null))for(var b=0;b<m.length;b++){var C=m[b],_=C.getSnapshot;C=C.value;try{if(!Ca(_(),C))return!1}catch{return!1}}}if(m=u.child,u.subtreeFlags&16384&&m!==null)m.return=u,u=m;else{if(u===l)break;for(;u.sibling===null;){if(u.return===null||u.return===l)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function yi(l,u){for(u&=~wy,u&=~fp,l.suspendedLanes|=u,l.pingedLanes&=~u,l=l.expirationTimes;0<u;){var m=31-Ct(u),b=1<<m;l[m]=-1,u&=~b}}function PE(l){if((Rt&6)!==0)throw Error(n(327));yl();var u=Xo(l,0);if((u&1)===0)return Nr(l,he()),null;var m=yp(l,u);if(l.tag!==0&&m===2){var b=Ir(l);b!==0&&(u=b,m=Cy(l,b))}if(m===1)throw m=Au,io(l,0),yi(l,u),Nr(l,he()),m;if(m===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=u,oo(l,Sr,As),Nr(l,he()),null}function Ey(l,u){var m=Rt;Rt|=1;try{return l(u)}finally{Rt=m,Rt===0&&(gl=he()+500,Vf&&di())}}function so(l){vi!==null&&vi.tag===0&&(Rt&6)===0&&yl();var u=Rt;Rt|=1;var m=sa.transition,b=Ht;try{if(sa.transition=null,Ht=1,l)return l()}finally{Ht=b,sa.transition=m,Rt=u,(Rt&6)===0&&di()}}function _y(){Lr=vl.current,un(vl)}function io(l,u){l.finishedWork=null,l.finishedLanes=0;var m=l.timeoutHandle;if(m!==-1&&(l.timeoutHandle=-1,_6(m)),Pn!==null)for(m=Pn.return;m!==null;){var b=m;switch(Dg(b),b.tag){case 1:b=b.type.childContextTypes,b!=null&&qf();break;case 3:pl(),un(br),un(ar),Xg();break;case 5:Gg(b);break;case 4:pl();break;case 13:un(vn);break;case 19:un(vn);break;case 10:qg(b.type._context);break;case 22:case 23:_y()}m=m.return}if(Vn=l,Pn=l=xi(l.current,null),Qn=Lr=u,Mn=0,Au=null,wy=fp=ao=0,Sr=Eu=null,to!==null){for(u=0;u<to.length;u++)if(m=to[u],b=m.interleaved,b!==null){m.interleaved=null;var C=b.next,_=m.pending;if(_!==null){var M=_.next;_.next=C,b.next=M}m.pending=b}to=null}return l}function OE(l,u){do{var m=Pn;try{if(Ug(),tp.current=sp,np){for(var b=gn.memoizedState;b!==null;){var C=b.queue;C!==null&&(C.pending=null),b=b.next}np=!1}if(ro=0,Wn=In=gn=null,bu=!1,wu=0,by.current=null,m===null||m.return===null){Mn=1,Au=u,Pn=null;break}e:{var _=l,M=m.return,Y=m,te=u;if(u=Qn,Y.flags|=32768,te!==null&&typeof te=="object"&&typeof te.then=="function"){var me=te,Ee=Y,ke=Ee.tag;if((Ee.mode&1)===0&&(ke===0||ke===11||ke===15)){var Ae=Ee.alternate;Ae?(Ee.updateQueue=Ae.updateQueue,Ee.memoizedState=Ae.memoizedState,Ee.lanes=Ae.lanes):(Ee.updateQueue=null,Ee.memoizedState=null)}var Ve=tE(M);if(Ve!==null){Ve.flags&=-257,nE(Ve,M,Y,_,u),Ve.mode&1&&eE(_,me,u),u=Ve,te=me;var Ze=u.updateQueue;if(Ze===null){var tt=new Set;tt.add(te),u.updateQueue=tt}else Ze.add(te);break e}else{if((u&1)===0){eE(_,me,u),Py();break e}te=Error(n(426))}}else if(hn&&Y.mode&1){var Nn=tE(M);if(Nn!==null){(Nn.flags&65536)===0&&(Nn.flags|=256),nE(Nn,M,Y,_,u),Bg(hl(te,Y));break e}}_=te=hl(te,Y),Mn!==4&&(Mn=2),Eu===null?Eu=[_]:Eu.push(_),_=M;do{switch(_.tag){case 3:_.flags|=65536,u&=-u,_.lanes|=u;var le=JA(_,te,u);CA(_,le);break e;case 1:Y=te;var re=_.type,fe=_.stateNode;if((_.flags&128)===0&&(typeof re.getDerivedStateFromError=="function"||fe!==null&&typeof fe.componentDidCatch=="function"&&(mi===null||!mi.has(fe)))){_.flags|=65536,u&=-u,_.lanes|=u;var Me=ZA(_,Y,u);CA(_,Me);break e}}_=_.return}while(_!==null)}TE(m)}catch(st){u=st,Pn===m&&m!==null&&(Pn=m=m.return);continue}break}while(!0)}function kE(){var l=dp.current;return dp.current=sp,l===null?sp:l}function Py(){(Mn===0||Mn===3||Mn===2)&&(Mn=4),Vn===null||(ao&268435455)===0&&(fp&268435455)===0||yi(Vn,Qn)}function yp(l,u){var m=Rt;Rt|=2;var b=kE();(Vn!==l||Qn!==u)&&(As=null,io(l,u));do try{Z6();break}catch(C){OE(l,C)}while(!0);if(Ug(),Rt=m,dp.current=b,Pn!==null)throw Error(n(261));return Vn=null,Qn=0,Mn}function Z6(){for(;Pn!==null;)RE(Pn)}function e7(){for(;Pn!==null&&!Qc();)RE(Pn)}function RE(l){var u=$E(l.alternate,l,Lr);l.memoizedProps=l.pendingProps,u===null?TE(l):Pn=u,by.current=null}function TE(l){var u=l;do{var m=u.alternate;if(l=u.return,(u.flags&32768)===0){if(m=H6(m,u,Lr),m!==null){Pn=m;return}}else{if(m=K6(m,u),m!==null){m.flags&=32767,Pn=m;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{Mn=6,Pn=null;return}}if(u=u.sibling,u!==null){Pn=u;return}Pn=u=l}while(u!==null);Mn===0&&(Mn=5)}function oo(l,u,m){var b=Ht,C=sa.transition;try{sa.transition=null,Ht=1,t7(l,u,m,b)}finally{sa.transition=C,Ht=b}return null}function t7(l,u,m,b){do yl();while(vi!==null);if((Rt&6)!==0)throw Error(n(327));m=l.finishedWork;var C=l.finishedLanes;if(m===null)return null;if(l.finishedWork=null,l.finishedLanes=0,m===l.current)throw Error(n(177));l.callbackNode=null,l.callbackPriority=0;var _=m.lanes|m.childLanes;if(Mz(l,_),l===Vn&&(Pn=Vn=null,Qn=0),(m.subtreeFlags&2064)===0&&(m.flags&2064)===0||hp||(hp=!0,DE(be,function(){return yl(),null})),_=(m.flags&15990)!==0,(m.subtreeFlags&15990)!==0||_){_=sa.transition,sa.transition=null;var M=Ht;Ht=1;var Y=Rt;Rt|=4,by.current=null,Y6(l,m),SE(m,l),w6(Pg),Pf=!!_g,Pg=_g=null,l.current=m,X6(m),K(),Rt=Y,Ht=M,sa.transition=_}else l.current=m;if(hp&&(hp=!1,vi=l,mp=C),_=l.pendingLanes,_===0&&(mi=null),Be(m.stateNode),Nr(l,he()),u!==null)for(b=l.onRecoverableError,m=0;m<u.length;m++)C=u[m],b(C.value,{componentStack:C.stack,digest:C.digest});if(pp)throw pp=!1,l=Sy,Sy=null,l;return(mp&1)!==0&&l.tag!==0&&yl(),_=l.pendingLanes,(_&1)!==0?l===Ny?_u++:(_u=0,Ny=l):_u=0,di(),null}function yl(){if(vi!==null){var l=wC(mp),u=sa.transition,m=Ht;try{if(sa.transition=null,Ht=16>l?16:l,vi===null)var b=!1;else{if(l=vi,vi=null,mp=0,(Rt&6)!==0)throw Error(n(331));var C=Rt;for(Rt|=4,Xe=l.current;Xe!==null;){var _=Xe,M=_.child;if((Xe.flags&16)!==0){var Y=_.deletions;if(Y!==null){for(var te=0;te<Y.length;te++){var me=Y[te];for(Xe=me;Xe!==null;){var Ee=Xe;switch(Ee.tag){case 0:case 11:case 15:Cu(8,Ee,_)}var ke=Ee.child;if(ke!==null)ke.return=Ee,Xe=ke;else for(;Xe!==null;){Ee=Xe;var Ae=Ee.sibling,Ve=Ee.return;if(yE(Ee),Ee===me){Xe=null;break}if(Ae!==null){Ae.return=Ve,Xe=Ae;break}Xe=Ve}}}var Ze=_.alternate;if(Ze!==null){var tt=Ze.child;if(tt!==null){Ze.child=null;do{var Nn=tt.sibling;tt.sibling=null,tt=Nn}while(tt!==null)}}Xe=_}}if((_.subtreeFlags&2064)!==0&&M!==null)M.return=_,Xe=M;else e:for(;Xe!==null;){if(_=Xe,(_.flags&2048)!==0)switch(_.tag){case 0:case 11:case 15:Cu(9,_,_.return)}var le=_.sibling;if(le!==null){le.return=_.return,Xe=le;break e}Xe=_.return}}var re=l.current;for(Xe=re;Xe!==null;){M=Xe;var fe=M.child;if((M.subtreeFlags&2064)!==0&&fe!==null)fe.return=M,Xe=fe;else e:for(M=re;Xe!==null;){if(Y=Xe,(Y.flags&2048)!==0)try{switch(Y.tag){case 0:case 11:case 15:up(9,Y)}}catch(st){bn(Y,Y.return,st)}if(Y===M){Xe=null;break e}var Me=Y.sibling;if(Me!==null){Me.return=Y.return,Xe=Me;break e}Xe=Y.return}}if(Rt=C,di(),vt&&typeof vt.onPostCommitFiberRoot=="function")try{vt.onPostCommitFiberRoot(Ge,l)}catch{}b=!0}return b}finally{Ht=m,sa.transition=u}}return!1}function IE(l,u,m){u=hl(m,u),u=JA(l,u,1),l=pi(l,u,1),u=ur(),l!==null&&(Jc(l,1,u),Nr(l,u))}function bn(l,u,m){if(l.tag===3)IE(l,l,m);else for(;u!==null;){if(u.tag===3){IE(u,l,m);break}else if(u.tag===1){var b=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof b.componentDidCatch=="function"&&(mi===null||!mi.has(b))){l=hl(m,l),l=ZA(u,l,1),u=pi(u,l,1),l=ur(),u!==null&&(Jc(u,1,l),Nr(u,l));break}}u=u.return}}function n7(l,u,m){var b=l.pingCache;b!==null&&b.delete(u),u=ur(),l.pingedLanes|=l.suspendedLanes&m,Vn===l&&(Qn&m)===m&&(Mn===4||Mn===3&&(Qn&130023424)===Qn&&500>he()-jy?io(l,0):wy|=m),Nr(l,u)}function ME(l,u){u===0&&((l.mode&1)===0?u=1:(u=Xi,Xi<<=1,(Xi&130023424)===0&&(Xi=4194304)));var m=ur();l=Ss(l,u),l!==null&&(Jc(l,u,m),Nr(l,m))}function r7(l){var u=l.memoizedState,m=0;u!==null&&(m=u.retryLane),ME(l,m)}function a7(l,u){var m=0;switch(l.tag){case 13:var b=l.stateNode,C=l.memoizedState;C!==null&&(m=C.retryLane);break;case 19:b=l.stateNode;break;default:throw Error(n(314))}b!==null&&b.delete(u),ME(l,m)}var $E;$E=function(l,u,m){if(l!==null)if(l.memoizedProps!==u.pendingProps||br.current)jr=!0;else{if((l.lanes&m)===0&&(u.flags&128)===0)return jr=!1,V6(l,u,m);jr=(l.flags&131072)!==0}else jr=!1,hn&&(u.flags&1048576)!==0&&mA(u,Kf,u.index);switch(u.lanes=0,u.tag){case 2:var b=u.type;lp(l,u),l=u.pendingProps;var C=il(u,ar.current);fl(u,m),C=Zg(null,u,b,l,C,m);var _=ey();return u.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,wr(b)?(_=!0,Wf(u)):_=!1,u.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,Hg(u),C.updater=ip,u.stateNode=C,C._reactInternals=u,iy(u,b,l,m),u=uy(null,u,b,!0,_,m)):(u.tag=0,hn&&_&&$g(u),cr(null,u,C,m),u=u.child),u;case 16:b=u.elementType;e:{switch(lp(l,u),l=u.pendingProps,C=b._init,b=C(b._payload),u.type=b,C=u.tag=i7(b),l=Ea(b,l),C){case 0:u=cy(null,u,b,l,m);break e;case 1:u=lE(null,u,b,l,m);break e;case 11:u=rE(null,u,b,l,m);break e;case 14:u=aE(null,u,b,Ea(b.type,l),m);break e}throw Error(n(306,b,""))}return u;case 0:return b=u.type,C=u.pendingProps,C=u.elementType===b?C:Ea(b,C),cy(l,u,b,C,m);case 1:return b=u.type,C=u.pendingProps,C=u.elementType===b?C:Ea(b,C),lE(l,u,b,C,m);case 3:e:{if(cE(u),l===null)throw Error(n(387));b=u.pendingProps,_=u.memoizedState,C=_.element,NA(l,u),Zf(u,b,null,m);var M=u.memoizedState;if(b=M.element,_.isDehydrated)if(_={element:b,isDehydrated:!1,cache:M.cache,pendingSuspenseBoundaries:M.pendingSuspenseBoundaries,transitions:M.transitions},u.updateQueue.baseState=_,u.memoizedState=_,u.flags&256){C=hl(Error(n(423)),u),u=uE(l,u,b,m,C);break e}else if(b!==C){C=hl(Error(n(424)),u),u=uE(l,u,b,m,C);break e}else for(Dr=li(u.stateNode.containerInfo.firstChild),$r=u,hn=!0,Aa=null,m=jA(u,null,b,m),u.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(cl(),b===C){u=Cs(l,u,m);break e}cr(l,u,b,m)}u=u.child}return u;case 5:return EA(u),l===null&&Fg(u),b=u.type,C=u.pendingProps,_=l!==null?l.memoizedProps:null,M=C.children,Og(b,C)?M=null:_!==null&&Og(b,_)&&(u.flags|=32),oE(l,u),cr(l,u,M,m),u.child;case 6:return l===null&&Fg(u),null;case 13:return dE(l,u,m);case 4:return Kg(u,u.stateNode.containerInfo),b=u.pendingProps,l===null?u.child=ul(u,null,b,m):cr(l,u,b,m),u.child;case 11:return b=u.type,C=u.pendingProps,C=u.elementType===b?C:Ea(b,C),rE(l,u,b,C,m);case 7:return cr(l,u,u.pendingProps,m),u.child;case 8:return cr(l,u,u.pendingProps.children,m),u.child;case 12:return cr(l,u,u.pendingProps.children,m),u.child;case 10:e:{if(b=u.type._context,C=u.pendingProps,_=u.memoizedProps,M=C.value,nn(Xf,b._currentValue),b._currentValue=M,_!==null)if(Ca(_.value,M)){if(_.children===C.children&&!br.current){u=Cs(l,u,m);break e}}else for(_=u.child,_!==null&&(_.return=u);_!==null;){var Y=_.dependencies;if(Y!==null){M=_.child;for(var te=Y.firstContext;te!==null;){if(te.context===b){if(_.tag===1){te=Ns(-1,m&-m),te.tag=2;var me=_.updateQueue;if(me!==null){me=me.shared;var Ee=me.pending;Ee===null?te.next=te:(te.next=Ee.next,Ee.next=te),me.pending=te}}_.lanes|=m,te=_.alternate,te!==null&&(te.lanes|=m),Wg(_.return,m,u),Y.lanes|=m;break}te=te.next}}else if(_.tag===10)M=_.type===u.type?null:_.child;else if(_.tag===18){if(M=_.return,M===null)throw Error(n(341));M.lanes|=m,Y=M.alternate,Y!==null&&(Y.lanes|=m),Wg(M,m,u),M=_.sibling}else M=_.child;if(M!==null)M.return=_;else for(M=_;M!==null;){if(M===u){M=null;break}if(_=M.sibling,_!==null){_.return=M.return,M=_;break}M=M.return}_=M}cr(l,u,C.children,m),u=u.child}return u;case 9:return C=u.type,b=u.pendingProps.children,fl(u,m),C=ra(C),b=b(C),u.flags|=1,cr(l,u,b,m),u.child;case 14:return b=u.type,C=Ea(b,u.pendingProps),C=Ea(b.type,C),aE(l,u,b,C,m);case 15:return sE(l,u,u.type,u.pendingProps,m);case 17:return b=u.type,C=u.pendingProps,C=u.elementType===b?C:Ea(b,C),lp(l,u),u.tag=1,wr(b)?(l=!0,Wf(u)):l=!1,fl(u,m),XA(u,b,C),iy(u,b,C,m),uy(null,u,b,!0,l,m);case 19:return pE(l,u,m);case 22:return iE(l,u,m)}throw Error(n(156,u.tag))};function DE(l,u){return Ga(l,u)}function s7(l,u,m,b){this.tag=l,this.key=m,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=b,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ia(l,u,m,b){return new s7(l,u,m,b)}function Oy(l){return l=l.prototype,!(!l||!l.isReactComponent)}function i7(l){if(typeof l=="function")return Oy(l)?1:0;if(l!=null){if(l=l.$$typeof,l===L)return 11;if(l===H)return 14}return 2}function xi(l,u){var m=l.alternate;return m===null?(m=ia(l.tag,u,l.key,l.mode),m.elementType=l.elementType,m.type=l.type,m.stateNode=l.stateNode,m.alternate=l,l.alternate=m):(m.pendingProps=u,m.type=l.type,m.flags=0,m.subtreeFlags=0,m.deletions=null),m.flags=l.flags&14680064,m.childLanes=l.childLanes,m.lanes=l.lanes,m.child=l.child,m.memoizedProps=l.memoizedProps,m.memoizedState=l.memoizedState,m.updateQueue=l.updateQueue,u=l.dependencies,m.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},m.sibling=l.sibling,m.index=l.index,m.ref=l.ref,m}function xp(l,u,m,b,C,_){var M=2;if(b=l,typeof l=="function")Oy(l)&&(M=1);else if(typeof l=="string")M=5;else e:switch(l){case k:return lo(m.children,C,_,u);case R:M=8,C|=8;break;case D:return l=ia(12,m,u,C|2),l.elementType=D,l.lanes=_,l;case G:return l=ia(13,m,u,C),l.elementType=G,l.lanes=_,l;case q:return l=ia(19,m,u,C),l.elementType=q,l.lanes=_,l;case Z:return bp(m,C,_,u);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case U:M=10;break e;case z:M=9;break e;case L:M=11;break e;case H:M=14;break e;case X:M=16,b=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return u=ia(M,m,u,C),u.elementType=l,u.type=b,u.lanes=_,u}function lo(l,u,m,b){return l=ia(7,l,b,u),l.lanes=m,l}function bp(l,u,m,b){return l=ia(22,l,b,u),l.elementType=Z,l.lanes=m,l.stateNode={isHidden:!1},l}function ky(l,u,m){return l=ia(6,l,null,u),l.lanes=m,l}function Ry(l,u,m){return u=ia(4,l.children!==null?l.children:[],l.key,u),u.lanes=m,u.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},u}function o7(l,u,m,b,C){this.tag=u,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=sg(0),this.expirationTimes=sg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sg(0),this.identifierPrefix=b,this.onRecoverableError=C,this.mutableSourceEagerHydrationData=null}function Ty(l,u,m,b,C,_,M,Y,te){return l=new o7(l,u,m,Y,te),u===1?(u=1,_===!0&&(u|=8)):u=0,_=ia(3,null,null,u),l.current=_,_.stateNode=l,_.memoizedState={element:b,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},Hg(_),l}function l7(l,u,m){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:O,key:b==null?null:""+b,children:l,containerInfo:u,implementation:m}}function LE(l){if(!l)return ui;l=l._reactInternals;e:{if(Rr(l)!==l||l.tag!==1)throw Error(n(170));var u=l;do{switch(u.tag){case 3:u=u.stateNode.context;break e;case 1:if(wr(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break e}}u=u.return}while(u!==null);throw Error(n(171))}if(l.tag===1){var m=l.type;if(wr(m))return fA(l,m,u)}return u}function FE(l,u,m,b,C,_,M,Y,te){return l=Ty(m,b,!0,l,C,_,M,Y,te),l.context=LE(null),m=l.current,b=ur(),C=gi(m),_=Ns(b,C),_.callback=u??null,pi(m,_,C),l.current.lanes=C,Jc(l,C,b),Nr(l,b),l}function wp(l,u,m,b){var C=u.current,_=ur(),M=gi(C);return m=LE(m),u.context===null?u.context=m:u.pendingContext=m,u=Ns(_,M),u.payload={element:l},b=b===void 0?null:b,b!==null&&(u.callback=b),l=pi(C,u,M),l!==null&&(Oa(l,C,M,_),Jf(l,C,M)),M}function jp(l){return l=l.current,l.child?(l.child.tag===5,l.child.stateNode):null}function BE(l,u){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var m=l.retryLane;l.retryLane=m!==0&&m<u?m:u}}function Iy(l,u){BE(l,u),(l=l.alternate)&&BE(l,u)}function c7(){return null}var zE=typeof reportError=="function"?reportError:function(l){console.error(l)};function My(l){this._internalRoot=l}Sp.prototype.render=My.prototype.render=function(l){var u=this._internalRoot;if(u===null)throw Error(n(409));wp(l,u,null,null)},Sp.prototype.unmount=My.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var u=l.containerInfo;so(function(){wp(null,l,null,null)}),u[xs]=null}};function Sp(l){this._internalRoot=l}Sp.prototype.unstable_scheduleHydration=function(l){if(l){var u=NC();l={blockedOn:null,target:l,priority:u};for(var m=0;m<si.length&&u!==0&&u<si[m].priority;m++);si.splice(m,0,l),m===0&&EC(l)}};function $y(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function Np(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function UE(){}function u7(l,u,m,b,C){if(C){if(typeof b=="function"){var _=b;b=function(){var me=jp(M);_.call(me)}}var M=FE(u,b,l,0,null,!1,!1,"",UE);return l._reactRootContainer=M,l[xs]=M.current,fu(l.nodeType===8?l.parentNode:l),so(),M}for(;C=l.lastChild;)l.removeChild(C);if(typeof b=="function"){var Y=b;b=function(){var me=jp(te);Y.call(me)}}var te=Ty(l,0,!1,null,null,!1,!1,"",UE);return l._reactRootContainer=te,l[xs]=te.current,fu(l.nodeType===8?l.parentNode:l),so(function(){wp(u,te,m,b)}),te}function Cp(l,u,m,b,C){var _=m._reactRootContainer;if(_){var M=_;if(typeof C=="function"){var Y=C;C=function(){var te=jp(M);Y.call(te)}}wp(u,M,l,C)}else M=u7(m,u,l,C,b);return jp(M)}jC=function(l){switch(l.tag){case 3:var u=l.stateNode;if(u.current.memoizedState.isDehydrated){var m=Na(u.pendingLanes);m!==0&&(ig(u,m|1),Nr(u,he()),(Rt&6)===0&&(gl=he()+500,di()))}break;case 13:so(function(){var b=Ss(l,1);if(b!==null){var C=ur();Oa(b,l,1,C)}}),Iy(l,1)}},og=function(l){if(l.tag===13){var u=Ss(l,134217728);if(u!==null){var m=ur();Oa(u,l,134217728,m)}Iy(l,134217728)}},SC=function(l){if(l.tag===13){var u=gi(l),m=Ss(l,u);if(m!==null){var b=ur();Oa(m,l,u,b)}Iy(l,u)}},NC=function(){return Ht},CC=function(l,u){var m=Ht;try{return Ht=l,u()}finally{Ht=m}},_n=function(l,u,m){switch(u){case"input":if(de(l,m),u=m.name,m.type==="radio"&&u!=null){for(m=l;m.parentNode;)m=m.parentNode;for(m=m.querySelectorAll("input[name="+JSON.stringify(""+u)+'][type="radio"]'),u=0;u<m.length;u++){var b=m[u];if(b!==l&&b.form===l.form){var C=Uf(b);if(!C)throw Error(n(90));pe(b),de(b,C)}}}break;case"textarea":Jt(l,m);break;case"select":u=m.value,u!=null&&$e(l,!!m.multiple,u,!1)}},ct=Ey,bt=so;var d7={usingClientEntryPoint:!1,Events:[mu,al,Uf,ue,Ie,Ey]},Pu={findFiberByHostInstance:Qi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},f7={bundleType:Pu.bundleType,version:Pu.version,rendererPackageName:Pu.rendererPackageName,rendererConfig:Pu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:P.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=Yo(l),l===null?null:l.stateNode},findFiberByHostInstance:Pu.findFiberByHostInstance||c7,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 Ap=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ap.isDisabled&&Ap.supportsFiber)try{Ge=Ap.inject(f7),vt=Ap}catch{}}return Cr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=d7,Cr.createPortal=function(l,u){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!$y(u))throw Error(n(200));return l7(l,u,null,m)},Cr.createRoot=function(l,u){if(!$y(l))throw Error(n(299));var m=!1,b="",C=zE;return u!=null&&(u.unstable_strictMode===!0&&(m=!0),u.identifierPrefix!==void 0&&(b=u.identifierPrefix),u.onRecoverableError!==void 0&&(C=u.onRecoverableError)),u=Ty(l,1,!1,null,null,m,!1,b,C),l[xs]=u.current,fu(l.nodeType===8?l.parentNode:l),new My(u)},Cr.findDOMNode=function(l){if(l==null)return null;if(l.nodeType===1)return l;var u=l._reactInternals;if(u===void 0)throw typeof l.render=="function"?Error(n(188)):(l=Object.keys(l).join(","),Error(n(268,l)));return l=Yo(u),l=l===null?null:l.stateNode,l},Cr.flushSync=function(l){return so(l)},Cr.hydrate=function(l,u,m){if(!Np(u))throw Error(n(200));return Cp(null,l,u,!0,m)},Cr.hydrateRoot=function(l,u,m){if(!$y(l))throw Error(n(405));var b=m!=null&&m.hydratedSources||null,C=!1,_="",M=zE;if(m!=null&&(m.unstable_strictMode===!0&&(C=!0),m.identifierPrefix!==void 0&&(_=m.identifierPrefix),m.onRecoverableError!==void 0&&(M=m.onRecoverableError)),u=FE(u,null,l,1,m??null,C,!1,_,M),l[xs]=u.current,fu(l),b)for(l=0;l<b.length;l++)m=b[l],C=m._getVersion,C=C(m._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[m,C]:u.mutableSourceEagerHydrationData.push(m,C);return new Sp(u)},Cr.render=function(l,u,m){if(!Np(u))throw Error(n(200));return Cp(null,l,u,!1,m)},Cr.unmountComponentAtNode=function(l){if(!Np(l))throw Error(n(40));return l._reactRootContainer?(so(function(){Cp(null,null,l,!1,function(){l._reactRootContainer=null,l[xs]=null})}),!0):!1},Cr.unstable_batchedUpdates=Ey,Cr.unstable_renderSubtreeIntoContainer=function(l,u,m,b){if(!Np(m))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return Cp(l,u,m,!1,b)},Cr.version="18.3.1-next-f1338f8080-20240426",Cr}var XE;function _M(){if(XE)return Fy.exports;XE=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Fy.exports=b7(),Fy.exports}var QE;function w7(){if(QE)return _p;QE=1;var e=_M();return _p.createRoot=e.createRoot,_p.hydrateRoot=e.hydrateRoot,_p}var j7=w7(),v=bS();const W=Yt(v),Am=h7({__proto__:null,default:W},[v]),S7=1,N7=1e6;let Uy=0;function C7(){return Uy=(Uy+1)%Number.MAX_SAFE_INTEGER,Uy.toString()}const qy=new Map,JE=e=>{if(qy.has(e))return;const t=setTimeout(()=>{qy.delete(e),Qu({type:"REMOVE_TOAST",toastId:e})},N7);qy.set(e,t)},A7=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,S7)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?JE(n):e.toasts.forEach(r=>{JE(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Zp=[];let eh={toasts:[]};function Qu(e){eh=A7(eh,e),Zp.forEach(t=>{t(eh)})}function Re({...e}){const t=C7(),n=a=>Qu({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>Qu({type:"DISMISS_TOAST",toastId:t});return Qu({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function E7(){const[e,t]=v.useState(eh);return v.useEffect(()=>(Zp.push(t),()=>{const n=Zp.indexOf(t);n>-1&&Zp.splice(n,1)}),[e]),{...e,toast:Re,dismiss:n=>Qu({type:"DISMISS_TOAST",toastId:n})}}var _c=_M();const PM=Yt(_c);function Pe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}function ZE(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function vr(...e){return t=>{let n=!1;const r=e.map(a=>{const i=ZE(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():ZE(e[a],null)}}}}function ft(...e){return v.useCallback(vr(...e),e)}function _7(e,t){const n=v.createContext(t),r=i=>{const{children:o,...c}=i,d=v.useMemo(()=>c,Object.values(c));return s.jsx(n.Provider,{value:d,children:o})};r.displayName=e+"Provider";function a(i){const o=v.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,a]}function er(e,t=[]){let n=[];function r(i,o){const c=v.createContext(o),d=n.length;n=[...n,o];const f=p=>{const{scope:g,children:y,...j}=p,w=g?.[e]?.[d]||c,x=v.useMemo(()=>j,Object.values(j));return s.jsx(w.Provider,{value:x,children:y})};f.displayName=i+"Provider";function h(p,g){const y=g?.[e]?.[d]||c,j=v.useContext(y);if(j)return j;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[f,h]}const a=()=>{const i=n.map(o=>v.createContext(o));return function(c){const d=c?.[e]||i;return v.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return a.scopeName=e,[r,P7(a,...t)]}function P7(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=r.reduce((c,{useScope:d,scopeName:f})=>{const p=d(i)[`__scope${f}`];return{...c,...p}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function e_(e){const t=O7(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(R7);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function O7(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=I7(a),c=T7(i,a.props);return a.type!==v.Fragment&&(c.ref=r?vr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var k7=Symbol("radix.slottable");function R7(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===k7}function T7(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function I7(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Jd(e){const t=e+"CollectionProvider",[n,r]=er(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=w=>{const{scope:x,children:S}=w,N=W.useRef(null),A=W.useRef(new Map).current;return s.jsx(a,{scope:x,itemMap:A,collectionRef:N,children:S})};o.displayName=t;const c=e+"CollectionSlot",d=e_(c),f=W.forwardRef((w,x)=>{const{scope:S,children:N}=w,A=i(c,S),P=ft(x,A.collectionRef);return s.jsx(d,{ref:P,children:N})});f.displayName=c;const h=e+"CollectionItemSlot",p="data-radix-collection-item",g=e_(h),y=W.forwardRef((w,x)=>{const{scope:S,children:N,...A}=w,P=W.useRef(null),E=ft(x,P),O=i(h,S);return W.useEffect(()=>(O.itemMap.set(P,{ref:P,...A}),()=>{O.itemMap.delete(P)})),s.jsx(g,{[p]:"",ref:E,children:N})});y.displayName=h;function j(w){const x=i(e+"CollectionConsumer",w);return W.useCallback(()=>{const N=x.collectionRef.current;if(!N)return[];const A=Array.from(N.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((O,k)=>A.indexOf(O.ref.current)-A.indexOf(k.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:o,Slot:f,ItemSlot:y},j,r]}function M7(e){const t=$7(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(L7);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function $7(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=B7(a),c=F7(i,a.props);return a.type!==v.Fragment&&(c.ref=r?vr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var D7=Symbol("radix.slottable");function L7(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===D7}function F7(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function B7(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var z7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qe=z7.reduce((e,t)=>{const n=M7(`Primitive.${t}`),r=v.forwardRef((a,i)=>{const{asChild:o,...c}=a,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function wS(e,t){e&&_c.flushSync(()=>e.dispatchEvent(t))}function Cn(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function U7(e,t=globalThis?.document){const n=Cn(e);v.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var q7="DismissableLayer",p1="dismissableLayer.update",W7="dismissableLayer.pointerDownOutside",V7="dismissableLayer.focusOutside",t_,OM=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Do=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:c,...d}=e,f=v.useContext(OM),[h,p]=v.useState(null),g=h?.ownerDocument??globalThis?.document,[,y]=v.useState({}),j=ft(t,k=>p(k)),w=Array.from(f.layers),[x]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),S=w.indexOf(x),N=h?w.indexOf(h):-1,A=f.layersWithOutsidePointerEventsDisabled.size>0,P=N>=S,E=K7(k=>{const R=k.target,D=[...f.branches].some(U=>U.contains(R));!P||D||(a?.(k),o?.(k),k.defaultPrevented||c?.())},g),O=G7(k=>{const R=k.target;[...f.branches].some(U=>U.contains(R))||(i?.(k),o?.(k),k.defaultPrevented||c?.())},g);return U7(k=>{N===f.layers.size-1&&(r?.(k),!k.defaultPrevented&&c&&(k.preventDefault(),c()))},g),v.useEffect(()=>{if(h)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(t_=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),n_(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=t_)}},[h,g,n,f]),v.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),n_())},[h,f]),v.useEffect(()=>{const k=()=>y({});return document.addEventListener(p1,k),()=>document.removeEventListener(p1,k)},[]),s.jsx(qe.div,{...d,ref:j,style:{pointerEvents:A?P?"auto":"none":void 0,...e.style},onFocusCapture:Pe(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Pe(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Pe(e.onPointerDownCapture,E.onPointerDownCapture)})});Do.displayName=q7;var H7="DismissableLayerBranch",kM=v.forwardRef((e,t)=>{const n=v.useContext(OM),r=v.useRef(null),a=ft(t,r);return v.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),s.jsx(qe.div,{...e,ref:a})});kM.displayName=H7;function K7(e,t=globalThis?.document){const n=Cn(e),r=v.useRef(!1),a=v.useRef(()=>{});return v.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let d=function(){RM(W7,n,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=d,t.addEventListener("click",a.current,{once:!0})):d()}else t.removeEventListener("click",a.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function G7(e,t=globalThis?.document){const n=Cn(e),r=v.useRef(!1);return v.useEffect(()=>{const a=i=>{i.target&&!r.current&&RM(V7,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function n_(){const e=new CustomEvent(p1);document.dispatchEvent(e)}function RM(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?wS(a,i):a.dispatchEvent(i)}var Y7=Do,X7=kM,zn=globalThis?.document?v.useLayoutEffect:()=>{},Q7="Portal",Pc=v.forwardRef((e,t)=>{const{container:n,...r}=e,[a,i]=v.useState(!1);zn(()=>i(!0),[]);const o=n||a&&globalThis?.document?.body;return o?PM.createPortal(s.jsx(qe.div,{...r,ref:t}),o):null});Pc.displayName=Q7;function J7(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var Un=e=>{const{present:t,children:n}=e,r=Z7(t),a=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),i=ft(r.ref,eU(a));return typeof n=="function"||r.isPresent?v.cloneElement(a,{ref:i}):null};Un.displayName="Presence";function Z7(e){const[t,n]=v.useState(),r=v.useRef(null),a=v.useRef(e),i=v.useRef("none"),o=e?"mounted":"unmounted",[c,d]=J7(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const f=Pp(r.current);i.current=c==="mounted"?f:"none"},[c]),zn(()=>{const f=r.current,h=a.current;if(h!==e){const g=i.current,y=Pp(f);e?d("MOUNT"):y==="none"||f?.display==="none"?d("UNMOUNT"):d(h&&g!==y?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),zn(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,p=y=>{const w=Pp(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&w&&(d("ANIMATION_END"),!a.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",f=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},g=y=>{y.target===t&&(i.current=Pp(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:v.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Pp(e){return e?.animationName||"none"}function eU(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var tU=Am[" useInsertionEffect ".trim().toString()]||zn;function Zr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,o]=nU({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:a;{const h=v.useRef(e!==void 0);v.useEffect(()=>{const p=h.current;p!==c&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=c},[c,r])}const f=v.useCallback(h=>{if(c){const p=rU(h)?h(e):h;p!==e&&o.current?.(p)}else i(h)},[c,e,i,o]);return[d,f]}function nU({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),a=v.useRef(n),i=v.useRef(t);return tU(()=>{i.current=t},[t]),v.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,r,i]}function rU(e){return typeof e=="function"}var TM=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),aU="VisuallyHidden",Em=v.forwardRef((e,t)=>s.jsx(qe.span,{...e,ref:t,style:{...TM,...e.style}}));Em.displayName=aU;var sU=Em,jS="ToastProvider",[SS,iU,oU]=Jd("Toast"),[IM]=er("Toast",[oU]),[lU,_m]=IM(jS),MM=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:o}=e,[c,d]=v.useState(null),[f,h]=v.useState(0),p=v.useRef(!1),g=v.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${jS}\`. Expected non-empty \`string\`.`),s.jsx(SS.Provider,{scope:t,children:s.jsx(lU,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:i,toastCount:f,viewport:c,onViewportChange:d,onToastAdd:v.useCallback(()=>h(y=>y+1),[]),onToastRemove:v.useCallback(()=>h(y=>y-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:g,children:o})})};MM.displayName=jS;var $M="ToastViewport",cU=["F8"],h1="toast.viewportPause",m1="toast.viewportResume",DM=v.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=cU,label:a="Notifications ({hotkey})",...i}=e,o=_m($M,n),c=iU(n),d=v.useRef(null),f=v.useRef(null),h=v.useRef(null),p=v.useRef(null),g=ft(t,p,o.onViewportChange),y=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=o.toastCount>0;v.useEffect(()=>{const x=S=>{r.length!==0&&r.every(A=>S[A]||S.code===A)&&p.current?.focus()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),v.useEffect(()=>{const x=d.current,S=p.current;if(j&&x&&S){const N=()=>{if(!o.isClosePausedRef.current){const O=new CustomEvent(h1);S.dispatchEvent(O),o.isClosePausedRef.current=!0}},A=()=>{if(o.isClosePausedRef.current){const O=new CustomEvent(m1);S.dispatchEvent(O),o.isClosePausedRef.current=!1}},P=O=>{!x.contains(O.relatedTarget)&&A()},E=()=>{x.contains(document.activeElement)||A()};return x.addEventListener("focusin",N),x.addEventListener("focusout",P),x.addEventListener("pointermove",N),x.addEventListener("pointerleave",E),window.addEventListener("blur",N),window.addEventListener("focus",A),()=>{x.removeEventListener("focusin",N),x.removeEventListener("focusout",P),x.removeEventListener("pointermove",N),x.removeEventListener("pointerleave",E),window.removeEventListener("blur",N),window.removeEventListener("focus",A)}}},[j,o.isClosePausedRef]);const w=v.useCallback(({tabbingDirection:x})=>{const N=c().map(A=>{const P=A.ref.current,E=[P,...jU(P)];return x==="forwards"?E:E.reverse()});return(x==="forwards"?N.reverse():N).flat()},[c]);return v.useEffect(()=>{const x=p.current;if(x){const S=N=>{const A=N.altKey||N.ctrlKey||N.metaKey;if(N.key==="Tab"&&!A){const E=document.activeElement,O=N.shiftKey;if(N.target===x&&O){f.current?.focus();return}const D=w({tabbingDirection:O?"backwards":"forwards"}),U=D.findIndex(z=>z===E);Wy(D.slice(U+1))?N.preventDefault():O?f.current?.focus():h.current?.focus()}};return x.addEventListener("keydown",S),()=>x.removeEventListener("keydown",S)}},[c,w]),s.jsxs(X7,{ref:d,role:"region","aria-label":a.replace("{hotkey}",y),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&s.jsx(v1,{ref:f,onFocusFromOutsideViewport:()=>{const x=w({tabbingDirection:"forwards"});Wy(x)}}),s.jsx(SS.Slot,{scope:n,children:s.jsx(qe.ol,{tabIndex:-1,...i,ref:g})}),j&&s.jsx(v1,{ref:h,onFocusFromOutsideViewport:()=>{const x=w({tabbingDirection:"backwards"});Wy(x)}})]})});DM.displayName=$M;var LM="ToastFocusProxy",v1=v.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,i=_m(LM,n);return s.jsx(Em,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:o=>{const c=o.relatedTarget;!i.viewport?.contains(c)&&r()}})});v1.displayName=LM;var Zd="Toast",uU="toast.swipeStart",dU="toast.swipeMove",fU="toast.swipeCancel",pU="toast.swipeEnd",FM=v.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:i,...o}=e,[c,d]=Zr({prop:r,defaultProp:a??!0,onChange:i,caller:Zd});return s.jsx(Un,{present:n||c,children:s.jsx(vU,{open:c,...o,ref:t,onClose:()=>d(!1),onPause:Cn(e.onPause),onResume:Cn(e.onResume),onSwipeStart:Pe(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Pe(e.onSwipeMove,f=>{const{x:h,y:p}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","move"),f.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${h}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${p}px`)}),onSwipeCancel:Pe(e.onSwipeCancel,f=>{f.currentTarget.setAttribute("data-swipe","cancel"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Pe(e.onSwipeEnd,f=>{const{x:h,y:p}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","end"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${h}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${p}px`),d(!1)})})})});FM.displayName=Zd;var[hU,mU]=IM(Zd,{onClose(){}}),vU=v.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:a,open:i,onClose:o,onEscapeKeyDown:c,onPause:d,onResume:f,onSwipeStart:h,onSwipeMove:p,onSwipeCancel:g,onSwipeEnd:y,...j}=e,w=_m(Zd,n),[x,S]=v.useState(null),N=ft(t,q=>S(q)),A=v.useRef(null),P=v.useRef(null),E=a||w.duration,O=v.useRef(0),k=v.useRef(E),R=v.useRef(0),{onToastAdd:D,onToastRemove:U}=w,z=Cn(()=>{x?.contains(document.activeElement)&&w.viewport?.focus(),o()}),L=v.useCallback(q=>{!q||q===1/0||(window.clearTimeout(R.current),O.current=new Date().getTime(),R.current=window.setTimeout(z,q))},[z]);v.useEffect(()=>{const q=w.viewport;if(q){const H=()=>{L(k.current),f?.()},X=()=>{const Z=new Date().getTime()-O.current;k.current=k.current-Z,window.clearTimeout(R.current),d?.()};return q.addEventListener(h1,X),q.addEventListener(m1,H),()=>{q.removeEventListener(h1,X),q.removeEventListener(m1,H)}}},[w.viewport,E,d,f,L]),v.useEffect(()=>{i&&!w.isClosePausedRef.current&&L(E)},[i,E,w.isClosePausedRef,L]),v.useEffect(()=>(D(),()=>U()),[D,U]);const G=v.useMemo(()=>x?HM(x):null,[x]);return w.viewport?s.jsxs(s.Fragment,{children:[G&&s.jsx(gU,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:G}),s.jsx(hU,{scope:n,onClose:z,children:_c.createPortal(s.jsx(SS.ItemSlot,{scope:n,children:s.jsx(Y7,{asChild:!0,onEscapeKeyDown:Pe(c,()=>{w.isFocusedToastEscapeKeyDownRef.current||z(),w.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(qe.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":w.swipeDirection,...j,ref:N,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Pe(e.onKeyDown,q=>{q.key==="Escape"&&(c?.(q.nativeEvent),q.nativeEvent.defaultPrevented||(w.isFocusedToastEscapeKeyDownRef.current=!0,z()))}),onPointerDown:Pe(e.onPointerDown,q=>{q.button===0&&(A.current={x:q.clientX,y:q.clientY})}),onPointerMove:Pe(e.onPointerMove,q=>{if(!A.current)return;const H=q.clientX-A.current.x,X=q.clientY-A.current.y,Z=!!P.current,I=["left","right"].includes(w.swipeDirection),F=["left","up"].includes(w.swipeDirection)?Math.min:Math.max,Q=I?F(0,H):0,B=I?0:F(0,X),$=q.pointerType==="touch"?10:2,ee={x:Q,y:B},V={originalEvent:q,delta:ee};Z?(P.current=ee,Op(dU,p,V,{discrete:!1})):r_(ee,w.swipeDirection,$)?(P.current=ee,Op(uU,h,V,{discrete:!1}),q.target.setPointerCapture(q.pointerId)):(Math.abs(H)>$||Math.abs(X)>$)&&(A.current=null)}),onPointerUp:Pe(e.onPointerUp,q=>{const H=P.current,X=q.target;if(X.hasPointerCapture(q.pointerId)&&X.releasePointerCapture(q.pointerId),P.current=null,A.current=null,H){const Z=q.currentTarget,I={originalEvent:q,delta:H};r_(H,w.swipeDirection,w.swipeThreshold)?Op(pU,y,I,{discrete:!0}):Op(fU,g,I,{discrete:!0}),Z.addEventListener("click",F=>F.preventDefault(),{once:!0})}})})})}),w.viewport)})]}):null}),gU=e=>{const{__scopeToast:t,children:n,...r}=e,a=_m(Zd,t),[i,o]=v.useState(!1),[c,d]=v.useState(!1);return bU(()=>o(!0)),v.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),c?null:s.jsx(Pc,{asChild:!0,children:s.jsx(Em,{...r,children:i&&s.jsxs(s.Fragment,{children:[a.label," ",n]})})})},yU="ToastTitle",BM=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(qe.div,{...r,ref:t})});BM.displayName=yU;var xU="ToastDescription",zM=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(qe.div,{...r,ref:t})});zM.displayName=xU;var UM="ToastAction",qM=v.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?s.jsx(VM,{altText:n,asChild:!0,children:s.jsx(NS,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${UM}\`. Expected non-empty \`string\`.`),null)});qM.displayName=UM;var WM="ToastClose",NS=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=mU(WM,n);return s.jsx(VM,{asChild:!0,children:s.jsx(qe.button,{type:"button",...r,ref:t,onClick:Pe(e.onClick,a.onClose)})})});NS.displayName=WM;var VM=v.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return s.jsx(qe.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function HM(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),wU(r)){const a=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!a)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...HM(r))}}),t}function Op(e,t,n,{discrete:r}){const a=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?wS(a,i):a.dispatchEvent(i)}var r_=(e,t,n=0)=>{const r=Math.abs(e.x),a=Math.abs(e.y),i=r>a;return t==="left"||t==="right"?i&&r>n:!i&&a>n};function bU(e=()=>{}){const t=Cn(e);zn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function wU(e){return e.nodeType===e.ELEMENT_NODE}function jU(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Wy(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var SU=MM,KM=DM,GM=FM,YM=BM,XM=zM,QM=qM,JM=NS;function ZM(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=ZM(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function St(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=ZM(e))&&(r&&(r+=" "),r+=t);return r}const a_=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,s_=St,Lo=(e,t)=>n=>{var r;if(t?.variants==null)return s_(e,n?.class,n?.className);const{variants:a,defaultVariants:i}=t,o=Object.keys(a).map(f=>{const h=n?.[f],p=i?.[f];if(h===null)return null;const g=a_(h)||a_(p);return a[f][g]}),c=n&&Object.entries(n).reduce((f,h)=>{let[p,g]=h;return g===void 0||(f[p]=g),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,h)=>{let{class:p,className:g,...y}=h;return Object.entries(y).every(j=>{let[w,x]=j;return Array.isArray(x)?x.includes({...i,...c}[w]):{...i,...c}[w]===x})?[...f,p,g]:f},[]);return s_(e,o,d,n?.class,n?.className)};const NU=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),e$=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var CU={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const AU=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:o,...c},d)=>v.createElement("svg",{ref:d,...CU,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:e$("lucide",a),...c},[...o.map(([f,h])=>v.createElement(f,h)),...Array.isArray(i)?i:[i]]));const ot=(e,t)=>{const n=v.forwardRef(({className:r,...a},i)=>v.createElement(AU,{ref:i,iconNode:t,className:e$(`lucide-${NU(e)}`,r),...a}));return n.displayName=`${e}`,n};const t$=ot("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);const EU=ot("ArrowLeftRight",[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]]);const No=ot("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const fa=ot("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);const od=ot("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);const Xl=ot("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const It=ot("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const n$=ot("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const La=ot("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const Ml=ot("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);const Vy=ot("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const $l=ot("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const _U=ot("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const th=ot("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);const PU=ot("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const Pm=ot("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ti=ot("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const r$=ot("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);const ma=ot("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);const Om=ot("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);const oh=ot("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const OU=ot("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const a$=ot("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);const i_=ot("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const s$=ot("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);const CS=ot("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);const kU=ot("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);const g1=ot("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);const i$=ot("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);const RU=ot("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);const Zn=ot("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const o$=ot("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]);const TU=ot("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);const l$=ot("NotebookTabs",[["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["path",{d:"M15 2v20",key:"dcj49h"}],["path",{d:"M15 7h5",key:"1xj5lc"}],["path",{d:"M15 12h5",key:"w5shd9"}],["path",{d:"M15 17h5",key:"1qaofu"}]]);const lh=ot("NotepadText",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"16",height:"18",x:"4",y:"4",rx:"2",key:"1u9h20"}],["path",{d:"M8 10h6",key:"3oa6kw"}],["path",{d:"M8 14h8",key:"1fgep2"}],["path",{d:"M8 18h5",key:"17enja"}]]);const IU=ot("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);const o_=ot("PanelRightClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);const l_=ot("PanelRightOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]]);const km=ot("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);const Dl=ot("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const Fa=ot("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const c$=ot("RectangleEllipsis",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M17 12h.01",key:"1m0b6t"}],["path",{d:"M7 12h.01",key:"eqddd0"}]]);const Ba=ot("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);const MU=ot("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);const AS=ot("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const u$=ot("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);const c_=ot("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);const ES=ot("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const ua=ot("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);const y1=ot("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const d$=ot("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);const Yr=ot("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const nh=ot("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const $U=ot("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);const _S=ot("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);const f$=ot("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);const Rs=ot("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);const Ii=ot("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),PS="-",DU=e=>{const t=FU(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const c=o.split(PS);return c[0]===""&&c.length!==1&&c.shift(),p$(c,t)||LU(o)},getConflictingClassGroupIds:(o,c)=>{const d=n[o]||[];return c&&r[o]?[...d,...r[o]]:d}}},p$=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?p$(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(PS);return t.validators.find(({validator:o})=>o(i))?.classGroupId},u_=/^\[(.+)\]$/,LU=e=>{if(u_.test(e)){const t=u_.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},FU=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return zU(Object.entries(e.classGroups),n).forEach(([i,o])=>{x1(o,r,i,t)}),r},x1=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:d_(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(BU(a)){x1(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,o])=>{x1(o,d_(t,i),n,r)})})},d_=(e,t)=>{let n=e;return t.split(PS).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},BU=e=>e.isThemeGetter,zU=(e,t)=>t?e.map(([n,r])=>{const a=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,c])=>[t+o,c])):i);return[n,a]}):e,UU=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return a(i,o),o},set(i,o){n.has(i)?n.set(i,o):a(i,o)}}},h$="!",qU=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],i=t.length,o=c=>{const d=[];let f=0,h=0,p;for(let x=0;x<c.length;x++){let S=c[x];if(f===0){if(S===a&&(r||c.slice(x,x+i)===t)){d.push(c.slice(h,x)),h=x+i;continue}if(S==="/"){p=x;continue}}S==="["?f++:S==="]"&&f--}const g=d.length===0?c:c.substring(h),y=g.startsWith(h$),j=y?g.substring(1):g,w=p&&p>h?p-h:void 0;return{modifiers:d,hasImportantModifier:y,baseClassName:j,maybePostfixModifierPosition:w}};return n?c=>n({className:c,parseClassName:o}):o},WU=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},VU=e=>({cache:UU(e.cacheSize),parseClassName:qU(e),...DU(e)}),HU=/\s+/,KU=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(HU);let c="";for(let d=o.length-1;d>=0;d-=1){const f=o[d],{modifiers:h,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:y}=n(f);let j=!!y,w=r(j?g.substring(0,y):g);if(!w){if(!j){c=f+(c.length>0?" "+c:c);continue}if(w=r(g),!w){c=f+(c.length>0?" "+c:c);continue}j=!1}const x=WU(h).join(":"),S=p?x+h$:x,N=S+w;if(i.includes(N))continue;i.push(N);const A=a(w,j);for(let P=0;P<A.length;++P){const E=A[P];i.push(S+E)}c=f+(c.length>0?" "+c:c)}return c};function GU(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=m$(t))&&(r&&(r+=" "),r+=n);return r}const m$=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=m$(e[r]))&&(n&&(n+=" "),n+=t);return n};function YU(e,...t){let n,r,a,i=o;function o(d){const f=t.reduce((h,p)=>p(h),e());return n=VU(f),r=n.cache.get,a=n.cache.set,i=c,c(d)}function c(d){const f=r(d);if(f)return f;const h=KU(d,n);return a(d,h),h}return function(){return i(GU.apply(null,arguments))}}const dn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},v$=/^\[(?:([a-z-]+):)?(.+)\]$/i,XU=/^\d+\/\d+$/,QU=new Set(["px","full","screen"]),JU=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ZU=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,eq=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,tq=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,nq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Es=e=>Ll(e)||QU.has(e)||XU.test(e),wi=e=>Oc(e,"length",uq),Ll=e=>!!e&&!Number.isNaN(Number(e)),Hy=e=>Oc(e,"number",Ll),ku=e=>!!e&&Number.isInteger(Number(e)),rq=e=>e.endsWith("%")&&Ll(e.slice(0,-1)),Nt=e=>v$.test(e),ji=e=>JU.test(e),aq=new Set(["length","size","percentage"]),sq=e=>Oc(e,aq,g$),iq=e=>Oc(e,"position",g$),oq=new Set(["image","url"]),lq=e=>Oc(e,oq,fq),cq=e=>Oc(e,"",dq),Ru=()=>!0,Oc=(e,t,n)=>{const r=v$.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},uq=e=>ZU.test(e)&&!eq.test(e),g$=()=>!1,dq=e=>tq.test(e),fq=e=>nq.test(e),pq=()=>{const e=dn("colors"),t=dn("spacing"),n=dn("blur"),r=dn("brightness"),a=dn("borderColor"),i=dn("borderRadius"),o=dn("borderSpacing"),c=dn("borderWidth"),d=dn("contrast"),f=dn("grayscale"),h=dn("hueRotate"),p=dn("invert"),g=dn("gap"),y=dn("gradientColorStops"),j=dn("gradientColorStopPositions"),w=dn("inset"),x=dn("margin"),S=dn("opacity"),N=dn("padding"),A=dn("saturate"),P=dn("scale"),E=dn("sepia"),O=dn("skew"),k=dn("space"),R=dn("translate"),D=()=>["auto","contain","none"],U=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",Nt,t],L=()=>[Nt,t],G=()=>["",Es,wi],q=()=>["auto",Ll,Nt],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],X=()=>["solid","dashed","dotted","double","none"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],I=()=>["start","end","center","between","around","evenly","stretch"],F=()=>["","0",Nt],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[Ll,Nt];return{cacheSize:500,separator:":",theme:{colors:[Ru],spacing:[Es,wi],blur:["none","",ji,Nt],brightness:B(),borderColor:[e],borderRadius:["none","","full",ji,Nt],borderSpacing:L(),borderWidth:G(),contrast:B(),grayscale:F(),hueRotate:B(),invert:F(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[rq,wi],inset:z(),margin:z(),opacity:B(),padding:L(),saturate:B(),scale:B(),sepia:F(),skew:B(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",Nt]}],container:["container"],columns:[{columns:[ji]}],"break-after":[{"break-after":Q()}],"break-before":[{"break-before":Q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...H(),Nt]}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ku,Nt]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Nt]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:["first","last","none",ku,Nt]}],"grid-cols":[{"grid-cols":[Ru]}],"col-start-end":[{col:["auto",{span:["full",ku,Nt]},Nt]}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":[Ru]}],"row-start-end":[{row:["auto",{span:[ku,Nt]},Nt]}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Nt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Nt]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...I()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...I(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...I(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[N]}],px:[{px:[N]}],py:[{py:[N]}],ps:[{ps:[N]}],pe:[{pe:[N]}],pt:[{pt:[N]}],pr:[{pr:[N]}],pb:[{pb:[N]}],pl:[{pl:[N]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Nt,t]}],"min-w":[{"min-w":[Nt,t,"min","max","fit"]}],"max-w":[{"max-w":[Nt,t,"none","full","min","max","fit","prose",{screen:[ji]},ji]}],h:[{h:[Nt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Nt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Nt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Nt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ji,wi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Hy]}],"font-family":[{font:[Ru]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Nt]}],"line-clamp":[{"line-clamp":["none",Ll,Hy]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Es,Nt]}],"list-image":[{"list-image":["none",Nt]}],"list-style-type":[{list:["none","disc","decimal",Nt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[S]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[S]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Es,wi]}],"underline-offset":[{"underline-offset":["auto",Es,Nt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Nt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Nt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[S]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),iq]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",sq]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},lq]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[j]}],"gradient-via-pos":[{via:[j]}],"gradient-to-pos":[{to:[j]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[S]}],"border-style":[{border:[...X(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[S]}],"divide-style":[{divide:X()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...X()]}],"outline-offset":[{"outline-offset":[Es,Nt]}],"outline-w":[{outline:[Es,wi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[S]}],"ring-offset-w":[{"ring-offset":[Es,wi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ji,cq]}],"shadow-color":[{shadow:[Ru]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...Z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",ji,Nt]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[p]}],saturate:[{saturate:[A]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[S]}],"backdrop-saturate":[{"backdrop-saturate":[A]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Nt]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",Nt]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",Nt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[P]}],"scale-x":[{"scale-x":[P]}],"scale-y":[{"scale-y":[P]}],rotate:[{rotate:[ku,Nt]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Nt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Nt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Nt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Es,wi,Hy]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},hq=YU(pq);function Se(...e){return hq(St(e))}const mq=SU,y$=v.forwardRef(({className:e,...t},n)=>s.jsx(KM,{ref:n,className:Se("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));y$.displayName=KM.displayName;const vq=Lo("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),x$=v.forwardRef(({className:e,variant:t,...n},r)=>s.jsx(GM,{ref:r,className:Se(vq({variant:t}),e),...n}));x$.displayName=GM.displayName;const gq=v.forwardRef(({className:e,...t},n)=>s.jsx(QM,{ref:n,className:Se("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));gq.displayName=QM.displayName;const b$=v.forwardRef(({className:e,...t},n)=>s.jsx(JM,{ref:n,className:Se("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:s.jsx(Ii,{className:"h-4 w-4"})}));b$.displayName=JM.displayName;const w$=v.forwardRef(({className:e,...t},n)=>s.jsx(YM,{ref:n,className:Se("text-sm font-semibold",e),...t}));w$.displayName=YM.displayName;const j$=v.forwardRef(({className:e,...t},n)=>s.jsx(XM,{ref:n,className:Se("text-sm opacity-90",e),...t}));j$.displayName=XM.displayName;function yq(){const{toasts:e}=E7();return s.jsxs(mq,{children:[e.map(function({id:t,title:n,description:r,action:a,...i}){return s.jsxs(x$,{...i,children:[s.jsxs("div",{className:"grid gap-1",children:[n&&s.jsx(w$,{children:n}),r&&s.jsx(j$,{children:r})]}),a,s.jsx(b$,{})]},t)}),s.jsx(y$,{})]})}var f_=["light","dark"],xq="(prefers-color-scheme: dark)",bq=v.createContext(void 0),wq={setTheme:e=>{},themes:[]},jq=()=>{var e;return(e=v.useContext(bq))!=null?e:wq};v.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:a,defaultTheme:i,value:o,attrs:c,nonce:d})=>{let f=i==="system",h=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${c.map(j=>`'${j}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,p=a?f_.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",g=(j,w=!1,x=!0)=>{let S=o?o[j]:j,N=w?j+"|| ''":`'${S}'`,A="";return a&&x&&!w&&f_.includes(j)&&(A+=`d.style.colorScheme = '${j}';`),n==="class"?w||S?A+=`c.add(${N})`:A+="null":S&&(A+=`d[s](n,${N})`),A},y=e?`!function(){${h}${g(e)}}()`:r?`!function(){try{${h}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${f})){var t='${xq}',m=window.matchMedia(t);if(m.media!==t||m.matches){${g("dark")}}else{${g("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${g(o?"x[e]":"e",!0)}}${f?"":"else{"+g(i,!1,!1)+"}"}${p}}catch(e){}}()`:`!function(){try{${h}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${g(o?"x[e]":"e",!0)}}else{${g(i,!1,!1)};}${p}}catch(t){}}();`;return v.createElement("script",{nonce:d,dangerouslySetInnerHTML:{__html:y}})});var Sq=e=>{switch(e){case"success":return Aq;case"info":return _q;case"warning":return Eq;case"error":return Pq;default:return null}},Nq=Array(12).fill(0),Cq=({visible:e,className:t})=>W.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},W.createElement("div",{className:"sonner-spinner"},Nq.map((n,r)=>W.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Aq=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Eq=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),_q=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Pq=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},W.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Oq=W.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},W.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),W.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),kq=()=>{let[e,t]=W.useState(document.hidden);return W.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},b1=1,Rq=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,a=typeof e?.id=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:b1++,i=this.toasts.find(c=>c.id===a),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(c=>c.id===a?(this.publish({...c,...e,id:a,title:n}),{...c,...e,id:a,dismissible:o,title:n}):c):this.addToast({title:n,...r,dismissible:o,id:a}),a},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),a=n!==void 0,i,o=r.then(async d=>{if(i=["resolve",d],W.isValidElement(d))a=!1,this.create({id:n,type:"default",message:d});else if(Iq(d)&&!d.ok){a=!1;let f=typeof t.error=="function"?await t.error(`HTTP error! status: ${d.status}`):t.error,h=typeof t.description=="function"?await t.description(`HTTP error! status: ${d.status}`):t.description;this.create({id:n,type:"error",message:f,description:h})}else if(t.success!==void 0){a=!1;let f=typeof t.success=="function"?await t.success(d):t.success,h=typeof t.description=="function"?await t.description(d):t.description;this.create({id:n,type:"success",message:f,description:h})}}).catch(async d=>{if(i=["reject",d],t.error!==void 0){a=!1;let f=typeof t.error=="function"?await t.error(d):t.error,h=typeof t.description=="function"?await t.description(d):t.description;this.create({id:n,type:"error",message:f,description:h})}}).finally(()=>{var d;a&&(this.dismiss(n),n=void 0),(d=t.finally)==null||d.call(t)}),c=()=>new Promise((d,f)=>o.then(()=>i[0]==="reject"?f(i[1]):d(i[1])).catch(f));return typeof n!="string"&&typeof n!="number"?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(e,t)=>{let n=t?.id||b1++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Ar=new Rq,Tq=(e,t)=>{let n=t?.id||b1++;return Ar.addToast({title:e,...t,id:n}),n},Iq=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Mq=Tq,$q=()=>Ar.toasts,Dq=()=>Ar.getActiveToasts();Object.assign(Mq,{success:Ar.success,info:Ar.info,warning:Ar.warning,error:Ar.error,custom:Ar.custom,message:Ar.message,promise:Ar.promise,dismiss:Ar.dismiss,loading:Ar.loading},{getHistory:$q,getToasts:Dq});function Lq(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Lq(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
9
|
+
`);function kp(e){return e.label!==void 0}var Fq=3,Bq="32px",zq="16px",p_=4e3,Uq=356,qq=14,Wq=20,Vq=200;function ka(...e){return e.filter(Boolean).join(" ")}function Hq(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var Kq=e=>{var t,n,r,a,i,o,c,d,f,h,p;let{invert:g,toast:y,unstyled:j,interacting:w,setHeights:x,visibleToasts:S,heights:N,index:A,toasts:P,expanded:E,removeToast:O,defaultRichColors:k,closeButton:R,style:D,cancelButtonStyle:U,actionButtonStyle:z,className:L="",descriptionClassName:G="",duration:q,position:H,gap:X,loadingIcon:Z,expandByDefault:I,classNames:F,icons:Q,closeButtonAriaLabel:B="Close toast",pauseWhenPageIsHidden:$}=e,[ee,V]=W.useState(null),[J,ge]=W.useState(null),[ie,ce]=W.useState(!1),[oe,xe]=W.useState(!1),[Oe,pe]=W.useState(!1),[ve,Ce]=W.useState(!1),[Le,se]=W.useState(!1),[de,Ne]=W.useState(0),[Fe,je]=W.useState(0),$e=W.useRef(y.duration||q||p_),et=W.useRef(null),xt=W.useRef(null),Jt=A===0,ye=A+1<=S,We=y.type,Ye=y.dismissible!==!1,Ot=y.className||"",Dt=y.descriptionClassName||"",kt=W.useMemo(()=>N.findIndex(Ie=>Ie.toastId===y.id)||0,[N,y.id]),Zt=W.useMemo(()=>{var Ie;return(Ie=y.closeButton)!=null?Ie:R},[y.closeButton,R]),Sn=W.useMemo(()=>y.duration||q||p_,[y.duration,q]),tr=W.useRef(0),nr=W.useRef(0),ba=W.useRef(0),En=W.useRef(null),[Or,kr]=H.split("-"),yr=W.useMemo(()=>N.reduce((Ie,ct,bt)=>bt>=kt?Ie:Ie+ct.height,0),[N,kt]),_n=kq(),Rn=y.invert||g,yn=We==="loading";nr.current=W.useMemo(()=>kt*X+yr,[kt,yr]),W.useEffect(()=>{$e.current=Sn},[Sn]),W.useEffect(()=>{ce(!0)},[]),W.useEffect(()=>{let Ie=xt.current;if(Ie){let ct=Ie.getBoundingClientRect().height;return je(ct),x(bt=>[{toastId:y.id,height:ct,position:y.position},...bt]),()=>x(bt=>bt.filter(Wt=>Wt.toastId!==y.id))}},[x,y.id]),W.useLayoutEffect(()=>{if(!ie)return;let Ie=xt.current,ct=Ie.style.height;Ie.style.height="auto";let bt=Ie.getBoundingClientRect().height;Ie.style.height=ct,je(bt),x(Wt=>Wt.find(on=>on.toastId===y.id)?Wt.map(on=>on.toastId===y.id?{...on,height:bt}:on):[{toastId:y.id,height:bt,position:y.position},...Wt])},[ie,y.title,y.description,x,y.id]);let Tn=W.useCallback(()=>{xe(!0),Ne(nr.current),x(Ie=>Ie.filter(ct=>ct.toastId!==y.id)),setTimeout(()=>{O(y)},Vq)},[y,O,x,nr]);W.useEffect(()=>{if(y.promise&&We==="loading"||y.duration===1/0||y.type==="loading")return;let Ie;return E||w||$&&_n?(()=>{if(ba.current<tr.current){let ct=new Date().getTime()-tr.current;$e.current=$e.current-ct}ba.current=new Date().getTime()})():$e.current!==1/0&&(tr.current=new Date().getTime(),Ie=setTimeout(()=>{var ct;(ct=y.onAutoClose)==null||ct.call(y,y),Tn()},$e.current)),()=>clearTimeout(Ie)},[E,w,y,We,$,_n,Tn]),W.useEffect(()=>{y.delete&&Tn()},[Tn,y.delete]);function ue(){var Ie,ct,bt;return Q!=null&&Q.loading?W.createElement("div",{className:ka(F?.loader,(Ie=y?.classNames)==null?void 0:Ie.loader,"sonner-loader"),"data-visible":We==="loading"},Q.loading):Z?W.createElement("div",{className:ka(F?.loader,(ct=y?.classNames)==null?void 0:ct.loader,"sonner-loader"),"data-visible":We==="loading"},Z):W.createElement(Cq,{className:ka(F?.loader,(bt=y?.classNames)==null?void 0:bt.loader),visible:We==="loading"})}return W.createElement("li",{tabIndex:0,ref:xt,className:ka(L,Ot,F?.toast,(t=y?.classNames)==null?void 0:t.toast,F?.default,F?.[We],(n=y?.classNames)==null?void 0:n[We]),"data-sonner-toast":"","data-rich-colors":(r=y.richColors)!=null?r:k,"data-styled":!(y.jsx||y.unstyled||j),"data-mounted":ie,"data-promise":!!y.promise,"data-swiped":Le,"data-removed":oe,"data-visible":ye,"data-y-position":Or,"data-x-position":kr,"data-index":A,"data-front":Jt,"data-swiping":Oe,"data-dismissible":Ye,"data-type":We,"data-invert":Rn,"data-swipe-out":ve,"data-swipe-direction":J,"data-expanded":!!(E||I&&ie),style:{"--index":A,"--toasts-before":A,"--z-index":P.length-A,"--offset":`${oe?de:nr.current}px`,"--initial-height":I?"auto":`${Fe}px`,...D,...y.style},onDragEnd:()=>{pe(!1),V(null),En.current=null},onPointerDown:Ie=>{yn||!Ye||(et.current=new Date,Ne(nr.current),Ie.target.setPointerCapture(Ie.pointerId),Ie.target.tagName!=="BUTTON"&&(pe(!0),En.current={x:Ie.clientX,y:Ie.clientY}))},onPointerUp:()=>{var Ie,ct,bt,Wt;if(ve||!Ye)return;En.current=null;let on=Number(((Ie=xt.current)==null?void 0:Ie.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Pt=Number(((ct=xt.current)==null?void 0:ct.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),rr=new Date().getTime()-((bt=et.current)==null?void 0:bt.getTime()),ln=ee==="x"?on:Pt,Xt=Math.abs(ln)/rr;if(Math.abs(ln)>=Wq||Xt>.11){Ne(nr.current),(Wt=y.onDismiss)==null||Wt.call(y,y),ge(ee==="x"?on>0?"right":"left":Pt>0?"down":"up"),Tn(),Ce(!0),se(!1);return}pe(!1),V(null)},onPointerMove:Ie=>{var ct,bt,Wt,on;if(!En.current||!Ye||((ct=window.getSelection())==null?void 0:ct.toString().length)>0)return;let Pt=Ie.clientY-En.current.y,rr=Ie.clientX-En.current.x,ln=(bt=e.swipeDirections)!=null?bt:Hq(H);!ee&&(Math.abs(rr)>1||Math.abs(Pt)>1)&&V(Math.abs(rr)>Math.abs(Pt)?"x":"y");let Xt={x:0,y:0};ee==="y"?(ln.includes("top")||ln.includes("bottom"))&&(ln.includes("top")&&Pt<0||ln.includes("bottom")&&Pt>0)&&(Xt.y=Pt):ee==="x"&&(ln.includes("left")||ln.includes("right"))&&(ln.includes("left")&&rr<0||ln.includes("right")&&rr>0)&&(Xt.x=rr),(Math.abs(Xt.x)>0||Math.abs(Xt.y)>0)&&se(!0),(Wt=xt.current)==null||Wt.style.setProperty("--swipe-amount-x",`${Xt.x}px`),(on=xt.current)==null||on.style.setProperty("--swipe-amount-y",`${Xt.y}px`)}},Zt&&!y.jsx?W.createElement("button",{"aria-label":B,"data-disabled":yn,"data-close-button":!0,onClick:yn||!Ye?()=>{}:()=>{var Ie;Tn(),(Ie=y.onDismiss)==null||Ie.call(y,y)},className:ka(F?.closeButton,(a=y?.classNames)==null?void 0:a.closeButton)},(i=Q?.close)!=null?i:Oq):null,y.jsx||v.isValidElement(y.title)?y.jsx?y.jsx:typeof y.title=="function"?y.title():y.title:W.createElement(W.Fragment,null,We||y.icon||y.promise?W.createElement("div",{"data-icon":"",className:ka(F?.icon,(o=y?.classNames)==null?void 0:o.icon)},y.promise||y.type==="loading"&&!y.icon?y.icon||ue():null,y.type!=="loading"?y.icon||Q?.[We]||Sq(We):null):null,W.createElement("div",{"data-content":"",className:ka(F?.content,(c=y?.classNames)==null?void 0:c.content)},W.createElement("div",{"data-title":"",className:ka(F?.title,(d=y?.classNames)==null?void 0:d.title)},typeof y.title=="function"?y.title():y.title),y.description?W.createElement("div",{"data-description":"",className:ka(G,Dt,F?.description,(f=y?.classNames)==null?void 0:f.description)},typeof y.description=="function"?y.description():y.description):null),v.isValidElement(y.cancel)?y.cancel:y.cancel&&kp(y.cancel)?W.createElement("button",{"data-button":!0,"data-cancel":!0,style:y.cancelButtonStyle||U,onClick:Ie=>{var ct,bt;kp(y.cancel)&&Ye&&((bt=(ct=y.cancel).onClick)==null||bt.call(ct,Ie),Tn())},className:ka(F?.cancelButton,(h=y?.classNames)==null?void 0:h.cancelButton)},y.cancel.label):null,v.isValidElement(y.action)?y.action:y.action&&kp(y.action)?W.createElement("button",{"data-button":!0,"data-action":!0,style:y.actionButtonStyle||z,onClick:Ie=>{var ct,bt;kp(y.action)&&((bt=(ct=y.action).onClick)==null||bt.call(ct,Ie),!Ie.defaultPrevented&&Tn())},className:ka(F?.actionButton,(p=y?.classNames)==null?void 0:p.actionButton)},y.action.label):null))};function h_(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Gq(e,t){let n={};return[e,t].forEach((r,a)=>{let i=a===1,o=i?"--mobile-offset":"--offset",c=i?zq:Bq;function d(f){["top","right","bottom","left"].forEach(h=>{n[`${o}-${h}`]=typeof f=="number"?`${f}px`:f})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(f=>{r[f]===void 0?n[`${o}-${f}`]=c:n[`${o}-${f}`]=typeof r[f]=="number"?`${r[f]}px`:r[f]}):d(c)}),n}var Yq=v.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:o,className:c,offset:d,mobileOffset:f,theme:h="light",richColors:p,duration:g,style:y,visibleToasts:j=Fq,toastOptions:w,dir:x=h_(),gap:S=qq,loadingIcon:N,icons:A,containerAriaLabel:P="Notifications",pauseWhenPageIsHidden:E}=e,[O,k]=W.useState([]),R=W.useMemo(()=>Array.from(new Set([r].concat(O.filter($=>$.position).map($=>$.position)))),[O,r]),[D,U]=W.useState([]),[z,L]=W.useState(!1),[G,q]=W.useState(!1),[H,X]=W.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Z=W.useRef(null),I=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=W.useRef(null),Q=W.useRef(!1),B=W.useCallback($=>{k(ee=>{var V;return(V=ee.find(J=>J.id===$.id))!=null&&V.delete||Ar.dismiss($.id),ee.filter(({id:J})=>J!==$.id)})},[]);return W.useEffect(()=>Ar.subscribe($=>{if($.dismiss){k(ee=>ee.map(V=>V.id===$.id?{...V,delete:!0}:V));return}setTimeout(()=>{PM.flushSync(()=>{k(ee=>{let V=ee.findIndex(J=>J.id===$.id);return V!==-1?[...ee.slice(0,V),{...ee[V],...$},...ee.slice(V+1)]:[$,...ee]})})})}),[]),W.useEffect(()=>{if(h!=="system"){X(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?X("dark"):X("light")),typeof window>"u")return;let $=window.matchMedia("(prefers-color-scheme: dark)");try{$.addEventListener("change",({matches:ee})=>{X(ee?"dark":"light")})}catch{$.addListener(({matches:V})=>{try{X(V?"dark":"light")}catch(J){console.error(J)}})}},[h]),W.useEffect(()=>{O.length<=1&&L(!1)},[O]),W.useEffect(()=>{let $=ee=>{var V,J;a.every(ge=>ee[ge]||ee.code===ge)&&(L(!0),(V=Z.current)==null||V.focus()),ee.code==="Escape"&&(document.activeElement===Z.current||(J=Z.current)!=null&&J.contains(document.activeElement))&&L(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[a]),W.useEffect(()=>{if(Z.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,Q.current=!1)}},[Z.current]),W.createElement("section",{ref:t,"aria-label":`${P} ${I}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map(($,ee)=>{var V;let[J,ge]=$.split("-");return O.length?W.createElement("ol",{key:$,dir:x==="auto"?h_():x,tabIndex:-1,ref:Z,className:c,"data-sonner-toaster":!0,"data-theme":H,"data-y-position":J,"data-lifted":z&&O.length>1&&!i,"data-x-position":ge,style:{"--front-toast-height":`${((V=D[0])==null?void 0:V.height)||0}px`,"--width":`${Uq}px`,"--gap":`${S}px`,...y,...Gq(d,f)},onBlur:ie=>{Q.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(Q.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||Q.current||(Q.current=!0,F.current=ie.relatedTarget)},onMouseEnter:()=>L(!0),onMouseMove:()=>L(!0),onMouseLeave:()=>{G||L(!1)},onDragEnd:()=>L(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||q(!0)},onPointerUp:()=>q(!1)},O.filter(ie=>!ie.position&&ee===0||ie.position===$).map((ie,ce)=>{var oe,xe;return W.createElement(Kq,{key:ie.id,icons:A,index:ce,toast:ie,defaultRichColors:p,duration:(oe=w?.duration)!=null?oe:g,className:w?.className,descriptionClassName:w?.descriptionClassName,invert:n,visibleToasts:j,closeButton:(xe=w?.closeButton)!=null?xe:o,interacting:G,position:$,style:w?.style,unstyled:w?.unstyled,classNames:w?.classNames,cancelButtonStyle:w?.cancelButtonStyle,actionButtonStyle:w?.actionButtonStyle,removeToast:B,toasts:O.filter(Oe=>Oe.position==ie.position),heights:D.filter(Oe=>Oe.position==ie.position),setHeights:U,expandByDefault:i,gap:S,loadingIcon:N,expanded:z,pauseWhenPageIsHidden:E,swipeDirections:e.swipeDirections})})):null}))});const Xq=({...e})=>{const{theme:t="system"}=jq();return s.jsx(Yq,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var Qq=Am[" useId ".trim().toString()]||(()=>{}),Jq=0;function Bn(e){const[t,n]=v.useState(Qq());return zn(()=>{n(r=>r??String(Jq++))},[e]),e||(t?`radix-${t}`:"")}const Zq=["top","right","bottom","left"],Mi=Math.min,qr=Math.max,ch=Math.round,Rp=Math.floor,ns=e=>({x:e,y:e}),e9={left:"right",right:"left",bottom:"top",top:"bottom"},t9={start:"end",end:"start"};function w1(e,t,n){return qr(e,Mi(t,n))}function Bs(e,t){return typeof e=="function"?e(t):e}function zs(e){return e.split("-")[0]}function kc(e){return e.split("-")[1]}function OS(e){return e==="x"?"y":"x"}function kS(e){return e==="y"?"height":"width"}const n9=new Set(["top","bottom"]);function es(e){return n9.has(zs(e))?"y":"x"}function RS(e){return OS(es(e))}function r9(e,t,n){n===void 0&&(n=!1);const r=kc(e),a=RS(e),i=kS(a);let o=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=uh(o)),[o,uh(o)]}function a9(e){const t=uh(e);return[j1(e),t,j1(t)]}function j1(e){return e.replace(/start|end/g,t=>t9[t])}const m_=["left","right"],v_=["right","left"],s9=["top","bottom"],i9=["bottom","top"];function o9(e,t,n){switch(e){case"top":case"bottom":return n?t?v_:m_:t?m_:v_;case"left":case"right":return t?s9:i9;default:return[]}}function l9(e,t,n,r){const a=kc(e);let i=o9(zs(e),n==="start",r);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(j1)))),i}function uh(e){return e.replace(/left|right|bottom|top/g,t=>e9[t])}function c9(e){return{top:0,right:0,bottom:0,left:0,...e}}function S$(e){return typeof e!="number"?c9(e):{top:e,right:e,bottom:e,left:e}}function dh(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function g_(e,t,n){let{reference:r,floating:a}=e;const i=es(t),o=RS(t),c=kS(o),d=zs(t),f=i==="y",h=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,g=r[c]/2-a[c]/2;let y;switch(d){case"top":y={x:h,y:r.y-a.height};break;case"bottom":y={x:h,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:p};break;case"left":y={x:r.x-a.width,y:p};break;default:y={x:r.x,y:r.y}}switch(kc(t)){case"start":y[o]-=g*(n&&f?-1:1);break;case"end":y[o]+=g*(n&&f?-1:1);break}return y}async function u9(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:o,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:g=!1,padding:y=0}=Bs(t,e),j=S$(y),x=c[g?p==="floating"?"reference":"floating":p],S=dh(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:f,rootBoundary:h,strategy:d})),N=p==="floating"?{x:r,y:a,width:o.floating.width,height:o.floating.height}:o.reference,A=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),P=await(i.isElement==null?void 0:i.isElement(A))?await(i.getScale==null?void 0:i.getScale(A))||{x:1,y:1}:{x:1,y:1},E=dh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:N,offsetParent:A,strategy:d}):N);return{top:(S.top-E.top+j.top)/P.y,bottom:(E.bottom-S.bottom+j.bottom)/P.y,left:(S.left-E.left+j.left)/P.x,right:(E.right-S.right+j.right)/P.x}}const d9=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:o}=n,c=i.filter(Boolean),d=await(o.isRTL==null?void 0:o.isRTL(t));let f=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:p}=g_(f,r,d),g=r,y={},j=0;for(let x=0;x<c.length;x++){var w;const{name:S,fn:N}=c[x],{x:A,y:P,data:E,reset:O}=await N({x:h,y:p,initialPlacement:r,placement:g,strategy:a,middlewareData:y,rects:f,platform:{...o,detectOverflow:(w=o.detectOverflow)!=null?w:u9},elements:{reference:e,floating:t}});h=A??h,p=P??p,y={...y,[S]:{...y[S],...E}},O&&j<=50&&(j++,typeof O=="object"&&(O.placement&&(g=O.placement),O.rects&&(f=O.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):O.rects),{x:h,y:p}=g_(f,g,d)),x=-1)}return{x:h,y:p,placement:g,strategy:a,middlewareData:y}},f9=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:o,elements:c,middlewareData:d}=t,{element:f,padding:h=0}=Bs(e,t)||{};if(f==null)return{};const p=S$(h),g={x:n,y:r},y=RS(a),j=kS(y),w=await o.getDimensions(f),x=y==="y",S=x?"top":"left",N=x?"bottom":"right",A=x?"clientHeight":"clientWidth",P=i.reference[j]+i.reference[y]-g[y]-i.floating[j],E=g[y]-i.reference[y],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f));let k=O?O[A]:0;(!k||!await(o.isElement==null?void 0:o.isElement(O)))&&(k=c.floating[A]||i.floating[j]);const R=P/2-E/2,D=k/2-w[j]/2-1,U=Mi(p[S],D),z=Mi(p[N],D),L=U,G=k-w[j]-z,q=k/2-w[j]/2+R,H=w1(L,q,G),X=!d.arrow&&kc(a)!=null&&q!==H&&i.reference[j]/2-(q<L?U:z)-w[j]/2<0,Z=X?q<L?q-L:q-G:0;return{[y]:g[y]+Z,data:{[y]:H,centerOffset:q-H-Z,...X&&{alignmentOffset:Z}},reset:X}}}),p9=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:o,initialPlacement:c,platform:d,elements:f}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:w=!0,...x}=Bs(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=zs(a),N=es(c),A=zs(c)===c,P=await(d.isRTL==null?void 0:d.isRTL(f.floating)),E=g||(A||!w?[uh(c)]:a9(c)),O=j!=="none";!g&&O&&E.push(...l9(c,w,j,P));const k=[c,...E],R=await d.detectOverflow(t,x),D=[];let U=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&D.push(R[S]),p){const q=r9(a,o,P);D.push(R[q[0]],R[q[1]])}if(U=[...U,{placement:a,overflows:D}],!D.every(q=>q<=0)){var z,L;const q=(((z=i.flip)==null?void 0:z.index)||0)+1,H=k[q];if(H&&(!(p==="alignment"?N!==es(H):!1)||U.every(I=>es(I.placement)===N?I.overflows[0]>0:!0)))return{data:{index:q,overflows:U},reset:{placement:H}};let X=(L=U.filter(Z=>Z.overflows[0]<=0).sort((Z,I)=>Z.overflows[1]-I.overflows[1])[0])==null?void 0:L.placement;if(!X)switch(y){case"bestFit":{var G;const Z=(G=U.filter(I=>{if(O){const F=es(I.placement);return F===N||F==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(F=>F>0).reduce((F,Q)=>F+Q,0)]).sort((I,F)=>I[1]-F[1])[0])==null?void 0:G[0];Z&&(X=Z);break}case"initialPlacement":X=c;break}if(a!==X)return{reset:{placement:X}}}return{}}}};function y_(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function x_(e){return Zq.some(t=>e[t]>=0)}const h9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...i}=Bs(e,t);switch(a){case"referenceHidden":{const o=await r.detectOverflow(t,{...i,elementContext:"reference"}),c=y_(o,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:x_(c)}}}case"escaped":{const o=await r.detectOverflow(t,{...i,altBoundary:!0}),c=y_(o,n.floating);return{data:{escapedOffsets:c,escaped:x_(c)}}}default:return{}}}}},N$=new Set(["left","top"]);async function m9(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),o=zs(n),c=kc(n),d=es(n)==="y",f=N$.has(o)?-1:1,h=i&&d?-1:1,p=Bs(t,e);let{mainAxis:g,crossAxis:y,alignmentAxis:j}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof j=="number"&&(y=c==="end"?j*-1:j),d?{x:y*h,y:g*f}:{x:g*f,y:y*h}}const v9=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:o,middlewareData:c}=t,d=await m9(t,e);return o===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:a+d.x,y:i+d.y,data:{...d,placement:o}}}}},g9=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:i}=t,{mainAxis:o=!0,crossAxis:c=!1,limiter:d={fn:S=>{let{x:N,y:A}=S;return{x:N,y:A}}},...f}=Bs(e,t),h={x:n,y:r},p=await i.detectOverflow(t,f),g=es(zs(a)),y=OS(g);let j=h[y],w=h[g];if(o){const S=y==="y"?"top":"left",N=y==="y"?"bottom":"right",A=j+p[S],P=j-p[N];j=w1(A,j,P)}if(c){const S=g==="y"?"top":"left",N=g==="y"?"bottom":"right",A=w+p[S],P=w-p[N];w=w1(A,w,P)}const x=d.fn({...t,[y]:j,[g]:w});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[y]:o,[g]:c}}}}}},y9=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:o}=t,{offset:c=0,mainAxis:d=!0,crossAxis:f=!0}=Bs(e,t),h={x:n,y:r},p=es(a),g=OS(p);let y=h[g],j=h[p];const w=Bs(c,t),x=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(d){const A=g==="y"?"height":"width",P=i.reference[g]-i.floating[A]+x.mainAxis,E=i.reference[g]+i.reference[A]-x.mainAxis;y<P?y=P:y>E&&(y=E)}if(f){var S,N;const A=g==="y"?"width":"height",P=N$.has(zs(a)),E=i.reference[p]-i.floating[A]+(P&&((S=o.offset)==null?void 0:S[p])||0)+(P?0:x.crossAxis),O=i.reference[p]+i.reference[A]+(P?0:((N=o.offset)==null?void 0:N[p])||0)-(P?x.crossAxis:0);j<E?j=E:j>O&&(j=O)}return{[g]:y,[p]:j}}}},x9=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:o,elements:c}=t,{apply:d=()=>{},...f}=Bs(e,t),h=await o.detectOverflow(t,f),p=zs(a),g=kc(a),y=es(a)==="y",{width:j,height:w}=i.floating;let x,S;p==="top"||p==="bottom"?(x=p,S=g===(await(o.isRTL==null?void 0:o.isRTL(c.floating))?"start":"end")?"left":"right"):(S=p,x=g==="end"?"top":"bottom");const N=w-h.top-h.bottom,A=j-h.left-h.right,P=Mi(w-h[x],N),E=Mi(j-h[S],A),O=!t.middlewareData.shift;let k=P,R=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=A),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=N),O&&!g){const U=qr(h.left,0),z=qr(h.right,0),L=qr(h.top,0),G=qr(h.bottom,0);y?R=j-2*(U!==0||z!==0?U+z:qr(h.left,h.right)):k=w-2*(L!==0||G!==0?L+G:qr(h.top,h.bottom))}await d({...t,availableWidth:R,availableHeight:k});const D=await o.getDimensions(c.floating);return j!==D.width||w!==D.height?{reset:{rects:!0}}:{}}}};function Rm(){return typeof window<"u"}function Rc(e){return C$(e)?(e.nodeName||"").toLowerCase():"#document"}function Xr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ls(e){var t;return(t=(C$(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function C$(e){return Rm()?e instanceof Node||e instanceof Xr(e).Node:!1}function za(e){return Rm()?e instanceof Element||e instanceof Xr(e).Element:!1}function ss(e){return Rm()?e instanceof HTMLElement||e instanceof Xr(e).HTMLElement:!1}function b_(e){return!Rm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Xr(e).ShadowRoot}const b9=new Set(["inline","contents"]);function ef(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ua(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!b9.has(a)}const w9=new Set(["table","td","th"]);function j9(e){return w9.has(Rc(e))}const S9=[":popover-open",":modal"];function Tm(e){return S9.some(t=>{try{return e.matches(t)}catch{return!1}})}const N9=["transform","translate","scale","rotate","perspective"],C9=["transform","translate","scale","rotate","perspective","filter"],A9=["paint","layout","strict","content"];function TS(e){const t=IS(),n=za(e)?Ua(e):e;return N9.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||C9.some(r=>(n.willChange||"").includes(r))||A9.some(r=>(n.contain||"").includes(r))}function E9(e){let t=$i(e);for(;ss(t)&&!Ql(t);){if(TS(t))return t;if(Tm(t))return null;t=$i(t)}return null}function IS(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const _9=new Set(["html","body","#document"]);function Ql(e){return _9.has(Rc(e))}function Ua(e){return Xr(e).getComputedStyle(e)}function Im(e){return za(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $i(e){if(Rc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||b_(e)&&e.host||ls(e);return b_(t)?t.host:t}function A$(e){const t=$i(e);return Ql(t)?e.ownerDocument?e.ownerDocument.body:e.body:ss(t)&&ef(t)?t:A$(t)}function ld(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=A$(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),o=Xr(a);if(i){const c=S1(o);return t.concat(o,o.visualViewport||[],ef(a)?a:[],c&&n?ld(c):[])}return t.concat(a,ld(a,[],n))}function S1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function E$(e){const t=Ua(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=ss(e),i=a?e.offsetWidth:n,o=a?e.offsetHeight:r,c=ch(n)!==i||ch(r)!==o;return c&&(n=i,r=o),{width:n,height:r,$:c}}function MS(e){return za(e)?e:e.contextElement}function Fl(e){const t=MS(e);if(!ss(t))return ns(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=E$(t);let o=(i?ch(n.width):n.width)/r,c=(i?ch(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const P9=ns(0);function _$(e){const t=Xr(e);return!IS()||!t.visualViewport?P9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function O9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Xr(e)?!1:t}function Co(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=MS(e);let o=ns(1);t&&(r?za(r)&&(o=Fl(r)):o=Fl(e));const c=O9(i,n,r)?_$(i):ns(0);let d=(a.left+c.x)/o.x,f=(a.top+c.y)/o.y,h=a.width/o.x,p=a.height/o.y;if(i){const g=Xr(i),y=r&&za(r)?Xr(r):r;let j=g,w=S1(j);for(;w&&r&&y!==j;){const x=Fl(w),S=w.getBoundingClientRect(),N=Ua(w),A=S.left+(w.clientLeft+parseFloat(N.paddingLeft))*x.x,P=S.top+(w.clientTop+parseFloat(N.paddingTop))*x.y;d*=x.x,f*=x.y,h*=x.x,p*=x.y,d+=A,f+=P,j=Xr(w),w=S1(j)}}return dh({width:h,height:p,x:d,y:f})}function Mm(e,t){const n=Im(e).scrollLeft;return t?t.left+n:Co(ls(e)).left+n}function P$(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Mm(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function k9(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",o=ls(r),c=t?Tm(t.floating):!1;if(r===o||c&&i)return n;let d={scrollLeft:0,scrollTop:0},f=ns(1);const h=ns(0),p=ss(r);if((p||!p&&!i)&&((Rc(r)!=="body"||ef(o))&&(d=Im(r)),ss(r))){const y=Co(r);f=Fl(r),h.x=y.x+r.clientLeft,h.y=y.y+r.clientTop}const g=o&&!p&&!i?P$(o,d):ns(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+h.x+g.x,y:n.y*f.y-d.scrollTop*f.y+h.y+g.y}}function R9(e){return Array.from(e.getClientRects())}function T9(e){const t=ls(e),n=Im(e),r=e.ownerDocument.body,a=qr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=qr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Mm(e);const c=-n.scrollTop;return Ua(r).direction==="rtl"&&(o+=qr(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:o,y:c}}const w_=25;function I9(e,t){const n=Xr(e),r=ls(e),a=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,c=0,d=0;if(a){i=a.width,o=a.height;const h=IS();(!h||h&&t==="fixed")&&(c=a.offsetLeft,d=a.offsetTop)}const f=Mm(r);if(f<=0){const h=r.ownerDocument,p=h.body,g=getComputedStyle(p),y=h.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,j=Math.abs(r.clientWidth-p.clientWidth-y);j<=w_&&(i-=j)}else f<=w_&&(i+=f);return{width:i,height:o,x:c,y:d}}const M9=new Set(["absolute","fixed"]);function $9(e,t){const n=Co(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=ss(e)?Fl(e):ns(1),o=e.clientWidth*i.x,c=e.clientHeight*i.y,d=a*i.x,f=r*i.y;return{width:o,height:c,x:d,y:f}}function j_(e,t,n){let r;if(t==="viewport")r=I9(e,n);else if(t==="document")r=T9(ls(e));else if(za(t))r=$9(t,n);else{const a=_$(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return dh(r)}function O$(e,t){const n=$i(e);return n===t||!za(n)||Ql(n)?!1:Ua(n).position==="fixed"||O$(n,t)}function D9(e,t){const n=t.get(e);if(n)return n;let r=ld(e,[],!1).filter(c=>za(c)&&Rc(c)!=="body"),a=null;const i=Ua(e).position==="fixed";let o=i?$i(e):e;for(;za(o)&&!Ql(o);){const c=Ua(o),d=TS(o);!d&&c.position==="fixed"&&(a=null),(i?!d&&!a:!d&&c.position==="static"&&!!a&&M9.has(a.position)||ef(o)&&!d&&O$(e,o))?r=r.filter(h=>h!==o):a=c,o=$i(o)}return t.set(e,r),r}function L9(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[...n==="clippingAncestors"?Tm(t)?[]:D9(t,this._c):[].concat(n),r],c=o[0],d=o.reduce((f,h)=>{const p=j_(t,h,a);return f.top=qr(p.top,f.top),f.right=Mi(p.right,f.right),f.bottom=Mi(p.bottom,f.bottom),f.left=qr(p.left,f.left),f},j_(t,c,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function F9(e){const{width:t,height:n}=E$(e);return{width:t,height:n}}function B9(e,t,n){const r=ss(t),a=ls(t),i=n==="fixed",o=Co(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const d=ns(0);function f(){d.x=Mm(a)}if(r||!r&&!i)if((Rc(t)!=="body"||ef(a))&&(c=Im(t)),r){const y=Co(t,!0,i,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}else a&&f();i&&!r&&a&&f();const h=a&&!r&&!i?P$(a,c):ns(0),p=o.left+c.scrollLeft-d.x-h.x,g=o.top+c.scrollTop-d.y-h.y;return{x:p,y:g,width:o.width,height:o.height}}function Ky(e){return Ua(e).position==="static"}function S_(e,t){if(!ss(e)||Ua(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ls(e)===n&&(n=n.ownerDocument.body),n}function k$(e,t){const n=Xr(e);if(Tm(e))return n;if(!ss(e)){let a=$i(e);for(;a&&!Ql(a);){if(za(a)&&!Ky(a))return a;a=$i(a)}return n}let r=S_(e,t);for(;r&&j9(r)&&Ky(r);)r=S_(r,t);return r&&Ql(r)&&Ky(r)&&!TS(r)?n:r||E9(e)||n}const z9=async function(e){const t=this.getOffsetParent||k$,n=this.getDimensions,r=await n(e.floating);return{reference:B9(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function U9(e){return Ua(e).direction==="rtl"}const q9={convertOffsetParentRelativeRectToViewportRelativeRect:k9,getDocumentElement:ls,getClippingRect:L9,getOffsetParent:k$,getElementRects:z9,getClientRects:R9,getDimensions:F9,getScale:Fl,isElement:za,isRTL:U9};function R$(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function W9(e,t){let n=null,r;const a=ls(e);function i(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function o(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),i();const f=e.getBoundingClientRect(),{left:h,top:p,width:g,height:y}=f;if(c||t(),!g||!y)return;const j=Rp(p),w=Rp(a.clientWidth-(h+g)),x=Rp(a.clientHeight-(p+y)),S=Rp(h),A={rootMargin:-j+"px "+-w+"px "+-x+"px "+-S+"px",threshold:qr(0,Mi(1,d))||1};let P=!0;function E(O){const k=O[0].intersectionRatio;if(k!==d){if(!P)return o();k?o(!1,k):r=setTimeout(()=>{o(!1,1e-7)},1e3)}k===1&&!R$(f,e.getBoundingClientRect())&&o(),P=!1}try{n=new IntersectionObserver(E,{...A,root:a.ownerDocument})}catch{n=new IntersectionObserver(E,A)}n.observe(e)}return o(!0),i}function V9(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=MS(e),h=a||i?[...f?ld(f):[],...ld(t)]:[];h.forEach(S=>{a&&S.addEventListener("scroll",n,{passive:!0}),i&&S.addEventListener("resize",n)});const p=f&&c?W9(f,n):null;let g=-1,y=null;o&&(y=new ResizeObserver(S=>{let[N]=S;N&&N.target===f&&y&&(y.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var A;(A=y)==null||A.observe(t)})),n()}),f&&!d&&y.observe(f),y.observe(t));let j,w=d?Co(e):null;d&&x();function x(){const S=Co(e);w&&!R$(w,S)&&n(),w=S,j=requestAnimationFrame(x)}return n(),()=>{var S;h.forEach(N=>{a&&N.removeEventListener("scroll",n),i&&N.removeEventListener("resize",n)}),p?.(),(S=y)==null||S.disconnect(),y=null,d&&cancelAnimationFrame(j)}}const H9=v9,K9=g9,G9=p9,Y9=x9,X9=h9,N_=f9,Q9=y9,J9=(e,t,n)=>{const r=new Map,a={platform:q9,...n},i={...a.platform,_c:r};return d9(e,t,{...a,platform:i})};var Z9=typeof document<"u",eW=function(){},rh=Z9?v.useLayoutEffect:eW;function fh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!fh(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!fh(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function T$(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function C_(e,t){const n=T$(e);return Math.round(t*n)/n}function Gy(e){const t=v.useRef(e);return rh(()=>{t.current=e}),t}function tW(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:o}={},transform:c=!0,whileElementsMounted:d,open:f}=e,[h,p]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,y]=v.useState(r);fh(g,r)||y(r);const[j,w]=v.useState(null),[x,S]=v.useState(null),N=v.useCallback(I=>{I!==O.current&&(O.current=I,w(I))},[]),A=v.useCallback(I=>{I!==k.current&&(k.current=I,S(I))},[]),P=i||j,E=o||x,O=v.useRef(null),k=v.useRef(null),R=v.useRef(h),D=d!=null,U=Gy(d),z=Gy(a),L=Gy(f),G=v.useCallback(()=>{if(!O.current||!k.current)return;const I={placement:t,strategy:n,middleware:g};z.current&&(I.platform=z.current),J9(O.current,k.current,I).then(F=>{const Q={...F,isPositioned:L.current!==!1};q.current&&!fh(R.current,Q)&&(R.current=Q,_c.flushSync(()=>{p(Q)}))})},[g,t,n,z,L]);rh(()=>{f===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p(I=>({...I,isPositioned:!1})))},[f]);const q=v.useRef(!1);rh(()=>(q.current=!0,()=>{q.current=!1}),[]),rh(()=>{if(P&&(O.current=P),E&&(k.current=E),P&&E){if(U.current)return U.current(P,E,G);G()}},[P,E,G,U,D]);const H=v.useMemo(()=>({reference:O,floating:k,setReference:N,setFloating:A}),[N,A]),X=v.useMemo(()=>({reference:P,floating:E}),[P,E]),Z=v.useMemo(()=>{const I={position:n,left:0,top:0};if(!X.floating)return I;const F=C_(X.floating,h.x),Q=C_(X.floating,h.y);return c?{...I,transform:"translate("+F+"px, "+Q+"px)",...T$(X.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:Q}},[n,c,X.floating,h.x,h.y]);return v.useMemo(()=>({...h,update:G,refs:H,elements:X,floatingStyles:Z}),[h,G,H,X,Z])}const nW=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?N_({element:r.current,padding:a}).fn(n):{}:r?N_({element:r,padding:a}).fn(n):{}}}},rW=(e,t)=>({...H9(e),options:[e,t]}),aW=(e,t)=>({...K9(e),options:[e,t]}),sW=(e,t)=>({...Q9(e),options:[e,t]}),iW=(e,t)=>({...G9(e),options:[e,t]}),oW=(e,t)=>({...Y9(e),options:[e,t]}),lW=(e,t)=>({...X9(e),options:[e,t]}),cW=(e,t)=>({...nW(e),options:[e,t]});var uW="Arrow",I$=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return s.jsx(qe.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});I$.displayName=uW;var dW=I$;function $m(e){const[t,n]=v.useState(void 0);return zn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let o,c;if("borderBoxSize"in i){const d=i.borderBoxSize,f=Array.isArray(d)?d[0]:d;o=f.inlineSize,c=f.blockSize}else o=e.offsetWidth,c=e.offsetHeight;n({width:o,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var $S="Popper",[M$,Li]=er($S),[fW,$$]=M$($S),D$=e=>{const{__scopePopper:t,children:n}=e,[r,a]=v.useState(null);return s.jsx(fW,{scope:t,anchor:r,onAnchorChange:a,children:n})};D$.displayName=$S;var L$="PopperAnchor",F$=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=$$(L$,n),o=v.useRef(null),c=ft(t,o),d=v.useRef(null);return v.useEffect(()=>{const f=d.current;d.current=r?.current||o.current,f!==d.current&&i.onAnchorChange(d.current)}),r?null:s.jsx(qe.div,{...a,ref:c})});F$.displayName=L$;var DS="PopperContent",[pW,hW]=M$(DS),B$=v.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:h=0,sticky:p="partial",hideWhenDetached:g=!1,updatePositionStrategy:y="optimized",onPlaced:j,...w}=e,x=$$(DS,n),[S,N]=v.useState(null),A=ft(t,ie=>N(ie)),[P,E]=v.useState(null),O=$m(P),k=O?.width??0,R=O?.height??0,D=r+(i!=="center"?"-"+i:""),U=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},z=Array.isArray(f)?f:[f],L=z.length>0,G={padding:U,boundary:z.filter(vW),altBoundary:L},{refs:q,floatingStyles:H,placement:X,isPositioned:Z,middlewareData:I}=tW({strategy:"fixed",placement:D,whileElementsMounted:(...ie)=>V9(...ie,{animationFrame:y==="always"}),elements:{reference:x.anchor},middleware:[rW({mainAxis:a+R,alignmentAxis:o}),d&&aW({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?sW():void 0,...G}),d&&iW({...G}),oW({...G,apply:({elements:ie,rects:ce,availableWidth:oe,availableHeight:xe})=>{const{width:Oe,height:pe}=ce.reference,ve=ie.floating.style;ve.setProperty("--radix-popper-available-width",`${oe}px`),ve.setProperty("--radix-popper-available-height",`${xe}px`),ve.setProperty("--radix-popper-anchor-width",`${Oe}px`),ve.setProperty("--radix-popper-anchor-height",`${pe}px`)}}),P&&cW({element:P,padding:c}),gW({arrowWidth:k,arrowHeight:R}),g&&lW({strategy:"referenceHidden",...G})]}),[F,Q]=q$(X),B=Cn(j);zn(()=>{Z&&B?.()},[Z,B]);const $=I.arrow?.x,ee=I.arrow?.y,V=I.arrow?.centerOffset!==0,[J,ge]=v.useState();return zn(()=>{S&&ge(window.getComputedStyle(S).zIndex)},[S]),s.jsx("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:Z?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(pW,{scope:n,placedSide:F,onArrowChange:E,arrowX:$,arrowY:ee,shouldHideArrow:V,children:s.jsx(qe.div,{"data-side":F,"data-align":Q,...w,ref:A,style:{...w.style,animation:Z?void 0:"none"}})})})});B$.displayName=DS;var z$="PopperArrow",mW={top:"bottom",right:"left",bottom:"top",left:"right"},U$=v.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=hW(z$,r),o=mW[i.placedSide];return s.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:s.jsx(dW,{...a,ref:n,style:{...a.style,display:"block"}})})});U$.displayName=z$;function vW(e){return e!==null}var gW=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:a}=t,o=a.arrow?.centerOffset!==0,c=o?0:e.arrowWidth,d=o?0:e.arrowHeight,[f,h]=q$(n),p={start:"0%",center:"50%",end:"100%"}[h],g=(a.arrow?.x??0)+c/2,y=(a.arrow?.y??0)+d/2;let j="",w="";return f==="bottom"?(j=o?p:`${g}px`,w=`${-d}px`):f==="top"?(j=o?p:`${g}px`,w=`${r.floating.height+d}px`):f==="right"?(j=`${-d}px`,w=o?p:`${y}px`):f==="left"&&(j=`${r.floating.width+d}px`,w=o?p:`${y}px`),{data:{x:j,y:w}}}});function q$(e){const[t,n="center"]=e.split("-");return[t,n]}var Dm=D$,tf=F$,Lm=B$,Fm=U$,yW=Symbol("radix.slottable");function xW(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=yW,t}var[Bm]=er("Tooltip",[Li]),zm=Li(),W$="TooltipProvider",bW=700,N1="tooltip.open",[wW,LS]=Bm(W$),V$=e=>{const{__scopeTooltip:t,delayDuration:n=bW,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,o=v.useRef(!0),c=v.useRef(!1),d=v.useRef(0);return v.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),s.jsx(wW,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:v.useCallback(()=>{window.clearTimeout(d.current),o.current=!1},[]),onClose:v.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:v.useCallback(f=>{c.current=f},[]),disableHoverableContent:a,children:i})};V$.displayName=W$;var cd="Tooltip",[jW,Um]=Bm(cd),H$=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:c}=e,d=LS(cd,e.__scopeTooltip),f=zm(t),[h,p]=v.useState(null),g=Bn(),y=v.useRef(0),j=o??d.disableHoverableContent,w=c??d.delayDuration,x=v.useRef(!1),[S,N]=Zr({prop:r,defaultProp:a??!1,onChange:k=>{k?(d.onOpen(),document.dispatchEvent(new CustomEvent(N1))):d.onClose(),i?.(k)},caller:cd}),A=v.useMemo(()=>S?x.current?"delayed-open":"instant-open":"closed",[S]),P=v.useCallback(()=>{window.clearTimeout(y.current),y.current=0,x.current=!1,N(!0)},[N]),E=v.useCallback(()=>{window.clearTimeout(y.current),y.current=0,N(!1)},[N]),O=v.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{x.current=!0,N(!0),y.current=0},w)},[w,N]);return v.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),s.jsx(Dm,{...f,children:s.jsx(jW,{scope:t,contentId:g,open:S,stateAttribute:A,trigger:h,onTriggerChange:p,onTriggerEnter:v.useCallback(()=>{d.isOpenDelayedRef.current?O():P()},[d.isOpenDelayedRef,O,P]),onTriggerLeave:v.useCallback(()=>{j?E():(window.clearTimeout(y.current),y.current=0)},[E,j]),onOpen:P,onClose:E,disableHoverableContent:j,children:n})})};H$.displayName=cd;var C1="TooltipTrigger",K$=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Um(C1,n),i=LS(C1,n),o=zm(n),c=v.useRef(null),d=ft(t,c,a.onTriggerChange),f=v.useRef(!1),h=v.useRef(!1),p=v.useCallback(()=>f.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),s.jsx(tf,{asChild:!0,...o,children:s.jsx(qe.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:d,onPointerMove:Pe(e.onPointerMove,g=>{g.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),h.current=!0)}),onPointerLeave:Pe(e.onPointerLeave,()=>{a.onTriggerLeave(),h.current=!1}),onPointerDown:Pe(e.onPointerDown,()=>{a.open&&a.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Pe(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:Pe(e.onBlur,a.onClose),onClick:Pe(e.onClick,a.onClose)})})});K$.displayName=C1;var SW="TooltipPortal",[_ge,NW]=Bm(SW,{forceMount:void 0}),Jl="TooltipContent",G$=v.forwardRef((e,t)=>{const n=NW(Jl,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,o=Um(Jl,e.__scopeTooltip);return s.jsx(Un,{present:r||o.open,children:o.disableHoverableContent?s.jsx(Y$,{side:a,...i,ref:t}):s.jsx(CW,{side:a,...i,ref:t})})}),CW=v.forwardRef((e,t)=>{const n=Um(Jl,e.__scopeTooltip),r=LS(Jl,e.__scopeTooltip),a=v.useRef(null),i=ft(t,a),[o,c]=v.useState(null),{trigger:d,onClose:f}=n,h=a.current,{onPointerInTransitChange:p}=r,g=v.useCallback(()=>{c(null),p(!1)},[p]),y=v.useCallback((j,w)=>{const x=j.currentTarget,S={x:j.clientX,y:j.clientY},N=OW(S,x.getBoundingClientRect()),A=kW(S,N),P=RW(w.getBoundingClientRect()),E=IW([...A,...P]);c(E),p(!0)},[p]);return v.useEffect(()=>()=>g(),[g]),v.useEffect(()=>{if(d&&h){const j=x=>y(x,h),w=x=>y(x,d);return d.addEventListener("pointerleave",j),h.addEventListener("pointerleave",w),()=>{d.removeEventListener("pointerleave",j),h.removeEventListener("pointerleave",w)}}},[d,h,y,g]),v.useEffect(()=>{if(o){const j=w=>{const x=w.target,S={x:w.clientX,y:w.clientY},N=d?.contains(x)||h?.contains(x),A=!TW(S,o);N?g():A&&(g(),f())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[d,h,o,f,g]),s.jsx(Y$,{...e,ref:i})}),[AW,EW]=Bm(cd,{isInside:!1}),_W=xW("TooltipContent"),Y$=v.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...c}=e,d=Um(Jl,n),f=zm(n),{onClose:h}=d;return v.useEffect(()=>(document.addEventListener(N1,h),()=>document.removeEventListener(N1,h)),[h]),v.useEffect(()=>{if(d.trigger){const p=g=>{g.target?.contains(d.trigger)&&h()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,h]),s.jsx(Do,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:s.jsxs(Lm,{"data-state":d.stateAttribute,...f,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(_W,{children:r}),s.jsx(AW,{scope:n,isInside:!0,children:s.jsx(sU,{id:d.contentId,role:"tooltip",children:a||r})})]})})});G$.displayName=Jl;var X$="TooltipArrow",PW=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=zm(n);return EW(X$,n).isInside?null:s.jsx(Fm,{...a,...r,ref:t})});PW.displayName=X$;function OW(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,a,i)){case i:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function kW(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function RW(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function TW(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const c=t[i],d=t[o],f=c.x,h=c.y,p=d.x,g=d.y;h>r!=g>r&&n<(p-f)*(r-h)/(g-h)+f&&(a=!a)}return a}function IW(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),MW(t)}function MW(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const a=e[r];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))n.pop();else break}n.push(a)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var $W=V$,DW=H$,LW=K$,Q$=G$;const J$=$W,Z$=DW,eD=LW,FS=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(Q$,{ref:r,sideOffset:t,className:Se("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));FS.displayName=Q$.displayName;var qm=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},FW={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},BW=class{#e=FW;#n=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},A1=new BW;function zW(e){setTimeout(e,0)}var Wm=typeof window>"u"||"Deno"in globalThis;function Ia(){}function UW(e,t){return typeof e=="function"?e(t):e}function qW(e){return typeof e=="number"&&e>=0&&e!==1/0}function WW(e,t){return Math.max(e+(t||0)-Date.now(),0)}function E1(e,t){return typeof e=="function"?e(t):e}function VW(e,t){return typeof e=="function"?e(t):e}function A_(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:o,stale:c}=e;if(o){if(r){if(t.queryHash!==BS(o,t.options))return!1}else if(!dd(t.queryKey,o))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||a&&a!==t.state.fetchStatus||i&&!i(t))}function E_(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(ud(t.options.mutationKey)!==ud(i))return!1}else if(!dd(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function BS(e,t){return(t?.queryKeyHashFn||ud)(e)}function ud(e){return JSON.stringify(e,(t,n)=>_1(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function dd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>dd(e[n],t[n])):!1}var HW=Object.prototype.hasOwnProperty;function tD(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=__(e)&&__(t);if(!r&&!(_1(e)&&_1(t)))return t;const i=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),c=o.length,d=r?new Array(c):{};let f=0;for(let h=0;h<c;h++){const p=r?h:o[h],g=e[p],y=t[p];if(g===y){d[p]=g,(r?h<i:HW.call(e,p))&&f++;continue}if(g===null||y===null||typeof g!="object"||typeof y!="object"){d[p]=y;continue}const j=tD(g,y,n+1);d[p]=j,j===g&&f++}return i===c&&f===i?e:d}function __(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function _1(e){if(!P_(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!P_(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function P_(e){return Object.prototype.toString.call(e)==="[object Object]"}function KW(e){return new Promise(t=>{A1.setTimeout(t,e)})}function GW(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?tD(e,t):t}function YW(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function XW(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var zS=Symbol();function nD(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===zS?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function QW(e,t,n){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??=t(),r||(r=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),e}var JW=class extends qm{#e;#n;#t;constructor(){super(),this.#t=e=>{if(!Wm&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#t=e,this.#n?.(),this.#n=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},rD=new JW;function ZW(){let e,t;const n=new Promise((a,i)=>{e=a,t=i});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}var eV=zW;function tV(){let e=[],t=0,n=c=>{c()},r=c=>{c()},a=eV;const i=c=>{t?e.push(c):a(()=>{n(c)})},o=()=>{const c=e;e=[],c.length&&a(()=>{r(()=>{c.forEach(d=>{n(d)})})})};return{batch:c=>{let d;t++;try{d=c()}finally{t--,t||o()}return d},batchCalls:c=>(...d)=>{i(()=>{c(...d)})},schedule:i,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{a=c}}}var dr=tV(),nV=class extends qm{#e=!0;#n;#t;constructor(){super(),this.#t=e=>{if(!Wm&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#t=e,this.#n?.(),this.#n=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},ph=new nV;function rV(e){return Math.min(1e3*2**e,3e4)}function aD(e){return(e??"online")==="online"?ph.isOnline():!0}var P1=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function sD(e){let t=!1,n=0,r;const a=ZW(),i=()=>a.status!=="pending",o=w=>{if(!i()){const x=new P1(w);g(x),e.onCancel?.(x)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>rD.isFocused()&&(e.networkMode==="always"||ph.isOnline())&&e.canRun(),h=()=>aD(e.networkMode)&&e.canRun(),p=w=>{i()||(r?.(),a.resolve(w))},g=w=>{i()||(r?.(),a.reject(w))},y=()=>new Promise(w=>{r=x=>{(i()||f())&&w(x)},e.onPause?.()}).then(()=>{r=void 0,i()||e.onContinue?.()}),j=()=>{if(i())return;let w;const x=n===0?e.initialPromise:void 0;try{w=x??e.fn()}catch(S){w=Promise.reject(S)}Promise.resolve(w).then(p).catch(S=>{if(i())return;const N=e.retry??(Wm?0:3),A=e.retryDelay??rV,P=typeof A=="function"?A(n,S):A,E=N===!0||typeof N=="number"&&n<N||typeof N=="function"&&N(n,S);if(t||!E){g(S);return}n++,e.onFail?.(n,S),KW(P).then(()=>f()?void 0:y()).then(()=>{t?g(S):j()})})};return{promise:a,status:()=>a.status,cancel:o,continue:()=>(r?.(),a),cancelRetry:c,continueRetry:d,canStart:h,start:()=>(h()?j():y().then(j),a)}}var iD=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),qW(this.gcTime)&&(this.#e=A1.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Wm?1/0:300*1e3))}clearGcTimeout(){this.#e&&(A1.clearTimeout(this.#e),this.#e=void 0)}},aV=class extends iD{#e;#n;#t;#a;#r;#i;#o;constructor(e){super(),this.#o=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#a=e.client,this.#t=this.#a.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=k_(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#i,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=k_(this.options);t.data!==void 0&&(this.setState(O_(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#t.remove(this)}setData(e,t){const n=GW(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Ia).catch(Ia):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>VW(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===zS||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>E1(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!WW(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#t.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(d=>d.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},a=()=>{const c=nD(this.options,t),f=(()=>{const h={client:this.#a,queryKey:this.queryKey,meta:this.meta};return r(h),h})();return this.#o=!1,this.options.persister?this.options.persister(c,f,this):c(f)},o=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:a};return r(c),c})();this.options.behavior?.onFetch(o,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#s({type:"fetch",meta:o.fetchOptions?.meta}),this.#r=sD({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:c=>{c instanceof P1&&c.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(c,d)=>{this.#s({type:"failed",failureCount:c,error:d})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const c=await this.#r.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#t.config.onSuccess?.(c,this),this.#t.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof P1){if(c.silent)return this.#r.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#s({type:"error",error:c}),this.#t.config.onError?.(c,this),this.#t.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...sV(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...O_(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?r:void 0,r;case"error":const a=e.error;return{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),dr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#t.notify({query:this,type:"updated",action:e})})}};function sV(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:aD(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function O_(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function k_(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}function R_(e){return{onFetch:(t,n)=>{const r=t.options,a=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let c={pages:[],pageParams:[]},d=0;const f=async()=>{let h=!1;const p=j=>{QW(j,()=>t.signal,()=>h=!0)},g=nD(t.options,t.fetchOptions),y=async(j,w,x)=>{if(h)return Promise.reject();if(w==null&&j.pages.length)return Promise.resolve(j);const N=(()=>{const O={client:t.client,queryKey:t.queryKey,pageParam:w,direction:x?"backward":"forward",meta:t.options.meta};return p(O),O})(),A=await g(N),{maxPages:P}=t.options,E=x?XW:YW;return{pages:E(j.pages,A,P),pageParams:E(j.pageParams,w,P)}};if(a&&i.length){const j=a==="backward",w=j?iV:T_,x={pages:i,pageParams:o},S=w(r,x);c=await y(x,S,j)}else{const j=e??i.length;do{const w=d===0?o[0]??r.initialPageParam:T_(r,c);if(d>0&&w==null)break;c=await y(c,w),d++}while(d<j)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=f}}}function T_(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function iV(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var oV=class extends iD{#e;#n;#t;#a;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#n=[],this.state=e.state||lV(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#n.includes(e)||(this.#n.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#n=this.#n.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#n.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#a?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#a=sD({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(i,o)=>{this.#r({type:"failed",failureCount:i,error:o})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const r=this.state.status==="pending",a=!this.#a.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:a}),this.#t.config.onMutate&&await this.#t.config.onMutate(e,this,n);const o=await this.options.onMutate?.(e,n);o!==this.state.context&&this.#r({type:"pending",context:o,variables:e,isPaused:a})}const i=await this.#a.start();return await this.#t.config.onSuccess?.(i,e,this.state.context,this,n),await this.options.onSuccess?.(i,e,this.state.context,n),await this.#t.config.onSettled?.(i,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(i,null,e,this.state.context,n),this.#r({type:"success",data:i}),i}catch(i){try{await this.#t.config.onError?.(i,e,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onError?.(i,e,this.state.context,n)}catch(o){Promise.reject(o)}try{await this.#t.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,i,e,this.state.context,n)}catch(o){Promise.reject(o)}throw this.#r({type:"error",error:i}),i}finally{this.#t.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),dr.batch(()=>{this.#n.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function lV(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var cV=class extends qm{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#n=new Map,this.#t=0}#e;#n;#t;build(e,t,n){const r=new oV({client:e,mutationCache:this,mutationId:++this.#t,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Tp(e);if(typeof t=="string"){const n=this.#n.get(t);n?n.push(e):this.#n.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Tp(e);if(typeof t=="string"){const n=this.#n.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#n.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Tp(e);if(typeof t=="string"){const r=this.#n.get(t)?.find(a=>a.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Tp(e);return typeof t=="string"?this.#n.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){dr.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#n.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>E_(t,n))}findAll(e={}){return this.getAll().filter(t=>E_(e,t))}notify(e){dr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return dr.batch(()=>Promise.all(e.map(t=>t.continue().catch(Ia))))}};function Tp(e){return e.options.scope?.id}var uV=class extends qm{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,a=t.queryHash??BS(r,t);let i=this.get(a);return i||(i=new aV({client:e,queryKey:r,queryHash:a,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(i)),i}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){dr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>A_(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>A_(e,n)):t}notify(e){dr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){dr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){dr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},dV=class{#e;#n;#t;#a;#r;#i;#o;#s;constructor(e={}){this.#e=e.queryCache||new uV,this.#n=e.mutationCache||new cV,this.#t=e.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=rD.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ph.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(E1(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,o=UW(t,i);if(o!==void 0)return this.#e.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return dr.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;dr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return dr.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=dr.batch(()=>this.#e.findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(Ia).catch(Ia)}invalidateQueries(e,t={}){return dr.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=dr.batch(()=>this.#e.findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,n);return n.throwOnError||(i=i.catch(Ia)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ia)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(E1(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ia).catch(Ia)}fetchInfiniteQuery(e){return e.behavior=R_(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ia).catch(Ia)}ensureInfiniteQueryData(e){return e.behavior=R_(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ph.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#n}getDefaultOptions(){return this.#t}setDefaultOptions(e){this.#t=e}setQueryDefaults(e,t){this.#a.set(ud(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(r=>{dd(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(ud(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{dd(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#t.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=BS(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===zS&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#t.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#n.clear()}},fV=v.createContext(void 0),pV=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(fV.Provider,{value:e,children:t}));function fd(){return fd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fd.apply(this,arguments)}var Ei;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ei||(Ei={}));const I_="popstate";function hV(e){e===void 0&&(e={});function t(r,a){let{pathname:i,search:o,hash:c}=r.location;return O1("",{pathname:i,search:o,hash:c},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:hh(a)}return vV(t,n,null,e)}function jn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function US(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function mV(){return Math.random().toString(36).substr(2,8)}function M_(e,t){return{usr:e.state,key:e.key,idx:t}}function O1(e,t,n,r){return n===void 0&&(n=null),fd({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Tc(t):t,{state:n,key:t&&t.key||r||mV()})}function hh(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 Tc(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 vV(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:i=!1}=r,o=a.history,c=Ei.Pop,d=null,f=h();f==null&&(f=0,o.replaceState(fd({},o.state,{idx:f}),""));function h(){return(o.state||{idx:null}).idx}function p(){c=Ei.Pop;let x=h(),S=x==null?null:x-f;f=x,d&&d({action:c,location:w.location,delta:S})}function g(x,S){c=Ei.Push;let N=O1(w.location,x,S);f=h()+1;let A=M_(N,f),P=w.createHref(N);try{o.pushState(A,"",P)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;a.location.assign(P)}i&&d&&d({action:c,location:w.location,delta:1})}function y(x,S){c=Ei.Replace;let N=O1(w.location,x,S);f=h();let A=M_(N,f),P=w.createHref(N);o.replaceState(A,"",P),i&&d&&d({action:c,location:w.location,delta:0})}function j(x){let S=a.location.origin!=="null"?a.location.origin:a.location.href,N=typeof x=="string"?x:hh(x);return N=N.replace(/ $/,"%20"),jn(S,"No window.location.(origin|href) available to create URL for href: "+N),new URL(N,S)}let w={get action(){return c},get location(){return e(a,o)},listen(x){if(d)throw new Error("A history only accepts one active listener");return a.addEventListener(I_,p),d=x,()=>{a.removeEventListener(I_,p),d=null}},createHref(x){return t(a,x)},createURL:j,encodeLocation(x){let S=j(x);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:g,replace:y,go(x){return o.go(x)}};return w}var $_;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})($_||($_={}));function gV(e,t,n){return n===void 0&&(n="/"),yV(e,t,n)}function yV(e,t,n,r){let a=typeof t=="string"?Tc(t):t,i=Zl(a.pathname||"/",n);if(i==null)return null;let o=oD(e);xV(o);let c=null;for(let d=0;c==null&&d<o.length;++d){let f=OV(i);c=_V(o[d],f)}return c}function oD(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let a=(i,o,c)=>{let d={relativePath:c===void 0?i.path||"":c,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};d.relativePath.startsWith("/")&&(jn(d.relativePath.startsWith(r),'Absolute route path "'+d.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),d.relativePath=d.relativePath.slice(r.length));let f=Pi([r,d.relativePath]),h=n.concat(d);i.children&&i.children.length>0&&(jn(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+f+'".')),oD(i.children,t,h,f)),!(i.path==null&&!i.index)&&t.push({path:f,score:AV(f,i.index),routesMeta:h})};return e.forEach((i,o)=>{var c;if(i.path===""||!((c=i.path)!=null&&c.includes("?")))a(i,o);else for(let d of lD(i.path))a(i,o,d)}),t}function lD(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let o=lD(r.join("/")),c=[];return c.push(...o.map(d=>d===""?i:[i,d].join("/"))),a&&c.push(...o),c.map(d=>e.startsWith("/")&&d===""?"/":d)}function xV(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:EV(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const bV=/^:[\w-]+$/,wV=3,jV=2,SV=1,NV=10,CV=-2,D_=e=>e==="*";function AV(e,t){let n=e.split("/"),r=n.length;return n.some(D_)&&(r+=CV),t&&(r+=jV),n.filter(a=>!D_(a)).reduce((a,i)=>a+(bV.test(i)?wV:i===""?SV:NV),r)}function EV(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function _V(e,t,n){let{routesMeta:r}=e,a={},i="/",o=[];for(let c=0;c<r.length;++c){let d=r[c],f=c===r.length-1,h=i==="/"?t:t.slice(i.length)||"/",p=en({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},h),g=d.route;if(!p)return null;Object.assign(a,p.params),o.push({params:a,pathname:Pi([i,p.pathname]),pathnameBase:MV(Pi([i,p.pathnameBase])),route:g}),p.pathnameBase!=="/"&&(i=Pi([i,p.pathnameBase]))}return o}function en(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=PV(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),c=a.slice(1);return{params:r.reduce((f,h,p)=>{let{paramName:g,isOptional:y}=h;if(g==="*"){let w=c[p]||"";o=i.slice(0,i.length-w.length).replace(/(.)\/+$/,"$1")}const j=c[p];return y&&!j?f[g]=void 0:f[g]=(j||"").replace(/%2F/g,"/"),f},{}),pathname:i,pathnameBase:o,pattern:e}}function PV(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),US(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=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,c,d)=>(r.push({paramName:c,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function OV(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return US(!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 Zl(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 kV=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,RV=e=>kV.test(e);function TV(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Tc(e):e,i;if(n)if(RV(n))i=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),US(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=L_(n.substring(1),"/"):i=L_(n,t)}else i=t;return{pathname:i,search:$V(r),hash:DV(a)}}function L_(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Yy(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 IV(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function cD(e,t){let n=IV(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function uD(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=Tc(e):(a=fd({},e),jn(!a.pathname||!a.pathname.includes("?"),Yy("?","pathname","search",a)),jn(!a.pathname||!a.pathname.includes("#"),Yy("#","pathname","hash",a)),jn(!a.search||!a.search.includes("#"),Yy("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,c;if(o==null)c=n;else{let p=t.length-1;if(!r&&o.startsWith("..")){let g=o.split("/");for(;g[0]==="..";)g.shift(),p-=1;a.pathname=g.join("/")}c=p>=0?t[p]:"/"}let d=TV(a,c),f=o&&o!=="/"&&o.endsWith("/"),h=(i||o===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||h)&&(d.pathname+="/"),d}const Pi=e=>e.join("/").replace(/\/\/+/g,"/"),MV=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),$V=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,DV=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function LV(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const dD=["post","put","patch","delete"];new Set(dD);const FV=["get",...dD];new Set(FV);function pd(){return pd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pd.apply(this,arguments)}const Vm=v.createContext(null),fD=v.createContext(null),Fi=v.createContext(null),Hm=v.createContext(null),Hs=v.createContext({outlet:null,matches:[],isDataRoute:!1}),pD=v.createContext(null);function BV(e,t){let{relative:n}=t===void 0?{}:t;nf()||jn(!1);let{basename:r,navigator:a}=v.useContext(Fi),{hash:i,pathname:o,search:c}=Km(e,{relative:n}),d=o;return r!=="/"&&(d=o==="/"?r:Pi([r,o])),a.createHref({pathname:d,search:c,hash:i})}function nf(){return v.useContext(Hm)!=null}function Ks(){return nf()||jn(!1),v.useContext(Hm).location}function hD(e){v.useContext(Fi).static||v.useLayoutEffect(e)}function qa(){let{isDataRoute:e}=v.useContext(Hs);return e?tH():zV()}function zV(){nf()||jn(!1);let e=v.useContext(Vm),{basename:t,future:n,navigator:r}=v.useContext(Fi),{matches:a}=v.useContext(Hs),{pathname:i}=Ks(),o=JSON.stringify(cD(a,n.v7_relativeSplatPath)),c=v.useRef(!1);return hD(()=>{c.current=!0}),v.useCallback(function(f,h){if(h===void 0&&(h={}),!c.current)return;if(typeof f=="number"){r.go(f);return}let p=uD(f,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:Pi([t,p.pathname])),(h.replace?r.replace:r.push)(p,h.state,h)},[t,r,o,i,e])}const UV=v.createContext(null);function qV(e){let t=v.useContext(Hs).outlet;return t&&v.createElement(UV.Provider,{value:e},t)}function Ic(){let{matches:e}=v.useContext(Hs),t=e[e.length-1];return t?t.params:{}}function Km(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=v.useContext(Fi),{matches:a}=v.useContext(Hs),{pathname:i}=Ks(),o=JSON.stringify(cD(a,r.v7_relativeSplatPath));return v.useMemo(()=>uD(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function WV(e,t){return VV(e,t)}function VV(e,t,n,r){nf()||jn(!1);let{navigator:a}=v.useContext(Fi),{matches:i}=v.useContext(Hs),o=i[i.length-1],c=o?o.params:{};o&&o.pathname;let d=o?o.pathnameBase:"/";o&&o.route;let f=Ks(),h;if(t){var p;let x=typeof t=="string"?Tc(t):t;d==="/"||(p=x.pathname)!=null&&p.startsWith(d)||jn(!1),h=x}else h=f;let g=h.pathname||"/",y=g;if(d!=="/"){let x=d.replace(/^\//,"").split("/");y="/"+g.replace(/^\//,"").split("/").slice(x.length).join("/")}let j=gV(e,{pathname:y}),w=XV(j&&j.map(x=>Object.assign({},x,{params:Object.assign({},c,x.params),pathname:Pi([d,a.encodeLocation?a.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?d:Pi([d,a.encodeLocation?a.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),i,n,r);return t&&w?v.createElement(Hm.Provider,{value:{location:pd({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Ei.Pop}},w):w}function HV(){let e=eH(),t=LV(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:a},n):null,null)}const KV=v.createElement(HV,null);class GV extends v.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?v.createElement(Hs.Provider,{value:this.props.routeContext},v.createElement(pD.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function YV(e){let{routeContext:t,match:n,children:r}=e,a=v.useContext(Vm);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(Hs.Provider,{value:t},r)}function XV(e,t,n,r){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,c=(a=n)==null?void 0:a.errors;if(c!=null){let h=o.findIndex(p=>p.route.id&&c?.[p.route.id]!==void 0);h>=0||jn(!1),o=o.slice(0,Math.min(o.length,h+1))}let d=!1,f=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h<o.length;h++){let p=o[h];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(f=h),p.route.id){let{loaderData:g,errors:y}=n,j=p.route.loader&&g[p.route.id]===void 0&&(!y||y[p.route.id]===void 0);if(p.route.lazy||j){d=!0,f>=0?o=o.slice(0,f+1):o=[o[0]];break}}}return o.reduceRight((h,p,g)=>{let y,j=!1,w=null,x=null;n&&(y=c&&p.route.id?c[p.route.id]:void 0,w=p.route.errorElement||KV,d&&(f<0&&g===0?(nH("route-fallback"),j=!0,x=null):f===g&&(j=!0,x=p.route.hydrateFallbackElement||null)));let S=t.concat(o.slice(0,g+1)),N=()=>{let A;return y?A=w:j?A=x:p.route.Component?A=v.createElement(p.route.Component,null):p.route.element?A=p.route.element:A=h,v.createElement(YV,{match:p,routeContext:{outlet:h,matches:S,isDataRoute:n!=null},children:A})};return n&&(p.route.ErrorBoundary||p.route.errorElement||g===0)?v.createElement(GV,{location:n.location,revalidation:n.revalidation,component:w,error:y,children:N(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):N()},null)}var mD=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(mD||{}),vD=(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})(vD||{});function QV(e){let t=v.useContext(Vm);return t||jn(!1),t}function JV(e){let t=v.useContext(fD);return t||jn(!1),t}function ZV(e){let t=v.useContext(Hs);return t||jn(!1),t}function gD(e){let t=ZV(),n=t.matches[t.matches.length-1];return n.route.id||jn(!1),n.route.id}function eH(){var e;let t=v.useContext(pD),n=JV(),r=gD();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function tH(){let{router:e}=QV(mD.UseNavigateStable),t=gD(vD.UseNavigateStable),n=v.useRef(!1);return hD(()=>{n.current=!0}),v.useCallback(function(a,i){i===void 0&&(i={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,pd({fromRouteId:t},i)))},[e,t])}const F_={};function nH(e,t,n){F_[e]||(F_[e]=!0)}function rH(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function B_(e){return qV(e.context)}function fn(e){jn(!1)}function aH(e){let{basename:t="/",children:n=null,location:r,navigationType:a=Ei.Pop,navigator:i,static:o=!1,future:c}=e;nf()&&jn(!1);let d=t.replace(/^\/*/,"/"),f=v.useMemo(()=>({basename:d,navigator:i,static:o,future:pd({v7_relativeSplatPath:!1},c)}),[d,c,i,o]);typeof r=="string"&&(r=Tc(r));let{pathname:h="/",search:p="",hash:g="",state:y=null,key:j="default"}=r,w=v.useMemo(()=>{let x=Zl(h,d);return x==null?null:{location:{pathname:x,search:p,hash:g,state:y,key:j},navigationType:a}},[d,h,p,g,y,j,a]);return w==null?null:v.createElement(Fi.Provider,{value:f},v.createElement(Hm.Provider,{children:n,value:w}))}function sH(e){let{children:t,location:n}=e;return WV(k1(t),n)}new Promise(()=>{});function k1(e,t){t===void 0&&(t=[]);let n=[];return v.Children.forEach(e,(r,a)=>{if(!v.isValidElement(r))return;let i=[...t,a];if(r.type===v.Fragment){n.push.apply(n,k1(r.props.children,i));return}r.type!==fn&&jn(!1),!r.props.index||!r.props.children||jn(!1);let o={id:r.props.id||i.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&&(o.children=k1(r.props.children,i)),n.push(o)}),n}function mh(){return mh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mh.apply(this,arguments)}function yD(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function iH(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function oH(e,t){return e.button===0&&(!t||t==="_self")&&!iH(e)}function R1(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function lH(e,t){let n=R1(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}const cH=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],uH=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],dH="6";try{window.__reactRouterVersion=dH}catch{}const fH=v.createContext({isTransitioning:!1}),pH="startTransition",z_=Am[pH];function hH(e){let{basename:t,children:n,future:r,window:a}=e,i=v.useRef();i.current==null&&(i.current=hV({window:a,v5Compat:!0}));let o=i.current,[c,d]=v.useState({action:o.action,location:o.location}),{v7_startTransition:f}=r||{},h=v.useCallback(p=>{f&&z_?z_(()=>d(p)):d(p)},[d,f]);return v.useLayoutEffect(()=>o.listen(h),[o,h]),v.useEffect(()=>rH(r),[r]),v.createElement(aH,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:o,future:r})}const mH=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",vH=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yt=v.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:i,replace:o,state:c,target:d,to:f,preventScrollReset:h,viewTransition:p}=t,g=yD(t,cH),{basename:y}=v.useContext(Fi),j,w=!1;if(typeof f=="string"&&vH.test(f)&&(j=f,mH))try{let A=new URL(window.location.href),P=f.startsWith("//")?new URL(A.protocol+f):new URL(f),E=Zl(P.pathname,y);P.origin===A.origin&&E!=null?f=E+P.search+P.hash:w=!0}catch{}let x=BV(f,{relative:a}),S=xH(f,{replace:o,state:c,target:d,preventScrollReset:h,relative:a,viewTransition:p});function N(A){r&&r(A),A.defaultPrevented||S(A)}return v.createElement("a",mh({},g,{href:j||x,onClick:w||i?r:N,ref:n,target:d}))}),gH=v.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:a=!1,className:i="",end:o=!1,style:c,to:d,viewTransition:f,children:h}=t,p=yD(t,uH),g=Km(d,{relative:p.relative}),y=Ks(),j=v.useContext(fD),{navigator:w,basename:x}=v.useContext(Fi),S=j!=null&&bH(g)&&f===!0,N=w.encodeLocation?w.encodeLocation(g).pathname:g.pathname,A=y.pathname,P=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;a||(A=A.toLowerCase(),P=P?P.toLowerCase():null,N=N.toLowerCase()),P&&x&&(P=Zl(P,x)||P);const E=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let O=A===N||!o&&A.startsWith(N)&&A.charAt(E)==="/",k=P!=null&&(P===N||!o&&P.startsWith(N)&&P.charAt(N.length)==="/"),R={isActive:O,isPending:k,isTransitioning:S},D=O?r:void 0,U;typeof i=="function"?U=i(R):U=[i,O?"active":null,k?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let z=typeof c=="function"?c(R):c;return v.createElement(yt,mh({},p,{"aria-current":D,className:U,ref:n,style:z,to:d,viewTransition:f}),typeof h=="function"?h(R):h)});var T1;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(T1||(T1={}));var U_;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(U_||(U_={}));function yH(e){let t=v.useContext(Vm);return t||jn(!1),t}function xH(e,t){let{target:n,replace:r,state:a,preventScrollReset:i,relative:o,viewTransition:c}=t===void 0?{}:t,d=qa(),f=Ks(),h=Km(e,{relative:o});return v.useCallback(p=>{if(oH(p,n)){p.preventDefault();let g=r!==void 0?r:hh(f)===hh(h);d(e,{replace:g,state:a,preventScrollReset:i,relative:o,viewTransition:c})}},[f,d,h,r,a,n,e,i,o,c])}function Mc(e){let t=v.useRef(R1(e)),n=v.useRef(!1),r=Ks(),a=v.useMemo(()=>lH(r.search,n.current?null:t.current),[r.search]),i=qa(),o=v.useCallback((c,d)=>{const f=R1(typeof c=="function"?c(a):c);n.current=!0,i("?"+f,d)},[i,a]);return[a,o]}function bH(e,t){t===void 0&&(t={});let n=v.useContext(fH);n==null&&jn(!1);let{basename:r}=yH(T1.useViewTransitionState),a=Km(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Zl(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Zl(n.nextLocation.pathname,r)||n.nextLocation.pathname;return en(a.pathname,o)!=null||en(a.pathname,i)!=null}var wH=Symbol.for("react.lazy"),vh=Am[" use ".trim().toString()];function jH(e){return typeof e=="object"&&e!==null&&"then"in e}function xD(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===wH&&"_payload"in e&&jH(e._payload)}function Gm(e){const t=SH(e),n=v.forwardRef((r,a)=>{let{children:i,...o}=r;xD(i)&&typeof vh=="function"&&(i=vh(i._payload));const c=v.Children.toArray(i),d=c.find(CH);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}var Bi=Gm("Slot");function SH(e){const t=v.forwardRef((n,r)=>{let{children:a,...i}=n;if(xD(a)&&typeof vh=="function"&&(a=vh(a._payload)),v.isValidElement(a)){const o=EH(a),c=AH(i,a.props);return a.type!==v.Fragment&&(c.ref=r?vr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var NH=Symbol("radix.slottable");function CH(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===NH}function AH(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function EH(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Xy=768;function _H(){const[e,t]=v.useState(void 0);return v.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Xy-1}px)`),r=()=>{t(window.innerWidth<Xy)};return n.addEventListener("change",r),t(window.innerWidth<Xy),()=>n.removeEventListener("change",r)},[]),!!e}const qS=Lo("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ae=v.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const o=r?Bi:"button";return s.jsx(o,{className:Se(qS({variant:t,size:n,className:e})),ref:i,...a})});ae.displayName="Button";const it=v.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{type:t,className:Se("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));it.displayName="Input";var PH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],OH=PH.reduce((e,t)=>{const n=Gm(`Primitive.${t}`),r=v.forwardRef((a,i)=>{const{asChild:o,...c}=a,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),kH="Separator",q_="horizontal",RH=["horizontal","vertical"],bD=v.forwardRef((e,t)=>{const{decorative:n,orientation:r=q_,...a}=e,i=TH(r)?r:q_,c=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return s.jsx(OH.div,{"data-orientation":i,...c,...a,ref:t})});bD.displayName=kH;function TH(e){return RH.includes(e)}var wD=bD;const jD=v.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>s.jsx(wD,{ref:a,decorative:n,orientation:t,className:Se("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));jD.displayName=wD.displayName;var Qy="focusScope.autoFocusOnMount",Jy="focusScope.autoFocusOnUnmount",W_={bubbles:!1,cancelable:!0},IH="FocusScope",rf=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[c,d]=v.useState(null),f=Cn(a),h=Cn(i),p=v.useRef(null),g=ft(t,w=>d(w)),y=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let w=function(A){if(y.paused||!c)return;const P=A.target;c.contains(P)?p.current=P:Si(p.current,{select:!0})},x=function(A){if(y.paused||!c)return;const P=A.relatedTarget;P!==null&&(c.contains(P)||Si(p.current,{select:!0}))},S=function(A){if(document.activeElement===document.body)for(const E of A)E.removedNodes.length>0&&Si(c)};document.addEventListener("focusin",w),document.addEventListener("focusout",x);const N=new MutationObserver(S);return c&&N.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",x),N.disconnect()}}},[r,c,y.paused]),v.useEffect(()=>{if(c){H_.add(y);const w=document.activeElement;if(!c.contains(w)){const S=new CustomEvent(Qy,W_);c.addEventListener(Qy,f),c.dispatchEvent(S),S.defaultPrevented||(MH(BH(SD(c)),{select:!0}),document.activeElement===w&&Si(c))}return()=>{c.removeEventListener(Qy,f),setTimeout(()=>{const S=new CustomEvent(Jy,W_);c.addEventListener(Jy,h),c.dispatchEvent(S),S.defaultPrevented||Si(w??document.body,{select:!0}),c.removeEventListener(Jy,h),H_.remove(y)},0)}}},[c,f,h,y]);const j=v.useCallback(w=>{if(!n&&!r||y.paused)return;const x=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,S=document.activeElement;if(x&&S){const N=w.currentTarget,[A,P]=$H(N);A&&P?!w.shiftKey&&S===P?(w.preventDefault(),n&&Si(A,{select:!0})):w.shiftKey&&S===A&&(w.preventDefault(),n&&Si(P,{select:!0})):S===N&&w.preventDefault()}},[n,r,y.paused]);return s.jsx(qe.div,{tabIndex:-1,...o,ref:g,onKeyDown:j})});rf.displayName=IH;function MH(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Si(r,{select:t}),document.activeElement!==n)return}function $H(e){const t=SD(e),n=V_(t,e),r=V_(t.reverse(),e);return[n,r]}function SD(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function V_(e,t){for(const n of e)if(!DH(n,{upTo:t}))return n}function DH(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function LH(e){return e instanceof HTMLInputElement&&"select"in e}function Si(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&LH(e)&&t&&e.select()}}var H_=FH();function FH(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=K_(e,t),e.unshift(t)},remove(t){e=K_(e,t),e[0]?.resume()}}}function K_(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function BH(e){return e.filter(t=>t.tagName!=="A")}var Zy=0;function Ym(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??G_()),document.body.insertAdjacentElement("beforeend",e[1]??G_()),Zy++,()=>{Zy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Zy--}},[])}function G_(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Za=function(){return Za=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Za.apply(this,arguments)};function ND(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function zH(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var ah="right-scroll-bar-position",sh="width-before-scroll-bar",UH="with-scroll-bars-hidden",qH="--removed-body-scroll-bar-size";function ex(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function WH(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var VH=typeof window<"u"?v.useLayoutEffect:v.useEffect,Y_=new WeakMap;function HH(e,t){var n=WH(null,function(r){return e.forEach(function(a){return ex(a,r)})});return VH(function(){var r=Y_.get(n);if(r){var a=new Set(r),i=new Set(e),o=n.current;a.forEach(function(c){i.has(c)||ex(c,null)}),i.forEach(function(c){a.has(c)||ex(c,o)})}Y_.set(n,e)},[e]),n}function KH(e){return e}function GH(e,t){t===void 0&&(t=KH);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var o=t(i,r);return n.push(o),function(){n=n.filter(function(c){return c!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var c=n;n=[],c.forEach(i),o=n}var d=function(){var h=o;o=[],h.forEach(i)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(h){o.push(h),f()},filter:function(h){return o=o.filter(h),n}}}};return a}function YH(e){e===void 0&&(e={});var t=GH(null);return t.options=Za({async:!0,ssr:!1},e),t}var CD=function(e){var t=e.sideCar,n=ND(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return v.createElement(r,Za({},n))};CD.isSideCarExport=!0;function XH(e,t){return e.useMedium(t),CD}var AD=YH(),tx=function(){},Xm=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:tx,onWheelCapture:tx,onTouchMoveCapture:tx}),a=r[0],i=r[1],o=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,h=e.enabled,p=e.shards,g=e.sideCar,y=e.noRelative,j=e.noIsolation,w=e.inert,x=e.allowPinchZoom,S=e.as,N=S===void 0?"div":S,A=e.gapMode,P=ND(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=g,O=HH([n,t]),k=Za(Za({},P),a);return v.createElement(v.Fragment,null,h&&v.createElement(E,{sideCar:AD,removeScrollBar:f,shards:p,noRelative:y,noIsolation:j,inert:w,setCallbacks:i,allowPinchZoom:!!x,lockRef:n,gapMode:A}),o?v.cloneElement(v.Children.only(c),Za(Za({},k),{ref:O})):v.createElement(N,Za({},k,{className:d,ref:O}),c))});Xm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Xm.classNames={fullWidth:sh,zeroRight:ah};var QH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function JH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=QH();return t&&e.setAttribute("nonce",t),e}function ZH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function eK(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var tK=function(){var e=0,t=null;return{add:function(n){e==0&&(t=JH())&&(ZH(t,n),eK(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},nK=function(){var e=tK();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ED=function(){var e=nK(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},rK={left:0,top:0,right:0,gap:0},nx=function(e){return parseInt(e||"",10)||0},aK=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[nx(n),nx(r),nx(a)]},sK=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return rK;var t=aK(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},iK=ED(),Bl="data-scroll-locked",oK=function(e,t,n,r){var a=e.left,i=e.top,o=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
10
|
+
.`.concat(UH,` {
|
|
11
|
+
overflow: hidden `).concat(r,`;
|
|
12
|
+
padding-right: `).concat(c,"px ").concat(r,`;
|
|
13
|
+
}
|
|
14
|
+
body[`).concat(Bl,`] {
|
|
15
|
+
overflow: hidden `).concat(r,`;
|
|
16
|
+
overscroll-behavior: contain;
|
|
17
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
18
|
+
padding-left: `.concat(a,`px;
|
|
19
|
+
padding-top: `).concat(i,`px;
|
|
20
|
+
padding-right: `).concat(o,`px;
|
|
21
|
+
margin-left:0;
|
|
22
|
+
margin-top:0;
|
|
23
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
24
|
+
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.`).concat(ah,` {
|
|
28
|
+
right: `).concat(c,"px ").concat(r,`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.`).concat(sh,` {
|
|
32
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.`).concat(ah," .").concat(ah,` {
|
|
36
|
+
right: 0 `).concat(r,`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.`).concat(sh," .").concat(sh,` {
|
|
40
|
+
margin-right: 0 `).concat(r,`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
body[`).concat(Bl,`] {
|
|
44
|
+
`).concat(qH,": ").concat(c,`px;
|
|
45
|
+
}
|
|
46
|
+
`)},X_=function(){var e=parseInt(document.body.getAttribute(Bl)||"0",10);return isFinite(e)?e:0},lK=function(){v.useEffect(function(){return document.body.setAttribute(Bl,(X_()+1).toString()),function(){var e=X_()-1;e<=0?document.body.removeAttribute(Bl):document.body.setAttribute(Bl,e.toString())}},[])},cK=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;lK();var i=v.useMemo(function(){return sK(a)},[a]);return v.createElement(iK,{styles:oK(i,!t,a,n?"":"!important")})},I1=!1;if(typeof window<"u")try{var Ip=Object.defineProperty({},"passive",{get:function(){return I1=!0,!0}});window.addEventListener("test",Ip,Ip),window.removeEventListener("test",Ip,Ip)}catch{I1=!1}var xl=I1?{passive:!1}:!1,uK=function(e){return e.tagName==="TEXTAREA"},_D=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!uK(e)&&n[t]==="visible")},dK=function(e){return _D(e,"overflowY")},fK=function(e){return _D(e,"overflowX")},Q_=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=PD(e,r);if(a){var i=OD(e,r),o=i[1],c=i[2];if(o>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},pK=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},hK=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},PD=function(e,t){return e==="v"?dK(t):fK(t)},OD=function(e,t){return e==="v"?pK(t):hK(t)},mK=function(e,t){return e==="h"&&t==="rtl"?-1:1},vK=function(e,t,n,r,a){var i=mK(e,window.getComputedStyle(t).direction),o=i*r,c=n.target,d=t.contains(c),f=!1,h=o>0,p=0,g=0;do{if(!c)break;var y=OD(e,c),j=y[0],w=y[1],x=y[2],S=w-x-i*j;(j||S)&&PD(e,c)&&(p+=S,g+=j);var N=c.parentNode;c=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(h&&Math.abs(p)<1||!h&&Math.abs(g)<1)&&(f=!0),f},Mp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},J_=function(e){return[e.deltaX,e.deltaY]},Z_=function(e){return e&&"current"in e?e.current:e},gK=function(e,t){return e[0]===t[0]&&e[1]===t[1]},yK=function(e){return`
|
|
47
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
48
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
49
|
+
`)},xK=0,bl=[];function bK(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),a=v.useState(xK++)[0],i=v.useState(ED)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var w=zH([e.lockRef.current],(e.shards||[]).map(Z_),!0).filter(Boolean);return w.forEach(function(x){return x.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),w.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var c=v.useCallback(function(w,x){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!o.current.allowPinchZoom;var S=Mp(w),N=n.current,A="deltaX"in w?w.deltaX:N[0]-S[0],P="deltaY"in w?w.deltaY:N[1]-S[1],E,O=w.target,k=Math.abs(A)>Math.abs(P)?"h":"v";if("touches"in w&&k==="h"&&O.type==="range")return!1;var R=window.getSelection(),D=R&&R.anchorNode,U=D?D===O||D.contains(O):!1;if(U)return!1;var z=Q_(k,O);if(!z)return!0;if(z?E=k:(E=k==="v"?"h":"v",z=Q_(k,O)),!z)return!1;if(!r.current&&"changedTouches"in w&&(A||P)&&(r.current=E),!E)return!0;var L=r.current||E;return vK(L,x,w,L==="h"?A:P)},[]),d=v.useCallback(function(w){var x=w;if(!(!bl.length||bl[bl.length-1]!==i)){var S="deltaY"in x?J_(x):Mp(x),N=t.current.filter(function(E){return E.name===x.type&&(E.target===x.target||x.target===E.shadowParent)&&gK(E.delta,S)})[0];if(N&&N.should){x.cancelable&&x.preventDefault();return}if(!N){var A=(o.current.shards||[]).map(Z_).filter(Boolean).filter(function(E){return E.contains(x.target)}),P=A.length>0?c(x,A[0]):!o.current.noIsolation;P&&x.cancelable&&x.preventDefault()}}},[]),f=v.useCallback(function(w,x,S,N){var A={name:w,delta:x,target:S,should:N,shadowParent:wK(S)};t.current.push(A),setTimeout(function(){t.current=t.current.filter(function(P){return P!==A})},1)},[]),h=v.useCallback(function(w){n.current=Mp(w),r.current=void 0},[]),p=v.useCallback(function(w){f(w.type,J_(w),w.target,c(w,e.lockRef.current))},[]),g=v.useCallback(function(w){f(w.type,Mp(w),w.target,c(w,e.lockRef.current))},[]);v.useEffect(function(){return bl.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:g}),document.addEventListener("wheel",d,xl),document.addEventListener("touchmove",d,xl),document.addEventListener("touchstart",h,xl),function(){bl=bl.filter(function(w){return w!==i}),document.removeEventListener("wheel",d,xl),document.removeEventListener("touchmove",d,xl),document.removeEventListener("touchstart",h,xl)}},[]);var y=e.removeScrollBar,j=e.inert;return v.createElement(v.Fragment,null,j?v.createElement(i,{styles:yK(a)}):null,y?v.createElement(cK,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function wK(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const jK=XH(AD,bK);var af=v.forwardRef(function(e,t){return v.createElement(Xm,Za({},e,{ref:t,sideCar:jK}))});af.classNames=Xm.classNames;var SK=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},wl=new WeakMap,$p=new WeakMap,Dp={},rx=0,kD=function(e){return e&&(e.host||kD(e.parentNode))},NK=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=kD(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},CK=function(e,t,n,r){var a=NK(t,Array.isArray(e)?e:[e]);Dp[n]||(Dp[n]=new WeakMap);var i=Dp[n],o=[],c=new Set,d=new Set(a),f=function(p){!p||c.has(p)||(c.add(p),f(p.parentNode))};a.forEach(f);var h=function(p){!p||d.has(p)||Array.prototype.forEach.call(p.children,function(g){if(c.has(g))h(g);else try{var y=g.getAttribute(r),j=y!==null&&y!=="false",w=(wl.get(g)||0)+1,x=(i.get(g)||0)+1;wl.set(g,w),i.set(g,x),o.push(g),w===1&&j&&$p.set(g,!0),x===1&&g.setAttribute(n,"true"),j||g.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",g,S)}})};return h(t),c.clear(),rx++,function(){o.forEach(function(p){var g=wl.get(p)-1,y=i.get(p)-1;wl.set(p,g),i.set(p,y),g||($p.has(p)||p.removeAttribute(r),$p.delete(p)),y||p.removeAttribute(n)}),rx--,rx||(wl=new WeakMap,wl=new WeakMap,$p=new WeakMap,Dp={})}},Qm=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=SK(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),CK(r,a,n,"aria-hidden")):function(){return null}};function AK(e){const t=EK(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(PK);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function EK(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=kK(a),c=OK(i,a.props);return a.type!==v.Fragment&&(c.ref=r?vr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var _K=Symbol("radix.slottable");function PK(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===_K}function OK(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function kK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Jm="Dialog",[RD,TD]=er(Jm),[RK,Wa]=RD(Jm),ID=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,c=v.useRef(null),d=v.useRef(null),[f,h]=Zr({prop:r,defaultProp:a??!1,onChange:i,caller:Jm});return s.jsx(RK,{scope:t,triggerRef:c,contentRef:d,contentId:Bn(),titleId:Bn(),descriptionId:Bn(),open:f,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(p=>!p),[h]),modal:o,children:n})};ID.displayName=Jm;var MD="DialogTrigger",$D=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Wa(MD,n),i=ft(t,a.triggerRef);return s.jsx(qe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":HS(a.open),...r,ref:i,onClick:Pe(e.onClick,a.onOpenToggle)})});$D.displayName=MD;var WS="DialogPortal",[TK,DD]=RD(WS,{forceMount:void 0}),LD=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=Wa(WS,t);return s.jsx(TK,{scope:t,forceMount:n,children:v.Children.map(r,o=>s.jsx(Un,{present:n||i.open,children:s.jsx(Pc,{asChild:!0,container:a,children:o})}))})};LD.displayName=WS;var gh="DialogOverlay",FD=v.forwardRef((e,t)=>{const n=DD(gh,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Wa(gh,e.__scopeDialog);return i.modal?s.jsx(Un,{present:r||i.open,children:s.jsx(MK,{...a,ref:t})}):null});FD.displayName=gh;var IK=AK("DialogOverlay.RemoveScroll"),MK=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Wa(gh,n);return s.jsx(af,{as:IK,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(qe.div,{"data-state":HS(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Ao="DialogContent",BD=v.forwardRef((e,t)=>{const n=DD(Ao,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Wa(Ao,e.__scopeDialog);return s.jsx(Un,{present:r||i.open,children:i.modal?s.jsx($K,{...a,ref:t}):s.jsx(DK,{...a,ref:t})})});BD.displayName=Ao;var $K=v.forwardRef((e,t)=>{const n=Wa(Ao,e.__scopeDialog),r=v.useRef(null),a=ft(t,n.contentRef,r);return v.useEffect(()=>{const i=r.current;if(i)return Qm(i)},[]),s.jsx(zD,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pe(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Pe(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0;(o.button===2||c)&&i.preventDefault()}),onFocusOutside:Pe(e.onFocusOutside,i=>i.preventDefault())})}),DK=v.forwardRef((e,t)=>{const n=Wa(Ao,e.__scopeDialog),r=v.useRef(!1),a=v.useRef(!1);return s.jsx(zD,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;n.triggerRef.current?.contains(o)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),zD=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,c=Wa(Ao,n),d=v.useRef(null),f=ft(t,d);return Ym(),s.jsxs(s.Fragment,{children:[s.jsx(rf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Do,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":HS(c.open),...o,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(FK,{titleId:c.titleId}),s.jsx(zK,{contentRef:d,descriptionId:c.descriptionId})]})]})}),VS="DialogTitle",UD=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Wa(VS,n);return s.jsx(qe.h2,{id:a.titleId,...r,ref:t})});UD.displayName=VS;var qD="DialogDescription",WD=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Wa(qD,n);return s.jsx(qe.p,{id:a.descriptionId,...r,ref:t})});WD.displayName=qD;var VD="DialogClose",HD=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Wa(VD,n);return s.jsx(qe.button,{type:"button",...r,ref:t,onClick:Pe(e.onClick,()=>a.onOpenChange(!1))})});HD.displayName=VD;function HS(e){return e?"open":"closed"}var KD="DialogTitleWarning",[LK,GD]=_7(KD,{contentName:Ao,titleName:VS,docsSlug:"dialog"}),FK=({titleId:e})=>{const t=GD(KD),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
50
|
+
|
|
51
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
52
|
+
|
|
53
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},BK="DialogDescriptionWarning",zK=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${GD(BK).contentName}}.`;return v.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Zm=ID,UK=$D,ev=LD,$c=FD,Dc=BD,sf=UD,of=WD,tv=HD;const YD=Zm,qK=ev,XD=v.forwardRef(({className:e,...t},n)=>s.jsx($c,{className:Se("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));XD.displayName=$c.displayName;const WK=Lo("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),KS=v.forwardRef(({side:e="right",className:t,children:n,...r},a)=>s.jsxs(qK,{children:[s.jsx(XD,{}),s.jsxs(Dc,{ref:a,className:Se(WK({side:e}),t),...r,children:[n,s.jsxs(tv,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[s.jsx(Ii,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));KS.displayName=Dc.displayName;const QD=({className:e,...t})=>s.jsx("div",{className:Se("flex flex-col space-y-2 text-center sm:text-left",e),...t});QD.displayName="SheetHeader";const JD=v.forwardRef(({className:e,...t},n)=>s.jsx(sf,{ref:n,className:Se("text-lg font-semibold text-foreground",e),...t}));JD.displayName=sf.displayName;const VK=v.forwardRef(({className:e,...t},n)=>s.jsx(of,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));VK.displayName=of.displayName;function eP({className:e,...t}){return s.jsx("div",{className:Se("animate-pulse rounded-md bg-muted",e),...t})}const HK="sidebar:state",KK=3600*24*7,GK="16rem",YK="18rem",XK="3rem",QK="b",ZD=v.createContext(null);function lf(){const e=v.useContext(ZD);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const e3=v.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:i,...o},c)=>{const d=_H(),[f,h]=v.useState(!1),[p,g]=v.useState(e),y=t??p,j=v.useCallback(N=>{const A=typeof N=="function"?N(y):N;n?n(A):g(A),document.cookie=`${HK}=${A}; path=/; max-age=${KK}`},[n,y]),w=v.useCallback(()=>d?h(N=>!N):j(N=>!N),[d,j,h]);v.useEffect(()=>{const N=A=>{A.key===QK&&(A.metaKey||A.ctrlKey)&&(A.preventDefault(),w())};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[w]);const x=y?"expanded":"collapsed",S=v.useMemo(()=>({state:x,open:y,setOpen:j,isMobile:d,openMobile:f,setOpenMobile:h,toggleSidebar:w}),[x,y,j,d,f,h,w]);return s.jsx(ZD.Provider,{value:S,children:s.jsx(J$,{delayDuration:0,children:s.jsx("div",{style:{"--sidebar-width":GK,"--sidebar-width-icon":XK,...a},className:Se("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:c,...o,children:i})})})});e3.displayName="SidebarProvider";const t3=v.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:a,...i},o)=>{const{isMobile:c,state:d,openMobile:f,setOpenMobile:h}=lf();return n==="none"?s.jsx("div",{className:Se("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:o,...i,children:a}):c?s.jsx(YD,{open:f,onOpenChange:h,...i,children:s.jsx(KS,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":YK},side:e,children:s.jsx("div",{className:"flex h-full w-full flex-col",children:a})})}):s.jsxs("div",{ref:o,className:"group peer hidden text-sidebar-foreground md:block","data-state":d,"data-collapsible":d==="collapsed"?n:"","data-variant":t,"data-side":e,children:[s.jsx("div",{className:Se("relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),s.jsx("div",{className:Se("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...i,children:s.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:a})})]})});t3.displayName="Sidebar";const n3=v.forwardRef(({className:e,onClick:t,...n},r)=>{const{toggleSidebar:a}=lf();return s.jsxs(ae,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:Se("h-7 w-7",e),onClick:i=>{t?.(i),a()},...n,children:[s.jsx(IU,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});n3.displayName="SidebarTrigger";const JK=v.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=lf();return s.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:Se("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] group-data-[side=left]:-right-4 group-data-[side=right]:left-0 hover:after:bg-sidebar-border sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});JK.displayName="SidebarRail";const ZK=v.forwardRef(({className:e,...t},n)=>s.jsx("main",{ref:n,className:Se("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));ZK.displayName="SidebarInset";const eG=v.forwardRef(({className:e,...t},n)=>s.jsx(it,{ref:n,"data-sidebar":"input",className:Se("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));eG.displayName="SidebarInput";const r3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"header",className:Se("flex flex-col gap-2 p-2",e),...t}));r3.displayName="SidebarHeader";const a3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"footer",className:Se("flex flex-col gap-2 p-2",e),...t}));a3.displayName="SidebarFooter";const M1=v.forwardRef(({className:e,...t},n)=>s.jsx(jD,{ref:n,"data-sidebar":"separator",className:Se("mx-2 w-auto bg-sidebar-border",e),...t}));M1.displayName="SidebarSeparator";const s3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"content",className:Se("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));s3.displayName="SidebarContent";const i3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group",className:Se("relative flex w-full min-w-0 flex-col p-2",e),...t}));i3.displayName="SidebarGroup";const o3=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?Bi:"div";return s.jsx(a,{ref:r,"data-sidebar":"group-label",className:Se("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...n})});o3.displayName="SidebarGroupLabel";const tG=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?Bi:"button";return s.jsx(a,{ref:r,"data-sidebar":"group-action",className:Se("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...n})});tG.displayName="SidebarGroupAction";const l3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group-content",className:Se("w-full text-sm",e),...t}));l3.displayName="SidebarGroupContent";const c3=v.forwardRef(({className:e,...t},n)=>s.jsx("ul",{ref:n,"data-sidebar":"menu",className:Se("flex w-full min-w-0 flex-col gap-1",e),...t}));c3.displayName="SidebarMenu";const u3=v.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,"data-sidebar":"menu-item",className:Se("group/menu-item relative",e),...t}));u3.displayName="SidebarMenuItem";const nG=Lo("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),d3=v.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:a,className:i,...o},c)=>{const d=e?Bi:"button",{isMobile:f,state:h}=lf(),p=s.jsx(d,{ref:c,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:Se(nG({variant:n,size:r}),i),...o});return a?(typeof a=="string"&&(a={children:a}),s.jsxs(Z$,{children:[s.jsx(eD,{asChild:!0,children:p}),s.jsx(FS,{side:"right",align:"center",hidden:h!=="collapsed"||f,...a})]})):p});d3.displayName="SidebarMenuButton";const rG=v.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},a)=>{const i=t?Bi:"button";return s.jsx(i,{ref:a,"data-sidebar":"menu-action",className:Se("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...r})});rG.displayName="SidebarMenuAction";const aG=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:Se("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));aG.displayName="SidebarMenuBadge";const sG=v.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{const a=v.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return s.jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:Se("flex h-8 items-center gap-2 rounded-md px-2",e),...n,children:[t&&s.jsx(eP,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),s.jsx(eP,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})});sG.displayName="SidebarMenuSkeleton";const iG=v.forwardRef(({className:e,...t},n)=>s.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:Se("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));iG.displayName="SidebarMenuSub";const oG=v.forwardRef(({...e},t)=>s.jsx("li",{ref:t,...e}));oG.displayName="SidebarMenuSubItem";const lG=v.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...a},i)=>{const o=e?Bi:"a";return s.jsx(o,{ref:i,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:Se("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...a})});lG.displayName="SidebarMenuSubButton";const f3=v.forwardRef(({className:e,activeClassName:t,pendingClassName:n,to:r,...a},i)=>s.jsx(gH,{ref:i,to:r,className:({isActive:o,isPending:c})=>Se(e,o&&t,c&&n),...a}));f3.displayName="NavLink";function cG({width:e=24,height:t=24,from:n="#53afba",to:r="#76fffb",...a}){const i=`grad-${v.useId().slice(1)}`;return s.jsxs("svg",{className:"inline-block",width:e,height:t,viewBox:"0 0 1648 1648",xmlns:"http://www.w3.org/2000/svg",...a,children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:i,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[s.jsx("stop",{offset:"0%",style:{stopColor:n}}),s.jsx("stop",{offset:"100%",style:{stopColor:r}})]})}),s.jsx("path",{d:"m610 216.654c-66.158 4.092-126.119 35.849-164.917 87.346-8.408 11.16-13.344 19.191-19.983 32.513-12.431 24.946-19.521 50.434-22.11 79.487-1.665 18.687-.854 826.238.841 837.939 7.867 54.284 32.465 101.134 70.706 134.667 16.297 14.291 32.283 24.657 53.963 34.991 16.889 8.05 34.568 13.468 60.5 18.541 9.019 1.764 52.201 1.795 61.5.044 26.487-4.989 43.97-10.341 61-18.675 15.131-7.406 21.53-11.135 60.5-35.267 20.813-12.887 23.095-14.298 29.5-18.24l13-8 13-8c6.901-4.247 12.593-7.767 29.54-18.271 5.796-3.593 12.771-7.863 15.5-9.49 2.728-1.626 8.56-5.19 12.96-7.921 4.4-2.73 72.575-44.711 151.5-93.29s150.925-92.918 160-98.531c9.075-5.612 24.15-14.936 33.5-20.719s23.075-14.234 30.5-18.78c85.169-52.142 120.029-73.942 130.014-81.304 40.974-30.211 68.344-69.764 81.788-118.194 13.864-49.94 8.549-104.847-14.809-153-16.836-34.708-41.252-62.432-74.993-85.154-4.125-2.778-17.625-11.26-30-18.849s-27-16.594-32.5-20.009c-5.5-3.416-109.45-67.427-231-142.246-306.386-188.593-335.221-206.352-350-215.553-30.562-19.028-59.301-29.911-90-34.083-11.697-1.59-30.408-2.514-39.5-1.952m-10.5 77.269c-39.541 6.402-76.013 29.73-97.661 62.467-13.001 19.66-19.718 38.39-22.802 63.584-1.472 12.028-1.434 802.191.04 818.026 1.861 19.998 6.142 35.48 14.415 52.133 17.942 36.114 53.025 64.18 91.508 73.203 3.575.839 8.975 2.118 12 2.844 8.221 1.973 40.343 1.613 49.971-.56 32.301-7.289 65.233-26.686 94.817-55.849 15.26-15.042 22.884-24.803 33.571-42.979 13.939-23.706 20.949-43.36 27.745-77.792 1.004-5.086 1.428-50 1.949-206.5.465-139.686 1.001-201.809 1.777-206 .611-3.3 1.608-9.15 2.217-13 1.672-10.583 4.039-21.117 7.191-32 8.179-28.247 20.714-55.13 37.188-79.751 24.262-36.262 53.189-63.572 93.074-87.872 4.95-3.016 12.825-7.435 17.5-9.82s8.95-4.668 9.5-5.074c3.565-2.63 34.688-13.266 52.465-17.93 6.2-1.627 11.49-3.174 11.754-3.439 1.003-1.002-1.016-2.602-10.967-8.689-5.639-3.449-16.552-10.172-24.252-14.94-13.435-8.319-31.76-19.604-58.5-36.029-6.875-4.222-16.1-9.911-20.5-12.641-7.667-4.758-73.088-45.103-122.5-75.546-75.227-46.348-108.509-66.591-116.5-70.86-9.422-5.033-25.23-10.76-37.043-13.419-7.967-1.794-40.076-2.843-47.957-1.567m473.5 305.564c-5.775.685-11.625 1.491-13 1.792-1.375.3-5.2 1.088-8.5 1.749-7.914 1.587-27.103 7.461-36.5 11.174-38.797 15.33-75.171 44.925-98.829 80.41-11.24 16.86-21.329 38.407-26.167 55.888-2.443 8.825-3.85 14.608-4.866 20-.621 3.3-1.653 8.475-2.292 11.5-.846 4.008-1.345 59.624-1.837 205-.618 182.331-.824 200.361-2.399 209.5-1.629 9.459-4.196 22.506-6.744 34.279-.628 2.903-.881 5.54-.561 5.859.596.596 455.986-279.084 472.195-290.001 17.547-11.819 36.335-33.412 46.291-53.203 3.956-7.863 9.527-23.924 11.597-33.434 4.848-22.272 3.572-48.26-3.506-71.387-6.907-22.572-18.055-40.93-35.316-58.158-12.705-12.681-16.829-15.485-79.066-53.756-7.15-4.397-15.7-9.654-19-11.684-3.3-2.029-8.925-5.504-12.5-7.722-53.826-33.397-67.199-40.611-88.616-47.8-29.343-9.85-61.599-13.421-90.384-10.006m-1066.25 1048.256c3.988.189 10.513.189 14.5 0 3.988-.19.725-.346-7.25-.346s-11.238.156-7.25.346",fill:`url(#${i})`,fillRule:"evenodd"})]})}const uG=[{title:"Home",items:[{title:"Dashboard",url:"/",icon:i$}]},{title:"Lab",items:[{title:"MCP Evaluations",url:"/mcp-evaluations",icon:s$},{title:"Analyze MCP",url:"/tool-analysis",icon:o$}]},{title:"Libraries",items:[{title:"Scenarios",url:"/libraries/scenarios",icon:a$},{title:"Servers",url:"/libraries/servers",icon:r$},{title:"Agents",url:"/libraries/agents",icon:fa}]},{title:"Execution",items:[{title:"Run Evaluation",url:"/run",icon:Dl},{title:"Evaluation Results",url:"/results",icon:od},{title:"Compare Evaluations",url:"/compare",icon:CS},{title:"MCP Analysis Results",url:"/tool-analysis-results",icon:l$},{title:"Custom Reports",url:"/markdown-reports",icon:lh}]},{title:"Workspace",items:[{title:"Settings",url:"/settings",icon:ES}]}];function dG(e={version:null}){const t=e.version??null,{state:n}=lf(),r=n==="collapsed",a=Ks(),i=v.useMemo(()=>uG,[]);return s.jsxs(t3,{collapsible:"icon",children:[s.jsx(r3,{className:`border-b border-sidebar-border py-3 ${r?"px-2":"px-4"}`,children:s.jsxs("div",{className:`flex items-center ${r?"justify-center":"gap-2.5"} overflow-hidden`,children:[s.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-sidebar-accent/50 border border-primary/60",children:s.jsx(cG,{width:22,height:22,from:"#f97316",to:"#fb923c"})}),!r&&s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"text-sm font-semibold text-sidebar-foreground",children:"MCPLab"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"MCP Evaluation Lab"})]})]})}),s.jsx(s3,{children:i.map((o,c)=>s.jsxs("div",{children:[c>0&&!r&&s.jsx(M1,{className:"my-1.5"}),s.jsxs(i3,{className:r?"px-2":"px-3 py-2",children:[!r&&s.jsx(o3,{className:"px-1 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/90",children:o.title}),s.jsx(l3,{children:s.jsx(c3,{children:o.items.map(d=>s.jsx(u3,{children:s.jsx(d3,{asChild:!0,isActive:d.url==="/"?a.pathname==="/":a.pathname.startsWith(d.url),tooltip:d.title,children:s.jsxs(f3,{to:d.url,end:d.url==="/",activeClassName:"bg-sidebar-accent text-sidebar-accent-foreground",children:[s.jsx(d.icon,{className:"h-4 w-4"}),s.jsx("span",{children:d.title})]})})},d.title))})})]})]},o.title))}),s.jsxs(a3,{className:r?"px-2 py-2":"px-3 py-3",children:[s.jsx(M1,{className:"my-1.5"}),s.jsxs("div",{className:`flex ${r?"justify-center":"items-center justify-center gap-2"} w-full`,children:[s.jsxs("a",{href:"https://github.com/inspectr-hq/mcp-lab",target:"_blank",rel:"noreferrer",className:`inline-flex items-center rounded-md border border-sidebar-border/70 bg-sidebar-accent/20 text-sidebar-foreground/85 transition-colors hover:bg-sidebar-accent/35 hover:text-sidebar-foreground ${r?"justify-center p-2":"gap-2 px-2.5 py-1.5"}`,title:`GitHub${t?` · v${t}`:""}`,"aria-label":"GitHub repository",children:[s.jsx(kU,{className:"h-4 w-4 shrink-0"}),!r&&s.jsx("span",{className:"text-xs text-sidebar-foreground/85",children:`v${t??"unknown"}`})]}),!r&&s.jsxs("a",{href:"https://inspectr.dev",target:"_blank",rel:"noreferrer",className:"text-xs text-muted-foreground transition-colors hover:text-sidebar-foreground",children:["Built by ",s.jsx("span",{className:"text-[#00e5ff] hover:text-[#00b8d4]",children:"Inspectr"})]})]})]})]})}const p3=v.forwardRef(({...e},t)=>s.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));p3.displayName="Breadcrumb";const h3=v.forwardRef(({className:e,...t},n)=>s.jsx("ol",{ref:n,className:Se("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));h3.displayName="BreadcrumbList";const m3=v.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,className:Se("inline-flex items-center gap-1.5",e),...t}));m3.displayName="BreadcrumbItem";const v3=v.forwardRef(({asChild:e,className:t,...n},r)=>{const a=e?Bi:"a";return s.jsx(a,{ref:r,className:Se("transition-colors hover:text-foreground",t),...n})});v3.displayName="BreadcrumbLink";const g3=v.forwardRef(({className:e,...t},n)=>s.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:Se("font-normal text-foreground",e),...t}));g3.displayName="BreadcrumbPage";const y3=({children:e,className:t,...n})=>s.jsx("li",{role:"presentation","aria-hidden":"true",className:Se("[&>svg]:size-3.5",t),...n,children:e??s.jsx(n$,{})});y3.displayName="BreadcrumbSeparator";function fG(e,t){return`${e}-${t+1}`}function Al(e){const t=typeof e.config.name=="string"&&e.config.name.trim().length>0?e.config.name.trim():void 0,n=Array.isArray(e.config.servers)?e.config.servers:[],r=Array.isArray(e.config.agents)?e.config.agents:[],a=new Map,i=[],o=[];for(const p of n){if("ref"in p){const x=String(p.ref||"").trim();if(!x)continue;a.set(x,x),o.push({kind:"referenced",ref:x});continue}const g=String(p.id||p.name||"").trim();if(!g)continue;const y=g;a.set(g,y);const j=p.auth?.type==="bearer"?"bearer":p.auth?.type==="oauth_client_credentials"?"api-key":p.auth?.type==="oauth_authorization_code"?"oauth2":"none",w={id:y,name:String(p.name||g),transport:"streamable-http",url:p.url,authType:j,authValue:p.auth?.type==="bearer"?p.auth.env:void 0,oauthClientId:p.auth?.type==="oauth_authorization_code"?p.auth.client_id:void 0,oauthClientSecret:p.auth?.type==="oauth_authorization_code"?p.auth.client_secret:void 0,oauthRedirectUrl:p.auth?.type==="oauth_authorization_code"?p.auth.redirect_url:void 0,oauthScope:p.auth?.type==="oauth_authorization_code"?p.auth.scope:void 0};i.push(w),o.push({kind:"inline",server:w})}const c=[],d=[];for(const p of r){if("ref"in p){const x=String(p.ref||"").trim();if(!x)continue;d.push({kind:"referenced",ref:x});continue}const g=String(p.id||p.name||"").trim();if(!g)continue;const y=g,j=p.provider==="azure_openai"?"azure":p.provider,w={id:y,name:String(p.name||g),provider:j,model:p.model,temperature:p.temperature??0,maxTokens:p.max_tokens??2048,systemPrompt:p.system};c.push(w),d.push({kind:"inline",agent:w})}const f=[],h=[];return e.config.scenarios.forEach((p,g)=>{if("ref"in p){const w=String(p.ref||"").trim();if(!w)return;h.push({kind:"referenced",ref:w});return}const y=[];for(const w of p.eval?.tool_constraints?.required_tools??[])y.push({type:"required_tool",value:w});for(const w of p.eval?.tool_constraints?.forbidden_tools??[])y.push({type:"forbidden_tool",value:w});for(const w of p.eval?.response_assertions??[])w.type==="regex"?y.push({type:"response_contains",value:w.pattern}):y.push({type:"response_contains",value:`${w.path}${w.equals!==void 0?` == ${w.equals}`:""}`});const j={id:p.id||fG("scn",g),name:p.name||p.id||`Scenario ${g+1}`,serverIds:p.servers.map(w=>a.get(w)).filter(Boolean),prompt:p.prompt,snapshotEval:p.snapshot_eval?{enabled:p.snapshot_eval.enabled,baselineSnapshotId:p.snapshot_eval.baseline_snapshot_id,baselineSourceRunId:p.snapshot_eval.baseline_source_run_id,lastUpdatedAt:p.snapshot_eval.last_updated_at}:void 0,evalRules:y,extractRules:(p.extract??[]).map(w=>({name:w.name,pattern:w.regex}))};f.push(j),h.push({kind:"inline",scenario:j})}),{id:e.id,name:t||e.name,configName:t,description:e.path,loadError:e.error,loadWarnings:e.warnings,servers:i,serverEntries:o,agents:c,agentEntries:d,scenarios:f,scenarioEntries:h,runDefaults:e.config.run_defaults?.selected_agents&&e.config.run_defaults.selected_agents.length>0?{selectedAgentNames:[...e.config.run_defaults.selected_agents]}:void 0,snapshotEval:e.config.snapshot_eval?{enabled:e.config.snapshot_eval.enabled,mode:e.config.snapshot_eval.mode,baselineSnapshotId:e.config.snapshot_eval.baseline_snapshot_id,baselineSourceRunId:e.config.snapshot_eval.baseline_source_run_id,lastUpdatedAt:e.config.snapshot_eval.last_updated_at}:void 0,createdAt:e.mtime,updatedAt:e.mtime,sourcePath:e.path}}function pG(e){const t={id:"library",name:"library",path:"library",mtime:new Date(0).toISOString(),config:{servers:Object.entries(e.servers).map(([r,a])=>({id:r,name:a.name||r,transport:a.transport,url:a.url,auth:a.auth})),agents:Object.entries(e.agents).map(([r,a])=>({id:r,name:a.name||r,provider:a.provider,model:a.model,temperature:a.temperature,max_tokens:a.max_tokens,system:a.system})),scenarios:e.scenarios}},n=Al(t);return{servers:n.servers,agents:n.agents,scenarios:n.scenarios}}function tP(e){const t=new Map,n=g=>{const y=g.id;return{id:y,...g.name&&g.name!==y?{name:g.name}:{},transport:"http",url:g.url||"http://localhost:3000/mcp",auth:g.authType==="bearer"?{type:"bearer",env:g.authValue||"MCP_TOKEN"}:g.authType==="oauth2"?{type:"oauth_authorization_code",client_id:g.oauthClientId||"",client_secret:g.oauthClientSecret||void 0,redirect_url:g.oauthRedirectUrl||"http://localhost:6274/oauth/",scope:g.oauthScope||void 0}:void 0}},r=e.serverEntries&&e.serverEntries.length>0?e.serverEntries:[...e.servers.map(g=>({kind:"inline",server:g}))],a=new Set,i=r.flatMap(g=>{if(g.kind==="referenced"){const j=String(g.ref||"").trim();return!j||a.has(j)?[]:(a.add(j),t.set(j,j),[{ref:j}])}const y=n(g.server);return t.set(g.server.id,y.id),[y]}),o=g=>{const y=g.id;return{id:y,...g.name&&g.name!==y?{name:g.name}:{},provider:g.provider==="azure"?"azure_openai":g.provider==="anthropic"?"anthropic":"openai",model:g.model,temperature:g.temperature,max_tokens:g.maxTokens,system:g.systemPrompt}},c=e.agentEntries&&e.agentEntries.length>0?e.agentEntries:[...e.agents.map(g=>({kind:"inline",agent:g}))],d=new Set,f=c.flatMap(g=>{if(g.kind==="referenced"){const y=String(g.ref||"").trim();return!y||d.has(y)?[]:(d.add(y),[{ref:y}])}return[o(g.agent)]}),h=g=>{const y=g.evalRules.filter(x=>x.type==="required_tool").map(x=>x.value),j=g.evalRules.filter(x=>x.type==="forbidden_tool").map(x=>x.value),w=g.evalRules.filter(x=>x.type==="response_contains"||x.type==="response_not_contains").map(x=>({type:"regex",pattern:x.value}));return{id:g.id,name:g.name||void 0,servers:g.serverIds.map(x=>t.get(x)).filter(Boolean),prompt:g.prompt,...g.snapshotEval?{snapshot_eval:{enabled:g.snapshotEval.enabled,baseline_snapshot_id:g.snapshotEval.baselineSnapshotId,baseline_source_run_id:g.snapshotEval.baselineSourceRunId,last_updated_at:g.snapshotEval.lastUpdatedAt}}:{},eval:{tool_constraints:{required_tools:y,forbidden_tools:j},response_assertions:w},extract:g.extractRules.map(x=>({name:x.name,from:"final_text",regex:x.pattern}))}},p=e.scenarioEntries&&e.scenarioEntries.length>0?e.scenarioEntries.map(g=>g.kind==="referenced"?{ref:g.ref}:h(g.scenario)):[...e.scenarios.map(g=>h(g))];return{name:e.configName?.trim()||void 0,servers:i,agents:f,scenarios:p,run_defaults:e.runDefaults?.selectedAgentNames&&e.runDefaults.selectedAgentNames.length>0?{selected_agents:[...e.runDefaults.selectedAgentNames]}:void 0,snapshot_eval:e.snapshotEval?{enabled:e.snapshotEval.enabled,mode:e.snapshotEval.mode,baseline_snapshot_id:e.snapshotEval.baselineSnapshotId,baseline_source_run_id:e.snapshotEval.baselineSourceRunId,last_updated_at:e.snapshotEval.lastUpdatedAt}:void 0}}function hG(e){const t=Object.fromEntries(e.servers.map(r=>[r.id,{...r.name&&r.name!==r.id?{name:r.name}:{},transport:"http",url:r.url||"http://localhost:3000/mcp",auth:r.authType==="bearer"?{type:"bearer",env:r.authValue||"MCP_TOKEN"}:r.authType==="oauth2"?{type:"oauth_authorization_code",client_id:r.oauthClientId||"",client_secret:r.oauthClientSecret||void 0,redirect_url:r.oauthRedirectUrl||"http://localhost:6274/oauth/",scope:r.oauthScope||void 0}:void 0}])),n=Object.fromEntries(e.agents.map(r=>[r.id,{...r.name&&r.name!==r.id?{name:r.name}:{},provider:r.provider==="azure"?"azure_openai":r.provider==="anthropic"?"anthropic":"openai",model:r.model,temperature:r.temperature,max_tokens:r.maxTokens,system:r.systemPrompt}]));return{servers:t,agents:n,scenarios:e.scenarios.map(r=>({id:r.id,name:r.name||void 0,servers:r.serverIds,prompt:r.prompt,snapshot_eval:r.snapshotEval?{enabled:r.snapshotEval.enabled,baseline_snapshot_id:r.snapshotEval.baselineSnapshotId,baseline_source_run_id:r.snapshotEval.baselineSourceRunId,last_updated_at:r.snapshotEval.lastUpdatedAt}:void 0,eval:{tool_constraints:{required_tools:r.evalRules.filter(a=>a.type==="required_tool").map(a=>a.value),forbidden_tools:r.evalRules.filter(a=>a.type==="forbidden_tool").map(a=>a.value)},response_assertions:r.evalRules.filter(a=>a.type==="response_contains"||a.type==="response_not_contains").map(a=>({type:"regex",pattern:a.value}))},extract:r.extractRules.map(a=>({name:a.name,from:"final_text",regex:a.pattern}))}))}}function mG(e,t){if(e)return`${e}::${t??""}`}function Lp(e){return e.type==="text"}function vG(e,t){if(!t)return e.tool_calls.map((a,i)=>({name:a,arguments:{},duration:e.tool_durations_ms[i]??0,timestamp:new Date().toISOString()}));const n=[],r=new Map;for(const a of t.messages)for(const i of a.content)i.type==="tool_use"?n.push({id:i.id,name:i.name,input:i.input??{},ts:a.ts}):i.type==="tool_result"&&r.set(i.tool_use_id,{durationMs:i.duration_ms,tsEnd:i.ts_end});return n.map((a,i)=>{const o=r.get(a.id);return{name:a.name,arguments:a.input,duration:o?.durationMs??e.tool_durations_ms[i]??0,timestamp:o?.tsEnd??a.ts??new Date().toISOString()}})}function gG(e,t){const n=[];if(!e)return n;let r;const a=e.messages??[];for(let i=0;i<a.length;i+=1){const o=a[i];if(o.role==="user"){const c=o.content.filter(Lp);for(const d of c)n.push({id:`user_prompt-${n.length}`,kind:"user_prompt",text:d.text,timestamp:o.ts});continue}if(o.role==="assistant"){const c=o.content.filter(h=>h.type==="tool_use");for(const h of o.content)h.type==="text"&&(n.push({id:`assistant_thought-${n.length}`,kind:"assistant_thought",text:h.text,timestamp:o.ts}),r=n.length-1);const d=a[i+1],f=d?.role==="tool";if(c.length>0&&f){const h=new Map,p=[];for(const g of d.content)g.type==="tool_result"&&(g.tool_use_id?h.set(g.tool_use_id,g):p.push(g));for(const g of c){n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:nP(g.input??{}),toolName:g.name,timestamp:o.ts});const y=h.get(g.id);if(!y)continue;const j=y.content.filter(Lp).map(w=>w.text).join(`
|
|
54
|
+
`);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:j,toolName:y.name,ok:!y.is_error,durationMs:y.duration_ms,timestamp:y.ts_end??d.ts}),h.delete(g.id)}for(const g of[...h.values(),...p]){const y=g.content.filter(Lp).map(j=>j.text).join(`
|
|
55
|
+
`);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:y,toolName:g.name,ok:!g.is_error,durationMs:g.duration_ms,timestamp:g.ts_end??d.ts})}i+=1}else for(const h of c)n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:nP(h.input??{}),toolName:h.name,timestamp:o.ts});continue}if(o.role==="tool")for(const c of o.content){if(c.type!=="tool_result")continue;const d=c.content.filter(Lp).map(f=>f.text).join(`
|
|
56
|
+
`);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:d,toolName:c.name,ok:!c.is_error,durationMs:c.duration_ms,timestamp:c.ts_end??o.ts})}}return typeof r=="number"&&n[r]&&(n[r]={...n[r],kind:"assistant_final"}),n}function nP(e){try{return JSON.stringify(e)}catch{return String(e)}}function rP(e,t=[]){const n=new Map;for(const a of t){const i=mG(a.scenario_id,a.agent);if(!i)continue;const o=n.get(i)??[];o.push(a),n.set(i,o)}const r=e.scenarios.map(a=>{const i=n.get(`${a.scenario_id}::${a.agent}`)??[],o=new Map;for(const h of i)o.set(h.run_index,h);const c=a.runs.map((h,p)=>{const g=o.get(h.run_index)??i[p];return{runIndex:h.run_index,passed:h.pass,toolCalls:vG(h,g),finalAnswer:h.final_text,conversation:gG(g),duration:h.tool_durations_ms.reduce((y,j)=>y+j,0),extractedValues:Object.fromEntries(Object.entries(h.extracted).map(([y,j])=>[y,String(j??"")])),failureReasons:h.failures}}),d=c.length===0?0:Math.round(c.reduce((h,p)=>h+p.duration,0)/c.length),f=c.length===0?0:c.reduce((h,p)=>h+p.toolCalls.length,0)/c.length;return{scenarioId:a.scenario_id,scenarioName:a.scenario_name||a.scenario_id,agentId:a.agent,agentName:a.agent,runs:c,passRate:a.pass_rate,avgToolCalls:f,avgDuration:d}});return{id:e.metadata.run_id,configId:"",configHash:e.metadata.config_hash,timestamp:e.metadata.timestamp,scenarios:r,overallPassRate:e.summary.pass_rate,totalScenarios:e.summary.total_scenarios,totalRuns:e.summary.total_runs,avgToolCalls:e.summary.avg_tool_calls_per_run,avgLatency:Math.round(e.summary.avg_tool_latency_ms??0),snapshotEval:e.metadata.snapshot_eval?{applied:e.metadata.snapshot_eval.applied,mode:e.metadata.snapshot_eval.mode,baselineSnapshotId:e.metadata.snapshot_eval.baseline_snapshot_id,baselineSourceRunId:e.metadata.snapshot_eval.baseline_source_run_id,overallScore:e.metadata.snapshot_eval.overall_score,status:e.metadata.snapshot_eval.status,impactedScenarios:e.metadata.snapshot_eval.impacted_scenarios}:void 0}}function yG(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}const Ju=yG();async function pt(e,t){const n=await fetch(`${Ju}${e}`,{...t,headers:{"content-type":"application/json",...t?.headers||{}}});if(!n.ok){const r=await n.text();throw new Error(`Request failed (${n.status}): ${r}`)}return await n.json()}async function xG(e,t){const n=await fetch(`${Ju}${e}`,{...t,headers:{}});if(!n.ok){const r=await n.text();throw new Error(`Request failed (${n.status}): ${r}`)}return n.text()}const lt={health:()=>pt("/api/health"),getSettings:()=>pt("/api/settings"),updateSettings:e=>pt("/api/settings",{method:"PUT",body:JSON.stringify(e)}),listConfigs:()=>pt("/api/evals"),createConfig:(e,t)=>pt("/api/evals",{method:"POST",body:JSON.stringify({fileName:e,config:t})}),updateConfig:(e,t,n)=>pt(`/api/evals/${e}`,{method:"PUT",body:JSON.stringify({config:t,fileName:n})}),deleteConfig:e=>pt(`/api/evals/${e}`,{method:"DELETE"}),listRuns:()=>pt("/api/runs"),listMarkdownReports:()=>pt("/api/markdown-reports").then(e=>e.items),getMarkdownReport:e=>pt(`/api/markdown-reports/content?path=${encodeURIComponent(e)}`),getRun:e=>pt(`/api/runs/${e}`),deleteRun:e=>pt(`/api/runs/${e}`,{method:"DELETE"}),getRunTrace:e=>pt(`/api/runs/${e}/trace`),listSnapshots:()=>pt("/api/snapshots"),createSnapshotFromRun:(e,t)=>pt("/api/snapshots",{method:"POST",body:JSON.stringify({runId:e,name:t})}),getSnapshot:e=>pt(`/api/snapshots/${e}`),compareSnapshot:(e,t)=>pt(`/api/snapshots/${e}/compare`,{method:"POST",body:JSON.stringify({runId:t})}),askResultAssistant:(e,t)=>pt(`/api/runs/${encodeURIComponent(e)}/assistant`,{method:"POST",body:JSON.stringify({messages:t})}),applyResultAssistantReport:e=>pt(`/api/runs/${encodeURIComponent(e.runId)}/assistant/apply-report`,{method:"POST",body:JSON.stringify({markdown:e.markdown,outputPath:e.outputPath,overwrite:e.overwrite})}),createResultAssistantSession:e=>pt("/api/result-assistant/sessions",{method:"POST",body:JSON.stringify({runId:e})}),getResultAssistantSession:e=>pt(`/api/result-assistant/sessions/${e}`),sendResultAssistantMessage:(e,t)=>pt(`/api/result-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t})}),approveResultAssistantToolCall:(e,t,n)=>pt(`/api/result-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify(n===void 0?{}:{argumentsOverride:n})}),denyResultAssistantToolCall:(e,t)=>pt(`/api/result-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),closeResultAssistantSession:e=>pt(`/api/result-assistant/sessions/${e}`,{method:"DELETE"}).then(()=>{}),generateSnapshotEvalBaseline:(e,t,n)=>pt("/api/snapshots/generate-eval",{method:"POST",body:JSON.stringify({runId:e,configId:t,name:n})}),updateSnapshotPolicy:(e,t)=>pt(`/api/evals/${e}/snapshot-policy`,{method:"POST",body:JSON.stringify(t)}),getLibraries:()=>pt("/api/libraries"),saveLibraries:e=>pt("/api/libraries",{method:"PUT",body:JSON.stringify(e)}),startRun:e=>pt("/api/runs",{method:"POST",body:JSON.stringify(e)}),listProviderModels:e=>pt(`/api/providers/models?provider=${encodeURIComponent(e)}`),createScenarioAssistantSession:e=>pt("/api/scenario-assistant/sessions",{method:"POST",body:JSON.stringify(e)}),getScenarioAssistantSession:e=>pt(`/api/scenario-assistant/sessions/${e}`),sendScenarioAssistantMessage:(e,t)=>pt(`/api/scenario-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t})}),approveScenarioAssistantToolCall:(e,t)=>pt(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify({})}),denyScenarioAssistantToolCall:(e,t)=>pt(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),closeScenarioAssistantSession:e=>pt(`/api/scenario-assistant/sessions/${e}`,{method:"DELETE"}),discoverToolsForAnalysis:e=>pt("/api/tool-analysis/discover-tools",{method:"POST",body:JSON.stringify(e)}),startToolAnalysis:e=>pt("/api/tool-analysis/jobs",{method:"POST",body:JSON.stringify(e)}),getToolAnalysisResult:e=>pt(`/api/tool-analysis/jobs/${e}/result`),stopToolAnalysis:e=>pt(`/api/tool-analysis/jobs/${e}/stop`,{method:"POST"}),subscribeToolAnalysisJob:(e,t)=>{const n=new EventSource(`${Ju}/api/tool-analysis/jobs/${e}/events`);let r=!1;const a=()=>{r||(r=!0,n.close())},i=o=>{if(!r&&!(typeof o.data!="string"||!o.data))try{const c=JSON.parse(o.data);t(c),(c.type==="completed"||c.type==="error")&&a()}catch{}};return n.addEventListener("started",i),n.addEventListener("log",i),n.addEventListener("completed",i),n.addEventListener("error",i),n.onerror=()=>{r||(t({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error"}}),a())},()=>a()},listToolAnalysisResults:()=>pt("/api/tool-analysis-results").then(e=>e.items),getToolAnalysisSavedResult:e=>pt(`/api/tool-analysis-results/${e}`),deleteToolAnalysisSavedResult:e=>pt(`/api/tool-analysis-results/${e}`,{method:"DELETE"}).then(()=>{}),createOAuthDebuggerSession:e=>pt("/api/oauth-debugger/sessions",{method:"POST",body:JSON.stringify(e)}),getOAuthDebuggerSession:e=>pt(`/api/oauth-debugger/sessions/${e}`),startOAuthDebuggerSession:e=>pt(`/api/oauth-debugger/sessions/${e}/start`,{method:"POST",body:JSON.stringify({})}),subscribeOAuthDebuggerSession:(e,t)=>{const n=new EventSource(`${Ju}/api/oauth-debugger/sessions/${e}/events`);let r=!1;const a=()=>{r||(r=!0,n.close())},i=o=>{if(!r&&!(typeof o.data!="string"||!o.data))try{const c=JSON.parse(o.data);t(c),(c.type==="completed"||c.type==="error"||c.type==="stopped")&&a()}catch{}};return["started","step_started","step_completed","step_failed","http_request","http_response","validation","log","waiting_for_user","waiting_for_browser_callback","completed","error","stopped"].forEach(o=>n.addEventListener(o,i)),n.onerror=()=>{r||(t({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error"}}),a())},()=>a()},submitOAuthDebuggerManualCallback:(e,t)=>pt(`/api/oauth-debugger/sessions/${e}/manual-callback`,{method:"POST",body:JSON.stringify(t)}),stopOAuthDebuggerSession:e=>pt(`/api/oauth-debugger/sessions/${e}/stop`,{method:"POST",body:JSON.stringify({})}),exportOAuthDebuggerSession:(e,t)=>t==="json"?pt(`/api/oauth-debugger/sessions/${e}/export?format=json`):xG(`/api/oauth-debugger/sessions/${e}/export?format=${t}`),stopRun:e=>pt(`/api/runs/jobs/${e}/stop`,{method:"POST"}),subscribeRunJob:(e,t)=>{const n=new EventSource(`${Ju}/api/runs/jobs/${e}/events`);let r=!1;const a=()=>{r||(r=!0,n.close())},i=o=>{if(!r&&!(typeof o.data!="string"||!o.data))try{const c=JSON.parse(o.data);t(c),(c.type==="completed"||c.type==="error")&&a()}catch{}};return n.addEventListener("started",i),n.addEventListener("log",i),n.addEventListener("completed",i),n.addEventListener("error",i),n.onerror=()=>{r||(t({type:"error",ts:new Date().toISOString(),payload:{message:"SSE connection error"}}),a())},()=>{a()}}};function bG(e){if(e.sourcePath){const t=e.sourcePath.split("/");return t[t.length-1].replace(/\.(yaml|yml)$/i,"")}return e.name||`config-${Date.now()}`}function wG(e){return e||`config-${Date.now()}`}const jG={async listConfigs(){return(await lt.listConfigs()).map(Al)},async createConfig(e){const t=await lt.createConfig(bG(e),tP(e));return Al(t)},async updateConfig(e){const t=await lt.updateConfig(e.id,tP(e),wG(e.name));return Al(t)},async deleteConfig(e){await lt.deleteConfig(e)},async listResults(){const t=(await lt.listRuns()).map(async n=>{const[{results:r},a]=await Promise.all([lt.getRun(n.runId),lt.getRunTrace(n.runId)]);return rP(r,a.records)});return Promise.all(t)},async getResult(e){try{const[{results:t},n]=await Promise.all([lt.getRun(e),lt.getRunTrace(e)]);return rP(t,n.records)}catch{return}},async deleteResult(e){await lt.deleteRun(e)},async listMarkdownReports(){return lt.listMarkdownReports()},async getMarkdownReport(e){return lt.getMarkdownReport(e)},async startRun(e){return lt.startRun(e)},async stopRun(e){await lt.stopRun(e)},subscribeRunJob(e,t){return lt.subscribeRunJob(e,t)},async listSnapshots(){return lt.listSnapshots()},async createSnapshotFromRun(e,t){return lt.createSnapshotFromRun(e,t)},async getSnapshot(e){try{return await lt.getSnapshot(e)}catch{return}},async compareSnapshot(e,t){return lt.compareSnapshot(e,t)},async askResultAssistant(e,t){return lt.askResultAssistant(e,t)},async applyResultAssistantReport(e){return lt.applyResultAssistantReport(e)},async createResultAssistantSession(e){return lt.createResultAssistantSession(e)},async getResultAssistantSession(e){return lt.getResultAssistantSession(e)},async sendResultAssistantMessage(e,t){return lt.sendResultAssistantMessage(e,t)},async approveResultAssistantToolCall(e,t,n){return lt.approveResultAssistantToolCall(e,t,n)},async denyResultAssistantToolCall(e,t){return lt.denyResultAssistantToolCall(e,t)},async closeResultAssistantSession(e){await lt.closeResultAssistantSession(e)},async generateSnapshotEvalBaseline(e,t,n){const r=await lt.generateSnapshotEvalBaseline(e,t,n);return{snapshot:r.snapshot,config:Al(r.config)}},async updateSnapshotPolicy(e,t){const n=await lt.updateSnapshotPolicy(e,t);return Al(n)},async getLibraries(){const e=await lt.getLibraries();return pG(e)},async saveLibraries(e){await lt.saveLibraries(hG(e))},async listProviderModels(e){return lt.listProviderModels(e)},async getWorkspaceSettings(){return lt.getSettings()},async updateWorkspaceSettings(e){return lt.updateSettings(e)},async createScenarioAssistantSession(e){return lt.createScenarioAssistantSession(e)},async getScenarioAssistantSession(e){return lt.getScenarioAssistantSession(e)},async sendScenarioAssistantMessage(e,t){return lt.sendScenarioAssistantMessage(e,t)},async approveScenarioAssistantToolCall(e,t){return lt.approveScenarioAssistantToolCall(e,t)},async denyScenarioAssistantToolCall(e,t){return lt.denyScenarioAssistantToolCall(e,t)},async closeScenarioAssistantSession(e){await lt.closeScenarioAssistantSession(e)},async discoverToolsForAnalysis(e){return lt.discoverToolsForAnalysis(e)},async startToolAnalysis(e){return lt.startToolAnalysis(e)},subscribeToolAnalysisJob(e,t){return lt.subscribeToolAnalysisJob(e,t)},async getToolAnalysisResult(e){return lt.getToolAnalysisResult(e)},async stopToolAnalysis(e){return lt.stopToolAnalysis(e)},async listToolAnalysisResults(){return lt.listToolAnalysisResults()},async getToolAnalysisSavedResult(e){return lt.getToolAnalysisSavedResult(e)},async deleteToolAnalysisSavedResult(e){await lt.deleteToolAnalysisSavedResult(e)},async createOAuthDebuggerSession(e){return lt.createOAuthDebuggerSession(e)},async getOAuthDebuggerSession(e){return lt.getOAuthDebuggerSession(e)},async startOAuthDebuggerSession(e){return lt.startOAuthDebuggerSession(e)},subscribeOAuthDebuggerSession(e,t){return lt.subscribeOAuthDebuggerSession(e,t)},async submitOAuthDebuggerManualCallback(e,t){return lt.submitOAuthDebuggerManualCallback(e,t)},async stopOAuthDebuggerSession(e){return lt.stopOAuthDebuggerSession(e)},async exportOAuthDebuggerSession(e,t){return lt.exportOAuthDebuggerSession(e,t)}},x3=v.createContext(null);function SG({children:e}){const t="workspace",[n,r]=v.useState("checking"),[a,i]=v.useState(null);v.useEffect(()=>{r("checking"),lt.health().then(c=>{r("connected"),i(typeof c?.version=="string"?c.version:null)}).catch(()=>{r("disconnected"),i(null)})},[t]);const o=v.useMemo(()=>jG,[]);return s.jsx(x3.Provider,{value:{mode:t,connection:n,version:a,source:o},children:e})}function An(){const e=v.useContext(x3);if(!e)throw new Error("useDataSource must be used within DataSourceProvider");return e}const NG=e=>{if(e==="/")return[{label:"Dashboard"}];const t=[{label:"Dashboard",to:"/"}];if(en("/mcp-evaluations/:id",e))return t.push({label:"MCP Evaluations",to:"/mcp-evaluations"},{label:"MCP Evaluation"}),t;if(en("/mcp-evaluations",e))return t.push({label:"MCP Evaluations"}),t;if(en("/settings",e))return t.push({label:"Settings"}),t;if(en("/tool-analysis",e))return t.push({label:"Analyze MCP Tools"}),t;if(en("/tool-analysis-results/:id",e)){const n=en("/tool-analysis-results/:id",e);return t.push({label:"Tool Analysis Results",to:"/tool-analysis-results"},{label:n?.params.id??"Report"}),t}if(en("/tool-analysis-results",e))return t.push({label:"Tool Analysis Results"}),t;if(en("/markdown-reports/view",e))return t.push({label:"Markdown Reports",to:"/markdown-reports"},{label:"View Report"}),t;if(en("/markdown-reports",e))return t.push({label:"Markdown Reports"}),t;if(en("/oauth-debugger",e))return t.push({label:"OAuth Debugger"}),t;if(en("/results/:id",e))return t.push({label:"Evaluation Results",to:"/results"},{label:"Result"}),t;if(en("/results",e))return t.push({label:"Evaluation Results"}),t;if(en("/run",e))return t.push({label:"Run Evaluation"}),t;if(en("/libraries/servers/:serverId",e)){const n=en("/libraries/servers/:serverId",e),r=n?.params.serverId?decodeURIComponent(n.params.serverId):"Server";return t.push({label:"Libraries",to:"/libraries/servers"},{label:"Servers",to:"/libraries/servers"},{label:r==="new"?"New Server":r}),t}if(en("/libraries/servers",e))return t.push({label:"Libraries",to:"/libraries/servers"},{label:"Servers"}),t;if(en("/libraries/agents/:agentName",e)){const n=en("/libraries/agents/:agentName",e),r=n?.params.agentName?decodeURIComponent(n.params.agentName):"Agent";return t.push({label:"Libraries",to:"/libraries/agents"},{label:"Agents",to:"/libraries/agents"},{label:r==="new"?"New Agent":r}),t}if(en("/libraries/agents",e))return t.push({label:"Libraries",to:"/libraries/agents"},{label:"Agents"}),t;if(en("/libraries/scenarios/:scenarioId",e)){const n=en("/libraries/scenarios/:scenarioId",e),r=n?.params.scenarioId?decodeURIComponent(n.params.scenarioId):"Scenario";return t.push({label:"Libraries",to:"/libraries/scenarios"},{label:"Scenarios",to:"/libraries/scenarios"},{label:r}),t}return en("/libraries/scenarios",e)?(t.push({label:"Libraries",to:"/libraries/scenarios"},{label:"Scenarios"}),t):en("/compare",e)?(t.push({label:"Compare Evaluations"}),t):(en("/compare/results",e)&&t.push({label:"Compare Evaluations",to:"/compare"},{label:"Full Result Compare"}),t)};function CG(){const e=Ks(),t=new URLSearchParams(e.search).get("embed")==="1",n=NG(e.pathname),{connection:r,version:a}=An();return t?s.jsx("main",{className:"min-h-screen overflow-auto bg-background p-4",children:s.jsx(B_,{})}):s.jsx(e3,{children:s.jsxs("div",{className:"flex min-h-screen w-full",children:[s.jsx(dG,{version:a}),s.jsxs("div",{className:"flex flex-1 flex-col",children:[s.jsxs("header",{className:"flex h-12 items-center gap-2 border-b bg-card px-4",children:[s.jsx(n3,{}),s.jsx(p3,{children:s.jsx(h3,{children:n.map((i,o)=>{const c=o===n.length-1;return s.jsxs(v.Fragment,{children:[s.jsx(m3,{children:i.to&&!c?s.jsx(v3,{asChild:!0,children:s.jsx(yt,{to:i.to,children:i.label})}):s.jsx(g3,{children:i.label})}),!c&&s.jsx(y3,{})]},`${i.label}-${o}`)})})}),s.jsx("div",{className:"ml-auto flex items-center gap-2",children:s.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border px-2.5 py-1",children:[s.jsx("span",{className:`h-2 w-2 rounded-full ${r==="connected"?"bg-emerald-500":r==="checking"?"bg-amber-400":"bg-rose-500"}`,"aria-hidden":"true"}),s.jsx("span",{className:`text-xs ${r==="connected"?"text-emerald-700":r==="checking"?"text-muted-foreground":"text-destructive"}`,children:r})]})})]}),s.jsx("main",{className:"flex-1 overflow-auto p-6",children:s.jsx(B_,{})})]})]})})}const b3=v.createContext(null);function AG({children:e}){const{source:t}=An(),[n,r]=v.useState([]),[a,i]=v.useState(!0),o=v.useCallback(async()=>{i(!0);try{const g=await t.listConfigs();r(g)}finally{i(!1)}},[t]);v.useEffect(()=>{o()},[o]);const c=v.useCallback(g=>n.find(y=>y.id===g),[n]),d=v.useCallback(async g=>{const y=await t.createConfig(g);return r(j=>[...j,y]),y},[t]),f=v.useCallback(async(g,y)=>{const j=await t.updateConfig({...y,id:g});return r(w=>w.map(x=>x.id===g?j:x)),j},[t]),h=v.useCallback(async g=>{await t.deleteConfig(g),r(y=>y.filter(j=>j.id!==g))},[t]),p=v.useCallback(async g=>{const y=n.find(x=>x.id===g);if(!y)throw new Error("Config not found");const j={...structuredClone(y),id:`cfg-${Date.now()}`,name:`${y.name} (Copy)`,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},w=await t.createConfig(j);return r(x=>[...x,w]),w},[n,t]);return s.jsx(b3.Provider,{value:{configs:n,loading:a,getConfig:c,addConfig:d,updateConfig:f,deleteConfig:h,cloneConfig:p,reload:o},children:e})}function cf(){const e=v.useContext(b3);if(!e)throw new Error("useConfigs must be used within ConfigProvider");return e}const w3=v.createContext(null);function EG({children:e}){const{source:t}=An(),[n,r]=v.useState({servers:[],agents:[],scenarios:[]}),[a,i]=v.useState(!0),o=async()=>{i(!0);try{const f=await t.getLibraries();r(f)}finally{i(!1)}};v.useEffect(()=>{o()},[t]),v.useEffect(()=>{const f=()=>{o()};return window.addEventListener("focus",f),()=>{window.removeEventListener("focus",f)}},[t]);const c=async f=>{r(f),await t.saveLibraries(f)},d=v.useMemo(()=>({...n,loading:a,setServers:async f=>c({...n,servers:f}),setAgents:async f=>c({...n,agents:f}),setScenarios:async f=>c({...n,scenarios:f}),reload:o}),[n,a]);return s.jsx(w3.Provider,{value:d,children:e})}function Va(){const e=v.useContext(w3);if(!e)throw new Error("useLibraries must be used within LibraryProvider");return e}const ze=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));ze.displayName="Card";const At=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("flex flex-col space-y-1.5 p-6",e),...t}));At.displayName="CardHeader";const Et=v.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:Se("text-2xl font-semibold leading-none tracking-tight",e),...t}));Et.displayName="CardTitle";const Ms=v.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));Ms.displayName="CardDescription";const Ue=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("p-6 pt-0",e),...t}));Ue.displayName="CardContent";const _G=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("flex items-center p-6 pt-0",e),...t}));_G.displayName="CardFooter";const Hr=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:n,className:Se("w-full caption-bottom text-sm",e),...t})}));Hr.displayName="Table";const Kr=v.forwardRef(({className:e,...t},n)=>s.jsx("thead",{ref:n,className:Se("[&_tr]:border-b",e),...t}));Kr.displayName="TableHeader";const Gr=v.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:Se("[&_tr:last-child]:border-0",e),...t}));Gr.displayName="TableBody";const PG=v.forwardRef(({className:e,...t},n)=>s.jsx("tfoot",{ref:n,className:Se("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));PG.displayName="TableFooter";const zt=v.forwardRef(({className:e,...t},n)=>s.jsx("tr",{ref:n,className:Se("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));zt.displayName="TableRow";const nt=v.forwardRef(({className:e,...t},n)=>s.jsx("th",{ref:n,className:Se("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));nt.displayName="TableHead";const He=v.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:Se("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));He.displayName="TableCell";const OG=v.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:Se("mt-4 text-sm text-muted-foreground",e),...t}));OG.displayName="TableCaption";function ks({title:e,value:t,subtitle:n,icon:r,trend:a}){return s.jsx(ze,{children:s.jsx(Ue,{className:"p-4",children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:e}),s.jsx("p",{className:"text-2xl font-bold",children:t}),n&&s.jsxs("p",{className:`text-xs ${a==="up"?"text-success":a==="down"?"text-destructive":"text-muted-foreground"}`,children:[a==="up"&&"↑ ",a==="down"&&"↓ ",n]})]}),s.jsx("div",{className:"rounded-lg bg-primary/10 p-2",children:s.jsx(r,{className:"h-4 w-4 text-primary"})})]})})})}const kG=Lo("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ke({className:e,variant:t,asChild:n,...r}){const a=n?Bi:"div";return s.jsx(a,{className:Se(kG({variant:t}),e),...r})}function wo({rate:e,className:t}){const n=Math.round(e*100),r=n>=80?"default":n>=50?"secondary":"destructive";return s.jsxs(Ke,{variant:r,className:`font-mono text-xs ${n>=80?"bg-success/15 text-success hover:bg-success/20 border-0":n>=50?"bg-warning/15 text-warning hover:bg-warning/20 border-0":"bg-destructive/15 text-destructive hover:bg-destructive/20 border-0"} ${t??""}`,children:[n,"%"]})}var ax,aP;function _r(){if(aP)return ax;aP=1;var e=Array.isArray;return ax=e,ax}var sx,sP;function j3(){if(sP)return sx;sP=1;var e=typeof Ep=="object"&&Ep&&Ep.Object===Object&&Ep;return sx=e,sx}var ix,iP;function cs(){if(iP)return ix;iP=1;var e=j3(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return ix=n,ix}var ox,oP;function uf(){if(oP)return ox;oP=1;var e=cs(),t=e.Symbol;return ox=t,ox}var lx,lP;function RG(){if(lP)return lx;lP=1;var e=uf(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,a=e?e.toStringTag:void 0;function i(o){var c=n.call(o,a),d=o[a];try{o[a]=void 0;var f=!0}catch{}var h=r.call(o);return f&&(c?o[a]=d:delete o[a]),h}return lx=i,lx}var cx,cP;function TG(){if(cP)return cx;cP=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return cx=n,cx}var ux,uP;function Gs(){if(uP)return ux;uP=1;var e=uf(),t=RG(),n=TG(),r="[object Null]",a="[object Undefined]",i=e?e.toStringTag:void 0;function o(c){return c==null?c===void 0?a:r:i&&i in Object(c)?t(c):n(c)}return ux=o,ux}var dx,dP;function Ys(){if(dP)return dx;dP=1;function e(t){return t!=null&&typeof t=="object"}return dx=e,dx}var fx,fP;function Lc(){if(fP)return fx;fP=1;var e=Gs(),t=Ys(),n="[object Symbol]";function r(a){return typeof a=="symbol"||t(a)&&e(a)==n}return fx=r,fx}var px,pP;function GS(){if(pP)return px;pP=1;var e=_r(),t=Lc(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function a(i,o){if(e(i))return!1;var c=typeof i;return c=="number"||c=="symbol"||c=="boolean"||i==null||t(i)?!0:r.test(i)||!n.test(i)||o!=null&&i in Object(o)}return px=a,px}var hx,hP;function zi(){if(hP)return hx;hP=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return hx=e,hx}var mx,mP;function YS(){if(mP)return mx;mP=1;var e=Gs(),t=zi(),n="[object AsyncFunction]",r="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function o(c){if(!t(c))return!1;var d=e(c);return d==r||d==a||d==n||d==i}return mx=o,mx}var vx,vP;function IG(){if(vP)return vx;vP=1;var e=cs(),t=e["__core-js_shared__"];return vx=t,vx}var gx,gP;function MG(){if(gP)return gx;gP=1;var e=IG(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return gx=n,gx}var yx,yP;function S3(){if(yP)return yx;yP=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return yx=n,yx}var xx,xP;function $G(){if(xP)return xx;xP=1;var e=YS(),t=MG(),n=zi(),r=S3(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,c=Object.prototype,d=o.toString,f=c.hasOwnProperty,h=RegExp("^"+d.call(f).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(g){if(!n(g)||t(g))return!1;var y=e(g)?h:i;return y.test(r(g))}return xx=p,xx}var bx,bP;function DG(){if(bP)return bx;bP=1;function e(t,n){return t?.[n]}return bx=e,bx}var wx,wP;function Fo(){if(wP)return wx;wP=1;var e=$G(),t=DG();function n(r,a){var i=t(r,a);return e(i)?i:void 0}return wx=n,wx}var jx,jP;function nv(){if(jP)return jx;jP=1;var e=Fo(),t=e(Object,"create");return jx=t,jx}var Sx,SP;function LG(){if(SP)return Sx;SP=1;var e=nv();function t(){this.__data__=e?e(null):{},this.size=0}return Sx=t,Sx}var Nx,NP;function FG(){if(NP)return Nx;NP=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Nx=e,Nx}var Cx,CP;function BG(){if(CP)return Cx;CP=1;var e=nv(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function a(i){var o=this.__data__;if(e){var c=o[i];return c===t?void 0:c}return r.call(o,i)?o[i]:void 0}return Cx=a,Cx}var Ax,AP;function zG(){if(AP)return Ax;AP=1;var e=nv(),t=Object.prototype,n=t.hasOwnProperty;function r(a){var i=this.__data__;return e?i[a]!==void 0:n.call(i,a)}return Ax=r,Ax}var Ex,EP;function UG(){if(EP)return Ex;EP=1;var e=nv(),t="__lodash_hash_undefined__";function n(r,a){var i=this.__data__;return this.size+=this.has(r)?0:1,i[r]=e&&a===void 0?t:a,this}return Ex=n,Ex}var _x,_P;function qG(){if(_P)return _x;_P=1;var e=LG(),t=FG(),n=BG(),r=zG(),a=UG();function i(o){var c=-1,d=o==null?0:o.length;for(this.clear();++c<d;){var f=o[c];this.set(f[0],f[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=a,_x=i,_x}var Px,PP;function WG(){if(PP)return Px;PP=1;function e(){this.__data__=[],this.size=0}return Px=e,Px}var Ox,OP;function XS(){if(OP)return Ox;OP=1;function e(t,n){return t===n||t!==t&&n!==n}return Ox=e,Ox}var kx,kP;function rv(){if(kP)return kx;kP=1;var e=XS();function t(n,r){for(var a=n.length;a--;)if(e(n[a][0],r))return a;return-1}return kx=t,kx}var Rx,RP;function VG(){if(RP)return Rx;RP=1;var e=rv(),t=Array.prototype,n=t.splice;function r(a){var i=this.__data__,o=e(i,a);if(o<0)return!1;var c=i.length-1;return o==c?i.pop():n.call(i,o,1),--this.size,!0}return Rx=r,Rx}var Tx,TP;function HG(){if(TP)return Tx;TP=1;var e=rv();function t(n){var r=this.__data__,a=e(r,n);return a<0?void 0:r[a][1]}return Tx=t,Tx}var Ix,IP;function KG(){if(IP)return Ix;IP=1;var e=rv();function t(n){return e(this.__data__,n)>-1}return Ix=t,Ix}var Mx,MP;function GG(){if(MP)return Mx;MP=1;var e=rv();function t(n,r){var a=this.__data__,i=e(a,n);return i<0?(++this.size,a.push([n,r])):a[i][1]=r,this}return Mx=t,Mx}var $x,$P;function av(){if($P)return $x;$P=1;var e=WG(),t=VG(),n=HG(),r=KG(),a=GG();function i(o){var c=-1,d=o==null?0:o.length;for(this.clear();++c<d;){var f=o[c];this.set(f[0],f[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=a,$x=i,$x}var Dx,DP;function QS(){if(DP)return Dx;DP=1;var e=Fo(),t=cs(),n=e(t,"Map");return Dx=n,Dx}var Lx,LP;function YG(){if(LP)return Lx;LP=1;var e=qG(),t=av(),n=QS();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return Lx=r,Lx}var Fx,FP;function XG(){if(FP)return Fx;FP=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return Fx=e,Fx}var Bx,BP;function sv(){if(BP)return Bx;BP=1;var e=XG();function t(n,r){var a=n.__data__;return e(r)?a[typeof r=="string"?"string":"hash"]:a.map}return Bx=t,Bx}var zx,zP;function QG(){if(zP)return zx;zP=1;var e=sv();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return zx=t,zx}var Ux,UP;function JG(){if(UP)return Ux;UP=1;var e=sv();function t(n){return e(this,n).get(n)}return Ux=t,Ux}var qx,qP;function ZG(){if(qP)return qx;qP=1;var e=sv();function t(n){return e(this,n).has(n)}return qx=t,qx}var Wx,WP;function eY(){if(WP)return Wx;WP=1;var e=sv();function t(n,r){var a=e(this,n),i=a.size;return a.set(n,r),this.size+=a.size==i?0:1,this}return Wx=t,Wx}var Vx,VP;function JS(){if(VP)return Vx;VP=1;var e=YG(),t=QG(),n=JG(),r=ZG(),a=eY();function i(o){var c=-1,d=o==null?0:o.length;for(this.clear();++c<d;){var f=o[c];this.set(f[0],f[1])}}return i.prototype.clear=e,i.prototype.delete=t,i.prototype.get=n,i.prototype.has=r,i.prototype.set=a,Vx=i,Vx}var Hx,HP;function N3(){if(HP)return Hx;HP=1;var e=JS(),t="Expected a function";function n(r,a){if(typeof r!="function"||a!=null&&typeof a!="function")throw new TypeError(t);var i=function(){var o=arguments,c=a?a.apply(this,o):o[0],d=i.cache;if(d.has(c))return d.get(c);var f=r.apply(this,o);return i.cache=d.set(c,f)||d,f};return i.cache=new(n.Cache||e),i}return n.Cache=e,Hx=n,Hx}var Kx,KP;function tY(){if(KP)return Kx;KP=1;var e=N3(),t=500;function n(r){var a=e(r,function(o){return i.size===t&&i.clear(),o}),i=a.cache;return a}return Kx=n,Kx}var Gx,GP;function nY(){if(GP)return Gx;GP=1;var e=tY(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(t,function(o,c,d,f){i.push(d?f.replace(n,"$1"):c||o)}),i});return Gx=r,Gx}var Yx,YP;function ZS(){if(YP)return Yx;YP=1;function e(t,n){for(var r=-1,a=t==null?0:t.length,i=Array(a);++r<a;)i[r]=n(t[r],r,t);return i}return Yx=e,Yx}var Xx,XP;function rY(){if(XP)return Xx;XP=1;var e=uf(),t=ZS(),n=_r(),r=Lc(),a=e?e.prototype:void 0,i=a?a.toString:void 0;function o(c){if(typeof c=="string")return c;if(n(c))return t(c,o)+"";if(r(c))return i?i.call(c):"";var d=c+"";return d=="0"&&1/c==-1/0?"-0":d}return Xx=o,Xx}var Qx,QP;function C3(){if(QP)return Qx;QP=1;var e=rY();function t(n){return n==null?"":e(n)}return Qx=t,Qx}var Jx,JP;function A3(){if(JP)return Jx;JP=1;var e=_r(),t=GS(),n=nY(),r=C3();function a(i,o){return e(i)?i:t(i,o)?[i]:n(r(i))}return Jx=a,Jx}var Zx,ZP;function iv(){if(ZP)return Zx;ZP=1;var e=Lc();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Zx=t,Zx}var eb,eO;function eN(){if(eO)return eb;eO=1;var e=A3(),t=iv();function n(r,a){a=e(a,r);for(var i=0,o=a.length;r!=null&&i<o;)r=r[t(a[i++])];return i&&i==o?r:void 0}return eb=n,eb}var tb,tO;function E3(){if(tO)return tb;tO=1;var e=eN();function t(n,r,a){var i=n==null?void 0:e(n,r);return i===void 0?a:i}return tb=t,tb}var aY=E3();const Qr=Yt(aY);var nb,nO;function sY(){if(nO)return nb;nO=1;function e(t){return t==null}return nb=e,nb}var iY=sY();const jt=Yt(iY);var rb,rO;function oY(){if(rO)return rb;rO=1;var e=Gs(),t=_r(),n=Ys(),r="[object String]";function a(i){return typeof i=="string"||!t(i)&&n(i)&&e(i)==r}return rb=a,rb}var lY=oY();const Eo=Yt(lY);var cY=YS();const wt=Yt(cY);var uY=zi();const Fc=Yt(uY);var ab={exports:{}},Ft={};var aO;function dY(){if(aO)return Ft;aO=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.server_context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),j;j=Symbol.for("react.module.reference");function w(x){if(typeof x=="object"&&x!==null){var S=x.$$typeof;switch(S){case e:switch(x=x.type,x){case n:case a:case r:case f:case h:return x;default:switch(x=x&&x.$$typeof,x){case c:case o:case d:case g:case p:case i:return x;default:return S}}case t:return S}}}return Ft.ContextConsumer=o,Ft.ContextProvider=i,Ft.Element=e,Ft.ForwardRef=d,Ft.Fragment=n,Ft.Lazy=g,Ft.Memo=p,Ft.Portal=t,Ft.Profiler=a,Ft.StrictMode=r,Ft.Suspense=f,Ft.SuspenseList=h,Ft.isAsyncMode=function(){return!1},Ft.isConcurrentMode=function(){return!1},Ft.isContextConsumer=function(x){return w(x)===o},Ft.isContextProvider=function(x){return w(x)===i},Ft.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===e},Ft.isForwardRef=function(x){return w(x)===d},Ft.isFragment=function(x){return w(x)===n},Ft.isLazy=function(x){return w(x)===g},Ft.isMemo=function(x){return w(x)===p},Ft.isPortal=function(x){return w(x)===t},Ft.isProfiler=function(x){return w(x)===a},Ft.isStrictMode=function(x){return w(x)===r},Ft.isSuspense=function(x){return w(x)===f},Ft.isSuspenseList=function(x){return w(x)===h},Ft.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===n||x===a||x===r||x===f||x===h||x===y||typeof x=="object"&&x!==null&&(x.$$typeof===g||x.$$typeof===p||x.$$typeof===i||x.$$typeof===o||x.$$typeof===d||x.$$typeof===j||x.getModuleId!==void 0)},Ft.typeOf=w,Ft}var sO;function fY(){return sO||(sO=1,ab.exports=dY()),ab.exports}var pY=fY(),sb,iO;function _3(){if(iO)return sb;iO=1;var e=Gs(),t=Ys(),n="[object Number]";function r(a){return typeof a=="number"||t(a)&&e(a)==n}return sb=r,sb}var ib,oO;function hY(){if(oO)return ib;oO=1;var e=_3();function t(n){return e(n)&&n!=+n}return ib=t,ib}var mY=hY();const df=Yt(mY);var vY=_3();const gY=Yt(vY);var fr=function(t){return t===0?0:t>0?1:-1},go=function(t){return Eo(t)&&t.indexOf("%")===t.length-1},De=function(t){return gY(t)&&!df(t)},yY=function(t){return jt(t)},Fn=function(t){return De(t)||Eo(t)},xY=0,Bc=function(t){var n=++xY;return"".concat(t||"").concat(n)},pr=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!De(t)&&!Eo(t))return r;var i;if(go(t)){var o=t.indexOf("%");i=n*parseFloat(t.slice(0,o))/100}else i=+t;return df(i)&&(i=r),a&&i>n&&(i=n),i},El=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},bY=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},a=0;a<n;a++)if(!r[t[a]])r[t[a]]=!0;else return!0;return!1},Wr=function(t,n){return De(t)&&De(n)?function(r){return t+r*(n-t)}:function(){return n}};function yh(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):Qr(r,t))===n})}var wY=function(t,n){return De(t)&&De(n)?t-n:Eo(t)&&Eo(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function zl(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function $1(e){"@babel/helpers - typeof";return $1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$1(e)}var jY=["viewBox","children"],SY=["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"],lO=["points","pathLength"],ob={svg:jY,polygon:lO,polyline:lO},tN=["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"],xh=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(v.isValidElement(t)&&(r=t.props),!Fc(r))return null;var a={};return Object.keys(r).forEach(function(i){tN.includes(i)&&(a[i]=n||function(o){return r[i](r,o)})}),a},NY=function(t,n,r){return function(a){return t(n,r,a),null}},_o=function(t,n,r){if(!Fc(t)||$1(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(i){var o=t[i];tN.includes(i)&&typeof o=="function"&&(a||(a={}),a[i]=NY(o,n,r))}),a},CY=["children"],AY=["children"];function cO(e,t){if(e==null)return{};var n=EY(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function EY(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function D1(e){"@babel/helpers - typeof";return D1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},D1(e)}var uO={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},$s=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},dO=null,lb=null,nN=function e(t){if(t===dO&&Array.isArray(lb))return lb;var n=[];return v.Children.forEach(t,function(r){jt(r)||(pY.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),lb=n,dO=t,n};function Jr(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(a){return $s(a)}):r=[$s(t)],nN(e).forEach(function(a){var i=Qr(a,"type.displayName")||Qr(a,"type.name");r.indexOf(i)!==-1&&n.push(a)}),n}function zr(e,t){var n=Jr(e,t);return n&&n[0]}var fO=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,a=n.height;return!(!De(r)||r<=0||!De(a)||a<=0)},_Y=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],PY=function(t){return t&&t.type&&Eo(t.type)&&_Y.indexOf(t.type)>=0},OY=function(t){return t&&D1(t)==="object"&&"clipDot"in t},kY=function(t,n,r,a){var i,o=(i=ob?.[a])!==null&&i!==void 0?i:[];return n.startsWith("data-")||!wt(t)&&(a&&o.includes(n)||SY.includes(n))||r&&tN.includes(n)},ht=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(v.isValidElement(t)&&(a=t.props),!Fc(a))return null;var i={};return Object.keys(a).forEach(function(o){var c;kY((c=a)===null||c===void 0?void 0:c[o],o,n,r)&&(i[o]=a[o])}),i},L1=function e(t,n){if(t===n)return!0;var r=v.Children.count(t);if(r!==v.Children.count(n))return!1;if(r===0)return!0;if(r===1)return pO(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var a=0;a<r;a++){var i=t[a],o=n[a];if(Array.isArray(i)||Array.isArray(o)){if(!e(i,o))return!1}else if(!pO(i,o))return!1}return!0},pO=function(t,n){if(jt(t)&&jt(n))return!0;if(!jt(t)&&!jt(n)){var r=t.props||{},a=r.children,i=cO(r,CY),o=n.props||{},c=o.children,d=cO(o,AY);return a&&c?zl(i,d)&&L1(a,c):!a&&!c?zl(i,d):!1}return!1},hO=function(t,n){var r=[],a={};return nN(t).forEach(function(i,o){if(PY(i))r.push(i);else if(i){var c=$s(i.type),d=n[c]||{},f=d.handler,h=d.once;if(f&&(!h||!a[c])){var p=f(i,c,o);r.push(p),a[c]=!0}}}),r},RY=function(t){var n=t&&t.type;return n&&uO[n]?uO[n]:null},TY=function(t,n){return nN(n).indexOf(t)},IY=["children","width","height","viewBox","className","style","title","desc"];function F1(){return F1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},F1.apply(this,arguments)}function MY(e,t){if(e==null)return{};var n=$Y(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $Y(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function B1(e){var t=e.children,n=e.width,r=e.height,a=e.viewBox,i=e.className,o=e.style,c=e.title,d=e.desc,f=MY(e,IY),h=a||{width:n,height:r,x:0,y:0},p=St("recharts-surface",i);return W.createElement("svg",F1({},ht(f,!0,"svg"),{className:p,width:n,height:r,style:o,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),W.createElement("title",null,c),W.createElement("desc",null,d),t)}var DY=["children","className"];function z1(){return z1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},z1.apply(this,arguments)}function LY(e,t){if(e==null)return{};var n=FY(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function FY(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Mt=W.forwardRef(function(e,t){var n=e.children,r=e.className,a=LY(e,DY),i=St("recharts-layer",r);return W.createElement("g",z1({className:i},ht(a,!0),{ref:t}),n)}),Ds=function(t,n){for(var r=arguments.length,a=new Array(r>2?r-2:0),i=2;i<r;i++)a[i-2]=arguments[i]},cb,mO;function BY(){if(mO)return cb;mO=1;function e(t,n,r){var a=-1,i=t.length;n<0&&(n=-n>i?0:i+n),r=r>i?i:r,r<0&&(r+=i),i=n>r?0:r-n>>>0,n>>>=0;for(var o=Array(i);++a<i;)o[a]=t[a+n];return o}return cb=e,cb}var ub,vO;function zY(){if(vO)return ub;vO=1;var e=BY();function t(n,r,a){var i=n.length;return a=a===void 0?i:a,!r&&a>=i?n:e(n,r,a)}return ub=t,ub}var db,gO;function P3(){if(gO)return db;gO=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",a=t+n+r,i="\\ufe0e\\ufe0f",o="\\u200d",c=RegExp("["+o+e+a+i+"]");function d(f){return c.test(f)}return db=d,db}var fb,yO;function UY(){if(yO)return fb;yO=1;function e(t){return t.split("")}return fb=e,fb}var pb,xO;function qY(){if(xO)return pb;xO=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",a=t+n+r,i="\\ufe0e\\ufe0f",o="["+e+"]",c="["+a+"]",d="\\ud83c[\\udffb-\\udfff]",f="(?:"+c+"|"+d+")",h="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",y="\\u200d",j=f+"?",w="["+i+"]?",x="(?:"+y+"(?:"+[h,p,g].join("|")+")"+w+j+")*",S=w+j+x,N="(?:"+[h+c+"?",c,p,g,o].join("|")+")",A=RegExp(d+"(?="+d+")|"+N+S,"g");function P(E){return E.match(A)||[]}return pb=P,pb}var hb,bO;function WY(){if(bO)return hb;bO=1;var e=UY(),t=P3(),n=qY();function r(a){return t(a)?n(a):e(a)}return hb=r,hb}var mb,wO;function VY(){if(wO)return mb;wO=1;var e=zY(),t=P3(),n=WY(),r=C3();function a(i){return function(o){o=r(o);var c=t(o)?n(o):void 0,d=c?c[0]:o.charAt(0),f=c?e(c,1).join(""):o.slice(1);return d[i]()+f}}return mb=a,mb}var vb,jO;function HY(){if(jO)return vb;jO=1;var e=VY(),t=e("toUpperCase");return vb=t,vb}var KY=HY();const ov=Yt(KY);function an(e){return function(){return e}}const O3=Math.cos,bh=Math.sin,Ha=Math.sqrt,wh=Math.PI,lv=2*wh,U1=Math.PI,q1=2*U1,ho=1e-6,GY=q1-ho;function k3(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function YY(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return k3;const n=10**t;return function(r){this._+=r[0];for(let a=1,i=r.length;a<i;++a)this._+=Math.round(arguments[a]*n)/n+r[a]}}class XY{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?k3:YY(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,a){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+a}`}bezierCurveTo(t,n,r,a,i,o){this._append`C${+t},${+n},${+r},${+a},${this._x1=+i},${this._y1=+o}`}arcTo(t,n,r,a,i){if(t=+t,n=+n,r=+r,a=+a,i=+i,i<0)throw new Error(`negative radius: ${i}`);let o=this._x1,c=this._y1,d=r-t,f=a-n,h=o-t,p=c-n,g=h*h+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(g>ho)if(!(Math.abs(p*d-f*h)>ho)||!i)this._append`L${this._x1=t},${this._y1=n}`;else{let y=r-o,j=a-c,w=d*d+f*f,x=y*y+j*j,S=Math.sqrt(w),N=Math.sqrt(g),A=i*Math.tan((U1-Math.acos((w+g-x)/(2*S*N)))/2),P=A/N,E=A/S;Math.abs(P-1)>ho&&this._append`L${t+P*h},${n+P*p}`,this._append`A${i},${i},0,0,${+(p*y>h*j)},${this._x1=t+E*d},${this._y1=n+E*f}`}}arc(t,n,r,a,i,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(a),d=r*Math.sin(a),f=t+c,h=n+d,p=1^o,g=o?a-i:i-a;this._x1===null?this._append`M${f},${h}`:(Math.abs(this._x1-f)>ho||Math.abs(this._y1-h)>ho)&&this._append`L${f},${h}`,r&&(g<0&&(g=g%q1+q1),g>GY?this._append`A${r},${r},0,1,${p},${t-c},${n-d}A${r},${r},0,1,${p},${this._x1=f},${this._y1=h}`:g>ho&&this._append`A${r},${r},0,${+(g>=U1)},${p},${this._x1=t+r*Math.cos(i)},${this._y1=n+r*Math.sin(i)}`)}rect(t,n,r,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+a}h${-r}Z`}toString(){return this._}}function rN(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 XY(t)}function aN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function R3(e){this._context=e}R3.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 cv(e){return new R3(e)}function T3(e){return e[0]}function I3(e){return e[1]}function M3(e,t){var n=an(!0),r=null,a=cv,i=null,o=rN(c);e=typeof e=="function"?e:e===void 0?T3:an(e),t=typeof t=="function"?t:t===void 0?I3:an(t);function c(d){var f,h=(d=aN(d)).length,p,g=!1,y;for(r==null&&(i=a(y=o())),f=0;f<=h;++f)!(f<h&&n(p=d[f],f,d))===g&&((g=!g)?i.lineStart():i.lineEnd()),g&&i.point(+e(p,f,d),+t(p,f,d));if(y)return i=null,y+""||null}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:an(+d),c):e},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:an(+d),c):t},c.defined=function(d){return arguments.length?(n=typeof d=="function"?d:an(!!d),c):n},c.curve=function(d){return arguments.length?(a=d,r!=null&&(i=a(r)),c):a},c.context=function(d){return arguments.length?(d==null?r=i=null:i=a(r=d),c):r},c}function Fp(e,t,n){var r=null,a=an(!0),i=null,o=cv,c=null,d=rN(f);e=typeof e=="function"?e:e===void 0?T3:an(+e),t=typeof t=="function"?t:an(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?I3:an(+n);function f(p){var g,y,j,w=(p=aN(p)).length,x,S=!1,N,A=new Array(w),P=new Array(w);for(i==null&&(c=o(N=d())),g=0;g<=w;++g){if(!(g<w&&a(x=p[g],g,p))===S)if(S=!S)y=g,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),j=g-1;j>=y;--j)c.point(A[j],P[j]);c.lineEnd(),c.areaEnd()}S&&(A[g]=+e(x,g,p),P[g]=+t(x,g,p),c.point(r?+r(x,g,p):A[g],n?+n(x,g,p):P[g]))}if(N)return c=null,N+""||null}function h(){return M3().defined(a).curve(o).context(i)}return f.x=function(p){return arguments.length?(e=typeof p=="function"?p:an(+p),r=null,f):e},f.x0=function(p){return arguments.length?(e=typeof p=="function"?p:an(+p),f):e},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:an(+p),f):r},f.y=function(p){return arguments.length?(t=typeof p=="function"?p:an(+p),n=null,f):t},f.y0=function(p){return arguments.length?(t=typeof p=="function"?p:an(+p),f):t},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:an(+p),f):n},f.lineX0=f.lineY0=function(){return h().x(e).y(t)},f.lineY1=function(){return h().x(e).y(n)},f.lineX1=function(){return h().x(r).y(t)},f.defined=function(p){return arguments.length?(a=typeof p=="function"?p:an(!!p),f):a},f.curve=function(p){return arguments.length?(o=p,i!=null&&(c=o(i)),f):o},f.context=function(p){return arguments.length?(p==null?i=c=null:c=o(i=p),f):i},f}class $3{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 QY(e){return new $3(e,!0)}function JY(e){return new $3(e,!1)}const sN={draw(e,t){const n=Ha(t/wh);e.moveTo(n,0),e.arc(0,0,n,0,lv)}},ZY={draw(e,t){const n=Ha(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()}},D3=Ha(1/3),eX=D3*2,tX={draw(e,t){const n=Ha(t/eX),r=n*D3;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},nX={draw(e,t){const n=Ha(t),r=-n/2;e.rect(r,r,n,n)}},rX=.8908130915292852,L3=bh(wh/10)/bh(7*wh/10),aX=bh(lv/10)*L3,sX=-O3(lv/10)*L3,iX={draw(e,t){const n=Ha(t*rX),r=aX*n,a=sX*n;e.moveTo(0,-n),e.lineTo(r,a);for(let i=1;i<5;++i){const o=lv*i/5,c=O3(o),d=bh(o);e.lineTo(d*n,-c*n),e.lineTo(c*r-d*a,d*r+c*a)}e.closePath()}},gb=Ha(3),oX={draw(e,t){const n=-Ha(t/(gb*3));e.moveTo(0,n*2),e.lineTo(-gb*n,-n),e.lineTo(gb*n,-n),e.closePath()}},oa=-.5,la=Ha(3)/2,W1=1/Ha(12),lX=(W1/2+1)*3,cX={draw(e,t){const n=Ha(t/lX),r=n/2,a=n*W1,i=r,o=n*W1+n,c=-i,d=o;e.moveTo(r,a),e.lineTo(i,o),e.lineTo(c,d),e.lineTo(oa*r-la*a,la*r+oa*a),e.lineTo(oa*i-la*o,la*i+oa*o),e.lineTo(oa*c-la*d,la*c+oa*d),e.lineTo(oa*r+la*a,oa*a-la*r),e.lineTo(oa*i+la*o,oa*o-la*i),e.lineTo(oa*c+la*d,oa*d-la*c),e.closePath()}};function uX(e,t){let n=null,r=rN(a);e=typeof e=="function"?e:an(e||sN),t=typeof t=="function"?t:an(t===void 0?64:+t);function a(){let i;if(n||(n=i=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:an(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:an(+i),a):t},a.context=function(i){return arguments.length?(n=i??null,a):n},a}function jh(){}function Sh(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 F3(e){this._context=e}F3.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:Sh(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:Sh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function dX(e){return new F3(e)}function B3(e){this._context=e}B3.prototype={areaStart:jh,areaEnd:jh,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:Sh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function fX(e){return new B3(e)}function z3(e){this._context=e}z3.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:Sh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function pX(e){return new z3(e)}function U3(e){this._context=e}U3.prototype={areaStart:jh,areaEnd:jh,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 hX(e){return new U3(e)}function SO(e){return e<0?-1:1}function NO(e,t,n){var r=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(r||a<0&&-0),o=(n-e._y1)/(a||r<0&&-0),c=(i*a+o*r)/(r+a);return(SO(i)+SO(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(c))||0}function CO(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function yb(e,t,n){var r=e._x0,a=e._y0,i=e._x1,o=e._y1,c=(i-r)/3;e._context.bezierCurveTo(r+c,a+c*t,i-c,o-c*n,i,o)}function Nh(e){this._context=e}Nh.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:yb(this,this._t0,CO(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,yb(this,CO(this,n=NO(this,e,t)),n);break;default:yb(this,this._t0,n=NO(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function q3(e){this._context=new W3(e)}(q3.prototype=Object.create(Nh.prototype)).point=function(e,t){Nh.prototype.point.call(this,t,e)};function W3(e){this._context=e}W3.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,a,i){this._context.bezierCurveTo(t,e,r,n,i,a)}};function mX(e){return new Nh(e)}function vX(e){return new q3(e)}function V3(e){this._context=e}V3.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=AO(e),a=AO(t),i=0,o=1;o<n;++i,++o)this._context.bezierCurveTo(r[0][i],a[0][i],r[1][i],a[1][i],e[o],t[o]);(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 AO(e){var t,n=e.length-1,r,a=new Array(n),i=new Array(n),o=new Array(n);for(a[0]=0,i[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)a[t]=1,i[t]=4,o[t]=4*e[t]+2*e[t+1];for(a[n-1]=2,i[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=a[t]/i[t-1],i[t]-=r,o[t]-=r*o[t-1];for(a[n-1]=o[n-1]/i[n-1],t=n-2;t>=0;--t)a[t]=(o[t]-a[t+1])/i[t];for(i[n-1]=(e[n]+a[n-1])/2,t=0;t<n-1;++t)i[t]=2*e[t+1]-a[t+1];return[a,i]}function gX(e){return new V3(e)}function uv(e,t){this._context=e,this._t=t}uv.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 yX(e){return new uv(e,.5)}function xX(e){return new uv(e,0)}function bX(e){return new uv(e,1)}function ec(e,t){if((o=e.length)>1)for(var n=1,r,a,i=e[t[0]],o,c=i.length;n<o;++n)for(a=i,i=e[t[n]],r=0;r<c;++r)i[r][1]+=i[r][0]=isNaN(a[r][1])?a[r][0]:a[r][1]}function V1(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function wX(e,t){return e[t]}function jX(e){const t=[];return t.key=e,t}function SX(){var e=an([]),t=V1,n=ec,r=wX;function a(i){var o=Array.from(e.apply(this,arguments),jX),c,d=o.length,f=-1,h;for(const p of i)for(c=0,++f;c<d;++c)(o[c][f]=[0,+r(p,o[c].key,f,i)]).data=p;for(c=0,h=aN(t(o));c<d;++c)o[h[c]].index=c;return n(o,h),o}return a.keys=function(i){return arguments.length?(e=typeof i=="function"?i:an(Array.from(i)),a):e},a.value=function(i){return arguments.length?(r=typeof i=="function"?i:an(+i),a):r},a.order=function(i){return arguments.length?(t=i==null?V1:typeof i=="function"?i:an(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(n=i??ec,a):n},a}function NX(e,t){if((r=e.length)>0){for(var n,r,a=0,i=e[0].length,o;a<i;++a){for(o=n=0;n<r;++n)o+=e[n][a][1]||0;if(o)for(n=0;n<r;++n)e[n][a][1]/=o}ec(e,t)}}function CX(e,t){if((a=e.length)>0){for(var n=0,r=e[t[0]],a,i=r.length;n<i;++n){for(var o=0,c=0;o<a;++o)c+=e[o][n][1]||0;r[n][1]+=r[n][0]=-c/2}ec(e,t)}}function AX(e,t){if(!(!((o=e.length)>0)||!((i=(a=e[t[0]]).length)>0))){for(var n=0,r=1,a,i,o;r<i;++r){for(var c=0,d=0,f=0;c<o;++c){for(var h=e[t[c]],p=h[r][1]||0,g=h[r-1][1]||0,y=(p-g)/2,j=0;j<c;++j){var w=e[t[j]],x=w[r][1]||0,S=w[r-1][1]||0;y+=x-S}d+=p,f+=y*p}a[r-1][1]+=a[r-1][0]=n,d&&(n-=f/d)}a[r-1][1]+=a[r-1][0]=n,ec(e,t)}}function hd(e){"@babel/helpers - typeof";return hd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hd(e)}var EX=["type","size","sizeType"];function H1(){return H1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},H1.apply(this,arguments)}function EO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function _O(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EO(Object(n),!0).forEach(function(r){_X(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _X(e,t,n){return t=PX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PX(e){var t=OX(e,"string");return hd(t)=="symbol"?t:t+""}function OX(e,t){if(hd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(hd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kX(e,t){if(e==null)return{};var n=RX(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function RX(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var H3={symbolCircle:sN,symbolCross:ZY,symbolDiamond:tX,symbolSquare:nX,symbolStar:iX,symbolTriangle:oX,symbolWye:cX},TX=Math.PI/180,IX=function(t){var n="symbol".concat(ov(t));return H3[n]||sN},MX=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*TX;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},$X=function(t,n){H3["symbol".concat(ov(t))]=n},iN=function(t){var n=t.type,r=n===void 0?"circle":n,a=t.size,i=a===void 0?64:a,o=t.sizeType,c=o===void 0?"area":o,d=kX(t,EX),f=_O(_O({},d),{},{type:r,size:i,sizeType:c}),h=function(){var x=IX(r),S=uX().type(x).size(MX(i,c,r));return S()},p=f.className,g=f.cx,y=f.cy,j=ht(f,!0);return g===+g&&y===+y&&i===+i?W.createElement("path",H1({},j,{className:St("recharts-symbols",p),transform:"translate(".concat(g,", ").concat(y,")"),d:h()})):null};iN.registerSymbol=$X;function tc(e){"@babel/helpers - typeof";return tc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tc(e)}function K1(){return K1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},K1.apply(this,arguments)}function PO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function DX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PO(Object(n),!0).forEach(function(r){md(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FX(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,G3(r.key),r)}}function BX(e,t,n){return t&&FX(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function zX(e,t,n){return t=Ch(t),UX(e,K3()?Reflect.construct(t,n||[],Ch(e).constructor):t.apply(e,n))}function UX(e,t){if(t&&(tc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qX(e)}function qX(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function K3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(K3=function(){return!!e})()}function Ch(e){return Ch=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ch(e)}function WX(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&G1(e,t)}function G1(e,t){return G1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},G1(e,t)}function md(e,t,n){return t=G3(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G3(e){var t=VX(e,"string");return tc(t)=="symbol"?t:t+""}function VX(e,t){if(tc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(tc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ca=32,oN=(function(e){function t(){return LX(this,t),zX(this,t,arguments)}return WX(t,e),BX(t,[{key:"renderIcon",value:function(r){var a=this.props.inactiveColor,i=ca/2,o=ca/6,c=ca/3,d=r.inactive?a:r.color;if(r.type==="plainline")return W.createElement("line",{strokeWidth:4,fill:"none",stroke:d,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:i,x2:ca,y2:i,className:"recharts-legend-icon"});if(r.type==="line")return W.createElement("path",{strokeWidth:4,fill:"none",stroke:d,d:"M0,".concat(i,"h").concat(c,`
|
|
57
|
+
A`).concat(o,",").concat(o,",0,1,1,").concat(2*c,",").concat(i,`
|
|
58
|
+
H`).concat(ca,"M").concat(2*c,",").concat(i,`
|
|
59
|
+
A`).concat(o,",").concat(o,",0,1,1,").concat(c,",").concat(i),className:"recharts-legend-icon"});if(r.type==="rect")return W.createElement("path",{stroke:"none",fill:d,d:"M0,".concat(ca/8,"h").concat(ca,"v").concat(ca*3/4,"h").concat(-ca,"z"),className:"recharts-legend-icon"});if(W.isValidElement(r.legendIcon)){var f=DX({},r);return delete f.legendIcon,W.cloneElement(r.legendIcon,f)}return W.createElement(iN,{fill:d,cx:i,cy:i,size:ca,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,a=this.props,i=a.payload,o=a.iconSize,c=a.layout,d=a.formatter,f=a.inactiveColor,h={x:0,y:0,width:ca,height:ca},p={display:c==="horizontal"?"inline-block":"block",marginRight:10},g={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(y,j){var w=y.formatter||d,x=St(md(md({"recharts-legend-item":!0},"legend-item-".concat(j),!0),"inactive",y.inactive));if(y.type==="none")return null;var S=wt(y.value)?null:y.value;Ds(!wt(y.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var N=y.inactive?f:y.color;return W.createElement("li",K1({className:x,style:p,key:"legend-item-".concat(j)},_o(r.props,y,j)),W.createElement(B1,{width:o,height:o,viewBox:h,style:g},r.renderIcon(y)),W.createElement("span",{className:"recharts-legend-item-text",style:{color:N}},w?w(S,y,j):S))})}},{key:"render",value:function(){var r=this.props,a=r.payload,i=r.layout,o=r.align;if(!a||!a.length)return null;var c={padding:0,margin:0,textAlign:i==="horizontal"?o:"left"};return W.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(v.PureComponent);md(oN,"displayName","Legend");md(oN,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var xb,OO;function HX(){if(OO)return xb;OO=1;var e=av();function t(){this.__data__=new e,this.size=0}return xb=t,xb}var bb,kO;function KX(){if(kO)return bb;kO=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return bb=e,bb}var wb,RO;function GX(){if(RO)return wb;RO=1;function e(t){return this.__data__.get(t)}return wb=e,wb}var jb,TO;function YX(){if(TO)return jb;TO=1;function e(t){return this.__data__.has(t)}return jb=e,jb}var Sb,IO;function XX(){if(IO)return Sb;IO=1;var e=av(),t=QS(),n=JS(),r=200;function a(i,o){var c=this.__data__;if(c instanceof e){var d=c.__data__;if(!t||d.length<r-1)return d.push([i,o]),this.size=++c.size,this;c=this.__data__=new n(d)}return c.set(i,o),this.size=c.size,this}return Sb=a,Sb}var Nb,MO;function Y3(){if(MO)return Nb;MO=1;var e=av(),t=HX(),n=KX(),r=GX(),a=YX(),i=XX();function o(c){var d=this.__data__=new e(c);this.size=d.size}return o.prototype.clear=t,o.prototype.delete=n,o.prototype.get=r,o.prototype.has=a,o.prototype.set=i,Nb=o,Nb}var Cb,$O;function QX(){if($O)return Cb;$O=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return Cb=t,Cb}var Ab,DO;function JX(){if(DO)return Ab;DO=1;function e(t){return this.__data__.has(t)}return Ab=e,Ab}var Eb,LO;function X3(){if(LO)return Eb;LO=1;var e=JS(),t=QX(),n=JX();function r(a){var i=-1,o=a==null?0:a.length;for(this.__data__=new e;++i<o;)this.add(a[i])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,Eb=r,Eb}var _b,FO;function Q3(){if(FO)return _b;FO=1;function e(t,n){for(var r=-1,a=t==null?0:t.length;++r<a;)if(n(t[r],r,t))return!0;return!1}return _b=e,_b}var Pb,BO;function J3(){if(BO)return Pb;BO=1;function e(t,n){return t.has(n)}return Pb=e,Pb}var Ob,zO;function Z3(){if(zO)return Ob;zO=1;var e=X3(),t=Q3(),n=J3(),r=1,a=2;function i(o,c,d,f,h,p){var g=d&r,y=o.length,j=c.length;if(y!=j&&!(g&&j>y))return!1;var w=p.get(o),x=p.get(c);if(w&&x)return w==c&&x==o;var S=-1,N=!0,A=d&a?new e:void 0;for(p.set(o,c),p.set(c,o);++S<y;){var P=o[S],E=c[S];if(f)var O=g?f(E,P,S,c,o,p):f(P,E,S,o,c,p);if(O!==void 0){if(O)continue;N=!1;break}if(A){if(!t(c,function(k,R){if(!n(A,R)&&(P===k||h(P,k,d,f,p)))return A.push(R)})){N=!1;break}}else if(!(P===E||h(P,E,d,f,p))){N=!1;break}}return p.delete(o),p.delete(c),N}return Ob=i,Ob}var kb,UO;function ZX(){if(UO)return kb;UO=1;var e=cs(),t=e.Uint8Array;return kb=t,kb}var Rb,qO;function eQ(){if(qO)return Rb;qO=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a,i){r[++n]=[i,a]}),r}return Rb=e,Rb}var Tb,WO;function lN(){if(WO)return Tb;WO=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a){r[++n]=a}),r}return Tb=e,Tb}var Ib,VO;function tQ(){if(VO)return Ib;VO=1;var e=uf(),t=ZX(),n=XS(),r=Z3(),a=eQ(),i=lN(),o=1,c=2,d="[object Boolean]",f="[object Date]",h="[object Error]",p="[object Map]",g="[object Number]",y="[object RegExp]",j="[object Set]",w="[object String]",x="[object Symbol]",S="[object ArrayBuffer]",N="[object DataView]",A=e?e.prototype:void 0,P=A?A.valueOf:void 0;function E(O,k,R,D,U,z,L){switch(R){case N:if(O.byteLength!=k.byteLength||O.byteOffset!=k.byteOffset)return!1;O=O.buffer,k=k.buffer;case S:return!(O.byteLength!=k.byteLength||!z(new t(O),new t(k)));case d:case f:case g:return n(+O,+k);case h:return O.name==k.name&&O.message==k.message;case y:case w:return O==k+"";case p:var G=a;case j:var q=D&o;if(G||(G=i),O.size!=k.size&&!q)return!1;var H=L.get(O);if(H)return H==k;D|=c,L.set(O,k);var X=r(G(O),G(k),D,U,z,L);return L.delete(O),X;case x:if(P)return P.call(O)==P.call(k)}return!1}return Ib=E,Ib}var Mb,HO;function e5(){if(HO)return Mb;HO=1;function e(t,n){for(var r=-1,a=n.length,i=t.length;++r<a;)t[i+r]=n[r];return t}return Mb=e,Mb}var $b,KO;function nQ(){if(KO)return $b;KO=1;var e=e5(),t=_r();function n(r,a,i){var o=a(r);return t(r)?o:e(o,i(r))}return $b=n,$b}var Db,GO;function rQ(){if(GO)return Db;GO=1;function e(t,n){for(var r=-1,a=t==null?0:t.length,i=0,o=[];++r<a;){var c=t[r];n(c,r,t)&&(o[i++]=c)}return o}return Db=e,Db}var Lb,YO;function aQ(){if(YO)return Lb;YO=1;function e(){return[]}return Lb=e,Lb}var Fb,XO;function sQ(){if(XO)return Fb;XO=1;var e=rQ(),t=aQ(),n=Object.prototype,r=n.propertyIsEnumerable,a=Object.getOwnPropertySymbols,i=a?function(o){return o==null?[]:(o=Object(o),e(a(o),function(c){return r.call(o,c)}))}:t;return Fb=i,Fb}var Bb,QO;function iQ(){if(QO)return Bb;QO=1;function e(t,n){for(var r=-1,a=Array(t);++r<t;)a[r]=n(r);return a}return Bb=e,Bb}var zb,JO;function oQ(){if(JO)return zb;JO=1;var e=Gs(),t=Ys(),n="[object Arguments]";function r(a){return t(a)&&e(a)==n}return zb=r,zb}var Ub,ZO;function cN(){if(ZO)return Ub;ZO=1;var e=oQ(),t=Ys(),n=Object.prototype,r=n.hasOwnProperty,a=n.propertyIsEnumerable,i=e((function(){return arguments})())?e:function(o){return t(o)&&r.call(o,"callee")&&!a.call(o,"callee")};return Ub=i,Ub}var Hu={exports:{}},qb,ek;function lQ(){if(ek)return qb;ek=1;function e(){return!1}return qb=e,qb}Hu.exports;var tk;function t5(){return tk||(tk=1,(function(e,t){var n=cs(),r=lQ(),a=t&&!t.nodeType&&t,i=a&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===a,c=o?n.Buffer:void 0,d=c?c.isBuffer:void 0,f=d||r;e.exports=f})(Hu,Hu.exports)),Hu.exports}var Wb,nk;function uN(){if(nk)return Wb;nk=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,a){var i=typeof r;return a=a??e,!!a&&(i=="number"||i!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<a}return Wb=n,Wb}var Vb,rk;function dN(){if(rk)return Vb;rk=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return Vb=t,Vb}var Hb,ak;function cQ(){if(ak)return Hb;ak=1;var e=Gs(),t=dN(),n=Ys(),r="[object Arguments]",a="[object Array]",i="[object Boolean]",o="[object Date]",c="[object Error]",d="[object Function]",f="[object Map]",h="[object Number]",p="[object Object]",g="[object RegExp]",y="[object Set]",j="[object String]",w="[object WeakMap]",x="[object ArrayBuffer]",S="[object DataView]",N="[object Float32Array]",A="[object Float64Array]",P="[object Int8Array]",E="[object Int16Array]",O="[object Int32Array]",k="[object Uint8Array]",R="[object Uint8ClampedArray]",D="[object Uint16Array]",U="[object Uint32Array]",z={};z[N]=z[A]=z[P]=z[E]=z[O]=z[k]=z[R]=z[D]=z[U]=!0,z[r]=z[a]=z[x]=z[i]=z[S]=z[o]=z[c]=z[d]=z[f]=z[h]=z[p]=z[g]=z[y]=z[j]=z[w]=!1;function L(G){return n(G)&&t(G.length)&&!!z[e(G)]}return Hb=L,Hb}var Kb,sk;function n5(){if(sk)return Kb;sk=1;function e(t){return function(n){return t(n)}}return Kb=e,Kb}var Ku={exports:{}};Ku.exports;var ik;function uQ(){return ik||(ik=1,(function(e,t){var n=j3(),r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===r,o=i&&n.process,c=(function(){try{var d=a&&a.require&&a.require("util").types;return d||o&&o.binding&&o.binding("util")}catch{}})();e.exports=c})(Ku,Ku.exports)),Ku.exports}var Gb,ok;function r5(){if(ok)return Gb;ok=1;var e=cQ(),t=n5(),n=uQ(),r=n&&n.isTypedArray,a=r?t(r):e;return Gb=a,Gb}var Yb,lk;function dQ(){if(lk)return Yb;lk=1;var e=iQ(),t=cN(),n=_r(),r=t5(),a=uN(),i=r5(),o=Object.prototype,c=o.hasOwnProperty;function d(f,h){var p=n(f),g=!p&&t(f),y=!p&&!g&&r(f),j=!p&&!g&&!y&&i(f),w=p||g||y||j,x=w?e(f.length,String):[],S=x.length;for(var N in f)(h||c.call(f,N))&&!(w&&(N=="length"||y&&(N=="offset"||N=="parent")||j&&(N=="buffer"||N=="byteLength"||N=="byteOffset")||a(N,S)))&&x.push(N);return x}return Yb=d,Yb}var Xb,ck;function fQ(){if(ck)return Xb;ck=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,a=typeof r=="function"&&r.prototype||e;return n===a}return Xb=t,Xb}var Qb,uk;function a5(){if(uk)return Qb;uk=1;function e(t,n){return function(r){return t(n(r))}}return Qb=e,Qb}var Jb,dk;function pQ(){if(dk)return Jb;dk=1;var e=a5(),t=e(Object.keys,Object);return Jb=t,Jb}var Zb,fk;function hQ(){if(fk)return Zb;fk=1;var e=fQ(),t=pQ(),n=Object.prototype,r=n.hasOwnProperty;function a(i){if(!e(i))return t(i);var o=[];for(var c in Object(i))r.call(i,c)&&c!="constructor"&&o.push(c);return o}return Zb=a,Zb}var e0,pk;function ff(){if(pk)return e0;pk=1;var e=YS(),t=dN();function n(r){return r!=null&&t(r.length)&&!e(r)}return e0=n,e0}var t0,hk;function dv(){if(hk)return t0;hk=1;var e=dQ(),t=hQ(),n=ff();function r(a){return n(a)?e(a):t(a)}return t0=r,t0}var n0,mk;function mQ(){if(mk)return n0;mk=1;var e=nQ(),t=sQ(),n=dv();function r(a){return e(a,n,t)}return n0=r,n0}var r0,vk;function vQ(){if(vk)return r0;vk=1;var e=mQ(),t=1,n=Object.prototype,r=n.hasOwnProperty;function a(i,o,c,d,f,h){var p=c&t,g=e(i),y=g.length,j=e(o),w=j.length;if(y!=w&&!p)return!1;for(var x=y;x--;){var S=g[x];if(!(p?S in o:r.call(o,S)))return!1}var N=h.get(i),A=h.get(o);if(N&&A)return N==o&&A==i;var P=!0;h.set(i,o),h.set(o,i);for(var E=p;++x<y;){S=g[x];var O=i[S],k=o[S];if(d)var R=p?d(k,O,S,o,i,h):d(O,k,S,i,o,h);if(!(R===void 0?O===k||f(O,k,c,d,h):R)){P=!1;break}E||(E=S=="constructor")}if(P&&!E){var D=i.constructor,U=o.constructor;D!=U&&"constructor"in i&&"constructor"in o&&!(typeof D=="function"&&D instanceof D&&typeof U=="function"&&U instanceof U)&&(P=!1)}return h.delete(i),h.delete(o),P}return r0=a,r0}var a0,gk;function gQ(){if(gk)return a0;gk=1;var e=Fo(),t=cs(),n=e(t,"DataView");return a0=n,a0}var s0,yk;function yQ(){if(yk)return s0;yk=1;var e=Fo(),t=cs(),n=e(t,"Promise");return s0=n,s0}var i0,xk;function s5(){if(xk)return i0;xk=1;var e=Fo(),t=cs(),n=e(t,"Set");return i0=n,i0}var o0,bk;function xQ(){if(bk)return o0;bk=1;var e=Fo(),t=cs(),n=e(t,"WeakMap");return o0=n,o0}var l0,wk;function bQ(){if(wk)return l0;wk=1;var e=gQ(),t=QS(),n=yQ(),r=s5(),a=xQ(),i=Gs(),o=S3(),c="[object Map]",d="[object Object]",f="[object Promise]",h="[object Set]",p="[object WeakMap]",g="[object DataView]",y=o(e),j=o(t),w=o(n),x=o(r),S=o(a),N=i;return(e&&N(new e(new ArrayBuffer(1)))!=g||t&&N(new t)!=c||n&&N(n.resolve())!=f||r&&N(new r)!=h||a&&N(new a)!=p)&&(N=function(A){var P=i(A),E=P==d?A.constructor:void 0,O=E?o(E):"";if(O)switch(O){case y:return g;case j:return c;case w:return f;case x:return h;case S:return p}return P}),l0=N,l0}var c0,jk;function wQ(){if(jk)return c0;jk=1;var e=Y3(),t=Z3(),n=tQ(),r=vQ(),a=bQ(),i=_r(),o=t5(),c=r5(),d=1,f="[object Arguments]",h="[object Array]",p="[object Object]",g=Object.prototype,y=g.hasOwnProperty;function j(w,x,S,N,A,P){var E=i(w),O=i(x),k=E?h:a(w),R=O?h:a(x);k=k==f?p:k,R=R==f?p:R;var D=k==p,U=R==p,z=k==R;if(z&&o(w)){if(!o(x))return!1;E=!0,D=!1}if(z&&!D)return P||(P=new e),E||c(w)?t(w,x,S,N,A,P):n(w,x,k,S,N,A,P);if(!(S&d)){var L=D&&y.call(w,"__wrapped__"),G=U&&y.call(x,"__wrapped__");if(L||G){var q=L?w.value():w,H=G?x.value():x;return P||(P=new e),A(q,H,S,N,P)}}return z?(P||(P=new e),r(w,x,S,N,A,P)):!1}return c0=j,c0}var u0,Sk;function fN(){if(Sk)return u0;Sk=1;var e=wQ(),t=Ys();function n(r,a,i,o,c){return r===a?!0:r==null||a==null||!t(r)&&!t(a)?r!==r&&a!==a:e(r,a,i,o,n,c)}return u0=n,u0}var d0,Nk;function jQ(){if(Nk)return d0;Nk=1;var e=Y3(),t=fN(),n=1,r=2;function a(i,o,c,d){var f=c.length,h=f,p=!d;if(i==null)return!h;for(i=Object(i);f--;){var g=c[f];if(p&&g[2]?g[1]!==i[g[0]]:!(g[0]in i))return!1}for(;++f<h;){g=c[f];var y=g[0],j=i[y],w=g[1];if(p&&g[2]){if(j===void 0&&!(y in i))return!1}else{var x=new e;if(d)var S=d(j,w,y,i,o,x);if(!(S===void 0?t(w,j,n|r,d,x):S))return!1}}return!0}return d0=a,d0}var f0,Ck;function i5(){if(Ck)return f0;Ck=1;var e=zi();function t(n){return n===n&&!e(n)}return f0=t,f0}var p0,Ak;function SQ(){if(Ak)return p0;Ak=1;var e=i5(),t=dv();function n(r){for(var a=t(r),i=a.length;i--;){var o=a[i],c=r[o];a[i]=[o,c,e(c)]}return a}return p0=n,p0}var h0,Ek;function o5(){if(Ek)return h0;Ek=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return h0=e,h0}var m0,_k;function NQ(){if(_k)return m0;_k=1;var e=jQ(),t=SQ(),n=o5();function r(a){var i=t(a);return i.length==1&&i[0][2]?n(i[0][0],i[0][1]):function(o){return o===a||e(o,a,i)}}return m0=r,m0}var v0,Pk;function CQ(){if(Pk)return v0;Pk=1;function e(t,n){return t!=null&&n in Object(t)}return v0=e,v0}var g0,Ok;function AQ(){if(Ok)return g0;Ok=1;var e=A3(),t=cN(),n=_r(),r=uN(),a=dN(),i=iv();function o(c,d,f){d=e(d,c);for(var h=-1,p=d.length,g=!1;++h<p;){var y=i(d[h]);if(!(g=c!=null&&f(c,y)))break;c=c[y]}return g||++h!=p?g:(p=c==null?0:c.length,!!p&&a(p)&&r(y,p)&&(n(c)||t(c)))}return g0=o,g0}var y0,kk;function EQ(){if(kk)return y0;kk=1;var e=CQ(),t=AQ();function n(r,a){return r!=null&&t(r,a,e)}return y0=n,y0}var x0,Rk;function _Q(){if(Rk)return x0;Rk=1;var e=fN(),t=E3(),n=EQ(),r=GS(),a=i5(),i=o5(),o=iv(),c=1,d=2;function f(h,p){return r(h)&&a(p)?i(o(h),p):function(g){var y=t(g,h);return y===void 0&&y===p?n(g,h):e(p,y,c|d)}}return x0=f,x0}var b0,Tk;function zc(){if(Tk)return b0;Tk=1;function e(t){return t}return b0=e,b0}var w0,Ik;function PQ(){if(Ik)return w0;Ik=1;function e(t){return function(n){return n?.[t]}}return w0=e,w0}var j0,Mk;function OQ(){if(Mk)return j0;Mk=1;var e=eN();function t(n){return function(r){return e(r,n)}}return j0=t,j0}var S0,$k;function kQ(){if($k)return S0;$k=1;var e=PQ(),t=OQ(),n=GS(),r=iv();function a(i){return n(i)?e(r(i)):t(i)}return S0=a,S0}var N0,Dk;function us(){if(Dk)return N0;Dk=1;var e=NQ(),t=_Q(),n=zc(),r=_r(),a=kQ();function i(o){return typeof o=="function"?o:o==null?n:typeof o=="object"?r(o)?t(o[0],o[1]):e(o):a(o)}return N0=i,N0}var C0,Lk;function l5(){if(Lk)return C0;Lk=1;function e(t,n,r,a){for(var i=t.length,o=r+(a?1:-1);a?o--:++o<i;)if(n(t[o],o,t))return o;return-1}return C0=e,C0}var A0,Fk;function RQ(){if(Fk)return A0;Fk=1;function e(t){return t!==t}return A0=e,A0}var E0,Bk;function TQ(){if(Bk)return E0;Bk=1;function e(t,n,r){for(var a=r-1,i=t.length;++a<i;)if(t[a]===n)return a;return-1}return E0=e,E0}var _0,zk;function IQ(){if(zk)return _0;zk=1;var e=l5(),t=RQ(),n=TQ();function r(a,i,o){return i===i?n(a,i,o):e(a,t,o)}return _0=r,_0}var P0,Uk;function MQ(){if(Uk)return P0;Uk=1;var e=IQ();function t(n,r){var a=n==null?0:n.length;return!!a&&e(n,r,0)>-1}return P0=t,P0}var O0,qk;function $Q(){if(qk)return O0;qk=1;function e(t,n,r){for(var a=-1,i=t==null?0:t.length;++a<i;)if(r(n,t[a]))return!0;return!1}return O0=e,O0}var k0,Wk;function DQ(){if(Wk)return k0;Wk=1;function e(){}return k0=e,k0}var R0,Vk;function LQ(){if(Vk)return R0;Vk=1;var e=s5(),t=DQ(),n=lN(),r=1/0,a=e&&1/n(new e([,-0]))[1]==r?function(i){return new e(i)}:t;return R0=a,R0}var T0,Hk;function FQ(){if(Hk)return T0;Hk=1;var e=X3(),t=MQ(),n=$Q(),r=J3(),a=LQ(),i=lN(),o=200;function c(d,f,h){var p=-1,g=t,y=d.length,j=!0,w=[],x=w;if(h)j=!1,g=n;else if(y>=o){var S=f?null:a(d);if(S)return i(S);j=!1,g=r,x=new e}else x=f?[]:w;e:for(;++p<y;){var N=d[p],A=f?f(N):N;if(N=h||N!==0?N:0,j&&A===A){for(var P=x.length;P--;)if(x[P]===A)continue e;f&&x.push(A),w.push(N)}else g(x,A,h)||(x!==w&&x.push(A),w.push(N))}return w}return T0=c,T0}var I0,Kk;function BQ(){if(Kk)return I0;Kk=1;var e=us(),t=FQ();function n(r,a){return r&&r.length?t(r,e(a,2)):[]}return I0=n,I0}var zQ=BQ();const Gk=Yt(zQ);function c5(e,t,n){return t===!0?Gk(e,n):wt(t)?Gk(e,t):e}function nc(e){"@babel/helpers - typeof";return nc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nc(e)}var UQ=["ref"];function Yk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).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?Yk(Object(n),!0).forEach(function(r){fv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xk(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,d5(r.key),r)}}function WQ(e,t,n){return t&&Xk(e.prototype,t),n&&Xk(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function VQ(e,t,n){return t=Ah(t),HQ(e,u5()?Reflect.construct(t,n||[],Ah(e).constructor):t.apply(e,n))}function HQ(e,t){if(t&&(nc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return KQ(e)}function KQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(u5=function(){return!!e})()}function Ah(e){return Ah=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ah(e)}function GQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Y1(e,t)}function Y1(e,t){return Y1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Y1(e,t)}function fv(e,t,n){return t=d5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d5(e){var t=YQ(e,"string");return nc(t)=="symbol"?t:t+""}function YQ(e,t){if(nc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function XQ(e,t){if(e==null)return{};var n=QQ(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function QQ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function JQ(e){return e.value}function ZQ(e,t){if(W.isValidElement(e))return W.cloneElement(e,t);if(typeof e=="function")return W.createElement(e,t);t.ref;var n=XQ(t,UQ);return W.createElement(oN,n)}var Qk=1,Ul=(function(e){function t(){var n;qQ(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=VQ(this,t,[].concat(a)),fv(n,"lastBoundingBox",{width:-1,height:-1}),n}return GQ(t,e),WQ(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,a=this.getBBox();a?(Math.abs(a.width-this.lastBoundingBox.width)>Qk||Math.abs(a.height-this.lastBoundingBox.height)>Qk)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,r&&r(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?_s({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var a=this.props,i=a.layout,o=a.align,c=a.verticalAlign,d=a.margin,f=a.chartWidth,h=a.chartHeight,p,g;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&i==="vertical"){var y=this.getBBoxSnapshot();p={left:((f||0)-y.width)/2}}else p=o==="right"?{right:d&&d.right||0}:{left:d&&d.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(c==="middle"){var j=this.getBBoxSnapshot();g={top:((h||0)-j.height)/2}}else g=c==="bottom"?{bottom:d&&d.bottom||0}:{top:d&&d.top||0};return _s(_s({},p),g)}},{key:"render",value:function(){var r=this,a=this.props,i=a.content,o=a.width,c=a.height,d=a.wrapperStyle,f=a.payloadUniqBy,h=a.payload,p=_s(_s({position:"absolute",width:o||"auto",height:c||"auto"},this.getDefaultPosition(d)),d);return W.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(y){r.wrapperNode=y}},ZQ(i,_s(_s({},this.props),{},{payload:c5(h,f,JQ)})))}}],[{key:"getWithHeight",value:function(r,a){var i=_s(_s({},this.defaultProps),r.props),o=i.layout;return o==="vertical"&&De(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||a}:null}}])})(v.PureComponent);fv(Ul,"displayName","Legend");fv(Ul,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var M0,Jk;function eJ(){if(Jk)return M0;Jk=1;var e=uf(),t=cN(),n=_r(),r=e?e.isConcatSpreadable:void 0;function a(i){return n(i)||t(i)||!!(r&&i&&i[r])}return M0=a,M0}var $0,Zk;function f5(){if(Zk)return $0;Zk=1;var e=e5(),t=eJ();function n(r,a,i,o,c){var d=-1,f=r.length;for(i||(i=t),c||(c=[]);++d<f;){var h=r[d];a>0&&i(h)?a>1?n(h,a-1,i,o,c):e(c,h):o||(c[c.length]=h)}return c}return $0=n,$0}var D0,e2;function tJ(){if(e2)return D0;e2=1;function e(t){return function(n,r,a){for(var i=-1,o=Object(n),c=a(n),d=c.length;d--;){var f=c[t?d:++i];if(r(o[f],f,o)===!1)break}return n}}return D0=e,D0}var L0,t2;function nJ(){if(t2)return L0;t2=1;var e=tJ(),t=e();return L0=t,L0}var F0,n2;function p5(){if(n2)return F0;n2=1;var e=nJ(),t=dv();function n(r,a){return r&&e(r,a,t)}return F0=n,F0}var B0,r2;function rJ(){if(r2)return B0;r2=1;var e=ff();function t(n,r){return function(a,i){if(a==null)return a;if(!e(a))return n(a,i);for(var o=a.length,c=r?o:-1,d=Object(a);(r?c--:++c<o)&&i(d[c],c,d)!==!1;);return a}}return B0=t,B0}var z0,a2;function pN(){if(a2)return z0;a2=1;var e=p5(),t=rJ(),n=t(e);return z0=n,z0}var U0,s2;function h5(){if(s2)return U0;s2=1;var e=pN(),t=ff();function n(r,a){var i=-1,o=t(r)?Array(r.length):[];return e(r,function(c,d,f){o[++i]=a(c,d,f)}),o}return U0=n,U0}var q0,i2;function aJ(){if(i2)return q0;i2=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return q0=e,q0}var W0,o2;function sJ(){if(o2)return W0;o2=1;var e=Lc();function t(n,r){if(n!==r){var a=n!==void 0,i=n===null,o=n===n,c=e(n),d=r!==void 0,f=r===null,h=r===r,p=e(r);if(!f&&!p&&!c&&n>r||c&&d&&h&&!f&&!p||i&&d&&h||!a&&h||!o)return 1;if(!i&&!c&&!p&&n<r||p&&a&&o&&!i&&!c||f&&a&&o||!d&&o||!h)return-1}return 0}return W0=t,W0}var V0,l2;function iJ(){if(l2)return V0;l2=1;var e=sJ();function t(n,r,a){for(var i=-1,o=n.criteria,c=r.criteria,d=o.length,f=a.length;++i<d;){var h=e(o[i],c[i]);if(h){if(i>=f)return h;var p=a[i];return h*(p=="desc"?-1:1)}}return n.index-r.index}return V0=t,V0}var H0,c2;function oJ(){if(c2)return H0;c2=1;var e=ZS(),t=eN(),n=us(),r=h5(),a=aJ(),i=n5(),o=iJ(),c=zc(),d=_r();function f(h,p,g){p.length?p=e(p,function(w){return d(w)?function(x){return t(x,w.length===1?w[0]:w)}:w}):p=[c];var y=-1;p=e(p,i(n));var j=r(h,function(w,x,S){var N=e(p,function(A){return A(w)});return{criteria:N,index:++y,value:w}});return a(j,function(w,x){return o(w,x,g)})}return H0=f,H0}var K0,u2;function lJ(){if(u2)return K0;u2=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return K0=e,K0}var G0,d2;function cJ(){if(d2)return G0;d2=1;var e=lJ(),t=Math.max;function n(r,a,i){return a=t(a===void 0?r.length-1:a,0),function(){for(var o=arguments,c=-1,d=t(o.length-a,0),f=Array(d);++c<d;)f[c]=o[a+c];c=-1;for(var h=Array(a+1);++c<a;)h[c]=o[c];return h[a]=i(f),e(r,this,h)}}return G0=n,G0}var Y0,f2;function uJ(){if(f2)return Y0;f2=1;function e(t){return function(){return t}}return Y0=e,Y0}var X0,p2;function m5(){if(p2)return X0;p2=1;var e=Fo(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return X0=t,X0}var Q0,h2;function dJ(){if(h2)return Q0;h2=1;var e=uJ(),t=m5(),n=zc(),r=t?function(a,i){return t(a,"toString",{configurable:!0,enumerable:!1,value:e(i),writable:!0})}:n;return Q0=r,Q0}var J0,m2;function fJ(){if(m2)return J0;m2=1;var e=800,t=16,n=Date.now;function r(a){var i=0,o=0;return function(){var c=n(),d=t-(c-o);if(o=c,d>0){if(++i>=e)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return J0=r,J0}var Z0,v2;function pJ(){if(v2)return Z0;v2=1;var e=dJ(),t=fJ(),n=t(e);return Z0=n,Z0}var ew,g2;function hJ(){if(g2)return ew;g2=1;var e=zc(),t=cJ(),n=pJ();function r(a,i){return n(t(a,i,e),a+"")}return ew=r,ew}var tw,y2;function pv(){if(y2)return tw;y2=1;var e=XS(),t=ff(),n=uN(),r=zi();function a(i,o,c){if(!r(c))return!1;var d=typeof o;return(d=="number"?t(c)&&n(o,c.length):d=="string"&&o in c)?e(c[o],i):!1}return tw=a,tw}var nw,x2;function mJ(){if(x2)return nw;x2=1;var e=f5(),t=oJ(),n=hJ(),r=pv(),a=n(function(i,o){if(i==null)return[];var c=o.length;return c>1&&r(i,o[0],o[1])?o=[]:c>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),t(i,e(o,1),[])});return nw=a,nw}var vJ=mJ();const hN=Yt(vJ);function vd(e){"@babel/helpers - typeof";return vd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vd(e)}function X1(){return X1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},X1.apply(this,arguments)}function gJ(e,t){return wJ(e)||bJ(e,t)||xJ(e,t)||yJ()}function yJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
60
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xJ(e,t){if(e){if(typeof e=="string")return b2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b2(e,t)}}function b2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function bJ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function wJ(e){if(Array.isArray(e))return e}function w2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function rw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?w2(Object(n),!0).forEach(function(r){jJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jJ(e,t,n){return t=SJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SJ(e){var t=NJ(e,"string");return vd(t)=="symbol"?t:t+""}function NJ(e,t){if(vd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(vd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function CJ(e){return Array.isArray(e)&&Fn(e[0])&&Fn(e[1])?e.join(" ~ "):e}var AJ=function(t){var n=t.separator,r=n===void 0?" : ":n,a=t.contentStyle,i=a===void 0?{}:a,o=t.itemStyle,c=o===void 0?{}:o,d=t.labelStyle,f=d===void 0?{}:d,h=t.payload,p=t.formatter,g=t.itemSorter,y=t.wrapperClassName,j=t.labelClassName,w=t.label,x=t.labelFormatter,S=t.accessibilityLayer,N=S===void 0?!1:S,A=function(){if(h&&h.length){var L={padding:0,margin:0},G=(g?hN(h,g):h).map(function(q,H){if(q.type==="none")return null;var X=rw({display:"block",paddingTop:4,paddingBottom:4,color:q.color||"#000"},c),Z=q.formatter||p||CJ,I=q.value,F=q.name,Q=I,B=F;if(Z&&Q!=null&&B!=null){var $=Z(I,F,q,H,h);if(Array.isArray($)){var ee=gJ($,2);Q=ee[0],B=ee[1]}else Q=$}return W.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(H),style:X},Fn(B)?W.createElement("span",{className:"recharts-tooltip-item-name"},B):null,Fn(B)?W.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,W.createElement("span",{className:"recharts-tooltip-item-value"},Q),W.createElement("span",{className:"recharts-tooltip-item-unit"},q.unit||""))});return W.createElement("ul",{className:"recharts-tooltip-item-list",style:L},G)}return null},P=rw({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),E=rw({margin:0},f),O=!jt(w),k=O?w:"",R=St("recharts-default-tooltip",y),D=St("recharts-tooltip-label",j);O&&x&&h!==void 0&&h!==null&&(k=x(w,h));var U=N?{role:"status","aria-live":"assertive"}:{};return W.createElement("div",X1({className:R,style:P},U),W.createElement("p",{className:D,style:E},W.isValidElement(k)?k:"".concat(k)),A())};function gd(e){"@babel/helpers - typeof";return gd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gd(e)}function Bp(e,t,n){return t=EJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EJ(e){var t=_J(e,"string");return gd(t)=="symbol"?t:t+""}function _J(e,t){if(gd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(gd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Tu="recharts-tooltip-wrapper",PJ={visibility:"hidden"};function OJ(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return St(Tu,Bp(Bp(Bp(Bp({},"".concat(Tu,"-right"),De(n)&&t&&De(t.x)&&n>=t.x),"".concat(Tu,"-left"),De(n)&&t&&De(t.x)&&n<t.x),"".concat(Tu,"-bottom"),De(r)&&t&&De(t.y)&&r>=t.y),"".concat(Tu,"-top"),De(r)&&t&&De(t.y)&&r<t.y))}function j2(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,a=e.offsetTopLeft,i=e.position,o=e.reverseDirection,c=e.tooltipDimension,d=e.viewBox,f=e.viewBoxDimension;if(i&&De(i[r]))return i[r];var h=n[r]-c-a,p=n[r]+a;if(t[r])return o[r]?h:p;if(o[r]){var g=h,y=d[r];return g<y?Math.max(p,d[r]):Math.max(h,d[r])}var j=p+c,w=d[r]+f;return j>w?Math.max(h,d[r]):Math.max(p,d[r])}function kJ(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 RJ(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,a=e.position,i=e.reverseDirection,o=e.tooltipBox,c=e.useTranslate3d,d=e.viewBox,f,h,p;return o.height>0&&o.width>0&&n?(h=j2({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:d,viewBoxDimension:d.width}),p=j2({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:d,viewBoxDimension:d.height}),f=kJ({translateX:h,translateY:p,useTranslate3d:c})):f=PJ,{cssProperties:f,cssClasses:OJ({translateX:h,translateY:p,coordinate:n})}}function rc(e){"@babel/helpers - typeof";return rc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rc(e)}function S2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).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?S2(Object(n),!0).forEach(function(r){J1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IJ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,g5(r.key),r)}}function MJ(e,t,n){return t&&IJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $J(e,t,n){return t=Eh(t),DJ(e,v5()?Reflect.construct(t,n||[],Eh(e).constructor):t.apply(e,n))}function DJ(e,t){if(t&&(rc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return LJ(e)}function LJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(v5=function(){return!!e})()}function Eh(e){return Eh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Eh(e)}function FJ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Q1(e,t)}function Q1(e,t){return Q1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Q1(e,t)}function J1(e,t,n){return t=g5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g5(e){var t=BJ(e,"string");return rc(t)=="symbol"?t:t+""}function BJ(e,t){if(rc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(rc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var C2=1,zJ=(function(e){function t(){var n;TJ(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=$J(this,t,[].concat(a)),J1(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),J1(n,"handleKeyDown",function(o){if(o.key==="Escape"){var c,d,f,h;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(c=(d=n.props.coordinate)===null||d===void 0?void 0:d.x)!==null&&c!==void 0?c:0,y:(f=(h=n.props.coordinate)===null||h===void 0?void 0:h.y)!==null&&f!==void 0?f:0}})}}),n}return FJ(t,e),MJ(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>C2||Math.abs(r.height-this.state.lastBoundingBox.height)>C2)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,c=a.animationDuration,d=a.animationEasing,f=a.children,h=a.coordinate,p=a.hasPayload,g=a.isAnimationActive,y=a.offset,j=a.position,w=a.reverseDirection,x=a.useTranslate3d,S=a.viewBox,N=a.wrapperStyle,A=RJ({allowEscapeViewBox:o,coordinate:h,offsetTopLeft:y,position:j,reverseDirection:w,tooltipBox:this.state.lastBoundingBox,useTranslate3d:x,viewBox:S}),P=A.cssClasses,E=A.cssProperties,O=N2(N2({transition:g&&i?"transform ".concat(c,"ms ").concat(d):void 0},E),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&p?"visible":"hidden",position:"absolute",top:0,left:0},N);return W.createElement("div",{tabIndex:-1,className:P,style:O,ref:function(R){r.wrapperNode=R}},f)}}])})(v.PureComponent),UJ=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Bo={isSsr:UJ()};function ac(e){"@babel/helpers - typeof";return ac=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ac(e)}function A2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function E2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?A2(Object(n),!0).forEach(function(r){mN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WJ(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,x5(r.key),r)}}function VJ(e,t,n){return t&&WJ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function HJ(e,t,n){return t=_h(t),KJ(e,y5()?Reflect.construct(t,n||[],_h(e).constructor):t.apply(e,n))}function KJ(e,t){if(t&&(ac(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return GJ(e)}function GJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(y5=function(){return!!e})()}function _h(e){return _h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_h(e)}function YJ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Z1(e,t)}function Z1(e,t){return Z1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Z1(e,t)}function mN(e,t,n){return t=x5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x5(e){var t=XJ(e,"string");return ac(t)=="symbol"?t:t+""}function XJ(e,t){if(ac(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ac(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function QJ(e){return e.dataKey}function JJ(e,t){return W.isValidElement(e)?W.cloneElement(e,t):typeof e=="function"?W.createElement(e,t):W.createElement(AJ,t)}var Ur=(function(e){function t(){return qJ(this,t),HJ(this,t,arguments)}return YJ(t,e),VJ(t,[{key:"render",value:function(){var r=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,c=a.animationDuration,d=a.animationEasing,f=a.content,h=a.coordinate,p=a.filterNull,g=a.isAnimationActive,y=a.offset,j=a.payload,w=a.payloadUniqBy,x=a.position,S=a.reverseDirection,N=a.useTranslate3d,A=a.viewBox,P=a.wrapperStyle,E=j??[];p&&E.length&&(E=c5(j.filter(function(k){return k.value!=null&&(k.hide!==!0||r.props.includeHidden)}),w,QJ));var O=E.length>0;return W.createElement(zJ,{allowEscapeViewBox:o,animationDuration:c,animationEasing:d,isAnimationActive:g,active:i,coordinate:h,hasPayload:O,offset:y,position:x,reverseDirection:S,useTranslate3d:N,viewBox:A,wrapperStyle:P},JJ(f,E2(E2({},this.props),{},{payload:E})))}}])})(v.PureComponent);mN(Ur,"displayName","Tooltip");mN(Ur,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Bo.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var aw,_2;function ZJ(){if(_2)return aw;_2=1;var e=cs(),t=function(){return e.Date.now()};return aw=t,aw}var sw,P2;function eZ(){if(P2)return sw;P2=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return sw=t,sw}var iw,O2;function tZ(){if(O2)return iw;O2=1;var e=eZ(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return iw=n,iw}var ow,k2;function b5(){if(k2)return ow;k2=1;var e=tZ(),t=zi(),n=Lc(),r=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,c=parseInt;function d(f){if(typeof f=="number")return f;if(n(f))return r;if(t(f)){var h=typeof f.valueOf=="function"?f.valueOf():f;f=t(h)?h+"":h}if(typeof f!="string")return f===0?f:+f;f=e(f);var p=i.test(f);return p||o.test(f)?c(f.slice(2),p?2:8):a.test(f)?r:+f}return ow=d,ow}var lw,R2;function nZ(){if(R2)return lw;R2=1;var e=zi(),t=ZJ(),n=b5(),r="Expected a function",a=Math.max,i=Math.min;function o(c,d,f){var h,p,g,y,j,w,x=0,S=!1,N=!1,A=!0;if(typeof c!="function")throw new TypeError(r);d=n(d)||0,e(f)&&(S=!!f.leading,N="maxWait"in f,g=N?a(n(f.maxWait)||0,d):g,A="trailing"in f?!!f.trailing:A);function P(G){var q=h,H=p;return h=p=void 0,x=G,y=c.apply(H,q),y}function E(G){return x=G,j=setTimeout(R,d),S?P(G):y}function O(G){var q=G-w,H=G-x,X=d-q;return N?i(X,g-H):X}function k(G){var q=G-w,H=G-x;return w===void 0||q>=d||q<0||N&&H>=g}function R(){var G=t();if(k(G))return D(G);j=setTimeout(R,O(G))}function D(G){return j=void 0,A&&h?P(G):(h=p=void 0,y)}function U(){j!==void 0&&clearTimeout(j),x=0,h=w=p=j=void 0}function z(){return j===void 0?y:D(t())}function L(){var G=t(),q=k(G);if(h=arguments,p=this,w=G,q){if(j===void 0)return E(w);if(N)return clearTimeout(j),j=setTimeout(R,d),P(w)}return j===void 0&&(j=setTimeout(R,d)),y}return L.cancel=U,L.flush=z,L}return lw=o,lw}var cw,T2;function rZ(){if(T2)return cw;T2=1;var e=nZ(),t=zi(),n="Expected a function";function r(a,i,o){var c=!0,d=!0;if(typeof a!="function")throw new TypeError(n);return t(o)&&(c="leading"in o?!!o.leading:c,d="trailing"in o?!!o.trailing:d),e(a,i,{leading:c,maxWait:i,trailing:d})}return cw=r,cw}var aZ=rZ();const w5=Yt(aZ);function yd(e){"@babel/helpers - typeof";return yd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yd(e)}function I2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function zp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?I2(Object(n),!0).forEach(function(r){sZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sZ(e,t,n){return t=iZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iZ(e){var t=oZ(e,"string");return yd(t)=="symbol"?t:t+""}function oZ(e,t){if(yd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(yd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lZ(e,t){return fZ(e)||dZ(e,t)||uZ(e,t)||cZ()}function cZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
61
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uZ(e,t){if(e){if(typeof e=="string")return M2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return M2(e,t)}}function M2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function dZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function fZ(e){if(Array.isArray(e))return e}var ej=v.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,a=r===void 0?{width:-1,height:-1}:r,i=e.width,o=i===void 0?"100%":i,c=e.height,d=c===void 0?"100%":c,f=e.minWidth,h=f===void 0?0:f,p=e.minHeight,g=e.maxHeight,y=e.children,j=e.debounce,w=j===void 0?0:j,x=e.id,S=e.className,N=e.onResize,A=e.style,P=A===void 0?{}:A,E=v.useRef(null),O=v.useRef();O.current=N,v.useImperativeHandle(t,function(){return Object.defineProperty(E.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),E.current},configurable:!0})});var k=v.useState({containerWidth:a.width,containerHeight:a.height}),R=lZ(k,2),D=R[0],U=R[1],z=v.useCallback(function(G,q){U(function(H){var X=Math.round(G),Z=Math.round(q);return H.containerWidth===X&&H.containerHeight===Z?H:{containerWidth:X,containerHeight:Z}})},[]);v.useEffect(function(){var G=function(F){var Q,B=F[0].contentRect,$=B.width,ee=B.height;z($,ee),(Q=O.current)===null||Q===void 0||Q.call(O,$,ee)};w>0&&(G=w5(G,w,{trailing:!0,leading:!1}));var q=new ResizeObserver(G),H=E.current.getBoundingClientRect(),X=H.width,Z=H.height;return z(X,Z),q.observe(E.current),function(){q.disconnect()}},[z,w]);var L=v.useMemo(function(){var G=D.containerWidth,q=D.containerHeight;if(G<0||q<0)return null;Ds(go(o)||go(d),`The width(%s) and height(%s) are both fixed numbers,
|
|
62
|
+
maybe you don't need to use a ResponsiveContainer.`,o,d),Ds(!n||n>0,"The aspect(%s) must be greater than zero.",n);var H=go(o)?G:o,X=go(d)?q:d;n&&n>0&&(H?X=H/n:X&&(H=X*n),g&&X>g&&(X=g)),Ds(H>0||X>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
63
|
+
please check the style of container, or the props width(%s) and height(%s),
|
|
64
|
+
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
65
|
+
height and width.`,H,X,o,d,h,p,n);var Z=!Array.isArray(y)&&$s(y.type).endsWith("Chart");return W.Children.map(y,function(I){return W.isValidElement(I)?v.cloneElement(I,zp({width:H,height:X},Z?{style:zp({height:"100%",width:"100%",maxHeight:X,maxWidth:H},I.props.style)}:{})):I})},[n,y,d,g,p,h,D,o]);return W.createElement("div",{id:x?"".concat(x):void 0,className:St("recharts-responsive-container",S),style:zp(zp({},P),{},{width:o,height:d,minWidth:h,minHeight:p,maxHeight:g}),ref:E},L)}),hv=function(t){return null};hv.displayName="Cell";function xd(e){"@babel/helpers - typeof";return xd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xd(e)}function $2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function tj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$2(Object(n),!0).forEach(function(r){pZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pZ(e,t,n){return t=hZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hZ(e){var t=mZ(e,"string");return xd(t)=="symbol"?t:t+""}function mZ(e,t){if(xd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jl={widthCache:{},cacheCount:0},vZ=2e3,gZ={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},D2="recharts_measurement_span";function yZ(e){var t=tj({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var Zu=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Bo.isSsr)return{width:0,height:0};var r=yZ(n),a=JSON.stringify({text:t,copyStyle:r});if(jl.widthCache[a])return jl.widthCache[a];try{var i=document.getElementById(D2);i||(i=document.createElement("span"),i.setAttribute("id",D2),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=tj(tj({},gZ),r);Object.assign(i.style,o),i.textContent="".concat(t);var c=i.getBoundingClientRect(),d={width:c.width,height:c.height};return jl.widthCache[a]=d,++jl.cacheCount>vZ&&(jl.cacheCount=0,jl.widthCache={}),d}catch{return{width:0,height:0}}},xZ=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function bd(e){"@babel/helpers - typeof";return bd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bd(e)}function Ph(e,t){return SZ(e)||jZ(e,t)||wZ(e,t)||bZ()}function bZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
66
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wZ(e,t){if(e){if(typeof e=="string")return L2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return L2(e,t)}}function L2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;d=!1}else for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function SZ(e){if(Array.isArray(e))return e}function NZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F2(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,AZ(r.key),r)}}function CZ(e,t,n){return t&&F2(e.prototype,t),n&&F2(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function AZ(e){var t=EZ(e,"string");return bd(t)=="symbol"?t:t+""}function EZ(e,t){if(bd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(bd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var B2=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,z2=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,_Z=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,PZ=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,j5={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},OZ=Object.keys(j5),Ol="NaN";function kZ(e,t){return e*j5[t]}var Up=(function(){function e(t,n){NZ(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!_Z.test(n)&&(this.num=NaN,this.unit=""),OZ.includes(n)&&(this.num=kZ(t,n),this.unit="px")}return CZ(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,a=(r=PZ.exec(n))!==null&&r!==void 0?r:[],i=Ph(a,3),o=i[1],c=i[2];return new e(parseFloat(o),c??"")}}])})();function S5(e){if(e.includes(Ol))return Ol;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=B2.exec(t))!==null&&n!==void 0?n:[],a=Ph(r,4),i=a[1],o=a[2],c=a[3],d=Up.parse(i??""),f=Up.parse(c??""),h=o==="*"?d.multiply(f):d.divide(f);if(h.isNaN())return Ol;t=t.replace(B2,h.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,g=(p=z2.exec(t))!==null&&p!==void 0?p:[],y=Ph(g,4),j=y[1],w=y[2],x=y[3],S=Up.parse(j??""),N=Up.parse(x??""),A=w==="+"?S.add(N):S.subtract(N);if(A.isNaN())return Ol;t=t.replace(z2,A.toString())}return t}var U2=/\(([^()]*)\)/;function RZ(e){for(var t=e;t.includes("(");){var n=U2.exec(t),r=Ph(n,2),a=r[1];t=t.replace(U2,S5(a))}return t}function TZ(e){var t=e.replace(/\s+/g,"");return t=RZ(t),t=S5(t),t}function IZ(e){try{return TZ(e)}catch{return Ol}}function uw(e){var t=IZ(e.slice(5,-1));return t===Ol?"":t}var MZ=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],$Z=["dx","dy","angle","className","breakAll"];function nj(){return nj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nj.apply(this,arguments)}function q2(e,t){if(e==null)return{};var n=DZ(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function DZ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function W2(e,t){return zZ(e)||BZ(e,t)||FZ(e,t)||LZ()}function LZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
67
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FZ(e,t){if(e){if(typeof e=="string")return V2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return V2(e,t)}}function V2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function BZ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;d=!1}else for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function zZ(e){if(Array.isArray(e))return e}var N5=/[ \f\n\r\t\v\u2028\u2029]+/,C5=function(t){var n=t.children,r=t.breakAll,a=t.style;try{var i=[];jt(n)||(r?i=n.toString().split(""):i=n.toString().split(N5));var o=i.map(function(d){return{word:d,width:Zu(d,a).width}}),c=r?0:Zu(" ",a).width;return{wordsWithComputedWidth:o,spaceWidth:c}}catch{return null}},UZ=function(t,n,r,a,i){var o=t.maxLines,c=t.children,d=t.style,f=t.breakAll,h=De(o),p=c,g=function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return H.reduce(function(X,Z){var I=Z.word,F=Z.width,Q=X[X.length-1];if(Q&&(a==null||i||Q.width+F+r<Number(a)))Q.words.push(I),Q.width+=F+r;else{var B={words:[I],width:F};X.push(B)}return X},[])},y=g(n),j=function(H){return H.reduce(function(X,Z){return X.width>Z.width?X:Z})};if(!h)return y;for(var w="…",x=function(H){var X=p.slice(0,H),Z=C5({breakAll:f,style:d,children:X+w}).wordsWithComputedWidth,I=g(Z),F=I.length>o||j(I).width>Number(a);return[F,I]},S=0,N=p.length-1,A=0,P;S<=N&&A<=p.length-1;){var E=Math.floor((S+N)/2),O=E-1,k=x(O),R=W2(k,2),D=R[0],U=R[1],z=x(E),L=W2(z,1),G=L[0];if(!D&&!G&&(S=E+1),D&&G&&(N=E-1),!D&&G){P=U;break}A++}return P||y},H2=function(t){var n=jt(t)?[]:t.toString().split(N5);return[{words:n}]},qZ=function(t){var n=t.width,r=t.scaleToFit,a=t.children,i=t.style,o=t.breakAll,c=t.maxLines;if((n||r)&&!Bo.isSsr){var d,f,h=C5({breakAll:o,children:a,style:i});if(h){var p=h.wordsWithComputedWidth,g=h.spaceWidth;d=p,f=g}else return H2(a);return UZ({breakAll:o,children:a,maxLines:c,style:i},d,f,n,r)}return H2(a)},K2="#808080",Po=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,i=a===void 0?0:a,o=t.lineHeight,c=o===void 0?"1em":o,d=t.capHeight,f=d===void 0?"0.71em":d,h=t.scaleToFit,p=h===void 0?!1:h,g=t.textAnchor,y=g===void 0?"start":g,j=t.verticalAnchor,w=j===void 0?"end":j,x=t.fill,S=x===void 0?K2:x,N=q2(t,MZ),A=v.useMemo(function(){return qZ({breakAll:N.breakAll,children:N.children,maxLines:N.maxLines,scaleToFit:p,style:N.style,width:N.width})},[N.breakAll,N.children,N.maxLines,p,N.style,N.width]),P=N.dx,E=N.dy,O=N.angle,k=N.className,R=N.breakAll,D=q2(N,$Z);if(!Fn(r)||!Fn(i))return null;var U=r+(De(P)?P:0),z=i+(De(E)?E:0),L;switch(w){case"start":L=uw("calc(".concat(f,")"));break;case"middle":L=uw("calc(".concat((A.length-1)/2," * -").concat(c," + (").concat(f," / 2))"));break;default:L=uw("calc(".concat(A.length-1," * -").concat(c,")"));break}var G=[];if(p){var q=A[0].width,H=N.width;G.push("scale(".concat((De(H)?H/q:1)/q,")"))}return O&&G.push("rotate(".concat(O,", ").concat(U,", ").concat(z,")")),G.length&&(D.transform=G.join(" ")),W.createElement("text",nj({},ht(D,!0),{x:U,y:z,className:St("recharts-text",k),textAnchor:y,fill:S.includes("url")?K2:S}),A.map(function(X,Z){var I=X.words.join(R?"":" ");return W.createElement("tspan",{x:U,dy:Z===0?L:c,key:"".concat(I,"-").concat(Z)},I)}))};function Oi(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function WZ(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function vN(e){let t,n,r;e.length!==2?(t=Oi,n=(c,d)=>Oi(e(c),d),r=(c,d)=>e(c)-d):(t=e===Oi||e===WZ?e:VZ,n=e,r=e);function a(c,d,f=0,h=c.length){if(f<h){if(t(d,d)!==0)return h;do{const p=f+h>>>1;n(c[p],d)<0?f=p+1:h=p}while(f<h)}return f}function i(c,d,f=0,h=c.length){if(f<h){if(t(d,d)!==0)return h;do{const p=f+h>>>1;n(c[p],d)<=0?f=p+1:h=p}while(f<h)}return f}function o(c,d,f=0,h=c.length){const p=a(c,d,f,h-1);return p>f&&r(c[p-1],d)>-r(c[p],d)?p-1:p}return{left:a,center:o,right:i}}function VZ(){return 0}function A5(e){return e===null?NaN:+e}function*HZ(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const KZ=vN(Oi),pf=KZ.right;vN(A5).center;class G2 extends Map{constructor(t,n=XZ){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,a]of t)this.set(r,a)}get(t){return super.get(Y2(this,t))}has(t){return super.has(Y2(this,t))}set(t,n){return super.set(GZ(this,t),n)}delete(t){return super.delete(YZ(this,t))}}function Y2({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function GZ({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function YZ({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function XZ(e){return e!==null&&typeof e=="object"?e.valueOf():e}function QZ(e=Oi){if(e===Oi)return E5;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 E5(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const JZ=Math.sqrt(50),ZZ=Math.sqrt(10),eee=Math.sqrt(2);function Oh(e,t,n){const r=(t-e)/Math.max(0,n),a=Math.floor(Math.log10(r)),i=r/Math.pow(10,a),o=i>=JZ?10:i>=ZZ?5:i>=eee?2:1;let c,d,f;return a<0?(f=Math.pow(10,-a)/o,c=Math.round(e*f),d=Math.round(t*f),c/f<e&&++c,d/f>t&&--d,f=-f):(f=Math.pow(10,a)*o,c=Math.round(e/f),d=Math.round(t/f),c*f<e&&++c,d*f>t&&--d),d<c&&.5<=n&&n<2?Oh(e,t,n*2):[c,d,f]}function rj(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[a,i,o]=r?Oh(t,e,n):Oh(e,t,n);if(!(i>=a))return[];const c=i-a+1,d=new Array(c);if(r)if(o<0)for(let f=0;f<c;++f)d[f]=(i-f)/-o;else for(let f=0;f<c;++f)d[f]=(i-f)*o;else if(o<0)for(let f=0;f<c;++f)d[f]=(a+f)/-o;else for(let f=0;f<c;++f)d[f]=(a+f)*o;return d}function aj(e,t,n){return t=+t,e=+e,n=+n,Oh(e,t,n)[2]}function sj(e,t,n){t=+t,e=+e,n=+n;const r=t<e,a=r?aj(t,e,n):aj(e,t,n);return(r?-1:1)*(a<0?1/-a:a)}function X2(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function Q2(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function _5(e,t,n=0,r=1/0,a){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(a=a===void 0?E5:QZ(a);r>n;){if(r-n>600){const d=r-n+1,f=t-n+1,h=Math.log(d),p=.5*Math.exp(2*h/3),g=.5*Math.sqrt(h*p*(d-p)/d)*(f-d/2<0?-1:1),y=Math.max(n,Math.floor(t-f*p/d+g)),j=Math.min(r,Math.floor(t+(d-f)*p/d+g));_5(e,t,y,j,a)}const i=e[t];let o=n,c=r;for(Iu(e,n,t),a(e[r],i)>0&&Iu(e,n,r);o<c;){for(Iu(e,o,c),++o,--c;a(e[o],i)<0;)++o;for(;a(e[c],i)>0;)--c}a(e[n],i)===0?Iu(e,n,c):(++c,Iu(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function Iu(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function tee(e,t,n){if(e=Float64Array.from(HZ(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Q2(e);if(t>=1)return X2(e);var r,a=(r-1)*t,i=Math.floor(a),o=X2(_5(e,i).subarray(0,i+1)),c=Q2(e.subarray(i+1));return o+(c-o)*(a-i)}}function nee(e,t,n=A5){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,a=(r-1)*t,i=Math.floor(a),o=+n(e[i],i,e),c=+n(e[i+1],i+1,e);return o+(c-o)*(a-i)}}function ree(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(a);++r<a;)i[r]=e+r*n;return i}function ya(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Xs(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 ij=Symbol("implicit");function gN(){var e=new G2,t=[],n=[],r=ij;function a(i){let o=e.get(i);if(o===void 0){if(r!==ij)return r;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return a.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new G2;for(const o of i)e.has(o)||e.set(o,t.push(o)-1);return a},a.range=function(i){return arguments.length?(n=Array.from(i),a):n.slice()},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return gN(t,n).unknown(r)},ya.apply(a,arguments),a}function wd(){var e=gN().unknown(void 0),t=e.domain,n=e.range,r=0,a=1,i,o,c=!1,d=0,f=0,h=.5;delete e.unknown;function p(){var g=t().length,y=a<r,j=y?a:r,w=y?r:a;i=(w-j)/Math.max(1,g-d+f*2),c&&(i=Math.floor(i)),j+=(w-j-i*(g-d))*h,o=i*(1-d),c&&(j=Math.round(j),o=Math.round(o));var x=ree(g).map(function(S){return j+i*S});return n(y?x.reverse():x)}return e.domain=function(g){return arguments.length?(t(g),p()):t()},e.range=function(g){return arguments.length?([r,a]=g,r=+r,a=+a,p()):[r,a]},e.rangeRound=function(g){return[r,a]=g,r=+r,a=+a,c=!0,p()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(g){return arguments.length?(c=!!g,p()):c},e.padding=function(g){return arguments.length?(d=Math.min(1,f=+g),p()):d},e.paddingInner=function(g){return arguments.length?(d=Math.min(1,g),p()):d},e.paddingOuter=function(g){return arguments.length?(f=+g,p()):f},e.align=function(g){return arguments.length?(h=Math.max(0,Math.min(1,g)),p()):h},e.copy=function(){return wd(t(),[r,a]).round(c).paddingInner(d).paddingOuter(f).align(h)},ya.apply(p(),arguments)}function P5(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return P5(t())},e}function ed(){return P5(wd.apply(null,arguments).paddingInner(1))}function yN(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function O5(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function hf(){}var jd=.7,kh=1/jd,ql="\\s*([+-]?\\d+)\\s*",Sd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",rs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",aee=/^#([0-9a-f]{3,8})$/,see=new RegExp(`^rgb\\(${ql},${ql},${ql}\\)$`),iee=new RegExp(`^rgb\\(${rs},${rs},${rs}\\)$`),oee=new RegExp(`^rgba\\(${ql},${ql},${ql},${Sd}\\)$`),lee=new RegExp(`^rgba\\(${rs},${rs},${rs},${Sd}\\)$`),cee=new RegExp(`^hsl\\(${Sd},${rs},${rs}\\)$`),uee=new RegExp(`^hsla\\(${Sd},${rs},${rs},${Sd}\\)$`),J2={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};yN(hf,Nd,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Z2,formatHex:Z2,formatHex8:dee,formatHsl:fee,formatRgb:eR,toString:eR});function Z2(){return this.rgb().formatHex()}function dee(){return this.rgb().formatHex8()}function fee(){return k5(this).formatHsl()}function eR(){return this.rgb().formatRgb()}function Nd(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=aee.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?tR(t):n===3?new Er(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?qp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?qp(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=see.exec(e))?new Er(t[1],t[2],t[3],1):(t=iee.exec(e))?new Er(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=oee.exec(e))?qp(t[1],t[2],t[3],t[4]):(t=lee.exec(e))?qp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=cee.exec(e))?aR(t[1],t[2]/100,t[3]/100,1):(t=uee.exec(e))?aR(t[1],t[2]/100,t[3]/100,t[4]):J2.hasOwnProperty(e)?tR(J2[e]):e==="transparent"?new Er(NaN,NaN,NaN,0):null}function tR(e){return new Er(e>>16&255,e>>8&255,e&255,1)}function qp(e,t,n,r){return r<=0&&(e=t=n=NaN),new Er(e,t,n,r)}function pee(e){return e instanceof hf||(e=Nd(e)),e?(e=e.rgb(),new Er(e.r,e.g,e.b,e.opacity)):new Er}function oj(e,t,n,r){return arguments.length===1?pee(e):new Er(e,t,n,r??1)}function Er(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}yN(Er,oj,O5(hf,{brighter(e){return e=e==null?kh:Math.pow(kh,e),new Er(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?jd:Math.pow(jd,e),new Er(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Er(jo(this.r),jo(this.g),jo(this.b),Rh(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:nR,formatHex:nR,formatHex8:hee,formatRgb:rR,toString:rR}));function nR(){return`#${yo(this.r)}${yo(this.g)}${yo(this.b)}`}function hee(){return`#${yo(this.r)}${yo(this.g)}${yo(this.b)}${yo((isNaN(this.opacity)?1:this.opacity)*255)}`}function rR(){const e=Rh(this.opacity);return`${e===1?"rgb(":"rgba("}${jo(this.r)}, ${jo(this.g)}, ${jo(this.b)}${e===1?")":`, ${e})`}`}function Rh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function jo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function yo(e){return e=jo(e),(e<16?"0":"")+e.toString(16)}function aR(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Da(e,t,n,r)}function k5(e){if(e instanceof Da)return new Da(e.h,e.s,e.l,e.opacity);if(e instanceof hf||(e=Nd(e)),!e)return new Da;if(e instanceof Da)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),i=Math.max(t,n,r),o=NaN,c=i-a,d=(i+a)/2;return c?(t===i?o=(n-r)/c+(n<r)*6:n===i?o=(r-t)/c+2:o=(t-n)/c+4,c/=d<.5?i+a:2-i-a,o*=60):c=d>0&&d<1?0:o,new Da(o,c,d,e.opacity)}function mee(e,t,n,r){return arguments.length===1?k5(e):new Da(e,t,n,r??1)}function Da(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}yN(Da,mee,O5(hf,{brighter(e){return e=e==null?kh:Math.pow(kh,e),new Da(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?jd:Math.pow(jd,e),new Da(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,a=2*n-r;return new Er(dw(e>=240?e-240:e+120,a,r),dw(e,a,r),dw(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Da(sR(this.h),Wp(this.s),Wp(this.l),Rh(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=Rh(this.opacity);return`${e===1?"hsl(":"hsla("}${sR(this.h)}, ${Wp(this.s)*100}%, ${Wp(this.l)*100}%${e===1?")":`, ${e})`}`}}));function sR(e){return e=(e||0)%360,e<0?e+360:e}function Wp(e){return Math.max(0,Math.min(1,e||0))}function dw(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 xN=e=>()=>e;function vee(e,t){return function(n){return e+n*t}}function gee(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 yee(e){return(e=+e)==1?R5:function(t,n){return n-t?gee(t,n,e):xN(isNaN(t)?n:t)}}function R5(e,t){var n=t-e;return n?vee(e,n):xN(isNaN(e)?t:e)}const iR=(function e(t){var n=yee(t);function r(a,i){var o=n((a=oj(a)).r,(i=oj(i)).r),c=n(a.g,i.g),d=n(a.b,i.b),f=R5(a.opacity,i.opacity);return function(h){return a.r=o(h),a.g=c(h),a.b=d(h),a.opacity=f(h),a+""}}return r.gamma=e,r})(1);function xee(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(i){for(a=0;a<n;++a)r[a]=e[a]*(1-i)+t[a]*i;return r}}function bee(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function wee(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),i=new Array(n),o;for(o=0;o<r;++o)a[o]=Uc(e[o],t[o]);for(;o<n;++o)i[o]=t[o];return function(c){for(o=0;o<r;++o)i[o]=a[o](c);return i}}function jee(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Th(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function See(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=Uc(e[a],t[a]):r[a]=t[a];return function(i){for(a in n)r[a]=n[a](i);return r}}var lj=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,fw=new RegExp(lj.source,"g");function Nee(e){return function(){return e}}function Cee(e){return function(t){return e(t)+""}}function Aee(e,t){var n=lj.lastIndex=fw.lastIndex=0,r,a,i,o=-1,c=[],d=[];for(e=e+"",t=t+"";(r=lj.exec(e))&&(a=fw.exec(t));)(i=a.index)>n&&(i=t.slice(n,i),c[o]?c[o]+=i:c[++o]=i),(r=r[0])===(a=a[0])?c[o]?c[o]+=a:c[++o]=a:(c[++o]=null,d.push({i:o,x:Th(r,a)})),n=fw.lastIndex;return n<t.length&&(i=t.slice(n),c[o]?c[o]+=i:c[++o]=i),c.length<2?d[0]?Cee(d[0].x):Nee(t):(t=d.length,function(f){for(var h=0,p;h<t;++h)c[(p=d[h]).i]=p.x(f);return c.join("")})}function Uc(e,t){var n=typeof t,r;return t==null||n==="boolean"?xN(t):(n==="number"?Th:n==="string"?(r=Nd(t))?(t=r,iR):Aee:t instanceof Nd?iR:t instanceof Date?jee:bee(t)?xee:Array.isArray(t)?wee:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?See:Th)(e,t)}function bN(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Eee(e,t){t===void 0&&(t=e,e=Uc);for(var n=0,r=t.length-1,a=t[0],i=new Array(r<0?0:r);n<r;)i[n]=e(a,a=t[++n]);return function(o){var c=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return i[c](o-c)}}function _ee(e){return function(){return e}}function Ih(e){return+e}var oR=[0,1];function hr(e){return e}function cj(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:_ee(isNaN(t)?NaN:.5)}function Pee(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Oee(e,t,n){var r=e[0],a=e[1],i=t[0],o=t[1];return a<r?(r=cj(a,r),i=n(o,i)):(r=cj(r,a),i=n(i,o)),function(c){return i(r(c))}}function kee(e,t,n){var r=Math.min(e.length,t.length)-1,a=new Array(r),i=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)a[o]=cj(e[o],e[o+1]),i[o]=n(t[o],t[o+1]);return function(c){var d=pf(e,c,1,r)-1;return i[d](a[d](c))}}function mf(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function mv(){var e=oR,t=oR,n=Uc,r,a,i,o=hr,c,d,f;function h(){var g=Math.min(e.length,t.length);return o!==hr&&(o=Pee(e[0],e[g-1])),c=g>2?kee:Oee,d=f=null,p}function p(g){return g==null||isNaN(g=+g)?i:(d||(d=c(e.map(r),t,n)))(r(o(g)))}return p.invert=function(g){return o(a((f||(f=c(t,e.map(r),Th)))(g)))},p.domain=function(g){return arguments.length?(e=Array.from(g,Ih),h()):e.slice()},p.range=function(g){return arguments.length?(t=Array.from(g),h()):t.slice()},p.rangeRound=function(g){return t=Array.from(g),n=bN,h()},p.clamp=function(g){return arguments.length?(o=g?!0:hr,h()):o!==hr},p.interpolate=function(g){return arguments.length?(n=g,h()):n},p.unknown=function(g){return arguments.length?(i=g,p):i},function(g,y){return r=g,a=y,h()}}function wN(){return mv()(hr,hr)}function Ree(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Mh(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 sc(e){return e=Mh(Math.abs(e)),e?e[1]:NaN}function Tee(e,t){return function(n,r){for(var a=n.length,i=[],o=0,c=e[0],d=0;a>0&&c>0&&(d+c+1>r&&(c=Math.max(1,r-d)),i.push(n.substring(a-=c,a+c)),!((d+=c+1)>r));)c=e[o=(o+1)%e.length];return i.reverse().join(t)}}function Iee(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Mee=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Cd(e){if(!(t=Mee.exec(e)))throw new Error("invalid format: "+e);var t;return new jN({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]})}Cd.prototype=jN.prototype;function jN(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+""}jN.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 $ee(e){e:for(var t=e.length,n=1,r=-1,a;n<t;++n)switch(e[n]){case".":r=a=n;break;case"0":r===0&&(r=n),a=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(a+1):e}var $h;function Dee(e,t){var n=Mh(e,t);if(!n)return $h=void 0,e.toPrecision(t);var r=n[0],a=n[1],i=a-($h=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=r.length;return i===o?r:i>o?r+new Array(i-o+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+Mh(e,Math.max(0,t+i-1))[0]}function lR(e,t){var n=Mh(e,t);if(!n)return e+"";var r=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+new Array(a-r.length+2).join("0")}const cR={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Ree,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)=>lR(e*100,t),r:lR,s:Dee,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function uR(e){return e}var dR=Array.prototype.map,fR=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Lee(e){var t=e.grouping===void 0||e.thousands===void 0?uR:Tee(dR.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?uR:Iee(dR.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(p,g){p=Cd(p);var y=p.fill,j=p.align,w=p.sign,x=p.symbol,S=p.zero,N=p.width,A=p.comma,P=p.precision,E=p.trim,O=p.type;O==="n"?(A=!0,O="g"):cR[O]||(P===void 0&&(P=12),E=!0,O="g"),(S||y==="0"&&j==="=")&&(S=!0,y="0",j="=");var k=(g&&g.prefix!==void 0?g.prefix:"")+(x==="$"?n:x==="#"&&/[boxX]/.test(O)?"0"+O.toLowerCase():""),R=(x==="$"?r:/[%p]/.test(O)?o:"")+(g&&g.suffix!==void 0?g.suffix:""),D=cR[O],U=/[defgprs%]/.test(O);P=P===void 0?6:/[gprs]/.test(O)?Math.max(1,Math.min(21,P)):Math.max(0,Math.min(20,P));function z(L){var G=k,q=R,H,X,Z;if(O==="c")q=D(L)+q,L="";else{L=+L;var I=L<0||1/L<0;if(L=isNaN(L)?d:D(Math.abs(L),P),E&&(L=$ee(L)),I&&+L==0&&w!=="+"&&(I=!1),G=(I?w==="("?w:c:w==="-"||w==="("?"":w)+G,q=(O==="s"&&!isNaN(L)&&$h!==void 0?fR[8+$h/3]:"")+q+(I&&w==="("?")":""),U){for(H=-1,X=L.length;++H<X;)if(Z=L.charCodeAt(H),48>Z||Z>57){q=(Z===46?a+L.slice(H+1):L.slice(H))+q,L=L.slice(0,H);break}}}A&&!S&&(L=t(L,1/0));var F=G.length+L.length+q.length,Q=F<N?new Array(N-F+1).join(y):"";switch(A&&S&&(L=t(Q+L,Q.length?N-q.length:1/0),Q=""),j){case"<":L=G+L+q+Q;break;case"=":L=G+Q+L+q;break;case"^":L=Q.slice(0,F=Q.length>>1)+G+L+q+Q.slice(F);break;default:L=Q+G+L+q;break}return i(L)}return z.toString=function(){return p+""},z}function h(p,g){var y=Math.max(-8,Math.min(8,Math.floor(sc(g)/3)))*3,j=Math.pow(10,-y),w=f((p=Cd(p),p.type="f",p),{suffix:fR[8+y/3]});return function(x){return w(j*x)}}return{format:f,formatPrefix:h}}var Vp,SN,T5;Fee({thousands:",",grouping:[3],currency:["$",""]});function Fee(e){return Vp=Lee(e),SN=Vp.format,T5=Vp.formatPrefix,Vp}function Bee(e){return Math.max(0,-sc(Math.abs(e)))}function zee(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(sc(t)/3)))*3-sc(Math.abs(e)))}function Uee(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,sc(t)-sc(e))+1}function I5(e,t,n,r){var a=sj(e,t,n),i;switch(r=Cd(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=zee(a,o))&&(r.precision=i),T5(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=Uee(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=Bee(a))&&(r.precision=i-(r.type==="%")*2);break}}return SN(r)}function Ui(e){var t=e.domain;return e.ticks=function(n){var r=t();return rj(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return I5(a[0],a[a.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),a=0,i=r.length-1,o=r[a],c=r[i],d,f,h=10;for(c<o&&(f=o,o=c,c=f,f=a,a=i,i=f);h-- >0;){if(f=aj(o,c,n),f===d)return r[a]=o,r[i]=c,t(r);if(f>0)o=Math.floor(o/f)*f,c=Math.ceil(c/f)*f;else if(f<0)o=Math.ceil(o*f)/f,c=Math.floor(c*f)/f;else break;d=f}return e},e}function Dh(){var e=wN();return e.copy=function(){return mf(e,Dh())},ya.apply(e,arguments),Ui(e)}function M5(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,Ih),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return M5(e).unknown(t)},e=arguments.length?Array.from(e,Ih):[0,1],Ui(n)}function $5(e,t){e=e.slice();var n=0,r=e.length-1,a=e[n],i=e[r],o;return i<a&&(o=n,n=r,r=o,o=a,a=i,i=o),e[n]=t.floor(a),e[r]=t.ceil(i),e}function pR(e){return Math.log(e)}function hR(e){return Math.exp(e)}function qee(e){return-Math.log(-e)}function Wee(e){return-Math.exp(-e)}function Vee(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Hee(e){return e===10?Vee:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Kee(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 mR(e){return(t,n)=>-e(-t,n)}function NN(e){const t=e(pR,hR),n=t.domain;let r=10,a,i;function o(){return a=Kee(r),i=Hee(r),n()[0]<0?(a=mR(a),i=mR(i),e(qee,Wee)):e(pR,hR),t}return t.base=function(c){return arguments.length?(r=+c,o()):r},t.domain=function(c){return arguments.length?(n(c),o()):n()},t.ticks=c=>{const d=n();let f=d[0],h=d[d.length-1];const p=h<f;p&&([f,h]=[h,f]);let g=a(f),y=a(h),j,w;const x=c==null?10:+c;let S=[];if(!(r%1)&&y-g<x){if(g=Math.floor(g),y=Math.ceil(y),f>0){for(;g<=y;++g)for(j=1;j<r;++j)if(w=g<0?j/i(-g):j*i(g),!(w<f)){if(w>h)break;S.push(w)}}else for(;g<=y;++g)for(j=r-1;j>=1;--j)if(w=g>0?j/i(-g):j*i(g),!(w<f)){if(w>h)break;S.push(w)}S.length*2<x&&(S=rj(f,h,x))}else S=rj(g,y,Math.min(y-g,x)).map(i);return p?S.reverse():S},t.tickFormat=(c,d)=>{if(c==null&&(c=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=Cd(d)).precision==null&&(d.trim=!0),d=SN(d)),c===1/0)return d;const f=Math.max(1,r*c/t.ticks().length);return h=>{let p=h/i(Math.round(a(h)));return p*r<r-.5&&(p*=r),p<=f?d(h):""}},t.nice=()=>n($5(n(),{floor:c=>i(Math.floor(a(c))),ceil:c=>i(Math.ceil(a(c)))})),t}function D5(){const e=NN(mv()).domain([1,10]);return e.copy=()=>mf(e,D5()).base(e.base()),ya.apply(e,arguments),e}function vR(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function gR(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function CN(e){var t=1,n=e(vR(t),gR(t));return n.constant=function(r){return arguments.length?e(vR(t=+r),gR(t)):t},Ui(n)}function L5(){var e=CN(mv());return e.copy=function(){return mf(e,L5()).constant(e.constant())},ya.apply(e,arguments)}function yR(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Gee(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Yee(e){return e<0?-e*e:e*e}function AN(e){var t=e(hr,hr),n=1;function r(){return n===1?e(hr,hr):n===.5?e(Gee,Yee):e(yR(n),yR(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},Ui(t)}function EN(){var e=AN(mv());return e.copy=function(){return mf(e,EN()).exponent(e.exponent())},ya.apply(e,arguments),e}function Xee(){return EN.apply(null,arguments).exponent(.5)}function xR(e){return Math.sign(e)*e*e}function Qee(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function F5(){var e=wN(),t=[0,1],n=!1,r;function a(i){var o=Qee(e(i));return isNaN(o)?r:n?Math.round(o):o}return a.invert=function(i){return e.invert(xR(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,Ih)).map(xR)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(n=!!i,a):n},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return F5(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},ya.apply(a,arguments),Ui(a)}function B5(){var e=[],t=[],n=[],r;function a(){var o=0,c=Math.max(1,t.length);for(n=new Array(c-1);++o<c;)n[o-1]=nee(e,o/c);return i}function i(o){return o==null||isNaN(o=+o)?r:t[pf(n,o)]}return i.invertExtent=function(o){var c=t.indexOf(o);return c<0?[NaN,NaN]:[c>0?n[c-1]:e[0],c<n.length?n[c]:e[e.length-1]]},i.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let c of o)c!=null&&!isNaN(c=+c)&&e.push(c);return e.sort(Oi),a()},i.range=function(o){return arguments.length?(t=Array.from(o),a()):t.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.quantiles=function(){return n.slice()},i.copy=function(){return B5().domain(e).range(t).unknown(r)},ya.apply(i,arguments)}function z5(){var e=0,t=1,n=1,r=[.5],a=[0,1],i;function o(d){return d!=null&&d<=d?a[pf(r,d,0,n)]:i}function c(){var d=-1;for(r=new Array(n);++d<n;)r[d]=((d+1)*t-(d-n)*e)/(n+1);return o}return o.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,c()):[e,t]},o.range=function(d){return arguments.length?(n=(a=Array.from(d)).length-1,c()):a.slice()},o.invertExtent=function(d){var f=a.indexOf(d);return f<0?[NaN,NaN]:f<1?[e,r[0]]:f>=n?[r[n-1],t]:[r[f-1],r[f]]},o.unknown=function(d){return arguments.length&&(i=d),o},o.thresholds=function(){return r.slice()},o.copy=function(){return z5().domain([e,t]).range(a).unknown(i)},ya.apply(Ui(o),arguments)}function U5(){var e=[.5],t=[0,1],n,r=1;function a(i){return i!=null&&i<=i?t[pf(e,i,0,r)]:n}return a.domain=function(i){return arguments.length?(e=Array.from(i),r=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),r=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return U5().domain(e).range(t).unknown(n)},ya.apply(a,arguments)}const pw=new Date,hw=new Date;function qn(e,t,n,r){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const o=a(i),c=a.ceil(i);return i-o<c-i?o:c},a.offset=(i,o)=>(t(i=new Date(+i),o==null?1:Math.floor(o)),i),a.range=(i,o,c)=>{const d=[];if(i=a.ceil(i),c=c==null?1:Math.floor(c),!(i<o)||!(c>0))return d;let f;do d.push(f=new Date(+i)),t(i,c),e(i);while(f<i&&i<o);return d},a.filter=i=>qn(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,c)=>{if(o>=o)if(c<0)for(;++c<=0;)for(;t(o,-1),!i(o););else for(;--c>=0;)for(;t(o,1),!i(o););}),n&&(a.count=(i,o)=>(pw.setTime(+i),hw.setTime(+o),e(pw),e(hw),Math.floor(n(pw,hw))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(r?o=>r(o)%i===0:o=>a.count(0,o)%i===0):a)),a}const Lh=qn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Lh.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?qn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Lh);Lh.range;const Ts=1e3,pa=Ts*60,Is=pa*60,Us=Is*24,_N=Us*7,bR=Us*30,mw=Us*365,xo=qn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ts)},(e,t)=>(t-e)/Ts,e=>e.getUTCSeconds());xo.range;const PN=qn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ts)},(e,t)=>{e.setTime(+e+t*pa)},(e,t)=>(t-e)/pa,e=>e.getMinutes());PN.range;const ON=qn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*pa)},(e,t)=>(t-e)/pa,e=>e.getUTCMinutes());ON.range;const kN=qn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ts-e.getMinutes()*pa)},(e,t)=>{e.setTime(+e+t*Is)},(e,t)=>(t-e)/Is,e=>e.getHours());kN.range;const RN=qn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Is)},(e,t)=>(t-e)/Is,e=>e.getUTCHours());RN.range;const vf=qn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*pa)/Us,e=>e.getDate()-1);vf.range;const vv=qn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Us,e=>e.getUTCDate()-1);vv.range;const q5=qn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Us,e=>Math.floor(e/Us));q5.range;function zo(e){return qn(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())*pa)/_N)}const gv=zo(0),Fh=zo(1),Jee=zo(2),Zee=zo(3),ic=zo(4),ete=zo(5),tte=zo(6);gv.range;Fh.range;Jee.range;Zee.range;ic.range;ete.range;tte.range;function Uo(e){return qn(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)/_N)}const yv=Uo(0),Bh=Uo(1),nte=Uo(2),rte=Uo(3),oc=Uo(4),ate=Uo(5),ste=Uo(6);yv.range;Bh.range;nte.range;rte.range;oc.range;ate.range;ste.range;const TN=qn(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());TN.range;const IN=qn(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());IN.range;const qs=qn(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());qs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qn(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)});qs.range;const Ws=qn(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());Ws.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:qn(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)});Ws.range;function W5(e,t,n,r,a,i){const o=[[xo,1,Ts],[xo,5,5*Ts],[xo,15,15*Ts],[xo,30,30*Ts],[i,1,pa],[i,5,5*pa],[i,15,15*pa],[i,30,30*pa],[a,1,Is],[a,3,3*Is],[a,6,6*Is],[a,12,12*Is],[r,1,Us],[r,2,2*Us],[n,1,_N],[t,1,bR],[t,3,3*bR],[e,1,mw]];function c(f,h,p){const g=h<f;g&&([f,h]=[h,f]);const y=p&&typeof p.range=="function"?p:d(f,h,p),j=y?y.range(f,+h+1):[];return g?j.reverse():j}function d(f,h,p){const g=Math.abs(h-f)/p,y=vN(([,,x])=>x).right(o,g);if(y===o.length)return e.every(sj(f/mw,h/mw,p));if(y===0)return Lh.every(Math.max(sj(f,h,p),1));const[j,w]=o[g/o[y-1][2]<o[y][2]/g?y-1:y];return j.every(w)}return[c,d]}const[ite,ote]=W5(Ws,IN,yv,q5,RN,ON),[lte,cte]=W5(qs,TN,gv,vf,kN,PN);function vw(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 gw(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 Mu(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function ute(e){var t=e.dateTime,n=e.date,r=e.time,a=e.periods,i=e.days,o=e.shortDays,c=e.months,d=e.shortMonths,f=$u(a),h=Du(a),p=$u(i),g=Du(i),y=$u(o),j=Du(o),w=$u(c),x=Du(c),S=$u(d),N=Du(d),A={a:Z,A:I,b:F,B:Q,c:null,d:AR,e:AR,f:Tte,g:qte,G:Vte,H:Ote,I:kte,j:Rte,L:V5,m:Ite,M:Mte,p:B,q:$,Q:PR,s:OR,S:$te,u:Dte,U:Lte,V:Fte,w:Bte,W:zte,x:null,X:null,y:Ute,Y:Wte,Z:Hte,"%":_R},P={a:ee,A:V,b:J,B:ge,c:null,d:ER,e:ER,f:Xte,g:ine,G:lne,H:Kte,I:Gte,j:Yte,L:K5,m:Qte,M:Jte,p:ie,q:ce,Q:PR,s:OR,S:Zte,u:ene,U:tne,V:nne,w:rne,W:ane,x:null,X:null,y:sne,Y:one,Z:cne,"%":_R},E={a:U,A:z,b:L,B:G,c:q,d:NR,e:NR,f:Ate,g:SR,G:jR,H:CR,I:CR,j:jte,L:Cte,m:wte,M:Ste,p:D,q:bte,Q:_te,s:Pte,S:Nte,u:mte,U:vte,V:gte,w:hte,W:yte,x:H,X,y:SR,Y:jR,Z:xte,"%":Ete};A.x=O(n,A),A.X=O(r,A),A.c=O(t,A),P.x=O(n,P),P.X=O(r,P),P.c=O(t,P);function O(oe,xe){return function(Oe){var pe=[],ve=-1,Ce=0,Le=oe.length,se,de,Ne;for(Oe instanceof Date||(Oe=new Date(+Oe));++ve<Le;)oe.charCodeAt(ve)===37&&(pe.push(oe.slice(Ce,ve)),(de=wR[se=oe.charAt(++ve)])!=null?se=oe.charAt(++ve):de=se==="e"?" ":"0",(Ne=xe[se])&&(se=Ne(Oe,de)),pe.push(se),Ce=ve+1);return pe.push(oe.slice(Ce,ve)),pe.join("")}}function k(oe,xe){return function(Oe){var pe=Mu(1900,void 0,1),ve=R(pe,oe,Oe+="",0),Ce,Le;if(ve!=Oe.length)return null;if("Q"in pe)return new Date(pe.Q);if("s"in pe)return new Date(pe.s*1e3+("L"in pe?pe.L:0));if(xe&&!("Z"in pe)&&(pe.Z=0),"p"in pe&&(pe.H=pe.H%12+pe.p*12),pe.m===void 0&&(pe.m="q"in pe?pe.q:0),"V"in pe){if(pe.V<1||pe.V>53)return null;"w"in pe||(pe.w=1),"Z"in pe?(Ce=gw(Mu(pe.y,0,1)),Le=Ce.getUTCDay(),Ce=Le>4||Le===0?Bh.ceil(Ce):Bh(Ce),Ce=vv.offset(Ce,(pe.V-1)*7),pe.y=Ce.getUTCFullYear(),pe.m=Ce.getUTCMonth(),pe.d=Ce.getUTCDate()+(pe.w+6)%7):(Ce=vw(Mu(pe.y,0,1)),Le=Ce.getDay(),Ce=Le>4||Le===0?Fh.ceil(Ce):Fh(Ce),Ce=vf.offset(Ce,(pe.V-1)*7),pe.y=Ce.getFullYear(),pe.m=Ce.getMonth(),pe.d=Ce.getDate()+(pe.w+6)%7)}else("W"in pe||"U"in pe)&&("w"in pe||(pe.w="u"in pe?pe.u%7:"W"in pe?1:0),Le="Z"in pe?gw(Mu(pe.y,0,1)).getUTCDay():vw(Mu(pe.y,0,1)).getDay(),pe.m=0,pe.d="W"in pe?(pe.w+6)%7+pe.W*7-(Le+5)%7:pe.w+pe.U*7-(Le+6)%7);return"Z"in pe?(pe.H+=pe.Z/100|0,pe.M+=pe.Z%100,gw(pe)):vw(pe)}}function R(oe,xe,Oe,pe){for(var ve=0,Ce=xe.length,Le=Oe.length,se,de;ve<Ce;){if(pe>=Le)return-1;if(se=xe.charCodeAt(ve++),se===37){if(se=xe.charAt(ve++),de=E[se in wR?xe.charAt(ve++):se],!de||(pe=de(oe,Oe,pe))<0)return-1}else if(se!=Oe.charCodeAt(pe++))return-1}return pe}function D(oe,xe,Oe){var pe=f.exec(xe.slice(Oe));return pe?(oe.p=h.get(pe[0].toLowerCase()),Oe+pe[0].length):-1}function U(oe,xe,Oe){var pe=y.exec(xe.slice(Oe));return pe?(oe.w=j.get(pe[0].toLowerCase()),Oe+pe[0].length):-1}function z(oe,xe,Oe){var pe=p.exec(xe.slice(Oe));return pe?(oe.w=g.get(pe[0].toLowerCase()),Oe+pe[0].length):-1}function L(oe,xe,Oe){var pe=S.exec(xe.slice(Oe));return pe?(oe.m=N.get(pe[0].toLowerCase()),Oe+pe[0].length):-1}function G(oe,xe,Oe){var pe=w.exec(xe.slice(Oe));return pe?(oe.m=x.get(pe[0].toLowerCase()),Oe+pe[0].length):-1}function q(oe,xe,Oe){return R(oe,t,xe,Oe)}function H(oe,xe,Oe){return R(oe,n,xe,Oe)}function X(oe,xe,Oe){return R(oe,r,xe,Oe)}function Z(oe){return o[oe.getDay()]}function I(oe){return i[oe.getDay()]}function F(oe){return d[oe.getMonth()]}function Q(oe){return c[oe.getMonth()]}function B(oe){return a[+(oe.getHours()>=12)]}function $(oe){return 1+~~(oe.getMonth()/3)}function ee(oe){return o[oe.getUTCDay()]}function V(oe){return i[oe.getUTCDay()]}function J(oe){return d[oe.getUTCMonth()]}function ge(oe){return c[oe.getUTCMonth()]}function ie(oe){return a[+(oe.getUTCHours()>=12)]}function ce(oe){return 1+~~(oe.getUTCMonth()/3)}return{format:function(oe){var xe=O(oe+="",A);return xe.toString=function(){return oe},xe},parse:function(oe){var xe=k(oe+="",!1);return xe.toString=function(){return oe},xe},utcFormat:function(oe){var xe=O(oe+="",P);return xe.toString=function(){return oe},xe},utcParse:function(oe){var xe=k(oe+="",!0);return xe.toString=function(){return oe},xe}}}var wR={"-":"",_:" ",0:"0"},Yn=/^\s*\d+/,dte=/^%/,fte=/[\\^$*+?|[\]().{}]/g;function $t(e,t,n){var r=e<0?"-":"",a=(r?-e:e)+"",i=a.length;return r+(i<n?new Array(n-i+1).join(t)+a:a)}function pte(e){return e.replace(fte,"\\$&")}function $u(e){return new RegExp("^(?:"+e.map(pte).join("|")+")","i")}function Du(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function hte(e,t,n){var r=Yn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function mte(e,t,n){var r=Yn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function vte(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function gte(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function yte(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function jR(e,t,n){var r=Yn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function SR(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function xte(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 bte(e,t,n){var r=Yn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function wte(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function NR(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function jte(e,t,n){var r=Yn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function CR(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Ste(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Nte(e,t,n){var r=Yn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Cte(e,t,n){var r=Yn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Ate(e,t,n){var r=Yn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Ete(e,t,n){var r=dte.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function _te(e,t,n){var r=Yn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Pte(e,t,n){var r=Yn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function AR(e,t){return $t(e.getDate(),t,2)}function Ote(e,t){return $t(e.getHours(),t,2)}function kte(e,t){return $t(e.getHours()%12||12,t,2)}function Rte(e,t){return $t(1+vf.count(qs(e),e),t,3)}function V5(e,t){return $t(e.getMilliseconds(),t,3)}function Tte(e,t){return V5(e,t)+"000"}function Ite(e,t){return $t(e.getMonth()+1,t,2)}function Mte(e,t){return $t(e.getMinutes(),t,2)}function $te(e,t){return $t(e.getSeconds(),t,2)}function Dte(e){var t=e.getDay();return t===0?7:t}function Lte(e,t){return $t(gv.count(qs(e)-1,e),t,2)}function H5(e){var t=e.getDay();return t>=4||t===0?ic(e):ic.ceil(e)}function Fte(e,t){return e=H5(e),$t(ic.count(qs(e),e)+(qs(e).getDay()===4),t,2)}function Bte(e){return e.getDay()}function zte(e,t){return $t(Fh.count(qs(e)-1,e),t,2)}function Ute(e,t){return $t(e.getFullYear()%100,t,2)}function qte(e,t){return e=H5(e),$t(e.getFullYear()%100,t,2)}function Wte(e,t){return $t(e.getFullYear()%1e4,t,4)}function Vte(e,t){var n=e.getDay();return e=n>=4||n===0?ic(e):ic.ceil(e),$t(e.getFullYear()%1e4,t,4)}function Hte(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+$t(t/60|0,"0",2)+$t(t%60,"0",2)}function ER(e,t){return $t(e.getUTCDate(),t,2)}function Kte(e,t){return $t(e.getUTCHours(),t,2)}function Gte(e,t){return $t(e.getUTCHours()%12||12,t,2)}function Yte(e,t){return $t(1+vv.count(Ws(e),e),t,3)}function K5(e,t){return $t(e.getUTCMilliseconds(),t,3)}function Xte(e,t){return K5(e,t)+"000"}function Qte(e,t){return $t(e.getUTCMonth()+1,t,2)}function Jte(e,t){return $t(e.getUTCMinutes(),t,2)}function Zte(e,t){return $t(e.getUTCSeconds(),t,2)}function ene(e){var t=e.getUTCDay();return t===0?7:t}function tne(e,t){return $t(yv.count(Ws(e)-1,e),t,2)}function G5(e){var t=e.getUTCDay();return t>=4||t===0?oc(e):oc.ceil(e)}function nne(e,t){return e=G5(e),$t(oc.count(Ws(e),e)+(Ws(e).getUTCDay()===4),t,2)}function rne(e){return e.getUTCDay()}function ane(e,t){return $t(Bh.count(Ws(e)-1,e),t,2)}function sne(e,t){return $t(e.getUTCFullYear()%100,t,2)}function ine(e,t){return e=G5(e),$t(e.getUTCFullYear()%100,t,2)}function one(e,t){return $t(e.getUTCFullYear()%1e4,t,4)}function lne(e,t){var n=e.getUTCDay();return e=n>=4||n===0?oc(e):oc.ceil(e),$t(e.getUTCFullYear()%1e4,t,4)}function cne(){return"+0000"}function _R(){return"%"}function PR(e){return+e}function OR(e){return Math.floor(+e/1e3)}var Sl,Y5,X5;une({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 une(e){return Sl=ute(e),Y5=Sl.format,Sl.parse,X5=Sl.utcFormat,Sl.utcParse,Sl}function dne(e){return new Date(e)}function fne(e){return e instanceof Date?+e:+new Date(+e)}function MN(e,t,n,r,a,i,o,c,d,f){var h=wN(),p=h.invert,g=h.domain,y=f(".%L"),j=f(":%S"),w=f("%I:%M"),x=f("%I %p"),S=f("%a %d"),N=f("%b %d"),A=f("%B"),P=f("%Y");function E(O){return(d(O)<O?y:c(O)<O?j:o(O)<O?w:i(O)<O?x:r(O)<O?a(O)<O?S:N:n(O)<O?A:P)(O)}return h.invert=function(O){return new Date(p(O))},h.domain=function(O){return arguments.length?g(Array.from(O,fne)):g().map(dne)},h.ticks=function(O){var k=g();return e(k[0],k[k.length-1],O??10)},h.tickFormat=function(O,k){return k==null?E:f(k)},h.nice=function(O){var k=g();return(!O||typeof O.range!="function")&&(O=t(k[0],k[k.length-1],O??10)),O?g($5(k,O)):h},h.copy=function(){return mf(h,MN(e,t,n,r,a,i,o,c,d,f))},h}function pne(){return ya.apply(MN(lte,cte,qs,TN,gv,vf,kN,PN,xo,Y5).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function hne(){return ya.apply(MN(ite,ote,Ws,IN,yv,vv,RN,ON,xo,X5).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function xv(){var e=0,t=1,n,r,a,i,o=hr,c=!1,d;function f(p){return p==null||isNaN(p=+p)?d:o(a===0?.5:(p=(i(p)-n)*a,c?Math.max(0,Math.min(1,p)):p))}f.domain=function(p){return arguments.length?([e,t]=p,n=i(e=+e),r=i(t=+t),a=n===r?0:1/(r-n),f):[e,t]},f.clamp=function(p){return arguments.length?(c=!!p,f):c},f.interpolator=function(p){return arguments.length?(o=p,f):o};function h(p){return function(g){var y,j;return arguments.length?([y,j]=g,o=p(y,j),f):[o(0),o(1)]}}return f.range=h(Uc),f.rangeRound=h(bN),f.unknown=function(p){return arguments.length?(d=p,f):d},function(p){return i=p,n=p(e),r=p(t),a=n===r?0:1/(r-n),f}}function qi(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Q5(){var e=Ui(xv()(hr));return e.copy=function(){return qi(e,Q5())},Xs.apply(e,arguments)}function J5(){var e=NN(xv()).domain([1,10]);return e.copy=function(){return qi(e,J5()).base(e.base())},Xs.apply(e,arguments)}function Z5(){var e=CN(xv());return e.copy=function(){return qi(e,Z5()).constant(e.constant())},Xs.apply(e,arguments)}function $N(){var e=AN(xv());return e.copy=function(){return qi(e,$N()).exponent(e.exponent())},Xs.apply(e,arguments)}function mne(){return $N.apply(null,arguments).exponent(.5)}function eL(){var e=[],t=hr;function n(r){if(r!=null&&!isNaN(r=+r))return t((pf(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let a of r)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(Oi),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,a)=>t(a/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(a,i)=>tee(e,i/r))},n.copy=function(){return eL(t).domain(e)},Xs.apply(n,arguments)}function bv(){var e=0,t=.5,n=1,r=1,a,i,o,c,d,f=hr,h,p=!1,g;function y(w){return isNaN(w=+w)?g:(w=.5+((w=+h(w))-i)*(r*w<r*i?c:d),f(p?Math.max(0,Math.min(1,w)):w))}y.domain=function(w){return arguments.length?([e,t,n]=w,a=h(e=+e),i=h(t=+t),o=h(n=+n),c=a===i?0:.5/(i-a),d=i===o?0:.5/(o-i),r=i<a?-1:1,y):[e,t,n]},y.clamp=function(w){return arguments.length?(p=!!w,y):p},y.interpolator=function(w){return arguments.length?(f=w,y):f};function j(w){return function(x){var S,N,A;return arguments.length?([S,N,A]=x,f=Eee(w,[S,N,A]),y):[f(0),f(.5),f(1)]}}return y.range=j(Uc),y.rangeRound=j(bN),y.unknown=function(w){return arguments.length?(g=w,y):g},function(w){return h=w,a=w(e),i=w(t),o=w(n),c=a===i?0:.5/(i-a),d=i===o?0:.5/(o-i),r=i<a?-1:1,y}}function tL(){var e=Ui(bv()(hr));return e.copy=function(){return qi(e,tL())},Xs.apply(e,arguments)}function nL(){var e=NN(bv()).domain([.1,1,10]);return e.copy=function(){return qi(e,nL()).base(e.base())},Xs.apply(e,arguments)}function rL(){var e=CN(bv());return e.copy=function(){return qi(e,rL()).constant(e.constant())},Xs.apply(e,arguments)}function DN(){var e=AN(bv());return e.copy=function(){return qi(e,DN()).exponent(e.exponent())},Xs.apply(e,arguments)}function vne(){return DN.apply(null,arguments).exponent(.5)}const kR=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:wd,scaleDiverging:tL,scaleDivergingLog:nL,scaleDivergingPow:DN,scaleDivergingSqrt:vne,scaleDivergingSymlog:rL,scaleIdentity:M5,scaleImplicit:ij,scaleLinear:Dh,scaleLog:D5,scaleOrdinal:gN,scalePoint:ed,scalePow:EN,scaleQuantile:B5,scaleQuantize:z5,scaleRadial:F5,scaleSequential:Q5,scaleSequentialLog:J5,scaleSequentialPow:$N,scaleSequentialQuantile:eL,scaleSequentialSqrt:mne,scaleSequentialSymlog:Z5,scaleSqrt:Xee,scaleSymlog:L5,scaleThreshold:U5,scaleTime:pne,scaleUtc:hne,tickFormat:I5},Symbol.toStringTag,{value:"Module"}));var yw,RR;function wv(){if(RR)return yw;RR=1;var e=Lc();function t(n,r,a){for(var i=-1,o=n.length;++i<o;){var c=n[i],d=r(c);if(d!=null&&(f===void 0?d===d&&!e(d):a(d,f)))var f=d,h=c}return h}return yw=t,yw}var xw,TR;function aL(){if(TR)return xw;TR=1;function e(t,n){return t>n}return xw=e,xw}var bw,IR;function gne(){if(IR)return bw;IR=1;var e=wv(),t=aL(),n=zc();function r(a){return a&&a.length?e(a,n,t):void 0}return bw=r,bw}var yne=gne();const jv=Yt(yne);var ww,MR;function sL(){if(MR)return ww;MR=1;function e(t,n){return t<n}return ww=e,ww}var jw,$R;function xne(){if($R)return jw;$R=1;var e=wv(),t=sL(),n=zc();function r(a){return a&&a.length?e(a,n,t):void 0}return jw=r,jw}var bne=xne();const Sv=Yt(bne);var Sw,DR;function wne(){if(DR)return Sw;DR=1;var e=ZS(),t=us(),n=h5(),r=_r();function a(i,o){var c=r(i)?e:n;return c(i,t(o,3))}return Sw=a,Sw}var Nw,LR;function jne(){if(LR)return Nw;LR=1;var e=f5(),t=wne();function n(r,a){return e(t(r,a),1)}return Nw=n,Nw}var Sne=jne();const Nne=Yt(Sne);var Cw,FR;function Cne(){if(FR)return Cw;FR=1;var e=fN();function t(n,r){return e(n,r)}return Cw=t,Cw}var Ane=Cne();const gf=Yt(Ane);var qc=1e9,Ene={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},FN,mn=!0,ga="[DecimalError] ",So=ga+"Invalid argument: ",LN=ga+"Exponent out of range: ",Wc=Math.floor,mo=Math.pow,_ne=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Vr,Kn=1e7,pn=7,iL=9007199254740991,zh=Wc(iL/pn),Qe={};Qe.absoluteValue=Qe.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Qe.comparedTo=Qe.cmp=function(e){var t,n,r,a,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(r=i.d.length,a=e.d.length,t=0,n=r<a?r:a;t<n;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return r===a?0:r>a^i.s<0?1:-1};Qe.decimalPlaces=Qe.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*pn;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Qe.dividedBy=Qe.div=function(e){return Ls(this,new this.constructor(e))};Qe.dividedToIntegerBy=Qe.idiv=function(e){var t=this,n=t.constructor;return tn(Ls(t,new n(e),0,1),n.precision)};Qe.equals=Qe.eq=function(e){return!this.cmp(e)};Qe.exponent=function(){return kn(this)};Qe.greaterThan=Qe.gt=function(e){return this.cmp(e)>0};Qe.greaterThanOrEqualTo=Qe.gte=function(e){return this.cmp(e)>=0};Qe.isInteger=Qe.isint=function(){return this.e>this.d.length-2};Qe.isNegative=Qe.isneg=function(){return this.s<0};Qe.isPositive=Qe.ispos=function(){return this.s>0};Qe.isZero=function(){return this.s===0};Qe.lessThan=Qe.lt=function(e){return this.cmp(e)<0};Qe.lessThanOrEqualTo=Qe.lte=function(e){return this.cmp(e)<1};Qe.logarithm=Qe.log=function(e){var t,n=this,r=n.constructor,a=r.precision,i=a+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Vr))throw Error(ga+"NaN");if(n.s<1)throw Error(ga+(n.s?"NaN":"-Infinity"));return n.eq(Vr)?new r(0):(mn=!1,t=Ls(Ad(n,i),Ad(e,i),i),mn=!0,tn(t,a))};Qe.minus=Qe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?cL(t,e):oL(t,(e.s=-e.s,e))};Qe.modulo=Qe.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(ga+"NaN");return n.s?(mn=!1,t=Ls(n,e,0,1).times(e),mn=!0,n.minus(t)):tn(new r(n),a)};Qe.naturalExponential=Qe.exp=function(){return lL(this)};Qe.naturalLogarithm=Qe.ln=function(){return Ad(this)};Qe.negated=Qe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Qe.plus=Qe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?oL(t,e):cL(t,(e.s=-e.s,e))};Qe.precision=Qe.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(So+e);if(t=kn(a)+1,r=a.d.length-1,n=r*pn+1,r=a.d[r],r){for(;r%10==0;r/=10)n--;for(r=a.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Qe.squareRoot=Qe.sqrt=function(){var e,t,n,r,a,i,o,c=this,d=c.constructor;if(c.s<1){if(!c.s)return new d(0);throw Error(ga+"NaN")}for(e=kn(c),mn=!1,a=Math.sqrt(+c),a==0||a==1/0?(t=ts(c.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Wc((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new d(t)):r=new d(a.toString()),n=d.precision,a=o=n+3;;)if(i=r,r=i.plus(Ls(c,i,o+2)).times(.5),ts(i.d).slice(0,o)===(t=ts(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(tn(i,n+1,0),i.times(i).eq(c)){r=i;break}}else if(t!="9999")break;o+=4}return mn=!0,tn(r,n)};Qe.times=Qe.mul=function(e){var t,n,r,a,i,o,c,d,f,h=this,p=h.constructor,g=h.d,y=(e=new p(e)).d;if(!h.s||!e.s)return new p(0);for(e.s*=h.s,n=h.e+e.e,d=g.length,f=y.length,d<f&&(i=g,g=y,y=i,o=d,d=f,f=o),i=[],o=d+f,r=o;r--;)i.push(0);for(r=f;--r>=0;){for(t=0,a=d+r;a>r;)c=i[a]+y[r]*g[a-r-1]+t,i[a--]=c%Kn|0,t=c/Kn|0;i[a]=(i[a]+t)%Kn|0}for(;!i[--o];)i.pop();return t?++n:i.shift(),e.d=i,e.e=n,mn?tn(e,p.precision):e};Qe.toDecimalPlaces=Qe.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(is(e,0,qc),t===void 0?t=r.rounding:is(t,0,8),tn(n,e+kn(n)+1,t))};Qe.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=Oo(r,!0):(is(e,0,qc),t===void 0?t=a.rounding:is(t,0,8),r=tn(new a(r),e+1,t),n=Oo(r,!0,e+1)),n};Qe.toFixed=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?Oo(a):(is(e,0,qc),t===void 0?t=i.rounding:is(t,0,8),r=tn(new i(a),e+kn(a)+1,t),n=Oo(r.abs(),!1,e+kn(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};Qe.toInteger=Qe.toint=function(){var e=this,t=e.constructor;return tn(new t(e),kn(e)+1,t.rounding)};Qe.toNumber=function(){return+this};Qe.toPower=Qe.pow=function(e){var t,n,r,a,i,o,c=this,d=c.constructor,f=12,h=+(e=new d(e));if(!e.s)return new d(Vr);if(c=new d(c),!c.s){if(e.s<1)throw Error(ga+"Infinity");return c}if(c.eq(Vr))return c;if(r=d.precision,e.eq(Vr))return tn(c,r);if(t=e.e,n=e.d.length-1,o=t>=n,i=c.s,o){if((n=h<0?-h:h)<=iL){for(a=new d(Vr),t=Math.ceil(r/pn+4),mn=!1;n%2&&(a=a.times(c),zR(a.d,t)),n=Wc(n/2),n!==0;)c=c.times(c),zR(c.d,t);return mn=!0,e.s<0?new d(Vr).div(a):tn(a,r)}}else if(i<0)throw Error(ga+"NaN");return i=i<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,mn=!1,a=e.times(Ad(c,r+f)),mn=!0,a=lL(a),a.s=i,a};Qe.toPrecision=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?(n=kn(a),r=Oo(a,n<=i.toExpNeg||n>=i.toExpPos)):(is(e,1,qc),t===void 0?t=i.rounding:is(t,0,8),a=tn(new i(a),e,t),n=kn(a),r=Oo(a,e<=n||n<=i.toExpNeg,e)),r};Qe.toSignificantDigits=Qe.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(is(e,1,qc),t===void 0?t=r.rounding:is(t,0,8)),tn(new r(n),e,t)};Qe.toString=Qe.valueOf=Qe.val=Qe.toJSON=Qe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=kn(e),n=e.constructor;return Oo(e,t<=n.toExpNeg||t>=n.toExpPos)};function oL(e,t){var n,r,a,i,o,c,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),mn?tn(t,p):t;if(d=e.d,f=t.d,o=e.e,a=t.e,d=d.slice(),i=o-a,i){for(i<0?(r=d,i=-i,c=f.length):(r=f,a=o,c=d.length),o=Math.ceil(p/pn),c=o>c?o+1:c+1,i>c&&(i=c,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(c=d.length,i=f.length,c-i<0&&(i=c,r=f,f=d,d=r),n=0;i;)n=(d[--i]=d[i]+f[i]+n)/Kn|0,d[i]%=Kn;for(n&&(d.unshift(n),++a),c=d.length;d[--c]==0;)d.pop();return t.d=d,t.e=a,mn?tn(t,p):t}function is(e,t,n){if(e!==~~e||e<t||e>n)throw Error(So+e)}function ts(e){var t,n,r,a=e.length-1,i="",o=e[0];if(a>0){for(i+=o,t=1;t<a;t++)r=e[t]+"",n=pn-r.length,n&&(i+=Ni(n)),i+=r;o=e[t],r=o+"",n=pn-r.length,n&&(i+=Ni(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var Ls=(function(){function e(r,a){var i,o=0,c=r.length;for(r=r.slice();c--;)i=r[c]*a+o,r[c]=i%Kn|0,o=i/Kn|0;return o&&r.unshift(o),r}function t(r,a,i,o){var c,d;if(i!=o)d=i>o?1:-1;else for(c=d=0;c<i;c++)if(r[c]!=a[c]){d=r[c]>a[c]?1:-1;break}return d}function n(r,a,i){for(var o=0;i--;)r[i]-=o,o=r[i]<a[i]?1:0,r[i]=o*Kn+r[i]-a[i];for(;!r[0]&&r.length>1;)r.shift()}return function(r,a,i,o){var c,d,f,h,p,g,y,j,w,x,S,N,A,P,E,O,k,R,D=r.constructor,U=r.s==a.s?1:-1,z=r.d,L=a.d;if(!r.s)return new D(r);if(!a.s)throw Error(ga+"Division by zero");for(d=r.e-a.e,k=L.length,E=z.length,y=new D(U),j=y.d=[],f=0;L[f]==(z[f]||0);)++f;if(L[f]>(z[f]||0)&&--d,i==null?N=i=D.precision:o?N=i+(kn(r)-kn(a))+1:N=i,N<0)return new D(0);if(N=N/pn+2|0,f=0,k==1)for(h=0,L=L[0],N++;(f<E||h)&&N--;f++)A=h*Kn+(z[f]||0),j[f]=A/L|0,h=A%L|0;else{for(h=Kn/(L[0]+1)|0,h>1&&(L=e(L,h),z=e(z,h),k=L.length,E=z.length),P=k,w=z.slice(0,k),x=w.length;x<k;)w[x++]=0;R=L.slice(),R.unshift(0),O=L[0],L[1]>=Kn/2&&++O;do h=0,c=t(L,w,k,x),c<0?(S=w[0],k!=x&&(S=S*Kn+(w[1]||0)),h=S/O|0,h>1?(h>=Kn&&(h=Kn-1),p=e(L,h),g=p.length,x=w.length,c=t(p,w,g,x),c==1&&(h--,n(p,k<g?R:L,g))):(h==0&&(c=h=1),p=L.slice()),g=p.length,g<x&&p.unshift(0),n(w,p,x),c==-1&&(x=w.length,c=t(L,w,k,x),c<1&&(h++,n(w,k<x?R:L,x))),x=w.length):c===0&&(h++,w=[0]),j[f++]=h,c&&w[0]?w[x++]=z[P]||0:(w=[z[P]],x=1);while((P++<E||w[0]!==void 0)&&N--)}return j[0]||j.shift(),y.e=d,tn(y,o?i+kn(y)+1:i)}})();function lL(e,t){var n,r,a,i,o,c,d=0,f=0,h=e.constructor,p=h.precision;if(kn(e)>16)throw Error(LN+kn(e));if(!e.s)return new h(Vr);for(mn=!1,c=p,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(r=Math.log(mo(2,f))/Math.LN10*2+5|0,c+=r,n=a=i=new h(Vr),h.precision=c;;){if(a=tn(a.times(e),c),n=n.times(++d),o=i.plus(Ls(a,n,c)),ts(o.d).slice(0,c)===ts(i.d).slice(0,c)){for(;f--;)i=tn(i.times(i),c);return h.precision=p,t==null?(mn=!0,tn(i,p)):i}i=o}}function kn(e){for(var t=e.e*pn,n=e.d[0];n>=10;n/=10)t++;return t}function Aw(e,t,n){if(t>e.LN10.sd())throw mn=!0,n&&(e.precision=n),Error(ga+"LN10 precision limit exceeded");return tn(new e(e.LN10),t)}function Ni(e){for(var t="";e--;)t+="0";return t}function Ad(e,t){var n,r,a,i,o,c,d,f,h,p=1,g=10,y=e,j=y.d,w=y.constructor,x=w.precision;if(y.s<1)throw Error(ga+(y.s?"NaN":"-Infinity"));if(y.eq(Vr))return new w(0);if(t==null?(mn=!1,f=x):f=t,y.eq(10))return t==null&&(mn=!0),Aw(w,f);if(f+=g,w.precision=f,n=ts(j),r=n.charAt(0),i=kn(y),Math.abs(i)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)y=y.times(e),n=ts(y.d),r=n.charAt(0),p++;i=kn(y),r>1?(y=new w("0."+n),i++):y=new w(r+"."+n.slice(1))}else return d=Aw(w,f+2,x).times(i+""),y=Ad(new w(r+"."+n.slice(1)),f-g).plus(d),w.precision=x,t==null?(mn=!0,tn(y,x)):y;for(c=o=y=Ls(y.minus(Vr),y.plus(Vr),f),h=tn(y.times(y),f),a=3;;){if(o=tn(o.times(h),f),d=c.plus(Ls(o,new w(a),f)),ts(d.d).slice(0,f)===ts(c.d).slice(0,f))return c=c.times(2),i!==0&&(c=c.plus(Aw(w,f+2,x).times(i+""))),c=Ls(c,new w(p),f),w.precision=x,t==null?(mn=!0,tn(c,x)):c;c=d,a+=2}}function BR(e,t){var n,r,a;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(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=Wc(n/pn),e.d=[],r=(n+1)%pn,n<0&&(r+=pn),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=pn;r<a;)e.d.push(+t.slice(r,r+=pn));t=t.slice(r),r=pn-t.length}else r-=a;for(;r--;)t+="0";if(e.d.push(+t),mn&&(e.e>zh||e.e<-zh))throw Error(LN+n)}else e.s=0,e.e=0,e.d=[0];return e}function tn(e,t,n){var r,a,i,o,c,d,f,h,p=e.d;for(o=1,i=p[0];i>=10;i/=10)o++;if(r=t-o,r<0)r+=pn,a=t,f=p[h=0];else{if(h=Math.ceil((r+1)/pn),i=p.length,h>=i)return e;for(f=i=p[h],o=1;i>=10;i/=10)o++;r%=pn,a=r-pn+o}if(n!==void 0&&(i=mo(10,o-a-1),c=f/i%10|0,d=t<0||p[h+1]!==void 0||f%i,d=n<4?(c||d)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||d||n==6&&(r>0?a>0?f/mo(10,o-a):0:p[h-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return d?(i=kn(e),p.length=1,t=t-i-1,p[0]=mo(10,(pn-t%pn)%pn),e.e=Wc(-t/pn)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(r==0?(p.length=h,i=1,h--):(p.length=h+1,i=mo(10,pn-r),p[h]=a>0?(f/mo(10,o-a)%mo(10,a)|0)*i:0),d)for(;;)if(h==0){(p[0]+=i)==Kn&&(p[0]=1,++e.e);break}else{if(p[h]+=i,p[h]!=Kn)break;p[h--]=0,i=1}for(r=p.length;p[--r]===0;)p.pop();if(mn&&(e.e>zh||e.e<-zh))throw Error(LN+kn(e));return e}function cL(e,t){var n,r,a,i,o,c,d,f,h,p,g=e.constructor,y=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),mn?tn(t,y):t;if(d=e.d,p=t.d,r=t.e,f=e.e,d=d.slice(),o=f-r,o){for(h=o<0,h?(n=d,o=-o,c=p.length):(n=p,r=f,c=d.length),a=Math.max(Math.ceil(y/pn),c)+2,o>a&&(o=a,n.length=1),n.reverse(),a=o;a--;)n.push(0);n.reverse()}else{for(a=d.length,c=p.length,h=a<c,h&&(c=a),a=0;a<c;a++)if(d[a]!=p[a]){h=d[a]<p[a];break}o=0}for(h&&(n=d,d=p,p=n,t.s=-t.s),c=d.length,a=p.length-c;a>0;--a)d[c++]=0;for(a=p.length;a>o;){if(d[--a]<p[a]){for(i=a;i&&d[--i]===0;)d[i]=Kn-1;--d[i],d[a]+=Kn}d[a]-=p[a]}for(;d[--c]===0;)d.pop();for(;d[0]===0;d.shift())--r;return d[0]?(t.d=d,t.e=r,mn?tn(t,y):t):new g(0)}function Oo(e,t,n){var r,a=kn(e),i=ts(e.d),o=i.length;return t?(n&&(r=n-o)>0?i=i.charAt(0)+"."+i.slice(1)+Ni(r):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+Ni(-a-1)+i,n&&(r=n-o)>0&&(i+=Ni(r))):a>=o?(i+=Ni(a+1-o),n&&(r=n-a-1)>0&&(i=i+"."+Ni(r))):((r=a+1)<o&&(i=i.slice(0,r)+"."+i.slice(r)),n&&(r=n-o)>0&&(a+1===o&&(i+="."),i+=Ni(r))),e.s<0?"-"+i:i}function zR(e,t){if(e.length>t)return e.length=t,!0}function uL(e){var t,n,r;function a(i){var o=this;if(!(o instanceof a))return new a(i);if(o.constructor=a,i instanceof a){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(So+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return BR(o,i.toString())}else if(typeof i!="string")throw Error(So+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,_ne.test(i))BR(o,i);else throw Error(So+i)}if(a.prototype=Qe,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=uL,a.config=a.set=Pne,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 a.config(e),a}function Pne(e){if(!e||typeof e!="object")throw Error(ga+"Object expected");var t,n,r,a=["precision",1,qc,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<a.length;t+=3)if((r=e[n=a[t]])!==void 0)if(Wc(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(So+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(So+n+": "+r);return this}var FN=uL(Ene);Vr=new FN(1);const Qt=FN;function One(e){return Ine(e)||Tne(e)||Rne(e)||kne()}function kne(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
68
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rne(e,t){if(e){if(typeof e=="string")return uj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uj(e,t)}}function Tne(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Ine(e){if(Array.isArray(e))return uj(e)}function uj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Mne=function(t){return t},dL={},fL=function(t){return t===dL},UR=function(t){return function n(){return arguments.length===0||arguments.length===1&&fL(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},$ne=function e(t,n){return t===1?n:UR(function(){for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];var o=a.filter(function(c){return c!==dL}).length;return o>=t?n.apply(void 0,a):e(t-o,UR(function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];var h=a.map(function(p){return fL(p)?d.shift():p});return n.apply(void 0,One(h).concat(d))}))})},Nv=function(t){return $ne(t.length,t)},dj=function(t,n){for(var r=[],a=t;a<n;++a)r[a-t]=a;return r},Dne=Nv(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),Lne=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return Mne;var a=n.reverse(),i=a[0],o=a.slice(1);return function(){return o.reduce(function(c,d){return d(c)},i.apply(void 0,arguments))}},fj=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},pL=function(t){var n=null,r=null;return function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return n&&i.every(function(c,d){return c===n[d]})||(n=i,r=t.apply(void 0,i)),r}};function Fne(e){var t;return e===0?t=1:t=Math.floor(new Qt(e).abs().log(10).toNumber())+1,t}function Bne(e,t,n){for(var r=new Qt(e),a=0,i=[];r.lt(t)&&a<1e5;)i.push(r.toNumber()),r=r.add(n),a++;return i}var zne=Nv(function(e,t,n){var r=+e,a=+t;return r+n*(a-r)}),Une=Nv(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),qne=Nv(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const Cv={rangeStep:Bne,getDigitCount:Fne,interpolateNumber:zne,uninterpolateNumber:Une,uninterpolateTruncation:qne};function pj(e){return Hne(e)||Vne(e)||hL(e)||Wne()}function Wne(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
69
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vne(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Hne(e){if(Array.isArray(e))return hj(e)}function Ed(e,t){return Yne(e)||Gne(e,t)||hL(e,t)||Kne()}function Kne(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
70
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hL(e,t){if(e){if(typeof e=="string")return hj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hj(e,t)}}function hj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Gne(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,a=!1,i=void 0;try{for(var o=e[Symbol.iterator](),c;!(r=(c=o.next()).done)&&(n.push(c.value),!(t&&n.length===t));r=!0);}catch(d){a=!0,i=d}finally{try{!r&&o.return!=null&&o.return()}finally{if(a)throw i}}return n}}function Yne(e){if(Array.isArray(e))return e}function mL(e){var t=Ed(e,2),n=t[0],r=t[1],a=n,i=r;return n>r&&(a=r,i=n),[a,i]}function vL(e,t,n){if(e.lte(0))return new Qt(0);var r=Cv.getDigitCount(e.toNumber()),a=new Qt(10).pow(r),i=e.div(a),o=r!==1?.05:.1,c=new Qt(Math.ceil(i.div(o).toNumber())).add(n).mul(o),d=c.mul(a);return t?d:new Qt(Math.ceil(d))}function Xne(e,t,n){var r=1,a=new Qt(e);if(!a.isint()&&n){var i=Math.abs(e);i<1?(r=new Qt(10).pow(Cv.getDigitCount(e)-1),a=new Qt(Math.floor(a.div(r).toNumber())).mul(r)):i>1&&(a=new Qt(Math.floor(e)))}else e===0?a=new Qt(Math.floor((t-1)/2)):n||(a=new Qt(Math.floor(e)));var o=Math.floor((t-1)/2),c=Lne(Dne(function(d){return a.add(new Qt(d-o).mul(r)).toNumber()}),dj);return c(0,t)}function gL(e,t,n,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Qt(0),tickMin:new Qt(0),tickMax:new Qt(0)};var i=vL(new Qt(t).sub(e).div(n-1),r,a),o;e<=0&&t>=0?o=new Qt(0):(o=new Qt(e).add(t).div(2),o=o.sub(new Qt(o).mod(i)));var c=Math.ceil(o.sub(e).div(i).toNumber()),d=Math.ceil(new Qt(t).sub(o).div(i).toNumber()),f=c+d+1;return f>n?gL(e,t,n,r,a+1):(f<n&&(d=t>0?d+(n-f):d,c=t>0?c:c+(n-f)),{step:i,tickMin:o.sub(new Qt(c).mul(i)),tickMax:o.add(new Qt(d).mul(i))})}function Qne(e){var t=Ed(e,2),n=t[0],r=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(a,2),c=mL([n,r]),d=Ed(c,2),f=d[0],h=d[1];if(f===-1/0||h===1/0){var p=h===1/0?[f].concat(pj(dj(0,a-1).map(function(){return 1/0}))):[].concat(pj(dj(0,a-1).map(function(){return-1/0})),[h]);return n>r?fj(p):p}if(f===h)return Xne(f,a,i);var g=gL(f,h,o,i),y=g.step,j=g.tickMin,w=g.tickMax,x=Cv.rangeStep(j,w.add(new Qt(.1).mul(y)),y);return n>r?fj(x):x}function Jne(e,t){var n=Ed(e,2),r=n[0],a=n[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=mL([r,a]),c=Ed(o,2),d=c[0],f=c[1];if(d===-1/0||f===1/0)return[r,a];if(d===f)return[d];var h=Math.max(t,2),p=vL(new Qt(f).sub(d).div(h-1),i,0),g=[].concat(pj(Cv.rangeStep(new Qt(d),new Qt(f).sub(new Qt(.99).mul(p)),p)),[f]);return r>a?fj(g):g}var Zne=pL(Qne),ere=pL(Jne),tre="Invariant failed";function ko(e,t){throw new Error(tre)}var nre=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function lc(e){"@babel/helpers - typeof";return lc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lc(e)}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)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Uh.apply(this,arguments)}function rre(e,t){return ore(e)||ire(e,t)||sre(e,t)||are()}function are(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
71
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sre(e,t){if(e){if(typeof e=="string")return qR(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qR(e,t)}}function qR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ire(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function ore(e){if(Array.isArray(e))return e}function lre(e,t){if(e==null)return{};var n=cre(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function cre(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ure(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dre(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,bL(r.key),r)}}function fre(e,t,n){return t&&dre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pre(e,t,n){return t=qh(t),hre(e,yL()?Reflect.construct(t,n||[],qh(e).constructor):t.apply(e,n))}function hre(e,t){if(t&&(lc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mre(e)}function mre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yL=function(){return!!e})()}function qh(e){return qh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qh(e)}function vre(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mj(e,t)}function mj(e,t){return mj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},mj(e,t)}function xL(e,t,n){return t=bL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bL(e){var t=gre(e,"string");return lc(t)=="symbol"?t:t+""}function gre(e,t){if(lc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(lc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var yf=(function(e){function t(){return ure(this,t),pre(this,t,arguments)}return vre(t,e),fre(t,[{key:"render",value:function(){var r=this.props,a=r.offset,i=r.layout,o=r.width,c=r.dataKey,d=r.data,f=r.dataPointFormatter,h=r.xAxis,p=r.yAxis,g=lre(r,nre),y=ht(g,!1);this.props.direction==="x"&&h.type!=="number"&&ko();var j=d.map(function(w){var x=f(w,c),S=x.x,N=x.y,A=x.value,P=x.errorVal;if(!P)return null;var E=[],O,k;if(Array.isArray(P)){var R=rre(P,2);O=R[0],k=R[1]}else O=k=P;if(i==="vertical"){var D=h.scale,U=N+a,z=U+o,L=U-o,G=D(A-O),q=D(A+k);E.push({x1:q,y1:z,x2:q,y2:L}),E.push({x1:G,y1:U,x2:q,y2:U}),E.push({x1:G,y1:z,x2:G,y2:L})}else if(i==="horizontal"){var H=p.scale,X=S+a,Z=X-o,I=X+o,F=H(A-O),Q=H(A+k);E.push({x1:Z,y1:Q,x2:I,y2:Q}),E.push({x1:X,y1:F,x2:X,y2:Q}),E.push({x1:Z,y1:F,x2:I,y2:F})}return W.createElement(Mt,Uh({className:"recharts-errorBar",key:"bar-".concat(E.map(function(B){return"".concat(B.x1,"-").concat(B.x2,"-").concat(B.y1,"-").concat(B.y2)}))},y),E.map(function(B){return W.createElement("line",Uh({},B,{key:"line-".concat(B.x1,"-").concat(B.x2,"-").concat(B.y1,"-").concat(B.y2)}))}))});return W.createElement(Mt,{className:"recharts-errorBars"},j)}}])})(W.Component);xL(yf,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});xL(yf,"displayName","ErrorBar");function _d(e){"@babel/helpers - typeof";return _d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_d(e)}function WR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function co(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WR(Object(n),!0).forEach(function(r){yre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yre(e,t,n){return t=xre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xre(e){var t=bre(e,"string");return _d(t)=="symbol"?t:t+""}function bre(e,t){if(_d(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(_d(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wL=function(t){var n=t.children,r=t.formattedGraphicalItems,a=t.legendWidth,i=t.legendContent,o=zr(n,Ul);if(!o)return null;var c=Ul.defaultProps,d=c!==void 0?co(co({},c),o.props):{},f;return o.props&&o.props.payload?f=o.props&&o.props.payload:i==="children"?f=(r||[]).reduce(function(h,p){var g=p.item,y=p.props,j=y.sectors||y.data||[];return h.concat(j.map(function(w){return{type:o.props.iconType||g.props.legendType,value:w.name,color:w.fill,payload:w}}))},[]):f=(r||[]).map(function(h){var p=h.item,g=p.type.defaultProps,y=g!==void 0?co(co({},g),p.props):{},j=y.dataKey,w=y.name,x=y.legendType,S=y.hide;return{inactive:S,dataKey:j,type:d.iconType||x||"square",color:BN(p),value:w||j,payload:y}}),co(co(co({},d),Ul.getWithHeight(o,a)),{},{payload:f,item:o})};function Pd(e){"@babel/helpers - typeof";return Pd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pd(e)}function VR(e){return Nre(e)||Sre(e)||jre(e)||wre()}function wre(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
72
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jre(e,t){if(e){if(typeof e=="string")return vj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vj(e,t)}}function Sre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Nre(e){if(Array.isArray(e))return vj(e)}function vj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function HR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function wn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HR(Object(n),!0).forEach(function(r){Wl(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wl(e,t,n){return t=Cre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cre(e){var t=Are(e,"string");return Pd(t)=="symbol"?t:t+""}function Are(e,t){if(Pd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Pd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ln(e,t,n){return jt(e)||jt(t)?n:Fn(t)?Qr(e,t,n):wt(t)?t(e):n}function td(e,t,n,r){var a=Nne(e,function(c){return Ln(c,t)});if(n==="number"){var i=a.filter(function(c){return De(c)||parseFloat(c)});return i.length?[Sv(i),jv(i)]:[1/0,-1/0]}var o=r?a.filter(function(c){return!jt(c)}):a;return o.map(function(c){return Fn(c)||c instanceof Date?c:""})}var Ere=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,c=(n=r?.length)!==null&&n!==void 0?n:0;if(c<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var d=i.range,f=0;f<c;f++){var h=f>0?a[f-1].coordinate:a[c-1].coordinate,p=a[f].coordinate,g=f>=c-1?a[0].coordinate:a[f+1].coordinate,y=void 0;if(fr(p-h)!==fr(g-p)){var j=[];if(fr(g-p)===fr(d[1]-d[0])){y=g;var w=p+d[1]-d[0];j[0]=Math.min(w,(w+h)/2),j[1]=Math.max(w,(w+h)/2)}else{y=h;var x=g+d[1]-d[0];j[0]=Math.min(p,(x+p)/2),j[1]=Math.max(p,(x+p)/2)}var S=[Math.min(p,(y+p)/2),Math.max(p,(y+p)/2)];if(t>S[0]&&t<=S[1]||t>=j[0]&&t<=j[1]){o=a[f].index;break}}else{var N=Math.min(h,g),A=Math.max(h,g);if(t>(N+p)/2&&t<=(A+p)/2){o=a[f].index;break}}}else for(var P=0;P<c;P++)if(P===0&&t<=(r[P].coordinate+r[P+1].coordinate)/2||P>0&&P<c-1&&t>(r[P].coordinate+r[P-1].coordinate)/2&&t<=(r[P].coordinate+r[P+1].coordinate)/2||P===c-1&&t>(r[P].coordinate+r[P-1].coordinate)/2){o=r[P].index;break}return o},BN=function(t){var n,r=t,a=r.type.displayName,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?wn(wn({},t.type.defaultProps),t.props):t.props,o=i.stroke,c=i.fill,d;switch(a){case"Line":d=o;break;case"Area":case"Radar":d=o&&o!=="none"?o:c;break;default:d=c;break}return d},_re=function(t){var n=t.barSize,r=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var o={},c=Object.keys(i),d=0,f=c.length;d<f;d++)for(var h=i[c[d]].stackGroups,p=Object.keys(h),g=0,y=p.length;g<y;g++){var j=h[p[g]],w=j.items,x=j.cateAxisId,S=w.filter(function(k){return $s(k.type).indexOf("Bar")>=0});if(S&&S.length){var N=S[0].type.defaultProps,A=N!==void 0?wn(wn({},N),S[0].props):S[0].props,P=A.barSize,E=A[x];o[E]||(o[E]=[]);var O=jt(P)?n:P;o[E].push({item:S[0],stackList:S.slice(1),barSize:jt(O)?void 0:pr(O,r,0)})}}return o},Pre=function(t){var n=t.barGap,r=t.barCategoryGap,a=t.bandSize,i=t.sizeList,o=i===void 0?[]:i,c=t.maxBarSize,d=o.length;if(d<1)return null;var f=pr(n,a,0,!0),h,p=[];if(o[0].barSize===+o[0].barSize){var g=!1,y=a/d,j=o.reduce(function(P,E){return P+E.barSize||0},0);j+=(d-1)*f,j>=a&&(j-=(d-1)*f,f=0),j>=a&&y>0&&(g=!0,y*=.9,j=d*y);var w=(a-j)/2>>0,x={offset:w-f,size:0};h=o.reduce(function(P,E){var O={item:E.item,position:{offset:x.offset+x.size+f,size:g?y:E.barSize}},k=[].concat(VR(P),[O]);return x=k[k.length-1].position,E.stackList&&E.stackList.length&&E.stackList.forEach(function(R){k.push({item:R,position:x})}),k},p)}else{var S=pr(r,a,0,!0);a-2*S-(d-1)*f<=0&&(f=0);var N=(a-2*S-(d-1)*f)/d;N>1&&(N>>=0);var A=c===+c?Math.min(N,c):N;h=o.reduce(function(P,E,O){var k=[].concat(VR(P),[{item:E.item,position:{offset:S+(N+f)*O+(N-A)/2,size:A}}]);return E.stackList&&E.stackList.length&&E.stackList.forEach(function(R){k.push({item:R,position:k[k.length-1].position})}),k},p)}return h},Ore=function(t,n,r,a){var i=r.children,o=r.width,c=r.margin,d=o-(c.left||0)-(c.right||0),f=wL({children:i,legendWidth:d});if(f){var h=a||{},p=h.width,g=h.height,y=f.align,j=f.verticalAlign,w=f.layout;if((w==="vertical"||w==="horizontal"&&j==="middle")&&y!=="center"&&De(t[y]))return wn(wn({},t),{},Wl({},y,t[y]+(p||0)));if((w==="horizontal"||w==="vertical"&&y==="center")&&j!=="middle"&&De(t[j]))return wn(wn({},t),{},Wl({},j,t[j]+(g||0)))}return t},kre=function(t,n,r){return jt(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},jL=function(t,n,r,a,i){var o=n.props.children,c=Jr(o,yf).filter(function(f){return kre(a,i,f.props.direction)});if(c&&c.length){var d=c.map(function(f){return f.props.dataKey});return t.reduce(function(f,h){var p=Ln(h,r);if(jt(p))return f;var g=Array.isArray(p)?[Sv(p),jv(p)]:[p,p],y=d.reduce(function(j,w){var x=Ln(h,w,0),S=g[0]-Math.abs(Array.isArray(x)?x[0]:x),N=g[1]+Math.abs(Array.isArray(x)?x[1]:x);return[Math.min(S,j[0]),Math.max(N,j[1])]},[1/0,-1/0]);return[Math.min(y[0],f[0]),Math.max(y[1],f[1])]},[1/0,-1/0])}return null},Rre=function(t,n,r,a,i){var o=n.map(function(c){return jL(t,c,r,i,a)}).filter(function(c){return!jt(c)});return o&&o.length?o.reduce(function(c,d){return[Math.min(c[0],d[0]),Math.max(c[1],d[1])]},[1/0,-1/0]):null},SL=function(t,n,r,a,i){var o=n.map(function(d){var f=d.props.dataKey;return r==="number"&&f&&jL(t,d,f,a)||td(t,f,r,i)});if(r==="number")return o.reduce(function(d,f){return[Math.min(d[0],f[0]),Math.max(d[1],f[1])]},[1/0,-1/0]);var c={};return o.reduce(function(d,f){for(var h=0,p=f.length;h<p;h++)c[f[h]]||(c[f[h]]=!0,d.push(f[h]));return d},[])},NL=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},bo=function(t,n,r){if(!t)return null;var a=t.scale,i=t.duplicateDomain,o=t.type,c=t.range,d=t.realScaleType==="scaleBand"?a.bandwidth()/2:2,f=(n||r)&&o==="category"&&a.bandwidth?a.bandwidth()/d:0;if(f=t.axisType==="angleAxis"&&c?.length>=2?fr(c[0]-c[1])*2*f:f,n&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(p){var g=i?i.indexOf(p):p;return{coordinate:a(g)+f,value:p,offset:f}});return h.filter(function(p){return!df(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,g){return{coordinate:a(p)+f,value:p,index:g,offset:f}}):a.ticks&&!r?a.ticks(t.tickCount).map(function(p){return{coordinate:a(p)+f,value:p,offset:f}}):a.domain().map(function(p,g){return{coordinate:a(p)+f,value:i?i[p]:p,index:g,offset:f}})},Ew=new WeakMap,Hp=function(t,n){if(typeof n!="function")return t;Ew.has(t)||Ew.set(t,new WeakMap);var r=Ew.get(t);if(r.has(n))return r.get(n);var a=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,a),a},CL=function(t,n,r){var a=t.scale,i=t.type,o=t.layout,c=t.axisType;if(a==="auto")return o==="radial"&&c==="radiusAxis"?{scale:wd(),realScaleType:"band"}:o==="radial"&&c==="angleAxis"?{scale:Dh(),realScaleType:"linear"}:i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:ed(),realScaleType:"point"}:i==="category"?{scale:wd(),realScaleType:"band"}:{scale:Dh(),realScaleType:"linear"};if(Eo(a)){var d="scale".concat(ov(a));return{scale:(kR[d]||ed)(),realScaleType:kR[d]?d:"point"}}return wt(a)?{scale:a}:{scale:ed(),realScaleType:"point"}},KR=1e-4,AL=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,a=t.range(),i=Math.min(a[0],a[1])-KR,o=Math.max(a[0],a[1])+KR,c=t(n[0]),d=t(n[r-1]);(c<i||c>o||d<i||d>o)&&t.domain([n[0],n[r-1]])}},Tre=function(t,n){if(!t)return null;for(var r=0,a=t.length;r<a;r++)if(t[r].item===n)return t[r].position;return null},Ire=function(t,n){if(!n||n.length!==2||!De(n[0])||!De(n[1]))return t;var r=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]),i=[t[0],t[1]];return(!De(t[0])||t[0]<r)&&(i[0]=r),(!De(t[1])||t[1]>a)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]<r&&(i[1]=r),i},Mre=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r<a;++r)for(var i=0,o=0,c=0;c<n;++c){var d=df(t[c][r][1])?t[c][r][0]:t[c][r][1];d>=0?(t[c][r][0]=i,t[c][r][1]=i+d,i=t[c][r][1]):(t[c][r][0]=o,t[c][r][1]=o+d,o=t[c][r][1])}},$re=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r<a;++r)for(var i=0,o=0;o<n;++o){var c=df(t[o][r][1])?t[o][r][0]:t[o][r][1];c>=0?(t[o][r][0]=i,t[o][r][1]=i+c,i=t[o][r][1]):(t[o][r][0]=0,t[o][r][1]=0)}},Dre={sign:Mre,expand:NX,none:ec,silhouette:CX,wiggle:AX,positive:$re},Lre=function(t,n,r){var a=n.map(function(c){return c.props.dataKey}),i=Dre[r],o=SX().keys(a).value(function(c,d){return+Ln(c,d,0)}).order(V1).offset(i);return o(t)},Fre=function(t,n,r,a,i,o){if(!t)return null;var c=o?n.reverse():n,d={},f=c.reduce(function(p,g){var y,j=(y=g.type)!==null&&y!==void 0&&y.defaultProps?wn(wn({},g.type.defaultProps),g.props):g.props,w=j.stackId,x=j.hide;if(x)return p;var S=j[r],N=p[S]||{hasStack:!1,stackGroups:{}};if(Fn(w)){var A=N.stackGroups[w]||{numericAxisId:r,cateAxisId:a,items:[]};A.items.push(g),N.hasStack=!0,N.stackGroups[w]=A}else N.stackGroups[Bc("_stackId_")]={numericAxisId:r,cateAxisId:a,items:[g]};return wn(wn({},p),{},Wl({},S,N))},d),h={};return Object.keys(f).reduce(function(p,g){var y=f[g];if(y.hasStack){var j={};y.stackGroups=Object.keys(y.stackGroups).reduce(function(w,x){var S=y.stackGroups[x];return wn(wn({},w),{},Wl({},x,{numericAxisId:r,cateAxisId:a,items:S.items,stackedData:Lre(t,S.items,i)}))},j)}return wn(wn({},p),{},Wl({},g,y))},h)},EL=function(t,n){var r=n.realScaleType,a=n.type,i=n.tickCount,o=n.originalDomain,c=n.allowDecimals,d=r||n.scale;if(d!=="auto"&&d!=="linear")return null;if(i&&a==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var f=t.domain();if(!f.length)return null;var h=Zne(f,i,c);return t.domain([Sv(h),jv(h)]),{niceTicks:h}}if(i&&a==="number"){var p=t.domain(),g=ere(p,i,c);return{niceTicks:g}}return null};function GR(e){var t=e.axis,n=e.ticks,r=e.bandSize,a=e.entry,i=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!jt(a[t.dataKey])){var c=yh(n,"value",a[t.dataKey]);if(c)return c.coordinate+r/2}return n[i]?n[i].coordinate+r/2:null}var d=Ln(a,jt(o)?t.dataKey:o);return jt(d)?null:t.scale(d)}var YR=function(t){var n=t.axis,r=t.ticks,a=t.offset,i=t.bandSize,o=t.entry,c=t.index;if(n.type==="category")return r[c]?r[c].coordinate+a:null;var d=Ln(o,n.dataKey,n.domain[c]);return jt(d)?null:n.scale(d)-i/2+a},Bre=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var a=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return a<=0&&i>=0?0:i<0?i:a}return r[0]},zre=function(t,n){var r,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?wn(wn({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(Fn(i)){var o=n[i];if(o){var c=o.items.indexOf(t);return c>=0?o.stackedData[c]:null}}return null},Ure=function(t){return t.reduce(function(n,r){return[Sv(r.concat([n[0]]).filter(De)),jv(r.concat([n[1]]).filter(De))]},[1/0,-1/0])},_L=function(t,n,r){return Object.keys(t).reduce(function(a,i){var o=t[i],c=o.stackedData,d=c.reduce(function(f,h){var p=Ure(h.slice(n,r+1));return[Math.min(f[0],p[0]),Math.max(f[1],p[1])]},[1/0,-1/0]);return[Math.min(d[0],a[0]),Math.max(d[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},XR=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,QR=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,gj=function(t,n,r){if(wt(t))return t(n,r);if(!Array.isArray(t))return n;var a=[];if(De(t[0]))a[0]=r?t[0]:Math.min(t[0],n[0]);else if(XR.test(t[0])){var i=+XR.exec(t[0])[1];a[0]=n[0]-i}else wt(t[0])?a[0]=t[0](n[0]):a[0]=n[0];if(De(t[1]))a[1]=r?t[1]:Math.max(t[1],n[1]);else if(QR.test(t[1])){var o=+QR.exec(t[1])[1];a[1]=n[1]+o}else wt(t[1])?a[1]=t[1](n[1]):a[1]=n[1];return a},Wh=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!r||a>0)return a}if(t&&n&&n.length>=2){for(var i=hN(n,function(p){return p.coordinate}),o=1/0,c=1,d=i.length;c<d;c++){var f=i[c],h=i[c-1];o=Math.min((f.coordinate||0)-(h.coordinate||0),o)}return o===1/0?0:o}return r?void 0:0},JR=function(t,n,r){return!t||!t.length||gf(t,Qr(r,"type.defaultProps.domain"))?n:t},PL=function(t,n){var r=t.type.defaultProps?wn(wn({},t.type.defaultProps),t.props):t.props,a=r.dataKey,i=r.name,o=r.unit,c=r.formatter,d=r.tooltipType,f=r.chartType,h=r.hide;return wn(wn({},ht(t,!1)),{},{dataKey:a,unit:o,formatter:c,name:i||a,color:BN(t),value:Ln(n,a),type:d,payload:n,chartType:f,hide:h})};function Od(e){"@babel/helpers - typeof";return Od=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Od(e)}function ZR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ps(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZR(Object(n),!0).forEach(function(r){OL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function OL(e,t,n){return t=qre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qre(e){var t=Wre(e,"string");return Od(t)=="symbol"?t:t+""}function Wre(e,t){if(Od(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Od(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vre(e,t){return Yre(e)||Gre(e,t)||Kre(e,t)||Hre()}function Hre(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
73
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kre(e,t){if(e){if(typeof e=="string")return eT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return eT(e,t)}}function eT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Gre(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function Yre(e){if(Array.isArray(e))return e}var Vh=Math.PI/180,Xre=function(t){return t*180/Math.PI},sn=function(t,n,r,a){return{x:t+Math.cos(-Vh*a)*r,y:n+Math.sin(-Vh*a)*r}},kL=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},Qre=function(t,n,r,a,i){var o=t.width,c=t.height,d=t.startAngle,f=t.endAngle,h=pr(t.cx,o,o/2),p=pr(t.cy,c,c/2),g=kL(o,c,r),y=pr(t.innerRadius,g,0),j=pr(t.outerRadius,g,g*.8),w=Object.keys(n);return w.reduce(function(x,S){var N=n[S],A=N.domain,P=N.reversed,E;if(jt(N.range))a==="angleAxis"?E=[d,f]:a==="radiusAxis"&&(E=[y,j]),P&&(E=[E[1],E[0]]);else{E=N.range;var O=E,k=Vre(O,2);d=k[0],f=k[1]}var R=CL(N,i),D=R.realScaleType,U=R.scale;U.domain(A).range(E),AL(U);var z=EL(U,Ps(Ps({},N),{},{realScaleType:D})),L=Ps(Ps(Ps({},N),z),{},{range:E,radius:j,realScaleType:D,scale:U,cx:h,cy:p,innerRadius:y,outerRadius:j,startAngle:d,endAngle:f});return Ps(Ps({},x),{},OL({},S,L))},{})},Jre=function(t,n){var r=t.x,a=t.y,i=n.x,o=n.y;return Math.sqrt(Math.pow(r-i,2)+Math.pow(a-o,2))},Zre=function(t,n){var r=t.x,a=t.y,i=n.cx,o=n.cy,c=Jre({x:r,y:a},{x:i,y:o});if(c<=0)return{radius:c};var d=(r-i)/c,f=Math.acos(d);return a>o&&(f=2*Math.PI-f),{radius:c,angle:Xre(f),angleInRadian:f}},eae=function(t){var n=t.startAngle,r=t.endAngle,a=Math.floor(n/360),i=Math.floor(r/360),o=Math.min(a,i);return{startAngle:n-o*360,endAngle:r-o*360}},tae=function(t,n){var r=n.startAngle,a=n.endAngle,i=Math.floor(r/360),o=Math.floor(a/360),c=Math.min(i,o);return t+c*360},tT=function(t,n){var r=t.x,a=t.y,i=Zre({x:r,y:a},n),o=i.radius,c=i.angle,d=n.innerRadius,f=n.outerRadius;if(o<d||o>f)return!1;if(o===0)return!0;var h=eae(n),p=h.startAngle,g=h.endAngle,y=c,j;if(p<=g){for(;y>g;)y-=360;for(;y<p;)y+=360;j=y>=p&&y<=g}else{for(;y>p;)y-=360;for(;y<g;)y+=360;j=y>=g&&y<=p}return j?Ps(Ps({},n),{},{radius:o,angle:tae(y,n)}):null},RL=function(t){return!v.isValidElement(t)&&!wt(t)&&typeof t!="boolean"?t.className:""};function kd(e){"@babel/helpers - typeof";return kd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kd(e)}var nae=["offset"];function rae(e){return oae(e)||iae(e)||sae(e)||aae()}function aae(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
74
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sae(e,t){if(e){if(typeof e=="string")return yj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yj(e,t)}}function iae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function oae(e){if(Array.isArray(e))return yj(e)}function yj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function lae(e,t){if(e==null)return{};var n=cae(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function cae(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function nT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Dn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nT(Object(n),!0).forEach(function(r){uae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uae(e,t,n){return t=dae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dae(e){var t=fae(e,"string");return kd(t)=="symbol"?t:t+""}function fae(e,t){if(kd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(kd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rd(){return Rd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rd.apply(this,arguments)}var pae=function(t){var n=t.value,r=t.formatter,a=jt(t.children)?n:t.children;return wt(r)?r(a):a},hae=function(t,n){var r=fr(n-t),a=Math.min(Math.abs(n-t),360);return r*a},mae=function(t,n,r){var a=t.position,i=t.viewBox,o=t.offset,c=t.className,d=i,f=d.cx,h=d.cy,p=d.innerRadius,g=d.outerRadius,y=d.startAngle,j=d.endAngle,w=d.clockWise,x=(p+g)/2,S=hae(y,j),N=S>=0?1:-1,A,P;a==="insideStart"?(A=y+N*o,P=w):a==="insideEnd"?(A=j-N*o,P=!w):a==="end"&&(A=j+N*o,P=w),P=S<=0?P:!P;var E=sn(f,h,x,A),O=sn(f,h,x,A+(P?1:-1)*359),k="M".concat(E.x,",").concat(E.y,`
|
|
75
|
+
A`).concat(x,",").concat(x,",0,1,").concat(P?0:1,`,
|
|
76
|
+
`).concat(O.x,",").concat(O.y),R=jt(t.id)?Bc("recharts-radial-line-"):t.id;return W.createElement("text",Rd({},r,{dominantBaseline:"central",className:St("recharts-radial-bar-label",c)}),W.createElement("defs",null,W.createElement("path",{id:R,d:k})),W.createElement("textPath",{xlinkHref:"#".concat(R)},n))},vae=function(t){var n=t.viewBox,r=t.offset,a=t.position,i=n,o=i.cx,c=i.cy,d=i.innerRadius,f=i.outerRadius,h=i.startAngle,p=i.endAngle,g=(h+p)/2;if(a==="outside"){var y=sn(o,c,f+r,g),j=y.x,w=y.y;return{x:j,y:w,textAnchor:j>=o?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:o,y:c,textAnchor:"middle",verticalAnchor:"end"};var x=(d+f)/2,S=sn(o,c,x,g),N=S.x,A=S.y;return{x:N,y:A,textAnchor:"middle",verticalAnchor:"middle"}},gae=function(t){var n=t.viewBox,r=t.parentViewBox,a=t.offset,i=t.position,o=n,c=o.x,d=o.y,f=o.width,h=o.height,p=h>=0?1:-1,g=p*a,y=p>0?"end":"start",j=p>0?"start":"end",w=f>=0?1:-1,x=w*a,S=w>0?"end":"start",N=w>0?"start":"end";if(i==="top"){var A={x:c+f/2,y:d-p*a,textAnchor:"middle",verticalAnchor:y};return Dn(Dn({},A),r?{height:Math.max(d-r.y,0),width:f}:{})}if(i==="bottom"){var P={x:c+f/2,y:d+h+g,textAnchor:"middle",verticalAnchor:j};return Dn(Dn({},P),r?{height:Math.max(r.y+r.height-(d+h),0),width:f}:{})}if(i==="left"){var E={x:c-x,y:d+h/2,textAnchor:S,verticalAnchor:"middle"};return Dn(Dn({},E),r?{width:Math.max(E.x-r.x,0),height:h}:{})}if(i==="right"){var O={x:c+f+x,y:d+h/2,textAnchor:N,verticalAnchor:"middle"};return Dn(Dn({},O),r?{width:Math.max(r.x+r.width-O.x,0),height:h}:{})}var k=r?{width:f,height:h}:{};return i==="insideLeft"?Dn({x:c+x,y:d+h/2,textAnchor:N,verticalAnchor:"middle"},k):i==="insideRight"?Dn({x:c+f-x,y:d+h/2,textAnchor:S,verticalAnchor:"middle"},k):i==="insideTop"?Dn({x:c+f/2,y:d+g,textAnchor:"middle",verticalAnchor:j},k):i==="insideBottom"?Dn({x:c+f/2,y:d+h-g,textAnchor:"middle",verticalAnchor:y},k):i==="insideTopLeft"?Dn({x:c+x,y:d+g,textAnchor:N,verticalAnchor:j},k):i==="insideTopRight"?Dn({x:c+f-x,y:d+g,textAnchor:S,verticalAnchor:j},k):i==="insideBottomLeft"?Dn({x:c+x,y:d+h-g,textAnchor:N,verticalAnchor:y},k):i==="insideBottomRight"?Dn({x:c+f-x,y:d+h-g,textAnchor:S,verticalAnchor:y},k):Fc(i)&&(De(i.x)||go(i.x))&&(De(i.y)||go(i.y))?Dn({x:c+pr(i.x,f),y:d+pr(i.y,h),textAnchor:"end",verticalAnchor:"end"},k):Dn({x:c+f/2,y:d+h/2,textAnchor:"middle",verticalAnchor:"middle"},k)},yae=function(t){return"cx"in t&&De(t.cx)};function Gn(e){var t=e.offset,n=t===void 0?5:t,r=lae(e,nae),a=Dn({offset:n},r),i=a.viewBox,o=a.position,c=a.value,d=a.children,f=a.content,h=a.className,p=h===void 0?"":h,g=a.textBreakAll;if(!i||jt(c)&&jt(d)&&!v.isValidElement(f)&&!wt(f))return null;if(v.isValidElement(f))return v.cloneElement(f,a);var y;if(wt(f)){if(y=v.createElement(f,a),v.isValidElement(y))return y}else y=pae(a);var j=yae(i),w=ht(a,!0);if(j&&(o==="insideStart"||o==="insideEnd"||o==="end"))return mae(a,y,w);var x=j?vae(a):gae(a);return W.createElement(Po,Rd({className:St("recharts-label",p)},w,x,{breakAll:g}),y)}Gn.displayName="Label";var TL=function(t){var n=t.cx,r=t.cy,a=t.angle,i=t.startAngle,o=t.endAngle,c=t.r,d=t.radius,f=t.innerRadius,h=t.outerRadius,p=t.x,g=t.y,y=t.top,j=t.left,w=t.width,x=t.height,S=t.clockWise,N=t.labelViewBox;if(N)return N;if(De(w)&&De(x)){if(De(p)&&De(g))return{x:p,y:g,width:w,height:x};if(De(y)&&De(j))return{x:y,y:j,width:w,height:x}}return De(p)&&De(g)?{x:p,y:g,width:0,height:0}:De(n)&&De(r)?{cx:n,cy:r,startAngle:i||a||0,endAngle:o||a||0,innerRadius:f||0,outerRadius:h||d||c||0,clockWise:S}:t.viewBox?t.viewBox:{}},xae=function(t,n){return t?t===!0?W.createElement(Gn,{key:"label-implicit",viewBox:n}):Fn(t)?W.createElement(Gn,{key:"label-implicit",viewBox:n,value:t}):v.isValidElement(t)?t.type===Gn?v.cloneElement(t,{key:"label-implicit",viewBox:n}):W.createElement(Gn,{key:"label-implicit",content:t,viewBox:n}):wt(t)?W.createElement(Gn,{key:"label-implicit",content:t,viewBox:n}):Fc(t)?W.createElement(Gn,Rd({viewBox:n},t,{key:"label-implicit"})):null:null},bae=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var a=t.children,i=TL(t),o=Jr(a,Gn).map(function(d,f){return v.cloneElement(d,{viewBox:n||i,key:"label-".concat(f)})});if(!r)return o;var c=xae(t.label,n||i);return[c].concat(rae(o))};Gn.parseViewBox=TL;Gn.renderCallByParent=bae;var _w,rT;function wae(){if(rT)return _w;rT=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return _w=e,_w}var jae=wae();const Sae=Yt(jae);function Td(e){"@babel/helpers - typeof";return Td=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Td(e)}var Nae=["valueAccessor"],Cae=["data","dataKey","clockWise","id","textBreakAll"];function Aae(e){return Oae(e)||Pae(e)||_ae(e)||Eae()}function Eae(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
77
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _ae(e,t){if(e){if(typeof e=="string")return xj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xj(e,t)}}function Pae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Oae(e){if(Array.isArray(e))return xj(e)}function xj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}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)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hh.apply(this,arguments)}function aT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function sT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aT(Object(n),!0).forEach(function(r){kae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kae(e,t,n){return t=Rae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rae(e){var t=Tae(e,"string");return Td(t)=="symbol"?t:t+""}function Tae(e,t){if(Td(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Td(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function iT(e,t){if(e==null)return{};var n=Iae(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Iae(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Mae=function(t){return Array.isArray(t.value)?Sae(t.value):t.value};function Fs(e){var t=e.valueAccessor,n=t===void 0?Mae:t,r=iT(e,Nae),a=r.data,i=r.dataKey,o=r.clockWise,c=r.id,d=r.textBreakAll,f=iT(r,Cae);return!a||!a.length?null:W.createElement(Mt,{className:"recharts-label-list"},a.map(function(h,p){var g=jt(i)?n(h,p):Ln(h&&h.payload,i),y=jt(c)?{}:{id:"".concat(c,"-").concat(p)};return W.createElement(Gn,Hh({},ht(h,!0),f,y,{parentViewBox:h.parentViewBox,value:g,textBreakAll:d,viewBox:Gn.parseViewBox(jt(o)?h:sT(sT({},h),{},{clockWise:o})),key:"label-".concat(p),index:p}))}))}Fs.displayName="LabelList";function $ae(e,t){return e?e===!0?W.createElement(Fs,{key:"labelList-implicit",data:t}):W.isValidElement(e)||wt(e)?W.createElement(Fs,{key:"labelList-implicit",data:t,content:e}):Fc(e)?W.createElement(Fs,Hh({data:t},e,{key:"labelList-implicit"})):null:null}function Dae(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,a=Jr(r,Fs).map(function(o,c){return v.cloneElement(o,{data:t,key:"labelList-".concat(c)})});if(!n)return a;var i=$ae(e.label,t);return[i].concat(Aae(a))}Fs.renderCallByParent=Dae;function Id(e){"@babel/helpers - typeof";return Id=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Id(e)}function bj(){return bj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bj.apply(this,arguments)}function oT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function lT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oT(Object(n),!0).forEach(function(r){Lae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lae(e,t,n){return t=Fae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fae(e){var t=Bae(e,"string");return Id(t)=="symbol"?t:t+""}function Bae(e,t){if(Id(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Id(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zae=function(t,n){var r=fr(n-t),a=Math.min(Math.abs(n-t),359.999);return r*a},Kp=function(t){var n=t.cx,r=t.cy,a=t.radius,i=t.angle,o=t.sign,c=t.isExternal,d=t.cornerRadius,f=t.cornerIsExternal,h=d*(c?1:-1)+a,p=Math.asin(d/h)/Vh,g=f?i:i+o*p,y=sn(n,r,h,g),j=sn(n,r,a,g),w=f?i-o*p:i,x=sn(n,r,h*Math.cos(p*Vh),w);return{center:y,circleTangency:j,lineTangency:x,theta:p}},IL=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.startAngle,c=t.endAngle,d=zae(o,c),f=o+d,h=sn(n,r,i,o),p=sn(n,r,i,f),g="M ".concat(h.x,",").concat(h.y,`
|
|
78
|
+
A `).concat(i,",").concat(i,`,0,
|
|
79
|
+
`).concat(+(Math.abs(d)>180),",").concat(+(o>f),`,
|
|
80
|
+
`).concat(p.x,",").concat(p.y,`
|
|
81
|
+
`);if(a>0){var y=sn(n,r,a,o),j=sn(n,r,a,f);g+="L ".concat(j.x,",").concat(j.y,`
|
|
82
|
+
A `).concat(a,",").concat(a,`,0,
|
|
83
|
+
`).concat(+(Math.abs(d)>180),",").concat(+(o<=f),`,
|
|
84
|
+
`).concat(y.x,",").concat(y.y," Z")}else g+="L ".concat(n,",").concat(r," Z");return g},Uae=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,c=t.forceCornerRadius,d=t.cornerIsExternal,f=t.startAngle,h=t.endAngle,p=fr(h-f),g=Kp({cx:n,cy:r,radius:i,angle:f,sign:p,cornerRadius:o,cornerIsExternal:d}),y=g.circleTangency,j=g.lineTangency,w=g.theta,x=Kp({cx:n,cy:r,radius:i,angle:h,sign:-p,cornerRadius:o,cornerIsExternal:d}),S=x.circleTangency,N=x.lineTangency,A=x.theta,P=d?Math.abs(f-h):Math.abs(f-h)-w-A;if(P<0)return c?"M ".concat(j.x,",").concat(j.y,`
|
|
85
|
+
a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
|
|
86
|
+
a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
|
|
87
|
+
`):IL({cx:n,cy:r,innerRadius:a,outerRadius:i,startAngle:f,endAngle:h});var E="M ".concat(j.x,",").concat(j.y,`
|
|
88
|
+
A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(y.x,",").concat(y.y,`
|
|
89
|
+
A`).concat(i,",").concat(i,",0,").concat(+(P>180),",").concat(+(p<0),",").concat(S.x,",").concat(S.y,`
|
|
90
|
+
A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(N.x,",").concat(N.y,`
|
|
91
|
+
`);if(a>0){var O=Kp({cx:n,cy:r,radius:a,angle:f,sign:p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),k=O.circleTangency,R=O.lineTangency,D=O.theta,U=Kp({cx:n,cy:r,radius:a,angle:h,sign:-p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),z=U.circleTangency,L=U.lineTangency,G=U.theta,q=d?Math.abs(f-h):Math.abs(f-h)-D-G;if(q<0&&o===0)return"".concat(E,"L").concat(n,",").concat(r,"Z");E+="L".concat(L.x,",").concat(L.y,`
|
|
92
|
+
A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(z.x,",").concat(z.y,`
|
|
93
|
+
A`).concat(a,",").concat(a,",0,").concat(+(q>180),",").concat(+(p>0),",").concat(k.x,",").concat(k.y,`
|
|
94
|
+
A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(R.x,",").concat(R.y,"Z")}else E+="L".concat(n,",").concat(r,"Z");return E},qae={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},ML=function(t){var n=lT(lT({},qae),t),r=n.cx,a=n.cy,i=n.innerRadius,o=n.outerRadius,c=n.cornerRadius,d=n.forceCornerRadius,f=n.cornerIsExternal,h=n.startAngle,p=n.endAngle,g=n.className;if(o<i||h===p)return null;var y=St("recharts-sector",g),j=o-i,w=pr(c,j,0,!0),x;return w>0&&Math.abs(h-p)<360?x=Uae({cx:r,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(w,j/2),forceCornerRadius:d,cornerIsExternal:f,startAngle:h,endAngle:p}):x=IL({cx:r,cy:a,innerRadius:i,outerRadius:o,startAngle:h,endAngle:p}),W.createElement("path",bj({},ht(n,!0),{className:y,d:x,role:"img"}))};function Md(e){"@babel/helpers - typeof";return Md=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Md(e)}function wj(){return wj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wj.apply(this,arguments)}function cT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function uT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cT(Object(n),!0).forEach(function(r){Wae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wae(e,t,n){return t=Vae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vae(e){var t=Hae(e,"string");return Md(t)=="symbol"?t:t+""}function Hae(e,t){if(Md(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Md(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var dT={curveBasisClosed:fX,curveBasisOpen:pX,curveBasis:dX,curveBumpX:QY,curveBumpY:JY,curveLinearClosed:hX,curveLinear:cv,curveMonotoneX:mX,curveMonotoneY:vX,curveNatural:gX,curveStep:yX,curveStepAfter:bX,curveStepBefore:xX},Gp=function(t){return t.x===+t.x&&t.y===+t.y},Lu=function(t){return t.x},Fu=function(t){return t.y},Kae=function(t,n){if(wt(t))return t;var r="curve".concat(ov(t));return(r==="curveMonotone"||r==="curveBump")&&n?dT["".concat(r).concat(n==="vertical"?"Y":"X")]:dT[r]||cv},Gae=function(t){var n=t.type,r=n===void 0?"linear":n,a=t.points,i=a===void 0?[]:a,o=t.baseLine,c=t.layout,d=t.connectNulls,f=d===void 0?!1:d,h=Kae(r,c),p=f?i.filter(function(w){return Gp(w)}):i,g;if(Array.isArray(o)){var y=f?o.filter(function(w){return Gp(w)}):o,j=p.map(function(w,x){return uT(uT({},w),{},{base:y[x]})});return c==="vertical"?g=Fp().y(Fu).x1(Lu).x0(function(w){return w.base.x}):g=Fp().x(Lu).y1(Fu).y0(function(w){return w.base.y}),g.defined(Gp).curve(h),g(j)}return c==="vertical"&&De(o)?g=Fp().y(Fu).x1(Lu).x0(o):De(o)?g=Fp().x(Lu).y1(Fu).y0(o):g=M3().x(Lu).y(Fu),g.defined(Gp).curve(h),g(p)},Kh=function(t){var n=t.className,r=t.points,a=t.path,i=t.pathRef;if((!r||!r.length)&&!a)return null;var o=r&&r.length?Gae(t):a;return v.createElement("path",wj({},ht(t,!1),xh(t),{className:St("recharts-curve",n),d:o,ref:i}))},Pw={exports:{}},Ow,fT;function Yae(){if(fT)return Ow;fT=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ow=e,Ow}var kw,pT;function Xae(){if(pT)return kw;pT=1;var e=Yae();function t(){}function n(){}return n.resetWarningCache=t,kw=function(){function r(o,c,d,f,h,p){if(p!==e){var g=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw g.name="Invariant Violation",g}}r.isRequired=r;function a(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},kw}var hT;function Qae(){return hT||(hT=1,Pw.exports=Xae()()),Pw.exports}var Jae=Qae();const Bt=Yt(Jae),{getOwnPropertyNames:Zae,getOwnPropertySymbols:ese}=Object,{hasOwnProperty:tse}=Object.prototype;function Rw(e,t){return function(r,a,i){return e(r,a,i)&&t(r,a,i)}}function Yp(e){return function(n,r,a){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,a);const{cache:i}=a,o=i.get(n),c=i.get(r);if(o&&c)return o===r&&c===n;i.set(n,r),i.set(r,n);const d=e(n,r,a);return i.delete(n),i.delete(r),d}}function nse(e){return e?.[Symbol.toStringTag]}function mT(e){return Zae(e).concat(ese(e))}const rse=Object.hasOwn||((e,t)=>tse.call(e,t));function qo(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const ase="__v",sse="__o",ise="_owner",{getOwnPropertyDescriptor:vT,keys:gT}=Object;function ose(e,t){return e.byteLength===t.byteLength&&Gh(new Uint8Array(e),new Uint8Array(t))}function lse(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function cse(e,t){return e.byteLength===t.byteLength&&Gh(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function use(e,t){return qo(e.getTime(),t.getTime())}function dse(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function fse(e,t){return e===t}function yT(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const a=new Array(r),i=e.entries();let o,c,d=0;for(;(o=i.next())&&!o.done;){const f=t.entries();let h=!1,p=0;for(;(c=f.next())&&!c.done;){if(a[p]){p++;continue}const g=o.value,y=c.value;if(n.equals(g[0],y[0],d,p,e,t,n)&&n.equals(g[1],y[1],g[0],y[0],e,t,n)){h=a[p]=!0;break}p++}if(!h)return!1;d++}return!0}const pse=qo;function hse(e,t,n){const r=gT(e);let a=r.length;if(gT(t).length!==a)return!1;for(;a-- >0;)if(!$L(e,t,n,r[a]))return!1;return!0}function Bu(e,t,n){const r=mT(e);let a=r.length;if(mT(t).length!==a)return!1;let i,o,c;for(;a-- >0;)if(i=r[a],!$L(e,t,n,i)||(o=vT(e,i),c=vT(t,i),(o||c)&&(!o||!c||o.configurable!==c.configurable||o.enumerable!==c.enumerable||o.writable!==c.writable)))return!1;return!0}function mse(e,t){return qo(e.valueOf(),t.valueOf())}function vse(e,t){return e.source===t.source&&e.flags===t.flags}function xT(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const a=new Array(r),i=e.values();let o,c;for(;(o=i.next())&&!o.done;){const d=t.values();let f=!1,h=0;for(;(c=d.next())&&!c.done;){if(!a[h]&&n.equals(o.value,c.value,o.value,c.value,e,t,n)){f=a[h]=!0;break}h++}if(!f)return!1}return!0}function Gh(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function gse(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function $L(e,t,n,r){return(r===ise||r===sse||r===ase)&&(e.$$typeof||t.$$typeof)?!0:rse(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const yse="[object ArrayBuffer]",xse="[object Arguments]",bse="[object Boolean]",wse="[object DataView]",jse="[object Date]",Sse="[object Error]",Nse="[object Map]",Cse="[object Number]",Ase="[object Object]",Ese="[object RegExp]",_se="[object Set]",Pse="[object String]",Ose={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},kse="[object URL]",Rse=Object.prototype.toString;function Tse({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:a,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:c,areObjectsEqual:d,arePrimitiveWrappersEqual:f,areRegExpsEqual:h,areSetsEqual:p,areTypedArraysEqual:g,areUrlsEqual:y,unknownTagComparators:j}){return function(x,S,N){if(x===S)return!0;if(x==null||S==null)return!1;const A=typeof x;if(A!==typeof S)return!1;if(A!=="object")return A==="number"?c(x,S,N):A==="function"?i(x,S,N):!1;const P=x.constructor;if(P!==S.constructor)return!1;if(P===Object)return d(x,S,N);if(Array.isArray(x))return t(x,S,N);if(P===Date)return r(x,S,N);if(P===RegExp)return h(x,S,N);if(P===Map)return o(x,S,N);if(P===Set)return p(x,S,N);const E=Rse.call(x);if(E===jse)return r(x,S,N);if(E===Ese)return h(x,S,N);if(E===Nse)return o(x,S,N);if(E===_se)return p(x,S,N);if(E===Ase)return typeof x.then!="function"&&typeof S.then!="function"&&d(x,S,N);if(E===kse)return y(x,S,N);if(E===Sse)return a(x,S,N);if(E===xse)return d(x,S,N);if(Ose[E])return g(x,S,N);if(E===yse)return e(x,S,N);if(E===wse)return n(x,S,N);if(E===bse||E===Cse||E===Pse)return f(x,S,N);if(j){let O=j[E];if(!O){const k=nse(x);k&&(O=j[k])}if(O)return O(x,S,N)}return!1}}function Ise({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:ose,areArraysEqual:n?Bu:lse,areDataViewsEqual:cse,areDatesEqual:use,areErrorsEqual:dse,areFunctionsEqual:fse,areMapsEqual:n?Rw(yT,Bu):yT,areNumbersEqual:pse,areObjectsEqual:n?Bu:hse,arePrimitiveWrappersEqual:mse,areRegExpsEqual:vse,areSetsEqual:n?Rw(xT,Bu):xT,areTypedArraysEqual:n?Rw(Gh,Bu):Gh,areUrlsEqual:gse,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const a=Yp(r.areArraysEqual),i=Yp(r.areMapsEqual),o=Yp(r.areObjectsEqual),c=Yp(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:c})}return r}function Mse(e){return function(t,n,r,a,i,o,c){return e(t,n,c)}}function $se({circular:e,comparator:t,createState:n,equals:r,strict:a}){if(n)return function(c,d){const{cache:f=e?new WeakMap:void 0,meta:h}=n();return t(c,d,{cache:f,equals:r,meta:h,strict:a})};if(e)return function(c,d){return t(c,d,{cache:new WeakMap,equals:r,meta:void 0,strict:a})};const i={cache:void 0,equals:r,meta:void 0,strict:a};return function(c,d){return t(c,d,i)}}const Dse=Wi();Wi({strict:!0});Wi({circular:!0});Wi({circular:!0,strict:!0});Wi({createInternalComparator:()=>qo});Wi({strict:!0,createInternalComparator:()=>qo});Wi({circular:!0,createInternalComparator:()=>qo});Wi({circular:!0,createInternalComparator:()=>qo,strict:!0});function Wi(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:a=!1}=e,i=Ise(e),o=Tse(i),c=n?n(o):Mse(o);return $se({circular:t,comparator:o,createState:r,equals:c,strict:a})}function Lse(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function bT(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function a(i){n<0&&(n=i),i-n>t?(e(i),n=-1):Lse(a)};requestAnimationFrame(r)}function jj(e){"@babel/helpers - typeof";return jj=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jj(e)}function Fse(e){return qse(e)||Use(e)||zse(e)||Bse()}function Bse(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
95
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zse(e,t){if(e){if(typeof e=="string")return wT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wT(e,t)}}function wT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Use(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function qse(e){if(Array.isArray(e))return e}function Wse(){var e={},t=function(){return null},n=!1,r=function a(i){if(!n){if(Array.isArray(i)){if(!i.length)return;var o=i,c=Fse(o),d=c[0],f=c.slice(1);if(typeof d=="number"){bT(a.bind(null,f),d);return}a(d),bT(a.bind(null,f));return}jj(i)==="object"&&(e=i,t(e)),typeof i=="function"&&i()}};return{stop:function(){n=!0},start:function(i){n=!1,r(i)},subscribe:function(i){return t=i,function(){t=function(){return null}}}}}function $d(e){"@babel/helpers - typeof";return $d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$d(e)}function jT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ST(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jT(Object(n),!0).forEach(function(r){DL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function DL(e,t,n){return t=Vse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vse(e){var t=Hse(e,"string");return $d(t)==="symbol"?t:String(t)}function Hse(e,t){if($d(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($d(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Kse=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,a){return r.filter(function(i){return a.includes(i)})})},Gse=function(t){return t},Yse=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},nd=function(t,n){return Object.keys(n).reduce(function(r,a){return ST(ST({},r),{},DL({},a,t(a,n[a])))},{})},NT=function(t,n,r){return t.map(function(a){return"".concat(Yse(a)," ").concat(n,"ms ").concat(r)}).join(",")};function Xse(e,t){return Zse(e)||Jse(e,t)||LL(e,t)||Qse()}function Qse(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
96
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jse(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function Zse(e){if(Array.isArray(e))return e}function eie(e){return rie(e)||nie(e)||LL(e)||tie()}function tie(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
97
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LL(e,t){if(e){if(typeof e=="string")return Sj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sj(e,t)}}function nie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function rie(e){if(Array.isArray(e))return Sj(e)}function Sj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Yh=1e-4,FL=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},BL=function(t,n){return t.map(function(r,a){return r*Math.pow(n,a)}).reduce(function(r,a){return r+a})},CT=function(t,n){return function(r){var a=FL(t,n);return BL(a,r)}},aie=function(t,n){return function(r){var a=FL(t,n),i=[].concat(eie(a.map(function(o,c){return o*c}).slice(1)),[0]);return BL(i,r)}},AT=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0],i=n[1],o=n[2],c=n[3];if(n.length===1)switch(n[0]){case"linear":a=0,i=0,o=1,c=1;break;case"ease":a=.25,i=.1,o=.25,c=1;break;case"ease-in":a=.42,i=0,o=1,c=1;break;case"ease-out":a=.42,i=0,o=.58,c=1;break;case"ease-in-out":a=0,i=0,o=.58,c=1;break;default:{var d=n[0].split("(");if(d[0]==="cubic-bezier"&&d[1].split(")")[0].split(",").length===4){var f=d[1].split(")")[0].split(",").map(function(x){return parseFloat(x)}),h=Xse(f,4);a=h[0],i=h[1],o=h[2],c=h[3]}}}var p=CT(a,o),g=CT(i,c),y=aie(a,o),j=function(S){return S>1?1:S<0?0:S},w=function(S){for(var N=S>1?1:S,A=N,P=0;P<8;++P){var E=p(A)-N,O=y(A);if(Math.abs(E-N)<Yh||O<Yh)return g(A);A=j(A-E/O)}return g(A)};return w.isStepper=!1,w},sie=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,a=t.damping,i=a===void 0?8:a,o=t.dt,c=o===void 0?17:o,d=function(h,p,g){var y=-(h-p)*r,j=g*i,w=g+(y-j)*c/1e3,x=g*c/1e3+h;return Math.abs(x-p)<Yh&&Math.abs(w)<Yh?[p,0]:[x,w]};return d.isStepper=!0,d.dt=c,d},iie=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0];if(typeof a=="string")switch(a){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return AT(a);case"spring":return sie();default:if(a.split("(")[0]==="cubic-bezier")return AT(a)}return typeof a=="function"?a:null};function Dd(e){"@babel/helpers - typeof";return Dd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dd(e)}function ET(e){return cie(e)||lie(e)||zL(e)||oie()}function oie(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
98
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function cie(e){if(Array.isArray(e))return Cj(e)}function _T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Jn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_T(Object(n),!0).forEach(function(r){Nj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_T(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nj(e,t,n){return t=uie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uie(e){var t=die(e,"string");return Dd(t)==="symbol"?t:String(t)}function die(e,t){if(Dd(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Dd(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fie(e,t){return mie(e)||hie(e,t)||zL(e,t)||pie()}function pie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
99
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zL(e,t){if(e){if(typeof e=="string")return Cj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cj(e,t)}}function Cj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function hie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function mie(e){if(Array.isArray(e))return e}var Xh=function(t,n,r){return t+(n-t)*r},Aj=function(t){var n=t.from,r=t.to;return n!==r},vie=function e(t,n,r){var a=nd(function(i,o){if(Aj(o)){var c=t(o.from,o.to,o.velocity),d=fie(c,2),f=d[0],h=d[1];return Jn(Jn({},o),{},{from:f,velocity:h})}return o},n);return r<1?nd(function(i,o){return Aj(o)?Jn(Jn({},o),{},{velocity:Xh(o.velocity,a[i].velocity,r),from:Xh(o.from,a[i].from,r)}):o},n):e(t,a,r-1)};const gie=(function(e,t,n,r,a){var i=Kse(e,t),o=i.reduce(function(x,S){return Jn(Jn({},x),{},Nj({},S,[e[S],t[S]]))},{}),c=i.reduce(function(x,S){return Jn(Jn({},x),{},Nj({},S,{from:e[S],velocity:0,to:t[S]}))},{}),d=-1,f,h,p=function(){return null},g=function(){return nd(function(S,N){return N.from},c)},y=function(){return!Object.values(c).filter(Aj).length},j=function(S){f||(f=S);var N=S-f,A=N/n.dt;c=vie(n,c,A),a(Jn(Jn(Jn({},e),t),g())),f=S,y()||(d=requestAnimationFrame(p))},w=function(S){h||(h=S);var N=(S-h)/r,A=nd(function(E,O){return Xh.apply(void 0,ET(O).concat([n(N)]))},o);if(a(Jn(Jn(Jn({},e),t),A)),N<1)d=requestAnimationFrame(p);else{var P=nd(function(E,O){return Xh.apply(void 0,ET(O).concat([n(1)]))},o);a(Jn(Jn(Jn({},e),t),P))}};return p=n.isStepper?j:w,function(){return requestAnimationFrame(p),function(){cancelAnimationFrame(d)}}});function cc(e){"@babel/helpers - typeof";return cc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cc(e)}var yie=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function xie(e,t){if(e==null)return{};var n=bie(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function bie(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function Tw(e){return Nie(e)||Sie(e)||jie(e)||wie()}function wie(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
100
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jie(e,t){if(e){if(typeof e=="string")return Ej(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ej(e,t)}}function Sie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Nie(e){if(Array.isArray(e))return Ej(e)}function Ej(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function PT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).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?PT(Object(n),!0).forEach(function(r){Gu(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Gu(e,t,n){return t=UL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Aie(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,UL(r.key),r)}}function Eie(e,t,n){return t&&Aie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function UL(e){var t=_ie(e,"string");return cc(t)==="symbol"?t:String(t)}function _ie(e,t){if(cc(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(cc(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Pie(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_j(e,t)}function _j(e,t){return _j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},_j(e,t)}function Oie(e){var t=kie();return function(){var r=Qh(e),a;if(t){var i=Qh(this).constructor;a=Reflect.construct(r,arguments,i)}else a=r.apply(this,arguments);return Pj(this,a)}}function Pj(e,t){if(t&&(cc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Oj(e)}function Oj(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kie(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Qh(e){return Qh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Qh(e)}var os=(function(e){Pie(n,e);var t=Oie(n);function n(r,a){var i;Cie(this,n),i=t.call(this,r,a);var o=i.props,c=o.isActive,d=o.attributeName,f=o.from,h=o.to,p=o.steps,g=o.children,y=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(Oj(i)),i.changeStyle=i.changeStyle.bind(Oj(i)),!c||y<=0)return i.state={style:{}},typeof g=="function"&&(i.state={style:h}),Pj(i);if(p&&p.length)i.state={style:p[0].style};else if(f){if(typeof g=="function")return i.state={style:f},Pj(i);i.state={style:d?Gu({},d,f):f}}else i.state={style:{}};return i}return Eie(n,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,o=a.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,o=i.isActive,c=i.canBegin,d=i.attributeName,f=i.shouldReAnimate,h=i.to,p=i.from,g=this.state.style;if(c){if(!o){var y={style:d?Gu({},d,h):h};this.state&&g&&(d&&g[d]!==h||!d&&g!==h)&&this.setState(y);return}if(!(Dse(a.to,h)&&a.canBegin&&a.isActive)){var j=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var w=j||f?p:a.to;if(this.state&&g){var x={style:d?Gu({},d,w):w};(d&&g[d]!==w||!d&&g!==w)&&this.setState(x)}this.runAnimation(Ra(Ra({},this.props),{},{from:w,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var i=this,o=a.from,c=a.to,d=a.duration,f=a.easing,h=a.begin,p=a.onAnimationEnd,g=a.onAnimationStart,y=gie(o,c,iie(f),d,this.changeStyle),j=function(){i.stopJSAnimation=y()};this.manager.start([g,h,j,d,p])}},{key:"runStepAnimation",value:function(a){var i=this,o=a.steps,c=a.begin,d=a.onAnimationStart,f=o[0],h=f.style,p=f.duration,g=p===void 0?0:p,y=function(w,x,S){if(S===0)return w;var N=x.duration,A=x.easing,P=A===void 0?"ease":A,E=x.style,O=x.properties,k=x.onAnimationEnd,R=S>0?o[S-1]:x,D=O||Object.keys(E);if(typeof P=="function"||P==="spring")return[].concat(Tw(w),[i.runJSAnimation.bind(i,{from:R.style,to:E,duration:N,easing:P}),N]);var U=NT(D,N,P),z=Ra(Ra(Ra({},R.style),E),{},{transition:U});return[].concat(Tw(w),[z,N,k]).filter(Gse)};return this.manager.start([d].concat(Tw(o.reduce(y,[h,Math.max(g,c)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=Wse());var i=a.begin,o=a.duration,c=a.attributeName,d=a.to,f=a.easing,h=a.onAnimationStart,p=a.onAnimationEnd,g=a.steps,y=a.children,j=this.manager;if(this.unSubscribe=j.subscribe(this.handleStyleChange),typeof f=="function"||typeof y=="function"||f==="spring"){this.runJSAnimation(a);return}if(g.length>1){this.runStepAnimation(a);return}var w=c?Gu({},c,d):d,x=NT(Object.keys(w),o,f);j.start([h,i,Ra(Ra({},w),{},{transition:x}),o,p])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var o=a.duration;a.attributeName,a.easing;var c=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var d=xie(a,yie),f=v.Children.count(i),h=this.state.style;if(typeof i=="function")return i(h);if(!c||f===0||o<=0)return i;var p=function(y){var j=y.props,w=j.style,x=w===void 0?{}:w,S=j.className,N=v.cloneElement(y,Ra(Ra({},d),{},{style:Ra(Ra({},x),h),className:S}));return N};return f===1?p(v.Children.only(i)):W.createElement("div",null,v.Children.map(i,function(g){return p(g)}))}}]),n})(v.PureComponent);os.displayName="Animate";os.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};os.propTypes={from:Bt.oneOfType([Bt.object,Bt.string]),to:Bt.oneOfType([Bt.object,Bt.string]),attributeName:Bt.string,duration:Bt.number,begin:Bt.number,easing:Bt.oneOfType([Bt.string,Bt.func]),steps:Bt.arrayOf(Bt.shape({duration:Bt.number.isRequired,style:Bt.object.isRequired,easing:Bt.oneOfType([Bt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Bt.func]),properties:Bt.arrayOf("string"),onAnimationEnd:Bt.func})),children:Bt.oneOfType([Bt.node,Bt.func]),isActive:Bt.bool,canBegin:Bt.bool,onAnimationEnd:Bt.func,shouldReAnimate:Bt.bool,onAnimationStart:Bt.func,onAnimationReStart:Bt.func};function Ld(e){"@babel/helpers - typeof";return Ld=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ld(e)}function Jh(){return Jh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jh.apply(this,arguments)}function Rie(e,t){return $ie(e)||Mie(e,t)||Iie(e,t)||Tie()}function Tie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
101
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Iie(e,t){if(e){if(typeof e=="string")return OT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return OT(e,t)}}function OT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Mie(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function $ie(e){if(Array.isArray(e))return e}function kT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function RT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kT(Object(n),!0).forEach(function(r){Die(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Die(e,t,n){return t=Lie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lie(e){var t=Fie(e,"string");return Ld(t)=="symbol"?t:t+""}function Fie(e,t){if(Ld(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ld(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var TT=function(t,n,r,a,i){var o=Math.min(Math.abs(r)/2,Math.abs(a)/2),c=a>=0?1:-1,d=r>=0?1:-1,f=a>=0&&r>=0||a<0&&r<0?1:0,h;if(o>0&&i instanceof Array){for(var p=[0,0,0,0],g=0,y=4;g<y;g++)p[g]=i[g]>o?o:i[g];h="M".concat(t,",").concat(n+c*p[0]),p[0]>0&&(h+="A ".concat(p[0],",").concat(p[0],",0,0,").concat(f,",").concat(t+d*p[0],",").concat(n)),h+="L ".concat(t+r-d*p[1],",").concat(n),p[1]>0&&(h+="A ".concat(p[1],",").concat(p[1],",0,0,").concat(f,`,
|
|
102
|
+
`).concat(t+r,",").concat(n+c*p[1])),h+="L ".concat(t+r,",").concat(n+a-c*p[2]),p[2]>0&&(h+="A ".concat(p[2],",").concat(p[2],",0,0,").concat(f,`,
|
|
103
|
+
`).concat(t+r-d*p[2],",").concat(n+a)),h+="L ".concat(t+d*p[3],",").concat(n+a),p[3]>0&&(h+="A ".concat(p[3],",").concat(p[3],",0,0,").concat(f,`,
|
|
104
|
+
`).concat(t,",").concat(n+a-c*p[3])),h+="Z"}else if(o>0&&i===+i&&i>0){var j=Math.min(o,i);h="M ".concat(t,",").concat(n+c*j,`
|
|
105
|
+
A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+d*j,",").concat(n,`
|
|
106
|
+
L `).concat(t+r-d*j,",").concat(n,`
|
|
107
|
+
A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+r,",").concat(n+c*j,`
|
|
108
|
+
L `).concat(t+r,",").concat(n+a-c*j,`
|
|
109
|
+
A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t+r-d*j,",").concat(n+a,`
|
|
110
|
+
L `).concat(t+d*j,",").concat(n+a,`
|
|
111
|
+
A `).concat(j,",").concat(j,",0,0,").concat(f,",").concat(t,",").concat(n+a-c*j," Z")}else h="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(a," h ").concat(-r," Z");return h},Bie=function(t,n){if(!t||!n)return!1;var r=t.x,a=t.y,i=n.x,o=n.y,c=n.width,d=n.height;if(Math.abs(c)>0&&Math.abs(d)>0){var f=Math.min(i,i+c),h=Math.max(i,i+c),p=Math.min(o,o+d),g=Math.max(o,o+d);return r>=f&&r<=h&&a>=p&&a<=g}return!1},zie={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},zN=function(t){var n=RT(RT({},zie),t),r=v.useRef(),a=v.useState(-1),i=Rie(a,2),o=i[0],c=i[1];v.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var P=r.current.getTotalLength();P&&c(P)}catch{}},[]);var d=n.x,f=n.y,h=n.width,p=n.height,g=n.radius,y=n.className,j=n.animationEasing,w=n.animationDuration,x=n.animationBegin,S=n.isAnimationActive,N=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||h===0||p===0)return null;var A=St("recharts-rectangle",y);return N?W.createElement(os,{canBegin:o>0,from:{width:h,height:p,x:d,y:f},to:{width:h,height:p,x:d,y:f},duration:w,animationEasing:j,isActive:N},function(P){var E=P.width,O=P.height,k=P.x,R=P.y;return W.createElement(os,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:w,isActive:S,easing:j},W.createElement("path",Jh({},ht(n,!0),{className:A,d:TT(k,R,E,O,g),ref:r})))}):W.createElement("path",Jh({},ht(n,!0),{className:A,d:TT(d,f,h,p,g)}))},Uie=["points","className","baseLinePoints","connectNulls"];function kl(){return kl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},kl.apply(this,arguments)}function qie(e,t){if(e==null)return{};var n=Wie(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Wie(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function IT(e){return Gie(e)||Kie(e)||Hie(e)||Vie()}function Vie(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
112
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hie(e,t){if(e){if(typeof e=="string")return kj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kj(e,t)}}function Kie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Gie(e){if(Array.isArray(e))return kj(e)}function kj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var MT=function(t){return t&&t.x===+t.x&&t.y===+t.y},Yie=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){MT(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),MT(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},rd=function(t,n){var r=Yie(t);n&&(r=[r.reduce(function(i,o){return[].concat(IT(i),IT(o))},[])]);var a=r.map(function(i){return i.reduce(function(o,c,d){return"".concat(o).concat(d===0?"M":"L").concat(c.x,",").concat(c.y)},"")}).join("");return r.length===1?"".concat(a,"Z"):a},Xie=function(t,n,r){var a=rd(t,r);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(rd(n.reverse(),r).slice(1))},Qie=function(t){var n=t.points,r=t.className,a=t.baseLinePoints,i=t.connectNulls,o=qie(t,Uie);if(!n||!n.length)return null;var c=St("recharts-polygon",r);if(a&&a.length){var d=o.stroke&&o.stroke!=="none",f=Xie(n,a,i);return W.createElement("g",{className:c},W.createElement("path",kl({},ht(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:f})),d?W.createElement("path",kl({},ht(o,!0),{fill:"none",d:rd(n,i)})):null,d?W.createElement("path",kl({},ht(o,!0),{fill:"none",d:rd(a,i)})):null)}var h=rd(n,i);return W.createElement("path",kl({},ht(o,!0),{fill:h.slice(-1)==="Z"?o.fill:"none",className:c,d:h}))};function Rj(){return Rj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rj.apply(this,arguments)}var Av=function(t){var n=t.cx,r=t.cy,a=t.r,i=t.className,o=St("recharts-dot",i);return n===+n&&r===+r&&a===+a?v.createElement("circle",Rj({},ht(t,!1),xh(t),{className:o,cx:n,cy:r,r:a})):null};function Fd(e){"@babel/helpers - typeof";return Fd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fd(e)}var Jie=["x","y","top","left","width","height","className"];function Tj(){return Tj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tj.apply(this,arguments)}function $T(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Zie(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$T(Object(n),!0).forEach(function(r){eoe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$T(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eoe(e,t,n){return t=toe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function toe(e){var t=noe(e,"string");return Fd(t)=="symbol"?t:t+""}function noe(e,t){if(Fd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Fd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function roe(e,t){if(e==null)return{};var n=aoe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function aoe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var soe=function(t,n,r,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(n,"h").concat(r)},ioe=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,i=a===void 0?0:a,o=t.top,c=o===void 0?0:o,d=t.left,f=d===void 0?0:d,h=t.width,p=h===void 0?0:h,g=t.height,y=g===void 0?0:g,j=t.className,w=roe(t,Jie),x=Zie({x:r,y:i,top:c,left:f,width:p,height:y},w);return!De(r)||!De(i)||!De(p)||!De(y)||!De(c)||!De(f)?null:W.createElement("path",Tj({},ht(x,!0),{className:St("recharts-cross",j),d:soe(r,i,p,y,c,f)}))},Iw,DT;function ooe(){if(DT)return Iw;DT=1;var e=wv(),t=aL(),n=us();function r(a,i){return a&&a.length?e(a,n(i,2),t):void 0}return Iw=r,Iw}var loe=ooe();const coe=Yt(loe);var Mw,LT;function uoe(){if(LT)return Mw;LT=1;var e=wv(),t=us(),n=sL();function r(a,i){return a&&a.length?e(a,t(i,2),n):void 0}return Mw=r,Mw}var doe=uoe();const foe=Yt(doe);var poe=["cx","cy","angle","ticks","axisLine"],hoe=["ticks","tick","angle","tickFormatter","stroke"];function uc(e){"@babel/helpers - typeof";return uc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uc(e)}function ad(){return ad=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ad.apply(this,arguments)}function FT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function uo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FT(Object(n),!0).forEach(function(r){Ev(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function BT(e,t){if(e==null)return{};var n=moe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function moe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function voe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zT(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,WL(r.key),r)}}function goe(e,t,n){return t&&zT(e.prototype,t),n&&zT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function yoe(e,t,n){return t=Zh(t),xoe(e,qL()?Reflect.construct(t,n||[],Zh(e).constructor):t.apply(e,n))}function xoe(e,t){if(t&&(uc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return boe(e)}function boe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qL=function(){return!!e})()}function Zh(e){return Zh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Zh(e)}function woe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ij(e,t)}function Ij(e,t){return Ij=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Ij(e,t)}function Ev(e,t,n){return t=WL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WL(e){var t=joe(e,"string");return uc(t)=="symbol"?t:t+""}function joe(e,t){if(uc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(uc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _v=(function(e){function t(){return voe(this,t),yoe(this,t,arguments)}return woe(t,e),goe(t,[{key:"getTickValueCoord",value:function(r){var a=r.coordinate,i=this.props,o=i.angle,c=i.cx,d=i.cy;return sn(c,d,a,o)}},{key:"getTickTextAnchor",value:function(){var r=this.props.orientation,a;switch(r){case"left":a="end";break;case"right":a="start";break;default:a="middle";break}return a}},{key:"getViewBox",value:function(){var r=this.props,a=r.cx,i=r.cy,o=r.angle,c=r.ticks,d=coe(c,function(h){return h.coordinate||0}),f=foe(c,function(h){return h.coordinate||0});return{cx:a,cy:i,startAngle:o,endAngle:o,innerRadius:f.coordinate||0,outerRadius:d.coordinate||0}}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.cx,i=r.cy,o=r.angle,c=r.ticks,d=r.axisLine,f=BT(r,poe),h=c.reduce(function(j,w){return[Math.min(j[0],w.coordinate),Math.max(j[1],w.coordinate)]},[1/0,-1/0]),p=sn(a,i,h[0],o),g=sn(a,i,h[1],o),y=uo(uo(uo({},ht(f,!1)),{},{fill:"none"},ht(d,!1)),{},{x1:p.x,y1:p.y,x2:g.x,y2:g.y});return W.createElement("line",ad({className:"recharts-polar-radius-axis-line"},y))}},{key:"renderTicks",value:function(){var r=this,a=this.props,i=a.ticks,o=a.tick,c=a.angle,d=a.tickFormatter,f=a.stroke,h=BT(a,hoe),p=this.getTickTextAnchor(),g=ht(h,!1),y=ht(o,!1),j=i.map(function(w,x){var S=r.getTickValueCoord(w),N=uo(uo(uo(uo({textAnchor:p,transform:"rotate(".concat(90-c,", ").concat(S.x,", ").concat(S.y,")")},g),{},{stroke:"none",fill:f},y),{},{index:x},S),{},{payload:w});return W.createElement(Mt,ad({className:St("recharts-polar-radius-axis-tick",RL(o)),key:"tick-".concat(w.coordinate)},_o(r.props,w,x)),t.renderTickItem(o,N,d?d(w.value,x):w.value))});return W.createElement(Mt,{className:"recharts-polar-radius-axis-ticks"},j)}},{key:"render",value:function(){var r=this.props,a=r.ticks,i=r.axisLine,o=r.tick;return!a||!a.length?null:W.createElement(Mt,{className:St("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),o&&this.renderTicks(),Gn.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,a,i){var o;return W.isValidElement(r)?o=W.cloneElement(r,a):wt(r)?o=r(a):o=W.createElement(Po,ad({},a,{className:"recharts-polar-radius-axis-tick-value"}),i),o}}])})(v.PureComponent);Ev(_v,"displayName","PolarRadiusAxis");Ev(_v,"axisType","radiusAxis");Ev(_v,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function dc(e){"@babel/helpers - typeof";return dc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dc(e)}function vo(){return vo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vo.apply(this,arguments)}function UT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function fo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UT(Object(n),!0).forEach(function(r){Pv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Soe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qT(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,HL(r.key),r)}}function Noe(e,t,n){return t&&qT(e.prototype,t),n&&qT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Coe(e,t,n){return t=em(t),Aoe(e,VL()?Reflect.construct(t,n||[],em(e).constructor):t.apply(e,n))}function Aoe(e,t){if(t&&(dc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Eoe(e)}function Eoe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function VL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(VL=function(){return!!e})()}function em(e){return em=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},em(e)}function _oe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mj(e,t)}function Mj(e,t){return Mj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Mj(e,t)}function Pv(e,t,n){return t=HL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HL(e){var t=Poe(e,"string");return dc(t)=="symbol"?t:t+""}function Poe(e,t){if(dc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(dc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ooe=Math.PI/180,WT=1e-5,Ov=(function(e){function t(){return Soe(this,t),Coe(this,t,arguments)}return _oe(t,e),Noe(t,[{key:"getTickLineCoord",value:function(r){var a=this.props,i=a.cx,o=a.cy,c=a.radius,d=a.orientation,f=a.tickSize,h=f||8,p=sn(i,o,c,r.coordinate),g=sn(i,o,c+(d==="inner"?-1:1)*h,r.coordinate);return{x1:p.x,y1:p.y,x2:g.x,y2:g.y}}},{key:"getTickTextAnchor",value:function(r){var a=this.props.orientation,i=Math.cos(-r.coordinate*Ooe),o;return i>WT?o=a==="outer"?"start":"end":i<-WT?o=a==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.cx,i=r.cy,o=r.radius,c=r.axisLine,d=r.axisLineType,f=fo(fo({},ht(this.props,!1)),{},{fill:"none"},ht(c,!1));if(d==="circle")return W.createElement(Av,vo({className:"recharts-polar-angle-axis-line"},f,{cx:a,cy:i,r:o}));var h=this.props.ticks,p=h.map(function(g){return sn(a,i,o,g.coordinate)});return W.createElement(Qie,vo({className:"recharts-polar-angle-axis-line"},f,{points:p}))}},{key:"renderTicks",value:function(){var r=this,a=this.props,i=a.ticks,o=a.tick,c=a.tickLine,d=a.tickFormatter,f=a.stroke,h=ht(this.props,!1),p=ht(o,!1),g=fo(fo({},h),{},{fill:"none"},ht(c,!1)),y=i.map(function(j,w){var x=r.getTickLineCoord(j),S=r.getTickTextAnchor(j),N=fo(fo(fo({textAnchor:S},h),{},{stroke:"none",fill:f},p),{},{index:w,payload:j,x:x.x2,y:x.y2});return W.createElement(Mt,vo({className:St("recharts-polar-angle-axis-tick",RL(o)),key:"tick-".concat(j.coordinate)},_o(r.props,j,w)),c&&W.createElement("line",vo({className:"recharts-polar-angle-axis-tick-line"},g,x)),o&&t.renderTickItem(o,N,d?d(j.value,w):j.value))});return W.createElement(Mt,{className:"recharts-polar-angle-axis-ticks"},y)}},{key:"render",value:function(){var r=this.props,a=r.ticks,i=r.radius,o=r.axisLine;return i<=0||!a||!a.length?null:W.createElement(Mt,{className:St("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,a,i){var o;return W.isValidElement(r)?o=W.cloneElement(r,a):wt(r)?o=r(a):o=W.createElement(Po,vo({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])})(v.PureComponent);Pv(Ov,"displayName","PolarAngleAxis");Pv(Ov,"axisType","angleAxis");Pv(Ov,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var $w,VT;function koe(){if(VT)return $w;VT=1;var e=a5(),t=e(Object.getPrototypeOf,Object);return $w=t,$w}var Dw,HT;function Roe(){if(HT)return Dw;HT=1;var e=Gs(),t=koe(),n=Ys(),r="[object Object]",a=Function.prototype,i=Object.prototype,o=a.toString,c=i.hasOwnProperty,d=o.call(Object);function f(h){if(!n(h)||e(h)!=r)return!1;var p=t(h);if(p===null)return!0;var g=c.call(p,"constructor")&&p.constructor;return typeof g=="function"&&g instanceof g&&o.call(g)==d}return Dw=f,Dw}var Toe=Roe();const Ioe=Yt(Toe);var Lw,KT;function Moe(){if(KT)return Lw;KT=1;var e=Gs(),t=Ys(),n="[object Boolean]";function r(a){return a===!0||a===!1||t(a)&&e(a)==n}return Lw=r,Lw}var $oe=Moe();const Doe=Yt($oe);function Bd(e){"@babel/helpers - typeof";return Bd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bd(e)}function tm(){return tm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tm.apply(this,arguments)}function Loe(e,t){return Uoe(e)||zoe(e,t)||Boe(e,t)||Foe()}function Foe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
113
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Boe(e,t){if(e){if(typeof e=="string")return GT(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return GT(e,t)}}function GT(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zoe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function Uoe(e){if(Array.isArray(e))return e}function YT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function XT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YT(Object(n),!0).forEach(function(r){qoe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qoe(e,t,n){return t=Woe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Woe(e){var t=Voe(e,"string");return Bd(t)=="symbol"?t:t+""}function Voe(e,t){if(Bd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var QT=function(t,n,r,a,i){var o=r-a,c;return c="M ".concat(t,",").concat(n),c+="L ".concat(t+r,",").concat(n),c+="L ".concat(t+r-o/2,",").concat(n+i),c+="L ".concat(t+r-o/2-a,",").concat(n+i),c+="L ".concat(t,",").concat(n," Z"),c},Hoe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Koe=function(t){var n=XT(XT({},Hoe),t),r=v.useRef(),a=v.useState(-1),i=Loe(a,2),o=i[0],c=i[1];v.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var A=r.current.getTotalLength();A&&c(A)}catch{}},[]);var d=n.x,f=n.y,h=n.upperWidth,p=n.lowerWidth,g=n.height,y=n.className,j=n.animationEasing,w=n.animationDuration,x=n.animationBegin,S=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||g!==+g||h===0&&p===0||g===0)return null;var N=St("recharts-trapezoid",y);return S?W.createElement(os,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:g,x:d,y:f},to:{upperWidth:h,lowerWidth:p,height:g,x:d,y:f},duration:w,animationEasing:j,isActive:S},function(A){var P=A.upperWidth,E=A.lowerWidth,O=A.height,k=A.x,R=A.y;return W.createElement(os,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:w,easing:j},W.createElement("path",tm({},ht(n,!0),{className:N,d:QT(k,R,P,E,O),ref:r})))}):W.createElement("g",null,W.createElement("path",tm({},ht(n,!0),{className:N,d:QT(d,f,h,p,g)})))},Goe=["option","shapeType","propTransformer","activeClassName","isActive"];function zd(e){"@babel/helpers - typeof";return zd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zd(e)}function Yoe(e,t){if(e==null)return{};var n=Xoe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Xoe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function JT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function nm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JT(Object(n),!0).forEach(function(r){Qoe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qoe(e,t,n){return t=Joe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Joe(e){var t=Zoe(e,"string");return zd(t)=="symbol"?t:t+""}function Zoe(e,t){if(zd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(zd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ele(e,t){return nm(nm({},t),e)}function tle(e,t){return e==="symbols"}function ZT(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return W.createElement(zN,n);case"trapezoid":return W.createElement(Koe,n);case"sector":return W.createElement(ML,n);case"symbols":if(tle(t))return W.createElement(iN,n);break;default:return null}}function nle(e){return v.isValidElement(e)?e.props:e}function KL(e){var t=e.option,n=e.shapeType,r=e.propTransformer,a=r===void 0?ele:r,i=e.activeClassName,o=i===void 0?"recharts-active-shape":i,c=e.isActive,d=Yoe(e,Goe),f;if(v.isValidElement(t))f=v.cloneElement(t,nm(nm({},d),nle(t)));else if(wt(t))f=t(d);else if(Ioe(t)&&!Doe(t)){var h=a(t,d);f=W.createElement(ZT,{shapeType:n,elementProps:h})}else{var p=d;f=W.createElement(ZT,{shapeType:n,elementProps:p})}return c?W.createElement(Mt,{className:o},f):f}function kv(e,t){return t!=null&&"trapezoids"in e.props}function Rv(e,t){return t!=null&&"sectors"in e.props}function Ud(e,t){return t!=null&&"points"in e.props}function rle(e,t){var n,r,a=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,i=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return a&&i}function ale(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function sle(e,t){var n=e.x===t.x,r=e.y===t.y,a=e.z===t.z;return n&&r&&a}function ile(e,t){var n;return kv(e,t)?n=rle:Rv(e,t)?n=ale:Ud(e,t)&&(n=sle),n}function ole(e,t){var n;return kv(e,t)?n="trapezoids":Rv(e,t)?n="sectors":Ud(e,t)&&(n="points"),n}function lle(e,t){if(kv(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}if(Rv(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}return Ud(e,t)?t.payload:{}}function cle(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,a=ole(n,t),i=lle(n,t),o=r.filter(function(d,f){var h=gf(i,d),p=n.props[a].filter(function(j){var w=ile(n,t);return w(j,t)}),g=n.props[a].indexOf(p[p.length-1]),y=f===g;return h&&y}),c=r.indexOf(o[o.length-1]);return c}var ih;function fc(e){"@babel/helpers - typeof";return fc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fc(e)}function Rl(){return Rl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rl.apply(this,arguments)}function eI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function rn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eI(Object(n),!0).forEach(function(r){da(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ule(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,YL(r.key),r)}}function dle(e,t,n){return t&&tI(e.prototype,t),n&&tI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fle(e,t,n){return t=rm(t),ple(e,GL()?Reflect.construct(t,n||[],rm(e).constructor):t.apply(e,n))}function ple(e,t){if(t&&(fc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hle(e)}function hle(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function GL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(GL=function(){return!!e})()}function rm(e){return rm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},rm(e)}function mle(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$j(e,t)}function $j(e,t){return $j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},$j(e,t)}function da(e,t,n){return t=YL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YL(e){var t=vle(e,"string");return fc(t)=="symbol"?t:t+""}function vle(e,t){if(fc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(fc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Qs=(function(e){function t(n){var r;return ule(this,t),r=fle(this,t,[n]),da(r,"pieRef",null),da(r,"sectorRefs",[]),da(r,"id",Bc("recharts-pie-")),da(r,"handleAnimationEnd",function(){var a=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),wt(a)&&a()}),da(r,"handleAnimationStart",function(){var a=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),wt(a)&&a()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return mle(t,e),dle(t,[{key:"isActiveIndex",value:function(r){var a=this.props.activeIndex;return Array.isArray(a)?a.indexOf(r)!==-1:r===a}},{key:"hasActiveIndex",value:function(){var r=this.props.activeIndex;return Array.isArray(r)?r.length!==0:r||r===0}},{key:"renderLabels",value:function(r){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.label,c=i.labelLine,d=i.dataKey,f=i.valueKey,h=ht(this.props,!1),p=ht(o,!1),g=ht(c,!1),y=o&&o.offsetRadius||20,j=r.map(function(w,x){var S=(w.startAngle+w.endAngle)/2,N=sn(w.cx,w.cy,w.outerRadius+y,S),A=rn(rn(rn(rn({},h),w),{},{stroke:"none"},p),{},{index:x,textAnchor:t.getTextAnchor(N.x,w.cx)},N),P=rn(rn(rn(rn({},h),w),{},{fill:"none",stroke:w.fill},g),{},{index:x,points:[sn(w.cx,w.cy,w.outerRadius,S),N]}),E=d;return jt(d)&&jt(f)?E="value":jt(d)&&(E=f),W.createElement(Mt,{key:"label-".concat(w.startAngle,"-").concat(w.endAngle,"-").concat(w.midAngle,"-").concat(x)},c&&t.renderLabelLineItem(c,P,"line"),t.renderLabelItem(o,A,Ln(w,E)))});return W.createElement(Mt,{className:"recharts-pie-labels"},j)}},{key:"renderSectorsStatically",value:function(r){var a=this,i=this.props,o=i.activeShape,c=i.blendStroke,d=i.inactiveShape;return r.map(function(f,h){if(f?.startAngle===0&&f?.endAngle===0&&r.length!==1)return null;var p=a.isActiveIndex(h),g=d&&a.hasActiveIndex()?d:null,y=p?o:g,j=rn(rn({},f),{},{stroke:c?f.fill:f.stroke,tabIndex:-1});return W.createElement(Mt,Rl({ref:function(x){x&&!a.sectorRefs.includes(x)&&a.sectorRefs.push(x)},tabIndex:-1,className:"recharts-pie-sector"},_o(a.props,f,h),{key:"sector-".concat(f?.startAngle,"-").concat(f?.endAngle,"-").concat(f.midAngle,"-").concat(h)}),W.createElement(KL,Rl({option:y,isActive:p,shapeType:"sector"},j)))})}},{key:"renderSectorsWithAnimation",value:function(){var r=this,a=this.props,i=a.sectors,o=a.isAnimationActive,c=a.animationBegin,d=a.animationDuration,f=a.animationEasing,h=a.animationId,p=this.state,g=p.prevSectors,y=p.prevIsAnimationActive;return W.createElement(os,{begin:c,duration:d,isActive:o,easing:f,from:{t:0},to:{t:1},key:"pie-".concat(h,"-").concat(y),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(j){var w=j.t,x=[],S=i&&i[0],N=S.startAngle;return i.forEach(function(A,P){var E=g&&g[P],O=P>0?Qr(A,"paddingAngle",0):0;if(E){var k=Wr(E.endAngle-E.startAngle,A.endAngle-A.startAngle),R=rn(rn({},A),{},{startAngle:N+O,endAngle:N+k(w)+O});x.push(R),N=R.endAngle}else{var D=A.endAngle,U=A.startAngle,z=Wr(0,D-U),L=z(w),G=rn(rn({},A),{},{startAngle:N+O,endAngle:N+L+O});x.push(G),N=G.endAngle}}),W.createElement(Mt,null,r.renderSectorsStatically(x))})}},{key:"attachKeyboardHandlers",value:function(r){var a=this;r.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[o].focus(),a.setState({sectorToFocus:o});break}case"ArrowRight":{var c=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[c].focus(),a.setState({sectorToFocus:c});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,a=r.sectors,i=r.isAnimationActive,o=this.state.prevSectors;return i&&a&&a.length&&(!o||!gf(o,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,a=this.props,i=a.hide,o=a.sectors,c=a.className,d=a.label,f=a.cx,h=a.cy,p=a.innerRadius,g=a.outerRadius,y=a.isAnimationActive,j=this.state.isAnimationFinished;if(i||!o||!o.length||!De(f)||!De(h)||!De(p)||!De(g))return null;var w=St("recharts-pie",c);return W.createElement(Mt,{tabIndex:this.props.rootTabIndex,className:w,ref:function(S){r.pieRef=S}},this.renderSectors(),d&&this.renderLabels(o),Gn.renderCallByParent(this.props,null,!1),(!y||j)&&Fs.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return a.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:r.sectors!==a.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,a){return r>a?"start":r<a?"end":"middle"}},{key:"renderLabelLineItem",value:function(r,a,i){if(W.isValidElement(r))return W.cloneElement(r,a);if(wt(r))return r(a);var o=St("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return W.createElement(Kh,Rl({},a,{key:i,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(r,a,i){if(W.isValidElement(r))return W.cloneElement(r,a);var o=i;if(wt(r)&&(o=r(a),W.isValidElement(o)))return o;var c=St("recharts-pie-label-text",typeof r!="boolean"&&!wt(r)?r.className:"");return W.createElement(Po,Rl({},a,{alignmentBaseline:"middle",className:c}),o)}}])})(v.PureComponent);ih=Qs;da(Qs,"displayName","Pie");da(Qs,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!Bo.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});da(Qs,"parseDeltaAngle",function(e,t){var n=fr(t-e),r=Math.min(Math.abs(t-e),360);return n*r});da(Qs,"getRealPieData",function(e){var t=e.data,n=e.children,r=ht(e,!1),a=Jr(n,hv);return t&&t.length?t.map(function(i,o){return rn(rn(rn({payload:i},r),i),a&&a[o]&&a[o].props)}):a&&a.length?a.map(function(i){return rn(rn({},r),i.props)}):[]});da(Qs,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,a=t.width,i=t.height,o=kL(a,i),c=r+pr(e.cx,a,a/2),d=n+pr(e.cy,i,i/2),f=pr(e.innerRadius,o,0),h=pr(e.outerRadius,o,o*.8),p=e.maxRadius||Math.sqrt(a*a+i*i)/2;return{cx:c,cy:d,innerRadius:f,outerRadius:h,maxRadius:p}});da(Qs,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?rn(rn({},t.type.defaultProps),t.props):t.props,a=ih.getRealPieData(r);if(!a||!a.length)return null;var i=r.cornerRadius,o=r.startAngle,c=r.endAngle,d=r.paddingAngle,f=r.dataKey,h=r.nameKey,p=r.valueKey,g=r.tooltipType,y=Math.abs(r.minAngle),j=ih.parseCoordinateOfPie(r,n),w=ih.parseDeltaAngle(o,c),x=Math.abs(w),S=f;jt(f)&&jt(p)?(Ds(!1,`Use "dataKey" to specify the value of pie,
|
|
114
|
+
the props "valueKey" will be deprecated in 1.1.0`),S="value"):jt(f)&&(Ds(!1,`Use "dataKey" to specify the value of pie,
|
|
115
|
+
the props "valueKey" will be deprecated in 1.1.0`),S=p);var N=a.filter(function(R){return Ln(R,S,0)!==0}).length,A=(x>=360?N:N-1)*d,P=x-N*y-A,E=a.reduce(function(R,D){var U=Ln(D,S,0);return R+(De(U)?U:0)},0),O;if(E>0){var k;O=a.map(function(R,D){var U=Ln(R,S,0),z=Ln(R,h,D),L=(De(U)?U:0)/E,G;D?G=k.endAngle+fr(w)*d*(U!==0?1:0):G=o;var q=G+fr(w)*((U!==0?y:0)+L*P),H=(G+q)/2,X=(j.innerRadius+j.outerRadius)/2,Z=[{name:z,value:U,payload:R,dataKey:S,type:g}],I=sn(j.cx,j.cy,X,H);return k=rn(rn(rn({percent:L,cornerRadius:i,name:z,tooltipPayload:Z,midAngle:H,middleRadius:X,tooltipPosition:I},R),j),{},{value:Ln(R,S),startAngle:G,endAngle:q,payload:R,paddingAngle:fr(w)*d}),k})}return rn(rn({},j),{},{sectors:O,data:a})});var Fw,nI;function gle(){if(nI)return Fw;nI=1;var e=Math.ceil,t=Math.max;function n(r,a,i,o){for(var c=-1,d=t(e((a-r)/(i||1)),0),f=Array(d);d--;)f[o?d:++c]=r,r+=i;return f}return Fw=n,Fw}var Bw,rI;function XL(){if(rI)return Bw;rI=1;var e=b5(),t=1/0,n=17976931348623157e292;function r(a){if(!a)return a===0?a:0;if(a=e(a),a===t||a===-t){var i=a<0?-1:1;return i*n}return a===a?a:0}return Bw=r,Bw}var zw,aI;function yle(){if(aI)return zw;aI=1;var e=gle(),t=pv(),n=XL();function r(a){return function(i,o,c){return c&&typeof c!="number"&&t(i,o,c)&&(o=c=void 0),i=n(i),o===void 0?(o=i,i=0):o=n(o),c=c===void 0?i<o?1:-1:n(c),e(i,o,c,a)}}return zw=r,zw}var Uw,sI;function xle(){if(sI)return Uw;sI=1;var e=yle(),t=e();return Uw=t,Uw}var ble=xle();const am=Yt(ble);function qd(e){"@babel/helpers - typeof";return qd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qd(e)}function iI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function oI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iI(Object(n),!0).forEach(function(r){QL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QL(e,t,n){return t=wle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wle(e){var t=jle(e,"string");return qd(t)=="symbol"?t:t+""}function jle(e,t){if(qd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Sle=["Webkit","Moz","O","ms"],Nle=function(t,n){var r=t.replace(/(\w)/,function(i){return i.toUpperCase()}),a=Sle.reduce(function(i,o){return oI(oI({},i),{},QL({},o+r,n))},{});return a[t]=n,a};function pc(e){"@babel/helpers - typeof";return pc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pc(e)}function sm(){return sm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sm.apply(this,arguments)}function lI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function qw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lI(Object(n),!0).forEach(function(r){Br(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ZL(r.key),r)}}function Ale(e,t,n){return t&&cI(e.prototype,t),n&&cI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ele(e,t,n){return t=im(t),_le(e,JL()?Reflect.construct(t,n||[],im(e).constructor):t.apply(e,n))}function _le(e,t){if(t&&(pc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ple(e)}function Ple(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function JL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(JL=function(){return!!e})()}function im(e){return im=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},im(e)}function Ole(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Dj(e,t)}function Dj(e,t){return Dj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Dj(e,t)}function Br(e,t,n){return t=ZL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZL(e){var t=kle(e,"string");return pc(t)=="symbol"?t:t+""}function kle(e,t){if(pc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(pc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Rle=function(t){var n=t.data,r=t.startIndex,a=t.endIndex,i=t.x,o=t.width,c=t.travellerWidth;if(!n||!n.length)return{};var d=n.length,f=ed().domain(am(0,d)).range([i,i+o-c]),h=f.domain().map(function(p){return f(p)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:f(r),endX:f(a),scale:f,scaleValues:h}},uI=function(t){return t.changedTouches&&!!t.changedTouches.length},hc=(function(e){function t(n){var r;return Cle(this,t),r=Ele(this,t,[n]),Br(r,"handleDrag",function(a){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(a):r.state.isSlideMoving&&r.handleSlideDrag(a)}),Br(r,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&r.handleDrag(a.changedTouches[0])}),Br(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=r.props,i=a.endIndex,o=a.onDragEnd,c=a.startIndex;o?.({endIndex:i,startIndex:c})}),r.detachDragEndListener()}),Br(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Br(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Br(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Br(r,"handleSlideDragStart",function(a){var i=uI(a)?a.changedTouches[0]:a;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return Ole(t,e),Ale(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var a=r.startX,i=r.endX,o=this.state.scaleValues,c=this.props,d=c.gap,f=c.data,h=f.length-1,p=Math.min(a,i),g=Math.max(a,i),y=t.getIndexInRange(o,p),j=t.getIndexInRange(o,g);return{startIndex:y-y%d,endIndex:j===h?h:j-j%d}}},{key:"getTextOfTick",value:function(r){var a=this.props,i=a.data,o=a.tickFormatter,c=a.dataKey,d=Ln(i[r],c,r);return wt(o)?o(d,r):d}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var a=this.state,i=a.slideMoveStartX,o=a.startX,c=a.endX,d=this.props,f=d.x,h=d.width,p=d.travellerWidth,g=d.startIndex,y=d.endIndex,j=d.onChange,w=r.pageX-i;w>0?w=Math.min(w,f+h-p-c,f+h-p-o):w<0&&(w=Math.max(w,f-o,f-c));var x=this.getIndex({startX:o+w,endX:c+w});(x.startIndex!==g||x.endIndex!==y)&&j&&j(x),this.setState({startX:o+w,endX:c+w,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,a){var i=uI(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var a=this.state,i=a.brushMoveStartX,o=a.movingTravellerId,c=a.endX,d=a.startX,f=this.state[o],h=this.props,p=h.x,g=h.width,y=h.travellerWidth,j=h.onChange,w=h.gap,x=h.data,S={startX:this.state.startX,endX:this.state.endX},N=r.pageX-i;N>0?N=Math.min(N,p+g-y-f):N<0&&(N=Math.max(N,p-f)),S[o]=f+N;var A=this.getIndex(S),P=A.startIndex,E=A.endIndex,O=function(){var R=x.length-1;return o==="startX"&&(c>d?P%w===0:E%w===0)||c<d&&E===R||o==="endX"&&(c>d?E%w===0:P%w===0)||c>d&&E===R};this.setState(Br(Br({},o,f+N),"brushMoveStartX",r.pageX),function(){j&&O()&&j(A)})}},{key:"handleTravellerMoveKeyboard",value:function(r,a){var i=this,o=this.state,c=o.scaleValues,d=o.startX,f=o.endX,h=this.state[a],p=c.indexOf(h);if(p!==-1){var g=p+r;if(!(g===-1||g>=c.length)){var y=c[g];a==="startX"&&y>=f||a==="endX"&&y<=d||this.setState(Br({},a,y),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,a=r.x,i=r.y,o=r.width,c=r.height,d=r.fill,f=r.stroke;return W.createElement("rect",{stroke:f,fill:d,x:a,y:i,width:o,height:c})}},{key:"renderPanorama",value:function(){var r=this.props,a=r.x,i=r.y,o=r.width,c=r.height,d=r.data,f=r.children,h=r.padding,p=v.Children.only(f);return p?W.cloneElement(p,{x:a,y:i,width:o,height:c,margin:h,compact:!0,data:d}):null}},{key:"renderTravellerLayer",value:function(r,a){var i,o,c=this,d=this.props,f=d.y,h=d.travellerWidth,p=d.height,g=d.traveller,y=d.ariaLabel,j=d.data,w=d.startIndex,x=d.endIndex,S=Math.max(r,this.props.x),N=qw(qw({},ht(this.props,!1)),{},{x:S,y:f,width:h,height:p}),A=y||"Min value: ".concat((i=j[w])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=j[x])===null||o===void 0?void 0:o.name);return W.createElement(Mt,{tabIndex:0,role:"slider","aria-label":A,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(E){["ArrowLeft","ArrowRight"].includes(E.key)&&(E.preventDefault(),E.stopPropagation(),c.handleTravellerMoveKeyboard(E.key==="ArrowRight"?1:-1,a))},onFocus:function(){c.setState({isTravellerFocused:!0})},onBlur:function(){c.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(g,N))}},{key:"renderSlide",value:function(r,a){var i=this.props,o=i.y,c=i.height,d=i.stroke,f=i.travellerWidth,h=Math.min(r,a)+f,p=Math.max(Math.abs(a-r)-f,0);return W.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:d,fillOpacity:.2,x:h,y:o,width:p,height:c})}},{key:"renderText",value:function(){var r=this.props,a=r.startIndex,i=r.endIndex,o=r.y,c=r.height,d=r.travellerWidth,f=r.stroke,h=this.state,p=h.startX,g=h.endX,y=5,j={pointerEvents:"none",fill:f};return W.createElement(Mt,{className:"recharts-brush-texts"},W.createElement(Po,sm({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,g)-y,y:o+c/2},j),this.getTextOfTick(a)),W.createElement(Po,sm({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,g)+d+y,y:o+c/2},j),this.getTextOfTick(i)))}},{key:"render",value:function(){var r=this.props,a=r.data,i=r.className,o=r.children,c=r.x,d=r.y,f=r.width,h=r.height,p=r.alwaysShowText,g=this.state,y=g.startX,j=g.endX,w=g.isTextActive,x=g.isSlideMoving,S=g.isTravellerMoving,N=g.isTravellerFocused;if(!a||!a.length||!De(c)||!De(d)||!De(f)||!De(h)||f<=0||h<=0)return null;var A=St("recharts-brush",i),P=W.Children.count(o)===1,E=Nle("userSelect","none");return W.createElement(Mt,{className:A,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:E},this.renderBackground(),P&&this.renderPanorama(),this.renderSlide(y,j),this.renderTravellerLayer(y,"startX"),this.renderTravellerLayer(j,"endX"),(w||x||S||N||p)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var a=r.x,i=r.y,o=r.width,c=r.height,d=r.stroke,f=Math.floor(i+c/2)-1;return W.createElement(W.Fragment,null,W.createElement("rect",{x:a,y:i,width:o,height:c,fill:d,stroke:"none"}),W.createElement("line",{x1:a+1,y1:f,x2:a+o-1,y2:f,fill:"none",stroke:"#fff"}),W.createElement("line",{x1:a+1,y1:f+2,x2:a+o-1,y2:f+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,a){var i;return W.isValidElement(r)?i=W.cloneElement(r,a):wt(r)?i=r(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(r,a){var i=r.data,o=r.width,c=r.x,d=r.travellerWidth,f=r.updateId,h=r.startIndex,p=r.endIndex;if(i!==a.prevData||f!==a.prevUpdateId)return qw({prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:o},i&&i.length?Rle({data:i,width:o,x:c,travellerWidth:d,startIndex:h,endIndex:p}):{scale:null,scaleValues:null});if(a.scale&&(o!==a.prevWidth||c!==a.prevX||d!==a.prevTravellerWidth)){a.scale.range([c,c+o-d]);var g=a.scale.domain().map(function(y){return a.scale(y)});return{prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:o,startX:a.scale(r.startIndex),endX:a.scale(r.endIndex),scaleValues:g}}return null}},{key:"getIndexInRange",value:function(r,a){for(var i=r.length,o=0,c=i-1;c-o>1;){var d=Math.floor((o+c)/2);r[d]>a?c=d:o=d}return a>=r[c]?c:o}}])})(v.PureComponent);Br(hc,"displayName","Brush");Br(hc,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Ww,dI;function Tle(){if(dI)return Ww;dI=1;var e=pN();function t(n,r){var a;return e(n,function(i,o,c){return a=r(i,o,c),!a}),!!a}return Ww=t,Ww}var Vw,fI;function Ile(){if(fI)return Vw;fI=1;var e=Q3(),t=us(),n=Tle(),r=_r(),a=pv();function i(o,c,d){var f=r(o)?e:n;return d&&a(o,c,d)&&(c=void 0),f(o,t(c,3))}return Vw=i,Vw}var Mle=Ile();const $le=Yt(Mle);var as=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},Hw,pI;function Dle(){if(pI)return Hw;pI=1;var e=m5();function t(n,r,a){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}return Hw=t,Hw}var Kw,hI;function Lle(){if(hI)return Kw;hI=1;var e=Dle(),t=p5(),n=us();function r(a,i){var o={};return i=n(i,3),t(a,function(c,d,f){e(o,d,i(c,d,f))}),o}return Kw=r,Kw}var Fle=Lle();const Ble=Yt(Fle);var Gw,mI;function zle(){if(mI)return Gw;mI=1;function e(t,n){for(var r=-1,a=t==null?0:t.length;++r<a;)if(!n(t[r],r,t))return!1;return!0}return Gw=e,Gw}var Yw,vI;function Ule(){if(vI)return Yw;vI=1;var e=pN();function t(n,r){var a=!0;return e(n,function(i,o,c){return a=!!r(i,o,c),a}),a}return Yw=t,Yw}var Xw,gI;function qle(){if(gI)return Xw;gI=1;var e=zle(),t=Ule(),n=us(),r=_r(),a=pv();function i(o,c,d){var f=r(o)?e:t;return d&&a(o,c,d)&&(c=void 0),f(o,n(c,3))}return Xw=i,Xw}var Wle=qle();const Vle=Yt(Wle);var Hle=["x","y"];function Wd(e){"@babel/helpers - typeof";return Wd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wd(e)}function Lj(){return Lj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lj.apply(this,arguments)}function yI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function zu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yI(Object(n),!0).forEach(function(r){Kle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kle(e,t,n){return t=Gle(t),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 Wd(t)=="symbol"?t:t+""}function Yle(e,t){if(Wd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Wd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xle(e,t){if(e==null)return{};var n=Qle(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Qle(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Jle(e,t){var n=e.x,r=e.y,a=Xle(e,Hle),i="".concat(n),o=parseInt(i,10),c="".concat(r),d=parseInt(c,10),f="".concat(t.height||a.height),h=parseInt(f,10),p="".concat(t.width||a.width),g=parseInt(p,10);return zu(zu(zu(zu(zu({},t),a),o?{x:o}:{}),d?{y:d}:{}),{},{height:h,width:g,name:t.name,radius:t.radius})}function xI(e){return W.createElement(KL,Lj({shapeType:"rectangle",propTransformer:Jle,activeClassName:"recharts-active-bar"},e))}var Zle=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,a){if(typeof t=="number")return t;var i=De(r)||yY(r);return i?t(r,a):(i||ko(),n)}},ece=["value","background"],e4;function mc(e){"@babel/helpers - typeof";return mc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mc(e)}function tce(e,t){if(e==null)return{};var n=nce(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function nce(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function om(){return om=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},om.apply(this,arguments)}function bI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function On(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bI(Object(n),!0).forEach(function(r){_i(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,n4(r.key),r)}}function ace(e,t,n){return t&&wI(e.prototype,t),n&&wI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function sce(e,t,n){return t=lm(t),ice(e,t4()?Reflect.construct(t,n||[],lm(e).constructor):t.apply(e,n))}function ice(e,t){if(t&&(mc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oce(e)}function oce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(t4=function(){return!!e})()}function lm(e){return lm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},lm(e)}function lce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fj(e,t)}function Fj(e,t){return Fj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Fj(e,t)}function _i(e,t,n){return t=n4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n4(e){var t=cce(e,"string");return mc(t)=="symbol"?t:t+""}function cce(e,t){if(mc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(mc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Wo=(function(e){function t(){var n;rce(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=sce(this,t,[].concat(a)),_i(n,"state",{isAnimationFinished:!1}),_i(n,"id",Bc("recharts-bar-")),_i(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),_i(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return lce(t,e),ace(t,[{key:"renderRectanglesStatically",value:function(r){var a=this,i=this.props,o=i.shape,c=i.dataKey,d=i.activeIndex,f=i.activeBar,h=ht(this.props,!1);return r&&r.map(function(p,g){var y=g===d,j=y?f:o,w=On(On(On({},h),p),{},{isActive:y,option:j,index:g,dataKey:c,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return W.createElement(Mt,om({className:"recharts-bar-rectangle"},_o(a.props,p,g),{key:"rectangle-".concat(p?.x,"-").concat(p?.y,"-").concat(p?.value,"-").concat(g)}),W.createElement(xI,w))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,a=this.props,i=a.data,o=a.layout,c=a.isAnimationActive,d=a.animationBegin,f=a.animationDuration,h=a.animationEasing,p=a.animationId,g=this.state.prevData;return W.createElement(os,{begin:d,duration:f,isActive:c,easing:h,from:{t:0},to:{t:1},key:"bar-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(y){var j=y.t,w=i.map(function(x,S){var N=g&&g[S];if(N){var A=Wr(N.x,x.x),P=Wr(N.y,x.y),E=Wr(N.width,x.width),O=Wr(N.height,x.height);return On(On({},x),{},{x:A(j),y:P(j),width:E(j),height:O(j)})}if(o==="horizontal"){var k=Wr(0,x.height),R=k(j);return On(On({},x),{},{y:x.y+x.height-R,height:R})}var D=Wr(0,x.width),U=D(j);return On(On({},x),{},{width:U})});return W.createElement(Mt,null,r.renderRectanglesStatically(w))})}},{key:"renderRectangles",value:function(){var r=this.props,a=r.data,i=r.isAnimationActive,o=this.state.prevData;return i&&a&&a.length&&(!o||!gf(o,a))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(a)}},{key:"renderBackground",value:function(){var r=this,a=this.props,i=a.data,o=a.dataKey,c=a.activeIndex,d=ht(this.props.background,!1);return i.map(function(f,h){f.value;var p=f.background,g=tce(f,ece);if(!p)return null;var y=On(On(On(On(On({},g),{},{fill:"#eee"},p),d),_o(r.props,f,h)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:h,className:"recharts-bar-background-rectangle"});return W.createElement(xI,om({key:"background-bar-".concat(h),option:r.props.background,isActive:h===c},y))})}},{key:"renderErrorBar",value:function(r,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.data,c=i.xAxis,d=i.yAxis,f=i.layout,h=i.children,p=Jr(h,yf);if(!p)return null;var g=f==="vertical"?o[0].height/2:o[0].width/2,y=function(x,S){var N=Array.isArray(x.value)?x.value[1]:x.value;return{x:x.x,y:x.y,value:N,errorVal:Ln(x,S)}},j={clipPath:r?"url(#clipPath-".concat(a,")"):null};return W.createElement(Mt,j,p.map(function(w){return W.cloneElement(w,{key:"error-bar-".concat(a,"-").concat(w.props.dataKey),data:o,xAxis:c,yAxis:d,layout:f,offset:g,dataPointFormatter:y})}))}},{key:"render",value:function(){var r=this.props,a=r.hide,i=r.data,o=r.className,c=r.xAxis,d=r.yAxis,f=r.left,h=r.top,p=r.width,g=r.height,y=r.isAnimationActive,j=r.background,w=r.id;if(a||!i||!i.length)return null;var x=this.state.isAnimationFinished,S=St("recharts-bar",o),N=c&&c.allowDataOverflow,A=d&&d.allowDataOverflow,P=N||A,E=jt(w)?this.id:w;return W.createElement(Mt,{className:S},N||A?W.createElement("defs",null,W.createElement("clipPath",{id:"clipPath-".concat(E)},W.createElement("rect",{x:N?f:f-p/2,y:A?h:h-g/2,width:N?p:p*2,height:A?g:g*2}))):null,W.createElement(Mt,{className:"recharts-bar-rectangles",clipPath:P?"url(#clipPath-".concat(E,")"):null},j?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(P,E),(!y||x)&&Fs.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:a.curData}:r.data!==a.curData?{curData:r.data}:null}}])})(v.PureComponent);e4=Wo;_i(Wo,"displayName","Bar");_i(Wo,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Bo.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});_i(Wo,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,a=e.bandSize,i=e.xAxis,o=e.yAxis,c=e.xAxisTicks,d=e.yAxisTicks,f=e.stackedData,h=e.dataStartIndex,p=e.displayedData,g=e.offset,y=Tre(r,n);if(!y)return null;var j=t.layout,w=n.type.defaultProps,x=w!==void 0?On(On({},w),n.props):n.props,S=x.dataKey,N=x.children,A=x.minPointSize,P=j==="horizontal"?o:i,E=f?P.scale.domain():null,O=Bre({numericAxis:P}),k=Jr(N,hv),R=p.map(function(D,U){var z,L,G,q,H,X;f?z=Ire(f[h+U],E):(z=Ln(D,S),Array.isArray(z)||(z=[O,z]));var Z=Zle(A,e4.defaultProps.minPointSize)(z[1],U);if(j==="horizontal"){var I,F=[o.scale(z[0]),o.scale(z[1])],Q=F[0],B=F[1];L=YR({axis:i,ticks:c,bandSize:a,offset:y.offset,entry:D,index:U}),G=(I=B??Q)!==null&&I!==void 0?I:void 0,q=y.size;var $=Q-B;if(H=Number.isNaN($)?0:$,X={x:L,y:o.y,width:q,height:o.height},Math.abs(Z)>0&&Math.abs(H)<Math.abs(Z)){var ee=fr(H||Z)*(Math.abs(Z)-Math.abs(H));G-=ee,H+=ee}}else{var V=[i.scale(z[0]),i.scale(z[1])],J=V[0],ge=V[1];if(L=J,G=YR({axis:o,ticks:d,bandSize:a,offset:y.offset,entry:D,index:U}),q=ge-J,H=y.size,X={x:i.x,y:G,width:i.width,height:H},Math.abs(Z)>0&&Math.abs(q)<Math.abs(Z)){var ie=fr(q||Z)*(Math.abs(Z)-Math.abs(q));q+=ie}}return On(On(On({},D),{},{x:L,y:G,width:q,height:H,value:f?z:z[1],payload:D,background:X},k&&k[U]&&k[U].props),{},{tooltipPayload:[PL(n,D)],tooltipPosition:{x:L+q/2,y:G+H/2}})});return On({data:R,layout:j},g)});function Vd(e){"@babel/helpers - typeof";return Vd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vd(e)}function uce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r4(r.key),r)}}function dce(e,t,n){return t&&jI(e.prototype,t),n&&jI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function SI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ma(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SI(Object(n),!0).forEach(function(r){Tv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tv(e,t,n){return t=r4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r4(e){var t=fce(e,"string");return Vd(t)=="symbol"?t:t+""}function fce(e,t){if(Vd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var a4=function(t,n,r,a,i){var o=t.width,c=t.height,d=t.layout,f=t.children,h=Object.keys(n),p={left:r.left,leftMirror:r.left,right:o-r.right,rightMirror:o-r.right,top:r.top,topMirror:r.top,bottom:c-r.bottom,bottomMirror:c-r.bottom},g=!!zr(f,Wo);return h.reduce(function(y,j){var w=n[j],x=w.orientation,S=w.domain,N=w.padding,A=N===void 0?{}:N,P=w.mirror,E=w.reversed,O="".concat(x).concat(P?"Mirror":""),k,R,D,U,z;if(w.type==="number"&&(w.padding==="gap"||w.padding==="no-gap")){var L=S[1]-S[0],G=1/0,q=w.categoricalDomain.sort(wY);if(q.forEach(function(V,J){J>0&&(G=Math.min((V||0)-(q[J-1]||0),G))}),Number.isFinite(G)){var H=G/L,X=w.layout==="vertical"?r.height:r.width;if(w.padding==="gap"&&(k=H*X/2),w.padding==="no-gap"){var Z=pr(t.barCategoryGap,H*X),I=H*X/2;k=I-Z-(I-Z)/X*Z}}}a==="xAxis"?R=[r.left+(A.left||0)+(k||0),r.left+r.width-(A.right||0)-(k||0)]:a==="yAxis"?R=d==="horizontal"?[r.top+r.height-(A.bottom||0),r.top+(A.top||0)]:[r.top+(A.top||0)+(k||0),r.top+r.height-(A.bottom||0)-(k||0)]:R=w.range,E&&(R=[R[1],R[0]]);var F=CL(w,i,g),Q=F.scale,B=F.realScaleType;Q.domain(S).range(R),AL(Q);var $=EL(Q,Ma(Ma({},w),{},{realScaleType:B}));a==="xAxis"?(z=x==="top"&&!P||x==="bottom"&&P,D=r.left,U=p[O]-z*w.height):a==="yAxis"&&(z=x==="left"&&!P||x==="right"&&P,D=p[O]-z*w.width,U=r.top);var ee=Ma(Ma(Ma({},w),$),{},{realScaleType:B,x:D,y:U,scale:Q,width:a==="xAxis"?r.width:w.width,height:a==="yAxis"?r.height:w.height});return ee.bandSize=Wh(ee,$),!w.hide&&a==="xAxis"?p[O]+=(z?-1:1)*ee.height:w.hide||(p[O]+=(z?-1:1)*ee.width),Ma(Ma({},y),{},Tv({},j,ee))},{})},s4=function(t,n){var r=t.x,a=t.y,i=n.x,o=n.y;return{x:Math.min(r,i),y:Math.min(a,o),width:Math.abs(i-r),height:Math.abs(o-a)}},pce=function(t){var n=t.x1,r=t.y1,a=t.x2,i=t.y2;return s4({x:n,y:r},{x:a,y:i})},i4=(function(){function e(t){uce(this,e),this.scale=t}return dce(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.bandAware,i=r.position;if(n!==void 0){if(i)switch(i){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var c=this.bandwidth?this.bandwidth():0;return this.scale(n)+c}default:return this.scale(n)}if(a){var d=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+d}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),a=r[0],i=r[r.length-1];return a<=i?n>=a&&n<=i:n>=i&&n<=a}}],[{key:"create",value:function(n){return new e(n)}}])})();Tv(i4,"EPS",1e-4);var UN=function(t){var n=Object.keys(t).reduce(function(r,a){return Ma(Ma({},r),{},Tv({},a,i4.create(t[a])))},{});return Ma(Ma({},n),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,c=i.position;return Ble(a,function(d,f){return n[f].apply(d,{bandAware:o,position:c})})},isInRange:function(a){return Vle(a,function(i,o){return n[o].isInRange(i)})}})};function hce(e){return(e%180+180)%180}var mce=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=hce(a),o=i*Math.PI/180,c=Math.atan(r/n),d=o>c&&o<Math.PI-c?r/Math.sin(o):n/Math.cos(o);return Math.abs(d)},Qw,NI;function vce(){if(NI)return Qw;NI=1;var e=us(),t=ff(),n=dv();function r(a){return function(i,o,c){var d=Object(i);if(!t(i)){var f=e(o,3);i=n(i),o=function(p){return f(d[p],p,d)}}var h=a(i,o,c);return h>-1?d[f?i[h]:h]:void 0}}return Qw=r,Qw}var Jw,CI;function gce(){if(CI)return Jw;CI=1;var e=XL();function t(n){var r=e(n),a=r%1;return r===r?a?r-a:r:0}return Jw=t,Jw}var Zw,AI;function yce(){if(AI)return Zw;AI=1;var e=l5(),t=us(),n=gce(),r=Math.max;function a(i,o,c){var d=i==null?0:i.length;if(!d)return-1;var f=c==null?0:n(c);return f<0&&(f=r(d+f,0)),e(i,t(o,3),f)}return Zw=a,Zw}var e1,EI;function xce(){if(EI)return e1;EI=1;var e=vce(),t=yce(),n=e(t);return e1=n,e1}xce();var bce=N3();const wce=Yt(bce);var jce=wce(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),o4=v.createContext(void 0),l4=v.createContext(void 0),c4=v.createContext(void 0),Sce=v.createContext({}),u4=v.createContext(void 0),d4=v.createContext(0),f4=v.createContext(0),_I=function(t){var n=t.state,r=n.xAxisMap,a=n.yAxisMap,i=n.offset,o=t.clipPathId,c=t.children,d=t.width,f=t.height,h=jce(i);return W.createElement(o4.Provider,{value:r},W.createElement(l4.Provider,{value:a},W.createElement(Sce.Provider,{value:i},W.createElement(c4.Provider,{value:h},W.createElement(u4.Provider,{value:o},W.createElement(d4.Provider,{value:f},W.createElement(f4.Provider,{value:d},c)))))))},Nce=function(){return v.useContext(u4)},p4=function(t){var n=v.useContext(o4);n==null&&ko();var r=n[t];return r==null&&ko(),r},h4=function(t){var n=v.useContext(l4);n==null&&ko();var r=n[t];return r==null&&ko(),r},Cce=function(){var t=v.useContext(c4);return t},m4=function(){return v.useContext(f4)},v4=function(){return v.useContext(d4)};function vc(e){"@babel/helpers - typeof";return vc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vc(e)}function Ace(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ece(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,y4(r.key),r)}}function _ce(e,t,n){return t&&Ece(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pce(e,t,n){return t=cm(t),Oce(e,g4()?Reflect.construct(t,n||[],cm(e).constructor):t.apply(e,n))}function Oce(e,t){if(t&&(vc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kce(e)}function kce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(g4=function(){return!!e})()}function cm(e){return cm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},cm(e)}function Rce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bj(e,t)}function Bj(e,t){return Bj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Bj(e,t)}function PI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function OI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PI(Object(n),!0).forEach(function(r){qN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qN(e,t,n){return t=y4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y4(e){var t=Tce(e,"string");return vc(t)=="symbol"?t:t+""}function Tce(e,t){if(vc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(vc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Ice(e,t){return Lce(e)||Dce(e,t)||$ce(e,t)||Mce()}function Mce(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
116
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $ce(e,t){if(e){if(typeof e=="string")return kI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kI(e,t)}}function kI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Dce(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function Lce(e){if(Array.isArray(e))return e}function zj(){return zj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zj.apply(this,arguments)}var Fce=function(t,n){var r;return W.isValidElement(t)?r=W.cloneElement(t,n):wt(t)?r=t(n):r=W.createElement("line",zj({},n,{className:"recharts-reference-line-line"})),r},Bce=function(t,n,r,a,i,o,c,d,f){var h=i.x,p=i.y,g=i.width,y=i.height;if(r){var j=f.y,w=t.y.apply(j,{position:o});if(as(f,"discard")&&!t.y.isInRange(w))return null;var x=[{x:h+g,y:w},{x:h,y:w}];return d==="left"?x.reverse():x}if(n){var S=f.x,N=t.x.apply(S,{position:o});if(as(f,"discard")&&!t.x.isInRange(N))return null;var A=[{x:N,y:p+y},{x:N,y:p}];return c==="top"?A.reverse():A}if(a){var P=f.segment,E=P.map(function(O){return t.apply(O,{position:o})});return as(f,"discard")&&$le(E,function(O){return!t.isInRange(O)})?null:E}return null};function zce(e){var t=e.x,n=e.y,r=e.segment,a=e.xAxisId,i=e.yAxisId,o=e.shape,c=e.className,d=e.alwaysShow,f=Nce(),h=p4(a),p=h4(i),g=Cce();if(!f||!g)return null;Ds(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var y=UN({x:h.scale,y:p.scale}),j=Fn(t),w=Fn(n),x=r&&r.length===2,S=Bce(y,j,w,x,g,e.position,h.orientation,p.orientation,e);if(!S)return null;var N=Ice(S,2),A=N[0],P=A.x,E=A.y,O=N[1],k=O.x,R=O.y,D=as(e,"hidden")?"url(#".concat(f,")"):void 0,U=OI(OI({clipPath:D},ht(e,!0)),{},{x1:P,y1:E,x2:k,y2:R});return W.createElement(Mt,{className:St("recharts-reference-line",c)},Fce(o,U),Gn.renderCallByParent(e,pce({x1:P,y1:E,x2:k,y2:R})))}var WN=(function(e){function t(){return Ace(this,t),Pce(this,t,arguments)}return Rce(t,e),_ce(t,[{key:"render",value:function(){return W.createElement(zce,this.props)}}])})(W.Component);qN(WN,"displayName","ReferenceLine");qN(WN,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function Uj(){return Uj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Uj.apply(this,arguments)}function gc(e){"@babel/helpers - typeof";return gc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gc(e)}function RI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function TI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RI(Object(n),!0).forEach(function(r){Iv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Uce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,b4(r.key),r)}}function Wce(e,t,n){return t&&qce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Vce(e,t,n){return t=um(t),Hce(e,x4()?Reflect.construct(t,n||[],um(e).constructor):t.apply(e,n))}function Hce(e,t){if(t&&(gc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kce(e)}function Kce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function x4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(x4=function(){return!!e})()}function um(e){return um=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},um(e)}function Gce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qj(e,t)}function qj(e,t){return qj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},qj(e,t)}function Iv(e,t,n){return t=b4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b4(e){var t=Yce(e,"string");return gc(t)=="symbol"?t:t+""}function Yce(e,t){if(gc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(gc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Xce=function(t){var n=t.x,r=t.y,a=t.xAxis,i=t.yAxis,o=UN({x:a.scale,y:i.scale}),c=o.apply({x:n,y:r},{bandAware:!0});return as(t,"discard")&&!o.isInRange(c)?null:c},Mv=(function(e){function t(){return Uce(this,t),Vce(this,t,arguments)}return Gce(t,e),Wce(t,[{key:"render",value:function(){var r=this.props,a=r.x,i=r.y,o=r.r,c=r.alwaysShow,d=r.clipPathId,f=Fn(a),h=Fn(i);if(Ds(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!f||!h)return null;var p=Xce(this.props);if(!p)return null;var g=p.x,y=p.y,j=this.props,w=j.shape,x=j.className,S=as(this.props,"hidden")?"url(#".concat(d,")"):void 0,N=TI(TI({clipPath:S},ht(this.props,!0)),{},{cx:g,cy:y});return W.createElement(Mt,{className:St("recharts-reference-dot",x)},t.renderDot(w,N),Gn.renderCallByParent(this.props,{x:g-o,y:y-o,width:2*o,height:2*o}))}}])})(W.Component);Iv(Mv,"displayName","ReferenceDot");Iv(Mv,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Iv(Mv,"renderDot",function(e,t){var n;return W.isValidElement(e)?n=W.cloneElement(e,t):wt(e)?n=e(t):n=W.createElement(Av,Uj({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function Wj(){return Wj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wj.apply(this,arguments)}function yc(e){"@babel/helpers - typeof";return yc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yc(e)}function II(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function MI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?II(Object(n),!0).forEach(function(r){$v(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):II(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,j4(r.key),r)}}function Zce(e,t,n){return t&&Jce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function eue(e,t,n){return t=dm(t),tue(e,w4()?Reflect.construct(t,n||[],dm(e).constructor):t.apply(e,n))}function tue(e,t){if(t&&(yc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nue(e)}function nue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function w4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(w4=function(){return!!e})()}function dm(e){return dm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},dm(e)}function rue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vj(e,t)}function Vj(e,t){return Vj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Vj(e,t)}function $v(e,t,n){return t=j4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j4(e){var t=aue(e,"string");return yc(t)=="symbol"?t:t+""}function aue(e,t){if(yc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(yc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var sue=function(t,n,r,a,i){var o=i.x1,c=i.x2,d=i.y1,f=i.y2,h=i.xAxis,p=i.yAxis;if(!h||!p)return null;var g=UN({x:h.scale,y:p.scale}),y={x:t?g.x.apply(o,{position:"start"}):g.x.rangeMin,y:r?g.y.apply(d,{position:"start"}):g.y.rangeMin},j={x:n?g.x.apply(c,{position:"end"}):g.x.rangeMax,y:a?g.y.apply(f,{position:"end"}):g.y.rangeMax};return as(i,"discard")&&(!g.isInRange(y)||!g.isInRange(j))?null:s4(y,j)},Dv=(function(e){function t(){return Qce(this,t),eue(this,t,arguments)}return rue(t,e),Zce(t,[{key:"render",value:function(){var r=this.props,a=r.x1,i=r.x2,o=r.y1,c=r.y2,d=r.className,f=r.alwaysShow,h=r.clipPathId;Ds(f===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=Fn(a),g=Fn(i),y=Fn(o),j=Fn(c),w=this.props.shape;if(!p&&!g&&!y&&!j&&!w)return null;var x=sue(p,g,y,j,this.props);if(!x&&!w)return null;var S=as(this.props,"hidden")?"url(#".concat(h,")"):void 0;return W.createElement(Mt,{className:St("recharts-reference-area",d)},t.renderRect(w,MI(MI({clipPath:S},ht(this.props,!0)),x)),Gn.renderCallByParent(this.props,x))}}])})(W.Component);$v(Dv,"displayName","ReferenceArea");$v(Dv,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});$v(Dv,"renderRect",function(e,t){var n;return W.isValidElement(e)?n=W.cloneElement(e,t):wt(e)?n=e(t):n=W.createElement(zN,Wj({},t,{className:"recharts-reference-area-rect"})),n});function S4(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],a=0;a<e.length;a+=t)r.push(e[a]);return r}function iue(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return mce(r,n)}function oue(e,t,n){var r=n==="width",a=e.x,i=e.y,o=e.width,c=e.height;return t===1?{start:r?a:i,end:r?a+o:i+c}:{start:r?a+o:i+c,end:r?a:i}}function fm(e,t,n,r,a){if(e*t<e*r||e*t>e*a)return!1;var i=n();return e*(t-e*i/2-r)>=0&&e*(t+e*i/2-a)<=0}function lue(e,t){return S4(e,t+1)}function cue(e,t,n,r,a){for(var i=(r||[]).slice(),o=t.start,c=t.end,d=0,f=1,h=o,p=function(){var j=r?.[d];if(j===void 0)return{v:S4(r,f)};var w=d,x,S=function(){return x===void 0&&(x=n(j,w)),x},N=j.coordinate,A=d===0||fm(e,N,S,h,c);A||(d=0,h=o,f+=1),A&&(h=N+e*(S()/2+a),d+=f)},g;f<=i.length;)if(g=p(),g)return g.v;return[]}function Hd(e){"@babel/helpers - typeof";return Hd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hd(e)}function $I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function lr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$I(Object(n),!0).forEach(function(r){uue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$I(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uue(e,t,n){return t=due(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function due(e){var t=fue(e,"string");return Hd(t)=="symbol"?t:t+""}function fue(e,t){if(Hd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Hd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pue(e,t,n,r,a){for(var i=(r||[]).slice(),o=i.length,c=t.start,d=t.end,f=function(g){var y=i[g],j,w=function(){return j===void 0&&(j=n(y,g)),j};if(g===o-1){var x=e*(y.coordinate+e*w()/2-d);i[g]=y=lr(lr({},y),{},{tickCoord:x>0?y.coordinate-x*e:y.coordinate})}else i[g]=y=lr(lr({},y),{},{tickCoord:y.coordinate});var S=fm(e,y.tickCoord,w,c,d);S&&(d=y.tickCoord-e*(w()/2+a),i[g]=lr(lr({},y),{},{isShow:!0}))},h=o-1;h>=0;h--)f(h);return i}function hue(e,t,n,r,a,i){var o=(r||[]).slice(),c=o.length,d=t.start,f=t.end;if(i){var h=r[c-1],p=n(h,c-1),g=e*(h.coordinate+e*p/2-f);o[c-1]=h=lr(lr({},h),{},{tickCoord:g>0?h.coordinate-g*e:h.coordinate});var y=fm(e,h.tickCoord,function(){return p},d,f);y&&(f=h.tickCoord-e*(p/2+a),o[c-1]=lr(lr({},h),{},{isShow:!0}))}for(var j=i?c-1:c,w=function(N){var A=o[N],P,E=function(){return P===void 0&&(P=n(A,N)),P};if(N===0){var O=e*(A.coordinate-e*E()/2-d);o[N]=A=lr(lr({},A),{},{tickCoord:O<0?A.coordinate-O*e:A.coordinate})}else o[N]=A=lr(lr({},A),{},{tickCoord:A.coordinate});var k=fm(e,A.tickCoord,E,d,f);k&&(d=A.tickCoord+e*(E()/2+a),o[N]=lr(lr({},A),{},{isShow:!0}))},x=0;x<j;x++)w(x);return o}function mue(e,t,n){var r=e.tick,a=e.ticks,i=e.viewBox,o=e.minTickGap,c=e.orientation,d=e.interval,f=e.tickFormatter,h=e.unit,p=e.angle;if(!a||!a.length||!r)return[];if(De(d)||Bo.isSsr)return lue(a,typeof d=="number"&&De(d)?d:0);var g=[],y=c==="top"||c==="bottom"?"width":"height",j=h&&y==="width"?Zu(h,{fontSize:t,letterSpacing:n}):{width:0,height:0},w=function(A,P){var E=wt(f)?f(A.value,P):A.value;return y==="width"?iue(Zu(E,{fontSize:t,letterSpacing:n}),j,p):Zu(E,{fontSize:t,letterSpacing:n})[y]},x=a.length>=2?fr(a[1].coordinate-a[0].coordinate):1,S=oue(i,x,y);return d==="equidistantPreserveStart"?cue(x,S,w,a,o):(d==="preserveStart"||d==="preserveStartEnd"?g=hue(x,S,w,a,o,d==="preserveStartEnd"):g=pue(x,S,w,a,o),g.filter(function(N){return N.isShow}))}var vue=["viewBox"],gue=["viewBox"],yue=["ticks"];function xc(e){"@babel/helpers - typeof";return xc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xc(e)}function Tl(){return Tl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tl.apply(this,arguments)}function DI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function $n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DI(Object(n),!0).forEach(function(r){VN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function t1(e,t){if(e==null)return{};var n=xue(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xue(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function bue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,C4(r.key),r)}}function wue(e,t,n){return t&&LI(e.prototype,t),n&&LI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function jue(e,t,n){return t=pm(t),Sue(e,N4()?Reflect.construct(t,n||[],pm(e).constructor):t.apply(e,n))}function Sue(e,t){if(t&&(xc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Nue(e)}function Nue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function N4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(N4=function(){return!!e})()}function pm(e){return pm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},pm(e)}function Cue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hj(e,t)}function Hj(e,t){return Hj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Hj(e,t)}function VN(e,t,n){return t=C4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C4(e){var t=Aue(e,"string");return xc(t)=="symbol"?t:t+""}function Aue(e,t){if(xc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Lv=(function(e){function t(n){var r;return bue(this,t),r=jue(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return Cue(t,e),wue(t,[{key:"shouldComponentUpdate",value:function(r,a){var i=r.viewBox,o=t1(r,vue),c=this.props,d=c.viewBox,f=t1(c,gue);return!zl(i,d)||!zl(o,f)||!zl(a,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var a=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];a&&this.setState({fontSize:window.getComputedStyle(a).fontSize,letterSpacing:window.getComputedStyle(a).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var a=this.props,i=a.x,o=a.y,c=a.width,d=a.height,f=a.orientation,h=a.tickSize,p=a.mirror,g=a.tickMargin,y,j,w,x,S,N,A=p?-1:1,P=r.tickSize||h,E=De(r.tickCoord)?r.tickCoord:r.coordinate;switch(f){case"top":y=j=r.coordinate,x=o+ +!p*d,w=x-A*P,N=w-A*g,S=E;break;case"left":w=x=r.coordinate,j=i+ +!p*c,y=j-A*P,S=y-A*g,N=E;break;case"right":w=x=r.coordinate,j=i+ +p*c,y=j+A*P,S=y+A*g,N=E;break;default:y=j=r.coordinate,x=o+ +p*d,w=x+A*P,N=w+A*g,S=E;break}return{line:{x1:y,y1:w,x2:j,y2:x},tick:{x:S,y:N}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,a=r.orientation,i=r.mirror,o;switch(a){case"left":o=i?"start":"end";break;case"right":o=i?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,a=r.orientation,i=r.mirror,o="end";switch(a){case"left":case"right":o="middle";break;case"top":o=i?"start":"end";break;default:o=i?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.x,i=r.y,o=r.width,c=r.height,d=r.orientation,f=r.mirror,h=r.axisLine,p=$n($n($n({},ht(this.props,!1)),ht(h,!1)),{},{fill:"none"});if(d==="top"||d==="bottom"){var g=+(d==="top"&&!f||d==="bottom"&&f);p=$n($n({},p),{},{x1:a,y1:i+g*c,x2:a+o,y2:i+g*c})}else{var y=+(d==="left"&&!f||d==="right"&&f);p=$n($n({},p),{},{x1:a+y*o,y1:i,x2:a+y*o,y2:i+c})}return W.createElement("line",Tl({},p,{className:St("recharts-cartesian-axis-line",Qr(h,"className"))}))}},{key:"renderTicks",value:function(r,a,i){var o=this,c=this.props,d=c.tickLine,f=c.stroke,h=c.tick,p=c.tickFormatter,g=c.unit,y=mue($n($n({},this.props),{},{ticks:r}),a,i),j=this.getTickTextAnchor(),w=this.getTickVerticalAnchor(),x=ht(this.props,!1),S=ht(h,!1),N=$n($n({},x),{},{fill:"none"},ht(d,!1)),A=y.map(function(P,E){var O=o.getTickLineCoord(P),k=O.line,R=O.tick,D=$n($n($n($n({textAnchor:j,verticalAnchor:w},x),{},{stroke:"none",fill:f},S),R),{},{index:E,payload:P,visibleTicksCount:y.length,tickFormatter:p});return W.createElement(Mt,Tl({className:"recharts-cartesian-axis-tick",key:"tick-".concat(P.value,"-").concat(P.coordinate,"-").concat(P.tickCoord)},_o(o.props,P,E)),d&&W.createElement("line",Tl({},N,k,{className:St("recharts-cartesian-axis-tick-line",Qr(d,"className"))})),h&&t.renderTickItem(h,D,"".concat(wt(p)?p(P.value,E):P.value).concat(g||"")))});return W.createElement("g",{className:"recharts-cartesian-axis-ticks"},A)}},{key:"render",value:function(){var r=this,a=this.props,i=a.axisLine,o=a.width,c=a.height,d=a.ticksGenerator,f=a.className,h=a.hide;if(h)return null;var p=this.props,g=p.ticks,y=t1(p,yue),j=g;return wt(d)&&(j=g&&g.length>0?d(this.props):d(y)),o<=0||c<=0||!j||!j.length?null:W.createElement(Mt,{className:St("recharts-cartesian-axis",f),ref:function(x){r.layerReference=x}},i&&this.renderAxisLine(),this.renderTicks(j,this.state.fontSize,this.state.letterSpacing),Gn.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,a,i){var o,c=St(a.className,"recharts-cartesian-axis-tick-value");return W.isValidElement(r)?o=W.cloneElement(r,$n($n({},a),{},{className:c})):wt(r)?o=r($n($n({},a),{},{className:c})):o=W.createElement(Po,Tl({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])})(v.Component);VN(Lv,"displayName","CartesianAxis");VN(Lv,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Eue=["type","layout","connectNulls","ref"],_ue=["key"];function bc(e){"@babel/helpers - typeof";return bc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bc(e)}function FI(e,t){if(e==null)return{};var n=Pue(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Pue(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function sd(){return sd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sd.apply(this,arguments)}function BI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Fr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BI(Object(n),!0).forEach(function(r){$a(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nl(e){return Tue(e)||Rue(e)||kue(e)||Oue()}function Oue(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
117
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kue(e,t){if(e){if(typeof e=="string")return Kj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kj(e,t)}}function Rue(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Tue(e){if(Array.isArray(e))return Kj(e)}function Kj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Iue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,E4(r.key),r)}}function Mue(e,t,n){return t&&zI(e.prototype,t),n&&zI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function $ue(e,t,n){return t=hm(t),Due(e,A4()?Reflect.construct(t,n||[],hm(e).constructor):t.apply(e,n))}function Due(e,t){if(t&&(bc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Lue(e)}function Lue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(A4=function(){return!!e})()}function hm(e){return hm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},hm(e)}function Fue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gj(e,t)}function Gj(e,t){return Gj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Gj(e,t)}function $a(e,t,n){return t=E4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E4(e){var t=Bue(e,"string");return bc(t)=="symbol"?t:t+""}function Bue(e,t){if(bc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(bc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var wc=(function(e){function t(){var n;Iue(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=$ue(this,t,[].concat(a)),$a(n,"state",{isAnimationFinished:!0,totalLength:0}),$a(n,"generateSimpleStrokeDasharray",function(o,c){return"".concat(c,"px ").concat(o-c,"px")}),$a(n,"getStrokeDasharray",function(o,c,d){var f=d.reduce(function(S,N){return S+N});if(!f)return n.generateSimpleStrokeDasharray(c,o);for(var h=Math.floor(o/f),p=o%f,g=c-o,y=[],j=0,w=0;j<d.length;w+=d[j],++j)if(w+d[j]>p){y=[].concat(Nl(d.slice(0,j)),[p-w]);break}var x=y.length%2===0?[0,g]:[g];return[].concat(Nl(t.repeat(d,h)),Nl(y),x).map(function(S){return"".concat(S,"px")}).join(", ")}),$a(n,"id",Bc("recharts-line-")),$a(n,"pathRef",function(o){n.mainCurve=o}),$a(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),$a(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return Fue(t,e),Mue(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.points,c=i.xAxis,d=i.yAxis,f=i.layout,h=i.children,p=Jr(h,yf);if(!p)return null;var g=function(w,x){return{x:w.x,y:w.y,value:w.value,errorVal:Ln(w.payload,x)}},y={clipPath:r?"url(#clipPath-".concat(a,")"):null};return W.createElement(Mt,y,p.map(function(j){return W.cloneElement(j,{key:"bar-".concat(j.props.dataKey),data:o,xAxis:c,yAxis:d,layout:f,dataPointFormatter:g})}))}},{key:"renderDots",value:function(r,a,i){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var c=this.props,d=c.dot,f=c.points,h=c.dataKey,p=ht(this.props,!1),g=ht(d,!0),y=f.map(function(w,x){var S=Fr(Fr(Fr({key:"dot-".concat(x),r:3},p),g),{},{index:x,cx:w.x,cy:w.y,value:w.value,dataKey:h,payload:w.payload,points:f});return t.renderDotItem(d,S)}),j={clipPath:r?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return W.createElement(Mt,sd({className:"recharts-line-dots",key:"dots"},j),y)}},{key:"renderCurveStatically",value:function(r,a,i,o){var c=this.props,d=c.type,f=c.layout,h=c.connectNulls;c.ref;var p=FI(c,Eue),g=Fr(Fr(Fr({},ht(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:a?"url(#clipPath-".concat(i,")"):null,points:r},o),{},{type:d,layout:f,connectNulls:h});return W.createElement(Kh,sd({},g,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,a){var i=this,o=this.props,c=o.points,d=o.strokeDasharray,f=o.isAnimationActive,h=o.animationBegin,p=o.animationDuration,g=o.animationEasing,y=o.animationId,j=o.animateNewValues,w=o.width,x=o.height,S=this.state,N=S.prevPoints,A=S.totalLength;return W.createElement(os,{begin:h,duration:p,isActive:f,easing:g,from:{t:0},to:{t:1},key:"line-".concat(y),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(P){var E=P.t;if(N){var O=N.length/c.length,k=c.map(function(L,G){var q=Math.floor(G*O);if(N[q]){var H=N[q],X=Wr(H.x,L.x),Z=Wr(H.y,L.y);return Fr(Fr({},L),{},{x:X(E),y:Z(E)})}if(j){var I=Wr(w*2,L.x),F=Wr(x/2,L.y);return Fr(Fr({},L),{},{x:I(E),y:F(E)})}return Fr(Fr({},L),{},{x:L.x,y:L.y})});return i.renderCurveStatically(k,r,a)}var R=Wr(0,A),D=R(E),U;if(d){var z="".concat(d).split(/[,\s]+/gim).map(function(L){return parseFloat(L)});U=i.getStrokeDasharray(D,A,z)}else U=i.generateSimpleStrokeDasharray(A,D);return i.renderCurveStatically(c,r,a,{strokeDasharray:U})})}},{key:"renderCurve",value:function(r,a){var i=this.props,o=i.points,c=i.isAnimationActive,d=this.state,f=d.prevPoints,h=d.totalLength;return c&&o&&o.length&&(!f&&h>0||!gf(f,o))?this.renderCurveWithAnimation(r,a):this.renderCurveStatically(o,r,a)}},{key:"render",value:function(){var r,a=this.props,i=a.hide,o=a.dot,c=a.points,d=a.className,f=a.xAxis,h=a.yAxis,p=a.top,g=a.left,y=a.width,j=a.height,w=a.isAnimationActive,x=a.id;if(i||!c||!c.length)return null;var S=this.state.isAnimationFinished,N=c.length===1,A=St("recharts-line",d),P=f&&f.allowDataOverflow,E=h&&h.allowDataOverflow,O=P||E,k=jt(x)?this.id:x,R=(r=ht(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},D=R.r,U=D===void 0?3:D,z=R.strokeWidth,L=z===void 0?2:z,G=OY(o)?o:{},q=G.clipDot,H=q===void 0?!0:q,X=U*2+L;return W.createElement(Mt,{className:A},P||E?W.createElement("defs",null,W.createElement("clipPath",{id:"clipPath-".concat(k)},W.createElement("rect",{x:P?g:g-y/2,y:E?p:p-j/2,width:P?y:y*2,height:E?j:j*2})),!H&&W.createElement("clipPath",{id:"clipPath-dots-".concat(k)},W.createElement("rect",{x:g-X/2,y:p-X/2,width:y+X,height:j+X}))):null,!N&&this.renderCurve(O,k),this.renderErrorBar(O,k),(N||o)&&this.renderDots(O,H,k),(!w||S)&&Fs.renderCallByParent(this.props,c))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:a.curPoints}:r.points!==a.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,a){for(var i=r.length%2!==0?[].concat(Nl(r),[0]):r,o=[],c=0;c<a;++c)o=[].concat(Nl(o),Nl(i));return o}},{key:"renderDotItem",value:function(r,a){var i;if(W.isValidElement(r))i=W.cloneElement(r,a);else if(wt(r))i=r(a);else{var o=a.key,c=FI(a,_ue),d=St("recharts-line-dot",typeof r!="boolean"?r.className:"");i=W.createElement(Av,sd({key:o},c,{className:d}))}return i}}])})(v.PureComponent);$a(wc,"displayName","Line");$a(wc,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!Bo.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});$a(wc,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,a=e.xAxisTicks,i=e.yAxisTicks,o=e.dataKey,c=e.bandSize,d=e.displayedData,f=e.offset,h=t.layout,p=d.map(function(g,y){var j=Ln(g,o);return h==="horizontal"?{x:GR({axis:n,ticks:a,bandSize:c,entry:g,index:y}),y:jt(j)?null:r.scale(j),value:j,payload:g}:{x:jt(j)?null:n.scale(j),y:GR({axis:r,ticks:i,bandSize:c,entry:g,index:y}),value:j,payload:g}});return Fr({points:p,layout:h},f)});function jc(e){"@babel/helpers - typeof";return jc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jc(e)}function zue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Uue(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,O4(r.key),r)}}function que(e,t,n){return t&&Uue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Wue(e,t,n){return t=mm(t),Vue(e,_4()?Reflect.construct(t,n||[],mm(e).constructor):t.apply(e,n))}function Vue(e,t){if(t&&(jc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Hue(e)}function Hue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_4=function(){return!!e})()}function mm(e){return mm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},mm(e)}function Kue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yj(e,t)}function Yj(e,t){return Yj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Yj(e,t)}function P4(e,t,n){return t=O4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O4(e){var t=Gue(e,"string");return jc(t)=="symbol"?t:t+""}function Gue(e,t){if(jc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(jc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Xj(){return Xj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xj.apply(this,arguments)}function Yue(e){var t=e.xAxisId,n=m4(),r=v4(),a=p4(t);return a==null?null:v.createElement(Lv,Xj({},a,{className:St("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return bo(o,!0)}}))}var Ro=(function(e){function t(){return zue(this,t),Wue(this,t,arguments)}return Kue(t,e),que(t,[{key:"render",value:function(){return v.createElement(Yue,this.props)}}])})(v.Component);P4(Ro,"displayName","XAxis");P4(Ro,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function Sc(e){"@babel/helpers - typeof";return Sc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sc(e)}function Xue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Que(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,T4(r.key),r)}}function Jue(e,t,n){return t&&Que(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zue(e,t,n){return t=vm(t),ede(e,k4()?Reflect.construct(t,n||[],vm(e).constructor):t.apply(e,n))}function ede(e,t){if(t&&(Sc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tde(e)}function tde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function k4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(k4=function(){return!!e})()}function vm(e){return vm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},vm(e)}function nde(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Qj(e,t)}function Qj(e,t){return Qj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},Qj(e,t)}function R4(e,t,n){return t=T4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T4(e){var t=rde(e,"string");return Sc(t)=="symbol"?t:t+""}function rde(e,t){if(Sc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Sc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Jj(){return Jj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jj.apply(this,arguments)}var ade=function(t){var n=t.yAxisId,r=m4(),a=v4(),i=h4(n);return i==null?null:v.createElement(Lv,Jj({},i,{className:St("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:a},ticksGenerator:function(c){return bo(c,!0)}}))},To=(function(e){function t(){return Xue(this,t),Zue(this,t,arguments)}return nde(t,e),Jue(t,[{key:"render",value:function(){return v.createElement(ade,this.props)}}])})(v.Component);R4(To,"displayName","YAxis");R4(To,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function UI(e){return lde(e)||ode(e)||ide(e)||sde()}function sde(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
118
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ide(e,t){if(e){if(typeof e=="string")return Zj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Zj(e,t)}}function ode(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lde(e){if(Array.isArray(e))return Zj(e)}function Zj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var eS=function(t,n,r,a,i){var o=Jr(t,WN),c=Jr(t,Mv),d=[].concat(UI(o),UI(c)),f=Jr(t,Dv),h="".concat(a,"Id"),p=a[0],g=n;if(d.length&&(g=d.reduce(function(w,x){if(x.props[h]===r&&as(x.props,"extendDomain")&&De(x.props[p])){var S=x.props[p];return[Math.min(w[0],S),Math.max(w[1],S)]}return w},g)),f.length){var y="".concat(p,"1"),j="".concat(p,"2");g=f.reduce(function(w,x){if(x.props[h]===r&&as(x.props,"extendDomain")&&De(x.props[y])&&De(x.props[j])){var S=x.props[y],N=x.props[j];return[Math.min(w[0],S,N),Math.max(w[1],S,N)]}return w},g)}return i&&i.length&&(g=i.reduce(function(w,x){return De(x)?[Math.min(w[0],x),Math.max(w[1],x)]:w},g)),g},n1={exports:{}},qI;function cde(){return qI||(qI=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function a(d,f,h){this.fn=d,this.context=f,this.once=h||!1}function i(d,f,h,p,g){if(typeof h!="function")throw new TypeError("The listener must be a function");var y=new a(h,p||d,g),j=n?n+f:f;return d._events[j]?d._events[j].fn?d._events[j]=[d._events[j],y]:d._events[j].push(y):(d._events[j]=y,d._eventsCount++),d}function o(d,f){--d._eventsCount===0?d._events=new r:delete d._events[f]}function c(){this._events=new r,this._eventsCount=0}c.prototype.eventNames=function(){var f=[],h,p;if(this._eventsCount===0)return f;for(p in h=this._events)t.call(h,p)&&f.push(n?p.slice(1):p);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(h)):f},c.prototype.listeners=function(f){var h=n?n+f:f,p=this._events[h];if(!p)return[];if(p.fn)return[p.fn];for(var g=0,y=p.length,j=new Array(y);g<y;g++)j[g]=p[g].fn;return j},c.prototype.listenerCount=function(f){var h=n?n+f:f,p=this._events[h];return p?p.fn?1:p.length:0},c.prototype.emit=function(f,h,p,g,y,j){var w=n?n+f:f;if(!this._events[w])return!1;var x=this._events[w],S=arguments.length,N,A;if(x.fn){switch(x.once&&this.removeListener(f,x.fn,void 0,!0),S){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,h),!0;case 3:return x.fn.call(x.context,h,p),!0;case 4:return x.fn.call(x.context,h,p,g),!0;case 5:return x.fn.call(x.context,h,p,g,y),!0;case 6:return x.fn.call(x.context,h,p,g,y,j),!0}for(A=1,N=new Array(S-1);A<S;A++)N[A-1]=arguments[A];x.fn.apply(x.context,N)}else{var P=x.length,E;for(A=0;A<P;A++)switch(x[A].once&&this.removeListener(f,x[A].fn,void 0,!0),S){case 1:x[A].fn.call(x[A].context);break;case 2:x[A].fn.call(x[A].context,h);break;case 3:x[A].fn.call(x[A].context,h,p);break;case 4:x[A].fn.call(x[A].context,h,p,g);break;default:if(!N)for(E=1,N=new Array(S-1);E<S;E++)N[E-1]=arguments[E];x[A].fn.apply(x[A].context,N)}}return!0},c.prototype.on=function(f,h,p){return i(this,f,h,p,!1)},c.prototype.once=function(f,h,p){return i(this,f,h,p,!0)},c.prototype.removeListener=function(f,h,p,g){var y=n?n+f:f;if(!this._events[y])return this;if(!h)return o(this,y),this;var j=this._events[y];if(j.fn)j.fn===h&&(!g||j.once)&&(!p||j.context===p)&&o(this,y);else{for(var w=0,x=[],S=j.length;w<S;w++)(j[w].fn!==h||g&&!j[w].once||p&&j[w].context!==p)&&x.push(j[w]);x.length?this._events[y]=x.length===1?x[0]:x:o(this,y)}return this},c.prototype.removeAllListeners=function(f){var h;return f?(h=n?n+f:f,this._events[h]&&o(this,h)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c})(n1)),n1.exports}var ude=cde();const dde=Yt(ude);var r1=new dde,a1="recharts.syncMouseEvents";function Kd(e){"@babel/helpers - typeof";return Kd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kd(e)}function fde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pde(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,I4(r.key),r)}}function hde(e,t,n){return t&&pde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function s1(e,t,n){return t=I4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I4(e){var t=mde(e,"string");return Kd(t)=="symbol"?t:t+""}function mde(e,t){if(Kd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Kd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var vde=(function(){function e(){fde(this,e),s1(this,"activeIndex",0),s1(this,"coordinateList",[]),s1(this,"layout","horizontal")}return hde(e,[{key:"setDetails",value:function(n){var r,a=n.coordinateList,i=a===void 0?null:a,o=n.container,c=o===void 0?null:o,d=n.layout,f=d===void 0?null:d,h=n.offset,p=h===void 0?null:h,g=n.mouseHandlerCallback,y=g===void 0?null:g;this.coordinateList=(r=i??this.coordinateList)!==null&&r!==void 0?r:[],this.container=c??this.container,this.layout=f??this.layout,this.offset=p??this.offset,this.mouseHandlerCallback=y??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var a=this.container.getBoundingClientRect(),i=a.x,o=a.y,c=a.height,d=this.coordinateList[this.activeIndex].coordinate,f=((n=window)===null||n===void 0?void 0:n.scrollX)||0,h=((r=window)===null||r===void 0?void 0:r.scrollY)||0,p=i+d+f,g=o+this.offset.top+c/2+h;this.mouseHandlerCallback({pageX:p,pageY:g})}}}])})();function gde(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e?.[0],a=e?.[1];if(r&&a&&De(r)&&De(a))return!0}return!1}function yde(e,t,n,r){var a=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-a,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function M4(e){var t=e.cx,n=e.cy,r=e.radius,a=e.startAngle,i=e.endAngle,o=sn(t,n,r,a),c=sn(t,n,r,i);return{points:[o,c],cx:t,cy:n,radius:r,startAngle:a,endAngle:i}}function xde(e,t,n){var r,a,i,o;if(e==="horizontal")r=t.x,i=r,a=n.top,o=n.top+n.height;else if(e==="vertical")a=t.y,o=a,r=n.left,i=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var c=t.cx,d=t.cy,f=t.innerRadius,h=t.outerRadius,p=t.angle,g=sn(c,d,f,p),y=sn(c,d,h,p);r=g.x,a=g.y,i=y.x,o=y.y}else return M4(t);return[{x:r,y:a},{x:i,y:o}]}function Gd(e){"@babel/helpers - typeof";return Gd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gd(e)}function WI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).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?WI(Object(n),!0).forEach(function(r){bde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bde(e,t,n){return t=wde(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wde(e){var t=jde(e,"string");return Gd(t)=="symbol"?t:t+""}function jde(e,t){if(Gd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Gd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sde(e){var t,n,r=e.element,a=e.tooltipEventType,i=e.isActive,o=e.activeCoordinate,c=e.activePayload,d=e.offset,f=e.activeTooltipIndex,h=e.tooltipAxisBandSize,p=e.layout,g=e.chartName,y=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!y||!i||!o||g!=="ScatterChart"&&a!=="axis")return null;var j,w=Kh;if(g==="ScatterChart")j=o,w=ioe;else if(g==="BarChart")j=yde(p,o,d,h),w=zN;else if(p==="radial"){var x=M4(o),S=x.cx,N=x.cy,A=x.radius,P=x.startAngle,E=x.endAngle;j={cx:S,cy:N,startAngle:P,endAngle:E,innerRadius:A,outerRadius:A},w=ML}else j={points:xde(p,o,d)},w=Kh;var O=Xp(Xp(Xp(Xp({stroke:"#ccc",pointerEvents:"none"},d),j),ht(y,!1)),{},{payload:c,payloadIndex:f,className:St("recharts-tooltip-cursor",y.className)});return v.isValidElement(y)?v.cloneElement(y,O):v.createElement(w,O)}var Nde=["item"],Cde=["children","className","width","height","style","compact","title","desc"];function Nc(e){"@babel/helpers - typeof";return Nc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nc(e)}function Il(){return Il=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Il.apply(this,arguments)}function VI(e,t){return _de(e)||Ede(e,t)||D4(e,t)||Ade()}function Ade(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
119
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ede(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,c=[],d=!0,f=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(h){f=!0,a=h}finally{try{if(!d&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(f)throw a}}return c}}function _de(e){if(Array.isArray(e))return e}function HI(e,t){if(e==null)return{};var n=Pde(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Pde(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Ode(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kde(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,L4(r.key),r)}}function Rde(e,t,n){return t&&kde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tde(e,t,n){return t=gm(t),Ide(e,$4()?Reflect.construct(t,n||[],gm(e).constructor):t.apply(e,n))}function Ide(e,t){if(t&&(Nc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Mde(e)}function Mde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($4=function(){return!!e})()}function gm(e){return gm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},gm(e)}function $de(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tS(e,t)}function tS(e,t){return tS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},tS(e,t)}function Cc(e){return Fde(e)||Lde(e)||D4(e)||Dde()}function Dde(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
120
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D4(e,t){if(e){if(typeof e=="string")return nS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nS(e,t)}}function Lde(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Fde(e){if(Array.isArray(e))return nS(e)}function nS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function KI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function we(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KI(Object(n),!0).forEach(function(r){mt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mt(e,t,n){return t=L4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function L4(e){var t=Bde(e,"string");return Nc(t)=="symbol"?t:t+""}function Bde(e,t){if(Nc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Nc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zde={xAxis:["bottom","top"],yAxis:["left","right"]},Ude={width:"100%",height:"100%"},F4={x:0,y:0};function Qp(e){return e}var qde=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Wde=function(t,n,r,a){var i=n.find(function(h){return h&&h.index===r});if(i){if(t==="horizontal")return{x:i.coordinate,y:a.y};if(t==="vertical")return{x:a.x,y:i.coordinate};if(t==="centric"){var o=i.coordinate,c=a.radius;return we(we(we({},a),sn(a.cx,a.cy,c,o)),{},{angle:o,radius:c})}var d=i.coordinate,f=a.angle;return we(we(we({},a),sn(a.cx,a.cy,d,f)),{},{angle:f,radius:d})}return F4},Fv=function(t,n){var r=n.graphicalItems,a=n.dataStartIndex,i=n.dataEndIndex,o=(r??[]).reduce(function(c,d){var f=d.props.data;return f&&f.length?[].concat(Cc(c),Cc(f)):c},[]);return o.length>0?o:t&&t.length&&De(a)&&De(i)?t.slice(a,i+1):[]};function B4(e){return e==="number"?[0,"auto"]:void 0}var rS=function(t,n,r,a){var i=t.graphicalItems,o=t.tooltipAxis,c=Fv(n,t);return r<0||!i||!i.length||r>=c.length?null:i.reduce(function(d,f){var h,p=(h=f.props.data)!==null&&h!==void 0?h:n;p&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(p=p.slice(t.dataStartIndex,t.dataEndIndex+1));var g;if(o.dataKey&&!o.allowDuplicatedCategory){var y=p===void 0?c:p;g=yh(y,o.dataKey,a)}else g=p&&p[r]||c[r];return g?[].concat(Cc(d),[PL(f,g)]):d},[])},GI=function(t,n,r,a){var i=a||{x:t.chartX,y:t.chartY},o=qde(i,r),c=t.orderedTooltipTicks,d=t.tooltipAxis,f=t.tooltipTicks,h=Ere(o,c,f,d);if(h>=0&&f){var p=f[h]&&f[h].value,g=rS(t,n,h,p),y=Wde(r,c,h,i);return{activeTooltipIndex:h,activeLabel:p,activePayload:g,activeCoordinate:y}}return null},Vde=function(t,n){var r=n.axes,a=n.graphicalItems,i=n.axisType,o=n.axisIdKey,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.layout,p=t.children,g=t.stackOffset,y=NL(h,i);return r.reduce(function(j,w){var x,S=w.type.defaultProps!==void 0?we(we({},w.type.defaultProps),w.props):w.props,N=S.type,A=S.dataKey,P=S.allowDataOverflow,E=S.allowDuplicatedCategory,O=S.scale,k=S.ticks,R=S.includeHidden,D=S[o];if(j[D])return j;var U=Fv(t.data,{graphicalItems:a.filter(function($){var ee,V=o in $.props?$.props[o]:(ee=$.type.defaultProps)===null||ee===void 0?void 0:ee[o];return V===D}),dataStartIndex:d,dataEndIndex:f}),z=U.length,L,G,q;gde(S.domain,P,N)&&(L=gj(S.domain,null,P),y&&(N==="number"||O!=="auto")&&(q=td(U,A,"category")));var H=B4(N);if(!L||L.length===0){var X,Z=(X=S.domain)!==null&&X!==void 0?X:H;if(A){if(L=td(U,A,N),N==="category"&&y){var I=bY(L);E&&I?(G=L,L=am(0,z)):E||(L=JR(Z,L,w).reduce(function($,ee){return $.indexOf(ee)>=0?$:[].concat(Cc($),[ee])},[]))}else if(N==="category")E?L=L.filter(function($){return $!==""&&!jt($)}):L=JR(Z,L,w).reduce(function($,ee){return $.indexOf(ee)>=0||ee===""||jt(ee)?$:[].concat(Cc($),[ee])},[]);else if(N==="number"){var F=Rre(U,a.filter(function($){var ee,V,J=o in $.props?$.props[o]:(ee=$.type.defaultProps)===null||ee===void 0?void 0:ee[o],ge="hide"in $.props?$.props.hide:(V=$.type.defaultProps)===null||V===void 0?void 0:V.hide;return J===D&&(R||!ge)}),A,i,h);F&&(L=F)}y&&(N==="number"||O!=="auto")&&(q=td(U,A,"category"))}else y?L=am(0,z):c&&c[D]&&c[D].hasStack&&N==="number"?L=g==="expand"?[0,1]:_L(c[D].stackGroups,d,f):L=SL(U,a.filter(function($){var ee=o in $.props?$.props[o]:$.type.defaultProps[o],V="hide"in $.props?$.props.hide:$.type.defaultProps.hide;return ee===D&&(R||!V)}),N,h,!0);if(N==="number")L=eS(p,L,D,i,k),Z&&(L=gj(Z,L,P));else if(N==="category"&&Z){var Q=Z,B=L.every(function($){return Q.indexOf($)>=0});B&&(L=Q)}}return we(we({},j),{},mt({},D,we(we({},S),{},{axisType:i,domain:L,categoricalDomain:q,duplicateDomain:G,originalDomain:(x=S.domain)!==null&&x!==void 0?x:H,isCategorical:y,layout:h})))},{})},Hde=function(t,n){var r=n.graphicalItems,a=n.Axis,i=n.axisType,o=n.axisIdKey,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.layout,p=t.children,g=Fv(t.data,{graphicalItems:r,dataStartIndex:d,dataEndIndex:f}),y=g.length,j=NL(h,i),w=-1;return r.reduce(function(x,S){var N=S.type.defaultProps!==void 0?we(we({},S.type.defaultProps),S.props):S.props,A=N[o],P=B4("number");if(!x[A]){w++;var E;return j?E=am(0,y):c&&c[A]&&c[A].hasStack?(E=_L(c[A].stackGroups,d,f),E=eS(p,E,A,i)):(E=gj(P,SL(g,r.filter(function(O){var k,R,D=o in O.props?O.props[o]:(k=O.type.defaultProps)===null||k===void 0?void 0:k[o],U="hide"in O.props?O.props.hide:(R=O.type.defaultProps)===null||R===void 0?void 0:R.hide;return D===A&&!U}),"number",h),a.defaultProps.allowDataOverflow),E=eS(p,E,A,i)),we(we({},x),{},mt({},A,we(we({axisType:i},a.defaultProps),{},{hide:!0,orientation:Qr(zde,"".concat(i,".").concat(w%2),null),domain:E,originalDomain:P,isCategorical:j,layout:h})))}return x},{})},Kde=function(t,n){var r=n.axisType,a=r===void 0?"xAxis":r,i=n.AxisComp,o=n.graphicalItems,c=n.stackGroups,d=n.dataStartIndex,f=n.dataEndIndex,h=t.children,p="".concat(a,"Id"),g=Jr(h,i),y={};return g&&g.length?y=Vde(t,{axes:g,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f}):o&&o.length&&(y=Hde(t,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f})),y},Gde=function(t){var n=El(t),r=bo(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:hN(r,function(a){return a.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Wh(n,r)}},YI=function(t){var n=t.children,r=t.defaultShowTooltip,a=zr(n,hc),i=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(o=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},Yde=function(t){return!t||!t.length?!1:t.some(function(n){var r=$s(n&&n.type);return r&&r.indexOf("Bar")>=0})},XI=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Xde=function(t,n){var r=t.props,a=t.graphicalItems,i=t.xAxisMap,o=i===void 0?{}:i,c=t.yAxisMap,d=c===void 0?{}:c,f=r.width,h=r.height,p=r.children,g=r.margin||{},y=zr(p,hc),j=zr(p,Ul),w=Object.keys(d).reduce(function(E,O){var k=d[O],R=k.orientation;return!k.mirror&&!k.hide?we(we({},E),{},mt({},R,E[R]+k.width)):E},{left:g.left||0,right:g.right||0}),x=Object.keys(o).reduce(function(E,O){var k=o[O],R=k.orientation;return!k.mirror&&!k.hide?we(we({},E),{},mt({},R,Qr(E,"".concat(R))+k.height)):E},{top:g.top||0,bottom:g.bottom||0}),S=we(we({},x),w),N=S.bottom;y&&(S.bottom+=y.props.height||hc.defaultProps.height),j&&n&&(S=Ore(S,a,r,n));var A=f-S.left-S.right,P=h-S.top-S.bottom;return we(we({brushBottom:N},S),{},{width:Math.max(A,0),height:Math.max(P,0)})},Qde=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},HN=function(t){var n=t.chartName,r=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,o=t.validateTooltipEventTypes,c=o===void 0?["axis"]:o,d=t.axisComponents,f=t.legendContent,h=t.formatAxisMap,p=t.defaultProps,g=function(S,N){var A=N.graphicalItems,P=N.stackGroups,E=N.offset,O=N.updateId,k=N.dataStartIndex,R=N.dataEndIndex,D=S.barSize,U=S.layout,z=S.barGap,L=S.barCategoryGap,G=S.maxBarSize,q=XI(U),H=q.numericAxisName,X=q.cateAxisName,Z=Yde(A),I=[];return A.forEach(function(F,Q){var B=Fv(S.data,{graphicalItems:[F],dataStartIndex:k,dataEndIndex:R}),$=F.type.defaultProps!==void 0?we(we({},F.type.defaultProps),F.props):F.props,ee=$.dataKey,V=$.maxBarSize,J=$["".concat(H,"Id")],ge=$["".concat(X,"Id")],ie={},ce=d.reduce(function($e,et){var xt=N["".concat(et.axisType,"Map")],Jt=$["".concat(et.axisType,"Id")];xt&&xt[Jt]||et.axisType==="zAxis"||ko();var ye=xt[Jt];return we(we({},$e),{},mt(mt({},et.axisType,ye),"".concat(et.axisType,"Ticks"),bo(ye)))},ie),oe=ce[X],xe=ce["".concat(X,"Ticks")],Oe=P&&P[J]&&P[J].hasStack&&zre(F,P[J].stackGroups),pe=$s(F.type).indexOf("Bar")>=0,ve=Wh(oe,xe),Ce=[],Le=Z&&_re({barSize:D,stackGroups:P,totalSize:Qde(ce,X)});if(pe){var se,de,Ne=jt(V)?G:V,Fe=(se=(de=Wh(oe,xe,!0))!==null&&de!==void 0?de:Ne)!==null&&se!==void 0?se:0;Ce=Pre({barGap:z,barCategoryGap:L,bandSize:Fe!==ve?Fe:ve,sizeList:Le[ge],maxBarSize:Ne}),Fe!==ve&&(Ce=Ce.map(function($e){return we(we({},$e),{},{position:we(we({},$e.position),{},{offset:$e.position.offset-Fe/2})})}))}var je=F&&F.type&&F.type.getComposedData;je&&I.push({props:we(we({},je(we(we({},ce),{},{displayedData:B,props:S,dataKey:ee,item:F,bandSize:ve,barPosition:Ce,offset:E,stackedData:Oe,layout:U,dataStartIndex:k,dataEndIndex:R}))),{},mt(mt(mt({key:F.key||"item-".concat(Q)},H,ce[H]),X,ce[X]),"animationId",O)),childIndex:TY(F,S.children),item:F})}),I},y=function(S,N){var A=S.props,P=S.dataStartIndex,E=S.dataEndIndex,O=S.updateId;if(!fO({props:A}))return null;var k=A.children,R=A.layout,D=A.stackOffset,U=A.data,z=A.reverseStackOrder,L=XI(R),G=L.numericAxisName,q=L.cateAxisName,H=Jr(k,r),X=Fre(U,H,"".concat(G,"Id"),"".concat(q,"Id"),D,z),Z=d.reduce(function($,ee){var V="".concat(ee.axisType,"Map");return we(we({},$),{},mt({},V,Kde(A,we(we({},ee),{},{graphicalItems:H,stackGroups:ee.axisType===G&&X,dataStartIndex:P,dataEndIndex:E}))))},{}),I=Xde(we(we({},Z),{},{props:A,graphicalItems:H}),N?.legendBBox);Object.keys(Z).forEach(function($){Z[$]=h(A,Z[$],I,$.replace("Map",""),n)});var F=Z["".concat(q,"Map")],Q=Gde(F),B=g(A,we(we({},Z),{},{dataStartIndex:P,dataEndIndex:E,updateId:O,graphicalItems:H,stackGroups:X,offset:I}));return we(we({formattedGraphicalItems:B,graphicalItems:H,offset:I,stackGroups:X},Q),Z)},j=(function(x){function S(N){var A,P,E;return Ode(this,S),E=Tde(this,S,[N]),mt(E,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),mt(E,"accessibilityManager",new vde),mt(E,"handleLegendBBoxUpdate",function(O){if(O){var k=E.state,R=k.dataStartIndex,D=k.dataEndIndex,U=k.updateId;E.setState(we({legendBBox:O},y({props:E.props,dataStartIndex:R,dataEndIndex:D,updateId:U},we(we({},E.state),{},{legendBBox:O}))))}}),mt(E,"handleReceiveSyncEvent",function(O,k,R){if(E.props.syncId===O){if(R===E.eventEmitterSymbol&&typeof E.props.syncMethod!="function")return;E.applySyncEvent(k)}}),mt(E,"handleBrushChange",function(O){var k=O.startIndex,R=O.endIndex;if(k!==E.state.dataStartIndex||R!==E.state.dataEndIndex){var D=E.state.updateId;E.setState(function(){return we({dataStartIndex:k,dataEndIndex:R},y({props:E.props,dataStartIndex:k,dataEndIndex:R,updateId:D},E.state))}),E.triggerSyncEvent({dataStartIndex:k,dataEndIndex:R})}}),mt(E,"handleMouseEnter",function(O){var k=E.getMouseInfo(O);if(k){var R=we(we({},k),{},{isTooltipActive:!0});E.setState(R),E.triggerSyncEvent(R);var D=E.props.onMouseEnter;wt(D)&&D(R,O)}}),mt(E,"triggeredAfterMouseMove",function(O){var k=E.getMouseInfo(O),R=k?we(we({},k),{},{isTooltipActive:!0}):{isTooltipActive:!1};E.setState(R),E.triggerSyncEvent(R);var D=E.props.onMouseMove;wt(D)&&D(R,O)}),mt(E,"handleItemMouseEnter",function(O){E.setState(function(){return{isTooltipActive:!0,activeItem:O,activePayload:O.tooltipPayload,activeCoordinate:O.tooltipPosition||{x:O.cx,y:O.cy}}})}),mt(E,"handleItemMouseLeave",function(){E.setState(function(){return{isTooltipActive:!1}})}),mt(E,"handleMouseMove",function(O){O.persist(),E.throttleTriggeredAfterMouseMove(O)}),mt(E,"handleMouseLeave",function(O){E.throttleTriggeredAfterMouseMove.cancel();var k={isTooltipActive:!1};E.setState(k),E.triggerSyncEvent(k);var R=E.props.onMouseLeave;wt(R)&&R(k,O)}),mt(E,"handleOuterEvent",function(O){var k=RY(O),R=Qr(E.props,"".concat(k));if(k&&wt(R)){var D,U;/.*touch.*/i.test(k)?U=E.getMouseInfo(O.changedTouches[0]):U=E.getMouseInfo(O),R((D=U)!==null&&D!==void 0?D:{},O)}}),mt(E,"handleClick",function(O){var k=E.getMouseInfo(O);if(k){var R=we(we({},k),{},{isTooltipActive:!0});E.setState(R),E.triggerSyncEvent(R);var D=E.props.onClick;wt(D)&&D(R,O)}}),mt(E,"handleMouseDown",function(O){var k=E.props.onMouseDown;if(wt(k)){var R=E.getMouseInfo(O);k(R,O)}}),mt(E,"handleMouseUp",function(O){var k=E.props.onMouseUp;if(wt(k)){var R=E.getMouseInfo(O);k(R,O)}}),mt(E,"handleTouchMove",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&E.throttleTriggeredAfterMouseMove(O.changedTouches[0])}),mt(E,"handleTouchStart",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&E.handleMouseDown(O.changedTouches[0])}),mt(E,"handleTouchEnd",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&E.handleMouseUp(O.changedTouches[0])}),mt(E,"handleDoubleClick",function(O){var k=E.props.onDoubleClick;if(wt(k)){var R=E.getMouseInfo(O);k(R,O)}}),mt(E,"handleContextMenu",function(O){var k=E.props.onContextMenu;if(wt(k)){var R=E.getMouseInfo(O);k(R,O)}}),mt(E,"triggerSyncEvent",function(O){E.props.syncId!==void 0&&r1.emit(a1,E.props.syncId,O,E.eventEmitterSymbol)}),mt(E,"applySyncEvent",function(O){var k=E.props,R=k.layout,D=k.syncMethod,U=E.state.updateId,z=O.dataStartIndex,L=O.dataEndIndex;if(O.dataStartIndex!==void 0||O.dataEndIndex!==void 0)E.setState(we({dataStartIndex:z,dataEndIndex:L},y({props:E.props,dataStartIndex:z,dataEndIndex:L,updateId:U},E.state)));else if(O.activeTooltipIndex!==void 0){var G=O.chartX,q=O.chartY,H=O.activeTooltipIndex,X=E.state,Z=X.offset,I=X.tooltipTicks;if(!Z)return;if(typeof D=="function")H=D(I,O);else if(D==="value"){H=-1;for(var F=0;F<I.length;F++)if(I[F].value===O.activeLabel){H=F;break}}var Q=we(we({},Z),{},{x:Z.left,y:Z.top}),B=Math.min(G,Q.x+Q.width),$=Math.min(q,Q.y+Q.height),ee=I[H]&&I[H].value,V=rS(E.state,E.props.data,H),J=I[H]?{x:R==="horizontal"?I[H].coordinate:B,y:R==="horizontal"?$:I[H].coordinate}:F4;E.setState(we(we({},O),{},{activeLabel:ee,activeCoordinate:J,activePayload:V,activeTooltipIndex:H}))}else E.setState(O)}),mt(E,"renderCursor",function(O){var k,R=E.state,D=R.isTooltipActive,U=R.activeCoordinate,z=R.activePayload,L=R.offset,G=R.activeTooltipIndex,q=R.tooltipAxisBandSize,H=E.getTooltipEventType(),X=(k=O.props.active)!==null&&k!==void 0?k:D,Z=E.props.layout,I=O.key||"_recharts-cursor";return W.createElement(Sde,{key:I,activeCoordinate:U,activePayload:z,activeTooltipIndex:G,chartName:n,element:O,isActive:X,layout:Z,offset:L,tooltipAxisBandSize:q,tooltipEventType:H})}),mt(E,"renderPolarAxis",function(O,k,R){var D=Qr(O,"type.axisType"),U=Qr(E.state,"".concat(D,"Map")),z=O.type.defaultProps,L=z!==void 0?we(we({},z),O.props):O.props,G=U&&U[L["".concat(D,"Id")]];return v.cloneElement(O,we(we({},G),{},{className:St(D,G.className),key:O.key||"".concat(k,"-").concat(R),ticks:bo(G,!0)}))}),mt(E,"renderPolarGrid",function(O){var k=O.props,R=k.radialLines,D=k.polarAngles,U=k.polarRadius,z=E.state,L=z.radiusAxisMap,G=z.angleAxisMap,q=El(L),H=El(G),X=H.cx,Z=H.cy,I=H.innerRadius,F=H.outerRadius;return v.cloneElement(O,{polarAngles:Array.isArray(D)?D:bo(H,!0).map(function(Q){return Q.coordinate}),polarRadius:Array.isArray(U)?U:bo(q,!0).map(function(Q){return Q.coordinate}),cx:X,cy:Z,innerRadius:I,outerRadius:F,key:O.key||"polar-grid",radialLines:R})}),mt(E,"renderLegend",function(){var O=E.state.formattedGraphicalItems,k=E.props,R=k.children,D=k.width,U=k.height,z=E.props.margin||{},L=D-(z.left||0)-(z.right||0),G=wL({children:R,formattedGraphicalItems:O,legendWidth:L,legendContent:f});if(!G)return null;var q=G.item,H=HI(G,Nde);return v.cloneElement(q,we(we({},H),{},{chartWidth:D,chartHeight:U,margin:z,onBBoxUpdate:E.handleLegendBBoxUpdate}))}),mt(E,"renderTooltip",function(){var O,k=E.props,R=k.children,D=k.accessibilityLayer,U=zr(R,Ur);if(!U)return null;var z=E.state,L=z.isTooltipActive,G=z.activeCoordinate,q=z.activePayload,H=z.activeLabel,X=z.offset,Z=(O=U.props.active)!==null&&O!==void 0?O:L;return v.cloneElement(U,{viewBox:we(we({},X),{},{x:X.left,y:X.top}),active:Z,label:H,payload:Z?q:[],coordinate:G,accessibilityLayer:D})}),mt(E,"renderBrush",function(O){var k=E.props,R=k.margin,D=k.data,U=E.state,z=U.offset,L=U.dataStartIndex,G=U.dataEndIndex,q=U.updateId;return v.cloneElement(O,{key:O.key||"_recharts-brush",onChange:Hp(E.handleBrushChange,O.props.onChange),data:D,x:De(O.props.x)?O.props.x:z.left,y:De(O.props.y)?O.props.y:z.top+z.height+z.brushBottom-(R.bottom||0),width:De(O.props.width)?O.props.width:z.width,startIndex:L,endIndex:G,updateId:"brush-".concat(q)})}),mt(E,"renderReferenceElement",function(O,k,R){if(!O)return null;var D=E,U=D.clipPathId,z=E.state,L=z.xAxisMap,G=z.yAxisMap,q=z.offset,H=O.type.defaultProps||{},X=O.props,Z=X.xAxisId,I=Z===void 0?H.xAxisId:Z,F=X.yAxisId,Q=F===void 0?H.yAxisId:F;return v.cloneElement(O,{key:O.key||"".concat(k,"-").concat(R),xAxis:L[I],yAxis:G[Q],viewBox:{x:q.left,y:q.top,width:q.width,height:q.height},clipPathId:U})}),mt(E,"renderActivePoints",function(O){var k=O.item,R=O.activePoint,D=O.basePoint,U=O.childIndex,z=O.isRange,L=[],G=k.props.key,q=k.item.type.defaultProps!==void 0?we(we({},k.item.type.defaultProps),k.item.props):k.item.props,H=q.activeDot,X=q.dataKey,Z=we(we({index:U,dataKey:X,cx:R.x,cy:R.y,r:4,fill:BN(k.item),strokeWidth:2,stroke:"#fff",payload:R.payload,value:R.value},ht(H,!1)),xh(H));return L.push(S.renderActiveDot(H,Z,"".concat(G,"-activePoint-").concat(U))),D?L.push(S.renderActiveDot(H,we(we({},Z),{},{cx:D.x,cy:D.y}),"".concat(G,"-basePoint-").concat(U))):z&&L.push(null),L}),mt(E,"renderGraphicChild",function(O,k,R){var D=E.filterFormatItem(O,k,R);if(!D)return null;var U=E.getTooltipEventType(),z=E.state,L=z.isTooltipActive,G=z.tooltipAxis,q=z.activeTooltipIndex,H=z.activeLabel,X=E.props.children,Z=zr(X,Ur),I=D.props,F=I.points,Q=I.isRange,B=I.baseLine,$=D.item.type.defaultProps!==void 0?we(we({},D.item.type.defaultProps),D.item.props):D.item.props,ee=$.activeDot,V=$.hide,J=$.activeBar,ge=$.activeShape,ie=!!(!V&&L&&Z&&(ee||J||ge)),ce={};U!=="axis"&&Z&&Z.props.trigger==="click"?ce={onClick:Hp(E.handleItemMouseEnter,O.props.onClick)}:U!=="axis"&&(ce={onMouseLeave:Hp(E.handleItemMouseLeave,O.props.onMouseLeave),onMouseEnter:Hp(E.handleItemMouseEnter,O.props.onMouseEnter)});var oe=v.cloneElement(O,we(we({},D.props),ce));function xe(et){return typeof G.dataKey=="function"?G.dataKey(et.payload):null}if(ie)if(q>=0){var Oe,pe;if(G.dataKey&&!G.allowDuplicatedCategory){var ve=typeof G.dataKey=="function"?xe:"payload.".concat(G.dataKey.toString());Oe=yh(F,ve,H),pe=Q&&B&&yh(B,ve,H)}else Oe=F?.[q],pe=Q&&B&&B[q];if(ge||J){var Ce=O.props.activeIndex!==void 0?O.props.activeIndex:q;return[v.cloneElement(O,we(we(we({},D.props),ce),{},{activeIndex:Ce})),null,null]}if(!jt(Oe))return[oe].concat(Cc(E.renderActivePoints({item:D,activePoint:Oe,basePoint:pe,childIndex:q,isRange:Q})))}else{var Le,se=(Le=E.getItemByXY(E.state.activeCoordinate))!==null&&Le!==void 0?Le:{graphicalItem:oe},de=se.graphicalItem,Ne=de.item,Fe=Ne===void 0?O:Ne,je=de.childIndex,$e=we(we(we({},D.props),ce),{},{activeIndex:je});return[v.cloneElement(Fe,$e),null,null]}return Q?[oe,null,null]:[oe,null]}),mt(E,"renderCustomized",function(O,k,R){return v.cloneElement(O,we(we({key:"recharts-customized-".concat(R)},E.props),E.state))}),mt(E,"renderMap",{CartesianGrid:{handler:Qp,once:!0},ReferenceArea:{handler:E.renderReferenceElement},ReferenceLine:{handler:Qp},ReferenceDot:{handler:E.renderReferenceElement},XAxis:{handler:Qp},YAxis:{handler:Qp},Brush:{handler:E.renderBrush,once:!0},Bar:{handler:E.renderGraphicChild},Line:{handler:E.renderGraphicChild},Area:{handler:E.renderGraphicChild},Radar:{handler:E.renderGraphicChild},RadialBar:{handler:E.renderGraphicChild},Scatter:{handler:E.renderGraphicChild},Pie:{handler:E.renderGraphicChild},Funnel:{handler:E.renderGraphicChild},Tooltip:{handler:E.renderCursor,once:!0},PolarGrid:{handler:E.renderPolarGrid,once:!0},PolarAngleAxis:{handler:E.renderPolarAxis},PolarRadiusAxis:{handler:E.renderPolarAxis},Customized:{handler:E.renderCustomized}}),E.clipPathId="".concat((A=N.id)!==null&&A!==void 0?A:Bc("recharts"),"-clip"),E.throttleTriggeredAfterMouseMove=w5(E.triggeredAfterMouseMove,(P=N.throttleDelay)!==null&&P!==void 0?P:1e3/60),E.state={},E}return $de(S,x),Rde(S,[{key:"componentDidMount",value:function(){var A,P;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(A=this.props.margin.left)!==null&&A!==void 0?A:0,top:(P=this.props.margin.top)!==null&&P!==void 0?P:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var A=this.props,P=A.children,E=A.data,O=A.height,k=A.layout,R=zr(P,Ur);if(R){var D=R.props.defaultIndex;if(!(typeof D!="number"||D<0||D>this.state.tooltipTicks.length-1)){var U=this.state.tooltipTicks[D]&&this.state.tooltipTicks[D].value,z=rS(this.state,E,D,U),L=this.state.tooltipTicks[D].coordinate,G=(this.state.offset.top+O)/2,q=k==="horizontal",H=q?{x:L,y:G}:{y:L,x:G},X=this.state.formattedGraphicalItems.find(function(I){var F=I.item;return F.type.name==="Scatter"});X&&(H=we(we({},H),X.props.points[D].tooltipPosition),z=X.props.points[D].tooltipPayload);var Z={activeTooltipIndex:D,isTooltipActive:!0,activeLabel:U,activePayload:z,activeCoordinate:H};this.setState(Z),this.renderCursor(R),this.accessibilityManager.setIndex(D)}}}},{key:"getSnapshotBeforeUpdate",value:function(A,P){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==P.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==A.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==A.margin){var E,O;this.accessibilityManager.setDetails({offset:{left:(E=this.props.margin.left)!==null&&E!==void 0?E:0,top:(O=this.props.margin.top)!==null&&O!==void 0?O:0}})}return null}},{key:"componentDidUpdate",value:function(A){L1([zr(A.children,Ur)],[zr(this.props.children,Ur)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var A=zr(this.props.children,Ur);if(A&&typeof A.props.shared=="boolean"){var P=A.props.shared?"axis":"item";return c.indexOf(P)>=0?P:i}return i}},{key:"getMouseInfo",value:function(A){if(!this.container)return null;var P=this.container,E=P.getBoundingClientRect(),O=xZ(E),k={chartX:Math.round(A.pageX-O.left),chartY:Math.round(A.pageY-O.top)},R=E.width/P.offsetWidth||1,D=this.inRange(k.chartX,k.chartY,R);if(!D)return null;var U=this.state,z=U.xAxisMap,L=U.yAxisMap,G=this.getTooltipEventType(),q=GI(this.state,this.props.data,this.props.layout,D);if(G!=="axis"&&z&&L){var H=El(z).scale,X=El(L).scale,Z=H&&H.invert?H.invert(k.chartX):null,I=X&&X.invert?X.invert(k.chartY):null;return we(we({},k),{},{xValue:Z,yValue:I},q)}return q?we(we({},k),q):null}},{key:"inRange",value:function(A,P){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,O=this.props.layout,k=A/E,R=P/E;if(O==="horizontal"||O==="vertical"){var D=this.state.offset,U=k>=D.left&&k<=D.left+D.width&&R>=D.top&&R<=D.top+D.height;return U?{x:k,y:R}:null}var z=this.state,L=z.angleAxisMap,G=z.radiusAxisMap;if(L&&G){var q=El(L);return tT({x:k,y:R},q)}return null}},{key:"parseEventsOfWrapper",value:function(){var A=this.props.children,P=this.getTooltipEventType(),E=zr(A,Ur),O={};E&&P==="axis"&&(E.props.trigger==="click"?O={onClick:this.handleClick}:O={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var k=xh(this.props,this.handleOuterEvent);return we(we({},k),O)}},{key:"addListener",value:function(){r1.on(a1,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){r1.removeListener(a1,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(A,P,E){for(var O=this.state.formattedGraphicalItems,k=0,R=O.length;k<R;k++){var D=O[k];if(D.item===A||D.props.key===A.key||P===$s(D.item.type)&&E===D.childIndex)return D}return null}},{key:"renderClipPath",value:function(){var A=this.clipPathId,P=this.state.offset,E=P.left,O=P.top,k=P.height,R=P.width;return W.createElement("defs",null,W.createElement("clipPath",{id:A},W.createElement("rect",{x:E,y:O,height:k,width:R})))}},{key:"getXScales",value:function(){var A=this.state.xAxisMap;return A?Object.entries(A).reduce(function(P,E){var O=VI(E,2),k=O[0],R=O[1];return we(we({},P),{},mt({},k,R.scale))},{}):null}},{key:"getYScales",value:function(){var A=this.state.yAxisMap;return A?Object.entries(A).reduce(function(P,E){var O=VI(E,2),k=O[0],R=O[1];return we(we({},P),{},mt({},k,R.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(A){var P;return(P=this.state.xAxisMap)===null||P===void 0||(P=P[A])===null||P===void 0?void 0:P.scale}},{key:"getYScaleByAxisId",value:function(A){var P;return(P=this.state.yAxisMap)===null||P===void 0||(P=P[A])===null||P===void 0?void 0:P.scale}},{key:"getItemByXY",value:function(A){var P=this.state,E=P.formattedGraphicalItems,O=P.activeItem;if(E&&E.length)for(var k=0,R=E.length;k<R;k++){var D=E[k],U=D.props,z=D.item,L=z.type.defaultProps!==void 0?we(we({},z.type.defaultProps),z.props):z.props,G=$s(z.type);if(G==="Bar"){var q=(U.data||[]).find(function(I){return Bie(A,I)});if(q)return{graphicalItem:D,payload:q}}else if(G==="RadialBar"){var H=(U.data||[]).find(function(I){return tT(A,I)});if(H)return{graphicalItem:D,payload:H}}else if(kv(D,O)||Rv(D,O)||Ud(D,O)){var X=cle({graphicalItem:D,activeTooltipItem:O,itemData:L.data}),Z=L.activeIndex===void 0?X:L.activeIndex;return{graphicalItem:we(we({},D),{},{childIndex:Z}),payload:Ud(D,O)?L.data[X]:D.props.data[X]}}}return null}},{key:"render",value:function(){var A=this;if(!fO(this))return null;var P=this.props,E=P.children,O=P.className,k=P.width,R=P.height,D=P.style,U=P.compact,z=P.title,L=P.desc,G=HI(P,Cde),q=ht(G,!1);if(U)return W.createElement(_I,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},W.createElement(B1,Il({},q,{width:k,height:R,title:z,desc:L}),this.renderClipPath(),hO(E,this.renderMap)));if(this.props.accessibilityLayer){var H,X;q.tabIndex=(H=this.props.tabIndex)!==null&&H!==void 0?H:0,q.role=(X=this.props.role)!==null&&X!==void 0?X:"application",q.onKeyDown=function(I){A.accessibilityManager.keyboardEvent(I)},q.onFocus=function(){A.accessibilityManager.focus()}}var Z=this.parseEventsOfWrapper();return W.createElement(_I,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},W.createElement("div",Il({className:St("recharts-wrapper",O),style:we({position:"relative",cursor:"default",width:k,height:R},D)},Z,{ref:function(F){A.container=F}}),W.createElement(B1,Il({},q,{width:k,height:R,title:z,desc:L,style:Ude}),this.renderClipPath(),hO(E,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(v.Component);mt(j,"displayName",n),mt(j,"defaultProps",we({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},p)),mt(j,"getDerivedStateFromProps",function(x,S){var N=x.dataKey,A=x.data,P=x.children,E=x.width,O=x.height,k=x.layout,R=x.stackOffset,D=x.margin,U=S.dataStartIndex,z=S.dataEndIndex;if(S.updateId===void 0){var L=YI(x);return we(we(we({},L),{},{updateId:0},y(we(we({props:x},L),{},{updateId:0}),S)),{},{prevDataKey:N,prevData:A,prevWidth:E,prevHeight:O,prevLayout:k,prevStackOffset:R,prevMargin:D,prevChildren:P})}if(N!==S.prevDataKey||A!==S.prevData||E!==S.prevWidth||O!==S.prevHeight||k!==S.prevLayout||R!==S.prevStackOffset||!zl(D,S.prevMargin)){var G=YI(x),q={chartX:S.chartX,chartY:S.chartY,isTooltipActive:S.isTooltipActive},H=we(we({},GI(S,A,k)),{},{updateId:S.updateId+1}),X=we(we(we({},G),q),H);return we(we(we({},X),y(we({props:x},X),S)),{},{prevDataKey:N,prevData:A,prevWidth:E,prevHeight:O,prevLayout:k,prevStackOffset:R,prevMargin:D,prevChildren:P})}if(!L1(P,S.prevChildren)){var Z,I,F,Q,B=zr(P,hc),$=B&&(Z=(I=B.props)===null||I===void 0?void 0:I.startIndex)!==null&&Z!==void 0?Z:U,ee=B&&(F=(Q=B.props)===null||Q===void 0?void 0:Q.endIndex)!==null&&F!==void 0?F:z,V=$!==U||ee!==z,J=!jt(A),ge=J&&!V?S.updateId:S.updateId+1;return we(we({updateId:ge},y(we(we({props:x},S),{},{updateId:ge,dataStartIndex:$,dataEndIndex:ee}),S)),{},{prevChildren:P,dataStartIndex:$,dataEndIndex:ee})}return null}),mt(j,"renderActiveDot",function(x,S,N){var A;return v.isValidElement(x)?A=v.cloneElement(x,S):wt(x)?A=x(S):A=W.createElement(Av,S),W.createElement(Mt,{className:"recharts-active-dot",key:N},A)});var w=v.forwardRef(function(S,N){return W.createElement(j,Il({},S,{ref:N}))});return w.displayName=j.displayName,w},QI=HN({chartName:"LineChart",GraphicalChild:wc,axisComponents:[{axisType:"xAxis",AxisComp:Ro},{axisType:"yAxis",AxisComp:To}],formatAxisMap:a4}),Jde=HN({chartName:"BarChart",GraphicalChild:Wo,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Ro},{axisType:"yAxis",AxisComp:To}],formatAxisMap:a4}),Zde=HN({chartName:"PieChart",GraphicalChild:Qs,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Ov},{axisType:"radiusAxis",AxisComp:_v}],formatAxisMap:Qre,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const efe=()=>{const{configs:e}=cf(),{source:t}=An(),[n,r]=v.useState([]),[a,i]=v.useState("timestamp"),[o,c]=v.useState("desc"),d=x=>{if(a===x){c(S=>S==="asc"?"desc":"asc");return}i(x),c("desc")};v.useEffect(()=>{let x=!0;return t.listResults().then(S=>{x&&r(S)}),()=>{x=!1}},[t]);const f=e.length,h=n.length,p=h===0?0:n.reduce((x,S)=>x+S.overallPassRate,0)/h,g=h===0?0:Math.round(n.reduce((x,S)=>x+S.avgLatency,0)/h),y=v.useMemo(()=>[...n].sort((S,N)=>{let A=0;return a==="timestamp"&&(A=new Date(S.timestamp).getTime()-new Date(N.timestamp).getTime()),a==="passRate"&&(A=S.overallPassRate-N.overallPassRate),a==="latency"&&(A=S.avgLatency-N.avgLatency),a==="scenarios"&&(A=S.totalScenarios-N.totalScenarios),o==="asc"?A:-A}),[n,a,o]),j=[...y].reverse().map(x=>({date:new Date(x.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"}),passRate:Math.round(x.overallPassRate*100),latency:x.avgLatency})),w=x=>{const S=Array.from(new Set(x.scenarios.map(E=>E.scenarioId).filter(Boolean))),N=Array.from(new Set(x.scenarios.map(E=>E.agentName).filter(Boolean))),A=S.slice(0,2).join(", "),P=S.length>2?` +${S.length-2}`:"";return{scenarioCount:S.length,agentCount:N.length,scenarioPreview:A?`${A}${P}`:"n/a"}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(i$,{className:"h-6 w-6"}),"Dashboard"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Overview of your MCP evaluation runs"})]}),s.jsxs("div",{className:"flex gap-3",children:[s.jsx(ae,{asChild:!0,children:s.jsxs(yt,{to:"/mcp-evaluations/new",children:[s.jsx(ES,{className:"mr-2 h-4 w-4"}),"New MCP Evaluation"]})}),s.jsx(ae,{variant:"outline",asChild:!0,children:s.jsxs(yt,{to:"/run",children:[s.jsx(Dl,{className:"mr-2 h-4 w-4"}),"Run Evaluation"]})}),s.jsx(ae,{variant:"outline",asChild:!0,children:s.jsxs(yt,{to:"/results",children:[s.jsx(od,{className:"mr-2 h-4 w-4"}),"Browse Results"]})})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(ks,{title:"MCP Evaluations",value:f,icon:g1,subtitle:`${f} active`}),s.jsx(ks,{title:"Total Runs",value:h,icon:t$,subtitle:"Last 30 days"}),s.jsx(ks,{title:"Pass Rate",value:`${Math.round(p*100)}%`,icon:od,subtitle:"+5% from last week",trend:"up"}),s.jsx(ks,{title:"Avg Latency",value:`${g}ms`,icon:d$,subtitle:"-120ms from last week",trend:"up"})]}),s.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(Et,{className:"text-base",children:"Pass Rate Trend"})}),s.jsx(Ue,{children:s.jsx(ej,{width:"100%",height:200,children:s.jsxs(QI,{data:j,children:[s.jsx(Ro,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(To,{domain:[0,100],tick:{fontSize:11},tickLine:!1,axisLine:!1,tickFormatter:x=>`${x}%`}),s.jsx(Ur,{formatter:x=>[`${x}%`,"Pass Rate"]}),s.jsx(wc,{type:"monotone",dataKey:"passRate",stroke:"hsl(38, 92%, 50%)",strokeWidth:2,dot:{r:3,fill:"hsl(38, 92%, 50%)"}})]})})})]}),s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(Et,{className:"text-base",children:"Recent Tool Latency (ms)"})}),s.jsx(Ue,{children:s.jsx(ej,{width:"100%",height:200,children:s.jsxs(QI,{data:j,children:[s.jsx(Ro,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(To,{tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Ur,{formatter:x=>[`${x}ms`,"Latency"]}),s.jsx(wc,{type:"monotone",dataKey:"latency",stroke:"hsl(200, 80%, 50%)",strokeWidth:2,dot:{r:3,fill:"hsl(200, 80%, 50%)"}})]})})})]})]}),s.jsx("div",{className:"grid gap-6",children:s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(Et,{className:"text-base",children:"Recent Runs"})}),s.jsx(Ue,{className:"p-0",children:s.jsxs(Hr,{children:[s.jsx(Kr,{children:s.jsxs(zt,{children:[s.jsx(nt,{children:"Run ID"}),s.jsx(nt,{children:"Evaluated"}),s.jsx(nt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>d("timestamp"),children:["Timestamp",a==="timestamp"?o==="asc"?s.jsx(La,{className:"h-3.5 w-3.5"}):s.jsx(It,{className:"h-3.5 w-3.5"}):s.jsx(Ml,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),s.jsx(nt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>d("passRate"),children:["Pass Rate",a==="passRate"?o==="asc"?s.jsx(La,{className:"h-3.5 w-3.5"}):s.jsx(It,{className:"h-3.5 w-3.5"}):s.jsx(Ml,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),s.jsx(nt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>d("scenarios"),children:["Scenarios",a==="scenarios"?o==="asc"?s.jsx(La,{className:"h-3.5 w-3.5"}):s.jsx(It,{className:"h-3.5 w-3.5"}):s.jsx(Ml,{className:"h-3.5 w-3.5 text-muted-foreground"})]})})]})}),s.jsx(Gr,{children:y.map(x=>s.jsxs(zt,{className:"cursor-pointer",children:[s.jsx(He,{children:s.jsx(yt,{to:`/results/${x.id}`,className:"font-mono text-xs text-primary hover:underline",children:x.id})}),s.jsx(He,{className:"text-[11px] text-muted-foreground",children:(()=>{const S=w(x);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",S.scenarioCount," scenario",S.scenarioCount===1?"":"s"," · ",S.agentCount," agent",S.agentCount===1?"":"s"]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:S.scenarioPreview})]})})()}),s.jsx(He,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Pm,{className:"h-3 w-3"}),new Date(x.timestamp).toLocaleString()]})}),s.jsx(He,{children:s.jsx(wo,{rate:x.overallPassRate})}),s.jsx(He,{className:"text-right font-mono text-sm",children:x.totalScenarios})]},x.id))})]})})]})})]})};var tfe=v.createContext(void 0);function Vc(e){const t=v.useContext(tfe);return e||t||"ltr"}var i1="rovingFocusGroup.onEntryFocus",nfe={bubbles:!1,cancelable:!0},xf="RovingFocusGroup",[aS,z4,rfe]=Jd(xf),[afe,Bv]=er(xf,[rfe]),[sfe,ife]=afe(xf),U4=v.forwardRef((e,t)=>s.jsx(aS.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(aS.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(ofe,{...e,ref:t})})}));U4.displayName=xf;var ofe=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:h=!1,...p}=e,g=v.useRef(null),y=ft(t,g),j=Vc(i),[w,x]=Zr({prop:o,defaultProp:c??null,onChange:d,caller:xf}),[S,N]=v.useState(!1),A=Cn(f),P=z4(n),E=v.useRef(!1),[O,k]=v.useState(0);return v.useEffect(()=>{const R=g.current;if(R)return R.addEventListener(i1,A),()=>R.removeEventListener(i1,A)},[A]),s.jsx(sfe,{scope:n,orientation:r,dir:j,loop:a,currentTabStopId:w,onItemFocus:v.useCallback(R=>x(R),[x]),onItemShiftTab:v.useCallback(()=>N(!0),[]),onFocusableItemAdd:v.useCallback(()=>k(R=>R+1),[]),onFocusableItemRemove:v.useCallback(()=>k(R=>R-1),[]),children:s.jsx(qe.div,{tabIndex:S||O===0?-1:0,"data-orientation":r,...p,ref:y,style:{outline:"none",...e.style},onMouseDown:Pe(e.onMouseDown,()=>{E.current=!0}),onFocus:Pe(e.onFocus,R=>{const D=!E.current;if(R.target===R.currentTarget&&D&&!S){const U=new CustomEvent(i1,nfe);if(R.currentTarget.dispatchEvent(U),!U.defaultPrevented){const z=P().filter(X=>X.focusable),L=z.find(X=>X.active),G=z.find(X=>X.id===w),H=[L,G,...z].filter(Boolean).map(X=>X.ref.current);V4(H,h)}}E.current=!1}),onBlur:Pe(e.onBlur,()=>N(!1))})})}),q4="RovingFocusGroupItem",W4=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,children:o,...c}=e,d=Bn(),f=i||d,h=ife(q4,n),p=h.currentTabStopId===f,g=z4(n),{onFocusableItemAdd:y,onFocusableItemRemove:j,currentTabStopId:w}=h;return v.useEffect(()=>{if(r)return y(),()=>j()},[r,y,j]),s.jsx(aS.ItemSlot,{scope:n,id:f,focusable:r,active:a,children:s.jsx(qe.span,{tabIndex:p?0:-1,"data-orientation":h.orientation,...c,ref:t,onMouseDown:Pe(e.onMouseDown,x=>{r?h.onItemFocus(f):x.preventDefault()}),onFocus:Pe(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:Pe(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){h.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const S=ufe(x,h.orientation,h.dir);if(S!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let A=g().filter(P=>P.focusable).map(P=>P.ref.current);if(S==="last")A.reverse();else if(S==="prev"||S==="next"){S==="prev"&&A.reverse();const P=A.indexOf(x.currentTarget);A=h.loop?dfe(A,P+1):A.slice(P+1)}setTimeout(()=>V4(A))}}),children:typeof o=="function"?o({isCurrentTabStop:p,hasTabStop:w!=null}):o})})});W4.displayName=q4;var lfe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function cfe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ufe(e,t,n){const r=cfe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return lfe[r]}function V4(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function dfe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var H4=U4,K4=W4;function ffe(e){const t=pfe(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(mfe);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function pfe(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=gfe(a),c=vfe(i,a.props);return a.type!==v.Fragment&&(c.ref=r?vr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hfe=Symbol("radix.slottable");function mfe(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hfe}function vfe(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function gfe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var sS=["Enter"," "],yfe=["ArrowDown","PageUp","Home"],G4=["ArrowUp","PageDown","End"],xfe=[...yfe,...G4],bfe={ltr:[...sS,"ArrowRight"],rtl:[...sS,"ArrowLeft"]},wfe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},bf="Menu",[Yd,jfe,Sfe]=Jd(bf),[Vo,Y4]=er(bf,[Sfe,Li,Bv]),zv=Li(),X4=Bv(),[Nfe,Ho]=Vo(bf),[Cfe,wf]=Vo(bf),Q4=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:i,modal:o=!0}=e,c=zv(t),[d,f]=v.useState(null),h=v.useRef(!1),p=Cn(i),g=Vc(a);return v.useEffect(()=>{const y=()=>{h.current=!0,document.addEventListener("pointerdown",j,{capture:!0,once:!0}),document.addEventListener("pointermove",j,{capture:!0,once:!0})},j=()=>h.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),s.jsx(Dm,{...c,children:s.jsx(Nfe,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:s.jsx(Cfe,{scope:t,onClose:v.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:h,dir:g,modal:o,children:r})})})};Q4.displayName=bf;var Afe="MenuAnchor",KN=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=zv(n);return s.jsx(tf,{...a,...r,ref:t})});KN.displayName=Afe;var GN="MenuPortal",[Efe,J4]=Vo(GN,{forceMount:void 0}),Z4=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,i=Ho(GN,t);return s.jsx(Efe,{scope:t,forceMount:n,children:s.jsx(Un,{present:n||i.open,children:s.jsx(Pc,{asChild:!0,container:a,children:r})})})};Z4.displayName=GN;var va="MenuContent",[_fe,YN]=Vo(va),eF=v.forwardRef((e,t)=>{const n=J4(va,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=Ho(va,e.__scopeMenu),o=wf(va,e.__scopeMenu);return s.jsx(Yd.Provider,{scope:e.__scopeMenu,children:s.jsx(Un,{present:r||i.open,children:s.jsx(Yd.Slot,{scope:e.__scopeMenu,children:o.modal?s.jsx(Pfe,{...a,ref:t}):s.jsx(Ofe,{...a,ref:t})})})})}),Pfe=v.forwardRef((e,t)=>{const n=Ho(va,e.__scopeMenu),r=v.useRef(null),a=ft(t,r);return v.useEffect(()=>{const i=r.current;if(i)return Qm(i)},[]),s.jsx(XN,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Pe(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Ofe=v.forwardRef((e,t)=>{const n=Ho(va,e.__scopeMenu);return s.jsx(XN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),kfe=ffe("MenuContent.ScrollLock"),XN=v.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:g,onDismiss:y,disableOutsideScroll:j,...w}=e,x=Ho(va,n),S=wf(va,n),N=zv(n),A=X4(n),P=jfe(n),[E,O]=v.useState(null),k=v.useRef(null),R=ft(t,k,x.onContentChange),D=v.useRef(0),U=v.useRef(""),z=v.useRef(0),L=v.useRef(null),G=v.useRef("right"),q=v.useRef(0),H=j?af:v.Fragment,X=j?{as:kfe,allowPinchZoom:!0}:void 0,Z=F=>{const Q=U.current+F,B=P().filter(ie=>!ie.disabled),$=document.activeElement,ee=B.find(ie=>ie.ref.current===$)?.textValue,V=B.map(ie=>ie.textValue),J=qfe(V,Q,ee),ge=B.find(ie=>ie.textValue===J)?.ref.current;(function ie(ce){U.current=ce,window.clearTimeout(D.current),ce!==""&&(D.current=window.setTimeout(()=>ie(""),1e3))})(Q),ge&&setTimeout(()=>ge.focus())};v.useEffect(()=>()=>window.clearTimeout(D.current),[]),Ym();const I=v.useCallback(F=>G.current===L.current?.side&&Vfe(F,L.current?.area),[]);return s.jsx(_fe,{scope:n,searchRef:U,onItemEnter:v.useCallback(F=>{I(F)&&F.preventDefault()},[I]),onItemLeave:v.useCallback(F=>{I(F)||(k.current?.focus(),O(null))},[I]),onTriggerLeave:v.useCallback(F=>{I(F)&&F.preventDefault()},[I]),pointerGraceTimerRef:z,onPointerGraceIntentChange:v.useCallback(F=>{L.current=F},[]),children:s.jsx(H,{...X,children:s.jsx(rf,{asChild:!0,trapped:a,onMountAutoFocus:Pe(i,F=>{F.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:s.jsx(Do,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:g,onDismiss:y,children:s.jsx(H4,{asChild:!0,...A,dir:S.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:O,onEntryFocus:Pe(d,F=>{S.isUsingKeyboardRef.current||F.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Lm,{role:"menu","aria-orientation":"vertical","data-state":vF(x.open),"data-radix-menu-content":"",dir:S.dir,...N,...w,ref:R,style:{outline:"none",...w.style},onKeyDown:Pe(w.onKeyDown,F=>{const B=F.target.closest("[data-radix-menu-content]")===F.currentTarget,$=F.ctrlKey||F.altKey||F.metaKey,ee=F.key.length===1;B&&(F.key==="Tab"&&F.preventDefault(),!$&&ee&&Z(F.key));const V=k.current;if(F.target!==V||!xfe.includes(F.key))return;F.preventDefault();const ge=P().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);G4.includes(F.key)&&ge.reverse(),zfe(ge)}),onBlur:Pe(e.onBlur,F=>{F.currentTarget.contains(F.target)||(window.clearTimeout(D.current),U.current="")}),onPointerMove:Pe(e.onPointerMove,Xd(F=>{const Q=F.target,B=q.current!==F.clientX;if(F.currentTarget.contains(Q)&&B){const $=F.clientX>q.current?"right":"left";G.current=$,q.current=F.clientX}}))})})})})})})});eF.displayName=va;var Rfe="MenuGroup",QN=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(qe.div,{role:"group",...r,ref:t})});QN.displayName=Rfe;var Tfe="MenuLabel",tF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(qe.div,{...r,ref:t})});tF.displayName=Tfe;var ym="MenuItem",JI="menu.itemSelect",Uv=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,i=v.useRef(null),o=wf(ym,e.__scopeMenu),c=YN(ym,e.__scopeMenu),d=ft(t,i),f=v.useRef(!1),h=()=>{const p=i.current;if(!n&&p){const g=new CustomEvent(JI,{bubbles:!0,cancelable:!0});p.addEventListener(JI,y=>r?.(y),{once:!0}),wS(p,g),g.defaultPrevented?f.current=!1:o.onClose()}};return s.jsx(nF,{...a,ref:d,disabled:n,onClick:Pe(e.onClick,h),onPointerDown:p=>{e.onPointerDown?.(p),f.current=!0},onPointerUp:Pe(e.onPointerUp,p=>{f.current||p.currentTarget?.click()}),onKeyDown:Pe(e.onKeyDown,p=>{const g=c.searchRef.current!=="";n||g&&p.key===" "||sS.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});Uv.displayName=ym;var nF=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...i}=e,o=YN(ym,n),c=X4(n),d=v.useRef(null),f=ft(t,d),[h,p]=v.useState(!1),[g,y]=v.useState("");return v.useEffect(()=>{const j=d.current;j&&y((j.textContent??"").trim())},[i.children]),s.jsx(Yd.ItemSlot,{scope:n,disabled:r,textValue:a??g,children:s.jsx(K4,{asChild:!0,...c,focusable:!r,children:s.jsx(qe.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:f,onPointerMove:Pe(e.onPointerMove,Xd(j=>{r?o.onItemLeave(j):(o.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Pe(e.onPointerLeave,Xd(j=>o.onItemLeave(j))),onFocus:Pe(e.onFocus,()=>p(!0)),onBlur:Pe(e.onBlur,()=>p(!1))})})})}),Ife="MenuCheckboxItem",rF=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return s.jsx(lF,{scope:e.__scopeMenu,checked:n,children:s.jsx(Uv,{role:"menuitemcheckbox","aria-checked":xm(n)?"mixed":n,...a,ref:t,"data-state":ZN(n),onSelect:Pe(a.onSelect,()=>r?.(xm(n)?!0:!n),{checkForDefaultPrevented:!1})})})});rF.displayName=Ife;var aF="MenuRadioGroup",[Mfe,$fe]=Vo(aF,{value:void 0,onValueChange:()=>{}}),sF=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,i=Cn(r);return s.jsx(Mfe,{scope:e.__scopeMenu,value:n,onValueChange:i,children:s.jsx(QN,{...a,ref:t})})});sF.displayName=aF;var iF="MenuRadioItem",oF=v.forwardRef((e,t)=>{const{value:n,...r}=e,a=$fe(iF,e.__scopeMenu),i=n===a.value;return s.jsx(lF,{scope:e.__scopeMenu,checked:i,children:s.jsx(Uv,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":ZN(i),onSelect:Pe(r.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});oF.displayName=iF;var JN="MenuItemIndicator",[lF,Dfe]=Vo(JN,{checked:!1}),cF=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,i=Dfe(JN,n);return s.jsx(Un,{present:r||xm(i.checked)||i.checked===!0,children:s.jsx(qe.span,{...a,ref:t,"data-state":ZN(i.checked)})})});cF.displayName=JN;var Lfe="MenuSeparator",uF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(qe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});uF.displayName=Lfe;var Ffe="MenuArrow",dF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=zv(n);return s.jsx(Fm,{...a,...r,ref:t})});dF.displayName=Ffe;var Bfe="MenuSub",[Pge,fF]=Vo(Bfe),Yu="MenuSubTrigger",pF=v.forwardRef((e,t)=>{const n=Ho(Yu,e.__scopeMenu),r=wf(Yu,e.__scopeMenu),a=fF(Yu,e.__scopeMenu),i=YN(Yu,e.__scopeMenu),o=v.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=i,f={__scopeMenu:e.__scopeMenu},h=v.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return v.useEffect(()=>h,[h]),v.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),d(null)}},[c,d]),s.jsx(KN,{asChild:!0,...f,children:s.jsx(nF,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":vF(n.open),...e,ref:vr(t,a.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Pe(e.onPointerMove,Xd(p=>{i.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:Pe(e.onPointerLeave,Xd(p=>{h();const g=n.content?.getBoundingClientRect();if(g){const y=n.content?.dataset.side,j=y==="right",w=j?-5:5,x=g[j?"left":"right"],S=g[j?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+w,y:p.clientY},{x,y:g.top},{x:S,y:g.top},{x:S,y:g.bottom},{x,y:g.bottom}],side:y}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(p),p.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Pe(e.onKeyDown,p=>{const g=i.searchRef.current!=="";e.disabled||g&&p.key===" "||bfe[r.dir].includes(p.key)&&(n.onOpenChange(!0),n.content?.focus(),p.preventDefault())})})})});pF.displayName=Yu;var hF="MenuSubContent",mF=v.forwardRef((e,t)=>{const n=J4(va,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=Ho(va,e.__scopeMenu),o=wf(va,e.__scopeMenu),c=fF(hF,e.__scopeMenu),d=v.useRef(null),f=ft(t,d);return s.jsx(Yd.Provider,{scope:e.__scopeMenu,children:s.jsx(Un,{present:r||i.open,children:s.jsx(Yd.Slot,{scope:e.__scopeMenu,children:s.jsx(XN,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:f,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{o.isUsingKeyboardRef.current&&d.current?.focus(),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:Pe(e.onFocusOutside,h=>{h.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Pe(e.onEscapeKeyDown,h=>{o.onClose(),h.preventDefault()}),onKeyDown:Pe(e.onKeyDown,h=>{const p=h.currentTarget.contains(h.target),g=wfe[o.dir].includes(h.key);p&&g&&(i.onOpenChange(!1),c.trigger?.focus(),h.preventDefault())})})})})})});mF.displayName=hF;function vF(e){return e?"open":"closed"}function xm(e){return e==="indeterminate"}function ZN(e){return xm(e)?"indeterminate":e?"checked":"unchecked"}function zfe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Ufe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function qfe(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=Ufe(e,Math.max(i,0));a.length===1&&(o=o.filter(f=>f!==n));const d=o.find(f=>f.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function Wfe(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const c=t[i],d=t[o],f=c.x,h=c.y,p=d.x,g=d.y;h>r!=g>r&&n<(p-f)*(r-h)/(g-h)+f&&(a=!a)}return a}function Vfe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Wfe(n,t)}function Xd(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Hfe=Q4,Kfe=KN,Gfe=Z4,Yfe=eF,Xfe=QN,Qfe=tF,Jfe=Uv,Zfe=rF,epe=sF,tpe=oF,npe=cF,rpe=uF,ape=dF,spe=pF,ipe=mF,qv="DropdownMenu",[ope]=er(qv,[Y4]),gr=Y4(),[lpe,gF]=ope(qv),yF=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:i,onOpenChange:o,modal:c=!0}=e,d=gr(t),f=v.useRef(null),[h,p]=Zr({prop:a,defaultProp:i??!1,onChange:o,caller:qv});return s.jsx(lpe,{scope:t,triggerId:Bn(),triggerRef:f,contentId:Bn(),open:h,onOpenChange:p,onOpenToggle:v.useCallback(()=>p(g=>!g),[p]),modal:c,children:s.jsx(Hfe,{...d,open:h,onOpenChange:p,dir:r,modal:c,children:n})})};yF.displayName=qv;var xF="DropdownMenuTrigger",bF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...a}=e,i=gF(xF,n),o=gr(n);return s.jsx(Kfe,{asChild:!0,...o,children:s.jsx(qe.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...a,ref:vr(t,i.triggerRef),onPointerDown:Pe(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(i.onOpenToggle(),i.open||c.preventDefault())}),onKeyDown:Pe(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&i.onOpenToggle(),c.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});bF.displayName=xF;var cpe="DropdownMenuPortal",wF=e=>{const{__scopeDropdownMenu:t,...n}=e,r=gr(t);return s.jsx(Gfe,{...r,...n})};wF.displayName=cpe;var jF="DropdownMenuContent",SF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=gF(jF,n),i=gr(n),o=v.useRef(!1);return s.jsx(Yfe,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...r,ref:t,onCloseAutoFocus:Pe(e.onCloseAutoFocus,c=>{o.current||a.triggerRef.current?.focus(),o.current=!1,c.preventDefault()}),onInteractOutside:Pe(e.onInteractOutside,c=>{const d=c.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,h=d.button===2||f;(!a.modal||h)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});SF.displayName=jF;var upe="DropdownMenuGroup",dpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=gr(n);return s.jsx(Xfe,{...a,...r,ref:t})});dpe.displayName=upe;var fpe="DropdownMenuLabel",NF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=gr(n);return s.jsx(Qfe,{...a,...r,ref:t})});NF.displayName=fpe;var ppe="DropdownMenuItem",CF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=gr(n);return s.jsx(Jfe,{...a,...r,ref:t})});CF.displayName=ppe;var hpe="DropdownMenuCheckboxItem",AF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=gr(n);return s.jsx(Zfe,{...a,...r,ref:t})});AF.displayName=hpe;var mpe="DropdownMenuRadioGroup",vpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=gr(n);return s.jsx(epe,{...a,...r,ref:t})});vpe.displayName=mpe;var gpe="DropdownMenuRadioItem",EF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=gr(n);return s.jsx(tpe,{...a,...r,ref:t})});EF.displayName=gpe;var ype="DropdownMenuItemIndicator",_F=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=gr(n);return s.jsx(npe,{...a,...r,ref:t})});_F.displayName=ype;var xpe="DropdownMenuSeparator",PF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=gr(n);return s.jsx(rpe,{...a,...r,ref:t})});PF.displayName=xpe;var bpe="DropdownMenuArrow",wpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=gr(n);return s.jsx(ape,{...a,...r,ref:t})});wpe.displayName=bpe;var jpe="DropdownMenuSubTrigger",OF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=gr(n);return s.jsx(spe,{...a,...r,ref:t})});OF.displayName=jpe;var Spe="DropdownMenuSubContent",kF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=gr(n);return s.jsx(ipe,{...a,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});kF.displayName=Spe;var Npe=yF,Cpe=bF,Ape=wF,RF=SF,TF=NF,IF=CF,MF=AF,$F=EF,DF=_F,LF=PF,FF=OF,BF=kF;const Hc=Npe,Kc=Cpe,Epe=v.forwardRef(({className:e,inset:t,children:n,...r},a)=>s.jsxs(FF,{ref:a,className:Se("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",t&&"pl-8",e),...r,children:[n,s.jsx(n$,{className:"ml-auto h-4 w-4"})]}));Epe.displayName=FF.displayName;const _pe=v.forwardRef(({className:e,...t},n)=>s.jsx(BF,{ref:n,className:Se("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));_pe.displayName=BF.displayName;const Ko=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(Ape,{children:s.jsx(RF,{ref:r,sideOffset:t,className:Se("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Ko.displayName=RF.displayName;const mr=v.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(IF,{ref:r,className:Se("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t&&"pl-8",e),...n}));mr.displayName=IF.displayName;const Ppe=v.forwardRef(({className:e,children:t,checked:n,...r},a)=>s.jsxs(MF,{ref:a,className:Se("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:n,...r,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(DF,{children:s.jsx(Xl,{className:"h-4 w-4"})})}),t]}));Ppe.displayName=MF.displayName;const Ope=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs($F,{ref:r,className:Se("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(DF,{children:s.jsx(PU,{className:"h-2 w-2 fill-current"})})}),t]}));Ope.displayName=$F.displayName;const eC=v.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(TF,{ref:r,className:Se("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));eC.displayName=TF.displayName;const tC=v.forwardRef(({className:e,...t},n)=>s.jsx(LF,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",e),...t}));tC.displayName=LF.displayName;const Uu=e=>e.configName?.trim()||e.name,kpe=()=>{const{configs:e,deleteConfig:t,cloneConfig:n,loading:r,reload:a}=cf(),i=qa(),[o,c]=v.useState("name"),[d,f]=v.useState("asc"),h=S=>{if(o===S){f(N=>N==="asc"?"desc":"asc");return}c(S),f(S==="updatedAt"?"desc":"asc")};v.useEffect(()=>{a();const S=()=>{a()};return window.addEventListener("focus",S),()=>{window.removeEventListener("focus",S)}},[a]);const p=async(S,N)=>{await t(S),Re({title:"Deleted",description:`"${N}" has been removed.`})},g=async S=>{const N=await n(S);Re({title:"Cloned",description:`Created "${Uu(N)}".`}),i(`/mcp-evaluations/${N.id}`)},y=S=>S.agentEntries?.length??S.agents?.length??0,j=S=>S.scenarioEntries?.length??S.scenarios?.length??0,w=v.useMemo(()=>[...e].sort((N,A)=>{let P=0;return o==="name"&&(P=Uu(N).localeCompare(Uu(A))),o==="scenarios"&&(P=j(N)-j(A)),o==="agents"&&(P=y(N)-y(A)),o==="updatedAt"&&(P=new Date(N.updatedAt).getTime()-new Date(A.updatedAt).getTime()),d==="asc"?P:-P}),[e,o,d]),x=S=>o!==S?s.jsx(Ml,{className:"h-3.5 w-3.5 text-muted-foreground"}):d==="asc"?s.jsx(La,{className:"h-3.5 w-3.5"}):s.jsx(It,{className:"h-3.5 w-3.5"});return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(s$,{className:"h-6 w-6"}),"MCP Evaluations"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage your MCP evaluation suites"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(ae,{variant:"outline",size:"sm",onClick:()=>{a()},children:[s.jsx(Ba,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(ae,{variant:"outline",size:"sm",children:[s.jsx($U,{className:"mr-2 h-4 w-4"}),"Import YAML"]}),s.jsx(ae,{size:"sm",asChild:!0,children:s.jsxs(yt,{to:"/mcp-evaluations/new",children:[s.jsx(Fa,{className:"mr-2 h-4 w-4"}),"Create New"]})})]})]}),s.jsx(ze,{children:s.jsx(Ue,{className:"p-0",children:s.jsxs(Hr,{children:[s.jsx(Kr,{children:s.jsxs(zt,{children:[s.jsx(nt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>h("name"),children:["Name",x("name")]})}),s.jsx(nt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>h("scenarios"),children:["Scenarios",x("scenarios")]})}),s.jsx(nt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>h("agents"),children:["Agents",x("agents")]})}),s.jsx(nt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>h("updatedAt"),children:["Last Updated",x("updatedAt")]})}),s.jsx(nt,{className:"w-10"})]})}),s.jsxs(Gr,{children:[w.map(S=>s.jsxs(zt,{children:[s.jsx(He,{children:s.jsxs("div",{children:[s.jsx(yt,{to:`/mcp-evaluations/${S.id}`,className:"font-medium text-sm hover:text-primary",children:Uu(S)}),S.loadError&&s.jsxs(Ke,{variant:"destructive",className:"ml-2 align-middle text-[10px]",children:[s.jsx(nh,{className:"mr-1 h-3 w-3"}),"Broken"]}),S.description&&s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:S.description}),S.loadError&&s.jsx("p",{className:"text-xs text-destructive mt-0.5 break-all",children:S.loadError})]})}),s.jsx(He,{className:"text-right font-mono text-sm",children:j(S)}),s.jsx(He,{className:"text-right font-mono text-sm",children:y(S)}),s.jsx(He,{className:"text-right text-xs text-muted-foreground",children:new Date(S.updatedAt).toLocaleDateString()}),s.jsx(He,{children:s.jsxs(Hc,{children:[s.jsx(Kc,{asChild:!0,children:s.jsx(ae,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Om,{className:"h-4 w-4"})})}),s.jsxs(Ko,{align:"end",children:[s.jsxs(mr,{onClick:()=>i(`/mcp-evaluations/${S.id}`),children:[s.jsx(km,{className:"mr-2 h-3.5 w-3.5"}),"Edit"]}),s.jsxs(mr,{onClick:()=>{g(S.id)},children:[s.jsx(Ti,{className:"mr-2 h-3.5 w-3.5"}),"Clone"]}),s.jsxs(mr,{children:[s.jsx(ma,{className:"mr-2 h-3.5 w-3.5"}),"Download YAML"]}),s.jsxs(mr,{className:"text-destructive",onClick:()=>{p(S.id,Uu(S))},children:[s.jsx(Yr,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})})]},S.id)),!r&&e.length===0&&s.jsx(zt,{children:s.jsx(He,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"No MCP evaluations yet. Create your first one to get started."})}),r&&s.jsx(zt,{children:s.jsx(He,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"Loading MCP evaluations..."})})]})]})})})]})};var Rpe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Tpe=Rpe.reduce((e,t)=>{const n=Gm(`Primitive.${t}`),r=v.forwardRef((a,i)=>{const{asChild:o,...c}=a,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Ipe="Label",zF=v.forwardRef((e,t)=>s.jsx(Tpe.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));zF.displayName=Ipe;var UF=zF;const Mpe=Lo("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Te=v.forwardRef(({className:e,...t},n)=>s.jsx(UF,{ref:n,className:Se(Mpe(),e),...t}));Te.displayName=UF.displayName;const Vs=v.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:Se("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Vs.displayName="Textarea";function Wv(e){const t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Vv="Switch",[$pe]=er(Vv),[Dpe,Lpe]=$pe(Vv),qF=v.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:a,defaultChecked:i,required:o,disabled:c,value:d="on",onCheckedChange:f,form:h,...p}=e,[g,y]=v.useState(null),j=ft(t,A=>y(A)),w=v.useRef(!1),x=g?h||!!g.closest("form"):!0,[S,N]=Zr({prop:a,defaultProp:i??!1,onChange:f,caller:Vv});return s.jsxs(Dpe,{scope:n,checked:S,disabled:c,children:[s.jsx(qe.button,{type:"button",role:"switch","aria-checked":S,"aria-required":o,"data-state":KF(S),"data-disabled":c?"":void 0,disabled:c,value:d,...p,ref:j,onClick:Pe(e.onClick,A=>{N(P=>!P),x&&(w.current=A.isPropagationStopped(),w.current||A.stopPropagation())})}),x&&s.jsx(HF,{control:g,bubbles:!w.current,name:r,value:d,checked:S,required:o,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})});qF.displayName=Vv;var WF="SwitchThumb",VF=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=Lpe(WF,n);return s.jsx(qe.span,{"data-state":KF(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});VF.displayName=WF;var Fpe="SwitchBubbleInput",HF=v.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},i)=>{const o=v.useRef(null),c=ft(o,i),d=Wv(n),f=$m(t);return v.useEffect(()=>{const h=o.current;if(!h)return;const p=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==n&&y){const j=new Event("click",{bubbles:r});y.call(h,n),h.dispatchEvent(j)}},[d,n,r]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:c,style:{...a.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});HF.displayName=Fpe;function KF(e){return e?"checked":"unchecked"}var GF=qF,Bpe=VF;const bm=v.forwardRef(({className:e,...t},n)=>s.jsx(GF,{className:Se("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",e),...t,ref:n,children:s.jsx(Bpe,{className:Se("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));bm.displayName=GF.displayName;var Hv="Tabs",[zpe]=er(Hv,[Bv]),YF=Bv(),[Upe,nC]=zpe(Hv),XF=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:c,activationMode:d="automatic",...f}=e,h=Vc(c),[p,g]=Zr({prop:r,onChange:a,defaultProp:i??"",caller:Hv});return s.jsx(Upe,{scope:n,baseId:Bn(),value:p,onValueChange:g,orientation:o,dir:h,activationMode:d,children:s.jsx(qe.div,{dir:h,"data-orientation":o,...f,ref:t})})});XF.displayName=Hv;var QF="TabsList",JF=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=nC(QF,n),o=YF(n);return s.jsx(H4,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:s.jsx(qe.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});JF.displayName=QF;var ZF="TabsTrigger",eB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,o=nC(ZF,n),c=YF(n),d=rB(o.baseId,r),f=aB(o.baseId,r),h=r===o.value;return s.jsx(K4,{asChild:!0,...c,focusable:!a,active:h,children:s.jsx(qe.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":f,"data-state":h?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:d,...i,ref:t,onMouseDown:Pe(e.onMouseDown,p=>{!a&&p.button===0&&p.ctrlKey===!1?o.onValueChange(r):p.preventDefault()}),onKeyDown:Pe(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&o.onValueChange(r)}),onFocus:Pe(e.onFocus,()=>{const p=o.activationMode!=="manual";!h&&!a&&p&&o.onValueChange(r)})})})});eB.displayName=ZF;var tB="TabsContent",nB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...o}=e,c=nC(tB,n),d=rB(c.baseId,r),f=aB(c.baseId,r),h=r===c.value,p=v.useRef(h);return v.useEffect(()=>{const g=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(g)},[]),s.jsx(Un,{present:a||h,children:({present:g})=>s.jsx(qe.div,{"data-state":h?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!g,id:f,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:g&&i})})});nB.displayName=tB;function rB(e,t){return`${e}-trigger-${t}`}function aB(e,t){return`${e}-content-${t}`}var qpe=XF,sB=JF,iB=eB,oB=nB;const rC=qpe,Kv=v.forwardRef(({className:e,...t},n)=>s.jsx(sB,{ref:n,className:Se("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Kv.displayName=sB.displayName;const ki=v.forwardRef(({className:e,...t},n)=>s.jsx(iB,{ref:n,className:Se("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));ki.displayName=iB.displayName;const Vl=v.forwardRef(({className:e,...t},n)=>s.jsx(oB,{ref:n,className:Se("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Vl.displayName=oB.displayName;const ZI={openai:"bg-emerald-100 text-emerald-800",anthropic:"bg-orange-100 text-orange-800",azure:"bg-blue-100 text-blue-800",google:"bg-yellow-100 text-yellow-800",custom:"bg-gray-100 text-gray-800"};function lB({provider:e}){return s.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${ZI[e]??ZI.custom}`,children:e})}function Qd(e,[t,n]){return Math.min(n,Math.max(t,e))}function Wpe(e){const t=Vpe(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(Kpe);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function Vpe(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=Ype(a),c=Gpe(i,a.props);return a.type!==v.Fragment&&(c.ref=r?vr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Hpe=Symbol("radix.slottable");function Kpe(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Hpe}function Gpe(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function Ype(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Xpe=[" ","Enter","ArrowUp","ArrowDown"],Qpe=[" ","Enter"],Io="Select",[Gv,Yv,Jpe]=Jd(Io),[Gc]=er(Io,[Jpe,Li]),Xv=Li(),[Zpe,Vi]=Gc(Io),[ehe,the]=Gc(Io),cB=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:i,value:o,defaultValue:c,onValueChange:d,dir:f,name:h,autoComplete:p,disabled:g,required:y,form:j}=e,w=Xv(t),[x,S]=v.useState(null),[N,A]=v.useState(null),[P,E]=v.useState(!1),O=Vc(f),[k,R]=Zr({prop:r,defaultProp:a??!1,onChange:i,caller:Io}),[D,U]=Zr({prop:o,defaultProp:c,onChange:d,caller:Io}),z=v.useRef(null),L=x?j||!!x.closest("form"):!0,[G,q]=v.useState(new Set),H=Array.from(G).map(X=>X.props.value).join(";");return s.jsx(Dm,{...w,children:s.jsxs(Zpe,{required:y,scope:t,trigger:x,onTriggerChange:S,valueNode:N,onValueNodeChange:A,valueNodeHasChildren:P,onValueNodeHasChildrenChange:E,contentId:Bn(),value:D,onValueChange:U,open:k,onOpenChange:R,dir:O,triggerPointerDownPosRef:z,disabled:g,children:[s.jsx(Gv.Provider,{scope:t,children:s.jsx(ehe,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(X=>{q(Z=>new Set(Z).add(X))},[]),onNativeOptionRemove:v.useCallback(X=>{q(Z=>{const I=new Set(Z);return I.delete(X),I})},[]),children:n})}),L?s.jsxs(TB,{"aria-hidden":!0,required:y,tabIndex:-1,name:h,autoComplete:p,value:D,onChange:X=>U(X.target.value),disabled:g,form:j,children:[D===void 0?s.jsx("option",{value:""}):null,Array.from(G)]},H):null]})})};cB.displayName=Io;var uB="SelectTrigger",dB=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=Xv(n),o=Vi(uB,n),c=o.disabled||r,d=ft(t,o.onTriggerChange),f=Yv(n),h=v.useRef("touch"),[p,g,y]=MB(w=>{const x=f().filter(A=>!A.disabled),S=x.find(A=>A.value===o.value),N=$B(x,w,S);N!==void 0&&o.onValueChange(N.value)}),j=w=>{c||(o.onOpenChange(!0),y()),w&&(o.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return s.jsx(tf,{asChild:!0,...i,children:s.jsx(qe.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":IB(o.value)?"":void 0,...a,ref:d,onClick:Pe(a.onClick,w=>{w.currentTarget.focus(),h.current!=="mouse"&&j(w)}),onPointerDown:Pe(a.onPointerDown,w=>{h.current=w.pointerType;const x=w.target;x.hasPointerCapture(w.pointerId)&&x.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(j(w),w.preventDefault())}),onKeyDown:Pe(a.onKeyDown,w=>{const x=p.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&g(w.key),!(x&&w.key===" ")&&Xpe.includes(w.key)&&(j(),w.preventDefault())})})})});dB.displayName=uB;var fB="SelectValue",pB=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:o="",...c}=e,d=Vi(fB,n),{onValueNodeHasChildrenChange:f}=d,h=i!==void 0,p=ft(t,d.onValueNodeChange);return zn(()=>{f(h)},[f,h]),s.jsx(qe.span,{...c,ref:p,style:{pointerEvents:"none"},children:IB(d.value)?s.jsx(s.Fragment,{children:o}):i})});pB.displayName=fB;var nhe="SelectIcon",hB=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return s.jsx(qe.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});hB.displayName=nhe;var rhe="SelectPortal",mB=e=>s.jsx(Pc,{asChild:!0,...e});mB.displayName=rhe;var Mo="SelectContent",vB=v.forwardRef((e,t)=>{const n=Vi(Mo,e.__scopeSelect),[r,a]=v.useState();if(zn(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?_c.createPortal(s.jsx(gB,{scope:e.__scopeSelect,children:s.jsx(Gv.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),i):null}return s.jsx(yB,{...e,ref:t})});vB.displayName=Mo;var Ta=10,[gB,Hi]=Gc(Mo),ahe="SelectContentImpl",she=Wpe("SelectContent.RemoveScroll"),yB=v.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:o,side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:g,collisionPadding:y,sticky:j,hideWhenDetached:w,avoidCollisions:x,...S}=e,N=Vi(Mo,n),[A,P]=v.useState(null),[E,O]=v.useState(null),k=ft(t,ie=>P(ie)),[R,D]=v.useState(null),[U,z]=v.useState(null),L=Yv(n),[G,q]=v.useState(!1),H=v.useRef(!1);v.useEffect(()=>{if(A)return Qm(A)},[A]),Ym();const X=v.useCallback(ie=>{const[ce,...oe]=L().map(pe=>pe.ref.current),[xe]=oe.slice(-1),Oe=document.activeElement;for(const pe of ie)if(pe===Oe||(pe?.scrollIntoView({block:"nearest"}),pe===ce&&E&&(E.scrollTop=0),pe===xe&&E&&(E.scrollTop=E.scrollHeight),pe?.focus(),document.activeElement!==Oe))return},[L,E]),Z=v.useCallback(()=>X([R,A]),[X,R,A]);v.useEffect(()=>{G&&Z()},[G,Z]);const{onOpenChange:I,triggerPointerDownPosRef:F}=N;v.useEffect(()=>{if(A){let ie={x:0,y:0};const ce=xe=>{ie={x:Math.abs(Math.round(xe.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(xe.pageY)-(F.current?.y??0))}},oe=xe=>{ie.x<=10&&ie.y<=10?xe.preventDefault():A.contains(xe.target)||I(!1),document.removeEventListener("pointermove",ce),F.current=null};return F.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",oe,{capture:!0})}}},[A,I,F]),v.useEffect(()=>{const ie=()=>I(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[I]);const[Q,B]=MB(ie=>{const ce=L().filter(Oe=>!Oe.disabled),oe=ce.find(Oe=>Oe.ref.current===document.activeElement),xe=$B(ce,ie,oe);xe&&setTimeout(()=>xe.ref.current.focus())}),$=v.useCallback((ie,ce,oe)=>{const xe=!H.current&&!oe;(N.value!==void 0&&N.value===ce||xe)&&(D(ie),xe&&(H.current=!0))},[N.value]),ee=v.useCallback(()=>A?.focus(),[A]),V=v.useCallback((ie,ce,oe)=>{const xe=!H.current&&!oe;(N.value!==void 0&&N.value===ce||xe)&&z(ie)},[N.value]),J=r==="popper"?iS:xB,ge=J===iS?{side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:g,collisionPadding:y,sticky:j,hideWhenDetached:w,avoidCollisions:x}:{};return s.jsx(gB,{scope:n,content:A,viewport:E,onViewportChange:O,itemRefCallback:$,selectedItem:R,onItemLeave:ee,itemTextRefCallback:V,focusSelectedItem:Z,selectedItemText:U,position:r,isPositioned:G,searchRef:Q,children:s.jsx(af,{as:she,allowPinchZoom:!0,children:s.jsx(rf,{asChild:!0,trapped:N.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:Pe(a,ie=>{N.trigger?.focus({preventScroll:!0}),ie.preventDefault()}),children:s.jsx(Do,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:s.jsx(J,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:ie=>ie.preventDefault(),...S,...ge,onPlaced:()=>q(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:Pe(S.onKeyDown,ie=>{const ce=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!ce&&ie.key.length===1&&B(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let xe=L().filter(Oe=>!Oe.disabled).map(Oe=>Oe.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(xe=xe.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const Oe=ie.target,pe=xe.indexOf(Oe);xe=xe.slice(pe+1)}setTimeout(()=>X(xe)),ie.preventDefault()}})})})})})})});yB.displayName=ahe;var ihe="SelectItemAlignedPosition",xB=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=Vi(Mo,n),o=Hi(Mo,n),[c,d]=v.useState(null),[f,h]=v.useState(null),p=ft(t,k=>h(k)),g=Yv(n),y=v.useRef(!1),j=v.useRef(!0),{viewport:w,selectedItem:x,selectedItemText:S,focusSelectedItem:N}=o,A=v.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&f&&w&&x&&S){const k=i.trigger.getBoundingClientRect(),R=f.getBoundingClientRect(),D=i.valueNode.getBoundingClientRect(),U=S.getBoundingClientRect();if(i.dir!=="rtl"){const Oe=U.left-R.left,pe=D.left-Oe,ve=k.left-pe,Ce=k.width+ve,Le=Math.max(Ce,R.width),se=window.innerWidth-Ta,de=Qd(pe,[Ta,Math.max(Ta,se-Le)]);c.style.minWidth=Ce+"px",c.style.left=de+"px"}else{const Oe=R.right-U.right,pe=window.innerWidth-D.right-Oe,ve=window.innerWidth-k.right-pe,Ce=k.width+ve,Le=Math.max(Ce,R.width),se=window.innerWidth-Ta,de=Qd(pe,[Ta,Math.max(Ta,se-Le)]);c.style.minWidth=Ce+"px",c.style.right=de+"px"}const z=g(),L=window.innerHeight-Ta*2,G=w.scrollHeight,q=window.getComputedStyle(f),H=parseInt(q.borderTopWidth,10),X=parseInt(q.paddingTop,10),Z=parseInt(q.borderBottomWidth,10),I=parseInt(q.paddingBottom,10),F=H+X+G+I+Z,Q=Math.min(x.offsetHeight*5,F),B=window.getComputedStyle(w),$=parseInt(B.paddingTop,10),ee=parseInt(B.paddingBottom,10),V=k.top+k.height/2-Ta,J=L-V,ge=x.offsetHeight/2,ie=x.offsetTop+ge,ce=H+X+ie,oe=F-ce;if(ce<=V){const Oe=z.length>0&&x===z[z.length-1].ref.current;c.style.bottom="0px";const pe=f.clientHeight-w.offsetTop-w.offsetHeight,ve=Math.max(J,ge+(Oe?ee:0)+pe+Z),Ce=ce+ve;c.style.height=Ce+"px"}else{const Oe=z.length>0&&x===z[0].ref.current;c.style.top="0px";const ve=Math.max(V,H+w.offsetTop+(Oe?$:0)+ge)+oe;c.style.height=ve+"px",w.scrollTop=ce-V+w.offsetTop}c.style.margin=`${Ta}px 0`,c.style.minHeight=Q+"px",c.style.maxHeight=L+"px",r?.(),requestAnimationFrame(()=>y.current=!0)}},[g,i.trigger,i.valueNode,c,f,w,x,S,i.dir,r]);zn(()=>A(),[A]);const[P,E]=v.useState();zn(()=>{f&&E(window.getComputedStyle(f).zIndex)},[f]);const O=v.useCallback(k=>{k&&j.current===!0&&(A(),N?.(),j.current=!1)},[A,N]);return s.jsx(lhe,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:y,onScrollButtonChange:O,children:s.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:s.jsx(qe.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});xB.displayName=ihe;var ohe="SelectPopperPosition",iS=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=Ta,...i}=e,o=Xv(n);return s.jsx(Lm,{...o,...i,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});iS.displayName=ohe;var[lhe,aC]=Gc(Mo,{}),oS="SelectViewport",bB=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=Hi(oS,n),o=aC(oS,n),c=ft(t,i.onViewportChange),d=v.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),s.jsx(Gv.Slot,{scope:n,children:s.jsx(qe.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Pe(a.onScroll,f=>{const h=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:g}=o;if(g?.current&&p){const y=Math.abs(d.current-h.scrollTop);if(y>0){const j=window.innerHeight-Ta*2,w=parseFloat(p.style.minHeight),x=parseFloat(p.style.height),S=Math.max(w,x);if(S<j){const N=S+y,A=Math.min(j,N),P=N-A;p.style.height=A+"px",p.style.bottom==="0px"&&(h.scrollTop=P>0?P:0,p.style.justifyContent="flex-end")}}}d.current=h.scrollTop})})})]})});bB.displayName=oS;var wB="SelectGroup",[che,uhe]=Gc(wB),dhe=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Bn();return s.jsx(che,{scope:n,id:a,children:s.jsx(qe.div,{role:"group","aria-labelledby":a,...r,ref:t})})});dhe.displayName=wB;var jB="SelectLabel",SB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=uhe(jB,n);return s.jsx(qe.div,{id:a.id,...r,ref:t})});SB.displayName=jB;var wm="SelectItem",[fhe,NB]=Gc(wm),CB=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...o}=e,c=Vi(wm,n),d=Hi(wm,n),f=c.value===r,[h,p]=v.useState(i??""),[g,y]=v.useState(!1),j=ft(t,N=>d.itemRefCallback?.(N,r,a)),w=Bn(),x=v.useRef("touch"),S=()=>{a||(c.onValueChange(r),c.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return s.jsx(fhe,{scope:n,value:r,disabled:a,textId:w,isSelected:f,onItemTextChange:v.useCallback(N=>{p(A=>A||(N?.textContent??"").trim())},[]),children:s.jsx(Gv.ItemSlot,{scope:n,value:r,disabled:a,textValue:h,children:s.jsx(qe.div,{role:"option","aria-labelledby":w,"data-highlighted":g?"":void 0,"aria-selected":f&&g,"data-state":f?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...o,ref:j,onFocus:Pe(o.onFocus,()=>y(!0)),onBlur:Pe(o.onBlur,()=>y(!1)),onClick:Pe(o.onClick,()=>{x.current!=="mouse"&&S()}),onPointerUp:Pe(o.onPointerUp,()=>{x.current==="mouse"&&S()}),onPointerDown:Pe(o.onPointerDown,N=>{x.current=N.pointerType}),onPointerMove:Pe(o.onPointerMove,N=>{x.current=N.pointerType,a?d.onItemLeave?.():x.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Pe(o.onPointerLeave,N=>{N.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Pe(o.onKeyDown,N=>{d.searchRef?.current!==""&&N.key===" "||(Qpe.includes(N.key)&&S(),N.key===" "&&N.preventDefault())})})})})});CB.displayName=wm;var Xu="SelectItemText",AB=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,o=Vi(Xu,n),c=Hi(Xu,n),d=NB(Xu,n),f=the(Xu,n),[h,p]=v.useState(null),g=ft(t,S=>p(S),d.onItemTextChange,S=>c.itemTextRefCallback?.(S,d.value,d.disabled)),y=h?.textContent,j=v.useMemo(()=>s.jsx("option",{value:d.value,disabled:d.disabled,children:y},d.value),[d.disabled,d.value,y]),{onNativeOptionAdd:w,onNativeOptionRemove:x}=f;return zn(()=>(w(j),()=>x(j)),[w,x,j]),s.jsxs(s.Fragment,{children:[s.jsx(qe.span,{id:d.textId,...i,ref:g}),d.isSelected&&o.valueNode&&!o.valueNodeHasChildren?_c.createPortal(i.children,o.valueNode):null]})});AB.displayName=Xu;var EB="SelectItemIndicator",_B=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return NB(EB,n).isSelected?s.jsx(qe.span,{"aria-hidden":!0,...r,ref:t}):null});_B.displayName=EB;var lS="SelectScrollUpButton",PB=v.forwardRef((e,t)=>{const n=Hi(lS,e.__scopeSelect),r=aC(lS,e.__scopeSelect),[a,i]=v.useState(!1),o=ft(t,r.onScrollButtonChange);return zn(()=>{if(n.viewport&&n.isPositioned){let c=function(){const f=d.scrollTop>0;i(f)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),a?s.jsx(kB,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});PB.displayName=lS;var cS="SelectScrollDownButton",OB=v.forwardRef((e,t)=>{const n=Hi(cS,e.__scopeSelect),r=aC(cS,e.__scopeSelect),[a,i]=v.useState(!1),o=ft(t,r.onScrollButtonChange);return zn(()=>{if(n.viewport&&n.isPositioned){let c=function(){const f=d.scrollHeight-d.clientHeight,h=Math.ceil(d.scrollTop)<f;i(h)};const d=n.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),a?s.jsx(kB,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});OB.displayName=cS;var kB=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=Hi("SelectScrollButton",n),o=v.useRef(null),c=Yv(n),d=v.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return v.useEffect(()=>()=>d(),[d]),zn(()=>{c().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),s.jsx(qe.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Pe(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Pe(a.onPointerMove,()=>{i.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Pe(a.onPointerLeave,()=>{d()})})}),phe="SelectSeparator",RB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(qe.div,{"aria-hidden":!0,...r,ref:t})});RB.displayName=phe;var uS="SelectArrow",hhe=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Xv(n),i=Vi(uS,n),o=Hi(uS,n);return i.open&&o.position==="popper"?s.jsx(Fm,{...a,...r,ref:t}):null});hhe.displayName=uS;var mhe="SelectBubbleInput",TB=v.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=v.useRef(null),i=ft(r,a),o=Wv(t);return v.useEffect(()=>{const c=a.current;if(!c)return;const d=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(d,"value").set;if(o!==t&&h){const p=new Event("change",{bubbles:!0});h.call(c,t),c.dispatchEvent(p)}},[o,t]),s.jsx(qe.select,{...n,style:{...TM,...n.style},ref:i,defaultValue:t})});TB.displayName=mhe;function IB(e){return e===""||e===void 0}function MB(e){const t=Cn(e),n=v.useRef(""),r=v.useRef(0),a=v.useCallback(o=>{const c=n.current+o;t(c),(function d(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(c)},[t]),i=v.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}function $B(e,t,n){const a=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=vhe(e,Math.max(i,0));a.length===1&&(o=o.filter(f=>f!==n));const d=o.find(f=>f.textValue.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function vhe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ghe=cB,DB=dB,yhe=pB,xhe=hB,bhe=mB,LB=vB,whe=bB,FB=SB,BB=CB,jhe=AB,She=_B,zB=PB,UB=OB,qB=RB;const Kt=ghe,Gt=yhe,Ut=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(DB,{ref:r,className:Se("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,s.jsx(xhe,{asChild:!0,children:s.jsx(It,{className:"h-4 w-4 opacity-50"})})]}));Ut.displayName=DB.displayName;const WB=v.forwardRef(({className:e,...t},n)=>s.jsx(zB,{ref:n,className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(La,{className:"h-4 w-4"})}));WB.displayName=zB.displayName;const VB=v.forwardRef(({className:e,...t},n)=>s.jsx(UB,{ref:n,className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(It,{className:"h-4 w-4"})}));VB.displayName=UB.displayName;const qt=v.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>s.jsx(bhe,{children:s.jsxs(LB,{ref:a,className:Se("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[s.jsx(WB,{}),s.jsx(whe,{className:Se("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(VB,{})]})}));qt.displayName=LB.displayName;const Nhe=v.forwardRef(({className:e,...t},n)=>s.jsx(FB,{ref:n,className:Se("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Nhe.displayName=FB.displayName;const Je=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(BB,{ref:r,className:Se("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(She,{children:s.jsx(Xl,{className:"h-4 w-4"})})}),s.jsx(jhe,{children:t})]}));Je.displayName=BB.displayName;const Che=v.forwardRef(({className:e,...t},n)=>s.jsx(qB,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",e),...t}));Che.displayName=qB.displayName;const Ahe=()=>({id:`srv-${Date.now()}`,name:"",transport:"stdio",authType:"none",oauthRedirectUrl:"http://localhost:6274/oauth/"});function Ehe({servers:e,onChange:t,readOnly:n,allowAdd:r=!n,allowStructureEdits:a=!n,showHeader:i=!0}){const o=(h,p)=>{const g=e.map((y,j)=>j===h?{...y,...p}:y);t(g)},c=(h,p)=>{const g=e[h];g&&o(h,{authType:p,...p!=="oauth2"?{oauthClientId:void 0,oauthClientSecret:void 0,oauthRedirectUrl:void 0,oauthScope:void 0}:{oauthRedirectUrl:g.oauthRedirectUrl||"http://localhost:6274/oauth/"}})},d=h=>t(e.filter((p,g)=>g!==h)),f=()=>t([...e,Ahe()]);return s.jsxs("div",{className:"space-y-4",children:[i&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Servers"}),!n&&r&&s.jsxs(ae,{type:"button",variant:"outline",size:"sm",onClick:f,children:[s.jsx(Fa,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Server"]})]}),e.map((h,p)=>s.jsxs(ze,{className:"border-dashed",children:[s.jsxs(At,{className:"pb-3 flex-row items-center justify-between space-y-0",children:[s.jsx(Et,{className:"text-sm font-medium",children:h.name||`Server ${p+1}`}),!n&&a&&s.jsx(ae,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>d(p),children:s.jsx(Yr,{className:"h-3.5 w-3.5 text-destructive"})})]}),s.jsxs(Ue,{className:"space-y-3",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Name"}),s.jsx(it,{value:h.name,onChange:g=>o(p,{name:g.target.value}),disabled:n,placeholder:"e.g. Filesystem MCP"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Transport"}),s.jsxs(Kt,{value:h.transport,onValueChange:g=>o(p,{transport:g}),disabled:n,children:[s.jsx(Ut,{children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"stdio",children:"stdio"}),s.jsx(Je,{value:"sse",children:"SSE"}),s.jsx(Je,{value:"streamable-http",children:"Streamable HTTP"})]})]})]})]}),h.transport==="stdio"?s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Command"}),s.jsx(it,{value:h.command||"",onChange:g=>o(p,{command:g.target.value}),disabled:n,placeholder:"npx",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Args (comma-separated)"}),s.jsx(it,{value:(h.args||[]).join(", "),onChange:g=>o(p,{args:g.target.value.split(",").map(y=>y.trim()).filter(Boolean)}),disabled:n,placeholder:"-y, @mcp/server",className:"font-mono text-xs"})]})]}):s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"URL"}),s.jsx(it,{value:h.url||"",onChange:g=>o(p,{url:g.target.value}),disabled:n,placeholder:"http://localhost:3001/sse",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Auth Type"}),s.jsxs(Kt,{value:h.authType||"none",onValueChange:g=>c(p,g),disabled:n,children:[s.jsx(Ut,{children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"none",children:"None"}),s.jsx(Je,{value:"bearer",children:"Bearer Token"}),s.jsx(Je,{value:"api-key",children:"API Key"}),s.jsx(Je,{value:"oauth2",children:"OAuth 2.0"})]})]})]}),h.authType&&h.authType!=="none"&&h.authType!=="oauth2"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:h.authType==="bearer"?"Token":"API Key"}),s.jsx(it,{type:"password",value:h.authValue||"",onChange:g=>o(p,{authValue:g.target.value}),disabled:n,placeholder:"••••••••",className:"font-mono text-xs"})]})]}),h.authType==="oauth2"&&s.jsxs("div",{className:"space-y-3 rounded-md border p-3",children:[s.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"OAuth 2.0 Flow"}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Client ID"}),s.jsx(it,{value:h.oauthClientId||"",onChange:g=>o(p,{oauthClientId:g.target.value}),disabled:n,placeholder:"your-client-id",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Client Secret (optional)"}),s.jsx(it,{type:"password",value:h.oauthClientSecret||"",onChange:g=>o(p,{oauthClientSecret:g.target.value}),disabled:n,placeholder:"••••••••",className:"font-mono text-xs"})]})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Redirect URL"}),s.jsx(it,{value:h.oauthRedirectUrl||"http://localhost:6274/oauth/",onChange:g=>o(p,{oauthRedirectUrl:g.target.value}),disabled:n,placeholder:"http://localhost:6274/oauth/",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Scope (space-separated)"}),s.jsx(it,{value:h.oauthScope||"",onChange:g=>o(p,{oauthScope:g.target.value}),disabled:n,placeholder:"openid profile mcp",className:"font-mono text-xs"})]})]})]})]})]},h.id)),e.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No servers configured. Add one to get started."})]})}var Qv="Collapsible",[_he]=er(Qv),[Phe,sC]=_he(Qv),HB=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:i,onOpenChange:o,...c}=e,[d,f]=Zr({prop:r,defaultProp:a??!1,onChange:o,caller:Qv});return s.jsx(Phe,{scope:n,disabled:i,contentId:Bn(),open:d,onOpenToggle:v.useCallback(()=>f(h=>!h),[f]),children:s.jsx(qe.div,{"data-state":oC(d),"data-disabled":i?"":void 0,...c,ref:t})})});HB.displayName=Qv;var KB="CollapsibleTrigger",GB=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,a=sC(KB,n);return s.jsx(qe.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":oC(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:t,onClick:Pe(e.onClick,a.onOpenToggle)})});GB.displayName=KB;var iC="CollapsibleContent",YB=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=sC(iC,e.__scopeCollapsible);return s.jsx(Un,{present:n||a.open,children:({present:i})=>s.jsx(Ohe,{...r,ref:t,present:i})})});YB.displayName=iC;var Ohe=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:a,...i}=e,o=sC(iC,n),[c,d]=v.useState(r),f=v.useRef(null),h=ft(t,f),p=v.useRef(0),g=p.current,y=v.useRef(0),j=y.current,w=o.open||c,x=v.useRef(w),S=v.useRef(void 0);return v.useEffect(()=>{const N=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(N)},[]),zn(()=>{const N=f.current;if(N){S.current=S.current||{transitionDuration:N.style.transitionDuration,animationName:N.style.animationName},N.style.transitionDuration="0s",N.style.animationName="none";const A=N.getBoundingClientRect();p.current=A.height,y.current=A.width,x.current||(N.style.transitionDuration=S.current.transitionDuration,N.style.animationName=S.current.animationName),d(r)}},[o.open,r]),s.jsx(qe.div,{"data-state":oC(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!w,...i,ref:h,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":j?`${j}px`:void 0,...e.style},children:w&&a})});function oC(e){return e?"open":"closed"}var khe=HB;const Ci=khe,Os=GB,Ai=YB,Rhe=Zm,The=ev,XB=v.forwardRef(({className:e,...t},n)=>s.jsx($c,{ref:n,className:Se("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));XB.displayName=$c.displayName;const QB=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(The,{children:[s.jsx(XB,{}),s.jsxs(Dc,{ref:r,className:Se("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,s.jsxs(tv,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[s.jsx(Ii,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));QB.displayName=Dc.displayName;const JB=({className:e,...t})=>s.jsx("div",{className:Se("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});JB.displayName="DialogHeader";const ZB=v.forwardRef(({className:e,...t},n)=>s.jsx(sf,{ref:n,className:Se("text-lg font-semibold leading-none tracking-tight",e),...t}));ZB.displayName=sf.displayName;const e8=v.forwardRef(({className:e,...t},n)=>s.jsx(of,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));e8.displayName=of.displayName;function Ihe(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var lC="ScrollArea",[t8]=er(lC),[Mhe,xa]=t8(lC),n8=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:a,scrollHideDelay:i=600,...o}=e,[c,d]=v.useState(null),[f,h]=v.useState(null),[p,g]=v.useState(null),[y,j]=v.useState(null),[w,x]=v.useState(null),[S,N]=v.useState(0),[A,P]=v.useState(0),[E,O]=v.useState(!1),[k,R]=v.useState(!1),D=ft(t,z=>d(z)),U=Vc(a);return s.jsx(Mhe,{scope:n,type:r,dir:U,scrollHideDelay:i,scrollArea:c,viewport:f,onViewportChange:h,content:p,onContentChange:g,scrollbarX:y,onScrollbarXChange:j,scrollbarXEnabled:E,onScrollbarXEnabledChange:O,scrollbarY:w,onScrollbarYChange:x,scrollbarYEnabled:k,onScrollbarYEnabledChange:R,onCornerWidthChange:N,onCornerHeightChange:P,children:s.jsx(qe.div,{dir:U,...o,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":A+"px",...e.style}})})});n8.displayName=lC;var r8="ScrollAreaViewport",a8=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...i}=e,o=xa(r8,n),c=v.useRef(null),d=ft(t,c,o.onViewportChange);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),s.jsx(qe.div,{"data-radix-scroll-area-viewport":"",...i,ref:d,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:s.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});a8.displayName=r8;var ds="ScrollAreaScrollbar",cC=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=xa(ds,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=a,c=e.orientation==="horizontal";return v.useEffect(()=>(c?i(!0):o(!0),()=>{c?i(!1):o(!1)}),[c,i,o]),a.type==="hover"?s.jsx($he,{...r,ref:t,forceMount:n}):a.type==="scroll"?s.jsx(Dhe,{...r,ref:t,forceMount:n}):a.type==="auto"?s.jsx(s8,{...r,ref:t,forceMount:n}):a.type==="always"?s.jsx(uC,{...r,ref:t}):null});cC.displayName=ds;var $he=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=xa(ds,e.__scopeScrollArea),[i,o]=v.useState(!1);return v.useEffect(()=>{const c=a.scrollArea;let d=0;if(c){const f=()=>{window.clearTimeout(d),o(!0)},h=()=>{d=window.setTimeout(()=>o(!1),a.scrollHideDelay)};return c.addEventListener("pointerenter",f),c.addEventListener("pointerleave",h),()=>{window.clearTimeout(d),c.removeEventListener("pointerenter",f),c.removeEventListener("pointerleave",h)}}},[a.scrollArea,a.scrollHideDelay]),s.jsx(Un,{present:n||i,children:s.jsx(s8,{"data-state":i?"visible":"hidden",...r,ref:t})})}),Dhe=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=xa(ds,e.__scopeScrollArea),i=e.orientation==="horizontal",o=Zv(()=>d("SCROLL_END"),100),[c,d]=Ihe("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return v.useEffect(()=>{if(c==="idle"){const f=window.setTimeout(()=>d("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(f)}},[c,a.scrollHideDelay,d]),v.useEffect(()=>{const f=a.viewport,h=i?"scrollLeft":"scrollTop";if(f){let p=f[h];const g=()=>{const y=f[h];p!==y&&(d("SCROLL"),o()),p=y};return f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[a.viewport,i,d,o]),s.jsx(Un,{present:n||c!=="hidden",children:s.jsx(uC,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Pe(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Pe(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),s8=v.forwardRef((e,t)=>{const n=xa(ds,e.__scopeScrollArea),{forceMount:r,...a}=e,[i,o]=v.useState(!1),c=e.orientation==="horizontal",d=Zv(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;o(c?f:h)}},10);return Ac(n.viewport,d),Ac(n.content,d),s.jsx(Un,{present:r||i,children:s.jsx(uC,{"data-state":i?"visible":"hidden",...a,ref:t})})}),uC=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,a=xa(ds,e.__scopeScrollArea),i=v.useRef(null),o=v.useRef(0),[c,d]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=u8(c.viewport,c.content),h={...r,sizes:c,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:g=>i.current=g,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:g=>o.current=g};function p(g,y){return qhe(g,o.current,c,y)}return n==="horizontal"?s.jsx(Lhe,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const g=a.viewport.scrollLeft,y=eM(g,c,a.dir);i.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:g=>{a.viewport&&(a.viewport.scrollLeft=g)},onDragScroll:g=>{a.viewport&&(a.viewport.scrollLeft=p(g,a.dir))}}):n==="vertical"?s.jsx(Fhe,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const g=a.viewport.scrollTop,y=eM(g,c);i.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:g=>{a.viewport&&(a.viewport.scrollTop=g)},onDragScroll:g=>{a.viewport&&(a.viewport.scrollTop=p(g))}}):null}),Lhe=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=xa(ds,e.__scopeScrollArea),[o,c]=v.useState(),d=v.useRef(null),f=ft(t,d,i.onScrollbarXChange);return v.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),s.jsx(o8,{"data-orientation":"horizontal",...a,ref:f,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Jv(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,p)=>{if(i.viewport){const g=i.viewport.scrollLeft+h.deltaX;e.onWheelScroll(g),f8(g,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:Sm(o.paddingLeft),paddingEnd:Sm(o.paddingRight)}})}})}),Fhe=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=xa(ds,e.__scopeScrollArea),[o,c]=v.useState(),d=v.useRef(null),f=ft(t,d,i.onScrollbarYChange);return v.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),s.jsx(o8,{"data-orientation":"vertical",...a,ref:f,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Jv(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,p)=>{if(i.viewport){const g=i.viewport.scrollTop+h.deltaY;e.onWheelScroll(g),f8(g,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:Sm(o.paddingTop),paddingEnd:Sm(o.paddingBottom)}})}})}),[Bhe,i8]=t8(ds),o8=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:a,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:h,onResize:p,...g}=e,y=xa(ds,n),[j,w]=v.useState(null),x=ft(t,D=>w(D)),S=v.useRef(null),N=v.useRef(""),A=y.viewport,P=r.content-r.viewport,E=Cn(h),O=Cn(d),k=Zv(p,10);function R(D){if(S.current){const U=D.clientX-S.current.left,z=D.clientY-S.current.top;f({x:U,y:z})}}return v.useEffect(()=>{const D=U=>{const z=U.target;j?.contains(z)&&E(U,P)};return document.addEventListener("wheel",D,{passive:!1}),()=>document.removeEventListener("wheel",D,{passive:!1})},[A,j,P,E]),v.useEffect(O,[r,O]),Ac(j,k),Ac(y.content,k),s.jsx(Bhe,{scope:n,scrollbar:j,hasThumb:a,onThumbChange:Cn(i),onThumbPointerUp:Cn(o),onThumbPositionChange:O,onThumbPointerDown:Cn(c),children:s.jsx(qe.div,{...g,ref:x,style:{position:"absolute",...g.style},onPointerDown:Pe(e.onPointerDown,D=>{D.button===0&&(D.target.setPointerCapture(D.pointerId),S.current=j.getBoundingClientRect(),N.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),R(D))}),onPointerMove:Pe(e.onPointerMove,R),onPointerUp:Pe(e.onPointerUp,D=>{const U=D.target;U.hasPointerCapture(D.pointerId)&&U.releasePointerCapture(D.pointerId),document.body.style.webkitUserSelect=N.current,y.viewport&&(y.viewport.style.scrollBehavior=""),S.current=null})})})}),jm="ScrollAreaThumb",l8=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=i8(jm,e.__scopeScrollArea);return s.jsx(Un,{present:n||a.hasThumb,children:s.jsx(zhe,{ref:t,...r})})}),zhe=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,i=xa(jm,n),o=i8(jm,n),{onThumbPositionChange:c}=o,d=ft(t,p=>o.onThumbChange(p)),f=v.useRef(void 0),h=Zv(()=>{f.current&&(f.current(),f.current=void 0)},100);return v.useEffect(()=>{const p=i.viewport;if(p){const g=()=>{if(h(),!f.current){const y=Whe(p,c);f.current=y,c()}};return c(),p.addEventListener("scroll",g),()=>p.removeEventListener("scroll",g)}},[i.viewport,h,c]),s.jsx(qe.div,{"data-state":o.hasThumb?"visible":"hidden",...a,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Pe(e.onPointerDownCapture,p=>{const y=p.target.getBoundingClientRect(),j=p.clientX-y.left,w=p.clientY-y.top;o.onThumbPointerDown({x:j,y:w})}),onPointerUp:Pe(e.onPointerUp,o.onThumbPointerUp)})});l8.displayName=jm;var dC="ScrollAreaCorner",c8=v.forwardRef((e,t)=>{const n=xa(dC,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(Uhe,{...e,ref:t}):null});c8.displayName=dC;var Uhe=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=xa(dC,n),[i,o]=v.useState(0),[c,d]=v.useState(0),f=!!(i&&c);return Ac(a.scrollbarX,()=>{const h=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(h),d(h)}),Ac(a.scrollbarY,()=>{const h=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(h),o(h)}),f?s.jsx(qe.div,{...r,ref:t,style:{width:i,height:c,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Sm(e){return e?parseInt(e,10):0}function u8(e,t){const n=e/t;return isNaN(n)?0:n}function Jv(e){const t=u8(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function qhe(e,t,n,r="ltr"){const a=Jv(n),i=a/2,o=t||i,c=a-o,d=n.scrollbar.paddingStart+o,f=n.scrollbar.size-n.scrollbar.paddingEnd-c,h=n.content-n.viewport,p=r==="ltr"?[0,h]:[h*-1,0];return d8([d,f],p)(e)}function eM(e,t,n="ltr"){const r=Jv(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,o=t.content-t.viewport,c=i-r,d=n==="ltr"?[0,o]:[o*-1,0],f=Qd(e,d);return d8([0,o],[0,c])(f)}function d8(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function f8(e,t){return e>0&&e<t}var Whe=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function a(){const i={left:e.scrollLeft,top:e.scrollTop},o=n.left!==i.left,c=n.top!==i.top;(o||c)&&t(),n=i,r=window.requestAnimationFrame(a)})(),()=>window.cancelAnimationFrame(r)};function Zv(e,t){const n=Cn(e),r=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),v.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ac(e,t){const n=Cn(t);zn(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}var p8=n8,Vhe=a8,Hhe=c8;const Nm=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(p8,{ref:r,className:Se("relative overflow-hidden",e),...n,children:[s.jsx(Vhe,{className:"h-full w-full rounded-[inherit]",children:t}),s.jsx(h8,{}),s.jsx(Hhe,{})]}));Nm.displayName=p8.displayName;const h8=v.forwardRef(({className:e,orientation:t="vertical",...n},r)=>s.jsx(cC,{ref:r,orientation:t,className:Se("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:s.jsx(l8,{className:"relative flex-1 rounded-full bg-border"})}));h8.displayName=cC.displayName;const Khe=[{label:"Suggest Checks",description:"Propose stronger evaluation checks for this scenario.",prompt:"Suggest checks"},{label:"Suggest Value Capture Rules",description:"Recommend extract/value capture rules for key outputs.",prompt:"Suggest value capture rules"},{label:"Improve Prompt Determinism",description:"Reduce ambiguity and improve reproducibility.",prompt:"Improve prompt determinism"},{label:"Explain Snapshot Drift Risk",description:"Assess likely causes of drift and stabilization options.",prompt:"Explain snapshot drift risk"},{label:"Generate Scenario Draft",description:"Create a draft scenario from the current context.",prompt:"Generate scenario draft"}];function Ghe({open:e,onOpenChange:t,configId:n,configPath:r,scenario:a,agents:i,servers:o,snapshotEval:c,defaultAssistantAgentName:d,initialUserMessage:f,onApplyPatch:h}){const{source:p}=An(),[g,y]=v.useState(null),[j,w]=v.useState(null),[x,S]=v.useState(""),[N,A]=v.useState(!1),[P,E]=v.useState(new Set),O=v.useRef(null),k=v.useRef(null),R=v.useRef(null),[D,U]=v.useState(!1),z=v.useRef(!1),L=d||i[0]?.name||i[0]?.id||"";v.useEffect(()=>{if(!e||!L||g)return;let V=!1;return A(!0),p.createScenarioAssistantSession({configId:n,configPath:r,scenarioId:a.id,selectedAssistantAgentName:L,context:{configSnapshotPolicy:c?{enabled:c.enabled,mode:c.mode,baselineSnapshotId:c.baselineSnapshotId}:void 0,scenario:{id:a.id,name:a.name,prompt:a.prompt,serverNames:a.serverIds.map(J=>o.find(ge=>ge.id===J)?.name||o.find(ge=>ge.id===J)?.id).filter(Boolean),evalRules:a.evalRules,extractRules:a.extractRules,snapshotEval:a.snapshotEval?{enabled:a.snapshotEval.enabled,baselineSnapshotId:a.snapshotEval.baselineSnapshotId}:void 0},availableServers:o.map(J=>({name:J.name||J.id,url:J.url})),availableAgents:i.map(J=>({name:J.name||J.id,provider:J.provider,model:J.model}))}}).then(J=>{V||(y(J.sessionId),w(J.session))}).catch(J=>{V||Re({title:"Could not start Scenario Assistant",description:J instanceof Error?J.message:String(J),variant:"destructive"})}).finally(()=>{V||A(!1)}),()=>{V=!0}},[e,p,g,n,r,a,c,i,o,L]);const G=()=>{y(null),w(null),S(""),E(new Set),R.current=null},q=V=>{G(),p.closeScenarioAssistantSession(V).catch(()=>{})};v.useEffect(()=>{e||g&&(z.current||D||q(g))},[e,g,p,D]),v.useEffect(()=>()=>{g&&p.closeScenarioAssistantSession(g).catch(()=>{})},[g,p]),v.useEffect(()=>{if(!e)return;D&&U(!1),z.current&&(z.current=!1);const V=window.setTimeout(()=>{O.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(V)},[e,N,j?.messages.length,j?.pendingToolCalls.length,j?.warnings.length]),v.useEffect(()=>{const V=k.current;if(!V)return;V.style.height="0px";const J=Math.min(V.scrollHeight,160);V.style.height=`${Math.max(40,J)}px`},[x,e]);const H=i.length>0&&a.serverIds.length>0&&!!L,X=async V=>{if(!g)return;const J=V.trim();if(!J)return;const ge=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,ie={id:ge,role:"user",text:J,createdAt:new Date().toISOString()};w(ce=>ce&&{...ce,messages:[...ce.messages,ie]}),S(""),A(!0);try{const ce=await p.sendScenarioAssistantMessage(g,J);w(ce.session)}catch(ce){w(oe=>oe&&{...oe,messages:oe.messages.filter(xe=>xe.id!==ge)}),S(oe=>oe.trim()?oe:J),Re({title:"Scenario Assistant error",description:ce instanceof Error?ce.message:String(ce),variant:"destructive"})}finally{A(!1)}},Z=V=>{S(V),requestAnimationFrame(()=>k.current?.focus())};v.useEffect(()=>{if(!e||!g||!j||!H||N)return;const V=String(f??"").trim();V&&R.current!==V&&(R.current=V,X(V))},[e,g,j,H,N,f]);const I=async V=>{if(g){A(!0);try{const J=await p.approveScenarioAssistantToolCall(g,V);w(J.session)}catch(J){Re({title:"Tool call failed",description:J instanceof Error?J.message:String(J),variant:"destructive"})}finally{A(!1)}}},F=async V=>{if(g){A(!0);try{const J=await p.denyScenarioAssistantToolCall(g,V);w(J.session)}catch(J){Re({title:"Could not deny tool call",description:J instanceof Error?J.message:String(J),variant:"destructive"})}finally{A(!1)}}},Q=(V,J,ge)=>{if(!J)return;if(ge==="prompt"&&J.prompt&&h({prompt:J.prompt.replacement}),ge==="evalRules"&&J.evalRules&&h({evalRules:J.evalRules.replacement}),ge==="extractRules"&&J.extractRules&&h({extractRules:J.extractRules.replacement}),ge==="snapshotEval"&&J.snapshotEval&&h({snapshotEval:{enabled:J.snapshotEval.patch.enabled,baselineSnapshotId:J.snapshotEval.patch.baselineSnapshotId}}),V){const ce=`${V}:${ge}`;E(oe=>new Set([...oe,ce]))}Re({title:"Applied suggestion",description:`Updated ${{prompt:"Prompt",evalRules:"Checks",extractRules:"Value Capture Rules",snapshotEval:"Snapshot Settings"}[ge]}`})},B=V=>{V||(U(!1),z.current=!1),t(V)},$=()=>{z.current=!0,U(!0),t(!1)},ee=()=>{z.current=!1,U(!1),g&&q(g)};return s.jsxs(s.Fragment,{children:[!e&&g&&s.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2 rounded-md border bg-background px-3 py-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-medium",children:"Scenario Assistant (session active)"}),s.jsxs("p",{className:"truncate text-xs text-muted-foreground",children:["Resume conversation for ",s.jsx("span",{className:"font-mono",children:a.id}),j?` · ${j.messages.length} messages`:""]})]}),s.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>t(!0),children:[s.jsx(ua,{className:"mr-1.5 h-3.5 w-3.5"}),"Resume"]}),s.jsx(ae,{type:"button",size:"sm",variant:"ghost",className:"h-8 px-2 text-muted-foreground",onClick:ee,"aria-label":"Discard assistant session",title:"Discard assistant session",children:s.jsx(Ii,{className:"h-4 w-4"})})]})]}),s.jsx(Rhe,{open:e,onOpenChange:B,children:s.jsxs(QB,{className:"max-w-6xl h-[85vh] flex flex-col",children:[g&&s.jsxs("button",{type:"button",className:"absolute right-12 top-4 z-10 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",onClick:$,"aria-label":"Minimize assistant",title:"Minimize assistant",children:[s.jsx(TU,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Minimize"})]}),s.jsx(JB,{className:"pr-20",children:s.jsx("div",{className:"flex items-start justify-between gap-3",children:s.jsxs("div",{className:"min-w-0",children:[s.jsxs(ZB,{className:"flex items-center gap-2",children:[s.jsx(ua,{className:"h-4 w-4"}),"Scenario Assistant"]}),s.jsx(e8,{children:"LLM-guided scenario authoring with MCP tool introspection and per-tool-call approval."})]})})}),H?s.jsxs("div",{className:"min-h-0 flex flex-1 flex-col gap-3",children:[s.jsx("div",{className:"grid gap-3 sm:grid-cols-1",children:s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"MCP Context"}),s.jsxs("div",{className:"h-8 rounded-md border px-2 text-xs flex items-center gap-2",children:[s.jsx(Rs,{className:"h-3.5 w-3.5"}),j?`Loaded ${j.toolsLoaded} tools`:"Preparing..."]})]})}),s.jsx(Nm,{className:"min-h-0 flex-1 rounded-md border p-3",children:s.jsxs("div",{className:"space-y-3",children:[j?.warnings?.map((V,J)=>s.jsx("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900",children:V},`${V}-${J}`)),j?.messages.map(V=>s.jsxs(v.Fragment,{children:[(()=>{const J=V.pendingToolCallId?(j?.pendingToolCalls??[]).find(Oe=>Oe.id===V.pendingToolCallId):void 0;if(!(V.role==="assistant"&&!!V.pendingToolCallId))return s.jsx("div",{className:"space-y-2",children:s.jsx(Yhe,{message:V})});const ie=V.text.match(/I need to call ['"]([^'"]+)['"]/i)?.[1]?.replace(/^.*__/,"")??void 0,ce=J?.tool??V.toolRequestName??ie,oe=J?.publicToolName??V.toolRequestPublicName,xe=ce??oe??"unknown_tool";return s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700",children:s.jsx(fa,{className:"h-3 w-3"})}),s.jsxs("details",{open:!!J,className:"group w-full max-w-[92%] rounded-md border border-border/60 bg-background",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2",children:[s.jsx("div",{className:"min-w-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Rs,{className:"h-3.5 w-3.5 text-muted-foreground"}),s.jsx("span",{className:"truncate text-sm font-medium",children:`Tool call ${xe}`}),s.jsx("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-semibold ${J?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"}`,children:J?"Needs approval":"Completed"})]})}),s.jsx(It,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),s.jsxs("div",{className:"space-y-2 border-t border-border/50 px-3 py-2",children:[s.jsx(dS,{text:V.text,variant:"assistant"}),J&&s.jsxs(s.Fragment,{children:[s.jsx("pre",{className:"max-h-40 w-full max-w-full overflow-x-auto overflow-y-auto whitespace-pre rounded border bg-muted/50 p-2 text-xs",children:s.jsx("code",{children:JSON.stringify(J.arguments??{},null,2)})}),s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{F(J.id)},children:"Deny"}),s.jsx(ae,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{I(J.id)},children:"Approve"})]})]})]})]})]})})(),V.suggestions&&s.jsxs("div",{className:"ml-0 space-y-3 rounded-md border border-dashed bg-muted/10 p-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-muted-foreground",children:[s.jsx(ua,{className:"h-3.5 w-3.5"}),"Structured Suggestions"]}),V.suggestions.prompt&&s.jsx(Jp,{title:"Prompt",rationale:V.suggestions.prompt.rationale,preview:V.suggestions.prompt.replacement,applied:P.has(`${V.id}:prompt`),onApply:()=>Q(V.id,V.suggestions,"prompt")}),V.suggestions.evalRules&&s.jsx(Jp,{title:"Checks",rationale:V.suggestions.evalRules.rationale,preview:JSON.stringify(V.suggestions.evalRules.replacement,null,2),applied:P.has(`${V.id}:evalRules`),onApply:()=>Q(V.id,V.suggestions,"evalRules")}),V.suggestions.extractRules&&s.jsx(Jp,{title:"Value Capture Rules",rationale:V.suggestions.extractRules.rationale,preview:JSON.stringify(V.suggestions.extractRules.replacement,null,2),applied:P.has(`${V.id}:extractRules`),onApply:()=>Q(V.id,V.suggestions,"extractRules")}),V.suggestions.snapshotEval&&s.jsx(Jp,{title:"Snapshot Settings",rationale:V.suggestions.snapshotEval.rationale,preview:JSON.stringify(V.suggestions.snapshotEval.patch,null,2),applied:P.has(`${V.id}:snapshotEval`),onApply:()=>Q(V.id,V.suggestions,"snapshotEval")}),(()=>{const J=V.suggestions?.notes,ge=Array.isArray(J)?J:typeof J=="string"?[J]:[];return ge.length===0?null:s.jsxs("div",{className:"space-y-2 rounded-md border p-3",children:[s.jsx("h5",{className:"text-sm font-medium",children:"Notes"}),s.jsx("ul",{className:"space-y-1 text-xs text-muted-foreground list-disc pl-4",children:ge.map((ie,ce)=>s.jsx("li",{children:ie},`${V.id}-note-${ce}`))})]})})()]})]},V.id)),(j?.pendingToolCalls??[]).filter(V=>!(j?.messages??[]).some(J=>J.pendingToolCallId===V.id)).map(V=>s.jsxs("details",{open:!0,className:"group min-w-0 rounded-md border bg-background",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-2 p-3",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Rs,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),s.jsx("p",{className:"min-w-0 truncate font-mono text-xs font-semibold",children:V.publicToolName||V.tool}),s.jsx("span",{className:"shrink-0 rounded bg-amber-100 px-1.5 py-0.5 text-[10px] font-semibold text-amber-900",children:"Needs approval"})]})}),s.jsx(It,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),s.jsxs("div",{className:"border-t px-3 pb-3 pt-2",children:[s.jsx("pre",{className:"max-h-40 w-full max-w-full overflow-x-auto overflow-y-auto whitespace-pre rounded border bg-muted/50 p-2 text-xs",children:s.jsx("code",{children:JSON.stringify(V.arguments??{},null,2)})}),s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{F(V.id)},children:"Deny"}),s.jsx(ae,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:N,onClick:()=>{I(V.id)},children:"Approve"})]})]})]},V.id)),!j&&N&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Zn,{className:"h-4 w-4 animate-spin"}),"Starting assistant session..."]}),j&&N&&s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700",children:s.jsx(fa,{className:"h-3 w-3"})}),s.jsxs("div",{className:"inline-flex items-center gap-2 rounded-md border bg-background px-3 py-2 text-sm text-muted-foreground",children:[s.jsx(Zn,{className:"h-4 w-4 animate-spin"}),"Thinking..."]})]}),s.jsx("div",{ref:O})]})}),s.jsxs("div",{className:"rounded-xl border bg-background p-2 shadow-sm",children:[s.jsx(Vs,{ref:k,value:x,onChange:V=>S(V.target.value),placeholder:"Get assistance with creating or refining this scenario ...",disabled:!g||N,rows:1,className:"min-h-10 max-h-40 resize-none border-0 bg-transparent px-2 py-1 text-sm shadow-none focus-visible:ring-0 focus-visible:ring-offset-0",onKeyDown:V=>{V.key==="Enter"&&!V.shiftKey&&(V.preventDefault(),X(x))}}),s.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[s.jsxs(Hc,{children:[s.jsx(Kc,{asChild:!0,children:s.jsxs(ae,{type:"button",variant:"ghost",size:"sm",className:"h-7 shrink-0 gap-1 px-1.5 text-[11px] font-normal text-muted-foreground/80 hover:text-muted-foreground",disabled:!g||N,children:[s.jsx(Fa,{className:"h-3 w-3"}),"Snippets",s.jsx(It,{className:"h-3 w-3"})]})}),s.jsxs(Ko,{align:"start",className:"w-[320px]",children:[s.jsx(eC,{children:"Scenario Assistant Snippets"}),s.jsx(tC,{}),Khe.map(V=>s.jsx(mr,{className:"items-start whitespace-normal px-2 py-2",onSelect:()=>Z(V.prompt),children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("div",{className:"text-xs font-medium leading-tight",children:V.label}),s.jsx("div",{className:"text-[11px] leading-snug text-muted-foreground",children:V.description})]})},V.label))]})]}),s.jsx(ae,{type:"button",size:"icon",className:"h-8 w-8 rounded-full",onClick:()=>{X(x)},disabled:!g||N||!x.trim(),"aria-label":"Send message",title:"Send message",children:N?s.jsx(Zn,{className:"h-4 w-4 animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(u$,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Send"})]})})]})]})]}):s.jsx("div",{className:"rounded-md border p-3 text-sm text-muted-foreground",children:"Scenario Assistant requires a configured assistant agent and at least one selected server on the scenario."})]})})]})}function Jp({title:e,rationale:t,preview:n,applied:r=!1,onApply:a}){return s.jsxs("div",{className:`space-y-2 rounded-md border p-3 ${r?"border-emerald-300 bg-emerald-50/40":""}`,children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("h5",{className:"text-sm font-medium",children:e}),s.jsx(ae,{type:"button",size:"sm",variant:r?"secondary":"outline",onClick:a,disabled:r,children:r?s.jsxs(s.Fragment,{children:[s.jsx($l,{className:"mr-1.5 h-3.5 w-3.5"}),"Applied"]}):"Apply"})]}),t&&s.jsx("p",{className:"text-xs text-muted-foreground",children:t}),s.jsx("pre",{className:"max-h-56 overflow-auto rounded bg-muted p-2 text-xs whitespace-pre-wrap",children:n})]})}function Yhe({message:e}){const t=async o=>{try{await navigator.clipboard.writeText(o),Re({title:"Copied"})}catch(c){Re({title:"Could not copy",description:c instanceof Error?c.message:String(c),variant:"destructive"})}},n=e.role;if(n==="tool"){const o=String(e.text??"").trim();return/^(Approved|Denied) tool call\b/i.test(o)?null:s.jsxs("div",{className:"rounded-md border border-sky-500/30 bg-sky-500/10 px-3 py-2 text-sm",children:[s.jsxs("div",{className:"mb-1 flex items-center gap-2 text-[11px] font-semibold uppercase tracking-wide text-sky-700",children:[s.jsx(Rs,{className:"h-3.5 w-3.5"}),"Tool",s.jsx("span",{className:"font-normal normal-case text-sky-700/80",children:new Date(e.createdAt).toLocaleTimeString()})]}),s.jsx("p",{className:"whitespace-pre-wrap text-sky-900",children:e.text})]})}if(n==="system")return s.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700",children:s.jsx(c$,{className:"h-3 w-3"})}),s.jsx("div",{className:"max-w-[92%] rounded-md border border-amber-400/30 bg-amber-50/70 p-3 text-sm",children:s.jsx(dS,{text:e.text,variant:"assistant"})})]});const r=n==="user",a=r?_S:fa,i=n==="user"||n==="assistant";return s.jsxs("div",{className:`flex items-start gap-2 text-xs ${r?"justify-end":"justify-start"}`,children:[!r&&s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700",children:s.jsx(a,{className:"h-3 w-3"})}),s.jsxs("div",{className:"relative max-w-[92%]",children:[s.jsxs("div",{className:`max-w-full rounded-md border px-3 py-2 text-sm ${r?"border-primary/20 bg-primary/10":"border-border/80 bg-background shadow-sm"}`,children:[!r&&s.jsx("p",{className:"mb-2 text-[11px] font-semibold text-muted-foreground",children:"Assistant"}),r?s.jsx("p",{className:"whitespace-pre-wrap",children:e.text}):s.jsx(dS,{text:e.text,variant:"assistant"})]}),i&&s.jsx(ae,{type:"button",variant:"ghost",size:"icon",className:`absolute bottom-1 h-6 w-6 text-muted-foreground ${r?"-left-8":"-right-8"}`,onClick:()=>{t(e.text)},"aria-label":"Copy message",title:"Copy message",children:s.jsx(Ti,{className:"h-3.5 w-3.5"})})]}),r&&s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-primary/30 bg-primary/15 text-primary",children:s.jsx(a,{className:"h-3 w-3"})})]})}function dS({text:e,variant:t="assistant"}){const n=Xhe(e);return s.jsx("div",{className:Se("space-y-2",t==="system"&&"text-xs"),children:n.map((r,a)=>s.jsx(v.Fragment,{children:Qhe(r,a,t)},`md-${a}`))})}function Xhe(e){const t=e.replace(/\r\n/g,`
|
|
121
|
+
`).split(`
|
|
122
|
+
`),n=[];let r=0;const a=o=>o.trim()==="",i=o=>o.trimStart().startsWith("```");for(;r<t.length;){const o=t[r],c=o.trim();if(a(o)){r+=1;continue}if(i(o)){const g=c.replace(/^```/,"").trim()||void 0;r+=1;const y=[];for(;r<t.length&&!i(t[r]);)y.push(t[r]),r+=1;r<t.length&&i(t[r])&&(r+=1),n.push({type:"code",lang:g,code:y.join(`
|
|
123
|
+
`)});continue}if(/^---+$/.test(c)||/^\*\*\*+$/.test(c)){n.push({type:"hr"}),r+=1;continue}const d=c.match(/^(#{1,4})\s+(.+)$/);if(d){n.push({type:"heading",level:d[1].length,text:d[2].trim()}),r+=1;continue}if(tM(t,r)){const g=nM(t[r]);r+=2;const y=[];for(;r<t.length&&t[r].includes("|")&&!a(t[r]);)y.push(nM(t[r])),r+=1;n.push({type:"table",headers:g,rows:y});continue}const f=c.match(/^\d+\.\s+/),h=c.match(/^[-*+]\s+/);if(f||h){const g=!!f,y=[];for(;r<t.length;){const j=t[r].trim();if(g?/^\d+\.\s+/.test(j):/^[-*+]\s+/.test(j)){y.push(j.replace(g?/^\d+\.\s+/:/^[-*+]\s+/,"")),r+=1;continue}a(t[r])&&(r+=1);break}n.push({type:"list",ordered:g,items:y});continue}const p=[o];for(r+=1;r<t.length;){const g=t[r],y=g.trim();if(a(g)||i(g)||/^---+$/.test(y)||/^#{1,4}\s+/.test(y)||tM(t,r)||/^\d+\.\s+/.test(y)||/^[-*+]\s+/.test(y))break;p.push(g),r+=1}n.push({type:"paragraph",text:p.join(`
|
|
124
|
+
`)})}return n}function tM(e,t){if(t+1>=e.length)return!1;const n=e[t].trim(),r=e[t+1].trim();return n.includes("|")?/^\|?(\s*:?-{3,}:?\s*\|)+\s*:?-{3,}:?\s*\|?$/.test(r):!1}function nM(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}function Qhe(e,t,n){if(e.type==="hr")return s.jsx("hr",{className:"border-border/60"});if(e.type==="heading"){const r=e.level===1?"text-base font-semibold":e.level===2?"text-sm font-semibold":"text-sm font-medium";return s.jsx("h4",{className:r,children:qu(e.text,`${t}-h`)})}if(e.type==="paragraph")return s.jsx("p",{className:Se("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:qu(e.text,`${t}-p`)});if(e.type==="code")return s.jsxs("div",{className:"rounded-md border bg-muted/70",children:[e.lang&&s.jsx("div",{className:"border-b px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:e.lang}),s.jsx("pre",{className:"max-h-72 overflow-auto p-2 text-xs",children:s.jsx("code",{children:e.code})})]});if(e.type==="list"){const r=e.ordered?"ol":"ul";return s.jsx(r,{className:Se("space-y-1 pl-5",e.ordered?"list-decimal":"list-disc"),children:e.items.map((a,i)=>s.jsx("li",{className:"leading-relaxed",children:qu(a,`${t}-li-${i}`)},`${t}-li-${i}`))})}return e.type==="table"?s.jsx("div",{className:"overflow-x-auto rounded-md border",children:s.jsxs("table",{className:"w-full min-w-[480px] border-collapse text-xs",children:[s.jsx("thead",{className:"bg-muted/40",children:s.jsx("tr",{children:e.headers.map((r,a)=>s.jsx("th",{className:"border-b px-2 py-1.5 text-left font-semibold align-top",children:qu(r,`${t}-thc-${a}`)},`${t}-th-${a}`))})}),s.jsx("tbody",{children:e.rows.map((r,a)=>s.jsx("tr",{className:"border-t",children:r.map((i,o)=>s.jsx("td",{className:"px-2 py-1.5 align-top",children:qu(i,`${t}-tdc-${a}-${o}`)},`${t}-td-${a}-${o}`))},`${t}-row-${a}`))})]})}):null}function qu(e,t){return e.split(/(`[^`]+`|\*\*[^*]+\*\*)/g).filter(Boolean).map((r,a)=>r.startsWith("`")&&r.endsWith("`")?s.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.92em]",children:r.slice(1,-1)},`${t}-${a}`):r.startsWith("**")&&r.endsWith("**")?s.jsx("strong",{children:r.slice(2,-2)},`${t}-${a}`):s.jsx(v.Fragment,{children:r},`${t}-${a}`))}const Jhe="mcplab.feature.";function jf(e,t=!1){if(typeof window>"u")return t;try{const n=window.localStorage.getItem(`${Jhe}${e}`);return n==null?t:n==="1"||n==="true"}catch{return t}}const Zhe=()=>({id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]});function fS({scenarios:e,scenarioOrigins:t,agents:n,servers:r,configId:a,configPath:i,defaultAssistantAgentName:o,assistantInitialPromptByScenarioId:c,assistantAutoOpenNonceByScenarioId:d,snapshotEval:f,onChange:h,readOnly:p,allowAdd:g=!p,allowStructureEdits:y=!p}){const j=(N,A)=>{const P=e.map((E,O)=>O===N?{...E,...A}:E);h(P)},w=N=>h(e.filter((A,P)=>P!==N)),x=()=>h([...e,Zhe()]),S=(N,A)=>{const P=N+A;if(P<0||P>=e.length)return;const E=[...e],[O]=E.splice(N,1);E.splice(P,0,O),h(E)};return s.jsxs("div",{className:p?"space-y-2":"space-y-4",children:[!p&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Scenarios"}),g&&y&&s.jsxs(ae,{type:"button",variant:"outline",size:"sm",onClick:x,children:[s.jsx(Fa,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Scenario"]})]}),e.map((N,A)=>s.jsx(eme,{scenario:N,scenarioOrigin:t?.[A],index:A,total:e.length,agents:n,servers:r,configId:a,configPath:i,defaultAssistantAgentName:o,assistantInitialPrompt:c?.[N.id],assistantAutoOpenNonce:d?.[N.id],snapshotEval:f,onUpdate:P=>j(A,P),onMoveUp:()=>S(A,-1),onMoveDown:()=>S(A,1),onRemove:()=>w(A),readOnly:p,allowStructureEdits:y},N.id)),e.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No scenarios configured. Add one to get started."})]})}function eme({scenario:e,scenarioOrigin:t,index:n,total:r,agents:a,servers:i,configId:o,configPath:c,defaultAssistantAgentName:d,assistantInitialPrompt:f,assistantAutoOpenNonce:h,snapshotEval:p,onUpdate:g,onMoveUp:y,onMoveDown:j,onRemove:w,readOnly:x,allowStructureEdits:S}){const{source:N}=An(),A=jf("snapshots",!1),[P,E]=v.useState("required_tool"),[O,k]=v.useState(""),[R,D]=v.useState(""),[U,z]=v.useState(null),[L,G]=v.useState(!1),[q,H]=v.useState(null),[X,Z]=v.useState(""),[I,F]=v.useState(""),[Q,B]=v.useState(!1),[$,ee]=v.useState(!x),V=()=>{O.trim()&&(g({evalRules:[...e.evalRules,{type:P,value:O.trim()}]}),k(""),D(""))},J=je=>{g({evalRules:e.evalRules.filter(($e,et)=>et!==je)})},ge=()=>{!X.trim()||!I.trim()||(g({extractRules:[...e.extractRules,{name:X.trim(),pattern:I.trim()}]}),Z(""),F(""))},ie=je=>{g({extractRules:e.extractRules.filter(($e,et)=>et!==je)})},ce=je=>{const $e=e.serverIds.includes(je)?e.serverIds.filter(et=>et!==je):[...e.serverIds,je];g({serverIds:$e})},oe={required_tool:"Required",forbidden_tool:"Forbidden",response_contains:"Contains",response_not_contains:"Not Contains"},xe={required_tool:"border-sky-300/60 bg-sky-500/10 text-sky-700",forbidden_tool:"border-rose-300/60 bg-rose-500/10 text-rose-700",response_contains:"border-violet-300/60 bg-violet-500/10 text-violet-700",response_not_contains:"border-amber-300/60 bg-amber-500/10 text-amber-700"},Oe=P==="required_tool"||P==="forbidden_tool",pe=e.serverIds.map(je=>i.find($e=>$e.id===je)?.name).filter(je=>!!je),ve=pe.length>0,Ce=e.snapshotEval?.baselineSnapshotId!==void 0,[Le,se]=v.useState(""),[de,Ne]=v.useState(0);v.useEffect(()=>{const je=(f??"").trim();je&&Le!==je&&(B(!0),se(je))},[f,Le]),v.useEffect(()=>{h&&h!==de&&(B(!0),Ne(h))},[h,de]),v.useEffect(()=>{z(null),H(null),D("")},[e.serverIds.join("|")]),v.useEffect(()=>{D("")},[P]);const Fe=async()=>{if(!(!ve||x)){G(!0),H(null);try{const je=new Set;for(const $e of pe){const et=await N.discoverToolsForAnalysis({serverNames:[$e]});for(const xt of et.servers)for(const Jt of xt.tools)je.add(Jt.name)}z(Array.from(je).sort(($e,et)=>$e.localeCompare(et)))}catch(je){H(je instanceof Error?je.message:"Failed to load tools")}finally{G(!1)}}};return s.jsx(Ci,{open:$,onOpenChange:ee,children:s.jsxs(ze,{className:x?"rounded-md border shadow-none":"border-dashed",children:[s.jsxs(At,{className:x?"px-3 py-3 flex-row items-center justify-between space-y-0":"pb-3 flex-row items-center justify-between space-y-0",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[!x&&s.jsx(Os,{asChild:!0,children:s.jsx(ae,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",children:s.jsx(It,{className:`h-3.5 w-3.5 transition-transform ${$?"rotate-0":"-rotate-90"}`})})}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[n+1,"."]}),s.jsx(Et,{className:"truncate text-sm font-medium",children:e.name||`Scenario ${n+1}`})]}),x?s.jsxs("div",{className:"flex items-center gap-2",children:[t&&s.jsx(Ke,{variant:t==="inline"?"secondary":"outline",children:t==="referenced"?"Referenced":"Inline"}),s.jsx(Os,{asChild:!0,children:s.jsx(ae,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8","aria-label":$?"Collapse scenario details":"Expand scenario details",children:s.jsx(It,{className:`h-4 w-4 transition-transform ${$?"rotate-180":""}`})})})]}):S&&s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>B(!0),title:a.length===0?"Add at least one agent in the config":e.serverIds.length===0?"Select at least one server for this scenario":"Open Scenario Assistant",children:[s.jsx(ua,{className:"h-3.5 w-3.5"}),"Ask Assistant"]}),s.jsx(ae,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:y,disabled:n===0,"aria-label":"Move scenario up",children:s.jsx(La,{className:"h-3.5 w-3.5"})}),s.jsx(ae,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,disabled:n===r-1,"aria-label":"Move scenario down",children:s.jsx(It,{className:"h-3.5 w-3.5"})}),s.jsx(ae,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:w,children:s.jsx(Yr,{className:"h-3.5 w-3.5 text-destructive"})})]})]}),s.jsx(Ai,{children:s.jsxs(Ue,{className:"space-y-3",children:[s.jsx(Ghe,{open:Q,onOpenChange:B,configId:o,configPath:c,scenario:e,agents:a,servers:i,snapshotEval:p,defaultAssistantAgentName:d,initialUserMessage:f,onApplyPatch:je=>g({...je.prompt!==void 0?{prompt:je.prompt}:{},...je.evalRules!==void 0?{evalRules:je.evalRules}:{},...je.extractRules!==void 0?{extractRules:je.extractRules}:{},...je.snapshotEval!==void 0?{snapshotEval:{...e.snapshotEval??{},...je.snapshotEval}}:{}})}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Name"}),s.jsx(it,{value:e.name,onChange:je=>g({name:je.target.value}),disabled:x,placeholder:"e.g. List directory"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Servers"}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[i.map(je=>s.jsx(Ke,{variant:e.serverIds.includes(je.id)?"default":"outline",className:`cursor-pointer text-xs ${e.serverIds.includes(je.id)?"":"opacity-50"}`,onClick:()=>!x&&ce(je.id),children:je.name||je.id},je.id)),i.length===0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:"Add servers above first"})]})]}),s.jsxs(ze,{className:"border bg-card",children:[s.jsxs(At,{className:"pb-2",children:[s.jsx(Et,{className:"text-sm",children:"Prompt"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"The instruction sent to the agent for this scenario. Be explicit about the task, expected output, and constraints."})]}),s.jsx(Ue,{className:"pt-0",children:s.jsx(Vs,{value:e.prompt,onChange:je=>g({prompt:je.target.value}),disabled:x,placeholder:"The prompt to send to the agent...",rows:4,className:"text-xs"})})]}),s.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[s.jsxs(ze,{className:"border bg-muted/20",children:[s.jsx(At,{className:"pb-2",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx(Et,{className:"text-sm",children:"Checks"}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Checks determine pass/fail for the scenario. Add tool checks or text pattern checks for the final answer."})]}),!x&&s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>B(!0),title:"Ask for help improving checks",children:[s.jsx(ua,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]})}),s.jsx(Ue,{className:"space-y-2",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(Te,{className:"text-xs",children:"Checks (pass / fail)"}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"These determine whether the scenario passes. Add tool checks (required/forbidden) or text pattern checks for the final answer."}),s.jsx("div",{className:"space-y-1.5",children:e.evalRules.length===0?s.jsx("p",{className:"rounded-md border border-dashed bg-background/60 px-2 py-2 text-xs text-muted-foreground",children:"No checks yet. Add tool checks or text pattern checks below."}):e.evalRules.map((je,$e)=>s.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-md border bg-background px-2 py-2 text-xs",children:[s.jsx("div",{className:"min-w-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:`rounded-full border px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${xe[je.type]}`,children:oe[je.type]}),s.jsx("span",{className:"font-mono break-all",children:je.value})]})}),!x&&s.jsx(ae,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>J($e),"aria-label":`Remove check ${$e+1}`,children:s.jsx(Ii,{className:"h-3.5 w-3.5"})})]},$e))}),!x&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex gap-2 items-end",children:[s.jsxs(Kt,{value:P,onValueChange:je=>E(je),children:[s.jsx(Ut,{className:"h-8 w-[14.5rem] shrink-0 text-xs",children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"required_tool",children:"Required Tool"}),s.jsx(Je,{value:"forbidden_tool",children:"Forbidden Tool"}),s.jsx(Je,{value:"response_contains",children:"Text matches pattern"}),s.jsx(Je,{value:"response_not_contains",children:"Text must not match"})]})]}),s.jsx(it,{value:O,onChange:je=>k(je.target.value),placeholder:"Value",className:"h-8 text-xs font-mono",onKeyDown:je=>je.key==="Enter"&&(je.preventDefault(),V())}),s.jsx(ae,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:V,children:"Add"})]}),Oe&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx(Te,{className:"mb-1 block text-[11px] text-muted-foreground",children:"Pick from selected server tools (optional)"}),s.jsxs(Kt,{value:R,onValueChange:je=>{D(je),k(je)},disabled:L||!U||U.length===0,children:[s.jsx(Ut,{className:"h-8 text-xs",children:s.jsx(Gt,{placeholder:L?"Loading tools...":U&&U.length>0?"Select tool to insert in value field":"Load tools first"})}),s.jsx(qt,{children:(U??[]).map(je=>s.jsx(Je,{value:je,children:je},je))})]})]}),s.jsx(ae,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:Fe,disabled:!ve||L,children:L?"Loading...":U?"Refresh tools":"Load tools"})]}),!ve&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Select at least one server in this scenario to load tool names."}),q&&s.jsxs("p",{className:"text-[11px] text-destructive",children:["Could not load tools: ",q]})]})]})]})})]}),s.jsxs(ze,{className:"border bg-muted/10",children:[s.jsx(At,{className:"pb-2",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx(Et,{className:"text-sm",children:"Value Capture Rules"}),s.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Formerly “Extract Rules”. These do not fail the run. They capture structured values from the final answer for reporting, snapshots, and comparisons."})]}),!x&&s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>B(!0),title:"Ask for help improving value capture rules",children:[s.jsx(ua,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]})}),s.jsx(Ue,{className:"space-y-2",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(Te,{className:"text-xs",children:"Value Capture Rules"}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Use regex patterns to capture values like max concentration, product names, date ranges, or IDs from the final answer text."}),s.jsx("div",{className:"space-y-1.5",children:e.extractRules.length===0?s.jsx("p",{className:"w-full rounded-md border border-dashed bg-background/60 px-2 py-2 text-xs text-muted-foreground",children:"No value capture rules yet. Add one below to capture structured output from the final answer."}):e.extractRules.map((je,$e)=>s.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border bg-background px-2 py-2 text-xs",children:[s.jsx("div",{className:"min-w-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"rounded-full border border-violet-300/60 bg-violet-500/10 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-violet-700",children:je.name}),s.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground",children:"regex:"}),s.jsx("code",{className:"font-mono break-all text-foreground",children:je.pattern})]})}),!x&&s.jsx(ae,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>ie($e),"aria-label":`Remove value capture rule ${$e+1}`,children:s.jsx(Ii,{className:"h-3.5 w-3.5"})})]},$e))}),!x&&s.jsxs("div",{className:"flex gap-2 items-end",children:[s.jsx(it,{value:X,onChange:je=>Z(je.target.value),placeholder:"Field name",className:"h-8 text-xs w-36"}),s.jsx(it,{value:I,onChange:je=>F(je.target.value),placeholder:"Regex pattern",className:"h-8 text-xs font-mono",onKeyDown:je=>je.key==="Enter"&&(je.preventDefault(),ge())}),s.jsx(ae,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:ge,children:"Add"})]})]})})]})]}),A&&s.jsxs(ze,{className:"border bg-amber-50/40",children:[s.jsxs(At,{className:"pb-2",children:[s.jsx(Et,{className:"text-sm",children:"Snapshot Evaluation"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Per-scenario toggle for config baseline drift checks."})]}),s.jsxs(Ue,{className:"space-y-2 text-xs text-muted-foreground",children:[s.jsxs("div",{className:"flex items-center justify-between rounded-md border bg-white/60 px-2 py-1.5",children:[s.jsx("span",{children:"Enabled for this scenario"}),s.jsx(bm,{checked:e.snapshotEval?.enabled!==!1,disabled:x,onCheckedChange:je=>g({snapshotEval:{...e.snapshotEval??{},enabled:je}})})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between rounded-md border bg-white/60 px-2 py-1.5",children:[s.jsx("span",{children:"Use config baseline"}),s.jsx(bm,{checked:!Ce,disabled:x,onCheckedChange:je=>{if(je){g({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:void 0}});return}g({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:e.snapshotEval?.baselineSnapshotId??""}})}})]}),Ce&&s.jsx(it,{value:e.snapshotEval?.baselineSnapshotId??"",onChange:je=>g({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:je.target.value}}),disabled:x,placeholder:"Override baseline snapshot id",className:"h-8 text-xs font-mono"})]}),s.jsxs("p",{children:["Effective baseline snapshot:"," ",s.jsx("span",{className:"font-mono",children:e.snapshotEval?.baselineSnapshotId||p?.baselineSnapshotId||"Not configured"})]}),s.jsxs("p",{children:["Policy:"," ",s.jsx("span",{className:"font-mono",children:p?.mode??"warn"})," · config-level switch"," ",s.jsx("span",{className:"font-mono",children:p?.enabled?"on":"off"})]})]})]})]})})]})})}const tme=()=>({id:`cfg-${Date.now()}`,name:"",configName:"",description:"",servers:[],serverEntries:[],agents:[],agentEntries:[],scenarios:[],scenarioEntries:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),rM=()=>{const{id:e,tab:t}=Ic(),n=qa(),[r,a]=Mc(),{getConfig:i,addConfig:o,updateConfig:c,loading:d}=cf(),{source:f}=An(),h=jf("snapshots",!1),{servers:p,agents:g,scenarios:y}=Va(),j=e==="new",w=!j&&!!e,x=w?i(e):void 0,[S,N]=v.useState(j),[A,P]=v.useState(()=>x?structuredClone(x):tme()),[E,O]=v.useState([]),[k,R]=v.useState(""),[D,U]=v.useState(""),[z,L]=v.useState(""),[G,q]=v.useState(null),[H,X]=v.useState(!1),[Z,I]=v.useState(!1),[F,Q]=v.useState(""),[B,$]=v.useState(""),[ee,V]=v.useState(""),[J,ge]=v.useState({}),[ie,ce]=v.useState({}),[oe,xe]=v.useState({}),[Oe,pe]=v.useState({}),[ve,Ce]=v.useState({}),Le=v.useMemo(()=>{const T=t||r.get("tab");return T==="agents"||T==="scenarios"||T==="servers"?T:"agents"},[t,r]);v.useEffect(()=>{x&&!S&&P(structuredClone(x))},[x,S]),v.useEffect(()=>{let T=!0;return f.listSnapshots().then(ne=>{T&&O(ne)}).catch(()=>{T&&O([])}),()=>{T=!1}},[f]),v.useEffect(()=>{if(!k.trim()){q(null);return}let T=!0;return f.getResult(k.trim()).then(ne=>{if(!T)return;if(!ne){q(!1);return}const be=ne.overallPassRate===1&&ne.scenarios.every(_e=>_e.runs.every(rt=>rt.passed));q(be)}).catch(()=>{T&&q(!1)}),()=>{T=!1}},[k,f]);const se=T=>P(ne=>({...ne,...T})),de=v.useMemo(()=>A.serverEntries&&A.serverEntries.length>0?A.serverEntries:A.servers.map(T=>({kind:"inline",server:T})),[A.serverEntries,A.servers]),Ne=T=>{se({serverEntries:T,servers:T.filter(ne=>ne.kind==="inline").map(ne=>ne.server)})},Fe=v.useMemo(()=>A.scenarioEntries&&A.scenarioEntries.length>0?A.scenarioEntries:A.scenarios.map(T=>({kind:"inline",scenario:T})),[A.scenarioEntries,A.scenarios]),je=T=>{se({scenarioEntries:T,scenarios:T.filter(ne=>ne.kind==="inline").map(ne=>ne.scenario)})},$e=v.useMemo(()=>A.agentEntries&&A.agentEntries.length>0?A.agentEntries:A.agents.map(T=>({kind:"inline",agent:T})),[A.agentEntries,A.agents]),et=T=>{se({agentEntries:T,agents:T.filter(ne=>ne.kind==="inline").map(ne=>ne.agent)})},xt=!S,Jt=A.runDefaults?.selectedAgentNames??[],ye=async T=>{if(!A.id||xt===!1){se({snapshotEval:{enabled:T.enabled,mode:T.mode,baselineSnapshotId:T.baselineSnapshotId,baselineSourceRunId:T.baselineSourceRunId,lastUpdatedAt:new Date().toISOString()}});return}X(!0);try{const ne=await f.updateSnapshotPolicy(A.id,T);P(ne),Re({title:"Snapshot policy updated"})}catch(ne){Re({title:"Could not update snapshot policy",description:ne instanceof Error?ne.message:String(ne),variant:"destructive"})}finally{X(!1)}},We=async()=>{if(!(!A.id||!k.trim())){I(!0);try{const T=await f.generateSnapshotEvalBaseline(k.trim(),A.id,D.trim()||void 0);P(T.config),L(T.snapshot.id),O(ne=>[T.snapshot,...ne.filter(be=>be.id!==T.snapshot.id)]),Re({title:"Snapshot baseline generated",description:`${T.snapshot.name} (${T.snapshot.id})`})}catch(T){Re({title:"Could not generate baseline",description:T instanceof Error?T.message:String(T),variant:"destructive"})}finally{I(!1)}}},Ye=async()=>{if(!A.name.trim()){Re({title:"Validation Error",description:"Config ID is required.",variant:"destructive"});return}const T=de.map(Be=>Be.kind==="referenced"?{kind:"referenced",ref:p.find(Vt=>Vt.id===Be.ref)?.id||Be.ref}:Be),ne=$e.map(Be=>Be.kind==="referenced"?{kind:"referenced",ref:g.find(Vt=>Vt.id===Be.ref)?.id||Be.ref}:Be),be=Fe.map(Be=>Be.kind==="referenced"?{kind:"referenced",ref:y.find(Vt=>Vt.id===Be.ref)?.id||Be.ref}:Be);if(be.filter(Be=>Be.kind==="inline").some(Be=>!Be.scenario.name?.trim())){Re({title:"Validation Error",description:"Inline scenarios must have a name before saving.",variant:"destructive"});return}const rt=new Set(ne.map(Be=>Be.kind==="inline"?Be.agent.id:Be.ref)),Ge=(A.runDefaults?.selectedAgentNames??[]).filter(Be=>rt.has(Be)),vt={...A,serverEntries:T,servers:T.filter(Be=>Be.kind==="inline").map(Be=>Be.server),agentEntries:ne,agents:ne.filter(Be=>Be.kind==="inline").map(Be=>Be.agent),scenarioEntries:be,scenarios:be.filter(Be=>Be.kind==="inline").map(Be=>Be.scenario),runDefaults:Ge.length>0?{...A.runDefaults??{},selectedAgentNames:Ge}:void 0,updatedAt:new Date().toISOString()};if(j){const Be=await o(vt);P(Be);const Ct=Be.configName?.trim()||Be.name;Re({title:"MCP Evaluation Created",description:`"${Ct}" has been saved.`}),n(`/mcp-evaluations/${Be.id}`)}else{const Be=await c(A.id,vt);P(Be);const Ct=Be.configName?.trim()||Be.name;Re({title:"MCP Evaluation Updated",description:`"${Ct}" has been updated.`}),N(!1),Be.id!==e&&n(`/mcp-evaluations/${Be.id}`,{replace:!0})}},Ot=A.configName?.trim()||A.name,Dt=j?"New MCP Evaluation":S?`Editing: ${Ot}`:Ot,kt=j?"/mcp-evaluations/new":`/mcp-evaluations/${encodeURIComponent(A.id||e||"")}`,Zt=!!x?.loadError,Sn=()=>{const T=p.find(be=>be.id===F);if(!T)return;const ne={...structuredClone(T),id:`srv-${Date.now()}`};Ne([...de,{kind:"inline",server:ne}]),ce(be=>({...be,[ne.id]:!0})),Q("")},tr=()=>{const T=p.find(_e=>_e.id===F);if(!T)return;const ne=T.id;new Set(de.filter(_e=>_e.kind==="referenced").map(_e=>_e.ref)).has(ne)||Ne([...de,{kind:"referenced",ref:ne}]),Q("")},nr=()=>{const ne={id:`srv-${Date.now()}`,name:"",transport:"stdio",authType:"none",oauthRedirectUrl:"http://localhost:6274/oauth/"};Ne([{kind:"inline",server:ne},...de]),ce(be=>({...be,[ne.id]:!0}))},ba=T=>{const ne=de[T];ne?.kind==="inline"&&ce(be=>{const _e={...be};return delete _e[ne.server.id],_e}),Ne(de.filter((be,_e)=>_e!==T))},En=(T,ne)=>{const be=T+ne;if(be<0||be>=de.length)return;const _e=[...de],[rt]=_e.splice(T,1);_e.splice(be,0,rt),Ne(_e)},Or=T=>{const ne=de[T];if(!ne||ne.kind!=="referenced")return;const be=Xt(ne.ref);if(!be){Re({title:"Referenced server not found",variant:"destructive"});return}const _e={...structuredClone(be),id:`srv-${Date.now()}`},rt=[...de];rt[T]={kind:"inline",server:_e},Ne(rt),ce(Ge=>({...Ge,[_e.id]:!0})),Re({title:"Referenced server converted to inline",description:_e.name||_e.id}),Q("")},kr=v.useMemo(()=>g.map(T=>({id:T.id,ref:T.id,label:T.name||T.id,model:T.model})).sort((T,ne)=>T.label.localeCompare(ne.label)),[g]),yr=(T,ne)=>{const be=ne?Array.from(new Set([...Jt,T])):Jt.filter(_e=>_e!==T);se({runDefaults:{...A.runDefaults??{},selectedAgentNames:be}})},_n=T=>{const ne=new Set([...$e.filter(Ge=>Ge.kind==="inline").map(Ge=>Ge.agent.name||Ge.agent.id),...g.map(Ge=>Ge.name||Ge.id)]),be=`${T}-custom`;let _e=be,rt=2;for(;ne.has(_e);)_e=`${be}-${rt}`,rt+=1;return _e},Rn=()=>{const ne={id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096};et([{kind:"inline",agent:ne},...$e]),ge(be=>({...be,[ne.id]:!0}))},yn=()=>{const T=g.find(_e=>_e.id===ee);if(!T)return;const ne=T.id;new Set($e.filter(_e=>_e.kind==="referenced").map(_e=>_e.ref)).has(ne)||et([...$e,{kind:"referenced",ref:ne}]),V("")},Tn=()=>{const T=g.find(rt=>rt.id===ee);if(!T)return;const ne=T.name||T.id,be=_n(ne),_e={...structuredClone(T),id:`agt-${Date.now()}`,name:be};et([...$e,{kind:"inline",agent:_e}]),ge(rt=>({...rt,[_e.id]:!0})),V(""),Re({title:"Imported agent as inline",description:be})},ue=T=>{const ne=$e[T];if(!ne)return;const be=ne.kind==="inline"?ne.agent.id:ne.ref,_e=Jt.filter(rt=>rt!==be);se({runDefaults:{...A.runDefaults??{},selectedAgentNames:_e}}),ne.kind==="inline"&&ge(rt=>{const Ge={...rt};return delete Ge[ne.agent.id],Ge}),et($e.filter((rt,Ge)=>Ge!==T))},Ie=(T,ne)=>{const be=T+ne;if(be<0||be>=$e.length)return;const _e=[...$e],[rt]=_e.splice(T,1);_e.splice(be,0,rt),et(_e)},ct=T=>{const ne=$e[T];if(!ne||ne.kind!=="referenced")return;const be=xr(ne.ref);if(!be){Re({title:"Referenced agent not found",variant:"destructive"});return}const _e=be.name||be.id,rt=_n(_e),Ge={...structuredClone(be),id:`agt-${Date.now()}`,name:rt},vt=[...$e];if(vt[T]={kind:"inline",agent:Ge},et(vt),Jt.includes(ne.ref)){const Be=Jt.map(Ct=>Ct===ne.ref?Ge.id:Ct);se({runDefaults:{...A.runDefaults??{},selectedAgentNames:Array.from(new Set(Be))}})}ge(Be=>({...Be,[Ge.id]:!0})),Re({title:"Referenced agent converted to inline",description:rt})},bt=()=>{const T=y.find(rt=>rt.id===B);if(!T)return;const ne=[...de],be=[];for(const rt of T.serverIds){const Ge=ne.find(Lt=>Lt.kind==="referenced"&&Lt.ref===rt);if(Ge){be.push(Ge.ref);continue}const vt=p.find(Lt=>Lt.id===rt);if(!vt)continue;const Be=vt.name||vt.id,Ct=ne.find(Lt=>Lt.kind==="inline"&&(Lt.server.id===vt.id||(Lt.server.name||Lt.server.id)===Be));if(Ct){be.push(Ct.server.id);continue}const Vt={...structuredClone(vt),id:`srv-${Date.now()}-${be.length}`};ne.push({kind:"inline",server:Vt}),be.push(Vt.id)}const _e={...structuredClone(T),id:`scn-${Date.now()}`,serverIds:be.length>0?be:[]};Ne(ne),je([...Fe,{kind:"inline",scenario:_e}]),Ce(rt=>({...rt,[_e.id]:!0})),$("")},Wt=()=>{const ne={id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};je([{kind:"inline",scenario:ne},...Fe]),Ce(be=>({...be,[ne.id]:!0}))},on=()=>{const T=y.find(_e=>_e.id===B);if(!T)return;const ne=T.id;new Set(Fe.filter(_e=>_e.kind==="referenced").map(_e=>_e.ref)).has(ne)||je([...Fe,{kind:"referenced",ref:ne}]),$("")},Pt=T=>{const ne=Fe[T];ne?.kind==="inline"&&Ce(be=>{const _e={...be};return delete _e[ne.scenario.id],_e}),je(Fe.filter((be,_e)=>_e!==T))},rr=(T,ne)=>{const be=T+ne;if(be<0||be>=Fe.length)return;const _e=[...Fe],[rt]=_e.splice(T,1);_e.splice(be,0,rt),je(_e)},ln=T=>{const ne=Fe[T];if(!ne||ne.kind!=="referenced")return;const be=wa(ne.ref);if(!be){Re({title:"Referenced scenario not found",variant:"destructive"});return}const _e=new Set(Fe.filter(Tr=>Tr.kind==="inline").map(Tr=>Tr.scenario.name?.trim().toLowerCase()).filter(Boolean)),rt=`${(be.name||be.id).trim()}-custom`;let Ge=rt,vt=2;for(;_e.has(Ge.toLowerCase());)Ge=`${rt}-${vt}`,vt+=1;const Be=Date.now(),Ct=[...de],Vt=[];for(const Tr of be.serverIds){const Xi=Ct.find(Ir=>Ir.kind==="referenced"&&Ir.ref===Tr);if(Xi){Vt.push(Xi.ref);continue}const Na=p.find(Ir=>Ir.id===Tr);if(!Na)continue;const Xo=Na.name||Na.id,Cf=Ct.find(Ir=>Ir.kind==="inline"&&(Ir.server.id===Na.id||(Ir.server.name||Ir.server.id)===Xo));if(Cf){Vt.push(Cf.server.id);continue}const Af={...structuredClone(Na),id:`srv-${Be}-${Vt.length}`};Ct.push({kind:"inline",server:Af}),Vt.push(Af.id)}Ne(Ct);const Lt={...structuredClone(be),id:`scn-${Be}`,name:Ge,serverIds:Vt},xn=[...Fe];xn[T]={kind:"inline",scenario:Lt},je(xn),Ce(Tr=>({...Tr,[Lt.id]:!0})),Re({title:"Referenced scenario converted to inline",description:Ge})},Xt=T=>p.find(ne=>ne.id===T),xr=T=>g.find(ne=>ne.id===T),wa=T=>y.find(ne=>ne.id===T),ja=de.filter(T=>T.kind==="referenced").map(T=>T.ref),ei=ja.map(Xt).filter(T=>!!T),Gi=de.flatMap(T=>{if(T.kind==="referenced"){const ne=Xt(T.ref);return ne?[{server:ne,origin:"referenced",ref:T.ref}]:[]}return[{server:T.server,origin:"inline",ref:void 0}]}),Go=$e.filter(T=>T.kind==="referenced").map(T=>T.ref),ti=Go.map(xr).filter(T=>!!T);$e.filter(T=>T.kind==="inline");const Rr=$e.flatMap(T=>{if(T.kind==="referenced"){const ne=xr(T.ref);return ne?[{agent:ne,origin:"referenced",ref:T.ref}]:[]}return[{agent:T.agent,origin:"inline",ref:void 0}]}),Yi=Fe.filter(T=>T.kind==="referenced").map(T=>T.ref),Ka=Fe.flatMap(T=>{if(T.kind==="referenced"){const ne=wa(T.ref);return ne?[{scenario:ne,origin:"referenced"}]:[]}return[{scenario:T.scenario,origin:"inline"}]}),Xc=Array.from(new Map([...g,...A.agents,...ti].map(T=>[T.name||T.id,T])).values()),Yo=Array.from(new Map([...p,...A.servers,...ei].map(T=>[T.name||T.id,T])).values()),ea=ja.filter(T=>!Xt(T)),Ga=Go.filter(T=>!xr(T)),Sa=Yi.filter(T=>!wa(T));new Set(ea);const Qc=new Set(Sa),K=de.length,he=$e.length,at=Fe.length;return v.useEffect(()=>{if(!ee)return;g.some(ne=>ne.id===ee)||V("")},[g,ee]),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ae,{variant:"ghost",size:"icon",asChild:!0,className:"h-8 w-8",children:s.jsx(yt,{to:"/mcp-evaluations",children:s.jsx(No,{className:"h-4 w-4"})})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h1",{className:"text-2xl font-bold truncate",children:Dt}),s.jsx("p",{className:"text-sm text-muted-foreground",children:j?"Create a new MCP evaluation":d?"Loading configuration...":x?x.loadError?"MCP evaluation could not be fully loaded":`Last updated ${new Date(A.updatedAt).toLocaleDateString()}`:"MCP evaluation not found"})]}),s.jsxs("div",{className:"flex gap-2 shrink-0",children:[w&&!S&&s.jsx(ae,{size:"sm",onClick:()=>N(!0),children:"Edit"}),w&&!S&&x&&!Zt&&s.jsx(ae,{size:"sm",variant:"outline",asChild:!0,children:s.jsxs(yt,{to:`/run?configId=${encodeURIComponent(x.id)}`,children:[s.jsx(Dl,{className:"mr-1.5 h-3.5 w-3.5"}),"Run MCP Evaluation"]})}),w&&!S&&Zt&&s.jsxs(Ke,{variant:"destructive",className:"py-1 px-3 text-xs",children:[s.jsx(nh,{className:"mr-1 h-3 w-3"}),"Broken config"]}),S&&s.jsxs(s.Fragment,{children:[!j&&s.jsx(ae,{variant:"outline",size:"sm",onClick:()=>{P(structuredClone(x)),N(!1)},children:"Cancel"}),s.jsxs(ae,{size:"sm",onClick:()=>{Ye()},children:[s.jsx(MU,{className:"mr-1.5 h-3.5 w-3.5"}),"Save"]})]})]})]}),Zt&&!S&&s.jsx(ze,{className:"border-destructive/40",children:s.jsxs(Ue,{className:"pt-6 space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(nh,{className:"mt-0.5 h-5 w-5 text-destructive"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-semibold",children:"This configuration is broken"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"The file is still present, but it could not be loaded because one or more references or fields are invalid."})]})]}),s.jsxs("div",{className:"rounded-md border bg-muted/20 p-3",children:[s.jsx("p",{className:"text-xs font-medium mb-1",children:"File"}),s.jsx("p",{className:"text-xs font-mono break-all",children:x?.sourcePath||x?.description})]}),s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3",children:[s.jsx("p",{className:"text-xs font-medium mb-1 text-destructive",children:"Load Error"}),s.jsx("p",{className:"text-xs break-all text-destructive",children:x?.loadError})]}),(ea.length>0||Ga.length>0||Sa.length>0)&&s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-background p-3 space-y-1.5",children:[s.jsx("p",{className:"text-xs font-medium",children:"Broken references"}),ea.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Servers: ",s.jsx("span",{className:"text-destructive",children:ea.join(", ")})]}),Ga.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Agents: ",s.jsx("span",{className:"text-destructive",children:Ga.join(", ")})]}),Sa.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Scenarios: ",s.jsx("span",{className:"text-destructive",children:Sa.join(", ")})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Valid items still render below. Only the missing references are marked as broken."})]})}),!Zt&&(A.loadWarnings?.length??0)>0&&s.jsx(ze,{className:"border-amber-500/30",children:s.jsxs(Ue,{className:"pt-4 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-amber-700 dark:text-amber-300",children:[s.jsx(nh,{className:"h-4 w-4"}),"Migration warnings"]}),A.loadWarnings?.map((T,ne)=>s.jsx("p",{className:"text-xs text-muted-foreground",children:T},`${T}-${ne}`))]})}),s.jsxs("div",{className:"flex gap-4",children:[s.jsx(Ke,{variant:Le==="agents"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(yt,{to:`${kt}/agents`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(fa,{className:"h-3 w-3"}),he," agent",he!==1?"s":""]})}),s.jsx(Ke,{variant:Le==="scenarios"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(yt,{to:`${kt}/scenarios`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(i_,{className:"h-3 w-3"}),at," scenario",at!==1?"s":""]})}),s.jsx(Ke,{variant:Le==="servers"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(yt,{to:`${kt}/servers`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(c_,{className:"h-3 w-3"}),K," server",K!==1?"s":""]})})]}),s.jsx(ze,{children:s.jsx(Ue,{className:"pt-6 space-y-3",children:s.jsxs("div",{className:`grid gap-4 ${xt||!j?"sm:grid-cols-2":"sm:grid-cols-3"}`,children:[!xt&&j&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Config ID"}),s.jsx(it,{value:A.name,onChange:T=>se({name:T.target.value}),disabled:xt,placeholder:"e.g. check-weather"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Name (optional)"}),s.jsx(it,{value:A.configName||"",onChange:T=>se({configName:T.target.value}),disabled:xt,placeholder:"e.g. Weather checks baseline"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Description"}),s.jsx(it,{value:A.description||"",onChange:T=>se({description:T.target.value}),disabled:xt,placeholder:"Brief description..."})]})]})})}),h&&s.jsx(ze,{children:s.jsxs(Ue,{className:"pt-6 space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-semibold",children:"Snapshot Evaluation"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Config baseline versioning. One active baseline is selected; scenarios can opt in/out below."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Te,{className:"text-xs",children:"Enable snapshot baseline"}),s.jsx(bm,{checked:A.snapshotEval?.enabled??!1,disabled:H,onCheckedChange:T=>{const ne=A.snapshotEval;ye({enabled:T,mode:ne?.mode??"warn",baselineSnapshotId:ne?.baselineSnapshotId,baselineSourceRunId:ne?.baselineSourceRunId})}})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Drift mode"}),s.jsxs(Kt,{value:A.snapshotEval?.mode??"warn",onValueChange:T=>{const ne=A.snapshotEval;ye({enabled:ne?.enabled??!1,mode:T,baselineSnapshotId:ne?.baselineSnapshotId,baselineSourceRunId:ne?.baselineSourceRunId})},children:[s.jsx(Ut,{className:"h-8",children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"warn",children:"Warn"}),s.jsx(Je,{value:"fail_on_drift",children:"Fail on drift"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Active baseline"}),s.jsx("p",{className:"rounded-md border bg-muted/20 px-2 py-2 text-xs font-mono",children:A.snapshotEval?.baselineSnapshotId??"No baseline linked"})]})]}),A.id&&s.jsxs("div",{className:"grid gap-2 rounded-md border bg-muted/20 p-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Generate baseline from passing run"}),s.jsx(it,{value:k,onChange:T=>R(T.target.value),placeholder:"Run id (e.g. 20260208-140213)",className:"h-8 font-mono text-xs"}),G===!1&&s.jsx("p",{className:"text-[11px] text-destructive",children:"Run is missing or not fully passing."})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Snapshot name (optional)"}),s.jsx(it,{value:D,onChange:T=>U(T.target.value),placeholder:"e.g. config-baseline-v1",className:"h-8 text-xs"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Switch baseline"}),s.jsxs(Kt,{value:z||A.snapshotEval?.baselineSnapshotId||"",onValueChange:T=>{L(T),ye({enabled:A.snapshotEval?.enabled??!0,mode:A.snapshotEval?.mode??"warn",baselineSnapshotId:T||void 0,baselineSourceRunId:A.snapshotEval?.baselineSourceRunId})},children:[s.jsx(Ut,{className:"h-8",children:s.jsx(Gt,{placeholder:"Select snapshot"})}),s.jsx(qt,{children:E.map(T=>s.jsx(Je,{value:T.id,children:T.name},T.id))})]})]}),s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{We()},disabled:Z||!k.trim()||G!==!0,children:Z?"Generating...":"Generate Baseline"}),s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{ye({enabled:A.snapshotEval?.enabled??!1,mode:A.snapshotEval?.mode??"warn",baselineSnapshotId:void 0,baselineSourceRunId:void 0})},disabled:H,children:"Clear Baseline"})]})]})]})}),s.jsxs(rC,{value:Le,onValueChange:T=>{if(T!=="servers"&&T!=="agents"&&T!=="scenarios")return;const ne=new URLSearchParams(r);if(ne.delete("tab"),a(ne,{replace:!0}),e&&e!=="new"){n(`/mcp-evaluations/${encodeURIComponent(e)}/${T}`,{replace:!0});return}n(`/mcp-evaluations/${e??"new"}/${T}`,{replace:!0})},className:"space-y-4",children:[s.jsxs(Kv,{children:[s.jsxs(ki,{value:"agents",className:"gap-1.5",children:[s.jsx(fa,{className:"h-3.5 w-3.5"}),"Agents"]}),s.jsxs(ki,{value:"scenarios",className:"gap-1.5",children:[s.jsx(i_,{className:"h-3.5 w-3.5"}),"Scenarios"]}),s.jsxs(ki,{value:"servers",className:"gap-1.5",children:[s.jsx(c_,{className:"h-3.5 w-3.5"}),"Servers"]})]}),s.jsxs(Vl,{value:"servers",children:[!xt&&s.jsx(ze,{className:"mb-4",children:s.jsxs(Ue,{className:"pt-4 space-y-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[s.jsxs(Kt,{value:F,onValueChange:Q,children:[s.jsx(Ut,{className:"h-8",children:s.jsx(Gt,{placeholder:"Select server from library"})}),s.jsx(qt,{children:p.map(T=>s.jsx(Je,{value:T.id,children:T.name||T.id},T.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!F,onClick:tr,children:"Add Ref"}),s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!F,onClick:Sn,children:"Import Inline"}),s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:nr,children:"Add server"})]})]}),s.jsxs("div",{className:"space-y-2",children:[de.map((T,ne)=>{const be=T.kind==="referenced"?Xt(T.ref):null,_e=T.kind==="inline"?T.server.name?.trim()||T.server.id:be?.name||T.ref,rt=T.kind==="inline"?T.server.id:T.ref,Ge=T.kind==="referenced"&&!be,vt=T.kind==="inline"&&!!ie[T.server.id];return s.jsxs("div",{className:"rounded-md border text-sm",children:[s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(ae,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>En(ne,-1),disabled:ne===0,"aria-label":"Move server up",children:s.jsx(La,{className:"h-3 w-3"})}),s.jsx(ae,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>En(ne,1),disabled:ne===de.length-1,"aria-label":"Move server down",children:s.jsx(It,{className:"h-3 w-3"})})]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[ne+1,"."]}),s.jsx("span",{className:"truncate font-medium",children:_e}),s.jsx(Ke,{variant:T.kind==="inline"?"secondary":"outline",children:T.kind==="inline"?"Inline":"Referenced"}),Ge&&s.jsx(Ke,{variant:"destructive",children:"Missing"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[T.kind==="inline"&&s.jsx(ae,{type:"button",size:"icon",variant:"outline",className:"h-7 w-7",onClick:()=>ce(Be=>({...Be,[T.server.id]:!Be[T.server.id]})),"aria-label":vt?"Collapse server details":"Expand server details",children:s.jsx(It,{className:`h-3.5 w-3.5 transition-transform ${vt?"rotate-180":""}`})}),T.kind==="referenced"&&s.jsx(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>Or(ne),disabled:Ge,children:"Convert to inline"}),s.jsx(ae,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>ba(ne),"aria-label":"Remove server entry",children:s.jsx(Yr,{className:"h-3.5 w-3.5"})})]})]}),T.kind==="inline"&&vt&&s.jsx("div",{className:"border-t px-3 py-3",children:s.jsx(Ehe,{servers:[T.server],onChange:Be=>{const Ct=Be[0];if(!Ct)return;const Vt=[...de];Vt[ne]={kind:"inline",server:Ct},Ne(Vt)},readOnly:!1,allowAdd:!1,allowStructureEdits:!1,showHeader:!1})})]},`server-entry-${ne}-${rt}`)}),de.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No servers configured yet. Add inline servers or references."})]}),ea.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing server refs: ",ea.join(", ")]})]})}),xt?s.jsx(ze,{children:s.jsx(Ue,{className:"pt-4",children:s.jsxs("div",{className:"space-y-2",children:[Gi.map((T,ne)=>{const be=T.ref??T.server.id,_e=!!Oe[be];return s.jsxs("div",{className:"rounded-md border p-3",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:[ne+1,"."]}),s.jsx("div",{className:"truncate font-medium text-sm",children:T.server.name||T.server.id})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ke,{variant:T.origin==="inline"?"secondary":"outline",children:T.origin==="inline"?"Inline":"Referenced"}),s.jsx(ae,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8",onClick:()=>pe(rt=>({...rt,[be]:!rt[be]})),"aria-label":_e?"Collapse server details":"Expand server details",children:s.jsx(It,{className:`h-4 w-4 transition-transform ${_e?"rotate-180":""}`})})]})]}),_e&&s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 border-t pt-2",children:[s.jsx(Ke,{variant:"outline",className:"text-xs font-mono",children:T.server.transport}),T.server.url&&s.jsx("span",{className:"text-xs font-mono text-muted-foreground break-all",children:T.server.url})]})]},`server-view-${ne}-${be}`)}),Gi.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No servers configured."})]})})}):null]}),s.jsxs(Vl,{value:"agents",children:[!xt&&s.jsx(ze,{className:"mb-4",children:s.jsxs(Ue,{className:"pt-4 space-y-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[s.jsxs(Kt,{value:ee,onValueChange:V,children:[s.jsx(Ut,{className:"h-8",children:s.jsx(Gt,{placeholder:"Select agent from library"})}),s.jsx(qt,{children:kr.map(T=>s.jsx(Je,{value:T.id,children:T.label},T.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!ee,onClick:yn,children:"Add Ref"}),s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!ee,onClick:Tn,children:"Import Inline"}),s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:Rn,children:"Add agent"})]})]}),s.jsxs("div",{className:"space-y-2",children:[$e.map((T,ne)=>{const be=T.kind==="referenced"?xr(T.ref):null,_e=T.kind==="inline"?T.agent.name?.trim()||T.agent.id:be?.name||T.ref,rt=T.kind==="inline"?T.agent.model:be?.model||"unknown",Ge=T.kind==="inline"?T.agent.id:T.ref,vt=T.kind==="referenced"&&!be,Be=T.kind==="inline"?T.agent.id:T.ref,Ct=Jt.includes(Be),Vt=T.kind==="inline"&&!!J[T.agent.id];return s.jsxs("div",{className:"rounded-md border text-sm",children:[s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(ae,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Ie(ne,-1),disabled:ne===0,"aria-label":"Move agent up",children:s.jsx(La,{className:"h-3 w-3"})}),s.jsx(ae,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>Ie(ne,1),disabled:ne===$e.length-1,"aria-label":"Move agent down",children:s.jsx(It,{className:"h-3 w-3"})})]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[ne+1,"."]}),s.jsx("span",{className:"truncate font-medium",children:_e}),s.jsx(Ke,{variant:T.kind==="inline"?"secondary":"outline",children:T.kind==="inline"?"Inline":"Referenced"}),s.jsx(Ke,{variant:"outline",className:"font-mono text-[10px]",children:rt}),Ct&&s.jsx(Ke,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),vt&&s.jsx(Ke,{variant:"destructive",children:"Missing"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxs("label",{className:"mx-2 flex items-center gap-1.5 text-xs text-muted-foreground",children:[s.jsx("input",{type:"checkbox",checked:Ct,onChange:Lt=>yr(Be,Lt.target.checked)}),s.jsx("span",{children:"Default"})]}),T.kind==="inline"&&s.jsx(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>ge(Lt=>({...Lt,[T.agent.id]:!Lt[T.agent.id]})),children:Vt?"Collapse":"Expand"}),T.kind==="referenced"&&s.jsx(s.Fragment,{children:s.jsx(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>ct(ne),disabled:vt,children:"Convert to inline"})}),s.jsx(ae,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>ue(ne),"aria-label":"Remove agent entry",children:s.jsx(Yr,{className:"h-3.5 w-3.5"})})]})]}),T.kind==="inline"&&Vt&&s.jsxs("div",{className:"border-t px-3 py-3 space-y-3",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Name"}),s.jsx(it,{value:T.agent.name,onChange:Lt=>{const xn=[...$e];xn[ne]={kind:"inline",agent:{...T.agent,name:Lt.target.value}},et(xn)},placeholder:"e.g. GPT-5 Mini custom"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Provider"}),s.jsxs(Kt,{value:T.agent.provider,onValueChange:Lt=>{const xn=[...$e];xn[ne]={kind:"inline",agent:{...T.agent,provider:Lt}},et(xn)},children:[s.jsx(Ut,{children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"openai",children:"OpenAI"}),s.jsx(Je,{value:"anthropic",children:"Anthropic"}),s.jsx(Je,{value:"azure",children:"Azure OpenAI"}),s.jsx(Je,{value:"google",children:"Google"}),s.jsx(Je,{value:"custom",children:"Custom"})]})]})]})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Model"}),s.jsx(it,{value:T.agent.model,onChange:Lt=>{const xn=[...$e];xn[ne]={kind:"inline",agent:{...T.agent,model:Lt.target.value}},et(xn)},className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Max Tokens"}),s.jsx(it,{type:"number",min:1,max:128e3,value:T.agent.maxTokens,onChange:Lt=>{const xn=[...$e];xn[ne]={kind:"inline",agent:{...T.agent,maxTokens:parseInt(Lt.target.value)||0}},et(xn)},className:"font-mono text-xs"})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Temperature"}),s.jsx(it,{type:"number",min:0,max:2,step:.01,value:T.agent.temperature,onChange:Lt=>{const xn=[...$e];xn[ne]={kind:"inline",agent:{...T.agent,temperature:Number(Lt.target.value)||0}},et(xn)},className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"System Prompt"}),s.jsx(Vs,{value:T.agent.systemPrompt||"",onChange:Lt=>{const xn=[...$e];xn[ne]={kind:"inline",agent:{...T.agent,systemPrompt:Lt.target.value}},et(xn)},rows:3,className:"text-xs"})]})]})]},`agent-entry-${ne}-${Ge}`)}),$e.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents configured yet. Add inline agents or references."})]}),Ga.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing agent refs: ",Ga.join(", ")]})]})}),xt?s.jsx(ze,{children:s.jsx(Ue,{className:"pt-4",children:s.jsxs("div",{className:"space-y-2",children:[Rr.map((T,ne)=>{const be=T.agent.name||T.agent.id,_e=Jt.includes(T.origin==="inline"?T.agent.id:T.ref||T.agent.id),rt=T.ref??T.agent.id,Ge=!!oe[rt];return s.jsxs("div",{className:"rounded-md border p-3",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:[ne+1,"."]}),s.jsx("div",{className:"truncate font-medium text-sm",children:be})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[_e&&s.jsx(Ke,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),s.jsx(Ke,{variant:T.origin==="inline"?"secondary":"outline",children:T.origin==="inline"?"Inline":"Referenced"}),s.jsx(ae,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8",onClick:()=>xe(vt=>({...vt,[rt]:!vt[rt]})),"aria-label":Ge?"Collapse agent details":"Expand agent details",children:s.jsx(It,{className:`h-4 w-4 transition-transform ${Ge?"rotate-180":""}`})})]})]}),Ge&&s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 border-t pt-2",children:[s.jsx(lB,{provider:T.agent.provider}),s.jsx(Ke,{variant:"outline",className:"text-xs font-mono",children:T.agent.model}),s.jsxs(Ke,{variant:"outline",className:"text-xs font-mono",children:["max_tokens: ",T.agent.maxTokens]}),s.jsxs(Ke,{variant:"outline",className:"text-xs font-mono",children:["temperature: ",T.agent.temperature]})]})]},`agent-view-${ne}-${T.ref??T.agent.id}`)}),Rr.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No agents configured."})]})})}):null]}),s.jsxs(Vl,{value:"scenarios",children:[!xt&&s.jsx(ze,{className:"mb-4",children:s.jsxs(Ue,{className:"pt-4 space-y-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[s.jsxs(Kt,{value:B,onValueChange:$,children:[s.jsx(Ut,{className:"h-8",children:s.jsx(Gt,{placeholder:"Select scenario from library"})}),s.jsx(qt,{children:y.map(T=>s.jsx(Je,{value:T.id,children:T.name||T.id},T.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!B,onClick:on,children:"Add Ref"}),s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!B,onClick:bt,children:"Import Inline"}),s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:Wt,children:"Add scenario"})]})]}),s.jsxs("div",{className:"space-y-2",children:[Fe.map((T,ne)=>{const be=T.kind==="referenced"?wa(T.ref):null,_e=T.kind==="inline"?T.scenario.name?.trim()||T.scenario.id:be?.name||T.ref,rt=T.kind==="inline"&&!T.scenario.name?.trim(),Ge=T.kind==="referenced"&&Qc.has(T.ref),vt=T.kind==="inline"&&!!ve[T.scenario.id];return s.jsxs("div",{className:"rounded-md border text-sm",children:[s.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(ae,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>rr(ne,-1),disabled:ne===0,"aria-label":"Move scenario up",children:s.jsx(La,{className:"h-3 w-3"})}),s.jsx(ae,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>rr(ne,1),disabled:ne===Fe.length-1,"aria-label":"Move scenario down",children:s.jsx(It,{className:"h-3 w-3"})})]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[ne+1,"."]}),s.jsx("span",{className:"truncate font-medium",children:_e}),s.jsx(Ke,{variant:T.kind==="inline"?"secondary":"outline",children:T.kind==="inline"?"Inline":"Referenced"}),rt&&s.jsx(Ke,{variant:"destructive",children:"Name required"}),Ge&&s.jsx(Ke,{variant:"destructive",children:"Missing"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[T.kind==="inline"&&s.jsx(ae,{type:"button",size:"icon",variant:"outline",className:"h-7 w-7",onClick:()=>Ce(Be=>({...Be,[T.scenario.id]:!Be[T.scenario.id]})),"aria-label":vt?"Collapse scenario details":"Expand scenario details",children:s.jsx(It,{className:`h-3.5 w-3.5 transition-transform ${vt?"rotate-180":""}`})}),T.kind==="referenced"&&s.jsx(s.Fragment,{children:s.jsx(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>ln(ne),disabled:Ge,children:"Convert to inline"})}),s.jsx(ae,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>Pt(ne),"aria-label":"Remove scenario entry",children:s.jsx(Yr,{className:"h-3.5 w-3.5"})})]})]}),T.kind==="inline"&&vt&&s.jsx("div",{className:"border-t px-3 py-3",children:s.jsx(fS,{scenarios:[T.scenario],scenarioOrigins:["inline"],agents:[...A.agents,...ti],servers:[...A.servers,...ei],configId:A.id,configPath:A.sourcePath,defaultAssistantAgentName:A.runDefaults?.selectedAgentNames?.[0],snapshotEval:A.snapshotEval,onChange:Be=>{const Ct=Be[0];if(!Ct)return;const Vt=[...Fe];Vt[ne]={kind:"inline",scenario:Ct},je(Vt)},readOnly:!1,allowAdd:!1,allowStructureEdits:!1})})]},`scenario-entry-${ne}-${T.kind==="inline"?T.scenario.id:T.ref}`)}),Fe.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No scenarios configured yet. Add inline scenarios or references."})]}),Sa.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing scenario refs: ",Sa.join(", ")]})]})}),xt?s.jsx(ze,{children:s.jsx(Ue,{className:"pt-4",children:s.jsx(fS,{scenarios:Ka.map(T=>T.scenario),scenarioOrigins:Ka.map(T=>T.origin),agents:Xc,servers:Yo,configId:A.id,configPath:A.sourcePath,defaultAssistantAgentName:A.runDefaults?.selectedAgentNames?.[0],snapshotEval:A.snapshotEval,onChange:()=>{},readOnly:!0})})}):null]})]})]})};var nme=Symbol("radix.slottable");function rme(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=nme,t}var m8="AlertDialog",[ame]=er(m8,[TD]),Js=TD(),v8=e=>{const{__scopeAlertDialog:t,...n}=e,r=Js(t);return s.jsx(Zm,{...r,...n,modal:!0})};v8.displayName=m8;var sme="AlertDialogTrigger",ime=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Js(n);return s.jsx(UK,{...a,...r,ref:t})});ime.displayName=sme;var ome="AlertDialogPortal",g8=e=>{const{__scopeAlertDialog:t,...n}=e,r=Js(t);return s.jsx(ev,{...r,...n})};g8.displayName=ome;var lme="AlertDialogOverlay",y8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Js(n);return s.jsx($c,{...a,...r,ref:t})});y8.displayName=lme;var Hl="AlertDialogContent",[cme,ume]=ame(Hl),dme=rme("AlertDialogContent"),x8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,i=Js(n),o=v.useRef(null),c=ft(t,o),d=v.useRef(null);return s.jsx(LK,{contentName:Hl,titleName:b8,docsSlug:"alert-dialog",children:s.jsx(cme,{scope:n,cancelRef:d,children:s.jsxs(Dc,{role:"alertdialog",...i,...a,ref:c,onOpenAutoFocus:Pe(a.onOpenAutoFocus,f=>{f.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[s.jsx(dme,{children:r}),s.jsx(pme,{contentRef:o})]})})})});x8.displayName=Hl;var b8="AlertDialogTitle",w8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Js(n);return s.jsx(sf,{...a,...r,ref:t})});w8.displayName=b8;var j8="AlertDialogDescription",S8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Js(n);return s.jsx(of,{...a,...r,ref:t})});S8.displayName=j8;var fme="AlertDialogAction",N8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=Js(n);return s.jsx(tv,{...a,...r,ref:t})});N8.displayName=fme;var C8="AlertDialogCancel",A8=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=ume(C8,n),i=Js(n),o=ft(t,a);return s.jsx(tv,{...i,...r,ref:o})});A8.displayName=C8;var pme=({contentRef:e})=>{const t=`\`${Hl}\` requires a description for the component to be accessible for screen reader users.
|
|
125
|
+
|
|
126
|
+
You can add a description to the \`${Hl}\` by passing a \`${j8}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
127
|
+
|
|
128
|
+
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Hl}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
129
|
+
|
|
130
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return v.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},hme=v8,mme=g8,E8=y8,_8=x8,P8=N8,O8=A8,k8=w8,R8=S8;const Zs=hme,vme=mme,T8=v.forwardRef(({className:e,...t},n)=>s.jsx(E8,{className:Se("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));T8.displayName=E8.displayName;const fs=v.forwardRef(({className:e,...t},n)=>s.jsxs(vme,{children:[s.jsx(T8,{}),s.jsx(_8,{ref:n,className:Se("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));fs.displayName=_8.displayName;const ps=({className:e,...t})=>s.jsx("div",{className:Se("flex flex-col space-y-2 text-center sm:text-left",e),...t});ps.displayName="AlertDialogHeader";const hs=({className:e,...t})=>s.jsx("div",{className:Se("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});hs.displayName="AlertDialogFooter";const ms=v.forwardRef(({className:e,...t},n)=>s.jsx(k8,{ref:n,className:Se("text-lg font-semibold",e),...t}));ms.displayName=k8.displayName;const vs=v.forwardRef(({className:e,...t},n)=>s.jsx(R8,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));vs.displayName=R8.displayName;const gs=v.forwardRef(({className:e,...t},n)=>s.jsx(P8,{ref:n,className:Se(qS(),e),...t}));gs.displayName=P8.displayName;const ys=v.forwardRef(({className:e,...t},n)=>s.jsx(O8,{ref:n,className:Se(qS({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));ys.displayName=O8.displayName;const gme=()=>{const{servers:e,setServers:t,reload:n,loading:r}=Va(),a=qa(),[i,o]=v.useState(null),c=p=>p.name?.trim()||p.id,d=async p=>{const g=`${c(p)}-copy`;let y=g,j=1;for(;e.some(x=>(x.name?.trim()||x.id)===y);)y=`${g}-${j}`,j+=1;const w={...structuredClone(p),id:`srv-${Date.now()}`,name:y};await t([...e,w]),Re({title:"Server duplicated",description:`Created ${y}.`})},f=async p=>{await t(e.filter(g=>g.id!==p.id)),Re({title:"Server deleted",description:`${c(p)} was removed.`}),o(null)},h=p=>p.transport==="stdio"?[p.command,...p.args||[]].filter(Boolean).join(" "):p.url||"";return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(r$,{className:"h-6 w-6"}),"Servers"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Reusable MCP server definitions shared across configurations."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[s.jsx(Ba,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(ae,{type:"button",size:"sm",onClick:()=>a("/libraries/servers/new"),children:[s.jsx(Fa,{className:"mr-2 h-4 w-4"}),"Add Server"]})]})]}),e.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed py-16 text-center",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"No servers configured. Add one to get started."}),s.jsxs(ae,{type:"button",size:"sm",className:"mt-4",onClick:()=>a("/libraries/servers/new"),children:[s.jsx(Fa,{className:"mr-2 h-4 w-4"}),"Add Server"]})]}):s.jsx(ze,{children:s.jsx(Ue,{className:"p-0",children:s.jsxs(Hr,{children:[s.jsx(Kr,{children:s.jsxs(zt,{children:[s.jsx(nt,{children:"Name"}),s.jsx(nt,{children:"Transport"}),s.jsx(nt,{children:"Endpoint"}),s.jsx(nt,{children:"Auth"}),s.jsx(nt,{className:"text-right",children:"Actions"})]})}),s.jsx(Gr,{children:e.map(p=>s.jsxs(zt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>a(`/libraries/servers/${encodeURIComponent(p.id)}`),children:[s.jsx(He,{className:"font-medium",children:c(p)}),s.jsx(He,{children:s.jsx(Ke,{variant:"secondary",className:"font-mono text-xs",children:p.transport})}),s.jsx(He,{children:s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:h(p)})}),s.jsx(He,{children:!p.authType||p.authType==="none"?s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"}):s.jsx(Ke,{variant:"outline",className:"text-xs",children:p.authType})}),s.jsx(He,{className:"text-right",onClick:g=>g.stopPropagation(),children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsxs(ae,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(p),children:[s.jsx(Yr,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{d(p)},children:[s.jsx(Ti,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>a(`/libraries/servers/${encodeURIComponent(p.id)}`),children:[s.jsx(km,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},p.id))})]})})}),s.jsx(Zs,{open:!!i,onOpenChange:p=>!p&&o(null),children:s.jsxs(fs,{children:[s.jsxs(ps,{children:[s.jsx(ms,{children:"Delete server?"}),s.jsxs(vs,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-mono",children:i?c(i):""})," from the library. This action cannot be undone."]})]}),s.jsxs(hs,{children:[s.jsx(ys,{children:"Cancel"}),s.jsx(gs,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&f(i)},children:"Delete Server"})]})]})})]})},aM={stdio:"Check that the command is installed and the args are correct",sse:"Check that the server is running and the URL is reachable","streamable-http":"Check that the server is running and the URL is reachable"},yme=()=>({id:`srv-${Date.now()}`,name:"",transport:"stdio",authType:"none",oauthRedirectUrl:"http://localhost:6274/oauth/"}),xme=()=>{const{serverId:e}=Ic(),t=qa(),{servers:n,setServers:r}=Va(),{source:a}=An(),i=e==="new",o=e?decodeURIComponent(e):"",c=i?null:n.find(R=>R.id===o||R.name===o),d=R=>R.name?.trim()||R.id,[f,h]=v.useState(()=>c??yme()),[p,g]=v.useState(!1),[y,j]=v.useState(!1),[w,x]=v.useState({status:"idle"}),[S,N]=v.useState(!1);v.useEffect(()=>{c&&h(c)},[c]);const A=R=>{h(D=>({...D,authType:R,...R!=="oauth2"?{oauthClientId:void 0,oauthClientSecret:void 0,oauthRedirectUrl:void 0,oauthScope:void 0}:{oauthRedirectUrl:D.oauthRedirectUrl||"http://localhost:6274/oauth/"}}))},P=async()=>{N(!0),x({status:"loading"});try{const D=(await a.discoverToolsForAnalysis({serverNames:[d(f)]})).servers[0];D&&D.warnings.length===0?x({status:"success",toolNames:D.tools.map(U=>U.name),toolCount:D.tools.length,testedAt:new Date().toISOString()}):x({status:"error",message:D?.warnings[0]??"Connection failed",testedAt:new Date().toISOString()})}catch(R){x({status:"error",message:R instanceof Error?R.message:String(R),testedAt:new Date().toISOString()})}},E=async()=>{if(!f.name.trim()){Re({title:"Name is required",variant:"destructive"});return}j(!0);try{if(i)await r([...n,f]),Re({title:"Server created"}),t(`/libraries/servers/${encodeURIComponent(f.id)}`);else{const R=n.map(D=>D.id===c?.id?f:D);await r(R),Re({title:"Server saved"}),f.id!==o&&t(`/libraries/servers/${encodeURIComponent(f.id)}`,{replace:!0})}}finally{j(!1)}},O=async()=>{const R=n.filter(D=>D.id!==c?.id);await r(R),Re({title:"Server deleted"}),t("/libraries/servers")},k=()=>f.transport==="stdio"?[f.command,...f.args||[]].filter(Boolean).join(" "):f.url||"";return!i&&!c?s.jsxs("div",{className:"space-y-4",children:[s.jsxs(yt,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(No,{className:"h-4 w-4"})," Servers"]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:['Server "',o,'" not found.']})]}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs(yt,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(No,{className:"h-4 w-4"})," Servers"]}),s.jsx("h1",{className:"text-2xl font-bold",children:i?"New Server":d(f)})]}),!i&&s.jsxs(ae,{type:"button",onClick:()=>{P()},children:[s.jsx(f$,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),S&&s.jsxs(ze,{children:[s.jsxs(At,{className:"flex-row items-center justify-between space-y-0",children:[s.jsx(Et,{className:"text-base",children:"Connection Test"}),s.jsx("button",{type:"button",onClick:()=>N(!1),className:"rounded-sm opacity-70 hover:opacity-100",children:s.jsx(Ii,{className:"h-4 w-4"})})]}),s.jsxs(Ue,{className:"space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground",children:[s.jsx("span",{children:"Server:"}),s.jsx("span",{className:"font-medium text-foreground",children:d(f)}),s.jsx("span",{className:"mx-1",children:"·"}),s.jsx("span",{children:"Transport:"}),s.jsx("span",{className:"font-medium text-foreground",children:f.transport}),k()&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"mx-1",children:"·"}),s.jsx("span",{children:"Endpoint:"}),s.jsx("code",{className:"font-mono text-xs",children:k()})]})]}),w.status==="loading"&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Zn,{className:"h-4 w-4 animate-spin"}),"Connecting to MCP server…"]}),w.status==="success"&&s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{className:"flex items-center gap-2 text-sm text-emerald-700",children:[s.jsx(Xl,{className:"h-4 w-4 shrink-0"}),"Connected — discovered ",w.toolCount," tool",w.toolCount!==1?"s":""]}),w.toolNames.length>0&&s.jsxs("div",{className:"rounded-md bg-muted p-3",children:[s.jsx("p",{className:"mb-1 text-xs font-medium text-muted-foreground",children:"First 5 tools:"}),s.jsx("ul",{className:"space-y-0.5",children:w.toolNames.slice(0,5).map(R=>s.jsx("li",{className:"font-mono text-xs",children:R},R))})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(w.testedAt).toLocaleString()]})]}),w.status==="error"&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("p",{className:"text-sm text-destructive",children:[s.jsx("span",{className:"font-medium",children:"✗ Connection failed"})," — ",w.message]}),aM[f.transport]&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",aM[f.transport]]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(w.testedAt).toLocaleString()]})]})]})]}),s.jsxs(ze,{children:[s.jsx(At,{children:s.jsx(Et,{className:"text-base",children:"Configuration"})}),s.jsxs(Ue,{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{children:"Name"}),s.jsx(it,{value:f.name,onChange:R=>h(D=>({...D,name:R.target.value})),placeholder:"e.g. Filesystem MCP"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{children:"Transport"}),s.jsxs(Kt,{value:f.transport,onValueChange:R=>h(D=>({...D,transport:R})),children:[s.jsx(Ut,{children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"stdio",children:"stdio"}),s.jsx(Je,{value:"sse",children:"SSE"}),s.jsx(Je,{value:"streamable-http",children:"Streamable HTTP"})]})]})]})]}),f.transport==="stdio"?s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{children:"Command"}),s.jsx(it,{value:f.command||"",onChange:R=>h(D=>({...D,command:R.target.value})),placeholder:"npx",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{children:"Args (comma-separated)"}),s.jsx(it,{value:(f.args||[]).join(", "),onChange:R=>h(D=>({...D,args:R.target.value.split(",").map(U=>U.trim()).filter(Boolean)})),placeholder:"-y, @mcp/server",className:"font-mono text-xs"})]})]}):s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{children:"URL"}),s.jsx(it,{value:f.url||"",onChange:R=>h(D=>({...D,url:R.target.value})),placeholder:"http://localhost:3001/sse",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{children:"Auth Type"}),s.jsxs(Kt,{value:f.authType||"none",onValueChange:R=>A(R),children:[s.jsx(Ut,{children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"none",children:"None"}),s.jsx(Je,{value:"bearer",children:"Bearer Token"}),s.jsx(Je,{value:"api-key",children:"API Key"}),s.jsx(Je,{value:"oauth2",children:"OAuth 2.0"})]})]})]}),f.authType&&f.authType!=="none"&&f.authType!=="oauth2"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{children:f.authType==="bearer"?"Token":"API Key"}),s.jsx(it,{type:"password",value:f.authValue||"",onChange:R=>h(D=>({...D,authValue:R.target.value})),placeholder:"••••••••",className:"font-mono text-xs"})]})]}),f.authType==="oauth2"&&s.jsxs("div",{className:"space-y-3 rounded-md border p-3",children:[s.jsx("div",{className:"text-xs font-medium text-muted-foreground",children:"OAuth 2.0 Flow"}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Client ID"}),s.jsx(it,{value:f.oauthClientId||"",onChange:R=>h(D=>({...D,oauthClientId:R.target.value})),placeholder:"your-client-id",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Client Secret (optional)"}),s.jsx(it,{type:"password",value:f.oauthClientSecret||"",onChange:R=>h(D=>({...D,oauthClientSecret:R.target.value})),placeholder:"••••••••",className:"font-mono text-xs"})]})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Redirect URL"}),s.jsx(it,{value:f.oauthRedirectUrl||"http://localhost:6274/oauth/",onChange:R=>h(D=>({...D,oauthRedirectUrl:R.target.value})),placeholder:"http://localhost:6274/oauth/",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Scope (space-separated)"}),s.jsx(it,{value:f.oauthScope||"",onChange:R=>h(D=>({...D,oauthScope:R.target.value})),placeholder:"openid profile mcp",className:"font-mono text-xs"})]})]})]}),s.jsxs("div",{className:"flex items-center justify-between pt-2",children:[s.jsx("div",{children:!i&&s.jsx(ae,{type:"button",variant:"destructive",size:"sm",onClick:()=>g(!0),children:"Delete"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ae,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/servers"),children:"Cancel"}),s.jsxs(ae,{type:"button",size:"sm",onClick:()=>{E()},disabled:y,children:[y&&s.jsx(Zn,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Server":"Save"]})]})]})]})]}),s.jsx(Zs,{open:p,onOpenChange:g,children:s.jsxs(fs,{children:[s.jsxs(ps,{children:[s.jsx(ms,{children:"Delete server?"}),s.jsxs(vs,{children:["This will permanently remove the server"," ",s.jsx("span",{className:"font-mono",children:f.name}),". This action cannot be undone."]})]}),s.jsxs(hs,{children:[s.jsx(ys,{children:"Cancel"}),s.jsx(gs,{onClick:()=>{O()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},bme=()=>{const{agents:e,setAgents:t,reload:n,loading:r}=Va(),a=qa(),[i,o]=v.useState(null),c=async f=>{const h=`${f.name}-copy`;let p=h,g=1;for(;e.some(j=>j.name===p);)p=`${h}-${g}`,g+=1;const y={...structuredClone(f),id:`agt-${Date.now()}`,name:p};await t([...e,y]),Re({title:"Agent duplicated",description:`Created ${p}.`})},d=async f=>{await t(e.filter(h=>h.id!==f.id)),Re({title:"Agent deleted",description:`${f.name} was removed.`}),o(null)};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(fa,{className:"h-6 w-6"}),"Agents"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Reusable agent profiles shared across configurations."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[s.jsx(Ba,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(ae,{type:"button",size:"sm",onClick:()=>a("/libraries/agents/new"),children:[s.jsx(Fa,{className:"mr-2 h-4 w-4"}),"Add Agent"]})]})]}),e.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed py-16 text-center",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents configured. Add one to get started."}),s.jsxs(ae,{type:"button",size:"sm",className:"mt-4",onClick:()=>a("/libraries/agents/new"),children:[s.jsx(Fa,{className:"mr-2 h-4 w-4"}),"Add Agent"]})]}):s.jsx(ze,{children:s.jsx(Ue,{className:"p-0",children:s.jsxs(Hr,{children:[s.jsx(Kr,{children:s.jsxs(zt,{children:[s.jsx(nt,{children:"Name"}),s.jsx(nt,{children:"Provider"}),s.jsx(nt,{children:"Model"}),s.jsx(nt,{children:"Max Tokens"}),s.jsx(nt,{children:"Temperature"}),s.jsx(nt,{className:"text-right",children:"Actions"})]})}),s.jsx(Gr,{children:e.map(f=>s.jsxs(zt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>a(`/libraries/agents/${encodeURIComponent(f.id)}`),children:[s.jsx(He,{className:"font-medium",children:f.name}),s.jsx(He,{children:s.jsx(lB,{provider:f.provider})}),s.jsx(He,{children:s.jsx("span",{className:"font-mono text-xs",children:f.model})}),s.jsx(He,{className:"font-mono text-xs",children:f.maxTokens}),s.jsx(He,{className:"font-mono text-xs",children:f.temperature.toFixed(2)}),s.jsx(He,{className:"text-right",onClick:h=>h.stopPropagation(),children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsxs(ae,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(f),children:[s.jsx(Yr,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{c(f)},children:[s.jsx(Ti,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>a(`/libraries/agents/${encodeURIComponent(f.id)}`),children:[s.jsx(km,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},f.id))})]})})}),s.jsx(Zs,{open:!!i,onOpenChange:f=>!f&&o(null),children:s.jsxs(fs,{children:[s.jsxs(ps,{children:[s.jsx(ms,{children:"Delete agent?"}),s.jsxs(vs,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-mono",children:i?.name})," from the library. This action cannot be undone."]})]}),s.jsxs(hs,{children:[s.jsx(ys,{children:"Cancel"}),s.jsx(gs,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&d(i)},children:"Delete Agent"})]})]})})]})};var I8=["PageUp","PageDown"],M8=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],$8={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Yc="Slider",[pS,wme,jme]=Jd(Yc),[D8]=er(Yc,[jme]),[Sme,eg]=D8(Yc),L8=v.forwardRef((e,t)=>{const{name:n,min:r=0,max:a=100,step:i=1,orientation:o="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:f=[r],value:h,onValueChange:p=()=>{},onValueCommit:g=()=>{},inverted:y=!1,form:j,...w}=e,x=v.useRef(new Set),S=v.useRef(0),A=o==="horizontal"?Nme:Cme,[P=[],E]=Zr({prop:h,defaultProp:f,onChange:z=>{[...x.current][S.current]?.focus(),p(z)}}),O=v.useRef(P);function k(z){const L=Ome(P,z);U(z,L)}function R(z){U(z,S.current)}function D(){const z=O.current[S.current];P[S.current]!==z&&g(P)}function U(z,L,{commit:G}={commit:!1}){const q=Ime(i),H=Mme(Math.round((z-r)/i)*i+r,q),X=Qd(H,[r,a]);E((Z=[])=>{const I=_me(Z,X,L);if(Tme(I,d*i)){S.current=I.indexOf(X);const F=String(I)!==String(Z);return F&&G&&g(I),F?I:Z}else return Z})}return s.jsx(Sme,{scope:e.__scopeSlider,name:n,disabled:c,min:r,max:a,valueIndexToChangeRef:S,thumbs:x.current,values:P,orientation:o,form:j,children:s.jsx(pS.Provider,{scope:e.__scopeSlider,children:s.jsx(pS.Slot,{scope:e.__scopeSlider,children:s.jsx(A,{"aria-disabled":c,"data-disabled":c?"":void 0,...w,ref:t,onPointerDown:Pe(w.onPointerDown,()=>{c||(O.current=P)}),min:r,max:a,inverted:y,onSlideStart:c?void 0:k,onSlideMove:c?void 0:R,onSlideEnd:c?void 0:D,onHomeKeyDown:()=>!c&&U(r,0,{commit:!0}),onEndKeyDown:()=>!c&&U(a,P.length-1,{commit:!0}),onStepKeyDown:({event:z,direction:L})=>{if(!c){const H=I8.includes(z.key)||z.shiftKey&&M8.includes(z.key)?10:1,X=S.current,Z=P[X],I=i*H*L;U(Z+I,X,{commit:!0})}}})})})})});L8.displayName=Yc;var[F8,B8]=D8(Yc,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Nme=v.forwardRef((e,t)=>{const{min:n,max:r,dir:a,inverted:i,onSlideStart:o,onSlideMove:c,onSlideEnd:d,onStepKeyDown:f,...h}=e,[p,g]=v.useState(null),y=ft(t,A=>g(A)),j=v.useRef(void 0),w=Vc(a),x=w==="ltr",S=x&&!i||!x&&i;function N(A){const P=j.current||p.getBoundingClientRect(),E=[0,P.width],k=fC(E,S?[n,r]:[r,n]);return j.current=P,k(A-P.left)}return s.jsx(F8,{scope:e.__scopeSlider,startEdge:S?"left":"right",endEdge:S?"right":"left",direction:S?1:-1,size:"width",children:s.jsx(z8,{dir:w,"data-orientation":"horizontal",...h,ref:y,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:A=>{const P=N(A.clientX);o?.(P)},onSlideMove:A=>{const P=N(A.clientX);c?.(P)},onSlideEnd:()=>{j.current=void 0,d?.()},onStepKeyDown:A=>{const E=$8[S?"from-left":"from-right"].includes(A.key);f?.({event:A,direction:E?-1:1})}})})}),Cme=v.forwardRef((e,t)=>{const{min:n,max:r,inverted:a,onSlideStart:i,onSlideMove:o,onSlideEnd:c,onStepKeyDown:d,...f}=e,h=v.useRef(null),p=ft(t,h),g=v.useRef(void 0),y=!a;function j(w){const x=g.current||h.current.getBoundingClientRect(),S=[0,x.height],A=fC(S,y?[r,n]:[n,r]);return g.current=x,A(w-x.top)}return s.jsx(F8,{scope:e.__scopeSlider,startEdge:y?"bottom":"top",endEdge:y?"top":"bottom",size:"height",direction:y?1:-1,children:s.jsx(z8,{"data-orientation":"vertical",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const x=j(w.clientY);i?.(x)},onSlideMove:w=>{const x=j(w.clientY);o?.(x)},onSlideEnd:()=>{g.current=void 0,c?.()},onStepKeyDown:w=>{const S=$8[y?"from-bottom":"from-top"].includes(w.key);d?.({event:w,direction:S?-1:1})}})})}),z8=v.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:a,onSlideEnd:i,onHomeKeyDown:o,onEndKeyDown:c,onStepKeyDown:d,...f}=e,h=eg(Yc,n);return s.jsx(qe.span,{...f,ref:t,onKeyDown:Pe(e.onKeyDown,p=>{p.key==="Home"?(o(p),p.preventDefault()):p.key==="End"?(c(p),p.preventDefault()):I8.concat(M8).includes(p.key)&&(d(p),p.preventDefault())}),onPointerDown:Pe(e.onPointerDown,p=>{const g=p.target;g.setPointerCapture(p.pointerId),p.preventDefault(),h.thumbs.has(g)?g.focus():r(p)}),onPointerMove:Pe(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&a(p)}),onPointerUp:Pe(e.onPointerUp,p=>{const g=p.target;g.hasPointerCapture(p.pointerId)&&(g.releasePointerCapture(p.pointerId),i(p))})})}),U8="SliderTrack",q8=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=eg(U8,n);return s.jsx(qe.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...r,ref:t})});q8.displayName=U8;var hS="SliderRange",W8=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=eg(hS,n),i=B8(hS,n),o=v.useRef(null),c=ft(t,o),d=a.values.length,f=a.values.map(g=>K8(g,a.min,a.max)),h=d>1?Math.min(...f):0,p=100-Math.max(...f);return s.jsx(qe.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...r,ref:c,style:{...e.style,[i.startEdge]:h+"%",[i.endEdge]:p+"%"}})});W8.displayName=hS;var mS="SliderThumb",V8=v.forwardRef((e,t)=>{const n=wme(e.__scopeSlider),[r,a]=v.useState(null),i=ft(t,c=>a(c)),o=v.useMemo(()=>r?n().findIndex(c=>c.ref.current===r):-1,[n,r]);return s.jsx(Ame,{...e,ref:i,index:o})}),Ame=v.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:a,...i}=e,o=eg(mS,n),c=B8(mS,n),[d,f]=v.useState(null),h=ft(t,N=>f(N)),p=d?o.form||!!d.closest("form"):!0,g=$m(d),y=o.values[r],j=y===void 0?0:K8(y,o.min,o.max),w=Pme(r,o.values.length),x=g?.[c.size],S=x?kme(x,j,c.direction):0;return v.useEffect(()=>{if(d)return o.thumbs.add(d),()=>{o.thumbs.delete(d)}},[d,o.thumbs]),s.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${j}% + ${S}px)`},children:[s.jsx(pS.ItemSlot,{scope:e.__scopeSlider,children:s.jsx(qe.span,{role:"slider","aria-label":e["aria-label"]||w,"aria-valuemin":o.min,"aria-valuenow":y,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...i,ref:h,style:y===void 0?{display:"none"}:e.style,onFocus:Pe(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),p&&s.jsx(H8,{name:a??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:y},r)]})});V8.displayName=mS;var Eme="RadioBubbleInput",H8=v.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const a=v.useRef(null),i=ft(a,r),o=Wv(t);return v.useEffect(()=>{const c=a.current;if(!c)return;const d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"value").set;if(o!==t&&h){const p=new Event("input",{bubbles:!0});h.call(c,t),c.dispatchEvent(p)}},[o,t]),s.jsx(qe.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});H8.displayName=Eme;function _me(e=[],t,n){const r=[...e];return r[n]=t,r.sort((a,i)=>a-i)}function K8(e,t,n){const i=100/(n-t)*(e-t);return Qd(i,[0,100])}function Pme(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Ome(e,t){if(e.length===1)return 0;const n=e.map(a=>Math.abs(a-t)),r=Math.min(...n);return n.indexOf(r)}function kme(e,t,n){const r=e/2,i=fC([0,50],[0,r]);return(r-i(t)*n)*n}function Rme(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Tme(e,t){if(t>0){const n=Rme(e);return Math.min(...n)>=t}return!0}function fC(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Ime(e){return(String(e).split(".")[1]||"").length}function Mme(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var G8=L8,$me=q8,Dme=W8,Lme=V8;const Y8=v.forwardRef(({className:e,...t},n)=>s.jsxs(G8,{ref:n,className:Se("relative flex w-full touch-none select-none items-center",e),...t,children:[s.jsx($me,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:s.jsx(Dme,{className:"absolute h-full bg-primary"})}),s.jsx(Lme,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));Y8.displayName=G8.displayName;function Fme(e){const t=Bme(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(Ume);if(d){const f=d.props.children,h=c.map(p=>p===d?v.Children.count(f)>1?v.Children.only(null):v.isValidElement(f)?f.props.children:null:p);return s.jsx(t,{...o,ref:a,children:v.isValidElement(f)?v.cloneElement(f,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}function Bme(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=Wme(a),c=qme(i,a.props);return a.type!==v.Fragment&&(c.ref=r?vr(r,o):o),v.cloneElement(a,c)}return v.Children.count(a)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zme=Symbol("radix.slottable");function Ume(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zme}function qme(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...c)=>{const d=i(...c);return a(...c),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function Wme(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var tg="Popover",[X8]=er(tg,[Li]),Sf=Li(),[Vme,Ki]=X8(tg),Q8=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,c=Sf(t),d=v.useRef(null),[f,h]=v.useState(!1),[p,g]=Zr({prop:r,defaultProp:a??!1,onChange:i,caller:tg});return s.jsx(Dm,{...c,children:s.jsx(Vme,{scope:t,contentId:Bn(),triggerRef:d,open:p,onOpenChange:g,onOpenToggle:v.useCallback(()=>g(y=>!y),[g]),hasCustomAnchor:f,onCustomAnchorAdd:v.useCallback(()=>h(!0),[]),onCustomAnchorRemove:v.useCallback(()=>h(!1),[]),modal:o,children:n})})};Q8.displayName=tg;var J8="PopoverAnchor",Hme=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Ki(J8,n),i=Sf(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:c}=a;return v.useEffect(()=>(o(),()=>c()),[o,c]),s.jsx(tf,{...i,...r,ref:t})});Hme.displayName=J8;var Z8="PopoverTrigger",ez=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Ki(Z8,n),i=Sf(n),o=ft(t,a.triggerRef),c=s.jsx(qe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":sz(a.open),...r,ref:o,onClick:Pe(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:s.jsx(tf,{asChild:!0,...i,children:c})});ez.displayName=Z8;var pC="PopoverPortal",[Kme,Gme]=X8(pC,{forceMount:void 0}),tz=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=Ki(pC,t);return s.jsx(Kme,{scope:t,forceMount:n,children:s.jsx(Un,{present:n||i.open,children:s.jsx(Pc,{asChild:!0,container:a,children:r})})})};tz.displayName=pC;var Ec="PopoverContent",nz=v.forwardRef((e,t)=>{const n=Gme(Ec,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=Ki(Ec,e.__scopePopover);return s.jsx(Un,{present:r||i.open,children:i.modal?s.jsx(Xme,{...a,ref:t}):s.jsx(Qme,{...a,ref:t})})});nz.displayName=Ec;var Yme=Fme("PopoverContent.RemoveScroll"),Xme=v.forwardRef((e,t)=>{const n=Ki(Ec,e.__scopePopover),r=v.useRef(null),a=ft(t,r),i=v.useRef(!1);return v.useEffect(()=>{const o=r.current;if(o)return Qm(o)},[]),s.jsx(af,{as:Yme,allowPinchZoom:!0,children:s.jsx(rz,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pe(e.onCloseAutoFocus,o=>{o.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Pe(e.onPointerDownOutside,o=>{const c=o.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,f=c.button===2||d;i.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:Pe(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),Qme=v.forwardRef((e,t)=>{const n=Ki(Ec,e.__scopePopover),r=v.useRef(!1),a=v.useRef(!1);return s.jsx(rz,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(r.current||n.triggerRef.current?.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;n.triggerRef.current?.contains(o)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),rz=v.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,...p}=e,g=Ki(Ec,n),y=Sf(n);return Ym(),s.jsx(rf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Do,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>g.onOpenChange(!1),children:s.jsx(Lm,{"data-state":sz(g.open),role:"dialog",id:g.contentId,...y,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),az="PopoverClose",Jme=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Ki(az,n);return s.jsx(qe.button,{type:"button",...r,ref:t,onClick:Pe(e.onClick,()=>a.onOpenChange(!1))})});Jme.displayName=az;var Zme="PopoverArrow",eve=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Sf(n);return s.jsx(Fm,{...a,...r,ref:t})});eve.displayName=Zme;function sz(e){return e?"open":"closed"}var tve=Q8,nve=ez,rve=tz,iz=nz;const ave=tve,sve=nve,oz=v.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>s.jsx(rve,{children:s.jsx(iz,{ref:a,align:t,sideOffset:n,className:Se("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));oz.displayName=iz.displayName;var sM=1,ive=.9,ove=.8,lve=.17,o1=.1,l1=.999,cve=.9999,uve=.99,dve=/[\\\/_+.#"@\[\(\{&]/,fve=/[\\\/_+.#"@\[\(\{&]/g,pve=/[\s-]/,lz=/[\s-]/g;function vS(e,t,n,r,a,i,o){if(i===t.length)return a===e.length?sM:uve;var c=`${a},${i}`;if(o[c]!==void 0)return o[c];for(var d=r.charAt(i),f=n.indexOf(d,a),h=0,p,g,y,j;f>=0;)p=vS(e,t,n,r,f+1,i+1,o),p>h&&(f===a?p*=sM:dve.test(e.charAt(f-1))?(p*=ove,y=e.slice(a,f-1).match(fve),y&&a>0&&(p*=Math.pow(l1,y.length))):pve.test(e.charAt(f-1))?(p*=ive,j=e.slice(a,f-1).match(lz),j&&a>0&&(p*=Math.pow(l1,j.length))):(p*=lve,a>0&&(p*=Math.pow(l1,f-a))),e.charAt(f)!==t.charAt(i)&&(p*=cve)),(p<o1&&n.charAt(f-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(f-1)!==r.charAt(i))&&(g=vS(e,t,n,r,f+1,i+2,o),g*o1>p&&(p=g*o1)),p>h&&(h=p),f=n.indexOf(d,f+1);return o[c]=h,h}function iM(e){return e.toLowerCase().replace(lz," ")}function hve(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,vS(e,t,iM(e),iM(t),0,0,{})}var Wu='[cmdk-group=""]',c1='[cmdk-group-items=""]',mve='[cmdk-group-heading=""]',cz='[cmdk-item=""]',oM=`${cz}:not([aria-disabled="true"])`,gS="cmdk-item-select",_l="data-value",vve=(e,t,n)=>hve(e,t,n),uz=v.createContext(void 0),Nf=()=>v.useContext(uz),dz=v.createContext(void 0),hC=()=>v.useContext(dz),fz=v.createContext(void 0),pz=v.forwardRef((e,t)=>{let n=Pl(()=>{var $,ee;return{search:"",value:(ee=($=e.value)!=null?$:e.defaultValue)!=null?ee:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Pl(()=>new Set),a=Pl(()=>new Map),i=Pl(()=>new Map),o=Pl(()=>new Set),c=hz(e),{label:d,children:f,value:h,onValueChange:p,filter:g,shouldFilter:y,loop:j,disablePointerSelection:w=!1,vimBindings:x=!0,...S}=e,N=Bn(),A=Bn(),P=Bn(),E=v.useRef(null),O=Eve();$o(()=>{if(h!==void 0){let $=h.trim();n.current.value=$,k.emit()}},[h]),$o(()=>{O(6,G)},[]);let k=v.useMemo(()=>({subscribe:$=>(o.current.add($),()=>o.current.delete($)),snapshot:()=>n.current,setState:($,ee,V)=>{var J,ge,ie,ce;if(!Object.is(n.current[$],ee)){if(n.current[$]=ee,$==="search")L(),U(),O(1,z);else if($==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let oe=document.getElementById(P);oe?oe.focus():(J=document.getElementById(N))==null||J.focus()}if(O(7,()=>{var oe;n.current.selectedItemId=(oe=q())==null?void 0:oe.id,k.emit()}),V||O(5,G),((ge=c.current)==null?void 0:ge.value)!==void 0){let oe=ee??"";(ce=(ie=c.current).onValueChange)==null||ce.call(ie,oe);return}}k.emit()}},emit:()=>{o.current.forEach($=>$())}}),[]),R=v.useMemo(()=>({value:($,ee,V)=>{var J;ee!==((J=i.current.get($))==null?void 0:J.value)&&(i.current.set($,{value:ee,keywords:V}),n.current.filtered.items.set($,D(ee,V)),O(2,()=>{U(),k.emit()}))},item:($,ee)=>(r.current.add($),ee&&(a.current.has(ee)?a.current.get(ee).add($):a.current.set(ee,new Set([$]))),O(3,()=>{L(),U(),n.current.value||z(),k.emit()}),()=>{i.current.delete($),r.current.delete($),n.current.filtered.items.delete($);let V=q();O(4,()=>{L(),V?.getAttribute("id")===$&&z(),k.emit()})}),group:$=>(a.current.has($)||a.current.set($,new Set),()=>{i.current.delete($),a.current.delete($)}),filter:()=>c.current.shouldFilter,label:d||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:N,inputId:P,labelId:A,listInnerRef:E}),[]);function D($,ee){var V,J;let ge=(J=(V=c.current)==null?void 0:V.filter)!=null?J:vve;return $?ge($,n.current.search,ee):0}function U(){if(!n.current.search||c.current.shouldFilter===!1)return;let $=n.current.filtered.items,ee=[];n.current.filtered.groups.forEach(J=>{let ge=a.current.get(J),ie=0;ge.forEach(ce=>{let oe=$.get(ce);ie=Math.max(oe,ie)}),ee.push([J,ie])});let V=E.current;H().sort((J,ge)=>{var ie,ce;let oe=J.getAttribute("id"),xe=ge.getAttribute("id");return((ie=$.get(xe))!=null?ie:0)-((ce=$.get(oe))!=null?ce:0)}).forEach(J=>{let ge=J.closest(c1);ge?ge.appendChild(J.parentElement===ge?J:J.closest(`${c1} > *`)):V.appendChild(J.parentElement===V?J:J.closest(`${c1} > *`))}),ee.sort((J,ge)=>ge[1]-J[1]).forEach(J=>{var ge;let ie=(ge=E.current)==null?void 0:ge.querySelector(`${Wu}[${_l}="${encodeURIComponent(J[0])}"]`);ie?.parentElement.appendChild(ie)})}function z(){let $=H().find(V=>V.getAttribute("aria-disabled")!=="true"),ee=$?.getAttribute(_l);k.setState("value",ee||void 0)}function L(){var $,ee,V,J;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ge=0;for(let ie of r.current){let ce=(ee=($=i.current.get(ie))==null?void 0:$.value)!=null?ee:"",oe=(J=(V=i.current.get(ie))==null?void 0:V.keywords)!=null?J:[],xe=D(ce,oe);n.current.filtered.items.set(ie,xe),xe>0&&ge++}for(let[ie,ce]of a.current)for(let oe of ce)if(n.current.filtered.items.get(oe)>0){n.current.filtered.groups.add(ie);break}n.current.filtered.count=ge}function G(){var $,ee,V;let J=q();J&&((($=J.parentElement)==null?void 0:$.firstChild)===J&&((V=(ee=J.closest(Wu))==null?void 0:ee.querySelector(mve))==null||V.scrollIntoView({block:"nearest"})),J.scrollIntoView({block:"nearest"}))}function q(){var $;return($=E.current)==null?void 0:$.querySelector(`${cz}[aria-selected="true"]`)}function H(){var $;return Array.from((($=E.current)==null?void 0:$.querySelectorAll(oM))||[])}function X($){let ee=H()[$];ee&&k.setState("value",ee.getAttribute(_l))}function Z($){var ee;let V=q(),J=H(),ge=J.findIndex(ce=>ce===V),ie=J[ge+$];(ee=c.current)!=null&&ee.loop&&(ie=ge+$<0?J[J.length-1]:ge+$===J.length?J[0]:J[ge+$]),ie&&k.setState("value",ie.getAttribute(_l))}function I($){let ee=q(),V=ee?.closest(Wu),J;for(;V&&!J;)V=$>0?Cve(V,Wu):Ave(V,Wu),J=V?.querySelector(oM);J?k.setState("value",J.getAttribute(_l)):Z($)}let F=()=>X(H().length-1),Q=$=>{$.preventDefault(),$.metaKey?F():$.altKey?I(1):Z(1)},B=$=>{$.preventDefault(),$.metaKey?X(0):$.altKey?I(-1):Z(-1)};return v.createElement(qe.div,{ref:t,tabIndex:-1,...S,"cmdk-root":"",onKeyDown:$=>{var ee;(ee=S.onKeyDown)==null||ee.call(S,$);let V=$.nativeEvent.isComposing||$.keyCode===229;if(!($.defaultPrevented||V))switch($.key){case"n":case"j":{x&&$.ctrlKey&&Q($);break}case"ArrowDown":{Q($);break}case"p":case"k":{x&&$.ctrlKey&&B($);break}case"ArrowUp":{B($);break}case"Home":{$.preventDefault(),X(0);break}case"End":{$.preventDefault(),F();break}case"Enter":{$.preventDefault();let J=q();if(J){let ge=new Event(gS);J.dispatchEvent(ge)}}}}},v.createElement("label",{"cmdk-label":"",htmlFor:R.inputId,id:R.labelId,style:Pve},d),ng(e,$=>v.createElement(dz.Provider,{value:k},v.createElement(uz.Provider,{value:R},$))))}),gve=v.forwardRef((e,t)=>{var n,r;let a=Bn(),i=v.useRef(null),o=v.useContext(fz),c=Nf(),d=hz(e),f=(r=(n=d.current)==null?void 0:n.forceMount)!=null?r:o?.forceMount;$o(()=>{if(!f)return c.item(a,o?.id)},[f]);let h=mz(a,i,[e.value,e.children,i],e.keywords),p=hC(),g=Di(O=>O.value&&O.value===h.current),y=Di(O=>f||c.filter()===!1?!0:O.search?O.filtered.items.get(a)>0:!0);v.useEffect(()=>{let O=i.current;if(!(!O||e.disabled))return O.addEventListener(gS,j),()=>O.removeEventListener(gS,j)},[y,e.onSelect,e.disabled]);function j(){var O,k;w(),(k=(O=d.current).onSelect)==null||k.call(O,h.current)}function w(){p.setState("value",h.current,!0)}if(!y)return null;let{disabled:x,value:S,onSelect:N,forceMount:A,keywords:P,...E}=e;return v.createElement(qe.div,{ref:vr(i,t),...E,id:a,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!g,"data-disabled":!!x,"data-selected":!!g,onPointerMove:x||c.getDisablePointerSelection()?void 0:w,onClick:x?void 0:j},e.children)}),yve=v.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...i}=e,o=Bn(),c=v.useRef(null),d=v.useRef(null),f=Bn(),h=Nf(),p=Di(y=>a||h.filter()===!1?!0:y.search?y.filtered.groups.has(o):!0);$o(()=>h.group(o),[]),mz(o,c,[e.value,e.heading,d]);let g=v.useMemo(()=>({id:o,forceMount:a}),[a]);return v.createElement(qe.div,{ref:vr(c,t),...i,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&v.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),ng(e,y=>v.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},v.createElement(fz.Provider,{value:g},y))))}),xve=v.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=v.useRef(null),i=Di(o=>!o.search);return!n&&!i?null:v.createElement(qe.div,{ref:vr(a,t),...r,"cmdk-separator":"",role:"separator"})}),bve=v.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,i=hC(),o=Di(f=>f.search),c=Di(f=>f.selectedItemId),d=Nf();return v.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),v.createElement(qe.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":d.listId,"aria-labelledby":d.labelId,"aria-activedescendant":c,id:d.inputId,type:"text",value:a?e.value:o,onChange:f=>{a||i.setState("search",f.target.value),n?.(f.target.value)}})}),wve=v.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,i=v.useRef(null),o=v.useRef(null),c=Di(f=>f.selectedItemId),d=Nf();return v.useEffect(()=>{if(o.current&&i.current){let f=o.current,h=i.current,p,g=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let y=f.offsetHeight;h.style.setProperty("--cmdk-list-height",y.toFixed(1)+"px")})});return g.observe(f),()=>{cancelAnimationFrame(p),g.unobserve(f)}}},[]),v.createElement(qe.div,{ref:vr(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:d.listId},ng(e,f=>v.createElement("div",{ref:vr(o,d.listInnerRef),"cmdk-list-sizer":""},f)))}),jve=v.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:i,container:o,...c}=e;return v.createElement(Zm,{open:n,onOpenChange:r},v.createElement(ev,{container:o},v.createElement($c,{"cmdk-overlay":"",className:a}),v.createElement(Dc,{"aria-label":e.label,"cmdk-dialog":"",className:i},v.createElement(pz,{ref:t,...c}))))}),Sve=v.forwardRef((e,t)=>Di(n=>n.filtered.count===0)?v.createElement(qe.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Nve=v.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...i}=e;return v.createElement(qe.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},ng(e,o=>v.createElement("div",{"aria-hidden":!0},o)))}),Pr=Object.assign(pz,{List:wve,Item:gve,Input:bve,Group:yve,Separator:xve,Dialog:jve,Empty:Sve,Loading:Nve});function Cve(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Ave(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function hz(e){let t=v.useRef(e);return $o(()=>{t.current=e}),t}var $o=typeof window>"u"?v.useEffect:v.useLayoutEffect;function Pl(e){let t=v.useRef();return t.current===void 0&&(t.current=e()),t}function Di(e){let t=hC(),n=()=>e(t.snapshot());return v.useSyncExternalStore(t.subscribe,n,n)}function mz(e,t,n,r=[]){let a=v.useRef(),i=Nf();return $o(()=>{var o;let c=(()=>{var f;for(let h of n){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(f=h.current.textContent)==null?void 0:f.trim():a.current}})(),d=r.map(f=>f.trim());i.value(e,c,d),(o=t.current)==null||o.setAttribute(_l,c),a.current=c}),a}var Eve=()=>{let[e,t]=v.useState(),n=Pl(()=>new Map);return $o(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function _ve(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function ng({asChild:e,children:t},n){return e&&v.isValidElement(t)?v.cloneElement(_ve(t),{ref:t.ref},n(t.props.children)):n(t)}var Pve={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const vz=v.forwardRef(({className:e,...t},n)=>s.jsx(Pr,{ref:n,className:Se("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));vz.displayName=Pr.displayName;const gz=v.forwardRef(({className:e,...t},n)=>s.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[s.jsx(AS,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),s.jsx(Pr.Input,{ref:n,className:Se("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));gz.displayName=Pr.Input.displayName;const yz=v.forwardRef(({className:e,...t},n)=>s.jsx(Pr.List,{ref:n,className:Se("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));yz.displayName=Pr.List.displayName;const xz=v.forwardRef((e,t)=>s.jsx(Pr.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));xz.displayName=Pr.Empty.displayName;const bz=v.forwardRef(({className:e,...t},n)=>s.jsx(Pr.Group,{ref:n,className:Se("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));bz.displayName=Pr.Group.displayName;const Ove=v.forwardRef(({className:e,...t},n)=>s.jsx(Pr.Separator,{ref:n,className:Se("-mx-1 h-px bg-border",e),...t}));Ove.displayName=Pr.Separator.displayName;const yS=v.forwardRef(({className:e,...t},n)=>s.jsx(Pr.Item,{ref:n,className:Se("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...t}));yS.displayName=Pr.Item.displayName;const lM={openai:["gpt-4o","gpt-4o-mini","gpt-4-turbo","o1","o1-mini"],anthropic:["claude-3-5-sonnet-latest","claude-3-5-haiku-latest","claude-3-opus-latest"],azure:["gpt-4o","gpt-4-turbo"],google:["gemini-2.0-flash","gemini-1.5-pro"],custom:[]},cM={anthropic:"Check that `ANTHROPIC_API_KEY` is set in your environment",openai:"Check that `OPENAI_API_KEY` is set in your environment",azure:"Check that Azure OpenAI env vars are configured in your environment"},kve=()=>({id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096}),Rve=()=>{const{agentName:e}=Ic(),t=qa(),{agents:n,setAgents:r}=Va(),{source:a}=An(),i=e==="new",o=e?decodeURIComponent(e):"",c=i?null:n.find(I=>I.id===o)??n.find(I=>I.name===o),[d,f]=v.useState(()=>c??kve()),[h,p]=v.useState(!1),[g,y]=v.useState(!1),[j,w]=v.useState({status:"idle"}),[x,S]=v.useState(!1),[N,A]=v.useState([]),[P,E]=v.useState(!1),[O,k]=v.useState(!1),[R,D]=v.useState(!1);v.useEffect(()=>{c&&f(c)},[c]);const U=d.provider==="anthropic"||d.provider==="openai"||d.provider==="azure",z=Array.from(new Set([...lM[d.provider]||[],...N])),L=z.includes(d.model),G=R||!!d.model&&!L,q=async()=>{if(S(!0),d.provider==="google"||d.provider==="custom"){w({status:"unsupported"});return}w({status:"loading"});try{const I=await a.listProviderModels(d.provider);w({status:"success",items:I.items,source:I.source,kind:I.kind,testedAt:new Date().toISOString()})}catch(I){w({status:"error",message:I instanceof Error?I.message:String(I),testedAt:new Date().toISOString()})}},H=async()=>{if(!U){Re({title:"Provider discovery not supported",description:"Model discovery is available for Anthropic, OpenAI, and Azure OpenAI."});return}E(!0);try{const I=await a.listProviderModels(d.provider);A(I.items),Re({title:I.kind==="deployments"?"Deployments loaded":"Models loaded",description:`${I.items.length} ${I.kind} from ${I.source}`})}catch(I){Re({title:"Could not load provider models",description:String(I instanceof Error?I.message:I),variant:"destructive"})}finally{E(!1)}},X=async()=>{if(!d.name.trim()){Re({title:"Name is required",variant:"destructive"});return}y(!0);try{if(i)await r([...n,d]),Re({title:"Agent created"}),t(`/libraries/agents/${encodeURIComponent(d.id)}`);else{const I=n.map(F=>F.id===c?.id?d:F);await r(I),Re({title:"Agent saved"}),d.id!==o&&t(`/libraries/agents/${encodeURIComponent(d.id)}`,{replace:!0})}}finally{y(!1)}},Z=async()=>{const I=n.filter(F=>F.id!==c?.id);await r(I),Re({title:"Agent deleted"}),t("/libraries/agents")};return!i&&!c?s.jsxs("div",{className:"space-y-4",children:[s.jsxs(yt,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(No,{className:"h-4 w-4"})," Agents"]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:['Agent "',o,'" not found.']})]}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs(yt,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(No,{className:"h-4 w-4"})," Agents"]}),s.jsx("h1",{className:"text-2xl font-bold",children:i?"New Agent":d.name})]}),!i&&s.jsxs(ae,{type:"button",onClick:()=>{q()},children:[s.jsx(f$,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),x&&s.jsxs(ze,{children:[s.jsxs(At,{className:"flex-row items-center justify-between space-y-0",children:[s.jsx(Et,{className:"text-base",children:"Connection Test"}),s.jsx("button",{type:"button",onClick:()=>S(!1),className:"rounded-sm opacity-70 hover:opacity-100",children:s.jsx(Ii,{className:"h-4 w-4"})})]}),s.jsxs(Ue,{className:"space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground",children:[s.jsx("span",{children:"Provider:"}),s.jsx("span",{className:"font-medium text-foreground",children:d.provider}),s.jsx("span",{className:"mx-1",children:"·"}),s.jsx("span",{children:"Endpoint:"}),s.jsxs("code",{className:"font-mono text-xs",children:["/api/providers/models?provider=",d.provider]})]}),j.status==="loading"&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Zn,{className:"h-4 w-4 animate-spin"}),"Testing connection..."]}),j.status==="success"&&s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{className:"flex items-center gap-2 text-sm text-emerald-700",children:[s.jsx(Xl,{className:"h-4 w-4 shrink-0"}),"Connected — discovered ",j.items.length," ",j.kind," from"," ",j.source]}),s.jsxs("div",{className:"rounded-md bg-muted p-3",children:[s.jsxs("p",{className:"mb-1 text-xs font-medium text-muted-foreground",children:["First 5 ",j.kind,":"]}),s.jsx("ul",{className:"space-y-0.5",children:j.items.slice(0,5).map(I=>s.jsx("li",{className:"font-mono text-xs",children:I},I))})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(j.testedAt).toLocaleString()]})]}),j.status==="error"&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("p",{className:"text-sm text-destructive",children:[s.jsx("span",{className:"font-medium",children:"✗ Connection failed"})," —"," ",j.message]}),cM[d.provider]&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",cM[d.provider]]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(j.testedAt).toLocaleString()]})]}),j.status==="unsupported"&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-sm text-muted-foreground",children:["Connection testing is not supported for the"," ",s.jsx("span",{className:"font-medium",children:d.provider})," provider. Supported providers: Anthropic, OpenAI, Azure OpenAI."]})]})]}),s.jsxs(ze,{children:[s.jsx(At,{children:s.jsx(Et,{className:"text-base",children:"Configuration"})}),s.jsxs(Ue,{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{children:"Name"}),s.jsx(it,{value:d.name,onChange:I=>f(F=>({...F,name:I.target.value})),placeholder:"e.g. GPT-4o"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{children:"Provider"}),s.jsxs(Kt,{value:d.provider,onValueChange:I=>f(F=>({...F,provider:I,model:lM[I]?.[0]||""})),children:[s.jsx(Ut,{children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"openai",children:"OpenAI"}),s.jsx(Je,{value:"anthropic",children:"Anthropic"}),s.jsx(Je,{value:"azure",children:"Azure OpenAI"}),s.jsx(Je,{value:"google",children:"Google"}),s.jsx(Je,{value:"custom",children:"Custom"})]})]})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{children:d.provider==="azure"?"Deployment":"Model"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(ave,{open:O,onOpenChange:k,children:[s.jsx(sve,{asChild:!0,children:s.jsxs(ae,{type:"button",variant:"outline",role:"combobox","aria-expanded":O,className:"h-9 flex-1 justify-between font-mono text-xs",children:[s.jsx("span",{className:"truncate text-left",children:d.model||"Select model..."}),s.jsx(It,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(oz,{className:"w-[420px] p-0",align:"start",children:s.jsxs(vz,{children:[s.jsx(gz,{placeholder:`Search ${d.provider==="azure"?"deployments":"models"}...`}),s.jsxs(yz,{children:[s.jsxs(xz,{children:["No ",d.provider==="azure"?"deployments":"models"," found."]}),s.jsxs(bz,{heading:d.provider==="azure"?"Deployments":"Models",children:[z.map(I=>s.jsxs(yS,{value:I,onSelect:F=>{f(Q=>({...Q,model:F})),D(!1),k(!1)},children:[s.jsx(Xl,{className:Se("mr-2 h-4 w-4",d.model===I?"opacity-100":"opacity-0")}),s.jsx("span",{className:"font-mono text-xs",children:I})]},I)),s.jsx(yS,{value:"__custom_model_id__",onSelect:()=>{D(!0),k(!1)},children:s.jsx("span",{className:"font-medium",children:d.provider==="azure"?"Custom deployment ID...":"Custom model ID..."})})]})]})]})})]}),U&&s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-9 shrink-0 text-xs",onClick:()=>{H()},disabled:P,title:d.provider==="azure"?"Fetch Azure OpenAI deployments":`Fetch ${d.provider} models`,children:[P?s.jsx(Zn,{className:"mr-1 h-3 w-3 animate-spin"}):s.jsx(Ba,{className:"mr-1 h-3 w-3"}),d.provider==="azure"?"Fetch Deployments":"Fetch Models"]})]}),G&&s.jsx(it,{value:d.model,onChange:I=>f(F=>({...F,model:I.target.value})),placeholder:d.provider==="azure"?"Type deployment name manually":"Type model name manually",className:"font-mono text-xs"}),N.length>0&&s.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Loaded ",N.length," ",d.provider==="azure"?"deployment names":"models"," from provider discovery."]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{children:"Max Tokens"}),s.jsx(it,{type:"number",min:1,max:128e3,value:d.maxTokens,onChange:I=>f(F=>({...F,maxTokens:parseInt(I.target.value)||0})),className:"font-mono text-xs"})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Te,{children:"Temperature"}),s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:d.temperature.toFixed(2)})]}),s.jsx(Y8,{value:[d.temperature],onValueChange:([I])=>f(F=>({...F,temperature:I})),min:0,max:2,step:.01})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{children:"System Prompt"}),s.jsx(Vs,{value:d.systemPrompt||"",onChange:I=>f(F=>({...F,systemPrompt:I.target.value})),placeholder:"Optional system prompt...",rows:3,className:"text-xs"})]}),s.jsxs("div",{className:"flex items-center justify-between pt-2",children:[s.jsx("div",{children:!i&&s.jsx(ae,{type:"button",variant:"destructive",size:"sm",onClick:()=>p(!0),children:"Delete"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ae,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/agents"),children:"Cancel"}),s.jsxs(ae,{type:"button",size:"sm",onClick:()=>{X()},disabled:g,children:[g&&s.jsx(Zn,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Agent":"Save"]})]})]})]})]}),s.jsx(Zs,{open:h,onOpenChange:p,children:s.jsxs(fs,{children:[s.jsxs(ps,{children:[s.jsx(ms,{children:"Delete agent?"}),s.jsxs(vs,{children:["This will permanently remove the agent"," ",s.jsx("span",{className:"font-mono",children:d.name}),". This action cannot be undone."]})]}),s.jsxs(hs,{children:[s.jsx(ys,{children:"Cancel"}),s.jsx(gs,{onClick:()=>{Z()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},uM="mcplab.resultAssistantScenarioHandoff",dM=()=>{const{scenarioId:e}=Ic(),[t,n]=Mc(),r=qa(),{source:a}=An(),{scenarios:i,setScenarios:o,agents:c,servers:d,reload:f,loading:h}=Va(),[p,g]=v.useState(""),[y,j]=v.useState("all"),[w,x]=v.useState("name"),[S,N]=v.useState("asc"),[A,P]=v.useState(""),[E,O]=v.useState(null),[k,R]=v.useState("idle"),[D,U]=v.useState(""),[z,L]=v.useState(""),[G,q]=v.useState(0),[H,X]=v.useState(null),Z=v.useRef(null),I=v.useRef(!1),F=v.useRef(!1),Q=v.useRef(null),B=v.useRef(0),$=e?decodeURIComponent(e):void 0,ee=$?i.findIndex(se=>se.id===$):-1,V=ee>=0?i[ee]:void 0,J=async se=>{if(!V||ee<0||!se)return;const de=[...i];de[ee]=se,await o(de)},ge=async()=>{const se=Q.current;if(!se||!V)return;if(I.current){F.current=!0;return}I.current=!0,F.current=!1;const de=++B.current;R("saving"),U("");try{await J(se),de===B.current&&R("saved")}catch(Ne){const Fe=Ne instanceof Error?Ne.message:String(Ne);de===B.current&&(R("error"),U(Fe)),Re({title:"Could not save scenario",description:Fe,variant:"destructive"})}finally{I.current=!1,F.current&&(F.current=!1,ge())}},ie=se=>{Q.current=se,R("dirty"),U(""),Z.current&&window.clearTimeout(Z.current),Z.current=window.setTimeout(()=>{Z.current=null,ge()},700)},ce=async()=>{const se=`scn-${Date.now()}`;let de=se,Ne=1;for(;i.some(je=>je.id===de);)de=`${se}-${Ne}`,Ne+=1;const Fe={id:de,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};await o([...i,Fe]),r(`/libraries/scenarios/${encodeURIComponent(de)}`),Re({title:"Scenario created",description:`Opened ${de} for editing.`})},oe=se=>{const de=(se||`scn-${Date.now()}`).trim().replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||`scn-${Date.now()}`;let Ne=de,Fe=1;for(;i.some(je=>je.id===Ne);)Ne=`${de}-${Fe}`,Fe+=1;return Ne},xe=async(se,de=!1)=>{const Ne=oe(`${se.id}-copy`),Fe={...structuredClone(se),id:Ne,name:se.name?`${se.name} (Copy)`:""};await o([...i,Fe]),Re({title:"Scenario duplicated",description:`Created ${Fe.id}.`}),de&&r(`/libraries/scenarios/${encodeURIComponent(Fe.id)}`)},Oe=async se=>{Z.current&&(window.clearTimeout(Z.current),Z.current=null);const de=i.filter(Ne=>Ne.id!==se.id);await o(de),Re({title:"Scenario deleted",description:`${se.id} was removed.`}),V?.id===se.id&&(O(null),Q.current=null,R("idle"),U(""),r("/libraries/scenarios"))},pe=se=>se.map(de=>d.find(Ne=>Ne.id===de)).filter(Boolean).map(de=>de?.name||de?.id).filter(Boolean),ve=v.useMemo(()=>{const se=new Set;for(const de of i)for(const Ne of pe(de.serverIds))se.add(Ne);return Array.from(se).sort((de,Ne)=>de.localeCompare(Ne))},[i,d]),Ce=v.useMemo(()=>{const se=p.trim().toLowerCase(),de=i.filter(Ne=>{const Fe=(Ne.name||"").toLowerCase(),je=Ne.id.toLowerCase(),$e=(Ne.prompt||"").toLowerCase(),et=pe(Ne.serverIds);return y!=="all"&&!et.includes(y)?!1:se?Fe.includes(se)||je.includes(se)||$e.includes(se)||et.some(xt=>xt.toLowerCase().includes(se)):!0});return de.sort((Ne,Fe)=>{const je=pe(Ne.serverIds),$e=pe(Fe.serverIds);let et=0;switch(w){case"id":et=Ne.id.localeCompare(Fe.id);break;case"servers":et=je.length-$e.length;break;case"evalRules":et=Ne.evalRules.length-Fe.evalRules.length;break;case"extractRules":et=Ne.extractRules.length-Fe.extractRules.length;break;default:et=(Ne.name||Ne.id).localeCompare(Fe.name||Fe.id);break}return et===0&&(et=Ne.id.localeCompare(Fe.id)),S==="asc"?et:-et}),de},[i,p,y,w,S,d]);v.useEffect(()=>{let se=!0;return a.getWorkspaceSettings().then(de=>{!se||!de||P(de.scenarioAssistantAgentName??"")}).catch(()=>{se&&P("")}),()=>{se=!1}},[a]),v.useEffect(()=>{if($&&t.get("assistantHandoff")==="1")try{const se=window.sessionStorage.getItem(uM);if(!se)return;const de=JSON.parse(se);if(!de||de.scenarioId!==$||!de.prompt)return;L(String(de.prompt)),q(Date.now()),window.sessionStorage.removeItem(uM);const Ne=new URLSearchParams(t);Ne.delete("assistantHandoff"),n(Ne,{replace:!0}),Re({title:"Suggestion sent to Scenario Assistant",description:"Review the suggestion and apply changes in the scenario editor."})}catch{}},[$,t,n]),v.useEffect(()=>{V?(O(structuredClone(V)),Q.current=structuredClone(V),R("idle"),U("")):(O(null),Q.current=null,R("idle"),U("")),Z.current&&(window.clearTimeout(Z.current),Z.current=null),I.current=!1,F.current=!1},[V]),v.useEffect(()=>()=>{Z.current&&window.clearTimeout(Z.current)},[]);const Le=A||c[0]?.name||"";return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(a$,{className:"h-6 w-6"}),"Manage Scenarios"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Reusable scenario templates shared across configurations."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[V&&s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>r("/libraries/scenarios"),children:[s.jsx(No,{className:"mr-2 h-4 w-4"}),"Back to Overview"]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{f()},disabled:h,children:[s.jsx(Ba,{className:"mr-2 h-4 w-4"}),"Refresh"]}),!V&&s.jsxs(ae,{type:"button",size:"sm",onClick:()=>{ce()},children:[s.jsx(Fa,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Scenario"]})]})]}),!V&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid gap-3 rounded-md border bg-muted/30 p-3 md:grid-cols-[1.6fr_1fr_1fr_auto]",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Search"}),s.jsxs("div",{className:"relative",children:[s.jsx(AS,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),s.jsx(it,{value:p,onChange:se=>g(se.target.value),placeholder:"Search by name, id, prompt, server...",className:"h-8 pl-8 text-xs"})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Server Filter"}),s.jsxs(Kt,{value:y,onValueChange:j,children:[s.jsx(Ut,{className:"h-8 text-xs",children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"all",children:"All servers"}),ve.map(se=>s.jsx(Je,{value:se,children:se},se))]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Sort By"}),s.jsxs(Kt,{value:w,onValueChange:se=>x(se),children:[s.jsx(Ut,{className:"h-8 text-xs",children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"name",children:"Name"}),s.jsx(Je,{value:"id",children:"ID"}),s.jsx(Je,{value:"servers",children:"# Servers"}),s.jsx(Je,{value:"evalRules",children:"# Eval Rules"}),s.jsx(Je,{value:"extractRules",children:"# Extract Rules"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Direction"}),s.jsxs(Kt,{value:S,onValueChange:se=>N(se),children:[s.jsx(Ut,{className:"h-8 w-28 text-xs",children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"asc",children:"Ascending"}),s.jsx(Je,{value:"desc",children:"Descending"})]})]})]})]}),s.jsx(ze,{children:s.jsxs(Ue,{className:"space-y-3 pt-6",children:[s.jsxs("div",{className:"text-xs text-muted-foreground",children:["Showing ",Ce.length," of ",i.length," scenario",i.length!==1?"s":"","."]}),$&&!V&&s.jsxs("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900",children:["Scenario ",s.jsx("code",{className:"font-mono",children:$})," was not found."]}),i.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No library scenarios yet."}):Ce.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No scenarios match the current filters."}):s.jsx("div",{className:"grid gap-3",children:Ce.map(se=>{const de=$===se.id,Ne=`/libraries/scenarios/${encodeURIComponent(se.id)}`,Fe=pe(se.serverIds);return s.jsx("div",{className:`rounded-lg border p-3 ${de?"border-primary bg-primary/5":""}`,children:s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"space-y-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx(yt,{to:Ne,className:"font-medium truncate hover:underline",children:se.name||se.id}),s.jsx(Ke,{variant:"outline",className:"font-mono text-[10px]",children:se.id}),de&&s.jsx(Ke,{children:"Selected"})]}),s.jsxs("div",{className:"text-xs text-muted-foreground flex flex-wrap gap-x-3 gap-y-1",children:[s.jsxs("span",{children:[Fe.length," server",Fe.length!==1?"s":""]}),s.jsxs("span",{children:[se.evalRules.length," eval rule",se.evalRules.length!==1?"s":""]}),s.jsxs("span",{children:[se.extractRules.length," extract rule",se.extractRules.length!==1?"s":""]})]}),Fe.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1",children:Fe.map(je=>s.jsx(Ke,{variant:"secondary",className:"text-[10px]",children:je},`${se.id}-${je}`))})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(ae,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>X(se),children:[s.jsx(Yr,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{xe(se)},children:[s.jsx(Ti,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsx(ae,{type:"button",size:"sm",variant:de?"default":"outline",asChild:!0,children:s.jsxs(yt,{to:Ne,children:[s.jsx(km,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})})]})]})},se.id)})})]})})]}),V&&E?s.jsxs(ze,{children:[s.jsxs(At,{className:"pb-3",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsx("div",{children:s.jsx(Et,{className:"text-base",children:"Edit Scenario"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{xe(E,!0)},children:[s.jsx(Ti,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>X(E),children:[s.jsx(Yr,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]})]})]}),s.jsx("div",{className:"text-sm text-muted-foreground",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs("span",{children:["Focused editor for ",s.jsx("code",{className:"font-mono",children:V.id}),"."]}),s.jsx(Ke,{variant:"outline",className:`text-[10px] ${k==="saving"?"border-amber-300 text-amber-700":k==="saved"?"border-emerald-300 text-emerald-700":k==="error"?"border-destructive/40 text-destructive":k==="dirty"?"border-sky-300 text-sky-700":""}`,children:k==="saving"?"Saving...":k==="saved"?"Saved":k==="error"?"Save failed":k==="dirty"?"Unsaved changes":"Ready"}),k==="error"&&D&&s.jsx("span",{className:"text-[11px] text-destructive",children:D})]})})]}),s.jsx(Ue,{className:"pt-3",children:s.jsx(fS,{scenarios:[E],agents:c,servers:d,defaultAssistantAgentName:Le,assistantInitialPromptByScenarioId:z&&E?.id?{[E.id]:z}:void 0,assistantAutoOpenNonceByScenarioId:E?.id&&G?{[E.id]:G}:void 0,onChange:se=>{const de=se[0];de&&(O(de),ie(de))},allowAdd:!1})})]}):null,s.jsx(Zs,{open:!!H,onOpenChange:se=>!se&&X(null),children:s.jsxs(fs,{children:[s.jsxs(ps,{children:[s.jsx(ms,{children:"Delete scenario?"}),s.jsxs(vs,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-medium",children:H?.name||H?.id})," ","from the library. This action cannot be undone."]})]}),s.jsxs(hs,{children:[s.jsx(ys,{children:"Cancel"}),s.jsx(gs,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{H&&(Oe(H),X(null))},children:"Delete Scenario"})]})]})})]})},Tve=()=>{const{source:e}=An(),{agents:t,reload:n,loading:r}=Va(),[a,i]=v.useState(!1),[o,c]=v.useState(!1),[d,f]=v.useState(""),h=v.useMemo(()=>d||t[0]?.name||"",[d,t]),p=async()=>{i(!0);try{const j=await e.getWorkspaceSettings();f(j?.scenarioAssistantAgentName??"")}catch(j){f(""),Re({title:"Could not load settings",description:j instanceof Error?j.message:String(j),variant:"destructive"})}finally{i(!1)}};v.useEffect(()=>{p()},[e]);const g=async j=>{f(j),c(!0);try{await e.updateWorkspaceSettings({scenarioAssistantAgentName:j||void 0}),Re({title:"Settings updated",description:j?`Scenario Assistant Agent set to ${j}.`:"Scenario Assistant Agent cleared (will use first available agent by default)."})}catch(w){Re({title:"Could not save settings",description:w instanceof Error?w.message:String(w),variant:"destructive"})}finally{c(!1)}},y=async()=>{await Promise.all([n(),p()])};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(ES,{className:"h-6 w-6"}),"Settings"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Workspace-level MCP Lab settings and defaults."})]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{y()},disabled:r||a,children:[s.jsx(Ba,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),s.jsxs(ze,{children:[s.jsxs(At,{className:"pb-3",children:[s.jsx(Et,{className:"text-base",children:"Scenario Assistant"}),s.jsx(Ms,{children:"Default assistant model used on library scenario pages. If unset, MCP Lab uses the first available agent automatically."})]}),s.jsxs(Ue,{className:"grid gap-3 md:grid-cols-[1.3fr_auto] md:items-end",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Te,{className:"text-xs",children:"Assistant Agent"}),s.jsxs(Kt,{value:h||"__none__",onValueChange:j=>{g(j==="__none__"?"":j)},disabled:o,children:[s.jsx(Ut,{className:"h-9 text-sm",children:s.jsx(Gt,{placeholder:"Select assistant agent"})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"__none__",children:"None (use first agent)"}),t.map(j=>s.jsxs(Je,{value:j.name||j.id,children:[j.name||j.id," · ",j.model]},j.id))]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Applies to `/libraries/scenarios/:scenarioId`. MCP Evaluation editors can still override the assistant agent from their evaluation context."})]}),s.jsx("div",{className:"text-xs text-muted-foreground",children:"Saved in workspace settings"})]})]})]})};var rg="Checkbox",[Ive]=er(rg),[Mve,mC]=Ive(rg);function $ve(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:i,form:o,name:c,onCheckedChange:d,required:f,value:h="on",internal_do_not_use_render:p}=e,[g,y]=Zr({prop:n,defaultProp:a??!1,onChange:d,caller:rg}),[j,w]=v.useState(null),[x,S]=v.useState(null),N=v.useRef(!1),A=j?!!o||!!j.closest("form"):!0,P={checked:g,disabled:i,setChecked:y,control:j,setControl:w,name:c,form:o,value:h,hasConsumerStoppedPropagationRef:N,required:f,defaultChecked:Ri(a)?!1:a,isFormControl:A,bubbleInput:x,setBubbleInput:S};return s.jsx(Mve,{scope:t,...P,children:Dve(p)?p(P):r})}var wz="CheckboxTrigger",jz=v.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a)=>{const{control:i,value:o,disabled:c,checked:d,required:f,setControl:h,setChecked:p,hasConsumerStoppedPropagationRef:g,isFormControl:y,bubbleInput:j}=mC(wz,e),w=ft(a,h),x=v.useRef(d);return v.useEffect(()=>{const S=i?.form;if(S){const N=()=>p(x.current);return S.addEventListener("reset",N),()=>S.removeEventListener("reset",N)}},[i,p]),s.jsx(qe.button,{type:"button",role:"checkbox","aria-checked":Ri(d)?"mixed":d,"aria-required":f,"data-state":Ez(d),"data-disabled":c?"":void 0,disabled:c,value:o,...r,ref:w,onKeyDown:Pe(t,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Pe(n,S=>{p(N=>Ri(N)?!0:!N),j&&y&&(g.current=S.isPropagationStopped(),g.current||S.stopPropagation())})})});jz.displayName=wz;var vC=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:i,required:o,disabled:c,value:d,onCheckedChange:f,form:h,...p}=e;return s.jsx($ve,{__scopeCheckbox:n,checked:a,defaultChecked:i,disabled:c,required:o,onCheckedChange:f,name:r,form:h,value:d,internal_do_not_use_render:({isFormControl:g})=>s.jsxs(s.Fragment,{children:[s.jsx(jz,{...p,ref:t,__scopeCheckbox:n}),g&&s.jsx(Az,{__scopeCheckbox:n})]})})});vC.displayName=rg;var Sz="CheckboxIndicator",Nz=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,i=mC(Sz,n);return s.jsx(Un,{present:r||Ri(i.checked)||i.checked===!0,children:s.jsx(qe.span,{"data-state":Ez(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});Nz.displayName=Sz;var Cz="CheckboxBubbleInput",Az=v.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:o,required:c,disabled:d,name:f,value:h,form:p,bubbleInput:g,setBubbleInput:y}=mC(Cz,e),j=ft(n,y),w=Wv(i),x=$m(r);v.useEffect(()=>{const N=g;if(!N)return;const A=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(A,"checked").set,O=!a.current;if(w!==i&&E){const k=new Event("click",{bubbles:O});N.indeterminate=Ri(i),E.call(N,Ri(i)?!1:i),N.dispatchEvent(k)}},[g,w,i,a]);const S=v.useRef(Ri(i)?!1:i);return s.jsx(qe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??S.current,required:c,disabled:d,name:f,value:h,form:p,...t,tabIndex:-1,ref:j,style:{...t.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Az.displayName=Cz;function Dve(e){return typeof e=="function"}function Ri(e){return e==="indeterminate"}function Ez(e){return Ri(e)?"indeterminate":e?"checked":"unchecked"}const ha=v.forwardRef(({className:e,...t},n)=>s.jsx(vC,{ref:n,className:Se("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:s.jsx(Nz,{className:Se("flex items-center justify-center text-current"),children:s.jsx(Xl,{className:"h-4 w-4"})})}));ha.displayName=vC.displayName;const Lve=Lo("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Kl=v.forwardRef(({className:e,variant:t,...n},r)=>s.jsx("div",{ref:r,role:"alert",className:Se(Lve({variant:t}),e),...n}));Kl.displayName="Alert";const Gl=v.forwardRef(({className:e,...t},n)=>s.jsx("h5",{ref:n,className:Se("mb-1 font-medium leading-none tracking-tight",e),...t}));Gl.displayName="AlertTitle";const Yl=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Se("text-sm [&_p]:leading-relaxed",e),...t}));Yl.displayName="AlertDescription";function Fve(e,t=[]){let n=[];function r(i,o){const c=v.createContext(o);c.displayName=i+"Context";const d=n.length;n=[...n,o];const f=p=>{const{scope:g,children:y,...j}=p,w=g?.[e]?.[d]||c,x=v.useMemo(()=>j,Object.values(j));return s.jsx(w.Provider,{value:x,children:y})};f.displayName=i+"Provider";function h(p,g){const y=g?.[e]?.[d]||c,j=v.useContext(y);if(j)return j;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[f,h]}const a=()=>{const i=n.map(o=>v.createContext(o));return function(c){const d=c?.[e]||i;return v.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return a.scopeName=e,[r,Bve(a,...t)]}function Bve(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=r.reduce((c,{useScope:d,scopeName:f})=>{const p=d(i)[`__scope${f}`];return{...c,...p}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var zve=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_z=zve.reduce((e,t)=>{const n=Gm(`Primitive.${t}`),r=v.forwardRef((a,i)=>{const{asChild:o,...c}=a,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),gC="Progress",yC=100,[Uve]=Fve(gC),[qve,Wve]=Uve(gC),Pz=v.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:a,getValueLabel:i=Vve,...o}=e;(a||a===0)&&!fM(a)&&console.error(Hve(`${a}`,"Progress"));const c=fM(a)?a:yC;r!==null&&!pM(r,c)&&console.error(Kve(`${r}`,"Progress"));const d=pM(r,c)?r:null,f=Cm(d)?i(d,c):void 0;return s.jsx(qve,{scope:n,value:d,max:c,children:s.jsx(_z.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":Cm(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":Rz(d,c),"data-value":d??void 0,"data-max":c,...o,ref:t})})});Pz.displayName=gC;var Oz="ProgressIndicator",kz=v.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,a=Wve(Oz,n);return s.jsx(_z.div,{"data-state":Rz(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...r,ref:t})});kz.displayName=Oz;function Vve(e,t){return`${Math.round(e/t*100)}%`}function Rz(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Cm(e){return typeof e=="number"}function fM(e){return Cm(e)&&!isNaN(e)&&e>0}function pM(e,t){return Cm(e)&&!isNaN(e)&&e<=t&&e>=0}function Hve(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${yC}\`.`}function Kve(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
131
|
+
- a positive number
|
|
132
|
+
- less than the value passed to \`max\` (or ${yC} if no \`max\` prop is set)
|
|
133
|
+
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
134
|
+
|
|
135
|
+
Defaulting to \`null\`.`}var Tz=Pz,Gve=kz;const ag=v.forwardRef(({className:e,value:t,...n},r)=>s.jsx(Tz,{ref:r,className:Se("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:s.jsx(Gve,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));ag.displayName=Tz.displayName;const Vu=["critical","high","medium","low","info"];function u1(e){switch(e){case"critical":return"border-red-300 bg-red-100 text-red-900";case"high":return"border-orange-300 bg-orange-100 text-orange-900";case"medium":return"border-amber-300 bg-amber-100 text-amber-900";case"low":return"border-sky-300 bg-sky-100 text-sky-900";default:return"border-slate-300 bg-slate-100 text-slate-800"}}function Yve(e){switch(e){case"critical":return"border-red-300 bg-background text-red-900";case"high":return"border-orange-300 bg-background text-orange-900";case"medium":return"border-amber-300 bg-background text-amber-900";case"low":return"border-sky-300 bg-background text-sky-900";default:return"border-slate-300 bg-background text-slate-800"}}function hM({text:e}){return s.jsxs("div",{className:"mt-2 rounded-md border px-2.5 py-2 text-[11px] text-slate-800",children:[s.jsxs("div",{className:"mb-1 inline-flex items-center gap-1 font-medium text-slate-700",children:[s.jsx(RU,{className:"h-3.5 w-3.5"}),"Suggested improvement"]}),s.jsx("p",{children:e})]})}function xC(e){const t=[];t.push("# MCP Tool Analysis Report",""),t.push(`- Created: ${e.createdAt}`),t.push(`- Assistant Agent: ${e.assistantAgentName}`),t.push(`- Assistant Model: ${e.assistantAgentModel}`),t.push(`- Modes: ${[e.modes.metadataReview?"metadata review":null,e.modes.deeperAnalysis?"deeper analysis":null].filter(Boolean).join(" + ")}`),t.push("","## Summary"),t.push(`- Servers analyzed: ${e.summary.serversAnalyzed}`),t.push(`- Tools analyzed: ${e.summary.toolsAnalyzed}`),t.push(`- Tools skipped: ${e.summary.toolsSkipped}`,"");for(const n of e.servers){t.push(`## Server: ${n.serverName}`),n.warnings.length>0&&t.push(...n.warnings.map(r=>`- Warning: ${r}`),"");for(const r of n.tools){if(t.push(`### ${r.publicToolName}`),t.push(`- Safety: ${r.safetyClassification} (${r.classificationReason})`),r.metadataReview?.issues.length){t.push("#### Metadata issues");for(const a of r.metadataReview.issues)t.push(` - [${a.severity}] ${a.title}: ${a.detail}`)}if(r.deeperAnalysis)if(!r.deeperAnalysis.attempted)t.push(`- Deeper analysis: skipped (${r.deeperAnalysis.skippedReason??"unknown"})`);else{t.push(`- Deeper analysis sample calls: ${r.deeperAnalysis.sampleCalls.length}`);for(const a of r.deeperAnalysis.sampleCalls){t.push(` - Call ${a.callIndex}: ${a.ok?"ok":"error"}${a.durationMs?` (${a.durationMs}ms)`:""}`),a.error&&t.push(` - Error: ${a.error}`);for(const i of a.observations)t.push(` - ${i}`)}}if(r.overallRecommendations.length>0){t.push("#### Recommendations");for(const a of r.overallRecommendations)t.push(` - ${a}`)}if(r.metadataReview?.evalReadinessNotes.length){t.push("#### Agent/Eval readiness notes");for(const a of r.metadataReview.evalReadinessNotes)t.push(` - ${a}`)}t.push("")}}return`${t.join(`
|
|
136
|
+
`)}
|
|
137
|
+
`}function Iz({report:e}){const[t,n]=v.useState([...Vu]),r=v.useMemo(()=>new Set(t),[t]),a=i=>{n(o=>{const c=o.includes(i)?o.filter(d=>d!==i):[...o,i];return c.length===0?[...Vu]:c})};return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[s.jsx(ze,{children:s.jsxs(Ue,{className:"pt-6",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Tools analyzed"}),s.jsx("div",{className:"text-2xl font-semibold",children:e.summary.toolsAnalyzed})]})}),s.jsx(ze,{children:s.jsxs(Ue,{className:"pt-6",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Tools skipped"}),s.jsx("div",{className:"text-2xl font-semibold",children:e.summary.toolsSkipped})]})}),s.jsx(ze,{children:s.jsxs(Ue,{className:"pt-6",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Findings"}),s.jsx("div",{className:"text-2xl font-semibold",children:e.findings.length})]})})]}),s.jsxs(ze,{children:[s.jsxs(At,{className:"pb-3",children:[s.jsx(Et,{className:"text-base",children:"Analysis Overview"}),s.jsx(Ms,{children:"Visual breakdown of findings by severity. Click badges to filter the report."})]}),s.jsx(Ue,{children:s.jsxs("div",{className:"flex flex-wrap gap-2",children:[Vu.filter(i=>e.summary.issueCounts[i]>0).map(i=>{const o=r.has(i);return s.jsx("button",{type:"button",onClick:()=>a(i),className:"rounded-full","aria-pressed":o,children:s.jsxs(Ke,{variant:"outline",className:`capitalize font-normal ${o?u1(i):Yve(i)} ${o?"ring-1 ring-current":"opacity-70"}`,children:[i,": ",e.summary.issueCounts[i]]})},i)}),s.jsx(ae,{type:"button",size:"sm",variant:"ghost",onClick:()=>n([...Vu]),className:"h-7 px-2 text-xs",children:"Reset"})]})})]}),s.jsx("div",{className:"space-y-4",children:e.servers.map(i=>{const o=i.tools.filter(c=>{const d=[...c.metadataReview?.issues??[],...c.deeperAnalysis?.sampleCalls.flatMap(f=>f.issues)??[]];return d.length===0?t.length===Vu.length:d.some(f=>r.has(f.severity))});return o.length===0?null:s.jsxs(ze,{children:[s.jsxs(At,{className:"pb-3",children:[s.jsx(Et,{className:"text-base",children:i.serverName}),s.jsxs(Ms,{children:["Discovered ",i.toolCountDiscovered," · Showing ",o.length," of ",i.toolCountAnalyzed," analyzed · Skipped ",i.toolCountSkipped]})]}),s.jsxs(Ue,{className:"space-y-3",children:[i.warnings.length>0&&s.jsxs(Kl,{children:[s.jsx(Gl,{children:"Warnings"}),s.jsx(Yl,{children:s.jsx("ul",{className:"ml-4 list-disc space-y-1",children:i.warnings.map(c=>s.jsx("li",{children:c},`${i.serverName}-${c}`))})})]}),o.map(c=>s.jsxs("details",{className:"group rounded-md border p-3",children:[s.jsx("summary",{className:"cursor-pointer list-none",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("div",{className:"font-mono text-sm",children:c.publicToolName}),c.description&&s.jsx("p",{className:"text-xs text-muted-foreground",children:c.description})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ke,{variant:c.safetyClassification==="read_like"?"secondary":"outline",children:c.safetyClassification}),s.jsx(It,{className:"h-4 w-4 text-muted-foreground transition-transform group-open:rotate-180"})]})]})}),s.jsxs("div",{className:"mt-3 space-y-2",children:[c.metadataReview&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Metadata review"}),c.metadataReview.issues.filter(d=>r.has(d.severity)).length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No metadata issues reported."}):s.jsx("div",{className:"space-y-1",children:c.metadataReview.issues.filter(d=>r.has(d.severity)).map((d,f)=>s.jsxs("div",{className:"rounded border p-2 text-xs",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx("span",{className:"inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full border bg-muted px-1 text-[10px] font-semibold text-muted-foreground",children:f+1}),s.jsx("span",{className:"min-w-0 font-bold leading-tight",children:d.title})]}),s.jsx(Ke,{variant:"outline",className:`shrink-0 text-[10px] ${u1(d.severity)}`,children:d.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",d.detail]}),d.suggestion&&s.jsx(hM,{text:d.suggestion})]},d.id))})]}),c.deeperAnalysis&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Deeper analysis"}),c.deeperAnalysis.attempted?s.jsx("div",{className:"space-y-2",children:c.deeperAnalysis.sampleCalls.map(d=>s.jsxs("div",{className:"rounded border p-2 text-xs",children:[s.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[s.jsx(Ke,{variant:d.ok?"secondary":"destructive",className:"text-[10px]",children:d.ok?"ok":"error"}),s.jsxs("span",{children:["Call ",d.callIndex]}),d.durationMs!==void 0&&s.jsxs("span",{className:"text-muted-foreground",children:[d.durationMs,"ms"]})]}),d.error&&s.jsx("p",{className:"text-destructive",children:d.error}),d.observations.length>0&&s.jsxs("div",{className:"mt-2",children:[s.jsx("div",{className:"mb-1 inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:"Observations"}),s.jsx("ul",{className:"ml-4 list-disc space-y-1",children:d.observations.map((f,h)=>s.jsx("li",{children:f},`${c.publicToolName}-obs-${d.callIndex}-${h}`))})]}),d.issues.filter(f=>r.has(f.severity)).length>0&&s.jsx("div",{className:"mt-2 space-y-1",children:d.issues.filter(f=>r.has(f.severity)).map((f,h)=>s.jsxs("div",{className:"rounded border p-2",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx("span",{className:"inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full border bg-muted px-1 text-[10px] font-semibold text-muted-foreground",children:h+1}),s.jsx("span",{className:"min-w-0 font-bold leading-tight",children:f.title})]}),s.jsx(Ke,{variant:"outline",className:`shrink-0 text-[10px] ${u1(f.severity)}`,children:f.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",f.detail]}),f.suggestion&&s.jsx(hM,{text:f.suggestion})]},`${d.callIndex}-${f.id}`))})]},`${c.publicToolName}-call-${d.callIndex}`))}):s.jsx("p",{className:"text-xs text-muted-foreground",children:c.deeperAnalysis.skippedReason??"Skipped"})]})]})]},c.publicToolName))]})]},i.serverName)})})]})}const d1="mcplab.toolAnalysis.activeJobId";function mM(e,t,n){const r=new Blob([t],{type:n}),a=URL.createObjectURL(r),i=document.createElement("a");i.href=a,i.download=e,i.click(),URL.revokeObjectURL(a)}function vM({text:e}){return s.jsxs(Z$,{children:[s.jsx(eD,{asChild:!0,children:s.jsx("button",{type:"button",className:"inline-flex h-4 w-4 items-center justify-center rounded text-muted-foreground hover:text-foreground",onClick:t=>t.preventDefault(),"aria-label":e,children:s.jsx(_U,{className:"h-3.5 w-3.5"})})}),s.jsx(FS,{className:"max-w-xs text-xs",children:s.jsx("p",{children:e})})]})}function Xve(e,t){const n=t.toLowerCase();return n.includes("failed to load tools")||n.includes("failed to connect to mcp server")?`Could not load tools from '${e}'. Check that the MCP server is running and reachable, then try Refresh Servers / Discover Tools again.`:t}const Qve=()=>{const{source:e}=An(),{servers:t,agents:n,loading:r,reload:a}=Va(),[i,o]=v.useState(""),[c,d]=v.useState([]),[f,h]=v.useState(!1),[p,g]=v.useState([]),[y,j]=v.useState({}),[w,x]=v.useState(""),[S,N]=v.useState(!0),[A,P]=v.useState(!1),[E,O]=v.useState(2),[k,R]=v.useState(1),[D,U]=v.useState(1e4),[z,L]=v.useState(null),[G,q]=v.useState([]),[H,X]=v.useState(null),[Z,I]=v.useState(null),[F,Q]=v.useState(!1),[B,$]=v.useState("configure"),[ee,V]=v.useState("idle"),J=v.useRef(null),ge=i||n[0]?.name||"",ie=v.useMemo(()=>{let ye=0;const We=new Set,Ye=new Set;for(const Dt of G){const kt=typeof Dt.payload?.message=="string"?Dt.payload.message:"";if(!kt)continue;const Zt=kt.match(/\((\d+)\s+tools?\)/i);Zt&&(ye=Math.max(ye,Number(Zt[1])||0));const Sn=kt.match(/^Started\s+(.+)$/);Sn&&We.add(Sn[1]);const tr=kt.match(/^Finished\s+(.+)$/);tr&&Ye.add(tr[1])}const Ot=ye>0?Math.max(0,Math.min(100,Math.round(Ye.size/ye*100))):0;return{totalTools:ye,startedTools:We.size,finishedTools:Ye.size,percent:Ot}},[G]);v.useEffect(()=>{let ye=!0;return e.getWorkspaceSettings().then(We=>{!ye||!We||o(We.scenarioAssistantAgentName??"")}).catch(()=>{ye&&o("")}),()=>{ye=!1}},[e]),v.useEffect(()=>()=>{J.current?.()},[]);const ce=()=>{try{sessionStorage.removeItem(d1)}catch{}},oe=ye=>{try{sessionStorage.setItem(d1,ye)}catch{}},xe=ye=>{J.current?.(),J.current=e.subscribeToolAnalysisJob(ye,We=>{if(q(Ye=>[...Ye,We]),We.type==="completed")e.getToolAnalysisResult(ye).then(Ye=>{X(Ye.report),I(Ye.savedReportId??null)}).catch(Ye=>Re({title:"Could not load analysis report",description:Ye instanceof Error?Ye.message:String(Ye),variant:"destructive"})).finally(()=>{ce(),L(null),Q(!1),V("idle"),$("run")});else if(We.type==="error"){const Ye=String(We.payload?.message??"");ce(),V(Ye.toLowerCase().includes("abort")?"stopped":"error"),L(null),Q(!1)}})};v.useEffect(()=>{if(z||H)return;let ye="";try{ye=sessionStorage.getItem(d1)??""}catch{ye=""}if(ye)return $("run"),V("running"),Q(!0),L(ye),q([]),xe(ye),()=>{}},[e,z,H]);const Oe=async()=>{if(c.length===0){g([]),j({});return}h(!0);try{const ye=await e.discoverToolsForAnalysis({serverNames:c});g(ye.servers),j(We=>{const Ye={};for(const Ot of ye.servers){const Dt=We[Ot.serverName]??[],kt=Ot.tools.map(Sn=>Sn.name),Zt=Dt.filter(Sn=>kt.includes(Sn));Ye[Ot.serverName]=Zt.length>0?Zt:kt}return Ye})}catch(ye){Re({title:"Could not discover MCP tools",description:ye instanceof Error?ye.message:String(ye),variant:"destructive"})}finally{h(!1)}};v.useEffect(()=>{Oe()},[c.join("|")]);const pe=v.useMemo(()=>{const ye=w.trim().toLowerCase();return ye?p.map(We=>({...We,tools:We.tools.filter(Ye=>Ye.name.toLowerCase().includes(ye)||(Ye.description||"").toLowerCase().includes(ye))})).filter(We=>We.tools.length>0):p},[p,w]),ve=v.useMemo(()=>Object.values(y).reduce((ye,We)=>ye+We.length,0),[y]),Ce=c[0]??"",Le=async()=>{if(!S&&!A){Re({title:"Select at least one mode",variant:"destructive"});return}if(c.length!==1){Re({title:"Select exactly one server",variant:"destructive"});return}if(ve===0){Re({title:"Select at least one tool",variant:"destructive"});return}Q(!0),q([]),X(null),I(null),$("run"),V("running");try{const{jobId:ye}=await e.startToolAnalysis({serverNames:c,selectedToolsByServer:y,maxParallelTools:E,modes:{metadataReview:S,deeperAnalysis:A},deeperAnalysisOptions:{autoRunPolicy:"read_only_allowlist",sampleCallsPerTool:k,toolCallTimeoutMs:D}});L(ye),oe(ye),xe(ye)}catch(ye){Q(!1),V("error"),$("run"),Re({title:"Could not start tool analysis",description:ye instanceof Error?ye.message:String(ye),variant:"destructive"})}},se=async()=>{if(!z)return;const ye=z;try{const We=await e.stopToolAnalysis(ye);if(We.status==="completed"){J.current?.(),J.current=null;const Ye=await e.getToolAnalysisResult(ye);X(Ye.report),I(Ye.savedReportId??null),ce(),L(null),Q(!1),V("idle"),$("run"),Re({title:"Analysis already finished",description:"Showing the result overview."});return}if(We.status==="stopped"){J.current?.(),J.current=null,ce(),L(null),Q(!1),V("stopped"),Re({title:"Analysis stopped"});return}if(We.status==="error"){J.current?.(),J.current=null,ce(),L(null),Q(!1),V("error"),Re({title:"Analysis already ended with an error",description:"Review the progress log and return to Configure Analysis."});return}Re({title:"Stopping analysis..."})}catch(We){Re({title:"Could not stop analysis",description:We instanceof Error?We.message:String(We),variant:"destructive"})}},de=()=>{$("configure"),V("idle"),L(null)},Ne=(ye,We)=>{d(Ye=>We?[ye]:Ye.filter(Ot=>Ot!==ye))},Fe=(ye,We,Ye)=>{j(Ot=>{const Dt=new Set(Ot[ye]??[]);return Ye?Dt.add(We):Dt.delete(We),{...Ot,[ye]:Array.from(Dt)}})},je=(ye,We)=>{j(Ye=>({...Ye,[ye]:We}))},$e=!0,et=z!==null||G.length>0||ee==="stopped"||ee==="error",xt=!!H,Jt=ye=>{if(ye==="configure"&&$e){$("configure");return}if(ye==="run"&&et){$("run");return}ye==="report"&&xt&&$("report")};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(o$,{className:"h-6 w-6"}),"Analyze MCP Tools"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Review MCP tools for schema quality, ergonomics, and agent/eval readiness."})]}),s.jsxs("div",{className:"hidden flex-wrap items-center gap-2 md:flex",children:[s.jsx("button",{type:"button",onClick:()=>Jt("configure"),className:"rounded-full","aria-label":"Open Configure Analysis",children:s.jsx(Ke,{variant:B==="configure"?"default":"outline",className:"cursor-pointer",children:"Configure Analysis"})}),s.jsx("button",{type:"button",onClick:()=>Jt("run"),disabled:!et,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Run Analysis",children:s.jsx(Ke,{variant:B==="run"?"default":"outline",className:et?"cursor-pointer":"cursor-not-allowed",children:"Run Analysis"})}),s.jsx("button",{type:"button",onClick:()=>Jt("report"),disabled:!xt,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Report",children:s.jsx(Ke,{variant:B==="report"?"default":"outline",className:xt?"cursor-pointer":"cursor-not-allowed",children:"Report"})})]})]}),B==="configure"&&s.jsxs(ze,{children:[s.jsxs(At,{children:[s.jsx(Et,{className:"text-base",children:"Run MCP analysis"}),s.jsx(Ms,{children:"Select servers and tools, choose metadata review and/or deeper sample-call analysis, then run the report."})]}),s.jsxs(Ue,{className:"space-y-5",children:[!ge&&s.jsxs(Kl,{children:[s.jsx(Gl,{children:"No assistant agent available"}),s.jsxs(Yl,{children:["Add a library agent in"," ",s.jsx(yt,{to:"/libraries/agents",className:"underline",children:"Agents"})," ","and optionally set the default Scenario Assistant Agent in"," ",s.jsx(yt,{to:"/settings",className:"underline",children:"Settings"}),"."]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx(Te,{className:"text-xs",children:"Servers"}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{a()},disabled:r,children:[s.jsx(Ba,{className:"mr-2 h-4 w-4"}),"Refresh Servers"]})]}),s.jsx("div",{className:"grid gap-2 rounded-md border p-3 md:grid-cols-2",children:t.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No library servers configured."}):t.map(ye=>{const We=ye.name||ye.id,Ye=c.includes(We);return s.jsxs("label",{className:"flex items-start gap-2 rounded-md border p-2 text-sm",children:[s.jsx(ha,{checked:Ye,onCheckedChange:Ot=>Ne(We,!!Ot)}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-medium",children:We}),ye.url&&s.jsx("div",{className:"truncate text-xs text-muted-foreground",children:ye.url})]})]},ye.id)})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Select exactly one MCP server for analysis."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Te,{className:"text-xs",children:"Filter visible tools"}),s.jsxs("div",{className:"relative",children:[s.jsx(AS,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),s.jsx(it,{className:"h-9 pl-8",placeholder:"Filter tools by name or description...",value:w,onChange:ye=>x(ye.target.value)})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Filtering only changes what is shown; selected tools remain selected."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx(Te,{className:"text-xs",children:Ce?`Tools for ${Ce}`:"Tools"}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{Oe()},disabled:f||c.length===0,children:[f&&s.jsx(Zn,{className:"mr-2 h-4 w-4 animate-spin"}),"Discover Tools"]})]}),s.jsx("div",{className:"space-y-3 rounded-md border p-3",children:c.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"Select a server to discover tools."}):f&&p.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading tools..."}):pe.length===0&&!f?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No discovered tools match the current filters."}):pe.map(ye=>{const We=new Set(y[ye.serverName]??[]);return s.jsxs("div",{className:"rounded-md border p-3",children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[s.jsx("div",{className:"font-medium",children:ye.serverName}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ae,{type:"button",size:"sm",variant:"ghost",onClick:()=>je(ye.serverName,ye.tools.map(Ye=>Ye.name)),children:"Select all"}),s.jsx(ae,{type:"button",size:"sm",variant:"ghost",onClick:()=>je(ye.serverName,[]),children:"Clear"})]})]}),ye.warnings.length>0&&s.jsx("div",{className:"mb-2 space-y-1",children:ye.warnings.map(Ye=>s.jsx("div",{className:"text-xs text-amber-700",children:Xve(ye.serverName,Ye)},`${ye.serverName}-${Ye}`))}),s.jsx("div",{className:"grid gap-2",children:ye.tools.map(Ye=>s.jsxs("label",{className:"flex items-start gap-2 rounded border p-2",children:[s.jsx(ha,{checked:We.has(Ye.name),onCheckedChange:Ot=>Fe(ye.serverName,Ye.name,!!Ot)}),s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("span",{className:"font-mono text-xs",children:Ye.name}),s.jsx(Ke,{variant:Ye.safetyClassification==="read_like"?"secondary":"outline",className:"text-[10px]",children:Ye.safetyClassification==="read_like"?"read-like":"unsafe/unknown"})]}),Ye.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:Ye.description}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:Ye.classificationReason})]})]},`${ye.serverName}-${Ye.name}`))})]},ye.serverName)})}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Selected tools: ",ve]})]}),s.jsxs("div",{className:"space-y-3 rounded-md border p-3",children:[s.jsx("div",{className:"text-sm font-medium",children:"Analysis Modes"}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx(ha,{checked:S,onCheckedChange:ye=>N(!!ye)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Metadata / schema review",s.jsx(vM,{text:"No tool execution. Reviews tool names, descriptions, and schemas only."})]})]}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx(ha,{checked:A,onCheckedChange:ye=>P(!!ye)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Deeper analysis",s.jsx(vM,{text:"Runs sample MCP tool calls automatically for read-like tools only (based on the safety allowlist)."})]})]}),s.jsxs("div",{className:"grid gap-3 rounded-md border bg-muted/20 p-3 md:grid-cols-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Max parallel tools"}),s.jsx(it,{type:"number",min:1,max:8,value:E,onChange:ye=>O(Math.max(1,Math.min(8,Number(ye.target.value)||2))),className:"h-8"})]}),A?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Safety profile"}),s.jsx("div",{className:"text-sm",children:"Read-only allowlist only"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Sample calls per tool"}),s.jsx(it,{type:"number",min:1,max:5,value:k,onChange:ye=>R(Math.max(1,Math.min(5,Number(ye.target.value)||1))),className:"h-8"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Tool call timeout (ms)"}),s.jsx(it,{type:"number",min:1e3,max:6e4,step:500,value:D,onChange:ye=>U(Math.max(1e3,Math.min(6e4,Number(ye.target.value)||1e4))),className:"h-8"})]}),s.jsx("div",{className:"md:col-span-3 text-xs text-amber-700",children:"Deeper analysis may execute read-only MCP tools automatically."})]}):s.jsx("div",{className:"md:col-span-2 text-xs text-muted-foreground",children:"Deeper analysis is disabled. Only metadata/schema review will run."})]})]}),s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:s.jsxs(ae,{type:"button",onClick:()=>{Le()},disabled:F||!!z,children:[(F||!!z)&&s.jsx(Zn,{className:"mr-2 h-4 w-4 animate-spin"}),"Analyze Tools"]})})]})]}),B==="run"&&s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Et,{className:"flex items-center gap-2 text-base",children:s.jsx("span",{children:"Progress"})}),s.jsx(Ms,{children:z?"Live tool-analysis job events:":H?"Analysis finished. Review the summary below or open the saved report details.":ee==="stopped"?"Analysis was stopped. You can return to Configure Analysis.":ee==="error"?"Analysis ended with an error. Review the log and go back to Configure Analysis.":"Analysis finished."})]}),z?s.jsx(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{se()},children:"Stop Analysis"}):s.jsx(ae,{type:"button",size:"sm",variant:"outline",onClick:de,children:"Back to Configure Analysis"})]})}),s.jsxs(Ue,{className:"space-y-2",children:[z&&s.jsxs("div",{className:"inline-flex items-center gap-2 rounded-md border bg-muted/20 px-2.5 py-1 text-xs text-muted-foreground",children:[s.jsx(Zn,{className:"h-3.5 w-3.5 animate-spin"}),"Analysis is still running..."]}),(ie.totalTools>0||z)&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[s.jsx("span",{children:ie.totalTools>0?`${ie.finishedTools}/${ie.totalTools} tools finished`:"Preparing analysis..."}),s.jsx("span",{children:ie.totalTools>0?`${ie.percent}%`:"0%"})]}),s.jsx(ag,{value:ie.totalTools>0?ie.percent:0,className:"h-2"})]}),G.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:z?"Starting analysis...":"No progress events captured."}):s.jsx("div",{className:"max-h-64 space-y-1 overflow-auto rounded border bg-muted/20 p-2",children:G.map((ye,We)=>s.jsxs("div",{className:"text-xs",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(ye.ts).toLocaleTimeString()}),s.jsx(Ke,{variant:"outline",className:"mr-2 text-[10px]",children:ye.type}),s.jsx("span",{className:"break-all",children:typeof ye.payload.message=="string"?ye.payload.message:JSON.stringify(ye.payload)})]},`${ye.ts}-${We}`))}),!z&&H&&s.jsx(ze,{className:"mt-2 border-green-200 bg-green-50/40 dark:border-green-900/40 dark:bg-green-950/10",children:s.jsxs(Ue,{className:"pt-4 space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-semibold",children:"Result overview"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[H.summary.toolsAnalyzed," tools analyzed, ",H.summary.toolsSkipped," skipped, across"," ",H.summary.serversAnalyzed," server",H.summary.serversAnalyzed!==1?"s":"","."]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Z&&s.jsx(ae,{asChild:!0,size:"sm",children:s.jsx(yt,{to:`/tool-analysis-results/${Z}`,children:"Open result details"})}),s.jsx(ae,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(yt,{to:"/tool-analysis-results",children:"View all results"})}),s.jsx(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>Jt("report"),children:"View inline report"})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[H.summary.issueCounts.critical>0&&s.jsxs(Ke,{className:"bg-red-600 text-white hover:bg-red-600",children:["Critical: ",H.summary.issueCounts.critical]}),H.summary.issueCounts.high>0&&s.jsxs(Ke,{className:"bg-orange-500 text-white hover:bg-orange-500",children:["High: ",H.summary.issueCounts.high]}),H.summary.issueCounts.medium>0&&s.jsxs(Ke,{className:"bg-amber-500 text-white hover:bg-amber-500",children:["Medium: ",H.summary.issueCounts.medium]}),H.summary.issueCounts.low>0&&s.jsxs(Ke,{className:"bg-blue-500 text-white hover:bg-blue-500",children:["Low: ",H.summary.issueCounts.low]}),H.summary.issueCounts.info>0&&s.jsxs(Ke,{variant:"outline",children:["Info: ",H.summary.issueCounts.info]}),Object.values(H.summary.issueCounts).every(ye=>ye===0)&&s.jsx(Ke,{className:"bg-green-600 text-white hover:bg-green-600",children:"No findings"})]})]})})]})]}),B==="report"&&H&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-semibold",children:"Report"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[H.summary.toolsAnalyzed," tools analyzed across ",H.summary.serversAnalyzed," server",H.summary.serversAnalyzed!==1?"s":"","."]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ae,{type:"button",size:"sm",variant:"outline",onClick:de,children:"Back to Configure Analysis"}),Z&&s.jsxs(s.Fragment,{children:[s.jsx(ae,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx(yt,{to:`/tool-analysis-results/${Z}`,children:"Open saved report"})}),s.jsx(ae,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx(yt,{to:"/tool-analysis-results",children:"View all reports"})})]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>mM(`tool-analysis-${Date.now()}.json`,`${JSON.stringify(H,null,2)}
|
|
138
|
+
`,"application/json"),children:[s.jsx(ma,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>mM(`tool-analysis-${Date.now()}.md`,xC(H),"text/markdown"),children:[s.jsx(ma,{className:"mr-2 h-4 w-4"}),"Export Markdown"]})]})]}),s.jsx(Iz,{report:H})]})]})};function gM(e,t,n){const r=new Blob([t],{type:n}),a=URL.createObjectURL(r),i=document.createElement("a");i.href=a,i.download=e,i.click(),URL.revokeObjectURL(a)}function Jve(){const{source:e}=An(),[t,n]=v.useState([]),[r,a]=v.useState(!0),[i,o]=v.useState(null),[c,d]=v.useState(!1),f=async()=>{a(!0);try{n(await e.listToolAnalysisResults())}catch(y){Re({title:"Could not load tool analysis results",description:y instanceof Error?y.message:String(y),variant:"destructive"})}finally{a(!1)}};v.useEffect(()=>{f()},[]);const h=v.useMemo(()=>t.find(y=>y.reportId===i)??null,[t,i]),p=async()=>{if(i){d(!0);try{await e.deleteToolAnalysisSavedResult(i),n(y=>y.filter(j=>j.reportId!==i)),Re({title:"Tool analysis report deleted"}),o(null)}catch(y){Re({title:"Could not delete report",description:y instanceof Error?y.message:String(y),variant:"destructive"})}finally{d(!1)}}},g=async(y,j)=>{try{const w=await e.getToolAnalysisSavedResult(y);j==="json"?gM(`${y}.json`,`${JSON.stringify(w,null,2)}
|
|
139
|
+
`,"application/json"):gM(`${y}.md`,xC(w.report),"text/markdown")}catch(w){Re({title:"Could not export saved report",description:w instanceof Error?w.message:String(w),variant:"destructive"})}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(l$,{className:"h-6 w-6"}),"Tool Analysis Results"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse persisted Analyze MCP Tools reports."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ae,{variant:"outline",onClick:()=>{f()},disabled:r,children:r?"Refreshing...":"Refresh"}),s.jsx(ae,{asChild:!0,variant:"outline",children:s.jsx(yt,{to:"/tool-analysis",children:"Analyze MCP Tools"})})]})]}),s.jsx(ze,{children:s.jsx(Ue,{className:"p-0",children:r?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Loading tool analysis results..."}):t.length===0?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"No saved tool analysis reports yet."}):s.jsxs(Hr,{children:[s.jsx(Kr,{children:s.jsxs(zt,{children:[s.jsx(nt,{children:"Report ID"}),s.jsx(nt,{children:"Evaluated"}),s.jsx(nt,{children:"Timestamp"}),s.jsx(nt,{children:"Issues"}),s.jsx(nt,{children:"Modes"}),s.jsx(nt,{className:"w-10"})]})}),s.jsx(Gr,{children:t.map(y=>s.jsxs(zt,{children:[s.jsx(He,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(yt,{to:`/tool-analysis-results/${y.reportId}`,className:"font-mono text-xs text-primary hover:underline",children:y.reportId}),s.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[y.assistantAgentName," · ",y.assistantAgentModel]})]})}),s.jsx(He,{className:"text-[11px] text-muted-foreground",children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Servers: ",s.jsx("span",{className:"font-medium text-foreground",children:y.serverNames.length})," · Tools:"," ",s.jsx("span",{className:"font-medium text-foreground",children:y.summary.toolsAnalyzed})," · ","Skipped: ",s.jsx("span",{className:"font-medium text-foreground",children:y.summary.toolsSkipped})]}),s.jsxs("div",{className:"font-mono text-xs text-foreground/80",children:[y.serverNames.slice(0,2).join(", "),y.serverNames.length>2?` +${y.serverNames.length-2}`:""]})]})}),s.jsx(He,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Pm,{className:"h-3 w-3"}),new Date(y.createdAt).toLocaleString()]})}),s.jsx(He,{children:s.jsxs("div",{className:"flex flex-wrap gap-1",children:[["critical","high","medium","low","info"].map(j=>y.summary.issueCounts[j]>0?s.jsxs(Ke,{variant:"outline",className:"capitalize",children:[j,": ",y.summary.issueCounts[j]]},`${y.reportId}-${j}`):null),Object.values(y.summary.issueCounts).every(j=>j===0)&&s.jsx(Ke,{variant:"outline",children:"No issues"})]})}),s.jsx(He,{children:s.jsxs("div",{className:"flex flex-wrap gap-1",children:[y.modes.metadataReview&&s.jsx(Ke,{variant:"outline",children:"metadata"}),y.modes.deeperAnalysis&&s.jsx(Ke,{variant:"outline",children:"deeper"})]})}),s.jsx(He,{children:s.jsxs(Hc,{children:[s.jsx(Kc,{asChild:!0,children:s.jsx(ae,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Om,{className:"h-4 w-4"})})}),s.jsxs(Ko,{align:"end",children:[s.jsx(mr,{asChild:!0,children:s.jsx(yt,{to:`/tool-analysis-results/${y.reportId}`,children:"View"})}),s.jsxs(mr,{onSelect:()=>{g(y.reportId,"json")},children:[s.jsx(ma,{className:"mr-2 h-3.5 w-3.5"})," Export JSON"]}),s.jsxs(mr,{onSelect:()=>{g(y.reportId,"markdown")},children:[s.jsx(ma,{className:"mr-2 h-3.5 w-3.5"})," Export Markdown"]}),s.jsxs(mr,{className:"text-destructive",onSelect:j=>{j.preventDefault(),o(y.reportId)},children:[s.jsx(Yr,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},y.reportId))})]})})}),s.jsx(Zs,{open:!!i,onOpenChange:y=>!y&&o(null),children:s.jsxs(fs,{children:[s.jsxs(ps,{children:[s.jsx(ms,{children:"Delete tool analysis report?"}),s.jsx(vs,{children:h?`Delete saved report '${h.reportId}' from disk? This cannot be undone.`:"Delete this saved report from disk? This cannot be undone."})]}),s.jsxs(hs,{children:[s.jsx(ys,{disabled:c,children:"Cancel"}),s.jsx(gs,{onClick:y=>{y.preventDefault(),p()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function yM(e,t,n){const r=new Blob([t],{type:n}),a=URL.createObjectURL(r),i=document.createElement("a");i.href=a,i.download=e,i.click(),URL.revokeObjectURL(a)}function Zve(){const{id:e=""}=Ic(),t=qa(),{source:n}=An(),[r,a]=v.useState(null),[i,o]=v.useState(!0),[c,d]=v.useState(!1),[f,h]=v.useState(!1),[p,g]=v.useState(!1);v.useEffect(()=>{let j=!0;return o(!0),d(!1),n.getToolAnalysisSavedResult(e).then(w=>{j&&a(w)}).catch(w=>{if(!j)return;const x=w instanceof Error?w.message:String(w);if(x.includes("(404)")){d(!0),a(null);return}Re({title:"Could not load saved tool analysis report",description:x,variant:"destructive"})}).finally(()=>{j&&o(!1)}),()=>{j=!1}},[e,n]);const y=async()=>{g(!0);try{await n.deleteToolAnalysisSavedResult(e),Re({title:"Tool analysis report deleted"}),t("/tool-analysis-results")}catch(j){Re({title:"Could not delete report",description:j instanceof Error?j.message:String(j),variant:"destructive"})}finally{g(!1),h(!1)}};return i?s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading saved tool analysis report..."}):c||!r?s.jsxs("div",{className:"space-y-4",children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Tool Analysis Result"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Saved report not found."}),s.jsx(ae,{asChild:!0,variant:"outline",children:s.jsx(yt,{to:"/tool-analysis-results",children:"Back to Tool Analysis Results"})})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-mono text-xl font-semibold",children:r.reportId}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[new Date(r.createdAt).toLocaleString()," · ",r.serverNames.join(", ")||"—"]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(ae,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(yt,{to:"/tool-analysis-results",children:"Back to results"})}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>yM(`${r.reportId}.json`,`${JSON.stringify(r,null,2)}
|
|
140
|
+
`,"application/json"),children:[s.jsx(ma,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>yM(`${r.reportId}.md`,xC(r.report),"text/markdown"),children:[s.jsx(ma,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>h(!0),children:[s.jsx(Yr,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]}),s.jsx(Iz,{report:r.report}),s.jsx(Zs,{open:f,onOpenChange:h,children:s.jsxs(fs,{children:[s.jsxs(ps,{children:[s.jsx(ms,{children:"Delete tool analysis report?"}),s.jsxs(vs,{children:["Delete saved report '",r.reportId,"' from disk? This cannot be undone."]})]}),s.jsxs(hs,{children:[s.jsx(ys,{disabled:p,children:"Cancel"}),s.jsx(gs,{onClick:j=>{j.preventDefault(),y()},disabled:p,children:p?"Deleting...":"Delete"})]})]})})]})}const ege=[{id:"configure",label:"Configure Debug Session"},{id:"run",label:"Run / Inspect Flow"},{id:"report",label:"Report / Export"}];function tge(e){return navigator.clipboard.writeText(e)}function nge(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}function rge(e,t){const n=[];n.push("# OAuth Debugger Report"),n.push(""),n.push(`- Session ID: ${e.id}`),n.push(`- Status: ${e.status}`),n.push(`- Registration method: ${e.registrationMethod}`),n.push(`- Profile: ${e.profile}`),n.push(""),n.push("## Steps");for(const r of e.stepStates)n.push(`- ${r.title}: ${r.status}${r.outcomeSummary?` — ${r.outcomeSummary}`:""}`);if(n.push(""),n.push("## Validation Findings"),e.validations.length===0)n.push("- None");else for(const r of e.validations)n.push(`- [${r.severity}] ${r.title} (${r.stepId})`),n.push(` - ${r.detail}`),r.recommendation&&n.push(` - Recommendation: ${r.recommendation}`);n.push(""),n.push("## Event Log");for(const r of t){const a=typeof r.payload.message=="string"?r.payload.message:JSON.stringify(r.payload);n.push(`- ${new Date(r.ts).toLocaleTimeString()} [${r.type}] ${a}`)}return`${n.join(`
|
|
141
|
+
`)}
|
|
142
|
+
`}function age(){const{source:e}=An(),{servers:t,reload:n,loading:r}=Va(),[a,i]=v.useState("configure"),[o,c]=v.useState(""),[d,f]=v.useState("pre_registered"),[h,p]=v.useState("local_callback"),[g,y]=v.useState(!0),[j,w]=v.useState(!0),[x,S]=v.useState(""),[N,A]=v.useState(""),[P,E]=v.useState(""),[O,k]=v.useState(""),[R,D]=v.useState("client_secret_basic"),[U,z]=v.useState("{}"),[L,G]=v.useState(""),[q,H]=v.useState(""),[X,Z]=v.useState(""),[I,F]=v.useState(""),[Q,B]=v.useState(""),[$,ee]=v.useState(""),[V,J]=v.useState(""),[ge,ie]=v.useState(""),[ce,oe]=v.useState(null),[xe,Oe]=v.useState(null),[pe,ve]=v.useState([]),[Ce,Le]=v.useState(!1),[se,de]=v.useState(!1),[Ne,Fe]=v.useState(!1),[je,$e]=v.useState("all"),[et,xt]=v.useState("all"),[Jt,ye]=v.useState("inspector"),We=v.useRef(null),Ye=v.useRef(null);v.useEffect(()=>()=>{We.current?.(),We.current=null},[]),v.useEffect(()=>{Ye.current?.scrollIntoView({behavior:"smooth",block:"end"})},[pe.length]);const Ot=v.useMemo(()=>t.filter(ue=>ue.authType==="oauth2"),[t]),Dt=Ot.find(ue=>ue.id===o);v.useEffect(()=>{o&&(Ot.some(ue=>ue.id===o)||c(""))},[Ot,o]);const kt=v.useMemo(()=>{const ue=ce?.stepStates.length??0,Ie=ce?.stepStates.filter(Wt=>Wt.status==="completed"||Wt.status==="skipped").length??0,ct=ce?.stepStates.filter(Wt=>Wt.status==="failed").length??0,bt=ue>0?Math.round((Ie+ct)/ue*100):0;return{total:ue,completed:Ie,failed:ct,percent:bt}},[ce]),Zt=v.useMemo(()=>(ce?.network??[]).filter(Ie=>!(je!=="all"&&Ie.stepId!==je||et==="error"&&!(Ie.phase==="response"&&(Ie.status??0)>=400)||et==="ok"&&!(Ie.phase==="response"&&(Ie.status??0)<400))),[ce?.network,je,et]),Sn=!!xe,tr=!!(ce&&(ce.status==="completed"||ce.status==="error"||ce.status==="stopped")),nr=ue=>{if(ue==="configure"||ue==="run"&&Sn||ue==="report"&&tr)return i(ue)},ba=()=>{let ue;if(d==="dcr"&&U.trim())try{ue=JSON.parse(U)}catch{throw new Error("DCR metadata JSON is invalid")}if(!Dt)throw new Error("Select an MCP server");return{profile:"latest",target:{serverName:Dt.name||Dt.id,overrides:{authorizationServerMetadataUrl:X||void 0,authorizationEndpoint:I||void 0,tokenEndpoint:Q||void 0,registrationEndpoint:$||void 0,cimdUrl:L||void 0,resourceBaseUrl:V||void 0}},registrationMethod:d,clientConfig:{preRegistered:d==="pre_registered"?{clientId:P.trim(),clientSecret:O.trim()||void 0,tokenEndpointAuthMethod:R||void 0}:void 0,dcr:d==="dcr"?{metadata:ue,tokenEndpointAuthMethod:R||void 0}:void 0,cimd:d==="cimd"?{cimdUrl:L||void 0,expectedClientId:q||void 0}:void 0},runtime:{redirectMode:h,scopes:x.split(/[,\s]+/).map(Ie=>Ie.trim()).filter(Boolean),resource:N.trim()||void 0,usePkce:j,codeChallengeMethod:"S256"},display:{showSensitiveValues:g}}},En=ue=>{We.current?.(),We.current=e.subscribeOAuthDebuggerSession(ue,Ie=>{ve(bt=>[...bt,Ie]),(Ie.type==="completed"||Ie.type==="error"||Ie.type==="stopped")&&Le(!1),e.getOAuthDebuggerSession(ue).then(bt=>{oe(bt.session),bt.session.status==="completed"&&i("report")}).catch(()=>{})})},Or=async()=>{de(!0);try{const ue=ba(),Ie=await e.createOAuthDebuggerSession(ue);Oe(Ie.sessionId),oe(Ie.session),ve([]),i("run"),En(Ie.sessionId);const ct=await e.startOAuthDebuggerSession(Ie.sessionId);oe(ct.session),Le(!0),(ct.session.status==="waiting_for_user"||ct.session.status==="waiting_for_browser_callback")&&Le(!1)}catch(ue){Re({title:"Could not start OAuth Debugger session",description:ue instanceof Error?ue.message:String(ue),variant:"destructive"})}finally{de(!1)}},kr=async()=>{if(xe)try{de(!0);const ue=await e.submitOAuthDebuggerManualCallback(xe,{redirectUrl:ge.trim()||void 0});oe(ue.session),ie(""),Le(!0)}catch(ue){Re({title:"Could not submit callback",description:ue instanceof Error?ue.message:String(ue),variant:"destructive"})}finally{de(!1)}},yr=async()=>{if(xe){Fe(!0);try{const ue=await e.stopOAuthDebuggerSession(xe);if(Le(!1),ue.status!=="running"){const Ie=await e.getOAuthDebuggerSession(xe);oe(Ie.session),Ie.session.status==="completed"?i("report"):i("run")}}catch(ue){Re({title:"Could not stop session",description:ue instanceof Error?ue.message:String(ue),variant:"destructive"})}finally{Fe(!1)}}},_n=async()=>{We.current?.(),We.current=null,oe(null),Oe(null),ve([]),Le(!1),Fe(!1),de(!1),ie(""),$e("all"),xt("all"),ye("inspector"),i("run"),await Or()},Rn=async ue=>{if(!(!xe||!ce))try{const Ie=await e.exportOAuthDebuggerSession(xe,ue);let ct="";const bt=ue==="json"?"json":ue==="raw"?"txt":"md";typeof Ie=="string"?ct=Ie:ct=`${JSON.stringify(Ie,null,2)}
|
|
143
|
+
`;const Wt=new Blob([ct],{type:"text/plain;charset=utf-8"}),on=URL.createObjectURL(Wt),Pt=document.createElement("a");Pt.href=on,Pt.download=`oauth-debugger-${xe}.${bt}`,Pt.click(),URL.revokeObjectURL(on)}catch(Ie){if(ue==="markdown"){const ct=rge(ce,pe),bt=new Blob([ct],{type:"text/markdown;charset=utf-8"}),Wt=URL.createObjectURL(bt),on=document.createElement("a");on.href=Wt,on.download=`oauth-debugger-${ce.id}.md`,on.click(),URL.revokeObjectURL(Wt);return}Re({title:"Export failed",description:Ie instanceof Error?Ie.message:String(Ie),variant:"destructive"})}},yn=xe?`${nge()}/api/oauth-debugger/sessions/${xe}/authorize`:void 0,Tn=ue=>ue==="error"?"destructive":ue==="warning"?"outline":"secondary";return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"OAuth Debugger"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Step-by-step OAuth flow debugging for MCP servers (latest MCP authorization draft profile)."})]}),s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:ege.map(ue=>{const Ie=a===ue.id,ct=ue.id==="configure"||ue.id==="run"&&Sn||ue.id==="report"&&tr;return s.jsx("button",{type:"button",onClick:()=>ct&&nr(ue.id),disabled:!ct,className:"rounded-full",children:s.jsx(Ke,{variant:Ie?"default":"outline",className:ct?"":"opacity-50",children:ue.label})},ue.id)})})]}),a==="configure"&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Et,{className:"text-base",children:"Target MCP Server"}),s.jsx(Ms,{children:"Select one MCP server from Libraries and optionally override endpoints."})]}),s.jsxs(ae,{type:"button",variant:"outline",size:"sm",onClick:()=>{n()},disabled:r,children:[s.jsx(Ba,{className:`mr-2 h-4 w-4 ${r?"animate-spin":""}`}),"Refresh Servers"]})]})}),s.jsx(Ue,{className:"space-y-3",children:s.jsxs("div",{className:"max-w-xl space-y-2",children:[s.jsx(Te,{children:"MCP Server"}),s.jsxs(Kt,{value:o,onValueChange:c,children:[s.jsx(Ut,{children:s.jsx(Gt,{placeholder:"Select an MCP server"})}),s.jsx(qt,{children:Ot.map(ue=>s.jsx(Je,{value:ue.id,children:ue.name||ue.id},ue.id))})]}),Ot.length===0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["No MCP servers with OAuth configured found. Add OAuth 2.0 auth in"," ",s.jsx("a",{href:"/libraries/servers",className:"underline text-primary",children:"Manage Servers"}),"."]}),Dt&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[Dt.transport," · ",Dt.url||Dt.command||"No URL/command"]})]})})]}),s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(Et,{className:"text-base",children:"Client Registration Method"})}),s.jsxs(Ue,{className:"space-y-3",children:[s.jsx("div",{className:"grid gap-2 md:grid-cols-3",children:[{id:"pre_registered",label:"Pre-registered client"},{id:"dcr",label:"Dynamic Client Registration (DCR)"},{id:"cimd",label:"Client ID Metadata Document (CIMD)"}].map(ue=>s.jsx("button",{type:"button",onClick:()=>f(ue.id),className:"rounded-md border p-3 text-left",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:`h-2.5 w-2.5 rounded-full ${d===ue.id?"bg-primary":"bg-muted-foreground/30"}`}),s.jsx("span",{className:"text-sm font-medium",children:ue.label})]})},ue.id))}),s.jsx("div",{className:"grid gap-3 md:grid-cols-1",children:s.jsxs("div",{className:"max-w-md space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Redirect mode"}),s.jsxs(Kt,{value:h,onValueChange:ue=>p(ue),children:[s.jsx(Ut,{children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"local_callback",children:"Local callback (recommended)"}),s.jsx(Je,{value:"manual",children:"Manual paste redirect URL"})]})]})]})}),d==="pre_registered"&&s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"client_id"}),s.jsx(it,{value:P,onChange:ue=>E(ue.target.value)})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"client_secret (optional)"}),s.jsx(it,{value:O,onChange:ue=>k(ue.target.value),type:"password"})]})]}),d==="cimd"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"CIMD URL"}),s.jsx(it,{value:L,onChange:ue=>G(ue.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(Et,{className:"text-base",children:"Runtime OAuth Inputs"})}),s.jsxs(Ue,{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Scopes (space or comma separated)"}),s.jsx(it,{value:x,onChange:ue=>S(ue.target.value),placeholder:"openid profile mcp"})]}),s.jsxs("div",{className:"flex items-center gap-2 md:col-span-2",children:[s.jsx(ha,{checked:j,onCheckedChange:ue=>w(!!ue)}),s.jsx(Te,{children:"Use PKCE (S256)"})]})]})]}),s.jsxs("details",{className:"rounded-md border bg-card p-3 shadow-sm",children:[s.jsx("summary",{className:"cursor-pointer text-sm font-medium",children:"Advanced"}),s.jsxs("div",{className:"mt-3 space-y-4",children:[s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Token endpoint auth method"}),s.jsx(it,{value:R,onChange:ue=>D(ue.target.value),placeholder:"client_secret_basic / none / client_secret_post"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Resource / audience (optional)"}),s.jsx(it,{value:N,onChange:ue=>A(ue.target.value),placeholder:"https://resource.example.com"})]})]}),d==="dcr"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"DCR metadata JSON (optional overrides)"}),s.jsx(Vs,{value:U,onChange:ue=>z(ue.target.value),className:"min-h-32 font-mono text-xs"})]}),d==="cimd"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Expected client_id (optional)"}),s.jsx(it,{value:q,onChange:ue=>H(ue.target.value)})]}),s.jsxs("div",{className:"rounded-md border bg-background p-3",children:[s.jsx("div",{className:"mb-3 text-sm font-medium",children:"Endpoint overrides"}),s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Authorization server metadata URL"}),s.jsx(it,{value:X,onChange:ue=>Z(ue.target.value),placeholder:"https://.../.well-known/oauth-authorization-server"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Resource server base URL"}),s.jsx(it,{value:V,onChange:ue=>J(ue.target.value),placeholder:"https://resource.example.com"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Authorization endpoint"}),s.jsx(it,{value:I,onChange:ue=>F(ue.target.value),placeholder:"https://.../authorize"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Token endpoint"}),s.jsx(it,{value:Q,onChange:ue=>B(ue.target.value),placeholder:"https://.../token"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Registration endpoint (DCR)"}),s.jsx(it,{value:$,onChange:ue=>ee(ue.target.value),placeholder:"https://.../register"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"CIMD URL override"}),s.jsx(it,{value:L,onChange:ue=>G(ue.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),s.jsxs(Kl,{children:[s.jsx(Vy,{className:"h-4 w-4"}),s.jsx(Gl,{children:"Secrets display"}),s.jsxs(Yl,{className:"space-y-2",children:[s.jsx("p",{children:"This debugger is configured to show full tokens/secrets in network logs and exports."}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ha,{checked:!g,onCheckedChange:ue=>y(ue===!1)}),s.jsx(Te,{children:"Hide sensitive values in inspector"})]})]})]})]})]}),s.jsx("div",{className:"flex justify-end",children:s.jsxs(ae,{type:"button",onClick:()=>{Or()},disabled:se,children:[se&&s.jsx(Zn,{className:"mr-2 h-4 w-4 animate-spin"}),"Start OAuth Debug Session"]})})]}),a==="run"&&s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{className:"grid gap-4 xl:grid-cols-[1.2fr_1fr]",children:[s.jsxs(ze,{className:"xl:col-span-1",children:[s.jsx(At,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx(Et,{className:"text-base",children:"Progress"}),s.jsx(Ms,{children:"Visual OAuth flow guide with live session events and next-step actions."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[ce?.uiHints.authorizationUrl&&yn&&s.jsx(ae,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:yn,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(oh,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{_n()},disabled:se,children:[s.jsx(Ba,{className:"mr-2 h-4 w-4"}),"Restart"]}),xe&&s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{yr()},disabled:Ne||!xe,children:[(Ne||Ce)&&Ne&&s.jsx(Zn,{className:"mr-2 h-4 w-4 animate-spin"}),s.jsx(y1,{className:"mr-2 h-4 w-4"}),"Stop Debug Session"]})]})]})}),s.jsxs(Ue,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[s.jsxs("span",{children:[kt.completed+kt.failed,"/",kt.total," steps"]}),s.jsxs("span",{children:[kt.percent,"%"]})]}),s.jsx(ag,{value:kt.percent,className:"h-2"})]}),ce?.status==="waiting_for_user"&&s.jsx(ze,{children:s.jsxs(Ue,{className:"pt-4 space-y-2",children:[s.jsx("div",{className:"text-sm font-medium",children:"Manual callback required"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Open the authorization URL, complete authentication, then paste the final redirect URL here."}),s.jsx(Vs,{value:ge,onChange:ue=>ie(ue.target.value),placeholder:"Paste the final redirect URL (with code and state)",className:"min-h-24 text-xs font-mono"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(ae,{type:"button",size:"sm",onClick:()=>{kr()},disabled:se||!ge.trim(),children:[se&&s.jsx(Zn,{className:"mr-2 h-4 w-4 animate-spin"}),"Continue"]}),ce.uiHints.authorizationUrl&&yn&&s.jsx(ae,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx("a",{href:yn,target:"_blank",rel:"noopener noreferrer",children:"Open Authorization URL"})})]})]})}),ce?.status==="waiting_for_browser_callback"&&s.jsxs(Kl,{children:[s.jsx(Vy,{className:"h-4 w-4"}),s.jsx(Gl,{children:"Waiting for browser callback"}),s.jsxs(Yl,{className:"space-y-1",children:[s.jsx("p",{className:"text-xs",children:"Complete the authorization flow in your browser. MCP Lab is listening for the callback at:"}),s.jsx("p",{className:"text-xs font-mono break-all",children:ce.uiHints.callbackUrl}),ce.uiHints.authorizationUrl&&yn&&s.jsx("div",{className:"pt-2",children:s.jsx(ae,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:yn,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(oh,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})})})]})]}),s.jsx("div",{className:"space-y-2",children:ce?.stepStates.map(ue=>s.jsxs("div",{className:"rounded-md border p-3",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium",children:ue.title}),s.jsx("div",{className:"text-xs text-muted-foreground",children:ue.description})]}),s.jsx(Ke,{variant:ue.status==="failed"?"destructive":ue.status==="completed"?"outline":ue.status==="active"?"secondary":"outline",className:ue.status==="completed"?"border-emerald-300 bg-emerald-50 text-emerald-700":void 0,children:ue.status})]}),ue.outcomeSummary&&s.jsx("p",{className:"mt-2 text-xs text-muted-foreground break-all",children:ue.outcomeSummary})]},ue.id))||s.jsx("p",{className:"text-sm text-muted-foreground",children:"No steps yet."})})]})]}),s.jsx("div",{className:"space-y-4 xl:col-span-1",children:s.jsxs(ze,{children:[s.jsxs(At,{className:"pb-3",children:[s.jsx(Et,{className:"text-base",children:"Inspect"}),s.jsx(Ms,{children:"Live events and network requests/responses for the OAuth flow."})]}),s.jsx(Ue,{className:"space-y-3",children:s.jsxs(rC,{value:Jt,onValueChange:ue=>ye(ue),children:[s.jsxs(Kv,{className:"grid grid-cols-2",children:[s.jsx(ki,{value:"inspector",children:"Network Inspector"}),s.jsx(ki,{value:"events",children:"Live Debug"})]}),s.jsx(Vl,{value:"events",className:"mt-3",children:s.jsxs("div",{className:"max-h-64 space-y-1 overflow-auto rounded-md border bg-muted/10 p-3 text-xs",children:[pe.length===0?s.jsx("p",{className:"text-muted-foreground",children:"No events yet."}):pe.map((ue,Ie)=>s.jsxs("div",{className:"break-all",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(ue.ts).toLocaleTimeString()}),s.jsx(Ke,{variant:"outline",className:"mr-2 text-[10px]",children:ue.type}),typeof ue.payload.message=="string"?ue.payload.message:JSON.stringify(ue.payload)]},`${ue.ts}-${Ie}`)),s.jsx("div",{ref:Ye})]})}),s.jsxs(Vl,{value:"inspector",className:"space-y-3 mt-3",children:[s.jsxs("div",{className:"grid gap-2 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Filter by step"}),s.jsxs(Kt,{value:je,onValueChange:$e,children:[s.jsx(Ut,{className:"h-8",children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"all",children:"All steps"}),(ce?.stepStates??[]).map(ue=>s.jsx(Je,{value:ue.id,children:ue.title},ue.id))]})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Filter by status"}),s.jsxs(Kt,{value:et,onValueChange:xt,children:[s.jsx(Ut,{className:"h-8",children:s.jsx(Gt,{})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"all",children:"All"}),s.jsx(Je,{value:"ok",children:"Successful responses"}),s.jsx(Je,{value:"error",children:"Error responses"})]})]})]})]}),s.jsx("div",{className:"max-h-[34rem] space-y-2 overflow-auto",children:Zt.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No network exchanges captured yet."}):Zt.map(ue=>s.jsxs("details",{className:"rounded-md border p-3",children:[s.jsx("summary",{className:"cursor-pointer list-none",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-sm font-medium",children:ue.label}),s.jsxs("div",{className:"text-xs text-muted-foreground break-all",children:[ue.method?`${ue.method} `:"",ue.url]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ke,{variant:"outline",children:ue.phase}),typeof ue.status=="number"&&s.jsx(Ke,{variant:ue.status>=400?"destructive":"secondary",children:ue.status})]})]})}),s.jsxs("div",{className:"mt-3 space-y-3",children:[s.jsxs("div",{children:[s.jsx("div",{className:"mb-1 text-xs font-medium",children:"Headers"}),s.jsx("pre",{className:"max-h-40 overflow-auto whitespace-pre rounded bg-muted p-2 text-xs",children:JSON.stringify(ue.headers,null,2)})]}),ue.bodyText&&s.jsxs("div",{children:[s.jsx("div",{className:"mb-1 text-xs font-medium",children:"Body"}),s.jsx("pre",{className:"max-h-64 overflow-auto whitespace-pre rounded bg-muted p-2 text-xs",children:ue.bodyText})]}),s.jsx("div",{className:"flex gap-2",children:s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{tge(JSON.stringify(ue,null,2))},children:[s.jsx(Ti,{className:"mr-2 h-4 w-4"}),"Copy JSON"]})})]})]},ue.id))})]})]})})]})})]})}),a==="report"&&ce&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-semibold",children:"Report / Export"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"OAuth debug session summary, validations, and trace exports."})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>i("configure"),children:"Back to Configure"}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{Rn("json")},children:[s.jsx(ma,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{Rn("markdown")},children:[s.jsx(ma,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",onClick:()=>{Rn("raw")},children:[s.jsx(ma,{className:"mr-2 h-4 w-4"}),"Copy/Export Raw Trace"]})]})]}),s.jsxs(Kl,{children:[s.jsx(Vy,{className:"h-4 w-4"}),s.jsx(Gl,{children:"Secrets display mode"}),s.jsx(Yl,{children:g?"This session is configured to show full tokens and secrets in network logs/exports.":"Sensitive values are hidden in the inspector for this session."})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[s.jsx(ze,{children:s.jsxs(Ue,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Status"}),s.jsx("div",{className:"text-lg font-semibold",children:ce.status})]})}),s.jsx(ze,{children:s.jsxs(Ue,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Requests"}),s.jsx("div",{className:"text-lg font-semibold",children:ce.networkSummary.requestCount})]})}),s.jsx(ze,{children:s.jsxs(Ue,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Network errors"}),s.jsx("div",{className:"text-lg font-semibold",children:ce.networkSummary.errorCount})]})}),s.jsx(ze,{children:s.jsxs(Ue,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Validation findings"}),s.jsx("div",{className:"text-lg font-semibold",children:ce.validations.length})]})})]}),s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(Et,{className:"text-base",children:"Key values"})}),s.jsxs(Ue,{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(Te,{className:"text-xs",children:"Issuer"}),s.jsx("p",{className:"text-sm break-all",children:ce.summary?.issuer||"-"})]}),s.jsxs("div",{children:[s.jsx(Te,{className:"text-xs",children:"Client ID"}),s.jsx("p",{className:"text-sm break-all",children:ce.summary?.clientId||"-"})]}),s.jsxs("div",{children:[s.jsx(Te,{className:"text-xs",children:"Redirect URI"}),s.jsx("p",{className:"text-sm break-all",children:ce.summary?.redirectUri||"-"})]}),s.jsxs("div",{children:[s.jsx(Te,{className:"text-xs",children:"Token endpoint status"}),s.jsx("p",{className:"text-sm",children:ce.summary?.tokenEndpointStatus??"-"})]}),s.jsxs("div",{children:[s.jsx(Te,{className:"text-xs",children:"Token type"}),s.jsx("p",{className:"text-sm",children:ce.summary?.tokenType||"-"})]}),s.jsxs("div",{children:[s.jsx(Te,{className:"text-xs",children:"Scopes granted"}),s.jsx("p",{className:"text-sm break-all",children:(ce.summary?.grantedScopes??[]).join(", ")||"-"})]})]})]}),s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(Et,{className:"text-base",children:"Validation findings"})}),s.jsx(Ue,{className:"space-y-2",children:ce.validations.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No validation findings recorded."}):ce.validations.map((ue,Ie)=>s.jsxs("div",{className:"rounded-md border p-3",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"inline-flex h-5 min-w-5 items-center justify-center rounded-full border bg-muted px-1 text-[10px] font-semibold text-muted-foreground",children:Ie+1}),s.jsx("span",{className:"font-bold",children:ue.title})]}),s.jsx(Ke,{variant:Tn(ue.severity),children:ue.severity})]}),s.jsxs("p",{className:"text-sm",children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",ue.detail]}),ue.recommendation&&s.jsxs("div",{className:"mt-2 rounded-md border px-2.5 py-2 text-xs",children:[s.jsx("div",{className:"mb-1 font-medium text-muted-foreground",children:"Suggested improvement"}),s.jsx("p",{children:ue.recommendation})]}),s.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Step: ",ue.stepId,ue.specReference&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("a",{href:ue.specReference,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"Spec reference"})]})]})]},ue.id))})]})]})]})}const f1="mcplab.runEvaluation.activeJobId",sge=()=>{const[e]=Mc(),[t,n]=v.useState(""),[r,a]=v.useState("1"),[i,o]=v.useState(!1),[c,d]=v.useState(0),[f,h]=v.useState([]),[p,g]=v.useState(!1),[y,j]=v.useState(!1),[w,x]=v.useState(""),[S,N]=v.useState(null),[A,P]=v.useState([]),[E,O]=v.useState([]),[k,R]=v.useState(!0),[D,U]=v.useState(""),[z,L]=v.useState(!1),G=v.useRef(null),q=v.useRef(null),H=v.useRef(null),{configs:X,reload:Z}=cf(),{source:I}=An(),F=jf("snapshots",!1),{agents:Q,scenarios:B}=Va(),$=X.find(ve=>ve.id===t),ee=e.get("configId"),V=v.useMemo(()=>{if(!$)return[];const ve=new Map,Ce=$.agentEntries&&$.agentEntries.length>0?$.agentEntries:$.agents.map(Le=>({kind:"inline",agent:Le}));for(const Le of Ce){if(Le.kind==="inline"){const de=Le.agent.id;ve.has(de)||ve.set(de,Le.agent);continue}const se=Q.find(de=>de.id===Le.ref);se&&!ve.has(se.id)&&ve.set(se.id,se)}return Array.from(ve.values())},[$,Q]),J=v.useMemo(()=>{if(!$)return[];const ve=new Map,Ce=$.scenarioEntries&&$.scenarioEntries.length>0?$.scenarioEntries:$.scenarios.map(Le=>({kind:"inline",scenario:Le}));for(const Le of Ce){if(Le.kind==="inline"){ve.has(Le.scenario.id)||ve.set(Le.scenario.id,Le.scenario);continue}const se=B.find(de=>de.id===Le.ref);se&&!ve.has(se.id)&&ve.set(se.id,se)}return Array.from(ve.values())},[$,B]);v.useEffect(()=>{ee&&X.some(ve=>ve.id===ee)&&n(ee)},[ee,X]),v.useEffect(()=>{if(!$){P([]),O([]);return}const ve=V.filter(Ce=>($.runDefaults?.selectedAgentNames??[]).includes(Ce.id)).map(Ce=>Ce.id);P(ve.length>0?ve:V.map(Ce=>Ce.id)),O(J.map(Ce=>Ce.id)),R(!0)},[$?.id,$?.sourcePath,V,J]);const ge=async()=>{if(!$?.sourcePath){h(se=>[...se,`[${new Date().toLocaleTimeString()}] Missing source path for selected config.`]);return}const ve=V.filter(se=>A.includes(se.id));if(ve.length===0){h(se=>[...se,`[${new Date().toLocaleTimeString()}] Select at least one agent.`]);return}const Ce=J.filter(se=>E.includes(se.id));if(Ce.length===0){h(se=>[...se,`[${new Date().toLocaleTimeString()}] Select at least one test.`]);return}o(!0),g(!1),j(!1),x("");const Le=($.serverEntries??[]).some(se=>se.kind==="referenced")||($.agentEntries??[]).some(se=>se.kind==="referenced")||($.scenarioEntries??[]).some(se=>se.kind==="referenced")?"refs-composed":"single-file/inline";h([`[${new Date().toLocaleTimeString()}] Starting evaluation run...`,`[${new Date().toLocaleTimeString()}] Config=${$.name} mode=${Le} agents=${ve.map(se=>se.name||se.id).join(", ")} tests=${Ce.map(se=>se.id).join(", ")} runs=${Number(r)} snapshotEval=${F&&k?"on":"off"}`]),d(10);try{const{jobId:se}=await I.startRun({configPath:$.sourcePath,runsPerScenario:Number(r),agents:ve.map(de=>de.id),scenarioIds:Ce.map(de=>de.id),applySnapshotEval:F?k:!1});N(se),Oe(se),pe(se)}catch(se){const de=se instanceof Error?se.message:String(se),Ne=de.includes("Anthropic model not found")?" Hint: this usually means the API key works but the model ID is not enabled for that Anthropic account. Change the agent model in Manage Agents (library) or inline config.":"";h(Fe=>[...Fe,`[${new Date().toLocaleTimeString()}] Error: ${de}${Ne}`]),o(!1),d(0),N(null)}},ie=()=>{ge()},ce=()=>{q.current&&clearInterval(q.current),S&&I.stopRun(S),H.current?.(),H.current=null,xe(),N(null),o(!1),g(!1),j(!0),h(ve=>[...ve,`[${new Date().toLocaleTimeString()}] Run aborted by user.`])},oe=async()=>{if(w){L(!0);try{const ve=await I.createSnapshotFromRun(w,D.trim()||void 0);Re({title:"Snapshot saved",description:`Created ${ve.name} (${ve.id})`}),D.trim()||U(ve.name)}catch(ve){Re({title:"Could not save snapshot",description:ve instanceof Error?ve.message:String(ve),variant:"destructive"})}finally{L(!1)}}};v.useEffect(()=>{G.current&&(G.current.scrollTop=G.current.scrollHeight)},[f]),v.useEffect(()=>()=>{q.current&&clearInterval(q.current),H.current?.()},[]),v.useEffect(()=>{if(S||p)return;let ve="";try{ve=sessionStorage.getItem(f1)??""}catch{ve=""}if(ve)return N(ve),o(!0),g(!1),j(!1),h(Ce=>Ce.length>0?Ce:[`[${new Date().toLocaleTimeString()}] Reattached to in-progress evaluation run...`]),pe(ve),()=>{}},[S,p]),v.useEffect(()=>{Z();const ve=()=>{Z()};return window.addEventListener("focus",ve),()=>{window.removeEventListener("focus",ve)}},[Z]);const xe=()=>{try{sessionStorage.removeItem(f1)}catch{}},Oe=ve=>{try{sessionStorage.setItem(f1,ve)}catch{}},pe=ve=>{H.current?.(),H.current=I.subscribeRunJob(ve,Ce=>{const Le=new Date(Ce.ts).toLocaleTimeString();if(Ce.type==="started"&&(h(se=>{const de=`[${Le}] Run started.`;return se.includes(de)?se:[...se,de]}),d(se=>Math.max(se,30)),j(!1)),Ce.type==="log"){const se=String(Ce.payload.message??"").trim();se&&(h(de=>{const Ne=`[${Le}] ${se}`;return de.includes(Ne)?de:[...de,Ne]}),d(de=>{const Ne=se.toLowerCase();return Ne.startsWith("loading mcp evaluation config")?Math.max(de,15):Ne.startsWith("loaded config")?Math.max(de,20):Ne.startsWith("selected ")?Math.max(de,30):Ne.startsWith("using requested agents")||Ne.startsWith("using resolved default agents")?Math.max(de,35):Ne.startsWith("expanded to ")?Math.max(de,45):Ne.startsWith("running evaluation")?Math.max(de,55):Ne.startsWith("evaluation execution finished")?Math.max(de,75):Ne.startsWith("applying snapshot evaluation policy")?Math.max(de,82):Ne.includes("snapshot evaluation applied")||Ne.includes("snapshot evaluation enabled")?Math.max(de,88):Ne.startsWith("writing results to ")?Math.max(de,94):Ne.startsWith("run finished:")?Math.max(de,98):de}))}if(Ce.type==="completed"){const se=String(Ce.payload.runId??"");if(h(de=>{const Ne=`[${Le}] Run completed.`;return de.includes(Ne)?de:[...de,Ne]}),Ce.payload.snapshotEval&&typeof Ce.payload.snapshotEval=="object"){const de=Ce.payload.snapshotEval;h(Ne=>{const Fe=`[${Le}] Snapshot eval (${de.mode??"warn"}) baseline=${de.baseline_snapshot_id??"-"} score=${de.overall_score??"-"} status=${de.status??"-"}`;return Ne.includes(Fe)?Ne:[...Ne,Fe]})}d(100),o(!1),g(!0),j(!1),x(se),xe(),N(null),H.current?.(),H.current=null}if(Ce.type==="error"){const se=String(Ce.payload.message??"Unknown error"),de=se.includes("Anthropic model not found")?" Hint: this usually means the API key works but the model ID is not enabled for that Anthropic account. Change the agent model in Manage Agents (library) or inline config.":"";h(Ne=>[...Ne,`[${Le}] Error: ${se}${de}`]),o(!1),g(!1),j(!1),d(0),xe(),N(null),H.current?.(),H.current=null}})};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(Dl,{className:"h-6 w-6"}),"Run Evaluation"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Execute evaluation scenarios against MCP servers"})]}),s.jsx(ze,{children:s.jsxs(Ue,{className:"pt-6 space-y-4",children:[s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Te,{children:"MCP Evaluation"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(Kt,{value:t,onValueChange:n,children:[s.jsx(Ut,{children:s.jsx(Gt,{placeholder:"Select a config"})}),s.jsx(qt,{children:X.map(ve=>s.jsx(Je,{value:ve.id,children:ve.name},ve.id))})]}),s.jsx(ae,{type:"button",variant:"outline",size:"icon",className:"h-10 w-10 shrink-0",onClick:()=>{Z()},"aria-label":"Refresh configs",title:"Refresh configs",children:s.jsx(Ba,{className:"h-4 w-4"})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Te,{children:"Variance Runs"}),s.jsx(it,{type:"number",min:"1",max:"10",value:r,onChange:ve=>a(ve.target.value)})]})]}),$&&s.jsxs("div",{className:"space-y-2",children:[F&&$.snapshotEval?.enabled&&s.jsxs("div",{className:"rounded-md border bg-amber-500/10 p-2 text-xs text-amber-700 dark:text-amber-300",children:["Snapshot eval active (",$.snapshotEval.mode,") · baseline:"," ",s.jsx("span",{className:"font-mono",children:$.snapshotEval.baselineSnapshotId??"none"})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Te,{children:"Agents"}),s.jsx("button",{type:"button",className:"text-xs text-primary hover:underline",onClick:()=>P(V.map(ve=>ve.id)),children:"Select all"})]}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:V.map(ve=>{const Ce=A.includes(ve.id);return s.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[s.jsx(ha,{checked:Ce,onCheckedChange:Le=>{const se=Le===!0;P(de=>se?[...de,ve.id]:de.filter(Ne=>Ne!==ve.id))}}),s.jsx("span",{children:ve.name||ve.id})]},ve.id)})}),V.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents available in this config. Add inline agents or agent references."})]}),$&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Te,{children:"Tests"}),s.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[s.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>O(J.map(ve=>ve.id)),children:"Select all"}),s.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>O([]),children:"Clear"})]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[E.length," of ",J.length," selected"]}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:J.map(ve=>{const Ce=E.includes(ve.id);return s.jsxs("label",{className:"flex items-start gap-2 text-sm rounded-md border p-2",children:[s.jsx(ha,{checked:Ce,onCheckedChange:Le=>{const se=Le===!0;O(de=>se?[...de,ve.id]:de.filter(Ne=>Ne!==ve.id))}}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block font-medium",children:ve.name||ve.id}),s.jsx("span",{className:"block font-mono text-xs text-muted-foreground truncate",children:ve.id})]})]},ve.id)})})]}),F&&s.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[s.jsx(ha,{checked:k,onCheckedChange:ve=>R(ve===!0)}),s.jsx("span",{children:"Apply snapshot evaluation policy (if configured)"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(ae,{onClick:ie,disabled:i||!t||V.length>0&&A.length===0||J.length>0&&E.length===0,children:[s.jsx(Dl,{className:"mr-2 h-4 w-4"}),"Run"]}),i&&s.jsxs(ae,{variant:"destructive",onClick:ce,children:[s.jsx(y1,{className:"mr-2 h-4 w-4"}),"Stop"]})]})]})}),(i||f.length>0)&&s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Et,{className:"text-base",children:"Progress"}),s.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:[Math.round(c),"%"]})]})}),s.jsxs(Ue,{className:"space-y-4",children:[s.jsx(ag,{value:c,className:"h-2"}),s.jsx("div",{ref:G,className:"h-64 overflow-auto rounded-md border bg-muted/30 p-3 font-mono text-xs space-y-0.5",children:f.map((ve,Ce)=>s.jsx("div",{className:ve.includes("✓")?"text-success":ve.includes("aborted")?"text-destructive":"text-foreground",children:ve},Ce))})]})]}),y&&!i&&!p&&s.jsx(ze,{className:"border-amber-300/60 bg-amber-50/40",children:s.jsx(Ue,{className:"pt-6",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx(y1,{className:"h-5 w-5 text-amber-700"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"font-medium",children:"Run stopped"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"The evaluation was stopped before completion. You can start it again or clear the progress log."})]}),s.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[s.jsx(ae,{type:"button",variant:"outline",onClick:()=>{h([]),d(0),j(!1)},children:"Clear Progress"}),s.jsxs(ae,{type:"button",onClick:ie,disabled:!t,children:[s.jsx(Dl,{className:"mr-2 h-4 w-4"}),"Run Again"]})]})]})})}),p&&s.jsx(ze,{className:"border-success/50",children:s.jsxs(Ue,{className:"pt-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx($l,{className:"h-6 w-6 text-success"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Evaluation Complete"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"All scenarios have been evaluated successfully."})]}),s.jsx(ae,{asChild:!0,className:"ml-auto",children:s.jsx(yt,{to:`/results/${w||"run-a1b2c3"}${t?`?configId=${encodeURIComponent(t)}`:""}`,children:"View Results"})})]}),F&&w&&s.jsxs("div",{className:"mt-4 flex flex-wrap items-end gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Te,{className:"text-xs",children:"Snapshot name (optional)"}),s.jsx(it,{value:D,onChange:ve=>U(ve.target.value),placeholder:"e.g. baseline-v1",className:"h-8 w-64"})]}),s.jsx(ae,{type:"button",variant:"outline",size:"sm",onClick:()=>{oe()},disabled:z,children:z?"Saving...":"Save Snapshot"})]})]})})]})},ige=()=>{const{source:e}=An(),[t,n]=v.useState([]),[r,a]=v.useState(!1),[i,o]=v.useState(null),[c,d]=v.useState(!1),[f,h]=v.useState("timestamp"),[p,g]=v.useState("desc"),[y,j]=v.useState("all"),w=k=>{if(f===k){g(R=>R==="asc"?"desc":"asc");return}h(k),g(k==="timestamp"?"desc":"asc")},x=async()=>{a(!0);try{n(await e.listResults())}catch(k){Re({title:"Could not load results",description:k instanceof Error?k.message:String(k),variant:"destructive"})}finally{a(!1)}};v.useEffect(()=>{let k=!0;return a(!0),e.listResults().then(R=>{k&&n(R)}).catch(R=>{k&&Re({title:"Could not load results",description:R instanceof Error?R.message:String(R),variant:"destructive"})}).finally(()=>{k&&a(!1)}),()=>{k=!1}},[e]);const S=v.useMemo(()=>{const k=new Set;return t.forEach(R=>{R.scenarios.forEach(D=>{const U=String(D.scenarioName??"").trim(),z=String(D.scenarioId??"").trim(),L=U||z;L&&k.add(L)})}),Array.from(k).sort((R,D)=>R.localeCompare(D))},[t]),N=v.useMemo(()=>y==="all"?t:t.filter(k=>k.scenarios.some(R=>{const D=String(R.scenarioName??"").trim(),U=String(R.scenarioId??"").trim();return(D||U)===y})),[t,y]),A=v.useMemo(()=>[...N].sort((R,D)=>{let U=0;return f==="id"&&(U=R.id.localeCompare(D.id)),f==="timestamp"&&(U=new Date(R.timestamp).getTime()-new Date(D.timestamp).getTime()),f==="passRate"&&(U=R.overallPassRate-D.overallPassRate),f==="scenarios"&&(U=R.totalScenarios-D.totalScenarios),f==="avgToolCalls"&&(U=R.avgToolCalls-D.avgToolCalls),p==="asc"?U:-U}),[N,f,p]),P=k=>f!==k?s.jsx(Ml,{className:"h-3.5 w-3.5 text-muted-foreground"}):p==="asc"?s.jsx(La,{className:"h-3.5 w-3.5"}):s.jsx(It,{className:"h-3.5 w-3.5"}),E=k=>{const R=Array.from(new Map(k.scenarios.map(L=>{const G=String(L.scenarioId??"").trim(),q=String(L.scenarioName??"").trim();return!G&&!q?null:[G||q,q||G]}).filter(L=>!!L)).values()),D=Array.from(new Set(k.scenarios.map(L=>L.agentName).filter(Boolean))),U=R.slice(0,2).join(", "),z=R.length>2?` +${R.length-2}`:"";return{scenarioCount:R.length,agentCount:D.length,scenarioPreview:U?`${U}${z}`:"n/a"}},O=async k=>{d(!0);try{await e.deleteResult(k),n(R=>R.filter(D=>D.id!==k)),Re({title:"Run deleted",description:k}),o(null)}catch(R){Re({title:"Could not delete run",description:R instanceof Error?R.message:String(R),variant:"destructive"})}finally{d(!1)}};return s.jsxs("div",{className:"space-y-6",children:[s.jsx(Zs,{open:i!==null,onOpenChange:k=>{!k&&!c&&o(null)},children:s.jsxs(fs,{children:[s.jsxs(ps,{children:[s.jsx(ms,{children:"Delete run?"}),s.jsxs(vs,{children:["This will permanently remove the run artifacts from disk for"," ",s.jsx("span",{className:"font-mono",children:i??""}),"."]})]}),s.jsxs(hs,{children:[s.jsx(ys,{disabled:c,children:"Cancel"}),s.jsx(gs,{disabled:c||!i,onClick:k=>{k.preventDefault(),i&&O(i)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:c?"Deleting...":"Delete run"})]})]})}),s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(od,{className:"h-6 w-6"}),"Results"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Browse evaluation runs and open detailed results"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(Kt,{value:y,onValueChange:j,children:[s.jsx(Ut,{className:"w-[260px]",children:s.jsx(Gt,{placeholder:"Filter by scenario"})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"all",children:"All scenarios"}),S.map(k=>s.jsx(Je,{value:k,children:k},k))]})]}),s.jsx(ae,{variant:"outline",onClick:()=>{x()},disabled:r,children:r?"Refreshing...":"Refresh"})]})]}),s.jsx(ze,{children:s.jsx(Ue,{className:"p-0",children:s.jsxs(Hr,{children:[s.jsx(Kr,{children:s.jsxs(zt,{children:[s.jsx(nt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>w("id"),children:["Run ID",P("id")]})}),s.jsx(nt,{children:"Evaluated"}),s.jsx(nt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>w("timestamp"),children:["Timestamp",P("timestamp")]})}),s.jsx(nt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>w("passRate"),children:["Pass Rate",P("passRate")]})}),s.jsx(nt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>w("scenarios"),children:["Scenarios",P("scenarios")]})}),s.jsx(nt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>w("avgToolCalls"),children:["Tool Calls",P("avgToolCalls")]})}),s.jsx(nt,{className:"w-10"})]})}),s.jsx(Gr,{children:A.map(k=>s.jsxs(zt,{children:[s.jsx(He,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(yt,{to:`/results/${k.id}`,className:"font-mono text-xs text-primary hover:underline",children:k.id}),k.configId?s.jsx("div",{className:"text-[11px] text-muted-foreground",children:k.configId}):null]})}),s.jsx(He,{className:"text-[11px] text-muted-foreground",children:(()=>{const R=E(k);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",R.scenarioCount," scenario",R.scenarioCount===1?"":"s"," · ",R.agentCount," agent",R.agentCount===1?"":"s"]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:R.scenarioPreview})]})})()}),s.jsx(He,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Pm,{className:"h-3 w-3"}),new Date(k.timestamp).toLocaleString()]})}),s.jsx(He,{children:s.jsx(wo,{rate:k.overallPassRate})}),s.jsx(He,{className:"font-mono text-sm",children:k.totalScenarios}),s.jsx(He,{className:"font-mono text-sm",children:k.avgToolCalls.toFixed(0)}),s.jsx(He,{children:s.jsxs(Hc,{children:[s.jsx(Kc,{asChild:!0,children:s.jsx(ae,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Om,{className:"h-4 w-4"})})}),s.jsxs(Ko,{align:"end",children:[s.jsx(mr,{asChild:!0,children:s.jsxs(yt,{to:`/results/${k.id}`,children:[s.jsx(OU,{className:"mr-2 h-3.5 w-3.5"}),"View"]})}),s.jsxs(mr,{children:[s.jsx(ma,{className:"mr-2 h-3.5 w-3.5"}),"Export JSON"]}),s.jsxs(mr,{className:"text-destructive",onSelect:R=>{R.preventDefault(),o(k.id)},children:[s.jsx(Yr,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})})]},k.id))})]})})})]})};function id({text:e,variant:t="assistant",className:n}){const r=oge(e);return s.jsx("div",{className:Se("space-y-2",t==="system"&&"text-xs",n),children:r.map((a,i)=>s.jsx(v.Fragment,{children:lge(a,i,t)},`md-${i}`))})}function oge(e){const t=e.replace(/\r\n/g,`
|
|
144
|
+
`).split(`
|
|
145
|
+
`),n=[];let r=0;const a=o=>o.trim()==="",i=o=>o.trimStart().startsWith("```");for(;r<t.length;){const o=t[r],c=o.trim();if(a(o)){r+=1;continue}if(i(o)){const g=c.replace(/^```/,"").trim()||void 0;r+=1;const y=[];for(;r<t.length&&!i(t[r]);)y.push(t[r]),r+=1;r<t.length&&i(t[r])&&(r+=1),n.push({type:"code",lang:g,code:y.join(`
|
|
146
|
+
`)});continue}if(/^---+$/.test(c)||/^\*\*\*+$/.test(c)){n.push({type:"hr"}),r+=1;continue}if(c.startsWith(">")){const g=[];for(;r<t.length&&t[r].trim().startsWith(">");)g.push(t[r].trim().replace(/^>\s?/,"")),r+=1;n.push({type:"blockquote",text:g.join(`
|
|
147
|
+
`)});continue}const d=c.match(/^(#{1,4})\s+(.+)$/);if(d){n.push({type:"heading",level:d[1].length,text:d[2].trim()}),r+=1;continue}if(xM(t,r)){const g=bM(t[r]);r+=2;const y=[];for(;r<t.length&&t[r].includes("|")&&!a(t[r]);)y.push(bM(t[r])),r+=1;n.push({type:"table",headers:g,rows:y});continue}const f=c.match(/^\d+\.\s+/),h=c.match(/^[-*+]\s+/);if(f||h){const g=!!f,y=[];for(;r<t.length;){const j=t[r].trim();if(g?/^\d+\.\s+/.test(j):/^[-*+]\s+/.test(j)){y.push(j.replace(g?/^\d+\.\s+/:/^[-*+]\s+/,"")),r+=1;continue}a(t[r])&&(r+=1);break}n.push({type:"list",ordered:g,items:y});continue}const p=[o];for(r+=1;r<t.length;){const g=t[r],y=g.trim();if(a(g)||i(g)||/^---+$/.test(y)||/^#{1,4}\s+/.test(y)||y.startsWith(">")||xM(t,r)||/^\d+\.\s+/.test(y)||/^[-*+]\s+/.test(y))break;p.push(g),r+=1}n.push({type:"paragraph",text:p.join(`
|
|
148
|
+
`)})}return n}function xM(e,t){if(t+1>=e.length)return!1;const n=e[t].trim(),r=e[t+1].trim();return n.includes("|")?/^\|?(\s*:?-{3,}:?\s*\|)+\s*:?-{3,}:?\s*\|?$/.test(r):!1}function bM(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}function lge(e,t,n){if(e.type==="hr")return s.jsx("hr",{className:"border-border/60"});if(e.type==="heading"){const r=e.level===1?"text-base font-semibold":e.level===2?"text-sm font-semibold":"text-sm font-medium";return s.jsx("h4",{className:r,children:Cl(e.text,`${t}-h`)})}if(e.type==="paragraph")return s.jsx("p",{className:Se("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:Cl(e.text,`${t}-p`)});if(e.type==="blockquote")return s.jsx("blockquote",{className:"border-l-2 border-muted-foreground/30 pl-3 text-muted-foreground italic",children:Cl(e.text,`${t}-bq`)});if(e.type==="code")return s.jsxs("div",{className:"rounded-md border bg-muted/70",children:[e.lang&&s.jsx("div",{className:"border-b px-2 py-1 text-[10px] uppercase tracking-wide text-muted-foreground",children:e.lang}),s.jsx("pre",{className:"max-h-72 overflow-auto p-2 text-xs",children:s.jsx("code",{children:e.code})})]});if(e.type==="list"){const r=e.ordered?"ol":"ul";return s.jsx(r,{className:Se("space-y-1 pl-5",e.ordered?"list-decimal":"list-disc"),children:e.items.map((a,i)=>s.jsx("li",{className:"leading-relaxed",children:Cl(a,`${t}-li-${i}`)},`${t}-li-${i}`))})}return e.type==="table"?s.jsx("div",{className:"overflow-x-auto rounded-md border",children:s.jsxs("table",{className:"w-full min-w-[480px] border-collapse text-xs",children:[s.jsx("thead",{className:"bg-muted/40",children:s.jsx("tr",{children:e.headers.map((r,a)=>s.jsx("th",{className:"border-b px-2 py-1.5 text-left font-semibold align-top",children:Cl(r,`${t}-thc-${a}`)},`${t}-th-${a}`))})}),s.jsx("tbody",{children:e.rows.map((r,a)=>s.jsx("tr",{className:"border-t",children:r.map((i,o)=>s.jsx("td",{className:"px-2 py-1.5 align-top",children:Cl(i,`${t}-tdc-${a}-${o}`)},`${t}-td-${a}-${o}`))},`${t}-row-${a}`))})]})}):null}function Cl(e,t){return e.split(/(`[^`]+`|\*\*[^*]+\*\*|\*[^*\n]+\*|_[^_\n]+_|~~[^~\n]+~~|\[[^\]]+\]\([^)]+\))/g).filter(Boolean).map((r,a)=>{if(r.startsWith("`")&&r.endsWith("`"))return s.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.92em]",children:r.slice(1,-1)},`${t}-${a}`);if(r.startsWith("**")&&r.endsWith("**"))return s.jsx("strong",{children:r.slice(2,-2)},`${t}-${a}`);if(r.startsWith("*")&&r.endsWith("*"))return s.jsx("em",{children:r.slice(1,-1)},`${t}-${a}`);if(r.startsWith("_")&&r.endsWith("_"))return s.jsx("em",{children:r.slice(1,-1)},`${t}-${a}`);if(r.startsWith("~~")&&r.endsWith("~~"))return s.jsx("s",{children:r.slice(2,-2)},`${t}-${a}`);const i=r.match(/^\[([^\]]+)\]\(([^)]+)\)$/);return i?s.jsx("a",{href:i[2],target:"_blank",rel:"noreferrer",className:"underline underline-offset-2",children:i[1]},`${t}-${a}`):s.jsx(v.Fragment,{children:r},`${t}-${a}`)})}function cge(e){const t=e.scenarios.reduce((c,d)=>c+d.runs.filter(f=>f.passed).length,0),n=e.totalRuns-t,r={};e.scenarios.forEach(c=>c.runs.forEach(d=>d.toolCalls.forEach(f=>{r[f.name]=(r[f.name]||0)+1})));const a=Object.keys(r),i=Object.values(r),o=e.scenarios.map(c=>`
|
|
149
|
+
<div class="scenario-card">
|
|
150
|
+
<div class="scenario-header" onclick="this.parentElement.classList.toggle('open')">
|
|
151
|
+
<span class="chevron">▶</span>
|
|
152
|
+
<span class="scenario-name">${po(c.scenarioName)}</span>
|
|
153
|
+
<span class="scenario-agent">${po(c.agentName)}</span>
|
|
154
|
+
<span class="mono">${c.runs.length} runs</span>
|
|
155
|
+
<span class="badge ${c.passRate>=.8?"badge-pass":c.passRate>=.5?"badge-warn":"badge-fail"}">${Math.round(c.passRate*100)}%</span>
|
|
156
|
+
<span class="mono">${c.avgToolCalls.toFixed(1)} avg tools</span>
|
|
157
|
+
</div>
|
|
158
|
+
<div class="scenario-detail">
|
|
159
|
+
${c.runs.map(d=>`
|
|
160
|
+
<div class="run-row">
|
|
161
|
+
<span class="run-status ${d.passed?"pass":"fail"}">${d.passed?"✓":"✗"}</span>
|
|
162
|
+
<span class="mono run-label">Run #${d.runIndex+1}</span>
|
|
163
|
+
<span class="mono run-duration">${d.duration}ms</span>
|
|
164
|
+
<div class="tool-pills">
|
|
165
|
+
${d.toolCalls.map(f=>`<span class="pill">${po(f.name)} <small>${f.duration}ms</small></span>`).join("")}
|
|
166
|
+
</div>
|
|
167
|
+
${d.failureReasons.length?`<div class="failure-reasons">${d.failureReasons.map(f=>po(f)).join(", ")}</div>`:""}
|
|
168
|
+
</div>`).join("")}
|
|
169
|
+
</div>
|
|
170
|
+
</div>`).join("");return`<!DOCTYPE html>
|
|
171
|
+
<html lang="en">
|
|
172
|
+
<head>
|
|
173
|
+
<meta charset="UTF-8">
|
|
174
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
175
|
+
<title>MCPLab Report — ${po(e.id)}</title>
|
|
176
|
+
<script src="https://cdn.jsdelivr.net/npm/chart.js@4"><\/script>
|
|
177
|
+
<style>
|
|
178
|
+
*{box-sizing:border-box;margin:0;padding:0}
|
|
179
|
+
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:#f9fafb;color:#1f2937;padding:2rem;max-width:1100px;margin:0 auto}
|
|
180
|
+
h1{font-size:1.5rem;font-weight:700}
|
|
181
|
+
.mono{font-family:'JetBrains Mono',ui-monospace,monospace;font-size:.8rem}
|
|
182
|
+
.header{display:flex;align-items:center;gap:1rem;margin-bottom:.25rem}
|
|
183
|
+
.sub{font-size:.75rem;color:#6b7280;margin-bottom:1.5rem}
|
|
184
|
+
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:1rem;margin-bottom:2rem}
|
|
185
|
+
.stat{background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;padding:1rem}
|
|
186
|
+
.stat-label{font-size:.7rem;color:#6b7280;text-transform:uppercase;letter-spacing:.05em}
|
|
187
|
+
.stat-value{font-size:1.5rem;font-weight:700;margin-top:.25rem}
|
|
188
|
+
.charts{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem;margin-bottom:2rem}
|
|
189
|
+
.chart-card{background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;padding:1rem}
|
|
190
|
+
.chart-card h3{font-size:.85rem;font-weight:600;margin-bottom:.75rem}
|
|
191
|
+
canvas{max-height:220px}
|
|
192
|
+
.scenario-card{background:#fff;border:1px solid #e5e7eb;border-radius:.75rem;margin-bottom:.75rem;overflow:hidden}
|
|
193
|
+
.scenario-header{display:flex;align-items:center;gap:.75rem;padding:.75rem 1rem;cursor:pointer;font-size:.85rem}
|
|
194
|
+
.scenario-header:hover{background:#f9fafb}
|
|
195
|
+
.chevron{font-size:.6rem;transition:transform .15s;color:#9ca3af}
|
|
196
|
+
.scenario-card.open .chevron{transform:rotate(90deg)}
|
|
197
|
+
.scenario-name{font-weight:600;flex:1}
|
|
198
|
+
.scenario-agent{color:#6b7280;font-size:.8rem}
|
|
199
|
+
.scenario-detail{display:none;border-top:1px solid #e5e7eb;padding:.75rem 1rem;background:#fafafa}
|
|
200
|
+
.scenario-card.open .scenario-detail{display:block}
|
|
201
|
+
.run-row{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;padding:.5rem 0;border-bottom:1px solid #f3f4f6;font-size:.8rem}
|
|
202
|
+
.run-row:last-child{border-bottom:none}
|
|
203
|
+
.run-status{font-weight:700;font-size:1rem}
|
|
204
|
+
.run-status.pass{color:#059669}
|
|
205
|
+
.run-status.fail{color:#dc2626}
|
|
206
|
+
.run-duration{color:#6b7280}
|
|
207
|
+
.tool-pills{display:flex;flex-wrap:wrap;gap:.25rem}
|
|
208
|
+
.pill{background:#fef3c7;color:#92400e;padding:2px 8px;border-radius:9999px;font-size:.7rem;font-family:'JetBrains Mono',monospace}
|
|
209
|
+
.pill small{color:#b45309;margin-left:2px}
|
|
210
|
+
.failure-reasons{width:100%;color:#dc2626;font-size:.75rem;margin-top:.25rem}
|
|
211
|
+
.badge{padding:2px 10px;border-radius:9999px;font-size:.75rem;font-weight:600}
|
|
212
|
+
.badge-pass{background:#d1fae5;color:#065f46}
|
|
213
|
+
.badge-warn{background:#fef3c7;color:#92400e}
|
|
214
|
+
.badge-fail{background:#fee2e2;color:#991b1b}
|
|
215
|
+
.footer{text-align:center;color:#9ca3af;font-size:.7rem;margin-top:2rem;padding-top:1rem;border-top:1px solid #e5e7eb}
|
|
216
|
+
</style>
|
|
217
|
+
</head>
|
|
218
|
+
<body>
|
|
219
|
+
<div class="header">
|
|
220
|
+
<h1 class="mono">${po(e.id)}</h1>
|
|
221
|
+
<span class="badge ${e.overallPassRate>=.8?"badge-pass":e.overallPassRate>=.5?"badge-warn":"badge-fail"}">${Math.round(e.overallPassRate*100)}% pass</span>
|
|
222
|
+
</div>
|
|
223
|
+
<p class="sub">${new Date(e.timestamp).toLocaleString()} · Config hash: <span class="mono">${po(e.configHash)}</span></p>
|
|
224
|
+
|
|
225
|
+
<div class="stats">
|
|
226
|
+
<div class="stat"><div class="stat-label">Scenarios</div><div class="stat-value">${e.totalScenarios}</div></div>
|
|
227
|
+
<div class="stat"><div class="stat-label">Total Runs</div><div class="stat-value">${e.totalRuns}</div></div>
|
|
228
|
+
<div class="stat"><div class="stat-label">Pass Rate</div><div class="stat-value">${Math.round(e.overallPassRate*100)}%</div></div>
|
|
229
|
+
<div class="stat"><div class="stat-label">Avg Tool Calls</div><div class="stat-value">${e.avgToolCalls.toFixed(1)}</div></div>
|
|
230
|
+
<div class="stat"><div class="stat-label">Avg Latency</div><div class="stat-value">${e.avgLatency}ms</div></div>
|
|
231
|
+
</div>
|
|
232
|
+
|
|
233
|
+
<div class="charts">
|
|
234
|
+
<div class="chart-card"><h3>Pass / Fail</h3><canvas id="pieChart"></canvas></div>
|
|
235
|
+
<div class="chart-card"><h3>Tool Usage</h3><canvas id="barChart"></canvas></div>
|
|
236
|
+
</div>
|
|
237
|
+
|
|
238
|
+
<h2 style="font-size:1rem;font-weight:600;margin-bottom:.75rem">Scenarios</h2>
|
|
239
|
+
${o}
|
|
240
|
+
|
|
241
|
+
<div class="footer">Generated by MCPLab · ${new Date().toISOString()}</div>
|
|
242
|
+
|
|
243
|
+
<script>
|
|
244
|
+
new Chart(document.getElementById('pieChart'),{type:'doughnut',data:{labels:['Pass','Fail'],datasets:[{data:[${t},${n}],backgroundColor:['#059669','#dc2626'],borderWidth:0}]},options:{cutout:'60%',plugins:{legend:{position:'bottom',labels:{font:{size:11}}}}}});
|
|
245
|
+
new Chart(document.getElementById('barChart'),{type:'bar',data:{labels:${JSON.stringify(a)},datasets:[{data:${JSON.stringify(i)},backgroundColor:'#f59e0b',borderRadius:4}]},options:{indexAxis:'y',plugins:{legend:{display:false}},scales:{x:{grid:{display:false}},y:{grid:{display:false},ticks:{font:{family:'monospace',size:11}}}}}});
|
|
246
|
+
<\/script>
|
|
247
|
+
</body>
|
|
248
|
+
</html>`}function po(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}const uge="mcplab.resultAssistantScenarioHandoff",dge=[{label:"Summarize Run Results",description:"Highlight failures first, then notable tool usage and extracted values.",prompt:"Summarize the scenario results in this run. Highlight failed scenarios/checks first, then mention notable tool usage and extracted values."},{label:"Compare Agent Answer Quality",description:"Rank agents by completeness, depth, and recommendation quality.",prompt:"Compare the answer quality across all agents for this run. Rank them by completeness, analytical depth, and usefulness of recommendations. Highlight concrete differences in tool usage."},{label:"Explain Key Failures",description:"Use traces and tool outputs to identify likely root causes.",prompt:"Identify the most important failures in this run and explain likely root causes using the trace and tool outputs."},{label:"Compare With Previous Run",description:"Summarize changes in outcomes, tool usage, and extracted values.",prompt:"Compare this run with the previous run and summarize changes in outcomes, tool usage, and extracted values."}];function wM(e){const t=new Date().toISOString().replace(/[:]/g,"-").replace(/\..+/,"");return`mcplab/reports/result-assistant/${e}-${t}.md`}function jM(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}const fge=()=>{const{id:e}=Ic(),t=qa(),[n]=Mc(),{source:r}=An(),a=jf("snapshots",!1),{configs:i}=cf(),{scenarios:o}=Va(),[c,d]=v.useState(void 0),[f,h]=v.useState(!0),[p,g]=v.useState(new Set),[y,j]=v.useState(new Set),[w,x]=v.useState([]),[S,N]=v.useState(""),[A,P]=v.useState(null),[E,O]=v.useState(!1),[k,R]=v.useState(""),[D,U]=v.useState(""),[z,L]=v.useState(!1),[G,q]=v.useState(!1),[H,X]=v.useState(null),[Z,I]=v.useState([]),[F,Q]=v.useState([]),[B,$]=v.useState(""),[ee,V]=v.useState(!1),[J,ge]=v.useState(!1),[ie,ce]=v.useState("assistant"),[oe,xe]=v.useState(null),[Oe,pe]=v.useState(null),[ve,Ce]=v.useState(!1),[Le,se]=v.useState(""),[de,Ne]=v.useState(""),[Fe,je]=v.useState(!1),[$e,et]=v.useState(!1),[xt,Jt]=v.useState(!1),[ye,We]=v.useState([]),[Ye,Ot]=v.useState(!1),[Dt,kt]=v.useState(""),[Zt,Sn]=v.useState(null),[tr,nr]=v.useState(!1),[ba,En]=v.useState(null),Or=v.useRef(null),kr=v.useRef(null),yr=v.useCallback(async(K,he)=>{Ot(!0);try{const T=(await r.listMarkdownReports()).filter(ne=>{const be=String(ne.relativePath??""),_e=String(ne.name??"");return be.includes(K)||_e.includes(K)});if(We(T),he&&T.length>0){const ne=T.find(be=>be.relativePath===he||be.path===he||be.relativePath.endsWith(he)||be.path.endsWith(he));ne&&kt(ne.relativePath)}return T}catch{return We([]),[]}finally{Ot(!1)}},[r]);v.useEffect(()=>{if(!e)return;let K=!0;const he=H;return he&&(r.closeResultAssistantSession(he).catch(()=>{}),X(null),I([]),Q([]),pe(null)),h(!0),r.getResult(e).then(at=>{K&&(d(at),h(!1))}),()=>{K=!1}},[e,r]),v.useEffect(()=>{let K=!0;return r.listSnapshots().then(he=>{K&&x(he)}).catch(()=>{K&&x([])}),()=>{K=!1}},[r]),v.useEffect(()=>{if(!c?.id){We([]);return}let K=!0;return(async()=>{const he=await yr(c.id)})(),()=>{K=!1}},[c?.id,yr]),v.useEffect(()=>{if(ye.length===0){kt(""),Sn(null),En(null);return}(!Dt||!ye.some(K=>K.relativePath===Dt))&&kt(ye[0].relativePath)},[ye,Dt]),v.useEffect(()=>{if(!G||ie!=="reports")return;if(!Dt){Sn(null),En(null);return}let K=!0;return nr(!0),En(null),r.getMarkdownReport(Dt).then(he=>{K&&Sn(he)}).catch(he=>{K&&(Sn(null),En(he instanceof Error?he.message:String(he)))}).finally(()=>{K&&nr(!1)}),()=>{K=!1}},[G,ie,Dt,r]);const _n=n.get("configId")??"",Rn=v.useMemo(()=>{const K=_n?i.find(he=>he.id===_n):void 0;return K||(c?i.find(he=>he.id===c.configId):void 0)},[i,_n,c]),yn=v.useMemo(()=>{const K=new Map;if(Rn){for(const he of Rn.scenarios)K.set(he.id,he),he.name&&!K.has(he.name)&&K.set(he.name,he);for(const he of Rn.scenarioEntries??[]){if(he.kind!=="referenced")continue;const at=o.find(T=>T.id===he.ref);at&&(K.set(at.id,at),at.name&&K.set(at.name,at),K.has(he.ref)||K.set(he.ref,at))}}for(const he of o)K.has(he.id)||K.set(he.id,he),he.name&&!K.has(he.name)&&K.set(he.name,he);return K},[Rn,o]),Tn=v.useMemo(()=>{if(!c?.snapshotEval?.baselineSnapshotId)return"";const K=i.filter(he=>he.snapshotEval?.baselineSnapshotId===c.snapshotEval?.baselineSnapshotId);return K.length===1?K[0].id:""},[i,c?.snapshotEval?.baselineSnapshotId]);if(v.useEffect(()=>{c?.snapshotEval?.baselineSnapshotId&&N(K=>K||c.snapshotEval.baselineSnapshotId)},[c?.snapshotEval?.baselineSnapshotId]),v.useEffect(()=>{if(_n&&i.some(K=>K.id===_n)){R(_n);return}Tn&&R(K=>K||Tn)},[_n,i,Tn]),v.useEffect(()=>{if(!G)return;const K=window.setTimeout(()=>{Or.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(K)},[G,Z.length,ee]),v.useEffect(()=>()=>{H&&r.closeResultAssistantSession(H).catch(()=>{})},[H,r]),v.useEffect(()=>{const K=kr.current;if(!K)return;K.style.height="0px";const he=Math.min(K.scrollHeight,160);K.style.height=`${Math.max(40,he)}px`},[B,G]),f)return s.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Loading result..."});if(!c)return s.jsx("div",{className:"p-8 text-center text-muted-foreground",children:"Result not found"});const ue=c.scenarios.reduce((K,he)=>K+he.runs.filter(at=>at.passed).length,0),Ie=c.totalRuns-ue,ct=[{name:"Pass",value:ue,color:"hsl(152, 69%, 40%)"},{name:"Fail",value:Ie,color:"hsl(0, 72%, 51%)"}],bt={};c.scenarios.forEach(K=>K.runs.forEach(he=>he.toolCalls.forEach(at=>{bt[at.name]=(bt[at.name]||0)+1})));const Wt=Object.entries(bt).map(([K,he])=>({name:K,count:he})).sort((K,he)=>he.count-K.count),on=K=>{g(he=>{const at=new Set(he);return at.has(K)?at.delete(K):at.add(K),at})},Pt=(K,he,at,T)=>`${K}:${he}:${at}:${T}`,rr=(K,he)=>`${K}::${he}`,ln=K=>{j(he=>{const at=new Set(he);return at.has(K)?at.delete(K):at.add(K),at})},Xt=K=>{const he=!K.endsWith(":conversation");return y.has(K)?!he:he},xr=new Map((A?.scenario_results??[]).map(K=>[K.scenario_id,K])),wa=async()=>{if(!(!c||!S)){O(!0);try{const K=await r.compareSnapshot(S,c.id);P(K)}finally{O(!1)}}},ja=async K=>{const he=K||c.snapshotEval?.baselineSnapshotId;if(he){N(he),O(!0);try{const at=await r.compareSnapshot(he,c.id);P(at)}catch(at){Re({title:"Could not review drift",description:at instanceof Error?at.message:String(at),variant:"destructive"})}finally{O(!1)}}},ei=async()=>{if(!k){Re({title:"Select a configuration",description:"Choose which config should receive the new baseline.",variant:"destructive"});return}L(!0);try{const K=await r.generateSnapshotEvalBaseline(c.id,k,D.trim()||void 0);x(he=>[K.snapshot,...he.filter(at=>at.id!==K.snapshot.id)]),N(K.snapshot.id),Re({title:"Baseline updated",description:`${K.snapshot.name} is now linked to the selected config.`}),D.trim()||U(K.snapshot.name),c.snapshotEval?.applied&&ja(K.snapshot.id)}catch(K){Re({title:"Could not accept new baseline",description:K instanceof Error?K.message:String(K),variant:"destructive"})}finally{L(!1)}},Gi=async()=>{const K=B.trim();if(!K||!c)return;const he=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,at={id:he,role:"user",text:K,createdAt:new Date().toISOString()};$(""),I(T=>[...T,at]),V(!0);try{let T=H;if(!T){const be=await r.createResultAssistantSession(c.id);T=be.sessionId,X(be.session.id),Q(be.session.pendingToolCalls),pe({assistantAgentName:be.session.selectedAssistantAgentName,provider:be.session.provider,model:be.session.model}),I(_e=>{const rt=_e.some(vt=>vt.id===he),Ge=be.session.messages;return rt?[...Ge,at]:Ge})}const ne=await r.sendResultAssistantMessage(T,K);ti(ne.session)}catch(T){I(ne=>ne.filter(be=>be.id!==he)),Re({title:"MCP Labs Assistant error",description:T instanceof Error?T.message:String(T),variant:"destructive"})}finally{V(!1)}},Go=K=>{$(K),requestAnimationFrame(()=>kr.current?.focus())},ti=K=>{X(K.id),I(K.messages),Q(K.pendingToolCalls),pe({assistantAgentName:K.selectedAssistantAgentName,provider:K.provider,model:K.model})},Rr=async K=>{if(H){V(!0);try{const he=await r.approveResultAssistantToolCall(H,K);ti(he.session)}catch(he){Re({title:"Could not approve assistant action",description:he instanceof Error?he.message:String(he),variant:"destructive"})}finally{V(!1)}}},Yi=async K=>{if(H){V(!0);try{const he=await r.denyResultAssistantToolCall(H,K);ti(he.session)}catch(he){Re({title:"Could not deny assistant action",description:he instanceof Error?he.message:String(he),variant:"destructive"})}finally{V(!1)}}},Ka=(K,he)=>{ce("assistant"),q(!0),xe(he?.scenarioId??null),Z.length===0&&I([{id:`msg-${Date.now()}`,role:"assistant",text:"Ask me to explain failures, tool usage, snapshot drift, or suggest what to inspect next in this result.",createdAt:new Date().toISOString()}]),K&&$(K)},Xc=K=>{ce("reports"),q(!0)},Yo=K=>{if(!c)return;if(!oe){Re({title:"No scenario context",description:"Ask about a specific scenario or run first, then send the suggestion.",variant:"destructive"});return}const he=o.find(T=>T.id===oe)??o.find(T=>T.name===oe);if(!he){Re({title:"Scenario not found in library",description:`Could not find library scenario '${oe}' to open in Scenario Assistant.`,variant:"destructive"});return}const at=[`I am sending a suggestion from the Result Assistant for scenario '${oe}' based on run '${c.id}'.`,"Please review the suggestion, check it against the current scenario configuration, and propose concrete updates to the Checks and/or Value Capture Rules if appropriate.","","Result Assistant suggestion:",K].join(`
|
|
249
|
+
`);try{window.sessionStorage.setItem(uge,JSON.stringify({type:"result-assistant-handoff-v1",runId:c.id,configId:_n||c.configId||"",scenarioId:he.id,prompt:at,sourceReply:K})),t(`/libraries/scenarios/${encodeURIComponent(he.id)}?assistantHandoff=1`)}catch(T){Re({title:"Could not create handoff",description:T instanceof Error?T.message:String(T),variant:"destructive"})}},ea=K=>{c&&(Jt(!1),se(K),Ne(wM(c.id)),je(!1),Ce(!0))},Ga=()=>{c&&(Jt(!0),se(""),Ne(wM(c.id)),je(!1),Ce(!0))},Sa=async()=>{if(!c)return;if(!Le.trim()){Re({title:"No markdown to write",description:"The selected assistant response is empty.",variant:"destructive"});return}et(!0);try{const he=await r.applyResultAssistantReport({runId:c.id,markdown:Le,outputPath:de.trim()||void 0,overwrite:Fe});Re({title:"Markdown report written",description:typeof he.path=="string"&&he.path?he.path:he.outputPath}),await yr(c.id,typeof he.path=="string"&&he.path||he.outputPath||void 0),G&&ce("reports"),Ce(!1)}catch(he){Re({title:"Could not write markdown report",description:he instanceof Error?he.message:String(he),variant:"destructive"})}finally{et(!1)}},Qc=async K=>{try{await navigator.clipboard.writeText(K),Re({title:"Copied"})}catch(he){Re({title:"Could not copy",description:he instanceof Error?he.message:String(he),variant:"destructive"})}};return s.jsxs("div",{className:`${G?"xl:flex xl:h-[calc(100vh-2rem-48px)] xl:min-h-0 xl:flex-col xl:overflow-hidden":""}`,children:[s.jsx("div",{className:`${G?"xl:shrink-0 xl:pb-6":"mb-6"}`,children:s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[s.jsx(ae,{variant:"ghost",size:"icon",asChild:!0,children:s.jsx(yt,{to:"/results",children:s.jsx(No,{className:"h-4 w-4"})})}),s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("h1",{className:"text-2xl font-bold font-mono",children:c.id}),s.jsx(wo,{rate:c.overallPassRate}),a&&c.snapshotEval?.applied&&s.jsxs(Ke,{variant:"outline",className:"text-xs",children:["Snapshot policy · ",c.snapshotEval.mode," · ",c.snapshotEval.status]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[new Date(c.timestamp).toLocaleString()," · Config hash: ",s.jsx("span",{className:"font-mono",children:c.configHash})]}),a&&c.snapshotEval?.applied&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Baseline: ",s.jsx("span",{className:"font-mono",children:c.snapshotEval.baselineSnapshotId})," · score: ",c.snapshotEval.overallScore]})]})]}),s.jsxs("div",{className:"ml-auto flex shrink-0 flex-wrap items-center justify-end gap-2",children:[a&&c.snapshotEval?.applied&&s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>{ja()},disabled:E,children:[s.jsx(CS,{className:"h-3.5 w-3.5"}),E?"Reviewing drift...":"Review Drift"]}),s.jsxs(ae,{variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>{const K=cge(c),he=new Blob([K],{type:"text/html"}),at=URL.createObjectURL(he),T=document.createElement("a");T.href=at,T.download=`mcplab-report-${c.id}.html`,T.click(),URL.revokeObjectURL(at)},children:[s.jsx(ma,{className:"h-3.5 w-3.5"}),"Download Report"]}),s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>Xc(),disabled:Ye,children:[s.jsx(lh,{className:"h-3.5 w-3.5"}),Ye?"Reference Reports...":`Reference Reports${ye.length?` (${ye.length})`:""}`]}),s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>Ka(),children:[s.jsx(ua,{className:"h-3.5 w-3.5"}),"MCP Labs Assistant"]})]})]})}),s.jsxs("div",{className:`grid gap-6 items-start ${G?J?"xl:grid-cols-[minmax(0,1fr)_52rem] xl:flex-1 xl:min-h-0 xl:overflow-hidden":"xl:grid-cols-[minmax(0,1fr)_28rem] xl:flex-1 xl:min-h-0 xl:overflow-hidden":"grid-cols-1"}`,children:[s.jsxs("div",{className:`min-w-0 space-y-6 ${G?"xl:h-full xl:min-h-0 xl:overflow-y-auto xl:pr-2":""}`,children:[a&&c.snapshotEval?.applied&&s.jsxs(ze,{className:"border-amber-500/30",children:[s.jsx(At,{className:"pb-3",children:s.jsx(Et,{className:"text-base",children:"Snapshot Drift Review"})}),s.jsxs(Ue,{className:"space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[s.jsxs(Ke,{variant:"outline",children:["Mode: ",c.snapshotEval.mode]}),s.jsxs(Ke,{variant:"outline",children:["Status: ",c.snapshotEval.status]}),s.jsxs(Ke,{variant:"outline",children:["Overall score: ",c.snapshotEval.overallScore]}),s.jsxs(Ke,{variant:"outline",className:"font-mono",children:["Baseline: ",c.snapshotEval.baselineSnapshotId]})]}),c.snapshotEval.impactedScenarios.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Impacted scenarios: ",c.snapshotEval.impactedScenarios.join(", ")]}),s.jsxs("div",{className:"grid gap-3 lg:grid-cols-[1.2fr_1fr_auto] items-end",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Target config for baseline update"}),s.jsxs(Kt,{value:k,onValueChange:R,children:[s.jsx(Ut,{className:"h-8",children:s.jsx(Gt,{placeholder:"Select config to update"})}),s.jsx(qt,{children:i.map(K=>s.jsx(Je,{value:K.id,children:K.name},K.id))})]}),!k&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Tip: open results from the Run page to prefill the config automatically."})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"New snapshot name (optional)"}),s.jsx("div",{className:"relative",children:s.jsx("input",{value:D,onChange:K=>U(K.target.value),placeholder:`Snapshot ${c.id}`,className:"h-8 w-full rounded-md border bg-background px-2 text-xs"})})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5",onClick:()=>{ja()},disabled:E,children:[s.jsx(Ba,{className:`h-3.5 w-3.5 ${E?"animate-spin":""}`}),"Review Drift"]}),s.jsx(ae,{type:"button",size:"sm",className:"h-8",onClick:()=>{ei()},disabled:z||c.overallPassRate!==1,children:z?"Accepting...":"Accept as New Baseline"})]})]}),c.overallPassRate!==1&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"Baseline updates require a fully passing run (same rule as snapshot creation)."})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-5",children:[s.jsx(ks,{title:"Scenarios",value:c.totalScenarios,icon:g1}),s.jsx(ks,{title:"Total Runs",value:c.totalRuns,icon:t$}),s.jsx(ks,{title:"Pass Rate",value:`${Math.round(c.overallPassRate*100)}%`,icon:od}),s.jsx(ks,{title:"Avg Tool Calls",value:jM(c.avgToolCalls),icon:$l}),s.jsx(ks,{title:"Avg Latency",value:`${c.avgLatency}ms`,icon:d$})]}),s.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[s.jsxs(ze,{children:[s.jsx(At,{className:"pb-2",children:s.jsx(Et,{className:"text-base",children:"Pass / Fail"})}),s.jsxs(Ue,{className:"flex items-center justify-center",children:[s.jsxs(Zde,{width:180,height:180,children:[s.jsx(Qs,{data:ct,dataKey:"value",innerRadius:50,outerRadius:75,paddingAngle:3,children:ct.map((K,he)=>s.jsx(hv,{fill:K.color},he))}),s.jsx(Ur,{})]}),s.jsxs("div",{className:"ml-4 space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s.jsx("div",{className:"h-3 w-3 rounded-full bg-success"}),ue," passed"]}),s.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s.jsx("div",{className:"h-3 w-3 rounded-full bg-destructive"}),Ie," failed"]})]})]})]}),s.jsxs(ze,{children:[s.jsx(At,{className:"pb-2",children:s.jsx(Et,{className:"text-base",children:"Tool Usage"})}),s.jsx(Ue,{children:s.jsx(ej,{width:"100%",height:180,children:s.jsxs(Jde,{data:Wt,layout:"vertical",children:[s.jsx(Ro,{type:"number",tick:{fontSize:11}}),s.jsx(To,{type:"category",dataKey:"name",tick:{fontSize:11},width:120}),s.jsx(Ur,{}),s.jsx(Wo,{dataKey:"count",fill:"hsl(38, 92%, 50%)",radius:[0,4,4,0]})]})})})]})]}),s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx(Et,{className:"text-base",children:"Scenarios"}),s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5 px-2 text-xs",onClick:()=>Ka("Summarize the scenario results in this run. Highlight failed scenarios/checks first, then mention notable tool usage and extracted values."),children:[s.jsx(ua,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]})}),s.jsxs(Ue,{className:"p-0",children:[a&&s.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-b p-3",children:[s.jsxs("div",{className:"min-w-60 space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Snapshot"}),s.jsxs(Kt,{value:S,onValueChange:N,children:[s.jsx(Ut,{className:"h-8",children:s.jsx(Gt,{placeholder:"Select snapshot"})}),s.jsx(qt,{children:w.map(K=>s.jsx(Je,{value:K.id,children:K.name},K.id))})]})]}),s.jsx(ae,{type:"button",variant:"outline",size:"sm",disabled:!S||E,onClick:()=>{wa()},children:E?"Comparing...":"Compare Snapshot"}),A&&s.jsxs(Ke,{variant:"outline",className:"h-8 px-2 py-0 text-xs",children:["Overall snapshot score: ",A.overall_score]})]}),s.jsxs(Hr,{children:[s.jsx(Kr,{children:s.jsxs(zt,{children:[s.jsx(nt,{className:"w-8"}),s.jsx(nt,{children:"Scenario"}),s.jsx(nt,{children:"Agent"}),s.jsx(nt,{children:"Runs"}),s.jsx(nt,{children:"Pass Rate"}),s.jsx(nt,{children:"Tool Calls"}),s.jsx(nt,{children:"Snapshot"})]})}),s.jsx(Gr,{children:c.scenarios.map(K=>{const he=rr(K.scenarioId,K.agentName),at=K.scenarioName||K.scenarioId;return s.jsx(Ci,{open:p.has(he),onOpenChange:()=>on(he),asChild:!0,children:s.jsxs(s.Fragment,{children:[s.jsx(Os,{asChild:!0,children:s.jsxs(zt,{className:"cursor-pointer hover:bg-muted/50",children:[s.jsx(He,{children:s.jsx(It,{className:`h-4 w-4 transition-transform ${p.has(he)?"rotate-180":""}`})}),s.jsx(He,{className:"font-medium text-sm",children:K.scenarioName}),s.jsx(He,{className:"text-sm",children:K.agentName}),s.jsx(He,{className:"font-mono text-sm",children:K.runs.length}),s.jsx(He,{children:s.jsx(wo,{rate:K.passRate})}),s.jsx(He,{className:"font-mono text-sm",children:jM(K.avgToolCalls)}),s.jsx(He,{children:(()=>{const T=xr.get(K.scenarioId);if(!T)return s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"});const ne=T.status==="Match"?"bg-success/15 text-success":T.status==="Warn"?"bg-amber-500/15 text-amber-600":"bg-destructive/15 text-destructive";return s.jsxs(Ke,{variant:"outline",className:`text-xs ${ne}`,children:[T.status," · ",T.score]})})()})]})}),s.jsx(Ai,{asChild:!0,children:s.jsx("tr",{children:s.jsx("td",{colSpan:7,className:"p-0",children:s.jsxs("div",{className:"bg-muted/30 p-4 space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border bg-card px-3 py-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-xs font-semibold",children:"Scenario details"}),s.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[at," · ",K.agentName," · ",Math.round(K.passRate*100),"% pass rate"]})]}),s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>Ka(`Explain why scenario '${at}' failed (agent: ${K.agentName}). Summarize the likely cause from the result details and suggest what to inspect next.`,{scenarioId:K.scenarioId}),children:[s.jsx(ua,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]}),(()=>{const T=xr.get(K.scenarioId);return!T||T.reasons.length===0?null:s.jsxs("div",{className:"rounded-md border bg-card p-2",children:[s.jsx("p",{className:"mb-1 text-xs font-semibold text-muted-foreground",children:"Snapshot reasons"}),s.jsxs("p",{className:"mb-1 text-[11px] text-muted-foreground",children:["Baseline agents: ",T.baseline_agents.join(", ")||"—"," · observed agents: ",T.observed_agents.join(", ")||"—"]}),s.jsx("ul",{className:"space-y-1 text-xs text-muted-foreground",children:T.reasons.map((ne,be)=>s.jsxs("li",{children:["• ",ne]},be))})]})})(),K.runs.map(T=>s.jsxs("div",{className:"flex items-start gap-3 rounded-md border bg-card p-3 text-sm",children:[s.jsx("div",{className:"mt-0.5",children:T.passed?s.jsx($l,{className:"h-4 w-4 text-success"}):s.jsx(th,{className:"h-4 w-4 text-destructive"})}),s.jsxs("div",{className:"flex-1 space-y-1",children:[(()=>{const ne=yn.get(K.scenarioId),be=ne?mge(ne.evalRules,T.failureReasons):[],_e=be.filter(Ge=>Ge.status==="failed"),rt=be.filter(Ge=>Ge.status==="passed");return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:["Run #",T.runIndex+1]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[T.duration,"ms"]}),!T.passed&&s.jsx(Ke,{variant:"outline",className:"h-5 border-destructive/30 bg-destructive/10 text-destructive text-[10px]",children:"Failed"})]}),T.failureReasons.length>0&&s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-2",children:[s.jsxs("p",{className:"mb-1 flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-destructive",children:[s.jsx(th,{className:"h-3.5 w-3.5"}),"Failure reasons"]}),s.jsx("ul",{className:"space-y-1 text-xs text-destructive",children:T.failureReasons.map((Ge,vt)=>s.jsxs("li",{children:["• ",CM(Ge)]},vt))})]}),be.length>0&&s.jsx(Ci,{open:Xt(Pt(K.scenarioId,K.agentName,T.runIndex,"checks")),onOpenChange:()=>ln(Pt(K.scenarioId,K.agentName,T.runIndex,"checks")),children:s.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[s.jsx(Os,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full flex-wrap items-center gap-2 text-left",children:[s.jsx(It,{className:`h-3.5 w-3.5 transition-transform ${Xt(Pt(K.scenarioId,K.agentName,T.runIndex,"checks"))?"rotate-180":""}`}),s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Checks"}),s.jsxs(Ke,{variant:"outline",className:"h-5 border-success/30 bg-success/10 text-success text-[10px]",children:[rt.length," passed"]}),s.jsxs(Ke,{variant:"outline",className:`h-5 text-[10px] ${_e.length>0?"border-destructive/30 bg-destructive/10 text-destructive":""}`,children:[_e.length," failed"]})]})}),s.jsx(Ai,{children:s.jsx("div",{className:"space-y-1",children:be.map((Ge,vt)=>s.jsxs("div",{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${Ge.status==="failed"?"border-destructive/20 bg-destructive/5":"border-success/20 bg-success/5"}`,children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[Ge.status==="failed"?s.jsx(th,{className:"h-3.5 w-3.5 shrink-0 text-destructive"}):s.jsx($l,{className:"h-3.5 w-3.5 shrink-0 text-success"}),s.jsx("span",{className:"font-medium",children:gge(Ge.rule)})]}),Ge.failureReason&&s.jsx("p",{className:"mt-1 pl-5 text-[11px] text-destructive",children:CM(Ge.failureReason)})]}),s.jsx(Ke,{variant:"outline",className:`shrink-0 text-[10px] ${Ge.status==="failed"?"border-destructive/30 text-destructive":"border-success/30 text-success"}`,children:Ge.status})]},`${Ge.rule.type}-${Ge.rule.value}-${vt}`))})})]})})]})})(),s.jsx(Ci,{open:Xt(Pt(K.scenarioId,K.agentName,T.runIndex,"extracts")),onOpenChange:()=>ln(Pt(K.scenarioId,K.agentName,T.runIndex,"extracts")),children:s.jsxs("div",{className:"rounded-md border border-violet-500/20 bg-violet-500/5 p-2",children:[s.jsx(Os,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full flex-wrap items-center justify-between gap-2 text-left",children:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s.jsx(It,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Xt(Pt(K.scenarioId,K.agentName,T.runIndex,"extracts"))?"rotate-180":""}`}),s.jsxs("p",{className:"flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:[s.jsx(g1,{className:"h-3.5 w-3.5 text-violet-600"}),"Extracted values"]})]}),s.jsxs(Ke,{variant:"outline",className:"h-5 text-[10px]",children:[Object.keys(T.extractedValues??{}).length," total"]})]})}),s.jsx(Ai,{children:Object.keys(T.extractedValues??{}).length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No extracted values captured for this run."}):s.jsx("div",{className:"grid gap-1.5 sm:grid-cols-2",children:Object.entries(T.extractedValues??{}).map(([ne,be])=>s.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5 text-xs",children:[s.jsx("div",{className:"mb-0.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:ne}),s.jsx("div",{className:"font-mono break-all text-foreground",children:be===null?"null":String(be)})]},ne))})})]})}),s.jsx(Ci,{open:Xt(Pt(K.scenarioId,K.agentName,T.runIndex,"tools")),onOpenChange:()=>ln(Pt(K.scenarioId,K.agentName,T.runIndex,"tools")),children:s.jsxs("div",{className:"rounded-md border border-sky-500/20 bg-sky-500/5 p-2",children:[s.jsx(Os,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full flex-wrap items-center justify-between gap-2 text-left",children:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[s.jsx(It,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Xt(Pt(K.scenarioId,K.agentName,T.runIndex,"tools"))?"rotate-180":""}`}),s.jsxs("p",{className:"flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:[s.jsx(Rs,{className:"h-3.5 w-3.5 text-sky-600"}),"Tool call sequence"]})]}),s.jsxs(Ke,{variant:"outline",className:"h-5 text-[10px]",children:[T.toolCalls.length," total"]})]})}),s.jsx(Ai,{children:s.jsx("div",{className:"flex flex-wrap gap-1",children:T.toolCalls.map((ne,be)=>s.jsxs(Ke,{variant:"outline",className:"font-mono text-xs bg-background",children:[s.jsxs("span",{className:"mr-1 text-muted-foreground",children:["#",be+1]}),ne.name,s.jsxs("span",{className:"ml-1 text-muted-foreground",children:[ne.duration,"ms"]})]},be))})})]})}),s.jsx(Ci,{open:Xt(Pt(K.scenarioId,K.agentName,T.runIndex,"final")),onOpenChange:()=>ln(Pt(K.scenarioId,K.agentName,T.runIndex,"final")),children:s.jsxs("div",{className:"rounded-md border border-muted-foreground/20 bg-card p-2",children:[s.jsx(Os,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full items-center gap-2 text-left",children:[s.jsx(It,{className:`h-3.5 w-3.5 transition-transform ${Xt(Pt(K.scenarioId,K.agentName,T.runIndex,"final"))?"rotate-180":""}`}),s.jsxs("p",{className:"flex items-center gap-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:[s.jsx(fa,{className:"h-3.5 w-3.5"}),"Final answer"]})]})}),s.jsx(Ai,{children:s.jsx(xS,{text:T.finalAnswer||"No final answer captured.",maxLength:1200,className:"text-xs text-foreground"})})]})}),s.jsx(Ci,{open:Xt(Pt(K.scenarioId,K.agentName,T.runIndex,"conversation")),onOpenChange:()=>ln(Pt(K.scenarioId,K.agentName,T.runIndex,"conversation")),children:s.jsxs("div",{className:"rounded-md border bg-muted/10 p-2",children:[s.jsxs("div",{className:"mb-2 flex flex-wrap items-center justify-between gap-2",children:[s.jsx(Os,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left",children:[s.jsx(It,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${Xt(Pt(K.scenarioId,K.agentName,T.runIndex,"conversation"))?"rotate-180":""}`}),s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Conversation trace"})]})}),s.jsx("div",{className:"flex flex-wrap gap-2",children:s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Ka(`Explain Run #${T.runIndex+1} for scenario '${at}'. It ${T.passed?"passed":"failed"} in ${T.duration}ms. Focus on the tool sequence and ${T.passed?"why it passed":"what caused the failure"}.`,{scenarioId:K.scenarioId}),children:[s.jsx(ua,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})})]}),s.jsx(Ai,{children:s.jsx("div",{className:"space-y-2 rounded-md border bg-muted/20 p-2",children:T.conversation.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No conversation trace captured."}):T.conversation.map(ne=>s.jsx(pge,{item:ne,fallbackUserPrompt:yn.get(K.scenarioId)?.prompt},ne.id))})}),!Xt(Pt(K.scenarioId,K.agentName,T.runIndex,"conversation"))&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"Expand to inspect user/assistant/tool messages for this run."})]})})]})]},T.runIndex))]})})})})]})},he)})})]})]})]})]}),G&&s.jsxs("div",{className:"min-w-0 space-y-0 xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(rC,{value:ie,onValueChange:K=>ce(K),className:"min-w-0 -mb-px px-3 pt-1",children:s.jsxs(Kv,{className:"h-auto w-full justify-start rounded-none border-b bg-transparent p-0",children:[s.jsx(ki,{value:"assistant",className:"-mb-px h-9 rounded-none rounded-t border border-border border-b-border bg-muted/20 px-3 text-xs text-muted-foreground data-[state=active]:z-10 data-[state=active]:bg-card data-[state=active]:text-foreground data-[state=active]:border-border data-[state=active]:border-b-card data-[state=active]:shadow-none",children:"Assistant"}),s.jsx(ki,{value:"reports",className:"-mb-px h-9 rounded-none rounded-t border border-border border-b-border bg-muted/20 px-3 text-xs text-muted-foreground data-[state=active]:z-10 data-[state=active]:bg-card data-[state=active]:text-foreground data-[state=active]:border-border data-[state=active]:border-b-card data-[state=active]:shadow-none",children:"Reports"})]})}),ie==="assistant"?s.jsxs(ze,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(At,{className:"border-b px-4 py-3",children:s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(Et,{className:"flex items-center gap-2 text-base",children:[s.jsx(ua,{className:"h-4 w-4 text-amber-500"}),"MCP Labs Assistant"]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>ge(K=>!K),children:[J?s.jsx(o_,{className:"h-3.5 w-3.5"}):s.jsx(l_,{className:"h-3.5 w-3.5"}),J?"Compact":"Expand"]}),s.jsx(ae,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>q(!1),children:"Hide"})]})]}),s.jsxs("div",{className:"flex items-baseline justify-between gap-4",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"Ask questions about this run result, failures, tool usage, and snapshot drift."}),Oe&&s.jsxs("p",{className:"shrink-0 text-[11px] text-muted-foreground",children:[Oe.assistantAgentName," (",Oe.provider,"/",Oe.model,")"]})]})]})}),s.jsxs(Ue,{className:"flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1",children:[s.jsx(Nm,{className:"min-h-0 flex-1 bg-muted/15 px-4 py-4",children:s.jsxs("div",{className:"space-y-3 pr-2",children:[Z.map((K,he)=>{const at=K.role==="user",T=K.role==="assistant",ne=K.role==="system",be=K.role==="tool",_e=K.pendingToolCallId?F.find(Vt=>Vt.id===K.pendingToolCallId):void 0,rt=T&&!!K.pendingToolCallId;if(be&&/^(Approved|Denied) tool call\b/i.test(String(K.text??"").trim()))return null;_e?.server??K.toolRequestServer;const Ge=_e?.tool??K.toolRequestName,vt=_e?.publicToolName??K.toolRequestPublicName,Be=T&&!rt&&hge(K.text,!!oe);if(rt){const Vt=Ge??vt??"unknown_tool";return Ge&&Ge.replace(/^mcplab_/,"").replace(/_/g," "),s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700",children:s.jsx(fa,{className:"h-3 w-3"})}),s.jsxs("details",{open:!!_e,className:"group min-w-0 w-full max-w-[92%] rounded-md border border-border/60 bg-background",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-3 px-3 py-2",children:[s.jsx("div",{className:"min-w-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Rs,{className:"h-3.5 w-3.5 text-muted-foreground"}),s.jsx("span",{className:"truncate text-sm font-medium",children:`Tool call ${Vt}`}),s.jsx("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-semibold ${_e?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"}`,children:_e?"Needs approval":"Completed"})]})}),s.jsx(It,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),s.jsxs("div",{className:"min-w-0 space-y-2 border-t border-border/50 px-3 py-2",children:[s.jsx(id,{text:K.text,className:"text-sm"}),_e&&s.jsxs(s.Fragment,{children:[s.jsx("pre",{className:"max-h-40 min-w-0 w-full max-w-full overflow-x-auto overflow-y-auto whitespace-pre-wrap break-words rounded border bg-muted/50 p-2 text-xs",children:s.jsx("code",{className:"break-words",children:JSON.stringify(_e.arguments??{},null,2)})}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:ee,onClick:()=>{Yi(_e.id)},children:"Deny"}),s.jsx(ae,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:ee,onClick:()=>{Rr(_e.id)},children:"Approve"})]})]})]})]})]},`${K.id??`${K.role}-${he}`}:${_e?"pending":"completed"}`)}const Ct=at||T&&!be&&!ne;return s.jsxs("div",{className:`flex items-start gap-2 ${at?"justify-end":"justify-start"}`,children:[!at&&s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700",children:ne?s.jsx(c$,{className:"h-3 w-3"}):s.jsx(fa,{className:"h-3 w-3"})}),s.jsxs("div",{className:"relative max-w-[92%]",children:[s.jsxs("div",{className:`max-w-full rounded-md border p-3 text-sm ${at?"border-primary/20 bg-primary/10":ne?"border-amber-400/30 bg-amber-50/70":be?"border-blue-300/30 bg-blue-50/50":"border-border/80 bg-background shadow-sm"}`,children:[!(at||ne)&&s.jsx("p",{className:`mb-2 text-[11px] font-semibold text-muted-foreground ${at?"text-right":""}`,children:be?"Tool":"Assistant"}),s.jsx(id,{text:K.text,className:"text-sm"}),Be&&s.jsxs("div",{className:"mt-3 flex max-w-full flex-wrap justify-end gap-2 overflow-x-auto pb-1",children:[s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Yo(K.text),children:[s.jsx(ua,{className:"h-3.5 w-3.5"}),"Send to Scenario Assistant"]}),s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>ea(K.text),children:[s.jsx(Rs,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})]}),!Be&&T&&!rt&&s.jsx("div",{className:"mt-3 flex max-w-full justify-end overflow-x-auto pb-1",children:s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>ea(K.text),children:[s.jsx(Rs,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})})]}),Ct&&s.jsx(ae,{type:"button",variant:"ghost",size:"icon",className:"absolute -right-8 bottom-1 h-6 w-6 text-muted-foreground",onClick:()=>{Qc(K.text)},"aria-label":"Copy message",title:"Copy message",children:s.jsx(Ti,{className:"h-3.5 w-3.5"})})]}),at&&s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-primary/30 bg-primary/15 text-primary",children:s.jsx(_S,{className:"h-3 w-3"})})]},K.id??`${K.role}-${he}`)}),F.filter(K=>!Z.some(he=>he.pendingToolCallId===K.id)).length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Pending actions (approve/deny)"}),F.filter(K=>!Z.some(he=>he.pendingToolCallId===K.id)).map(K=>s.jsxs("details",{open:!0,className:"group min-w-0 rounded-md border bg-background",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-2 p-3",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"break-all font-mono text-xs font-semibold",children:K.publicToolName}),s.jsxs("p",{className:"break-all text-xs text-muted-foreground",children:[K.server,"::",K.tool]})]}),s.jsx(It,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),s.jsxs("div",{className:"border-t px-3 pb-3 pt-2",children:[s.jsx("pre",{className:"max-h-48 min-w-0 w-full max-w-full overflow-x-auto overflow-y-auto whitespace-pre-wrap break-words rounded border bg-muted/50 p-2 text-xs",children:s.jsx("code",{className:"break-words",children:JSON.stringify(K.arguments??{},null,2)})}),s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(ae,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:ee,onClick:()=>{Yi(K.id)},children:"Deny"}),s.jsx(ae,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:ee,onClick:()=>{Rr(K.id)},children:"Approve"})]})]})]},K.id))]}),ee&&s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700",children:s.jsx(fa,{className:"h-3 w-3"})}),s.jsxs("div",{className:"inline-flex items-center gap-2 rounded-md border bg-background px-3 py-2 text-sm text-muted-foreground",children:[s.jsx(Zn,{className:"h-4 w-4 animate-spin"}),"Thinking..."]})]}),s.jsx("div",{ref:Or})]})}),s.jsx("div",{className:"border-t bg-background px-4 py-3",children:s.jsxs("div",{className:"rounded-xl border bg-background p-2 shadow-sm",children:[s.jsx(Vs,{ref:kr,value:B,onChange:K=>$(K.target.value),placeholder:"Ask about this result...",rows:1,className:"min-h-10 max-h-40 resize-none border-0 bg-transparent px-2 py-1 text-sm shadow-none focus-visible:ring-0 focus-visible:ring-offset-0",onKeyDown:K=>{K.key==="Enter"&&!K.shiftKey&&(K.preventDefault(),ee||Gi())}}),s.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[s.jsxs(Hc,{children:[s.jsx(Kc,{asChild:!0,children:s.jsxs(ae,{type:"button",variant:"ghost",size:"sm",className:"h-7 shrink-0 gap-1 px-1.5 text-[11px] font-normal text-muted-foreground/80 hover:text-muted-foreground",disabled:ee,children:[s.jsx(Fa,{className:"h-3 w-3"}),"Snippets",s.jsx(It,{className:"h-3 w-3"})]})}),s.jsxs(Ko,{align:"start",className:"w-[360px]",children:[s.jsx(eC,{children:"Result Assistant Snippets"}),s.jsx(tC,{}),dge.map(K=>s.jsx(mr,{className:"items-start whitespace-normal px-2 py-2",onSelect:()=>Go(K.prompt),children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("div",{className:"text-xs font-medium leading-tight",children:K.label}),s.jsx("div",{className:"text-[11px] leading-snug text-muted-foreground",children:K.description})]})},K.label))]})]}),s.jsx(ae,{type:"button",size:"icon",className:"h-8 w-8 shrink-0 rounded-full",onClick:()=>{Gi()},disabled:ee||!B.trim(),"aria-label":"Send assistant message",title:"Send assistant message",children:ee?s.jsx(Zn,{className:"h-4 w-4 animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(u$,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Ask"})]})})]})]})})]})]}):s.jsxs(ze,{className:"min-w-0 overflow-hidden rounded-t-none xl:flex xl:h-full xl:min-h-0 xl:flex-col",children:[s.jsx(At,{className:"border-b px-4 py-3",children:s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(Et,{className:"flex items-center gap-2 text-base",children:[s.jsx(lh,{className:"h-4 w-4 text-muted-foreground"}),"Reference Reports"]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(ae,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>ge(K=>!K),children:[J?s.jsx(o_,{className:"h-3.5 w-3.5"}):s.jsx(l_,{className:"h-3.5 w-3.5"}),J?"Compact":"Expand"]}),s.jsx(ae,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>q(!1),children:"Hide"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Review markdown reports for this run while keeping the result visible."})]})}),s.jsxs(Ue,{className:"flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1",children:[(Ye||ye.length===0||ye.length>1)&&s.jsx("div",{className:"border-b px-4 py-3",children:Ye?s.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading reference reports..."}):ye.length===0?s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"No reference reports for this run yet."}),s.jsxs(ae,{type:"button",size:"sm",variant:"outline",className:"shrink-0 gap-1.5",onClick:()=>Ga(),children:[s.jsx(Fa,{className:"h-3.5 w-3.5"}),"New Report"]})]}):s.jsx("div",{className:"space-y-2",children:ye.length>1?s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Selected report"}),s.jsxs(Kt,{value:Dt,onValueChange:kt,children:[s.jsx(Ut,{className:"h-8",children:s.jsx(Gt,{placeholder:"Select a report"})}),s.jsx(qt,{children:ye.map(K=>s.jsx(Je,{value:K.relativePath,children:K.name},K.path))})]})]}):null})}),s.jsx(Nm,{className:"min-h-0 flex-1 bg-muted/15 px-4 py-4",children:ye.length===0?s.jsx("div",{className:"text-sm text-muted-foreground",children:"No report selected."}):tr?s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Zn,{className:"h-4 w-4 animate-spin"}),"Loading report..."]}):ba?s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive",children:["Could not load report: ",ba]}):Zt?s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"rounded-md border bg-background p-3",children:[s.jsx("p",{className:"font-mono text-xs font-semibold",children:Zt.name}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:Zt.relativePath}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:new Date(Zt.mtime).toLocaleString()})]}),s.jsx("div",{className:"rounded-md border bg-background p-3",children:s.jsx(id,{text:Zt.content,className:"text-sm"})})]}):s.jsx("div",{className:"text-sm text-muted-foreground",children:"Select a report to preview."})})]})]})]}),s.jsx(Zs,{open:ve,onOpenChange:K=>!$e&&Ce(K),children:s.jsxs(fs,{className:"max-w-2xl",children:[s.jsxs(ps,{children:[s.jsx(ms,{children:xt?"Create markdown report":"Approve MCP action: write markdown report"}),s.jsx(vs,{children:xt?"Write a custom markdown report and save it to the workspace.":s.jsxs(s.Fragment,{children:["This will call ",s.jsx("code",{children:"mcplab_write_markdown_report"})," via the local MCPLab MCP server."]})})]}),s.jsxs("div",{className:"space-y-3",children:[!xt&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Output path"}),s.jsx(it,{value:de,onChange:K=>Ne(K.target.value),placeholder:"mcplab/reports/result-assistant/my-report.md",disabled:$e})]}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx(ha,{checked:Fe,onCheckedChange:K=>je(K===!0),disabled:$e}),s.jsx("span",{children:"Overwrite if file exists"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:xt?"Markdown content":"Markdown preview (to be written)"}),s.jsx(Vs,{value:Le,onChange:K=>se(K.target.value),rows:10,className:"font-mono text-xs",disabled:$e})]})]}),s.jsxs(hs,{children:[s.jsx(ys,{disabled:$e,children:"Cancel"}),s.jsx(gs,{onClick:K=>{K.preventDefault(),Sa()},disabled:$e,children:$e?"Writing...":xt?"Save Report":"Approve & Write"})]})]})})]})]})};function pge({item:e,fallbackUserPrompt:t}){if(e.kind==="tool_call")return s.jsx(NM,{variant:"call",title:`Tool call · ${e.toolName||"unknown"}`,text:e.text});if(e.kind==="tool_result"){const d=e.ok?s.jsx($l,{className:"h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300"}):s.jsx(th,{className:"h-3.5 w-3.5 text-rose-700 dark:text-rose-300"});return s.jsx(NM,{variant:e.ok?"result_ok":"result_error",title:`Tool result · ${e.toolName||"unknown"} · ${e.ok?"ok":"error"}${typeof e.durationMs=="number"?` · ${e.durationMs}ms`:""}`,text:e.text,icon:d})}const n=e.kind==="user_prompt",r=SM(e.text,e.kind),a=t?SM(t,"user_prompt"):"",i=n&&a.length>r.length?a:r,o=n?"User prompt":e.kind==="assistant_final"?"Agent final":"Agent",c=n?_S:fa;return s.jsxs("div",{className:`flex items-start gap-2 text-xs ${n?"justify-end":"justify-start"}`,children:[!n&&s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:s.jsx(c,{className:"h-3 w-3"})}),s.jsxs("div",{className:`max-w-[90%] rounded-md p-2 ${n?"bg-primary/10":"bg-muted/50"}`,children:[s.jsx("p",{className:`mb-1 text-[11px] font-semibold text-muted-foreground ${n?"text-right":""}`,children:o}),n?s.jsx(xS,{text:i,maxLength:280,className:"text-xs"}):s.jsx(xS,{text:i,maxLength:500,className:"text-xs"})]}),n&&s.jsx("div",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border border-primary/30 bg-primary/15 text-primary",children:s.jsx(c,{className:"h-3 w-3"})})]})}function SM(e,t){const r=String(e??"").replace(/^\s+/,"");return t==="user_prompt"?r.replace(/^user:\s*/i,""):t==="assistant_final"||t==="assistant_thought"?r.replace(/^assistant:\s*/i,""):r}function hge(e,t){if(!t)return!1;const n=String(e??"").toLowerCase();if(!n.trim())return!1;const r=["check","checks","rule","rules","regex","pattern","value capture","extract rule","update","change","replace","modify","adjust","use ","set "],a=["change ","replace ","update ","use ","set the","suggested","you should","try ","text match failed","text must match pattern"];if(["i can only read","i don't have write access","i cannot directly edit","what happened","summary"].some(h=>n.includes(h))&&!a.some(h=>n.includes(h)))return!1;const o=r.some(h=>n.includes(h)),c=a.some(h=>n.includes(h)),d=/(^|\n)\s*[-*]\s+/.test(e)||/(^|\n)\s*\d+\.\s+/.test(e),f=/["'`][^"'`\n]{2,}["'`]/.test(e);return o&&(c||d||f)}function NM({variant:e,title:t,text:n,icon:r}){const[a,i]=v.useState(!1),o={call:"border-sky-500/30 bg-sky-500/10 text-sky-700 dark:text-sky-300",result_ok:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",result_error:"border-rose-500/30 bg-rose-500/10 text-rose-700 dark:text-rose-300"};return s.jsx(Ci,{open:a,onOpenChange:i,children:s.jsxs("div",{className:`rounded-md border p-2 text-xs ${o[e]}`,children:[s.jsx(Os,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex w-full items-center justify-between gap-2 text-left",children:[s.jsxs("div",{className:"flex items-center gap-1.5 font-mono text-[11px]",children:[r??s.jsx(Rs,{className:"h-3.5 w-3.5"}),s.jsx("span",{children:t})]}),s.jsx("span",{className:"text-[11px] font-semibold",children:a?"Hide content":"Show content"})]})}),s.jsx(Ai,{children:s.jsx("p",{className:"mt-2 font-mono whitespace-pre-wrap text-foreground",children:n})})]})})}function xS({text:e,maxLength:t,className:n}){const[r,a]=v.useState(!1),i=e.length>t,o=r||!i?e:`${e.slice(0,t)}...`;return s.jsxs("div",{children:[s.jsx(id,{text:o,className:n}),i&&s.jsx("button",{type:"button",className:"mt-1 text-[11px] font-medium text-primary hover:underline",onClick:()=>a(c=>!c),children:r?"Show less":"Show all"})]})}function mge(e,t){return e.map(n=>{const r=vge(n,t);return{rule:n,status:r?"failed":"passed",failureReason:r}})}function vge(e,t){const n=e.type==="required_tool"?`Required tool not used: ${e.value}`:e.type==="forbidden_tool"?`Forbidden tool used: ${e.value}`:`Regex assertion failed: ${e.value}`,r=t.find(a=>a===n);if(r)return r;if(e.type==="response_contains"||e.type==="response_not_contains")return t.find(a=>a.startsWith("Regex assertion failed:")&&a.includes(e.value))}function gge(e){return e.type==="required_tool"?`Required tool · ${e.value}`:e.type==="forbidden_tool"?`Forbidden tool · ${e.value}`:e.type==="response_contains"?`Text must match pattern · ${e.value}`:e.type==="response_not_contains"?`Text must not match pattern · ${e.value}`:`${e.type} · ${e.value}`}function CM(e){const t=String(e??"").trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}const AM=["hsl(38, 92%, 50%)","hsl(200, 80%, 50%)","hsl(152, 69%, 40%)","hsl(280, 60%, 50%)","hsl(0, 72%, 51%)"],yge=()=>{const{source:e}=An(),t=jf("snapshots",!1),[n,r]=v.useState([]),[a,i]=v.useState(!1),[o,c]=v.useState(new Set),[d,f]=v.useState("timestamp"),[h,p]=v.useState("desc"),[g,y]=v.useState("all"),[j,w]=v.useState("runs"),[x,S]=v.useState([]),[N,A]=v.useState(""),[P,E]=v.useState(""),[O,k]=v.useState(null),R=async()=>{i(!0);try{r(await e.listResults())}catch(I){Re({title:"Could not load results",description:I instanceof Error?I.message:String(I),variant:"destructive"})}finally{i(!1)}};v.useEffect(()=>{let I=!0;return i(!0),e.listResults().then(F=>{I&&r(F)}).catch(F=>{I&&Re({title:"Could not load results",description:F instanceof Error?F.message:String(F),variant:"destructive"})}).finally(()=>{I&&i(!1)}),()=>{I=!1}},[e]),v.useEffect(()=>{let I=!0;return e.listSnapshots().then(F=>{I&&S(F)}).catch(()=>{I&&S([])}),()=>{I=!1}},[e]);const D=I=>{if(d===I){p(F=>F==="asc"?"desc":"asc");return}f(I),p(I==="timestamp"?"desc":"asc")},U=I=>{c(F=>{const Q=new Set(F);return Q.has(I)?Q.delete(I):Q.add(I),Q})},z=v.useMemo(()=>{const I=new Set;return n.forEach(F=>{F.scenarios.forEach(Q=>{const B=String(Q.scenarioName??"").trim(),$=String(Q.scenarioId??"").trim(),ee=B||$;ee&&I.add(ee)})}),Array.from(I).sort((F,Q)=>F.localeCompare(Q))},[n]),L=v.useMemo(()=>g==="all"?n:n.filter(I=>I.scenarios.some(F=>{const Q=String(F.scenarioName??"").trim(),B=String(F.scenarioId??"").trim();return(Q||B)===g})),[n,g]),G=v.useMemo(()=>[...L].sort((F,Q)=>{let B=0;return d==="id"&&(B=F.id.localeCompare(Q.id)),d==="timestamp"&&(B=new Date(F.timestamp).getTime()-new Date(Q.timestamp).getTime()),d==="passRate"&&(B=F.overallPassRate-Q.overallPassRate),d==="scenarios"&&(B=F.totalScenarios-Q.totalScenarios),h==="asc"?B:-B}),[L,d,h]),q=G.filter(I=>o.has(I.id)),H=I=>d!==I?s.jsx(Ml,{className:"h-3.5 w-3.5 text-muted-foreground"}):h==="asc"?s.jsx(La,{className:"h-3.5 w-3.5"}):s.jsx(It,{className:"h-3.5 w-3.5"}),X=I=>{const F=Array.from(new Set(I.scenarios.map(ee=>ee.scenarioId).filter(Boolean))),Q=Array.from(new Set(I.scenarios.map(ee=>ee.agentName).filter(Boolean))),B=F.slice(0,2).join(", "),$=F.length>2?` +${F.length-2}`:"";return{scenarioCount:F.length,agentCount:Q.length,scenarioPreview:B?`${B}${$}`:"n/a"}},Z=[...new Set(q.flatMap(I=>I.scenarios.map(F=>F.scenarioId)))];return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(CS,{className:"h-6 w-6"}),"Compare Runs"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Select 2–5 runs to compare"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[j==="runs"&&s.jsxs(Kt,{value:g,onValueChange:y,children:[s.jsx(Ut,{className:"w-[260px]",children:s.jsx(Gt,{placeholder:"Filter by scenario"})}),s.jsxs(qt,{children:[s.jsx(Je,{value:"all",children:"All scenarios"}),z.map(I=>s.jsx(Je,{value:I,children:I},I))]})]}),s.jsx(ae,{variant:"outline",onClick:()=>{R()},disabled:a,children:a?"Refreshing...":"Refresh"})]})]}),j==="runs"&&s.jsx(ze,{children:s.jsx(Ue,{className:"p-0",children:s.jsxs(Hr,{children:[s.jsx(Kr,{children:s.jsxs(zt,{children:[s.jsx(nt,{className:"w-10"}),s.jsx(nt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>D("id"),children:["Run ID",H("id")]})}),s.jsx(nt,{children:"Evaluated"}),s.jsx(nt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>D("timestamp"),children:["Timestamp",H("timestamp")]})}),s.jsx(nt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>D("passRate"),children:["Pass Rate",H("passRate")]})}),s.jsx(nt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>D("scenarios"),children:["Scenarios",H("scenarios")]})})]})}),s.jsx(Gr,{children:G.map(I=>s.jsxs(zt,{children:[s.jsx(He,{children:s.jsx(ha,{checked:o.has(I.id),onCheckedChange:()=>U(I.id),disabled:!o.has(I.id)&&o.size>=5})}),s.jsx(He,{className:"font-mono text-xs",children:I.id}),s.jsx(He,{className:"text-[11px] text-muted-foreground",children:(()=>{const F=X(I);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",F.scenarioCount," scenario",F.scenarioCount===1?"":"s"," · ",F.agentCount," agent",F.agentCount===1?"":"s"]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:F.scenarioPreview})]})})()}),s.jsx(He,{className:"text-xs text-muted-foreground",children:new Date(I.timestamp).toLocaleString()}),s.jsx(He,{children:s.jsx(wo,{rate:I.overallPassRate})}),s.jsx(He,{className:"font-mono text-sm",children:I.totalScenarios})]},I.id))})]})})}),j==="runs"&&q.length>=2&&s.jsxs(s.Fragment,{children:[q.length===2&&s.jsx(ze,{children:s.jsx(Ue,{className:"pt-6",children:s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Need a deeper comparison?"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Open the two selected runs in a dedicated side-by-side full result compare view."})]}),s.jsx(ae,{asChild:!0,size:"sm",children:s.jsx(yt,{to:`/compare/results?left=${encodeURIComponent(q[0].id)}&right=${encodeURIComponent(q[1].id)}&leftConfig=${encodeURIComponent(q[0].configId)}&rightConfig=${encodeURIComponent(q[1].configId)}`,children:"Compare full results"})})]})})}),s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(Et,{className:"text-base",children:"Summary Comparison"})}),s.jsx(Ue,{className:"p-0",children:s.jsxs(Hr,{children:[s.jsx(Kr,{children:s.jsxs(zt,{children:[s.jsx(nt,{children:"Metric"}),q.map((I,F)=>s.jsx(nt,{style:{color:AM[F]},className:"font-mono text-xs",children:I.id},I.id))]})}),s.jsxs(Gr,{children:[s.jsxs(zt,{children:[s.jsx(He,{className:"font-medium",children:"Pass Rate"}),q.map(I=>s.jsx(He,{children:s.jsx(wo,{rate:I.overallPassRate})},I.id))]}),s.jsxs(zt,{children:[s.jsx(He,{className:"font-medium",children:"Total Runs"}),q.map(I=>s.jsx(He,{className:"font-mono",children:I.totalRuns},I.id))]}),s.jsxs(zt,{children:[s.jsx(He,{className:"font-medium",children:"Tool Calls"}),q.map(I=>s.jsx(He,{className:"font-mono",children:I.avgToolCalls.toFixed(1)},I.id))]}),s.jsxs(zt,{children:[s.jsx(He,{className:"font-medium",children:"Avg Latency"}),q.map(I=>s.jsxs(He,{className:"font-mono",children:[I.avgLatency,"ms"]},I.id))]})]})]})})]}),s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(Et,{className:"text-base",children:"Scenario Breakdown"})}),s.jsx(Ue,{className:"p-0",children:s.jsxs(Hr,{children:[s.jsx(Kr,{children:s.jsxs(zt,{children:[s.jsx(nt,{children:"Scenario"}),q.map((I,F)=>s.jsx(nt,{style:{color:AM[F]},className:"font-mono text-xs",children:I.id},I.id))]})}),s.jsx(Gr,{children:Z.map(I=>s.jsxs(zt,{children:[s.jsx(He,{className:"font-medium text-sm",children:I}),q.map(F=>{const Q=F.scenarios.find(B=>B.scenarioId===I);return s.jsx(He,{children:Q?s.jsx(wo,{rate:Q.passRate}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},F.id)})]},I))})]})})]})]}),t&&j==="snapshot"&&s.jsxs(ze,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(Et,{className:"text-base",children:"Run vs Snapshot"})}),s.jsxs(Ue,{className:"space-y-3",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Run"}),s.jsxs(Kt,{value:P,onValueChange:E,children:[s.jsx(Ut,{children:s.jsx(Gt,{placeholder:"Select run"})}),s.jsx(qt,{children:n.map(I=>s.jsx(Je,{value:I.id,children:I.id},I.id))})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Snapshot"}),s.jsxs(Kt,{value:N,onValueChange:A,children:[s.jsx(Ut,{children:s.jsx(Gt,{placeholder:"Select snapshot"})}),s.jsx(qt,{children:x.map(I=>s.jsx(Je,{value:I.id,children:I.name},I.id))})]})]})]}),s.jsx(ae,{type:"button",variant:"outline",size:"sm",disabled:!P||!N,onClick:()=>{e.compareSnapshot(N,P).then(k)},children:"Compare"}),O&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("p",{className:"text-sm font-medium",children:["Overall score: ",O.overall_score]}),s.jsxs(Hr,{children:[s.jsx(Kr,{children:s.jsxs(zt,{children:[s.jsx(nt,{children:"Scenario"}),s.jsx(nt,{children:"Agents"}),s.jsx(nt,{children:"Score"}),s.jsx(nt,{children:"Status"}),s.jsx(nt,{children:"Reasons"})]})}),s.jsx(Gr,{children:O.scenario_results.map(I=>s.jsxs(zt,{children:[s.jsx(He,{children:I.scenario_id}),s.jsxs(He,{className:"text-xs text-muted-foreground",children:["baseline: ",I.baseline_agents.join(", ")||"—"," · observed: ",I.observed_agents.join(", ")||"—"]}),s.jsx(He,{className:"font-mono text-xs",children:I.score}),s.jsx(He,{children:I.status}),s.jsx(He,{className:"text-xs text-muted-foreground",children:I.reasons.slice(0,2).join("; ")||"—"})]},I.scenario_id))})]})]})]})]})]})},EM=(e,t)=>{const n=new URLSearchParams;return t&&n.set("configId",t),n.set("embed","1"),`/results/${encodeURIComponent(e)}?${n.toString()}`},xge=()=>{const[e]=Mc(),t=e.get("left")??"",n=e.get("right")??"",r=e.get("leftConfig"),a=e.get("rightConfig");return!t||!n?s.jsxs(ze,{children:[s.jsx(At,{children:s.jsx(Et,{className:"text-base",children:"Full Result Compare"})}),s.jsxs(Ue,{className:"space-y-3",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Select exactly two runs in Compare and use the “Compare full results” action."}),s.jsx(ae,{asChild:!0,variant:"outline",children:s.jsx(yt,{to:"/compare",children:"Back to Compare"})})]})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Full Result Compare"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Side-by-side Result Detail views for deep inspection."})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(ae,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs(yt,{to:"/compare",children:[s.jsx(EU,{className:"mr-1.5 h-4 w-4"}),"Back to Compare"]})}),s.jsx(ae,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:`/results/${encodeURIComponent(t)}${r?`?configId=${encodeURIComponent(r)}`:""}`,target:"_blank",rel:"noreferrer",children:["Open Left",s.jsx(oh,{className:"ml-1.5 h-3.5 w-3.5"})]})}),s.jsx(ae,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:`/results/${encodeURIComponent(n)}${a?`?configId=${encodeURIComponent(a)}`:""}`,target:"_blank",rel:"noreferrer",children:["Open Right",s.jsx(oh,{className:"ml-1.5 h-3.5 w-3.5"})]})})]})]}),s.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[s.jsxs(ze,{className:"overflow-hidden",children:[s.jsx(At,{className:"py-3",children:s.jsx(Et,{className:"text-sm font-mono",children:t})}),s.jsx(Ue,{className:"p-0",children:s.jsx("iframe",{title:`Result ${t}`,src:EM(t,r),className:"h-[calc(100vh-15rem)] w-full border-0"})})]}),s.jsxs(ze,{className:"overflow-hidden",children:[s.jsx(At,{className:"py-3",children:s.jsx(Et,{className:"text-sm font-mono",children:n})}),s.jsx(Ue,{className:"p-0",children:s.jsx("iframe",{title:`Result ${n}`,src:EM(n,a),className:"h-[calc(100vh-15rem)] w-full border-0"})})]})]})]})};function bge(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function wge(){const{source:e}=An(),[t,n]=v.useState([]),[r,a]=v.useState(!0),i=async()=>{a(!0);try{n(await e.listMarkdownReports())}catch(c){Re({title:"Could not load markdown reports",description:c instanceof Error?c.message:String(c),variant:"destructive"})}finally{a(!1)}};v.useEffect(()=>{i()},[]);const o=v.useMemo(()=>t[0],[t]);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"inline-flex items-center gap-2 text-2xl font-bold",children:[s.jsx(lh,{className:"h-6 w-6"}),"Markdown Reports"]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Browse Markdown files under ",s.jsx("code",{children:"mcplab/reports"}),"."]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ae,{variant:"outline",onClick:()=>{i()},children:"Refresh"}),o?s.jsx(ae,{asChild:!0,variant:"outline",children:s.jsx(yt,{to:`/markdown-reports/view?path=${encodeURIComponent(o.relativePath)}`,children:"Open latest"})}):null]})]}),s.jsx(ze,{children:s.jsx(Ue,{className:"p-0",children:r?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Loading markdown reports..."}):t.length===0?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"No markdown reports found yet."}):s.jsxs(Hr,{children:[s.jsx(Kr,{children:s.jsxs(zt,{children:[s.jsx(nt,{children:"Report"}),s.jsx(nt,{children:"Folder"}),s.jsx(nt,{children:"Timestamp"}),s.jsx(nt,{children:"Size"}),s.jsx(nt,{className:"w-10"})]})}),s.jsx(Gr,{children:t.map(c=>s.jsxs(zt,{children:[s.jsx(He,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(yt,{to:`/markdown-reports/view?path=${encodeURIComponent(c.relativePath)}`,className:"font-mono text-xs text-primary hover:underline",children:c.name}),s.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:c.relativePath})]})}),s.jsx(He,{className:"text-xs text-muted-foreground font-mono",children:c.relativePath.includes("/")?c.relativePath.slice(0,c.relativePath.lastIndexOf("/")):"."}),s.jsx(He,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Pm,{className:"h-3 w-3"}),new Date(c.mtime).toLocaleString()]})}),s.jsx(He,{className:"font-mono text-sm",children:bge(c.sizeBytes)}),s.jsx(He,{children:s.jsxs(Hc,{children:[s.jsx(Kc,{asChild:!0,children:s.jsx(ae,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Om,{className:"h-4 w-4"})})}),s.jsx(Ko,{align:"end",children:s.jsx(mr,{asChild:!0,children:s.jsx(yt,{to:`/markdown-reports/view?path=${encodeURIComponent(c.relativePath)}`,children:"View"})})})]})})]},c.path))})]})})})]})}function jge(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Sge(e){const t=e.relativePath.match(/(?:^|\/)(?:result-assistant|results?)\/([0-9]{8}-[0-9]{6})(?:-|\/)/i);return t?.[1]?t[1]:(e.content.match(/(?:^|\n)\s*\*\*Run:\*\*\s*`([^`]+)`/i)??e.content.match(/(?:^|\n)\s*Run ID:\s*([^\s]+)/i))?.[1]?.trim()||null}function Nge(){const{source:e}=An(),[t]=Mc(),n=(t.get("path")??"").trim(),[r,a]=v.useState(null),[i,o]=v.useState(!0),[c,d]=v.useState(!1),[f,h]=v.useState(!1);if(v.useEffect(()=>{let g=!0;if(a(null),d(!1),!n){o(!1);return}return o(!0),e.getMarkdownReport(n).then(y=>{g&&a(y)}).catch(y=>{if(!g)return;const j=y instanceof Error?y.message:String(y);if(j.includes("(404)")){d(!0);return}Re({title:"Could not load markdown report",description:j,variant:"destructive"})}).finally(()=>{g&&o(!1)}),()=>{g=!1}},[n,e]),!n)return s.jsxs("div",{className:"space-y-4",children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Markdown Report"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Missing report path."}),s.jsx(ae,{asChild:!0,variant:"outline",children:s.jsx(yt,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});if(i)return s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading markdown report..."});if(c||!r)return s.jsxs("div",{className:"space-y-4",children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Markdown Report"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Report not found."}),s.jsx(ae,{asChild:!0,variant:"outline",children:s.jsx(yt,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});const p=Sge(r);return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("h1",{className:"font-mono text-xl font-semibold",children:r.name}),s.jsx("p",{className:"truncate text-sm text-muted-foreground",children:r.relativePath}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[new Date(r.mtime).toLocaleString()," "," · "," ",jge(r.sizeBytes)]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[p?s.jsxs(s.Fragment,{children:[s.jsx(ae,{variant:"outline",size:"sm",onClick:()=>h(!0),children:"Open Result Panel"}),s.jsx(ae,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(yt,{to:`/results/${encodeURIComponent(p)}`,children:"Open Result"})})]}):null,s.jsx(ae,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(yt,{to:"/markdown-reports",children:"Back to reports"})})]})]}),s.jsx(ze,{children:s.jsx(Ue,{className:"pt-6",children:s.jsx(id,{text:r.content,variant:"assistant"})})}),p?s.jsx(YD,{open:f,onOpenChange:h,children:s.jsxs(KS,{side:"right",className:"w-[96vw] max-w-none p-0 sm:max-w-5xl",children:[s.jsx(QD,{className:"border-b px-4 py-3 pr-12",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(JD,{className:"text-base",children:["Result ",p]}),s.jsx(ae,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(yt,{to:`/results/${encodeURIComponent(p)}`,target:"_blank",rel:"noreferrer",children:"Open full page"})})]})}),s.jsx("div",{className:"h-[calc(100vh-64px)]",children:s.jsx("iframe",{title:`Result ${p}`,src:`/results/${encodeURIComponent(p)}?embed=1`,className:"h-full w-full border-0"})})]})}):null]})}const Cge=()=>{const e=Ks();return v.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),s.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),s.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},Age=new dV,Ege=()=>s.jsx(pV,{client:Age,children:s.jsx(J$,{children:s.jsx(SG,{children:s.jsx(EG,{children:s.jsxs(AG,{children:[s.jsx(yq,{}),s.jsx(Xq,{}),s.jsx(hH,{children:s.jsxs(sH,{children:[s.jsxs(fn,{element:s.jsx(CG,{}),children:[s.jsx(fn,{path:"/",element:s.jsx(efe,{})}),s.jsx(fn,{path:"/mcp-evaluations",element:s.jsx(kpe,{})}),s.jsx(fn,{path:"/mcp-evaluations/:id",element:s.jsx(rM,{})}),s.jsx(fn,{path:"/mcp-evaluations/:id/:tab",element:s.jsx(rM,{})}),s.jsx(fn,{path:"/tool-analysis",element:s.jsx(Qve,{})}),s.jsx(fn,{path:"/tool-analysis-results",element:s.jsx(Jve,{})}),s.jsx(fn,{path:"/tool-analysis-results/:id",element:s.jsx(Zve,{})}),s.jsx(fn,{path:"/oauth-debugger",element:s.jsx(age,{})}),s.jsx(fn,{path:"/libraries/servers",element:s.jsx(gme,{})}),s.jsx(fn,{path:"/libraries/servers/:serverId",element:s.jsx(xme,{})}),s.jsx(fn,{path:"/libraries/agents",element:s.jsx(bme,{})}),s.jsx(fn,{path:"/libraries/agents/:agentName",element:s.jsx(Rve,{})}),s.jsx(fn,{path:"/libraries/scenarios",element:s.jsx(dM,{})}),s.jsx(fn,{path:"/libraries/scenarios/:scenarioId",element:s.jsx(dM,{})}),s.jsx(fn,{path:"/settings",element:s.jsx(Tve,{})}),s.jsx(fn,{path:"/run",element:s.jsx(sge,{})}),s.jsx(fn,{path:"/results",element:s.jsx(ige,{})}),s.jsx(fn,{path:"/results/:id",element:s.jsx(fge,{})}),s.jsx(fn,{path:"/markdown-reports",element:s.jsx(wge,{})}),s.jsx(fn,{path:"/markdown-reports/view",element:s.jsx(Nge,{})}),s.jsx(fn,{path:"/compare",element:s.jsx(yge,{})}),s.jsx(fn,{path:"/compare/results",element:s.jsx(xge,{})})]}),s.jsx(fn,{path:"*",element:s.jsx(Cge,{})})]})})]})})})})});j7.createRoot(document.getElementById("root")).render(s.jsx(Ege,{}));
|