@inspectr/mcplab 1.7.0 → 1.8.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.
Files changed (48) hide show
  1. package/README.md +14 -1
  2. package/dist/app/assets/index-DHs9MRuO.css +1 -0
  3. package/dist/app/assets/index-UuO3yMWK.js +253 -0
  4. package/dist/app/index.html +2 -2
  5. package/dist/app-server/app-context.d.ts +129 -75
  6. package/dist/app-server/oauth-debugger-domain.d.ts +7 -0
  7. package/dist/app-server/oauth-debugger-domain.d.ts.map +1 -1
  8. package/dist/app-server/oauth-debugger-domain.js +47 -4
  9. package/dist/app-server/oauth-debugger-domain.js.map +1 -1
  10. package/dist/app-server/oauth-runtime-domain.d.ts +53 -42
  11. package/dist/app-server/oauth-runtime-domain.d.ts.map +1 -1
  12. package/dist/app-server/oauth-runtime-domain.js +1 -3
  13. package/dist/app-server/oauth-runtime-domain.js.map +1 -1
  14. package/dist/app-server/oauth-runtime-routes.d.ts +2 -0
  15. package/dist/app-server/oauth-runtime-routes.d.ts.map +1 -1
  16. package/dist/app-server/oauth-runtime-routes.js +27 -1
  17. package/dist/app-server/oauth-runtime-routes.js.map +1 -1
  18. package/dist/app-server/oauth-session-manager.d.ts +51 -0
  19. package/dist/app-server/oauth-session-manager.d.ts.map +1 -0
  20. package/dist/app-server/oauth-session-manager.js +338 -0
  21. package/dist/app-server/oauth-session-manager.js.map +1 -0
  22. package/dist/app-server/router.d.ts.map +1 -1
  23. package/dist/app-server/router.js +11 -4
  24. package/dist/app-server/router.js.map +1 -1
  25. package/dist/app-server/runs-routes.d.ts +3 -4
  26. package/dist/app-server/runs-routes.d.ts.map +1 -1
  27. package/dist/app-server/runs-routes.js +229 -28
  28. package/dist/app-server/runs-routes.js.map +1 -1
  29. package/dist/app-server/scenario-assistant-domain.d.ts +133 -139
  30. package/dist/app-server/scenario-assistant-domain.d.ts.map +1 -1
  31. package/dist/app-server/scenario-assistant-domain.js +270 -5
  32. package/dist/app-server/scenario-assistant-domain.js.map +1 -1
  33. package/dist/app-server/scenario-assistant.d.ts +11 -25
  34. package/dist/app-server/scenario-assistant.d.ts.map +1 -1
  35. package/dist/app-server/scenario-assistant.js +18 -2
  36. package/dist/app-server/scenario-assistant.js.map +1 -1
  37. package/dist/app-server/tool-analysis-domain.d.ts +3 -4
  38. package/dist/app-server/tool-analysis-domain.d.ts.map +1 -1
  39. package/dist/app-server/tool-analysis-domain.js +14 -9
  40. package/dist/app-server/tool-analysis-domain.js.map +1 -1
  41. package/dist/app-server/tool-analysis.d.ts +3 -3
  42. package/dist/app-server/tool-analysis.d.ts.map +1 -1
  43. package/dist/app-server/tool-analysis.js +23 -20
  44. package/dist/app-server/tool-analysis.js.map +1 -1
  45. package/dist/cli.js.map +1 -1
  46. package/package.json +4 -4
  47. package/dist/app/assets/index-CYs1291A.css +0 -1
  48. package/dist/app/assets/index-Fe4npghI.js +0 -249
@@ -1,249 +0,0 @@
1
- function RU(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 Vp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function an(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var iy={exports:{}},Ku={},oy={exports:{}},Lt={};var gE;function TU(){if(gE)return Lt;gE=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 x(z){return z===null||typeof z!="object"?null:(z=p&&z[p]||z["@@iterator"],typeof z=="function"?z:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,b={};function y(z,$,te){this.props=z,this.context=$,this.refs=b,this.updater=te||g}y.prototype.isReactComponent={},y.prototype.setState=function(z,$){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,$,"setState")},y.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function S(){}S.prototype=y.prototype;function C(z,$,te){this.props=z,this.context=$,this.refs=b,this.updater=te||g}var N=C.prototype=new S;N.constructor=C,j(N,y.prototype),N.isPureReactComponent=!0;var E=Array.isArray,_=Object.prototype.hasOwnProperty,P={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function R(z,$,te){var se,Q={},ce=null,le=null;if($!=null)for(se in $.ref!==void 0&&(le=$.ref),$.key!==void 0&&(ce=""+$.key),$)_.call($,se)&&!O.hasOwnProperty(se)&&(Q[se]=$[se]);var me=arguments.length-2;if(me===1)Q.children=te;else if(1<me){for(var oe=Array(me),fe=0;fe<me;fe++)oe[fe]=arguments[fe+2];Q.children=oe}if(z&&z.defaultProps)for(se in me=z.defaultProps,me)Q[se]===void 0&&(Q[se]=me[se]);return{$$typeof:e,type:z,key:ce,ref:le,props:Q,_owner:P.current}}function L(z,$){return{$$typeof:e,type:z.type,key:$,ref:z.ref,props:z.props,_owner:z._owner}}function T(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function D(z){var $={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(te){return $[te]})}var M=/\/+/g;function G(z,$){return typeof z=="object"&&z!==null&&z.key!=null?D(""+z.key):$.toString(36)}function B(z,$,te,se,Q){var ce=typeof z;(ce==="undefined"||ce==="boolean")&&(z=null);var le=!1;if(z===null)le=!0;else switch(ce){case"string":case"number":le=!0;break;case"object":switch(z.$$typeof){case e:case t:le=!0}}if(le)return le=z,Q=Q(le),z=se===""?"."+G(le,0):se,E(Q)?(te="",z!=null&&(te=z.replace(M,"$&/")+"/"),B(Q,$,te,"",function(fe){return fe})):Q!=null&&(T(Q)&&(Q=L(Q,te+(!Q.key||le&&le.key===Q.key?"":(""+Q.key).replace(M,"$&/")+"/")+z)),$.push(Q)),1;if(le=0,se=se===""?".":se+":",E(z))for(var me=0;me<z.length;me++){ce=z[me];var oe=se+G(ce,me);le+=B(ce,$,te,oe,Q)}else if(oe=x(z),typeof oe=="function")for(z=oe.call(z),me=0;!(ce=z.next()).done;)ce=ce.value,oe=se+G(ce,me++),le+=B(ce,$,te,oe,Q);else if(ce==="object")throw $=String(z),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.");return le}function W(z,$,te){if(z==null)return z;var se=[],Q=0;return B(z,se,"","",function(ce){return $.call(te,ce,Q++)}),se}function q(z){if(z._status===-1){var $=z._result;$=$(),$.then(function(te){(z._status===0||z._status===-1)&&(z._status=1,z._result=te)},function(te){(z._status===0||z._status===-1)&&(z._status=2,z._result=te)}),z._status===-1&&(z._status=0,z._result=$)}if(z._status===1)return z._result.default;throw z._result}var V={current:null},F={transition:null},U={ReactCurrentDispatcher:V,ReactCurrentBatchConfig:F,ReactCurrentOwner:P};function Z(){throw Error("act(...) is not supported in production builds of React.")}return Lt.Children={map:W,forEach:function(z,$,te){W(z,function(){$.apply(this,arguments)},te)},count:function(z){var $=0;return W(z,function(){$++}),$},toArray:function(z){return W(z,function($){return $})||[]},only:function(z){if(!T(z))throw Error("React.Children.only expected to receive a single React element child.");return z}},Lt.Component=y,Lt.Fragment=n,Lt.Profiler=a,Lt.PureComponent=C,Lt.StrictMode=r,Lt.Suspense=d,Lt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=U,Lt.act=Z,Lt.cloneElement=function(z,$,te){if(z==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+z+".");var se=j({},z.props),Q=z.key,ce=z.ref,le=z._owner;if($!=null){if($.ref!==void 0&&(ce=$.ref,le=P.current),$.key!==void 0&&(Q=""+$.key),z.type&&z.type.defaultProps)var me=z.type.defaultProps;for(oe in $)_.call($,oe)&&!O.hasOwnProperty(oe)&&(se[oe]=$[oe]===void 0&&me!==void 0?me[oe]:$[oe])}var oe=arguments.length-2;if(oe===1)se.children=te;else if(1<oe){me=Array(oe);for(var fe=0;fe<oe;fe++)me[fe]=arguments[fe+2];se.children=me}return{$$typeof:e,type:z.type,key:Q,ref:ce,props:se,_owner:le}},Lt.createContext=function(z){return z={$$typeof:o,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},z.Provider={$$typeof:i,_context:z},z.Consumer=z},Lt.createElement=R,Lt.createFactory=function(z){var $=R.bind(null,z);return $.type=z,$},Lt.createRef=function(){return{current:null}},Lt.forwardRef=function(z){return{$$typeof:c,render:z}},Lt.isValidElement=T,Lt.lazy=function(z){return{$$typeof:h,_payload:{_status:-1,_result:z},_init:q}},Lt.memo=function(z,$){return{$$typeof:f,type:z,compare:$===void 0?null:$}},Lt.startTransition=function(z){var $=F.transition;F.transition={};try{z()}finally{F.transition=$}},Lt.unstable_act=Z,Lt.useCallback=function(z,$){return V.current.useCallback(z,$)},Lt.useContext=function(z){return V.current.useContext(z)},Lt.useDebugValue=function(){},Lt.useDeferredValue=function(z){return V.current.useDeferredValue(z)},Lt.useEffect=function(z,$){return V.current.useEffect(z,$)},Lt.useId=function(){return V.current.useId()},Lt.useImperativeHandle=function(z,$,te){return V.current.useImperativeHandle(z,$,te)},Lt.useInsertionEffect=function(z,$){return V.current.useInsertionEffect(z,$)},Lt.useLayoutEffect=function(z,$){return V.current.useLayoutEffect(z,$)},Lt.useMemo=function(z,$){return V.current.useMemo(z,$)},Lt.useReducer=function(z,$,te){return V.current.useReducer(z,$,te)},Lt.useRef=function(z){return V.current.useRef(z)},Lt.useState=function(z){return V.current.useState(z)},Lt.useSyncExternalStore=function(z,$,te){return V.current.useSyncExternalStore(z,$,te)},Lt.useTransition=function(){return V.current.useTransition()},Lt.version="18.3.1",Lt}var xE;function HS(){return xE||(xE=1,oy.exports=TU()),oy.exports}var yE;function IU(){if(yE)return Ku;yE=1;var e=HS(),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={},x=null,g=null;f!==void 0&&(x=""+f),d.key!==void 0&&(x=""+d.key),d.ref!==void 0&&(g=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:x,ref:g,props:p,_owner:a.current}}return Ku.Fragment=n,Ku.jsx=o,Ku.jsxs=o,Ku}var bE;function MU(){return bE||(bE=1,iy.exports=IU()),iy.exports}var s=MU(),Hp={},ly={exports:{}},Dr={},cy={exports:{}},uy={};var wE;function $U(){return wE||(wE=1,(function(e){function t(F,U){var Z=F.length;F.push(U);e:for(;0<Z;){var z=Z-1>>>1,$=F[z];if(0<a($,U))F[z]=U,F[Z]=$,Z=z;else break e}}function n(F){return F.length===0?null:F[0]}function r(F){if(F.length===0)return null;var U=F[0],Z=F.pop();if(Z!==U){F[0]=Z;e:for(var z=0,$=F.length,te=$>>>1;z<te;){var se=2*(z+1)-1,Q=F[se],ce=se+1,le=F[ce];if(0>a(Q,Z))ce<$&&0>a(le,Q)?(F[z]=le,F[ce]=Z,z=ce):(F[z]=Q,F[se]=Z,z=se);else if(ce<$&&0>a(le,Z))F[z]=le,F[ce]=Z,z=ce;else break e}}return U}function a(F,U){var Z=F.sortIndex-U.sortIndex;return Z!==0?Z:F.id-U.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,x=3,g=!1,j=!1,b=!1,y=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(F){for(var U=n(f);U!==null;){if(U.callback===null)r(f);else if(U.startTime<=F)r(f),U.sortIndex=U.expirationTime,t(d,U);else break;U=n(f)}}function E(F){if(b=!1,N(F),!j)if(n(d)!==null)j=!0,q(_);else{var U=n(f);U!==null&&V(E,U.startTime-F)}}function _(F,U){j=!1,b&&(b=!1,S(R),R=-1),g=!0;var Z=x;try{for(N(U),p=n(d);p!==null&&(!(p.expirationTime>U)||F&&!D());){var z=p.callback;if(typeof z=="function"){p.callback=null,x=p.priorityLevel;var $=z(p.expirationTime<=U);U=e.unstable_now(),typeof $=="function"?p.callback=$:p===n(d)&&r(d),N(U)}else r(d);p=n(d)}if(p!==null)var te=!0;else{var se=n(f);se!==null&&V(E,se.startTime-U),te=!1}return te}finally{p=null,x=Z,g=!1}}var P=!1,O=null,R=-1,L=5,T=-1;function D(){return!(e.unstable_now()-T<L)}function M(){if(O!==null){var F=e.unstable_now();T=F;var U=!0;try{U=O(!0,F)}finally{U?G():(P=!1,O=null)}}else P=!1}var G;if(typeof C=="function")G=function(){C(M)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,W=B.port2;B.port1.onmessage=M,G=function(){W.postMessage(null)}}else G=function(){y(M,0)};function q(F){O=F,P||(P=!0,G())}function V(F,U){R=y(function(){F(e.unstable_now())},U)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(F){F.callback=null},e.unstable_continueExecution=function(){j||g||(j=!0,q(_))},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(F){switch(x){case 1:case 2:case 3:var U=3;break;default:U=x}var Z=x;x=U;try{return F()}finally{x=Z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(F,U){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var Z=x;x=F;try{return U()}finally{x=Z}},e.unstable_scheduleCallback=function(F,U,Z){var z=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?z+Z:z):Z=z,F){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=Z+$,F={id:h++,callback:U,priorityLevel:F,startTime:Z,expirationTime:$,sortIndex:-1},Z>z?(F.sortIndex=Z,t(f,F),n(d)===null&&F===n(f)&&(b?(S(R),R=-1):b=!0,V(E,Z-z))):(F.sortIndex=$,t(d,F),j||g||(j=!0,q(_))),F},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(F){var U=x;return function(){var Z=x;x=U;try{return F.apply(this,arguments)}finally{x=Z}}}})(uy)),uy}var jE;function DU(){return jE||(jE=1,cy.exports=$U()),cy.exports}var SE;function LU(){if(SE)return Dr;SE=1;var e=HS(),t=DU();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 x(l){return d.call(p,l)?!0:d.call(h,l)?!1:f.test(l)?p[l]=!0:(h[l]=!0,!1)}function g(l,u,m,w){if(m!==null&&m.type===0)return!1;switch(typeof u){case"function":case"symbol":return!0;case"boolean":return w?!1:m!==null?!m.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function j(l,u,m,w){if(u===null||typeof u>"u"||g(l,u,m,w))return!0;if(w)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 b(l,u,m,w,A,k,I){this.acceptsBooleans=u===2||u===3||u===4,this.attributeName=w,this.attributeNamespace=A,this.mustUseProperty=m,this.propertyName=l,this.type=u,this.sanitizeURL=k,this.removeEmptyString=I}var y={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){y[l]=new b(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var u=l[0];y[u]=new b(u,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){y[l]=new b(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){y[l]=new b(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){y[l]=new b(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){y[l]=new b(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){y[l]=new b(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){y[l]=new b(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){y[l]=new b(l,5,!1,l.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function C(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,C);y[u]=new b(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,C);y[u]=new b(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,C);y[u]=new b(u,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){y[l]=new b(l,1,!1,l.toLowerCase(),null,!1,!1)}),y.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){y[l]=new b(l,1,!1,l.toLowerCase(),null,!0,!0)});function N(l,u,m,w){var A=y.hasOwnProperty(u)?y[u]:null;(A!==null?A.type!==0:w||!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(j(u,m,A,w)&&(m=null),w||A===null?x(u)&&(m===null?l.removeAttribute(u):l.setAttribute(u,""+m)):A.mustUseProperty?l[A.propertyName]=m===null?A.type===3?!1:"":m:(u=A.attributeName,w=A.attributeNamespace,m===null?l.removeAttribute(u):(A=A.type,m=A===3||A===4&&m===!0?"":""+m,w?l.setAttributeNS(w,u,m):l.setAttribute(u,m))))}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,_=Symbol.for("react.element"),P=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),D=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),V=Symbol.for("react.offscreen"),F=Symbol.iterator;function U(l){return l===null||typeof l!="object"?null:(l=F&&l[F]||l["@@iterator"],typeof l=="function"?l:null)}var Z=Object.assign,z;function $(l){if(z===void 0)try{throw Error()}catch(m){var u=m.stack.trim().match(/\n( *(at )?)/);z=u&&u[1]||""}return`
2
- `+z+l}var te=!1;function se(l,u){if(!l||te)return"";te=!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(ve){var w=ve}Reflect.construct(l,[],u)}else{try{u.call()}catch(ve){w=ve}l.call(u.prototype)}else{try{throw Error()}catch(ve){w=ve}l()}}catch(ve){if(ve&&w&&typeof ve.stack=="string"){for(var A=ve.stack.split(`
3
- `),k=w.stack.split(`
4
- `),I=A.length-1,J=k.length-1;1<=I&&0<=J&&A[I]!==k[J];)J--;for(;1<=I&&0<=J;I--,J--)if(A[I]!==k[J]){if(I!==1||J!==1)do if(I--,J--,0>J||A[I]!==k[J]){var ne=`
5
- `+A[I].replace(" at new "," at ");return l.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",l.displayName)),ne}while(1<=I&&0<=J);break}}}finally{te=!1,Error.prepareStackTrace=m}return(l=l?l.displayName||l.name:"")?$(l):""}function Q(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=se(l.type,!1),l;case 11:return l=se(l.type.render,!1),l;case 1:return l=se(l.type,!0),l;default:return""}}function ce(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 O:return"Fragment";case P:return"Portal";case L:return"Profiler";case R:return"StrictMode";case G:return"Suspense";case B:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case D:return(l.displayName||"Context")+".Consumer";case T:return(l._context.displayName||"Context")+".Provider";case M:var u=l.render;return l=l.displayName,l||(l=u.displayName||u.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case W:return u=l.displayName||null,u!==null?u:ce(l.type)||"Memo";case q:u=l._payload,l=l._init;try{return ce(l(u))}catch{}}return null}function le(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 ce(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 me(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 fe(l){var u=oe(l)?"checked":"value",m=Object.getOwnPropertyDescriptor(l.constructor.prototype,u),w=""+l[u];if(!l.hasOwnProperty(u)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var A=m.get,k=m.set;return Object.defineProperty(l,u,{configurable:!0,get:function(){return A.call(this)},set:function(I){w=""+I,k.call(this,I)}}),Object.defineProperty(l,u,{enumerable:m.enumerable}),{getValue:function(){return w},setValue:function(I){w=""+I},stopTracking:function(){l._valueTracker=null,delete l[u]}}}}function Ce(l){l._valueTracker||(l._valueTracker=fe(l))}function ae(l){if(!l)return!1;var u=l._valueTracker;if(!u)return!0;var m=u.getValue(),w="";return l&&(w=oe(l)?l.checked?"true":"false":l.value),l=w,l!==m?(u.setValue(l),!0):!1}function Re(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 Ae(l,u){var m=u.checked;return Z({},u,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:m??l._wrapperState.initialChecked})}function Te(l,u){var m=u.defaultValue==null?"":u.defaultValue,w=u.checked!=null?u.checked:u.defaultChecked;m=me(u.value!=null?u.value:m),l._wrapperState={initialChecked:w,initialValue:m,controlled:u.type==="checkbox"||u.type==="radio"?u.checked!=null:u.value!=null}}function be(l,u){u=u.checked,u!=null&&N(l,"checked",u,!1)}function _e(l,u){be(l,u);var m=me(u.value),w=u.type;if(m!=null)w==="number"?(m===0&&l.value===""||l.value!=m)&&(l.value=""+m):l.value!==""+m&&(l.value=""+m);else if(w==="submit"||w==="reset"){l.removeAttribute("value");return}u.hasOwnProperty("value")?ge(l,u.type,m):u.hasOwnProperty("defaultValue")&&ge(l,u.type,me(u.defaultValue)),u.checked==null&&u.defaultChecked!=null&&(l.defaultChecked=!!u.defaultChecked)}function X(l,u,m){if(u.hasOwnProperty("value")||u.hasOwnProperty("defaultValue")){var w=u.type;if(!(w!=="submit"&&w!=="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 ge(l,u,m){(u!=="number"||Re(l.ownerDocument)!==l)&&(m==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+m&&(l.defaultValue=""+m))}var ue=Array.isArray;function De(l,u,m,w){if(l=l.options,u){u={};for(var A=0;A<m.length;A++)u["$"+m[A]]=!0;for(m=0;m<l.length;m++)A=u.hasOwnProperty("$"+l[m].value),l[m].selected!==A&&(l[m].selected=A),A&&w&&(l[m].defaultSelected=!0)}else{for(m=""+me(m),u=null,A=0;A<l.length;A++){if(l[A].value===m){l[A].selected=!0,w&&(l[A].defaultSelected=!0);return}u!==null||l[A].disabled||(u=l[A])}u!==null&&(u.selected=!0)}}function Ye(l,u){if(u.dangerouslySetInnerHTML!=null)throw Error(n(91));return Z({},u,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function Ct(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(ue(m)){if(1<m.length)throw Error(n(93));m=m[0]}u=m}u==null&&(u=""),m=u}l._wrapperState={initialValue:me(m)}}function Ft(l,u){var m=me(u.value),w=me(u.defaultValue);m!=null&&(m=""+m,m!==l.value&&(l.value=m),u.defaultValue==null&&l.defaultValue!==m&&(l.defaultValue=m)),w!=null&&(l.defaultValue=""+w)}function mt(l){var u=l.textContent;u===l._wrapperState.initialValue&&u!==""&&u!==null&&(l.value=u)}function Nt(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 Vt(l,u){return l==null||l==="http://www.w3.org/1999/xhtml"?Nt(u):l==="http://www.w3.org/2000/svg"&&u==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var pn,ln=(function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(u,m,w,A){MSApp.execUnsafeLocalFunction(function(){return l(u,m,w,A)})}:l})(function(l,u){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=u;else{for(pn=pn||document.createElement("div"),pn.innerHTML="<svg>"+u.valueOf().toString()+"</svg>",u=pn.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;u.firstChild;)l.appendChild(u.firstChild)}});function ee(l,u){if(u){var m=l.firstChild;if(m&&m===l.lastChild&&m.nodeType===3){m.nodeValue=u;return}}l.textContent=u}var Se={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},Ne=["Webkit","ms","Moz","O"];Object.keys(Se).forEach(function(l){Ne.forEach(function(u){u=u+l.charAt(0).toUpperCase()+l.substring(1),Se[u]=Se[l]})});function ze(l,u,m){return u==null||typeof u=="boolean"||u===""?"":m||typeof u!="number"||u===0||Se.hasOwnProperty(l)&&Se[l]?(""+u).trim():u+"px"}function ke(l,u){l=l.style;for(var m in u)if(u.hasOwnProperty(m)){var w=m.indexOf("--")===0,A=ze(m,u[m],w);m==="float"&&(m="cssFloat"),w?l.setProperty(m,A):l[m]=A}}var it=Z({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 Ue(l,u){if(u){if(it[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 Tt(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 Ot=null;function zt(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var Ln=null,yn=null,Ht=null;function hn(l){if(l=Ru(l)){if(typeof Ln!="function")throw Error(n(280));var u=l.stateNode;u&&(u=ip(u),Ln(l.stateNode,l.type,u))}}function wr(l){yn?Ht?Ht.push(l):Ht=[l]:yn=l}function ut(){if(yn){var l=yn,u=Ht;if(Ht=yn=null,hn(l),u)for(l=0;l<u.length;l++)hn(u[l])}}function jt(l,u){return l(u)}function Et(){}var bn=!1;function de(l,u,m){if(bn)return l(u,m);bn=!0;try{return jt(l,u,m)}finally{bn=!1,(yn!==null||Ht!==null)&&(Et(),ut())}}function ot(l,u){var m=l.stateNode;if(m===null)return null;var w=ip(m);if(w===null)return null;m=w[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":(w=!w.disabled)||(l=l.type,w=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!w;break e;default:l=!1}if(l)return null;if(m&&typeof m!="function")throw Error(n(231,u,typeof m));return m}var Bt=!1;if(c)try{var Kt={};Object.defineProperty(Kt,"passive",{get:function(){Bt=!0}}),window.addEventListener("test",Kt,Kt),window.removeEventListener("test",Kt,Kt)}catch{Bt=!1}function cn(l,u,m,w,A,k,I,J,ne){var ve=Array.prototype.slice.call(arguments,3);try{u.apply(m,ve)}catch(Oe){this.onError(Oe)}}var Rn=!1,ur=null,di=!1,fi=null,dl={onError:function(l){Rn=!0,ur=l}};function Y(l,u,m,w,A,k,I,J,ne){Rn=!1,ur=null,cn.apply(dl,arguments)}function xe(l,u,m,w,A,k,I,J,ne){if(Y.apply(this,arguments),Rn){if(Rn){var ve=ur;Rn=!1,ur=null}else throw Error(n(198));di||(di=!0,fi=ve)}}function He(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 ft(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 $t(l){if(He(l)!==l)throw Error(n(188))}function Ut(l){var u=l.alternate;if(!u){if(u=He(l),u===null)throw Error(n(188));return u!==l?null:l}for(var m=l,w=u;;){var A=m.return;if(A===null)break;var k=A.alternate;if(k===null){if(w=A.return,w!==null){m=w;continue}break}if(A.child===k.child){for(k=A.child;k;){if(k===m)return $t(A),l;if(k===w)return $t(A),u;k=k.sibling}throw Error(n(188))}if(m.return!==w.return)m=A,w=k;else{for(var I=!1,J=A.child;J;){if(J===m){I=!0,m=A,w=k;break}if(J===w){I=!0,w=A,m=k;break}J=J.sibling}if(!I){for(J=k.child;J;){if(J===m){I=!0,m=k,w=A;break}if(J===w){I=!0,w=k,m=A;break}J=J.sibling}if(!I)throw Error(n(189))}}if(m.alternate!==w)throw Error(n(190))}if(m.tag!==3)throw Error(n(188));return m.stateNode.current===m?l:u}function Dt(l){return l=Ut(l),l!==null?Fn(l):null}function Fn(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var u=Fn(l);if(u!==null)return u;l=l.sibling}return null}var Ke=t.unstable_scheduleCallback,en=t.unstable_cancelCallback,Gt=t.unstable_shouldYield,Bn=t.unstable_requestPaint,wn=t.unstable_now,Ag=t.unstable_getCurrentPriorityLevel,fl=t.unstable_ImmediatePriority,zf=t.unstable_UserBlockingPriority,pi=t.unstable_NormalPriority,Uf=t.unstable_LowPriority,mu=t.unstable_IdlePriority,Rs=null,ca=null;function _g(l){if(ca&&typeof ca.onCommitFiberRoot=="function")try{ca.onCommitFiberRoot(Rs,l,void 0,(l.current.flags&128)===128)}catch{}}var Kr=Math.clz32?Math.clz32:Pg,qf=Math.log,Eg=Math.LN2;function Pg(l){return l>>>=0,l===0?32:31-(qf(l)/Eg|0)|0}var pl=64,hl=4194304;function K(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 ye(l,u){var m=l.pendingLanes;if(m===0)return 0;var w=0,A=l.suspendedLanes,k=l.pingedLanes,I=m&268435455;if(I!==0){var J=I&~A;J!==0?w=K(J):(k&=I,k!==0&&(w=K(k)))}else I=m&~A,I!==0?w=K(I):k!==0&&(w=K(k));if(w===0)return 0;if(u!==0&&u!==w&&(u&A)===0&&(A=w&-w,k=u&-u,A>=k||A===16&&(k&4194240)!==0))return u;if((w&4)!==0&&(w|=m&16),u=l.entangledLanes,u!==0)for(l=l.entanglements,u&=w;0<u;)m=31-Kr(u),A=1<<m,w|=l[m],u&=~A;return w}function rt(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 $e(l,u){for(var m=l.suspendedLanes,w=l.pingedLanes,A=l.expirationTimes,k=l.pendingLanes;0<k;){var I=31-Kr(k),J=1<<I,ne=A[I];ne===-1?((J&m)===0||(J&w)!==0)&&(A[I]=rt(J,u)):ne<=u&&(l.expiredLanes|=J),k&=~J}}function Mt(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function pt(){var l=pl;return pl<<=1,(pl&4194240)===0&&(pl=64),l}function tn(l){for(var u=[],m=0;31>m;m++)u.push(l);return u}function Kn(l,u,m){l.pendingLanes|=u,u!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,u=31-Kr(u),l[u]=m}function sn(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 w=l.eventTimes;for(l=l.expirationTimes;0<m;){var A=31-Kr(m),k=1<<A;u[A]=0,w[A]=-1,l[A]=-1,m&=~k}}function ua(l,u){var m=l.entangledLanes|=u;for(l=l.entanglements;m;){var w=31-Kr(m),A=1<<w;A&u|l[w]&u&&(l[w]|=u),m&=~A}}var Xt=0;function Wf(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var ml,kg,QC,JC,ZC,Og=!1,Vf=[],hi=null,mi=null,vi=null,vu=new Map,gu=new Map,gi=[],e6="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 eA(l,u){switch(l){case"focusin":case"focusout":hi=null;break;case"dragenter":case"dragleave":mi=null;break;case"mouseover":case"mouseout":vi=null;break;case"pointerover":case"pointerout":vu.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":gu.delete(u.pointerId)}}function xu(l,u,m,w,A,k){return l===null||l.nativeEvent!==k?(l={blockedOn:u,domEventName:m,eventSystemFlags:w,nativeEvent:k,targetContainers:[A]},u!==null&&(u=Ru(u),u!==null&&kg(u)),l):(l.eventSystemFlags|=w,u=l.targetContainers,A!==null&&u.indexOf(A)===-1&&u.push(A),l)}function t6(l,u,m,w,A){switch(u){case"focusin":return hi=xu(hi,l,u,m,w,A),!0;case"dragenter":return mi=xu(mi,l,u,m,w,A),!0;case"mouseover":return vi=xu(vi,l,u,m,w,A),!0;case"pointerover":var k=A.pointerId;return vu.set(k,xu(vu.get(k)||null,l,u,m,w,A)),!0;case"gotpointercapture":return k=A.pointerId,gu.set(k,xu(gu.get(k)||null,l,u,m,w,A)),!0}return!1}function tA(l){var u=so(l.target);if(u!==null){var m=He(u);if(m!==null){if(u=m.tag,u===13){if(u=ft(m),u!==null){l.blockedOn=u,ZC(l.priority,function(){QC(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 Hf(l){if(l.blockedOn!==null)return!1;for(var u=l.targetContainers;0<u.length;){var m=Tg(l.domEventName,l.eventSystemFlags,u[0],l.nativeEvent);if(m===null){m=l.nativeEvent;var w=new m.constructor(m.type,m);Ot=w,m.target.dispatchEvent(w),Ot=null}else return u=Ru(m),u!==null&&kg(u),l.blockedOn=m,!1;u.shift()}return!0}function nA(l,u,m){Hf(l)&&m.delete(u)}function n6(){Og=!1,hi!==null&&Hf(hi)&&(hi=null),mi!==null&&Hf(mi)&&(mi=null),vi!==null&&Hf(vi)&&(vi=null),vu.forEach(nA),gu.forEach(nA)}function yu(l,u){l.blockedOn===u&&(l.blockedOn=null,Og||(Og=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,n6)))}function bu(l){function u(A){return yu(A,l)}if(0<Vf.length){yu(Vf[0],l);for(var m=1;m<Vf.length;m++){var w=Vf[m];w.blockedOn===l&&(w.blockedOn=null)}}for(hi!==null&&yu(hi,l),mi!==null&&yu(mi,l),vi!==null&&yu(vi,l),vu.forEach(u),gu.forEach(u),m=0;m<gi.length;m++)w=gi[m],w.blockedOn===l&&(w.blockedOn=null);for(;0<gi.length&&(m=gi[0],m.blockedOn===null);)tA(m),m.blockedOn===null&&gi.shift()}var vl=E.ReactCurrentBatchConfig,Kf=!0;function r6(l,u,m,w){var A=Xt,k=vl.transition;vl.transition=null;try{Xt=1,Rg(l,u,m,w)}finally{Xt=A,vl.transition=k}}function a6(l,u,m,w){var A=Xt,k=vl.transition;vl.transition=null;try{Xt=4,Rg(l,u,m,w)}finally{Xt=A,vl.transition=k}}function Rg(l,u,m,w){if(Kf){var A=Tg(l,u,m,w);if(A===null)Xg(l,u,w,Gf,m),eA(l,w);else if(t6(A,l,u,m,w))w.stopPropagation();else if(eA(l,w),u&4&&-1<e6.indexOf(l)){for(;A!==null;){var k=Ru(A);if(k!==null&&ml(k),k=Tg(l,u,m,w),k===null&&Xg(l,u,w,Gf,m),k===A)break;A=k}A!==null&&w.stopPropagation()}else Xg(l,u,w,null,m)}}var Gf=null;function Tg(l,u,m,w){if(Gf=null,l=zt(w),l=so(l),l!==null)if(u=He(l),u===null)l=null;else if(m=u.tag,m===13){if(l=ft(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 Gf=l,null}function rA(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(Ag()){case fl:return 1;case zf:return 4;case pi:case Uf:return 16;case mu:return 536870912;default:return 16}default:return 16}}var xi=null,Ig=null,Yf=null;function aA(){if(Yf)return Yf;var l,u=Ig,m=u.length,w,A="value"in xi?xi.value:xi.textContent,k=A.length;for(l=0;l<m&&u[l]===A[l];l++);var I=m-l;for(w=1;w<=I&&u[m-w]===A[k-w];w++);return Yf=A.slice(l,1<w?1-w:void 0)}function Xf(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 Qf(){return!0}function sA(){return!1}function Gr(l){function u(m,w,A,k,I){this._reactName=m,this._targetInst=A,this.type=w,this.nativeEvent=k,this.target=I,this.currentTarget=null;for(var J in l)l.hasOwnProperty(J)&&(m=l[J],this[J]=m?m(k):k[J]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?Qf:sA,this.isPropagationStopped=sA,this}return Z(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=Qf)},stopPropagation:function(){var m=this.nativeEvent;m&&(m.stopPropagation?m.stopPropagation():typeof m.cancelBubble!="unknown"&&(m.cancelBubble=!0),this.isPropagationStopped=Qf)},persist:function(){},isPersistent:Qf}),u}var gl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Mg=Gr(gl),wu=Z({},gl,{view:0,detail:0}),s6=Gr(wu),$g,Dg,ju,Jf=Z({},wu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fg,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!==ju&&(ju&&l.type==="mousemove"?($g=l.screenX-ju.screenX,Dg=l.screenY-ju.screenY):Dg=$g=0,ju=l),$g)},movementY:function(l){return"movementY"in l?l.movementY:Dg}}),iA=Gr(Jf),i6=Z({},Jf,{dataTransfer:0}),o6=Gr(i6),l6=Z({},wu,{relatedTarget:0}),Lg=Gr(l6),c6=Z({},gl,{animationName:0,elapsedTime:0,pseudoElement:0}),u6=Gr(c6),d6=Z({},gl,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),f6=Gr(d6),p6=Z({},gl,{data:0}),oA=Gr(p6),h6={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},m6={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"},v6={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function g6(l){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(l):(l=v6[l])?!!u[l]:!1}function Fg(){return g6}var x6=Z({},wu,{key:function(l){if(l.key){var u=h6[l.key]||l.key;if(u!=="Unidentified")return u}return l.type==="keypress"?(l=Xf(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?m6[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fg,charCode:function(l){return l.type==="keypress"?Xf(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?Xf(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),y6=Gr(x6),b6=Z({},Jf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lA=Gr(b6),w6=Z({},wu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fg}),j6=Gr(w6),S6=Z({},gl,{propertyName:0,elapsedTime:0,pseudoElement:0}),N6=Gr(S6),C6=Z({},Jf,{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}),A6=Gr(C6),_6=[9,13,27,32],Bg=c&&"CompositionEvent"in window,Su=null;c&&"documentMode"in document&&(Su=document.documentMode);var E6=c&&"TextEvent"in window&&!Su,cA=c&&(!Bg||Su&&8<Su&&11>=Su),uA=" ",dA=!1;function fA(l,u){switch(l){case"keyup":return _6.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pA(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var xl=!1;function P6(l,u){switch(l){case"compositionend":return pA(u);case"keypress":return u.which!==32?null:(dA=!0,uA);case"textInput":return l=u.data,l===uA&&dA?null:l;default:return null}}function k6(l,u){if(xl)return l==="compositionend"||!Bg&&fA(l,u)?(l=aA(),Yf=Ig=xi=null,xl=!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 cA&&u.locale!=="ko"?null:u.data;default:return null}}var O6={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 hA(l){var u=l&&l.nodeName&&l.nodeName.toLowerCase();return u==="input"?!!O6[l.type]:u==="textarea"}function mA(l,u,m,w){wr(w),u=rp(u,"onChange"),0<u.length&&(m=new Mg("onChange","change",null,m,w),l.push({event:m,listeners:u}))}var Nu=null,Cu=null;function R6(l){TA(l,0)}function Zf(l){var u=Sl(l);if(ae(u))return l}function T6(l,u){if(l==="change")return u}var vA=!1;if(c){var zg;if(c){var Ug="oninput"in document;if(!Ug){var gA=document.createElement("div");gA.setAttribute("oninput","return;"),Ug=typeof gA.oninput=="function"}zg=Ug}else zg=!1;vA=zg&&(!document.documentMode||9<document.documentMode)}function xA(){Nu&&(Nu.detachEvent("onpropertychange",yA),Cu=Nu=null)}function yA(l){if(l.propertyName==="value"&&Zf(Cu)){var u=[];mA(u,Cu,l,zt(l)),de(R6,u)}}function I6(l,u,m){l==="focusin"?(xA(),Nu=u,Cu=m,Nu.attachEvent("onpropertychange",yA)):l==="focusout"&&xA()}function M6(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return Zf(Cu)}function $6(l,u){if(l==="click")return Zf(u)}function D6(l,u){if(l==="input"||l==="change")return Zf(u)}function L6(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var Ra=typeof Object.is=="function"?Object.is:L6;function Au(l,u){if(Ra(l,u))return!0;if(typeof l!="object"||l===null||typeof u!="object"||u===null)return!1;var m=Object.keys(l),w=Object.keys(u);if(m.length!==w.length)return!1;for(w=0;w<m.length;w++){var A=m[w];if(!d.call(u,A)||!Ra(l[A],u[A]))return!1}return!0}function bA(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function wA(l,u){var m=bA(l);l=0;for(var w;m;){if(m.nodeType===3){if(w=l+m.textContent.length,l<=u&&w>=u)return{node:m,offset:u-l};l=w}e:{for(;m;){if(m.nextSibling){m=m.nextSibling;break e}m=m.parentNode}m=void 0}m=bA(m)}}function jA(l,u){return l&&u?l===u?!0:l&&l.nodeType===3?!1:u&&u.nodeType===3?jA(l,u.parentNode):"contains"in l?l.contains(u):l.compareDocumentPosition?!!(l.compareDocumentPosition(u)&16):!1:!1}function SA(){for(var l=window,u=Re();u instanceof l.HTMLIFrameElement;){try{var m=typeof u.contentWindow.location.href=="string"}catch{m=!1}if(m)l=u.contentWindow;else break;u=Re(l.document)}return u}function qg(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 F6(l){var u=SA(),m=l.focusedElem,w=l.selectionRange;if(u!==m&&m&&m.ownerDocument&&jA(m.ownerDocument.documentElement,m)){if(w!==null&&qg(m)){if(u=w.start,l=w.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 A=m.textContent.length,k=Math.min(w.start,A);w=w.end===void 0?k:Math.min(w.end,A),!l.extend&&k>w&&(A=w,w=k,k=A),A=wA(m,k);var I=wA(m,w);A&&I&&(l.rangeCount!==1||l.anchorNode!==A.node||l.anchorOffset!==A.offset||l.focusNode!==I.node||l.focusOffset!==I.offset)&&(u=u.createRange(),u.setStart(A.node,A.offset),l.removeAllRanges(),k>w?(l.addRange(u),l.extend(I.node,I.offset)):(u.setEnd(I.node,I.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 B6=c&&"documentMode"in document&&11>=document.documentMode,yl=null,Wg=null,_u=null,Vg=!1;function NA(l,u,m){var w=m.window===m?m.document:m.nodeType===9?m:m.ownerDocument;Vg||yl==null||yl!==Re(w)||(w=yl,"selectionStart"in w&&qg(w)?w={start:w.selectionStart,end:w.selectionEnd}:(w=(w.ownerDocument&&w.ownerDocument.defaultView||window).getSelection(),w={anchorNode:w.anchorNode,anchorOffset:w.anchorOffset,focusNode:w.focusNode,focusOffset:w.focusOffset}),_u&&Au(_u,w)||(_u=w,w=rp(Wg,"onSelect"),0<w.length&&(u=new Mg("onSelect","select",null,u,m),l.push({event:u,listeners:w}),u.target=yl)))}function ep(l,u){var m={};return m[l.toLowerCase()]=u.toLowerCase(),m["Webkit"+l]="webkit"+u,m["Moz"+l]="moz"+u,m}var bl={animationend:ep("Animation","AnimationEnd"),animationiteration:ep("Animation","AnimationIteration"),animationstart:ep("Animation","AnimationStart"),transitionend:ep("Transition","TransitionEnd")},Hg={},CA={};c&&(CA=document.createElement("div").style,"AnimationEvent"in window||(delete bl.animationend.animation,delete bl.animationiteration.animation,delete bl.animationstart.animation),"TransitionEvent"in window||delete bl.transitionend.transition);function tp(l){if(Hg[l])return Hg[l];if(!bl[l])return l;var u=bl[l],m;for(m in u)if(u.hasOwnProperty(m)&&m in CA)return Hg[l]=u[m];return l}var AA=tp("animationend"),_A=tp("animationiteration"),EA=tp("animationstart"),PA=tp("transitionend"),kA=new Map,OA="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 yi(l,u){kA.set(l,u),i(u,[l])}for(var Kg=0;Kg<OA.length;Kg++){var Gg=OA[Kg],z6=Gg.toLowerCase(),U6=Gg[0].toUpperCase()+Gg.slice(1);yi(z6,"on"+U6)}yi(AA,"onAnimationEnd"),yi(_A,"onAnimationIteration"),yi(EA,"onAnimationStart"),yi("dblclick","onDoubleClick"),yi("focusin","onFocus"),yi("focusout","onBlur"),yi(PA,"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 Eu="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(" "),q6=new Set("cancel close invalid load scroll toggle".split(" ").concat(Eu));function RA(l,u,m){var w=l.type||"unknown-event";l.currentTarget=m,xe(w,u,void 0,l),l.currentTarget=null}function TA(l,u){u=(u&4)!==0;for(var m=0;m<l.length;m++){var w=l[m],A=w.event;w=w.listeners;e:{var k=void 0;if(u)for(var I=w.length-1;0<=I;I--){var J=w[I],ne=J.instance,ve=J.currentTarget;if(J=J.listener,ne!==k&&A.isPropagationStopped())break e;RA(A,J,ve),k=ne}else for(I=0;I<w.length;I++){if(J=w[I],ne=J.instance,ve=J.currentTarget,J=J.listener,ne!==k&&A.isPropagationStopped())break e;RA(A,J,ve),k=ne}}}if(di)throw l=fi,di=!1,fi=null,l}function jn(l,u){var m=u[nx];m===void 0&&(m=u[nx]=new Set);var w=l+"__bubble";m.has(w)||(IA(u,l,2,!1),m.add(w))}function Yg(l,u,m){var w=0;u&&(w|=4),IA(m,l,w,u)}var np="_reactListening"+Math.random().toString(36).slice(2);function Pu(l){if(!l[np]){l[np]=!0,r.forEach(function(m){m!=="selectionchange"&&(q6.has(m)||Yg(m,!1,l),Yg(m,!0,l))});var u=l.nodeType===9?l:l.ownerDocument;u===null||u[np]||(u[np]=!0,Yg("selectionchange",!1,u))}}function IA(l,u,m,w){switch(rA(u)){case 1:var A=r6;break;case 4:A=a6;break;default:A=Rg}m=A.bind(null,u,m,l),A=void 0,!Bt||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(A=!0),w?A!==void 0?l.addEventListener(u,m,{capture:!0,passive:A}):l.addEventListener(u,m,!0):A!==void 0?l.addEventListener(u,m,{passive:A}):l.addEventListener(u,m,!1)}function Xg(l,u,m,w,A){var k=w;if((u&1)===0&&(u&2)===0&&w!==null)e:for(;;){if(w===null)return;var I=w.tag;if(I===3||I===4){var J=w.stateNode.containerInfo;if(J===A||J.nodeType===8&&J.parentNode===A)break;if(I===4)for(I=w.return;I!==null;){var ne=I.tag;if((ne===3||ne===4)&&(ne=I.stateNode.containerInfo,ne===A||ne.nodeType===8&&ne.parentNode===A))return;I=I.return}for(;J!==null;){if(I=so(J),I===null)return;if(ne=I.tag,ne===5||ne===6){w=k=I;continue e}J=J.parentNode}}w=w.return}de(function(){var ve=k,Oe=zt(m),Me=[];e:{var Ee=kA.get(l);if(Ee!==void 0){var Xe=Mg,nt=l;switch(l){case"keypress":if(Xf(m)===0)break e;case"keydown":case"keyup":Xe=y6;break;case"focusin":nt="focus",Xe=Lg;break;case"focusout":nt="blur",Xe=Lg;break;case"beforeblur":case"afterblur":Xe=Lg;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":Xe=iA;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Xe=o6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Xe=j6;break;case AA:case _A:case EA:Xe=u6;break;case PA:Xe=N6;break;case"scroll":Xe=s6;break;case"wheel":Xe=A6;break;case"copy":case"cut":case"paste":Xe=f6;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Xe=lA}var at=(u&4)!==0,zn=!at&&l==="scroll",pe=at?Ee!==null?Ee+"Capture":null:Ee;at=[];for(var ie=ve,he;ie!==null;){he=ie;var Le=he.stateNode;if(he.tag===5&&Le!==null&&(he=Le,pe!==null&&(Le=ot(ie,pe),Le!=null&&at.push(ku(ie,Le,he)))),zn)break;ie=ie.return}0<at.length&&(Ee=new Xe(Ee,nt,null,m,Oe),Me.push({event:Ee,listeners:at}))}}if((u&7)===0){e:{if(Ee=l==="mouseover"||l==="pointerover",Xe=l==="mouseout"||l==="pointerout",Ee&&m!==Ot&&(nt=m.relatedTarget||m.fromElement)&&(so(nt)||nt[Ts]))break e;if((Xe||Ee)&&(Ee=Oe.window===Oe?Oe:(Ee=Oe.ownerDocument)?Ee.defaultView||Ee.parentWindow:window,Xe?(nt=m.relatedTarget||m.toElement,Xe=ve,nt=nt?so(nt):null,nt!==null&&(zn=He(nt),nt!==zn||nt.tag!==5&&nt.tag!==6)&&(nt=null)):(Xe=null,nt=ve),Xe!==nt)){if(at=iA,Le="onMouseLeave",pe="onMouseEnter",ie="mouse",(l==="pointerout"||l==="pointerover")&&(at=lA,Le="onPointerLeave",pe="onPointerEnter",ie="pointer"),zn=Xe==null?Ee:Sl(Xe),he=nt==null?Ee:Sl(nt),Ee=new at(Le,ie+"leave",Xe,m,Oe),Ee.target=zn,Ee.relatedTarget=he,Le=null,so(Oe)===ve&&(at=new at(pe,ie+"enter",nt,m,Oe),at.target=he,at.relatedTarget=zn,Le=at),zn=Le,Xe&&nt)t:{for(at=Xe,pe=nt,ie=0,he=at;he;he=wl(he))ie++;for(he=0,Le=pe;Le;Le=wl(Le))he++;for(;0<ie-he;)at=wl(at),ie--;for(;0<he-ie;)pe=wl(pe),he--;for(;ie--;){if(at===pe||pe!==null&&at===pe.alternate)break t;at=wl(at),pe=wl(pe)}at=null}else at=null;Xe!==null&&MA(Me,Ee,Xe,at,!1),nt!==null&&zn!==null&&MA(Me,zn,nt,at,!0)}}e:{if(Ee=ve?Sl(ve):window,Xe=Ee.nodeName&&Ee.nodeName.toLowerCase(),Xe==="select"||Xe==="input"&&Ee.type==="file")var lt=T6;else if(hA(Ee))if(vA)lt=D6;else{lt=M6;var vt=I6}else(Xe=Ee.nodeName)&&Xe.toLowerCase()==="input"&&(Ee.type==="checkbox"||Ee.type==="radio")&&(lt=$6);if(lt&&(lt=lt(l,ve))){mA(Me,lt,m,Oe);break e}vt&&vt(l,Ee,ve),l==="focusout"&&(vt=Ee._wrapperState)&&vt.controlled&&Ee.type==="number"&&ge(Ee,"number",Ee.value)}switch(vt=ve?Sl(ve):window,l){case"focusin":(hA(vt)||vt.contentEditable==="true")&&(yl=vt,Wg=ve,_u=null);break;case"focusout":_u=Wg=yl=null;break;case"mousedown":Vg=!0;break;case"contextmenu":case"mouseup":case"dragend":Vg=!1,NA(Me,m,Oe);break;case"selectionchange":if(B6)break;case"keydown":case"keyup":NA(Me,m,Oe)}var gt;if(Bg)e:{switch(l){case"compositionstart":var St="onCompositionStart";break e;case"compositionend":St="onCompositionEnd";break e;case"compositionupdate":St="onCompositionUpdate";break e}St=void 0}else xl?fA(l,m)&&(St="onCompositionEnd"):l==="keydown"&&m.keyCode===229&&(St="onCompositionStart");St&&(cA&&m.locale!=="ko"&&(xl||St!=="onCompositionStart"?St==="onCompositionEnd"&&xl&&(gt=aA()):(xi=Oe,Ig="value"in xi?xi.value:xi.textContent,xl=!0)),vt=rp(ve,St),0<vt.length&&(St=new oA(St,l,null,m,Oe),Me.push({event:St,listeners:vt}),gt?St.data=gt:(gt=pA(m),gt!==null&&(St.data=gt)))),(gt=E6?P6(l,m):k6(l,m))&&(ve=rp(ve,"onBeforeInput"),0<ve.length&&(Oe=new oA("onBeforeInput","beforeinput",null,m,Oe),Me.push({event:Oe,listeners:ve}),Oe.data=gt))}TA(Me,u)})}function ku(l,u,m){return{instance:l,listener:u,currentTarget:m}}function rp(l,u){for(var m=u+"Capture",w=[];l!==null;){var A=l,k=A.stateNode;A.tag===5&&k!==null&&(A=k,k=ot(l,m),k!=null&&w.unshift(ku(l,k,A)),k=ot(l,u),k!=null&&w.push(ku(l,k,A))),l=l.return}return w}function wl(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function MA(l,u,m,w,A){for(var k=u._reactName,I=[];m!==null&&m!==w;){var J=m,ne=J.alternate,ve=J.stateNode;if(ne!==null&&ne===w)break;J.tag===5&&ve!==null&&(J=ve,A?(ne=ot(m,k),ne!=null&&I.unshift(ku(m,ne,J))):A||(ne=ot(m,k),ne!=null&&I.push(ku(m,ne,J)))),m=m.return}I.length!==0&&l.push({event:u,listeners:I})}var W6=/\r\n?/g,V6=/\u0000|\uFFFD/g;function $A(l){return(typeof l=="string"?l:""+l).replace(W6,`
6
- `).replace(V6,"")}function ap(l,u,m){if(u=$A(u),$A(l)!==u&&m)throw Error(n(425))}function sp(){}var Qg=null,Jg=null;function Zg(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 ex=typeof setTimeout=="function"?setTimeout:void 0,H6=typeof clearTimeout=="function"?clearTimeout:void 0,DA=typeof Promise=="function"?Promise:void 0,K6=typeof queueMicrotask=="function"?queueMicrotask:typeof DA<"u"?function(l){return DA.resolve(null).then(l).catch(G6)}:ex;function G6(l){setTimeout(function(){throw l})}function tx(l,u){var m=u,w=0;do{var A=m.nextSibling;if(l.removeChild(m),A&&A.nodeType===8)if(m=A.data,m==="/$"){if(w===0){l.removeChild(A),bu(u);return}w--}else m!=="$"&&m!=="$?"&&m!=="$!"||w++;m=A}while(m);bu(u)}function bi(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 LA(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 jl=Math.random().toString(36).slice(2),ss="__reactFiber$"+jl,Ou="__reactProps$"+jl,Ts="__reactContainer$"+jl,nx="__reactEvents$"+jl,Y6="__reactListeners$"+jl,X6="__reactHandles$"+jl;function so(l){var u=l[ss];if(u)return u;for(var m=l.parentNode;m;){if(u=m[Ts]||m[ss]){if(m=u.alternate,u.child!==null||m!==null&&m.child!==null)for(l=LA(l);l!==null;){if(m=l[ss])return m;l=LA(l)}return u}l=m,m=l.parentNode}return null}function Ru(l){return l=l[ss]||l[Ts],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function Sl(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(n(33))}function ip(l){return l[Ou]||null}var rx=[],Nl=-1;function wi(l){return{current:l}}function Sn(l){0>Nl||(l.current=rx[Nl],rx[Nl]=null,Nl--)}function mn(l,u){Nl++,rx[Nl]=l.current,l.current=u}var ji={},vr=wi(ji),Rr=wi(!1),io=ji;function Cl(l,u){var m=l.type.contextTypes;if(!m)return ji;var w=l.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===u)return w.__reactInternalMemoizedMaskedChildContext;var A={},k;for(k in m)A[k]=u[k];return w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=u,l.__reactInternalMemoizedMaskedChildContext=A),A}function Tr(l){return l=l.childContextTypes,l!=null}function op(){Sn(Rr),Sn(vr)}function FA(l,u,m){if(vr.current!==ji)throw Error(n(168));mn(vr,u),mn(Rr,m)}function BA(l,u,m){var w=l.stateNode;if(u=u.childContextTypes,typeof w.getChildContext!="function")return m;w=w.getChildContext();for(var A in w)if(!(A in u))throw Error(n(108,le(l)||"Unknown",A));return Z({},m,w)}function lp(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||ji,io=vr.current,mn(vr,l),mn(Rr,Rr.current),!0}function zA(l,u,m){var w=l.stateNode;if(!w)throw Error(n(169));m?(l=BA(l,u,io),w.__reactInternalMemoizedMergedChildContext=l,Sn(Rr),Sn(vr),mn(vr,l)):Sn(Rr),mn(Rr,m)}var Is=null,cp=!1,ax=!1;function UA(l){Is===null?Is=[l]:Is.push(l)}function Q6(l){cp=!0,UA(l)}function Si(){if(!ax&&Is!==null){ax=!0;var l=0,u=Xt;try{var m=Is;for(Xt=1;l<m.length;l++){var w=m[l];do w=w(!0);while(w!==null)}Is=null,cp=!1}catch(A){throw Is!==null&&(Is=Is.slice(l+1)),Ke(fl,Si),A}finally{Xt=u,ax=!1}}return null}var Al=[],_l=0,up=null,dp=0,da=[],fa=0,oo=null,Ms=1,$s="";function lo(l,u){Al[_l++]=dp,Al[_l++]=up,up=l,dp=u}function qA(l,u,m){da[fa++]=Ms,da[fa++]=$s,da[fa++]=oo,oo=l;var w=Ms;l=$s;var A=32-Kr(w)-1;w&=~(1<<A),m+=1;var k=32-Kr(u)+A;if(30<k){var I=A-A%5;k=(w&(1<<I)-1).toString(32),w>>=I,A-=I,Ms=1<<32-Kr(u)+A|m<<A|w,$s=k+l}else Ms=1<<k|m<<A|w,$s=l}function sx(l){l.return!==null&&(lo(l,1),qA(l,1,0))}function ix(l){for(;l===up;)up=Al[--_l],Al[_l]=null,dp=Al[--_l],Al[_l]=null;for(;l===oo;)oo=da[--fa],da[fa]=null,$s=da[--fa],da[fa]=null,Ms=da[--fa],da[fa]=null}var Yr=null,Xr=null,En=!1,Ta=null;function WA(l,u){var m=va(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 VA(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,Yr=l,Xr=bi(u.firstChild),!0):!1;case 6:return u=l.pendingProps===""||u.nodeType!==3?null:u,u!==null?(l.stateNode=u,Yr=l,Xr=null,!0):!1;case 13:return u=u.nodeType!==8?null:u,u!==null?(m=oo!==null?{id:Ms,overflow:$s}:null,l.memoizedState={dehydrated:u,treeContext:m,retryLane:1073741824},m=va(18,null,null,0),m.stateNode=u,m.return=l,l.child=m,Yr=l,Xr=null,!0):!1;default:return!1}}function ox(l){return(l.mode&1)!==0&&(l.flags&128)===0}function lx(l){if(En){var u=Xr;if(u){var m=u;if(!VA(l,u)){if(ox(l))throw Error(n(418));u=bi(m.nextSibling);var w=Yr;u&&VA(l,u)?WA(w,m):(l.flags=l.flags&-4097|2,En=!1,Yr=l)}}else{if(ox(l))throw Error(n(418));l.flags=l.flags&-4097|2,En=!1,Yr=l}}}function HA(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;Yr=l}function fp(l){if(l!==Yr)return!1;if(!En)return HA(l),En=!0,!1;var u;if((u=l.tag!==3)&&!(u=l.tag!==5)&&(u=l.type,u=u!=="head"&&u!=="body"&&!Zg(l.type,l.memoizedProps)),u&&(u=Xr)){if(ox(l))throw KA(),Error(n(418));for(;u;)WA(l,u),u=bi(u.nextSibling)}if(HA(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){Xr=bi(l.nextSibling);break e}u--}else m!=="$"&&m!=="$!"&&m!=="$?"||u++}l=l.nextSibling}Xr=null}}else Xr=Yr?bi(l.stateNode.nextSibling):null;return!0}function KA(){for(var l=Xr;l;)l=bi(l.nextSibling)}function El(){Xr=Yr=null,En=!1}function cx(l){Ta===null?Ta=[l]:Ta.push(l)}var J6=E.ReactCurrentBatchConfig;function Tu(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 w=m.stateNode}if(!w)throw Error(n(147,l));var A=w,k=""+l;return u!==null&&u.ref!==null&&typeof u.ref=="function"&&u.ref._stringRef===k?u.ref:(u=function(I){var J=A.refs;I===null?delete J[k]:J[k]=I},u._stringRef=k,u)}if(typeof l!="string")throw Error(n(284));if(!m._owner)throw Error(n(290,l))}return l}function pp(l,u){throw l=Object.prototype.toString.call(u),Error(n(31,l==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":l))}function GA(l){var u=l._init;return u(l._payload)}function YA(l){function u(pe,ie){if(l){var he=pe.deletions;he===null?(pe.deletions=[ie],pe.flags|=16):he.push(ie)}}function m(pe,ie){if(!l)return null;for(;ie!==null;)u(pe,ie),ie=ie.sibling;return null}function w(pe,ie){for(pe=new Map;ie!==null;)ie.key!==null?pe.set(ie.key,ie):pe.set(ie.index,ie),ie=ie.sibling;return pe}function A(pe,ie){return pe=Oi(pe,ie),pe.index=0,pe.sibling=null,pe}function k(pe,ie,he){return pe.index=he,l?(he=pe.alternate,he!==null?(he=he.index,he<ie?(pe.flags|=2,ie):he):(pe.flags|=2,ie)):(pe.flags|=1048576,ie)}function I(pe){return l&&pe.alternate===null&&(pe.flags|=2),pe}function J(pe,ie,he,Le){return ie===null||ie.tag!==6?(ie=ey(he,pe.mode,Le),ie.return=pe,ie):(ie=A(ie,he),ie.return=pe,ie)}function ne(pe,ie,he,Le){var lt=he.type;return lt===O?Oe(pe,ie,he.props.children,Le,he.key):ie!==null&&(ie.elementType===lt||typeof lt=="object"&&lt!==null&&lt.$$typeof===q&&GA(lt)===ie.type)?(Le=A(ie,he.props),Le.ref=Tu(pe,ie,he),Le.return=pe,Le):(Le=Dp(he.type,he.key,he.props,null,pe.mode,Le),Le.ref=Tu(pe,ie,he),Le.return=pe,Le)}function ve(pe,ie,he,Le){return ie===null||ie.tag!==4||ie.stateNode.containerInfo!==he.containerInfo||ie.stateNode.implementation!==he.implementation?(ie=ty(he,pe.mode,Le),ie.return=pe,ie):(ie=A(ie,he.children||[]),ie.return=pe,ie)}function Oe(pe,ie,he,Le,lt){return ie===null||ie.tag!==7?(ie=go(he,pe.mode,Le,lt),ie.return=pe,ie):(ie=A(ie,he),ie.return=pe,ie)}function Me(pe,ie,he){if(typeof ie=="string"&&ie!==""||typeof ie=="number")return ie=ey(""+ie,pe.mode,he),ie.return=pe,ie;if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case _:return he=Dp(ie.type,ie.key,ie.props,null,pe.mode,he),he.ref=Tu(pe,null,ie),he.return=pe,he;case P:return ie=ty(ie,pe.mode,he),ie.return=pe,ie;case q:var Le=ie._init;return Me(pe,Le(ie._payload),he)}if(ue(ie)||U(ie))return ie=go(ie,pe.mode,he,null),ie.return=pe,ie;pp(pe,ie)}return null}function Ee(pe,ie,he,Le){var lt=ie!==null?ie.key:null;if(typeof he=="string"&&he!==""||typeof he=="number")return lt!==null?null:J(pe,ie,""+he,Le);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case _:return he.key===lt?ne(pe,ie,he,Le):null;case P:return he.key===lt?ve(pe,ie,he,Le):null;case q:return lt=he._init,Ee(pe,ie,lt(he._payload),Le)}if(ue(he)||U(he))return lt!==null?null:Oe(pe,ie,he,Le,null);pp(pe,he)}return null}function Xe(pe,ie,he,Le,lt){if(typeof Le=="string"&&Le!==""||typeof Le=="number")return pe=pe.get(he)||null,J(ie,pe,""+Le,lt);if(typeof Le=="object"&&Le!==null){switch(Le.$$typeof){case _:return pe=pe.get(Le.key===null?he:Le.key)||null,ne(ie,pe,Le,lt);case P:return pe=pe.get(Le.key===null?he:Le.key)||null,ve(ie,pe,Le,lt);case q:var vt=Le._init;return Xe(pe,ie,he,vt(Le._payload),lt)}if(ue(Le)||U(Le))return pe=pe.get(he)||null,Oe(ie,pe,Le,lt,null);pp(ie,Le)}return null}function nt(pe,ie,he,Le){for(var lt=null,vt=null,gt=ie,St=ie=0,ir=null;gt!==null&&St<he.length;St++){gt.index>St?(ir=gt,gt=null):ir=gt.sibling;var Qt=Ee(pe,gt,he[St],Le);if(Qt===null){gt===null&&(gt=ir);break}l&&gt&&Qt.alternate===null&&u(pe,gt),ie=k(Qt,ie,St),vt===null?lt=Qt:vt.sibling=Qt,vt=Qt,gt=ir}if(St===he.length)return m(pe,gt),En&&lo(pe,St),lt;if(gt===null){for(;St<he.length;St++)gt=Me(pe,he[St],Le),gt!==null&&(ie=k(gt,ie,St),vt===null?lt=gt:vt.sibling=gt,vt=gt);return En&&lo(pe,St),lt}for(gt=w(pe,gt);St<he.length;St++)ir=Xe(gt,pe,St,he[St],Le),ir!==null&&(l&&ir.alternate!==null&&gt.delete(ir.key===null?St:ir.key),ie=k(ir,ie,St),vt===null?lt=ir:vt.sibling=ir,vt=ir);return l&&gt.forEach(function(Ri){return u(pe,Ri)}),En&&lo(pe,St),lt}function at(pe,ie,he,Le){var lt=U(he);if(typeof lt!="function")throw Error(n(150));if(he=lt.call(he),he==null)throw Error(n(151));for(var vt=lt=null,gt=ie,St=ie=0,ir=null,Qt=he.next();gt!==null&&!Qt.done;St++,Qt=he.next()){gt.index>St?(ir=gt,gt=null):ir=gt.sibling;var Ri=Ee(pe,gt,Qt.value,Le);if(Ri===null){gt===null&&(gt=ir);break}l&&gt&&Ri.alternate===null&&u(pe,gt),ie=k(Ri,ie,St),vt===null?lt=Ri:vt.sibling=Ri,vt=Ri,gt=ir}if(Qt.done)return m(pe,gt),En&&lo(pe,St),lt;if(gt===null){for(;!Qt.done;St++,Qt=he.next())Qt=Me(pe,Qt.value,Le),Qt!==null&&(ie=k(Qt,ie,St),vt===null?lt=Qt:vt.sibling=Qt,vt=Qt);return En&&lo(pe,St),lt}for(gt=w(pe,gt);!Qt.done;St++,Qt=he.next())Qt=Xe(gt,pe,St,Qt.value,Le),Qt!==null&&(l&&Qt.alternate!==null&&gt.delete(Qt.key===null?St:Qt.key),ie=k(Qt,ie,St),vt===null?lt=Qt:vt.sibling=Qt,vt=Qt);return l&&gt.forEach(function(OU){return u(pe,OU)}),En&&lo(pe,St),lt}function zn(pe,ie,he,Le){if(typeof he=="object"&&he!==null&&he.type===O&&he.key===null&&(he=he.props.children),typeof he=="object"&&he!==null){switch(he.$$typeof){case _:e:{for(var lt=he.key,vt=ie;vt!==null;){if(vt.key===lt){if(lt=he.type,lt===O){if(vt.tag===7){m(pe,vt.sibling),ie=A(vt,he.props.children),ie.return=pe,pe=ie;break e}}else if(vt.elementType===lt||typeof lt=="object"&&lt!==null&&lt.$$typeof===q&&GA(lt)===vt.type){m(pe,vt.sibling),ie=A(vt,he.props),ie.ref=Tu(pe,vt,he),ie.return=pe,pe=ie;break e}m(pe,vt);break}else u(pe,vt);vt=vt.sibling}he.type===O?(ie=go(he.props.children,pe.mode,Le,he.key),ie.return=pe,pe=ie):(Le=Dp(he.type,he.key,he.props,null,pe.mode,Le),Le.ref=Tu(pe,ie,he),Le.return=pe,pe=Le)}return I(pe);case P:e:{for(vt=he.key;ie!==null;){if(ie.key===vt)if(ie.tag===4&&ie.stateNode.containerInfo===he.containerInfo&&ie.stateNode.implementation===he.implementation){m(pe,ie.sibling),ie=A(ie,he.children||[]),ie.return=pe,pe=ie;break e}else{m(pe,ie);break}else u(pe,ie);ie=ie.sibling}ie=ty(he,pe.mode,Le),ie.return=pe,pe=ie}return I(pe);case q:return vt=he._init,zn(pe,ie,vt(he._payload),Le)}if(ue(he))return nt(pe,ie,he,Le);if(U(he))return at(pe,ie,he,Le);pp(pe,he)}return typeof he=="string"&&he!==""||typeof he=="number"?(he=""+he,ie!==null&&ie.tag===6?(m(pe,ie.sibling),ie=A(ie,he),ie.return=pe,pe=ie):(m(pe,ie),ie=ey(he,pe.mode,Le),ie.return=pe,pe=ie),I(pe)):m(pe,ie)}return zn}var Pl=YA(!0),XA=YA(!1),hp=wi(null),mp=null,kl=null,ux=null;function dx(){ux=kl=mp=null}function fx(l){var u=hp.current;Sn(hp),l._currentValue=u}function px(l,u,m){for(;l!==null;){var w=l.alternate;if((l.childLanes&u)!==u?(l.childLanes|=u,w!==null&&(w.childLanes|=u)):w!==null&&(w.childLanes&u)!==u&&(w.childLanes|=u),l===m)break;l=l.return}}function Ol(l,u){mp=l,ux=kl=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&u)!==0&&(Ir=!0),l.firstContext=null)}function pa(l){var u=l._currentValue;if(ux!==l)if(l={context:l,memoizedValue:u,next:null},kl===null){if(mp===null)throw Error(n(308));kl=l,mp.dependencies={lanes:0,firstContext:l}}else kl=kl.next=l;return u}var co=null;function hx(l){co===null?co=[l]:co.push(l)}function QA(l,u,m,w){var A=u.interleaved;return A===null?(m.next=m,hx(u)):(m.next=A.next,A.next=m),u.interleaved=m,Ds(l,w)}function Ds(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 Ni=!1;function mx(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function JA(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 Ls(l,u){return{eventTime:l,lane:u,tag:0,payload:null,callback:null,next:null}}function Ci(l,u,m){var w=l.updateQueue;if(w===null)return null;if(w=w.shared,(Yt&2)!==0){var A=w.pending;return A===null?u.next=u:(u.next=A.next,A.next=u),w.pending=u,Ds(l,m)}return A=w.interleaved,A===null?(u.next=u,hx(w)):(u.next=A.next,A.next=u),w.interleaved=u,Ds(l,m)}function vp(l,u,m){if(u=u.updateQueue,u!==null&&(u=u.shared,(m&4194240)!==0)){var w=u.lanes;w&=l.pendingLanes,m|=w,u.lanes=m,ua(l,m)}}function ZA(l,u){var m=l.updateQueue,w=l.alternate;if(w!==null&&(w=w.updateQueue,m===w)){var A=null,k=null;if(m=m.firstBaseUpdate,m!==null){do{var I={eventTime:m.eventTime,lane:m.lane,tag:m.tag,payload:m.payload,callback:m.callback,next:null};k===null?A=k=I:k=k.next=I,m=m.next}while(m!==null);k===null?A=k=u:k=k.next=u}else A=k=u;m={baseState:w.baseState,firstBaseUpdate:A,lastBaseUpdate:k,shared:w.shared,effects:w.effects},l.updateQueue=m;return}l=m.lastBaseUpdate,l===null?m.firstBaseUpdate=u:l.next=u,m.lastBaseUpdate=u}function gp(l,u,m,w){var A=l.updateQueue;Ni=!1;var k=A.firstBaseUpdate,I=A.lastBaseUpdate,J=A.shared.pending;if(J!==null){A.shared.pending=null;var ne=J,ve=ne.next;ne.next=null,I===null?k=ve:I.next=ve,I=ne;var Oe=l.alternate;Oe!==null&&(Oe=Oe.updateQueue,J=Oe.lastBaseUpdate,J!==I&&(J===null?Oe.firstBaseUpdate=ve:J.next=ve,Oe.lastBaseUpdate=ne))}if(k!==null){var Me=A.baseState;I=0,Oe=ve=ne=null,J=k;do{var Ee=J.lane,Xe=J.eventTime;if((w&Ee)===Ee){Oe!==null&&(Oe=Oe.next={eventTime:Xe,lane:0,tag:J.tag,payload:J.payload,callback:J.callback,next:null});e:{var nt=l,at=J;switch(Ee=u,Xe=m,at.tag){case 1:if(nt=at.payload,typeof nt=="function"){Me=nt.call(Xe,Me,Ee);break e}Me=nt;break e;case 3:nt.flags=nt.flags&-65537|128;case 0:if(nt=at.payload,Ee=typeof nt=="function"?nt.call(Xe,Me,Ee):nt,Ee==null)break e;Me=Z({},Me,Ee);break e;case 2:Ni=!0}}J.callback!==null&&J.lane!==0&&(l.flags|=64,Ee=A.effects,Ee===null?A.effects=[J]:Ee.push(J))}else Xe={eventTime:Xe,lane:Ee,tag:J.tag,payload:J.payload,callback:J.callback,next:null},Oe===null?(ve=Oe=Xe,ne=Me):Oe=Oe.next=Xe,I|=Ee;if(J=J.next,J===null){if(J=A.shared.pending,J===null)break;Ee=J,J=Ee.next,Ee.next=null,A.lastBaseUpdate=Ee,A.shared.pending=null}}while(!0);if(Oe===null&&(ne=Me),A.baseState=ne,A.firstBaseUpdate=ve,A.lastBaseUpdate=Oe,u=A.shared.interleaved,u!==null){A=u;do I|=A.lane,A=A.next;while(A!==u)}else k===null&&(A.shared.lanes=0);po|=I,l.lanes=I,l.memoizedState=Me}}function e_(l,u,m){if(l=u.effects,u.effects=null,l!==null)for(u=0;u<l.length;u++){var w=l[u],A=w.callback;if(A!==null){if(w.callback=null,w=m,typeof A!="function")throw Error(n(191,A));A.call(w)}}}var Iu={},is=wi(Iu),Mu=wi(Iu),$u=wi(Iu);function uo(l){if(l===Iu)throw Error(n(174));return l}function vx(l,u){switch(mn($u,u),mn(Mu,l),mn(is,Iu),l=u.nodeType,l){case 9:case 11:u=(u=u.documentElement)?u.namespaceURI:Vt(null,"");break;default:l=l===8?u.parentNode:u,u=l.namespaceURI||null,l=l.tagName,u=Vt(u,l)}Sn(is),mn(is,u)}function Rl(){Sn(is),Sn(Mu),Sn($u)}function t_(l){uo($u.current);var u=uo(is.current),m=Vt(u,l.type);u!==m&&(mn(Mu,l),mn(is,m))}function gx(l){Mu.current===l&&(Sn(is),Sn(Mu))}var Tn=wi(0);function xp(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 xx=[];function yx(){for(var l=0;l<xx.length;l++)xx[l]._workInProgressVersionPrimary=null;xx.length=0}var yp=E.ReactCurrentDispatcher,bx=E.ReactCurrentBatchConfig,fo=0,In=null,Gn=null,ar=null,bp=!1,Du=!1,Lu=0,Z6=0;function gr(){throw Error(n(321))}function wx(l,u){if(u===null)return!1;for(var m=0;m<u.length&&m<l.length;m++)if(!Ra(l[m],u[m]))return!1;return!0}function jx(l,u,m,w,A,k){if(fo=k,In=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,yp.current=l===null||l.memoizedState===null?rU:aU,l=m(w,A),Du){k=0;do{if(Du=!1,Lu=0,25<=k)throw Error(n(301));k+=1,ar=Gn=null,u.updateQueue=null,yp.current=sU,l=m(w,A)}while(Du)}if(yp.current=Sp,u=Gn!==null&&Gn.next!==null,fo=0,ar=Gn=In=null,bp=!1,u)throw Error(n(300));return l}function Sx(){var l=Lu!==0;return Lu=0,l}function os(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ar===null?In.memoizedState=ar=l:ar=ar.next=l,ar}function ha(){if(Gn===null){var l=In.alternate;l=l!==null?l.memoizedState:null}else l=Gn.next;var u=ar===null?In.memoizedState:ar.next;if(u!==null)ar=u,Gn=l;else{if(l===null)throw Error(n(310));Gn=l,l={memoizedState:Gn.memoizedState,baseState:Gn.baseState,baseQueue:Gn.baseQueue,queue:Gn.queue,next:null},ar===null?In.memoizedState=ar=l:ar=ar.next=l}return ar}function Fu(l,u){return typeof u=="function"?u(l):u}function Nx(l){var u=ha(),m=u.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=l;var w=Gn,A=w.baseQueue,k=m.pending;if(k!==null){if(A!==null){var I=A.next;A.next=k.next,k.next=I}w.baseQueue=A=k,m.pending=null}if(A!==null){k=A.next,w=w.baseState;var J=I=null,ne=null,ve=k;do{var Oe=ve.lane;if((fo&Oe)===Oe)ne!==null&&(ne=ne.next={lane:0,action:ve.action,hasEagerState:ve.hasEagerState,eagerState:ve.eagerState,next:null}),w=ve.hasEagerState?ve.eagerState:l(w,ve.action);else{var Me={lane:Oe,action:ve.action,hasEagerState:ve.hasEagerState,eagerState:ve.eagerState,next:null};ne===null?(J=ne=Me,I=w):ne=ne.next=Me,In.lanes|=Oe,po|=Oe}ve=ve.next}while(ve!==null&&ve!==k);ne===null?I=w:ne.next=J,Ra(w,u.memoizedState)||(Ir=!0),u.memoizedState=w,u.baseState=I,u.baseQueue=ne,m.lastRenderedState=w}if(l=m.interleaved,l!==null){A=l;do k=A.lane,In.lanes|=k,po|=k,A=A.next;while(A!==l)}else A===null&&(m.lanes=0);return[u.memoizedState,m.dispatch]}function Cx(l){var u=ha(),m=u.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=l;var w=m.dispatch,A=m.pending,k=u.memoizedState;if(A!==null){m.pending=null;var I=A=A.next;do k=l(k,I.action),I=I.next;while(I!==A);Ra(k,u.memoizedState)||(Ir=!0),u.memoizedState=k,u.baseQueue===null&&(u.baseState=k),m.lastRenderedState=k}return[k,w]}function n_(){}function r_(l,u){var m=In,w=ha(),A=u(),k=!Ra(w.memoizedState,A);if(k&&(w.memoizedState=A,Ir=!0),w=w.queue,Ax(i_.bind(null,m,w,l),[l]),w.getSnapshot!==u||k||ar!==null&&ar.memoizedState.tag&1){if(m.flags|=2048,Bu(9,s_.bind(null,m,w,A,u),void 0,null),sr===null)throw Error(n(349));(fo&30)!==0||a_(m,u,A)}return A}function a_(l,u,m){l.flags|=16384,l={getSnapshot:u,value:m},u=In.updateQueue,u===null?(u={lastEffect:null,stores:null},In.updateQueue=u,u.stores=[l]):(m=u.stores,m===null?u.stores=[l]:m.push(l))}function s_(l,u,m,w){u.value=m,u.getSnapshot=w,o_(u)&&l_(l)}function i_(l,u,m){return m(function(){o_(u)&&l_(l)})}function o_(l){var u=l.getSnapshot;l=l.value;try{var m=u();return!Ra(l,m)}catch{return!0}}function l_(l){var u=Ds(l,1);u!==null&&Da(u,l,1,-1)}function c_(l){var u=os();return typeof l=="function"&&(l=l()),u.memoizedState=u.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Fu,lastRenderedState:l},u.queue=l,l=l.dispatch=nU.bind(null,In,l),[u.memoizedState,l]}function Bu(l,u,m,w){return l={tag:l,create:u,destroy:m,deps:w,next:null},u=In.updateQueue,u===null?(u={lastEffect:null,stores:null},In.updateQueue=u,u.lastEffect=l.next=l):(m=u.lastEffect,m===null?u.lastEffect=l.next=l:(w=m.next,m.next=l,l.next=w,u.lastEffect=l)),l}function u_(){return ha().memoizedState}function wp(l,u,m,w){var A=os();In.flags|=l,A.memoizedState=Bu(1|u,m,void 0,w===void 0?null:w)}function jp(l,u,m,w){var A=ha();w=w===void 0?null:w;var k=void 0;if(Gn!==null){var I=Gn.memoizedState;if(k=I.destroy,w!==null&&wx(w,I.deps)){A.memoizedState=Bu(u,m,k,w);return}}In.flags|=l,A.memoizedState=Bu(1|u,m,k,w)}function d_(l,u){return wp(8390656,8,l,u)}function Ax(l,u){return jp(2048,8,l,u)}function f_(l,u){return jp(4,2,l,u)}function p_(l,u){return jp(4,4,l,u)}function h_(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 m_(l,u,m){return m=m!=null?m.concat([l]):null,jp(4,4,h_.bind(null,u,l),m)}function _x(){}function v_(l,u){var m=ha();u=u===void 0?null:u;var w=m.memoizedState;return w!==null&&u!==null&&wx(u,w[1])?w[0]:(m.memoizedState=[l,u],l)}function g_(l,u){var m=ha();u=u===void 0?null:u;var w=m.memoizedState;return w!==null&&u!==null&&wx(u,w[1])?w[0]:(l=l(),m.memoizedState=[l,u],l)}function x_(l,u,m){return(fo&21)===0?(l.baseState&&(l.baseState=!1,Ir=!0),l.memoizedState=m):(Ra(m,u)||(m=pt(),In.lanes|=m,po|=m,l.baseState=!0),u)}function eU(l,u){var m=Xt;Xt=m!==0&&4>m?m:4,l(!0);var w=bx.transition;bx.transition={};try{l(!1),u()}finally{Xt=m,bx.transition=w}}function y_(){return ha().memoizedState}function tU(l,u,m){var w=Pi(l);if(m={lane:w,action:m,hasEagerState:!1,eagerState:null,next:null},b_(l))w_(u,m);else if(m=QA(l,u,m,w),m!==null){var A=Sr();Da(m,l,w,A),j_(m,u,w)}}function nU(l,u,m){var w=Pi(l),A={lane:w,action:m,hasEagerState:!1,eagerState:null,next:null};if(b_(l))w_(u,A);else{var k=l.alternate;if(l.lanes===0&&(k===null||k.lanes===0)&&(k=u.lastRenderedReducer,k!==null))try{var I=u.lastRenderedState,J=k(I,m);if(A.hasEagerState=!0,A.eagerState=J,Ra(J,I)){var ne=u.interleaved;ne===null?(A.next=A,hx(u)):(A.next=ne.next,ne.next=A),u.interleaved=A;return}}catch{}m=QA(l,u,A,w),m!==null&&(A=Sr(),Da(m,l,w,A),j_(m,u,w))}}function b_(l){var u=l.alternate;return l===In||u!==null&&u===In}function w_(l,u){Du=bp=!0;var m=l.pending;m===null?u.next=u:(u.next=m.next,m.next=u),l.pending=u}function j_(l,u,m){if((m&4194240)!==0){var w=u.lanes;w&=l.pendingLanes,m|=w,u.lanes=m,ua(l,m)}}var Sp={readContext:pa,useCallback:gr,useContext:gr,useEffect:gr,useImperativeHandle:gr,useInsertionEffect:gr,useLayoutEffect:gr,useMemo:gr,useReducer:gr,useRef:gr,useState:gr,useDebugValue:gr,useDeferredValue:gr,useTransition:gr,useMutableSource:gr,useSyncExternalStore:gr,useId:gr,unstable_isNewReconciler:!1},rU={readContext:pa,useCallback:function(l,u){return os().memoizedState=[l,u===void 0?null:u],l},useContext:pa,useEffect:d_,useImperativeHandle:function(l,u,m){return m=m!=null?m.concat([l]):null,wp(4194308,4,h_.bind(null,u,l),m)},useLayoutEffect:function(l,u){return wp(4194308,4,l,u)},useInsertionEffect:function(l,u){return wp(4,2,l,u)},useMemo:function(l,u){var m=os();return u=u===void 0?null:u,l=l(),m.memoizedState=[l,u],l},useReducer:function(l,u,m){var w=os();return u=m!==void 0?m(u):u,w.memoizedState=w.baseState=u,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:u},w.queue=l,l=l.dispatch=tU.bind(null,In,l),[w.memoizedState,l]},useRef:function(l){var u=os();return l={current:l},u.memoizedState=l},useState:c_,useDebugValue:_x,useDeferredValue:function(l){return os().memoizedState=l},useTransition:function(){var l=c_(!1),u=l[0];return l=eU.bind(null,l[1]),os().memoizedState=l,[u,l]},useMutableSource:function(){},useSyncExternalStore:function(l,u,m){var w=In,A=os();if(En){if(m===void 0)throw Error(n(407));m=m()}else{if(m=u(),sr===null)throw Error(n(349));(fo&30)!==0||a_(w,u,m)}A.memoizedState=m;var k={value:m,getSnapshot:u};return A.queue=k,d_(i_.bind(null,w,k,l),[l]),w.flags|=2048,Bu(9,s_.bind(null,w,k,m,u),void 0,null),m},useId:function(){var l=os(),u=sr.identifierPrefix;if(En){var m=$s,w=Ms;m=(w&~(1<<32-Kr(w)-1)).toString(32)+m,u=":"+u+"R"+m,m=Lu++,0<m&&(u+="H"+m.toString(32)),u+=":"}else m=Z6++,u=":"+u+"r"+m.toString(32)+":";return l.memoizedState=u},unstable_isNewReconciler:!1},aU={readContext:pa,useCallback:v_,useContext:pa,useEffect:Ax,useImperativeHandle:m_,useInsertionEffect:f_,useLayoutEffect:p_,useMemo:g_,useReducer:Nx,useRef:u_,useState:function(){return Nx(Fu)},useDebugValue:_x,useDeferredValue:function(l){var u=ha();return x_(u,Gn.memoizedState,l)},useTransition:function(){var l=Nx(Fu)[0],u=ha().memoizedState;return[l,u]},useMutableSource:n_,useSyncExternalStore:r_,useId:y_,unstable_isNewReconciler:!1},sU={readContext:pa,useCallback:v_,useContext:pa,useEffect:Ax,useImperativeHandle:m_,useInsertionEffect:f_,useLayoutEffect:p_,useMemo:g_,useReducer:Cx,useRef:u_,useState:function(){return Cx(Fu)},useDebugValue:_x,useDeferredValue:function(l){var u=ha();return Gn===null?u.memoizedState=l:x_(u,Gn.memoizedState,l)},useTransition:function(){var l=Cx(Fu)[0],u=ha().memoizedState;return[l,u]},useMutableSource:n_,useSyncExternalStore:r_,useId:y_,unstable_isNewReconciler:!1};function Ia(l,u){if(l&&l.defaultProps){u=Z({},u),l=l.defaultProps;for(var m in l)u[m]===void 0&&(u[m]=l[m]);return u}return u}function Ex(l,u,m,w){u=l.memoizedState,m=m(w,u),m=m==null?u:Z({},u,m),l.memoizedState=m,l.lanes===0&&(l.updateQueue.baseState=m)}var Np={isMounted:function(l){return(l=l._reactInternals)?He(l)===l:!1},enqueueSetState:function(l,u,m){l=l._reactInternals;var w=Sr(),A=Pi(l),k=Ls(w,A);k.payload=u,m!=null&&(k.callback=m),u=Ci(l,k,A),u!==null&&(Da(u,l,A,w),vp(u,l,A))},enqueueReplaceState:function(l,u,m){l=l._reactInternals;var w=Sr(),A=Pi(l),k=Ls(w,A);k.tag=1,k.payload=u,m!=null&&(k.callback=m),u=Ci(l,k,A),u!==null&&(Da(u,l,A,w),vp(u,l,A))},enqueueForceUpdate:function(l,u){l=l._reactInternals;var m=Sr(),w=Pi(l),A=Ls(m,w);A.tag=2,u!=null&&(A.callback=u),u=Ci(l,A,w),u!==null&&(Da(u,l,w,m),vp(u,l,w))}};function S_(l,u,m,w,A,k,I){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(w,k,I):u.prototype&&u.prototype.isPureReactComponent?!Au(m,w)||!Au(A,k):!0}function N_(l,u,m){var w=!1,A=ji,k=u.contextType;return typeof k=="object"&&k!==null?k=pa(k):(A=Tr(u)?io:vr.current,w=u.contextTypes,k=(w=w!=null)?Cl(l,A):ji),u=new u(m,k),l.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Np,l.stateNode=u,u._reactInternals=l,w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=A,l.__reactInternalMemoizedMaskedChildContext=k),u}function C_(l,u,m,w){l=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(m,w),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(m,w),u.state!==l&&Np.enqueueReplaceState(u,u.state,null)}function Px(l,u,m,w){var A=l.stateNode;A.props=m,A.state=l.memoizedState,A.refs={},mx(l);var k=u.contextType;typeof k=="object"&&k!==null?A.context=pa(k):(k=Tr(u)?io:vr.current,A.context=Cl(l,k)),A.state=l.memoizedState,k=u.getDerivedStateFromProps,typeof k=="function"&&(Ex(l,u,k,m),A.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof A.getSnapshotBeforeUpdate=="function"||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(u=A.state,typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount(),u!==A.state&&Np.enqueueReplaceState(A,A.state,null),gp(l,m,A,w),A.state=l.memoizedState),typeof A.componentDidMount=="function"&&(l.flags|=4194308)}function Tl(l,u){try{var m="",w=u;do m+=Q(w),w=w.return;while(w);var A=m}catch(k){A=`
7
- Error generating stack: `+k.message+`
8
- `+k.stack}return{value:l,source:u,stack:A,digest:null}}function kx(l,u,m){return{value:l,source:null,stack:m??null,digest:u??null}}function Ox(l,u){try{console.error(u.value)}catch(m){setTimeout(function(){throw m})}}var iU=typeof WeakMap=="function"?WeakMap:Map;function A_(l,u,m){m=Ls(-1,m),m.tag=3,m.payload={element:null};var w=u.value;return m.callback=function(){Op||(Op=!0,Hx=w),Ox(l,u)},m}function __(l,u,m){m=Ls(-1,m),m.tag=3;var w=l.type.getDerivedStateFromError;if(typeof w=="function"){var A=u.value;m.payload=function(){return w(A)},m.callback=function(){Ox(l,u)}}var k=l.stateNode;return k!==null&&typeof k.componentDidCatch=="function"&&(m.callback=function(){Ox(l,u),typeof w!="function"&&(_i===null?_i=new Set([this]):_i.add(this));var I=u.stack;this.componentDidCatch(u.value,{componentStack:I!==null?I:""})}),m}function E_(l,u,m){var w=l.pingCache;if(w===null){w=l.pingCache=new iU;var A=new Set;w.set(u,A)}else A=w.get(u),A===void 0&&(A=new Set,w.set(u,A));A.has(m)||(A.add(m),l=bU.bind(null,l,u,m),u.then(l,l))}function P_(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 k_(l,u,m,w,A){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=Ls(-1,1),u.tag=2,Ci(m,u,1))),m.lanes|=1),l):(l.flags|=65536,l.lanes=A,l)}var oU=E.ReactCurrentOwner,Ir=!1;function jr(l,u,m,w){u.child=l===null?XA(u,null,m,w):Pl(u,l.child,m,w)}function O_(l,u,m,w,A){m=m.render;var k=u.ref;return Ol(u,A),w=jx(l,u,m,w,k,A),m=Sx(),l!==null&&!Ir?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~A,Fs(l,u,A)):(En&&m&&sx(u),u.flags|=1,jr(l,u,w,A),u.child)}function R_(l,u,m,w,A){if(l===null){var k=m.type;return typeof k=="function"&&!Zx(k)&&k.defaultProps===void 0&&m.compare===null&&m.defaultProps===void 0?(u.tag=15,u.type=k,T_(l,u,k,w,A)):(l=Dp(m.type,null,w,u,u.mode,A),l.ref=u.ref,l.return=u,u.child=l)}if(k=l.child,(l.lanes&A)===0){var I=k.memoizedProps;if(m=m.compare,m=m!==null?m:Au,m(I,w)&&l.ref===u.ref)return Fs(l,u,A)}return u.flags|=1,l=Oi(k,w),l.ref=u.ref,l.return=u,u.child=l}function T_(l,u,m,w,A){if(l!==null){var k=l.memoizedProps;if(Au(k,w)&&l.ref===u.ref)if(Ir=!1,u.pendingProps=w=k,(l.lanes&A)!==0)(l.flags&131072)!==0&&(Ir=!0);else return u.lanes=l.lanes,Fs(l,u,A)}return Rx(l,u,m,w,A)}function I_(l,u,m){var w=u.pendingProps,A=w.children,k=l!==null?l.memoizedState:null;if(w.mode==="hidden")if((u.mode&1)===0)u.memoizedState={baseLanes:0,cachePool:null,transitions:null},mn(Ml,Qr),Qr|=m;else{if((m&1073741824)===0)return l=k!==null?k.baseLanes|m:m,u.lanes=u.childLanes=1073741824,u.memoizedState={baseLanes:l,cachePool:null,transitions:null},u.updateQueue=null,mn(Ml,Qr),Qr|=l,null;u.memoizedState={baseLanes:0,cachePool:null,transitions:null},w=k!==null?k.baseLanes:m,mn(Ml,Qr),Qr|=w}else k!==null?(w=k.baseLanes|m,u.memoizedState=null):w=m,mn(Ml,Qr),Qr|=w;return jr(l,u,A,m),u.child}function M_(l,u){var m=u.ref;(l===null&&m!==null||l!==null&&l.ref!==m)&&(u.flags|=512,u.flags|=2097152)}function Rx(l,u,m,w,A){var k=Tr(m)?io:vr.current;return k=Cl(u,k),Ol(u,A),m=jx(l,u,m,w,k,A),w=Sx(),l!==null&&!Ir?(u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~A,Fs(l,u,A)):(En&&w&&sx(u),u.flags|=1,jr(l,u,m,A),u.child)}function $_(l,u,m,w,A){if(Tr(m)){var k=!0;lp(u)}else k=!1;if(Ol(u,A),u.stateNode===null)Ap(l,u),N_(u,m,w),Px(u,m,w,A),w=!0;else if(l===null){var I=u.stateNode,J=u.memoizedProps;I.props=J;var ne=I.context,ve=m.contextType;typeof ve=="object"&&ve!==null?ve=pa(ve):(ve=Tr(m)?io:vr.current,ve=Cl(u,ve));var Oe=m.getDerivedStateFromProps,Me=typeof Oe=="function"||typeof I.getSnapshotBeforeUpdate=="function";Me||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(J!==w||ne!==ve)&&C_(u,I,w,ve),Ni=!1;var Ee=u.memoizedState;I.state=Ee,gp(u,w,I,A),ne=u.memoizedState,J!==w||Ee!==ne||Rr.current||Ni?(typeof Oe=="function"&&(Ex(u,m,Oe,w),ne=u.memoizedState),(J=Ni||S_(u,m,J,w,Ee,ne,ve))?(Me||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(u.flags|=4194308)):(typeof I.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=w,u.memoizedState=ne),I.props=w,I.state=ne,I.context=ve,w=J):(typeof I.componentDidMount=="function"&&(u.flags|=4194308),w=!1)}else{I=u.stateNode,JA(l,u),J=u.memoizedProps,ve=u.type===u.elementType?J:Ia(u.type,J),I.props=ve,Me=u.pendingProps,Ee=I.context,ne=m.contextType,typeof ne=="object"&&ne!==null?ne=pa(ne):(ne=Tr(m)?io:vr.current,ne=Cl(u,ne));var Xe=m.getDerivedStateFromProps;(Oe=typeof Xe=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(J!==Me||Ee!==ne)&&C_(u,I,w,ne),Ni=!1,Ee=u.memoizedState,I.state=Ee,gp(u,w,I,A);var nt=u.memoizedState;J!==Me||Ee!==nt||Rr.current||Ni?(typeof Xe=="function"&&(Ex(u,m,Xe,w),nt=u.memoizedState),(ve=Ni||S_(u,m,ve,w,Ee,nt,ne)||!1)?(Oe||typeof I.UNSAFE_componentWillUpdate!="function"&&typeof I.componentWillUpdate!="function"||(typeof I.componentWillUpdate=="function"&&I.componentWillUpdate(w,nt,ne),typeof I.UNSAFE_componentWillUpdate=="function"&&I.UNSAFE_componentWillUpdate(w,nt,ne)),typeof I.componentDidUpdate=="function"&&(u.flags|=4),typeof I.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof I.componentDidUpdate!="function"||J===l.memoizedProps&&Ee===l.memoizedState||(u.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||J===l.memoizedProps&&Ee===l.memoizedState||(u.flags|=1024),u.memoizedProps=w,u.memoizedState=nt),I.props=w,I.state=nt,I.context=ne,w=ve):(typeof I.componentDidUpdate!="function"||J===l.memoizedProps&&Ee===l.memoizedState||(u.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||J===l.memoizedProps&&Ee===l.memoizedState||(u.flags|=1024),w=!1)}return Tx(l,u,m,w,k,A)}function Tx(l,u,m,w,A,k){M_(l,u);var I=(u.flags&128)!==0;if(!w&&!I)return A&&zA(u,m,!1),Fs(l,u,k);w=u.stateNode,oU.current=u;var J=I&&typeof m.getDerivedStateFromError!="function"?null:w.render();return u.flags|=1,l!==null&&I?(u.child=Pl(u,l.child,null,k),u.child=Pl(u,null,J,k)):jr(l,u,J,k),u.memoizedState=w.state,A&&zA(u,m,!0),u.child}function D_(l){var u=l.stateNode;u.pendingContext?FA(l,u.pendingContext,u.pendingContext!==u.context):u.context&&FA(l,u.context,!1),vx(l,u.containerInfo)}function L_(l,u,m,w,A){return El(),cx(A),u.flags|=256,jr(l,u,m,w),u.child}var Ix={dehydrated:null,treeContext:null,retryLane:0};function Mx(l){return{baseLanes:l,cachePool:null,transitions:null}}function F_(l,u,m){var w=u.pendingProps,A=Tn.current,k=!1,I=(u.flags&128)!==0,J;if((J=I)||(J=l!==null&&l.memoizedState===null?!1:(A&2)!==0),J?(k=!0,u.flags&=-129):(l===null||l.memoizedState!==null)&&(A|=1),mn(Tn,A&1),l===null)return lx(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):(I=w.children,l=w.fallback,k?(w=u.mode,k=u.child,I={mode:"hidden",children:I},(w&1)===0&&k!==null?(k.childLanes=0,k.pendingProps=I):k=Lp(I,w,0,null),l=go(l,w,m,null),k.return=u,l.return=u,k.sibling=l,u.child=k,u.child.memoizedState=Mx(m),u.memoizedState=Ix,l):$x(u,I));if(A=l.memoizedState,A!==null&&(J=A.dehydrated,J!==null))return lU(l,u,I,w,J,A,m);if(k){k=w.fallback,I=u.mode,A=l.child,J=A.sibling;var ne={mode:"hidden",children:w.children};return(I&1)===0&&u.child!==A?(w=u.child,w.childLanes=0,w.pendingProps=ne,u.deletions=null):(w=Oi(A,ne),w.subtreeFlags=A.subtreeFlags&14680064),J!==null?k=Oi(J,k):(k=go(k,I,m,null),k.flags|=2),k.return=u,w.return=u,w.sibling=k,u.child=w,w=k,k=u.child,I=l.child.memoizedState,I=I===null?Mx(m):{baseLanes:I.baseLanes|m,cachePool:null,transitions:I.transitions},k.memoizedState=I,k.childLanes=l.childLanes&~m,u.memoizedState=Ix,w}return k=l.child,l=k.sibling,w=Oi(k,{mode:"visible",children:w.children}),(u.mode&1)===0&&(w.lanes=m),w.return=u,w.sibling=null,l!==null&&(m=u.deletions,m===null?(u.deletions=[l],u.flags|=16):m.push(l)),u.child=w,u.memoizedState=null,w}function $x(l,u){return u=Lp({mode:"visible",children:u},l.mode,0,null),u.return=l,l.child=u}function Cp(l,u,m,w){return w!==null&&cx(w),Pl(u,l.child,null,m),l=$x(u,u.pendingProps.children),l.flags|=2,u.memoizedState=null,l}function lU(l,u,m,w,A,k,I){if(m)return u.flags&256?(u.flags&=-257,w=kx(Error(n(422))),Cp(l,u,I,w)):u.memoizedState!==null?(u.child=l.child,u.flags|=128,null):(k=w.fallback,A=u.mode,w=Lp({mode:"visible",children:w.children},A,0,null),k=go(k,A,I,null),k.flags|=2,w.return=u,k.return=u,w.sibling=k,u.child=w,(u.mode&1)!==0&&Pl(u,l.child,null,I),u.child.memoizedState=Mx(I),u.memoizedState=Ix,k);if((u.mode&1)===0)return Cp(l,u,I,null);if(A.data==="$!"){if(w=A.nextSibling&&A.nextSibling.dataset,w)var J=w.dgst;return w=J,k=Error(n(419)),w=kx(k,w,void 0),Cp(l,u,I,w)}if(J=(I&l.childLanes)!==0,Ir||J){if(w=sr,w!==null){switch(I&-I){case 4:A=2;break;case 16:A=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:A=32;break;case 536870912:A=268435456;break;default:A=0}A=(A&(w.suspendedLanes|I))!==0?0:A,A!==0&&A!==k.retryLane&&(k.retryLane=A,Ds(l,A),Da(w,l,A,-1))}return Jx(),w=kx(Error(n(421))),Cp(l,u,I,w)}return A.data==="$?"?(u.flags|=128,u.child=l.child,u=wU.bind(null,l),A._reactRetry=u,null):(l=k.treeContext,Xr=bi(A.nextSibling),Yr=u,En=!0,Ta=null,l!==null&&(da[fa++]=Ms,da[fa++]=$s,da[fa++]=oo,Ms=l.id,$s=l.overflow,oo=u),u=$x(u,w.children),u.flags|=4096,u)}function B_(l,u,m){l.lanes|=u;var w=l.alternate;w!==null&&(w.lanes|=u),px(l.return,u,m)}function Dx(l,u,m,w,A){var k=l.memoizedState;k===null?l.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:w,tail:m,tailMode:A}:(k.isBackwards=u,k.rendering=null,k.renderingStartTime=0,k.last=w,k.tail=m,k.tailMode=A)}function z_(l,u,m){var w=u.pendingProps,A=w.revealOrder,k=w.tail;if(jr(l,u,w.children,m),w=Tn.current,(w&2)!==0)w=w&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&&B_(l,m,u);else if(l.tag===19)B_(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}w&=1}if(mn(Tn,w),(u.mode&1)===0)u.memoizedState=null;else switch(A){case"forwards":for(m=u.child,A=null;m!==null;)l=m.alternate,l!==null&&xp(l)===null&&(A=m),m=m.sibling;m=A,m===null?(A=u.child,u.child=null):(A=m.sibling,m.sibling=null),Dx(u,!1,A,m,k);break;case"backwards":for(m=null,A=u.child,u.child=null;A!==null;){if(l=A.alternate,l!==null&&xp(l)===null){u.child=A;break}l=A.sibling,A.sibling=m,m=A,A=l}Dx(u,!0,m,null,k);break;case"together":Dx(u,!1,null,null,void 0);break;default:u.memoizedState=null}return u.child}function Ap(l,u){(u.mode&1)===0&&l!==null&&(l.alternate=null,u.alternate=null,u.flags|=2)}function Fs(l,u,m){if(l!==null&&(u.dependencies=l.dependencies),po|=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=Oi(l,l.pendingProps),u.child=m,m.return=u;l.sibling!==null;)l=l.sibling,m=m.sibling=Oi(l,l.pendingProps),m.return=u;m.sibling=null}return u.child}function cU(l,u,m){switch(u.tag){case 3:D_(u),El();break;case 5:t_(u);break;case 1:Tr(u.type)&&lp(u);break;case 4:vx(u,u.stateNode.containerInfo);break;case 10:var w=u.type._context,A=u.memoizedProps.value;mn(hp,w._currentValue),w._currentValue=A;break;case 13:if(w=u.memoizedState,w!==null)return w.dehydrated!==null?(mn(Tn,Tn.current&1),u.flags|=128,null):(m&u.child.childLanes)!==0?F_(l,u,m):(mn(Tn,Tn.current&1),l=Fs(l,u,m),l!==null?l.sibling:null);mn(Tn,Tn.current&1);break;case 19:if(w=(m&u.childLanes)!==0,(l.flags&128)!==0){if(w)return z_(l,u,m);u.flags|=128}if(A=u.memoizedState,A!==null&&(A.rendering=null,A.tail=null,A.lastEffect=null),mn(Tn,Tn.current),w)break;return null;case 22:case 23:return u.lanes=0,I_(l,u,m)}return Fs(l,u,m)}var U_,Lx,q_,W_;U_=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}},Lx=function(){},q_=function(l,u,m,w){var A=l.memoizedProps;if(A!==w){l=u.stateNode,uo(is.current);var k=null;switch(m){case"input":A=Ae(l,A),w=Ae(l,w),k=[];break;case"select":A=Z({},A,{value:void 0}),w=Z({},w,{value:void 0}),k=[];break;case"textarea":A=Ye(l,A),w=Ye(l,w),k=[];break;default:typeof A.onClick!="function"&&typeof w.onClick=="function"&&(l.onclick=sp)}Ue(m,w);var I;m=null;for(ve in A)if(!w.hasOwnProperty(ve)&&A.hasOwnProperty(ve)&&A[ve]!=null)if(ve==="style"){var J=A[ve];for(I in J)J.hasOwnProperty(I)&&(m||(m={}),m[I]="")}else ve!=="dangerouslySetInnerHTML"&&ve!=="children"&&ve!=="suppressContentEditableWarning"&&ve!=="suppressHydrationWarning"&&ve!=="autoFocus"&&(a.hasOwnProperty(ve)?k||(k=[]):(k=k||[]).push(ve,null));for(ve in w){var ne=w[ve];if(J=A?.[ve],w.hasOwnProperty(ve)&&ne!==J&&(ne!=null||J!=null))if(ve==="style")if(J){for(I in J)!J.hasOwnProperty(I)||ne&&ne.hasOwnProperty(I)||(m||(m={}),m[I]="");for(I in ne)ne.hasOwnProperty(I)&&J[I]!==ne[I]&&(m||(m={}),m[I]=ne[I])}else m||(k||(k=[]),k.push(ve,m)),m=ne;else ve==="dangerouslySetInnerHTML"?(ne=ne?ne.__html:void 0,J=J?J.__html:void 0,ne!=null&&J!==ne&&(k=k||[]).push(ve,ne)):ve==="children"?typeof ne!="string"&&typeof ne!="number"||(k=k||[]).push(ve,""+ne):ve!=="suppressContentEditableWarning"&&ve!=="suppressHydrationWarning"&&(a.hasOwnProperty(ve)?(ne!=null&&ve==="onScroll"&&jn("scroll",l),k||J===ne||(k=[])):(k=k||[]).push(ve,ne))}m&&(k=k||[]).push("style",m);var ve=k;(u.updateQueue=ve)&&(u.flags|=4)}},W_=function(l,u,m,w){m!==w&&(u.flags|=4)};function zu(l,u){if(!En)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 w=null;m!==null;)m.alternate!==null&&(w=m),m=m.sibling;w===null?u||l.tail===null?l.tail=null:l.tail.sibling=null:w.sibling=null}}function xr(l){var u=l.alternate!==null&&l.alternate.child===l.child,m=0,w=0;if(u)for(var A=l.child;A!==null;)m|=A.lanes|A.childLanes,w|=A.subtreeFlags&14680064,w|=A.flags&14680064,A.return=l,A=A.sibling;else for(A=l.child;A!==null;)m|=A.lanes|A.childLanes,w|=A.subtreeFlags,w|=A.flags,A.return=l,A=A.sibling;return l.subtreeFlags|=w,l.childLanes=m,u}function uU(l,u,m){var w=u.pendingProps;switch(ix(u),u.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xr(u),null;case 1:return Tr(u.type)&&op(),xr(u),null;case 3:return w=u.stateNode,Rl(),Sn(Rr),Sn(vr),yx(),w.pendingContext&&(w.context=w.pendingContext,w.pendingContext=null),(l===null||l.child===null)&&(fp(u)?u.flags|=4:l===null||l.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Ta!==null&&(Yx(Ta),Ta=null))),Lx(l,u),xr(u),null;case 5:gx(u);var A=uo($u.current);if(m=u.type,l!==null&&u.stateNode!=null)q_(l,u,m,w,A),l.ref!==u.ref&&(u.flags|=512,u.flags|=2097152);else{if(!w){if(u.stateNode===null)throw Error(n(166));return xr(u),null}if(l=uo(is.current),fp(u)){w=u.stateNode,m=u.type;var k=u.memoizedProps;switch(w[ss]=u,w[Ou]=k,l=(u.mode&1)!==0,m){case"dialog":jn("cancel",w),jn("close",w);break;case"iframe":case"object":case"embed":jn("load",w);break;case"video":case"audio":for(A=0;A<Eu.length;A++)jn(Eu[A],w);break;case"source":jn("error",w);break;case"img":case"image":case"link":jn("error",w),jn("load",w);break;case"details":jn("toggle",w);break;case"input":Te(w,k),jn("invalid",w);break;case"select":w._wrapperState={wasMultiple:!!k.multiple},jn("invalid",w);break;case"textarea":Ct(w,k),jn("invalid",w)}Ue(m,k),A=null;for(var I in k)if(k.hasOwnProperty(I)){var J=k[I];I==="children"?typeof J=="string"?w.textContent!==J&&(k.suppressHydrationWarning!==!0&&ap(w.textContent,J,l),A=["children",J]):typeof J=="number"&&w.textContent!==""+J&&(k.suppressHydrationWarning!==!0&&ap(w.textContent,J,l),A=["children",""+J]):a.hasOwnProperty(I)&&J!=null&&I==="onScroll"&&jn("scroll",w)}switch(m){case"input":Ce(w),X(w,k,!0);break;case"textarea":Ce(w),mt(w);break;case"select":case"option":break;default:typeof k.onClick=="function"&&(w.onclick=sp)}w=A,u.updateQueue=w,w!==null&&(u.flags|=4)}else{I=A.nodeType===9?A:A.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=Nt(m)),l==="http://www.w3.org/1999/xhtml"?m==="script"?(l=I.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof w.is=="string"?l=I.createElement(m,{is:w.is}):(l=I.createElement(m),m==="select"&&(I=l,w.multiple?I.multiple=!0:w.size&&(I.size=w.size))):l=I.createElementNS(l,m),l[ss]=u,l[Ou]=w,U_(l,u,!1,!1),u.stateNode=l;e:{switch(I=Tt(m,w),m){case"dialog":jn("cancel",l),jn("close",l),A=w;break;case"iframe":case"object":case"embed":jn("load",l),A=w;break;case"video":case"audio":for(A=0;A<Eu.length;A++)jn(Eu[A],l);A=w;break;case"source":jn("error",l),A=w;break;case"img":case"image":case"link":jn("error",l),jn("load",l),A=w;break;case"details":jn("toggle",l),A=w;break;case"input":Te(l,w),A=Ae(l,w),jn("invalid",l);break;case"option":A=w;break;case"select":l._wrapperState={wasMultiple:!!w.multiple},A=Z({},w,{value:void 0}),jn("invalid",l);break;case"textarea":Ct(l,w),A=Ye(l,w),jn("invalid",l);break;default:A=w}Ue(m,A),J=A;for(k in J)if(J.hasOwnProperty(k)){var ne=J[k];k==="style"?ke(l,ne):k==="dangerouslySetInnerHTML"?(ne=ne?ne.__html:void 0,ne!=null&&ln(l,ne)):k==="children"?typeof ne=="string"?(m!=="textarea"||ne!=="")&&ee(l,ne):typeof ne=="number"&&ee(l,""+ne):k!=="suppressContentEditableWarning"&&k!=="suppressHydrationWarning"&&k!=="autoFocus"&&(a.hasOwnProperty(k)?ne!=null&&k==="onScroll"&&jn("scroll",l):ne!=null&&N(l,k,ne,I))}switch(m){case"input":Ce(l),X(l,w,!1);break;case"textarea":Ce(l),mt(l);break;case"option":w.value!=null&&l.setAttribute("value",""+me(w.value));break;case"select":l.multiple=!!w.multiple,k=w.value,k!=null?De(l,!!w.multiple,k,!1):w.defaultValue!=null&&De(l,!!w.multiple,w.defaultValue,!0);break;default:typeof A.onClick=="function"&&(l.onclick=sp)}switch(m){case"button":case"input":case"select":case"textarea":w=!!w.autoFocus;break e;case"img":w=!0;break e;default:w=!1}}w&&(u.flags|=4)}u.ref!==null&&(u.flags|=512,u.flags|=2097152)}return xr(u),null;case 6:if(l&&u.stateNode!=null)W_(l,u,l.memoizedProps,w);else{if(typeof w!="string"&&u.stateNode===null)throw Error(n(166));if(m=uo($u.current),uo(is.current),fp(u)){if(w=u.stateNode,m=u.memoizedProps,w[ss]=u,(k=w.nodeValue!==m)&&(l=Yr,l!==null))switch(l.tag){case 3:ap(w.nodeValue,m,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&ap(w.nodeValue,m,(l.mode&1)!==0)}k&&(u.flags|=4)}else w=(m.nodeType===9?m:m.ownerDocument).createTextNode(w),w[ss]=u,u.stateNode=w}return xr(u),null;case 13:if(Sn(Tn),w=u.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(En&&Xr!==null&&(u.mode&1)!==0&&(u.flags&128)===0)KA(),El(),u.flags|=98560,k=!1;else if(k=fp(u),w!==null&&w.dehydrated!==null){if(l===null){if(!k)throw Error(n(318));if(k=u.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(n(317));k[ss]=u}else El(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;xr(u),k=!1}else Ta!==null&&(Yx(Ta),Ta=null),k=!0;if(!k)return u.flags&65536?u:null}return(u.flags&128)!==0?(u.lanes=m,u):(w=w!==null,w!==(l!==null&&l.memoizedState!==null)&&w&&(u.child.flags|=8192,(u.mode&1)!==0&&(l===null||(Tn.current&1)!==0?Yn===0&&(Yn=3):Jx())),u.updateQueue!==null&&(u.flags|=4),xr(u),null);case 4:return Rl(),Lx(l,u),l===null&&Pu(u.stateNode.containerInfo),xr(u),null;case 10:return fx(u.type._context),xr(u),null;case 17:return Tr(u.type)&&op(),xr(u),null;case 19:if(Sn(Tn),k=u.memoizedState,k===null)return xr(u),null;if(w=(u.flags&128)!==0,I=k.rendering,I===null)if(w)zu(k,!1);else{if(Yn!==0||l!==null&&(l.flags&128)!==0)for(l=u.child;l!==null;){if(I=xp(l),I!==null){for(u.flags|=128,zu(k,!1),w=I.updateQueue,w!==null&&(u.updateQueue=w,u.flags|=4),u.subtreeFlags=0,w=m,m=u.child;m!==null;)k=m,l=w,k.flags&=14680066,I=k.alternate,I===null?(k.childLanes=0,k.lanes=l,k.child=null,k.subtreeFlags=0,k.memoizedProps=null,k.memoizedState=null,k.updateQueue=null,k.dependencies=null,k.stateNode=null):(k.childLanes=I.childLanes,k.lanes=I.lanes,k.child=I.child,k.subtreeFlags=0,k.deletions=null,k.memoizedProps=I.memoizedProps,k.memoizedState=I.memoizedState,k.updateQueue=I.updateQueue,k.type=I.type,l=I.dependencies,k.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),m=m.sibling;return mn(Tn,Tn.current&1|2),u.child}l=l.sibling}k.tail!==null&&wn()>$l&&(u.flags|=128,w=!0,zu(k,!1),u.lanes=4194304)}else{if(!w)if(l=xp(I),l!==null){if(u.flags|=128,w=!0,m=l.updateQueue,m!==null&&(u.updateQueue=m,u.flags|=4),zu(k,!0),k.tail===null&&k.tailMode==="hidden"&&!I.alternate&&!En)return xr(u),null}else 2*wn()-k.renderingStartTime>$l&&m!==1073741824&&(u.flags|=128,w=!0,zu(k,!1),u.lanes=4194304);k.isBackwards?(I.sibling=u.child,u.child=I):(m=k.last,m!==null?m.sibling=I:u.child=I,k.last=I)}return k.tail!==null?(u=k.tail,k.rendering=u,k.tail=u.sibling,k.renderingStartTime=wn(),u.sibling=null,m=Tn.current,mn(Tn,w?m&1|2:m&1),u):(xr(u),null);case 22:case 23:return Qx(),w=u.memoizedState!==null,l!==null&&l.memoizedState!==null!==w&&(u.flags|=8192),w&&(u.mode&1)!==0?(Qr&1073741824)!==0&&(xr(u),u.subtreeFlags&6&&(u.flags|=8192)):xr(u),null;case 24:return null;case 25:return null}throw Error(n(156,u.tag))}function dU(l,u){switch(ix(u),u.tag){case 1:return Tr(u.type)&&op(),l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 3:return Rl(),Sn(Rr),Sn(vr),yx(),l=u.flags,(l&65536)!==0&&(l&128)===0?(u.flags=l&-65537|128,u):null;case 5:return gx(u),null;case 13:if(Sn(Tn),l=u.memoizedState,l!==null&&l.dehydrated!==null){if(u.alternate===null)throw Error(n(340));El()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 19:return Sn(Tn),null;case 4:return Rl(),null;case 10:return fx(u.type._context),null;case 22:case 23:return Qx(),null;case 24:return null;default:return null}}var _p=!1,yr=!1,fU=typeof WeakSet=="function"?WeakSet:Set,Je=null;function Il(l,u){var m=l.ref;if(m!==null)if(typeof m=="function")try{m(null)}catch(w){$n(l,u,w)}else m.current=null}function Fx(l,u,m){try{m()}catch(w){$n(l,u,w)}}var V_=!1;function pU(l,u){if(Qg=Kf,l=SA(),qg(l)){if("selectionStart"in l)var m={start:l.selectionStart,end:l.selectionEnd};else e:{m=(m=l.ownerDocument)&&m.defaultView||window;var w=m.getSelection&&m.getSelection();if(w&&w.rangeCount!==0){m=w.anchorNode;var A=w.anchorOffset,k=w.focusNode;w=w.focusOffset;try{m.nodeType,k.nodeType}catch{m=null;break e}var I=0,J=-1,ne=-1,ve=0,Oe=0,Me=l,Ee=null;t:for(;;){for(var Xe;Me!==m||A!==0&&Me.nodeType!==3||(J=I+A),Me!==k||w!==0&&Me.nodeType!==3||(ne=I+w),Me.nodeType===3&&(I+=Me.nodeValue.length),(Xe=Me.firstChild)!==null;)Ee=Me,Me=Xe;for(;;){if(Me===l)break t;if(Ee===m&&++ve===A&&(J=I),Ee===k&&++Oe===w&&(ne=I),(Xe=Me.nextSibling)!==null)break;Me=Ee,Ee=Me.parentNode}Me=Xe}m=J===-1||ne===-1?null:{start:J,end:ne}}else m=null}m=m||{start:0,end:0}}else m=null;for(Jg={focusedElem:l,selectionRange:m},Kf=!1,Je=u;Je!==null;)if(u=Je,l=u.child,(u.subtreeFlags&1028)!==0&&l!==null)l.return=u,Je=l;else for(;Je!==null;){u=Je;try{var nt=u.alternate;if((u.flags&1024)!==0)switch(u.tag){case 0:case 11:case 15:break;case 1:if(nt!==null){var at=nt.memoizedProps,zn=nt.memoizedState,pe=u.stateNode,ie=pe.getSnapshotBeforeUpdate(u.elementType===u.type?at:Ia(u.type,at),zn);pe.__reactInternalSnapshotBeforeUpdate=ie}break;case 3:var he=u.stateNode.containerInfo;he.nodeType===1?he.textContent="":he.nodeType===9&&he.documentElement&&he.removeChild(he.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Le){$n(u,u.return,Le)}if(l=u.sibling,l!==null){l.return=u.return,Je=l;break}Je=u.return}return nt=V_,V_=!1,nt}function Uu(l,u,m){var w=u.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var A=w=w.next;do{if((A.tag&l)===l){var k=A.destroy;A.destroy=void 0,k!==void 0&&Fx(u,m,k)}A=A.next}while(A!==w)}}function Ep(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 w=m.create;m.destroy=w()}m=m.next}while(m!==u)}}function Bx(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 H_(l){var u=l.alternate;u!==null&&(l.alternate=null,H_(u)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(u=l.stateNode,u!==null&&(delete u[ss],delete u[Ou],delete u[nx],delete u[Y6],delete u[X6])),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 K_(l){return l.tag===5||l.tag===3||l.tag===4}function G_(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||K_(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 zx(l,u,m){var w=l.tag;if(w===5||w===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=sp));else if(w!==4&&(l=l.child,l!==null))for(zx(l,u,m),l=l.sibling;l!==null;)zx(l,u,m),l=l.sibling}function Ux(l,u,m){var w=l.tag;if(w===5||w===6)l=l.stateNode,u?m.insertBefore(l,u):m.appendChild(l);else if(w!==4&&(l=l.child,l!==null))for(Ux(l,u,m),l=l.sibling;l!==null;)Ux(l,u,m),l=l.sibling}var dr=null,Ma=!1;function Ai(l,u,m){for(m=m.child;m!==null;)Y_(l,u,m),m=m.sibling}function Y_(l,u,m){if(ca&&typeof ca.onCommitFiberUnmount=="function")try{ca.onCommitFiberUnmount(Rs,m)}catch{}switch(m.tag){case 5:yr||Il(m,u);case 6:var w=dr,A=Ma;dr=null,Ai(l,u,m),dr=w,Ma=A,dr!==null&&(Ma?(l=dr,m=m.stateNode,l.nodeType===8?l.parentNode.removeChild(m):l.removeChild(m)):dr.removeChild(m.stateNode));break;case 18:dr!==null&&(Ma?(l=dr,m=m.stateNode,l.nodeType===8?tx(l.parentNode,m):l.nodeType===1&&tx(l,m),bu(l)):tx(dr,m.stateNode));break;case 4:w=dr,A=Ma,dr=m.stateNode.containerInfo,Ma=!0,Ai(l,u,m),dr=w,Ma=A;break;case 0:case 11:case 14:case 15:if(!yr&&(w=m.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){A=w=w.next;do{var k=A,I=k.destroy;k=k.tag,I!==void 0&&((k&2)!==0||(k&4)!==0)&&Fx(m,u,I),A=A.next}while(A!==w)}Ai(l,u,m);break;case 1:if(!yr&&(Il(m,u),w=m.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=m.memoizedProps,w.state=m.memoizedState,w.componentWillUnmount()}catch(J){$n(m,u,J)}Ai(l,u,m);break;case 21:Ai(l,u,m);break;case 22:m.mode&1?(yr=(w=yr)||m.memoizedState!==null,Ai(l,u,m),yr=w):Ai(l,u,m);break;default:Ai(l,u,m)}}function X_(l){var u=l.updateQueue;if(u!==null){l.updateQueue=null;var m=l.stateNode;m===null&&(m=l.stateNode=new fU),u.forEach(function(w){var A=jU.bind(null,l,w);m.has(w)||(m.add(w),w.then(A,A))})}}function $a(l,u){var m=u.deletions;if(m!==null)for(var w=0;w<m.length;w++){var A=m[w];try{var k=l,I=u,J=I;e:for(;J!==null;){switch(J.tag){case 5:dr=J.stateNode,Ma=!1;break e;case 3:dr=J.stateNode.containerInfo,Ma=!0;break e;case 4:dr=J.stateNode.containerInfo,Ma=!0;break e}J=J.return}if(dr===null)throw Error(n(160));Y_(k,I,A),dr=null,Ma=!1;var ne=A.alternate;ne!==null&&(ne.return=null),A.return=null}catch(ve){$n(A,u,ve)}}if(u.subtreeFlags&12854)for(u=u.child;u!==null;)Q_(u,l),u=u.sibling}function Q_(l,u){var m=l.alternate,w=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if($a(u,l),ls(l),w&4){try{Uu(3,l,l.return),Ep(3,l)}catch(at){$n(l,l.return,at)}try{Uu(5,l,l.return)}catch(at){$n(l,l.return,at)}}break;case 1:$a(u,l),ls(l),w&512&&m!==null&&Il(m,m.return);break;case 5:if($a(u,l),ls(l),w&512&&m!==null&&Il(m,m.return),l.flags&32){var A=l.stateNode;try{ee(A,"")}catch(at){$n(l,l.return,at)}}if(w&4&&(A=l.stateNode,A!=null)){var k=l.memoizedProps,I=m!==null?m.memoizedProps:k,J=l.type,ne=l.updateQueue;if(l.updateQueue=null,ne!==null)try{J==="input"&&k.type==="radio"&&k.name!=null&&be(A,k),Tt(J,I);var ve=Tt(J,k);for(I=0;I<ne.length;I+=2){var Oe=ne[I],Me=ne[I+1];Oe==="style"?ke(A,Me):Oe==="dangerouslySetInnerHTML"?ln(A,Me):Oe==="children"?ee(A,Me):N(A,Oe,Me,ve)}switch(J){case"input":_e(A,k);break;case"textarea":Ft(A,k);break;case"select":var Ee=A._wrapperState.wasMultiple;A._wrapperState.wasMultiple=!!k.multiple;var Xe=k.value;Xe!=null?De(A,!!k.multiple,Xe,!1):Ee!==!!k.multiple&&(k.defaultValue!=null?De(A,!!k.multiple,k.defaultValue,!0):De(A,!!k.multiple,k.multiple?[]:"",!1))}A[Ou]=k}catch(at){$n(l,l.return,at)}}break;case 6:if($a(u,l),ls(l),w&4){if(l.stateNode===null)throw Error(n(162));A=l.stateNode,k=l.memoizedProps;try{A.nodeValue=k}catch(at){$n(l,l.return,at)}}break;case 3:if($a(u,l),ls(l),w&4&&m!==null&&m.memoizedState.isDehydrated)try{bu(u.containerInfo)}catch(at){$n(l,l.return,at)}break;case 4:$a(u,l),ls(l);break;case 13:$a(u,l),ls(l),A=l.child,A.flags&8192&&(k=A.memoizedState!==null,A.stateNode.isHidden=k,!k||A.alternate!==null&&A.alternate.memoizedState!==null||(Vx=wn())),w&4&&X_(l);break;case 22:if(Oe=m!==null&&m.memoizedState!==null,l.mode&1?(yr=(ve=yr)||Oe,$a(u,l),yr=ve):$a(u,l),ls(l),w&8192){if(ve=l.memoizedState!==null,(l.stateNode.isHidden=ve)&&!Oe&&(l.mode&1)!==0)for(Je=l,Oe=l.child;Oe!==null;){for(Me=Je=Oe;Je!==null;){switch(Ee=Je,Xe=Ee.child,Ee.tag){case 0:case 11:case 14:case 15:Uu(4,Ee,Ee.return);break;case 1:Il(Ee,Ee.return);var nt=Ee.stateNode;if(typeof nt.componentWillUnmount=="function"){w=Ee,m=Ee.return;try{u=w,nt.props=u.memoizedProps,nt.state=u.memoizedState,nt.componentWillUnmount()}catch(at){$n(w,m,at)}}break;case 5:Il(Ee,Ee.return);break;case 22:if(Ee.memoizedState!==null){eE(Me);continue}}Xe!==null?(Xe.return=Ee,Je=Xe):eE(Me)}Oe=Oe.sibling}e:for(Oe=null,Me=l;;){if(Me.tag===5){if(Oe===null){Oe=Me;try{A=Me.stateNode,ve?(k=A.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none"):(J=Me.stateNode,ne=Me.memoizedProps.style,I=ne!=null&&ne.hasOwnProperty("display")?ne.display:null,J.style.display=ze("display",I))}catch(at){$n(l,l.return,at)}}}else if(Me.tag===6){if(Oe===null)try{Me.stateNode.nodeValue=ve?"":Me.memoizedProps}catch(at){$n(l,l.return,at)}}else if((Me.tag!==22&&Me.tag!==23||Me.memoizedState===null||Me===l)&&Me.child!==null){Me.child.return=Me,Me=Me.child;continue}if(Me===l)break e;for(;Me.sibling===null;){if(Me.return===null||Me.return===l)break e;Oe===Me&&(Oe=null),Me=Me.return}Oe===Me&&(Oe=null),Me.sibling.return=Me.return,Me=Me.sibling}}break;case 19:$a(u,l),ls(l),w&4&&X_(l);break;case 21:break;default:$a(u,l),ls(l)}}function ls(l){var u=l.flags;if(u&2){try{e:{for(var m=l.return;m!==null;){if(K_(m)){var w=m;break e}m=m.return}throw Error(n(160))}switch(w.tag){case 5:var A=w.stateNode;w.flags&32&&(ee(A,""),w.flags&=-33);var k=G_(l);Ux(l,k,A);break;case 3:case 4:var I=w.stateNode.containerInfo,J=G_(l);zx(l,J,I);break;default:throw Error(n(161))}}catch(ne){$n(l,l.return,ne)}l.flags&=-3}u&4096&&(l.flags&=-4097)}function hU(l,u,m){Je=l,J_(l)}function J_(l,u,m){for(var w=(l.mode&1)!==0;Je!==null;){var A=Je,k=A.child;if(A.tag===22&&w){var I=A.memoizedState!==null||_p;if(!I){var J=A.alternate,ne=J!==null&&J.memoizedState!==null||yr;J=_p;var ve=yr;if(_p=I,(yr=ne)&&!ve)for(Je=A;Je!==null;)I=Je,ne=I.child,I.tag===22&&I.memoizedState!==null?tE(A):ne!==null?(ne.return=I,Je=ne):tE(A);for(;k!==null;)Je=k,J_(k),k=k.sibling;Je=A,_p=J,yr=ve}Z_(l)}else(A.subtreeFlags&8772)!==0&&k!==null?(k.return=A,Je=k):Z_(l)}}function Z_(l){for(;Je!==null;){var u=Je;if((u.flags&8772)!==0){var m=u.alternate;try{if((u.flags&8772)!==0)switch(u.tag){case 0:case 11:case 15:yr||Ep(5,u);break;case 1:var w=u.stateNode;if(u.flags&4&&!yr)if(m===null)w.componentDidMount();else{var A=u.elementType===u.type?m.memoizedProps:Ia(u.type,m.memoizedProps);w.componentDidUpdate(A,m.memoizedState,w.__reactInternalSnapshotBeforeUpdate)}var k=u.updateQueue;k!==null&&e_(u,k,w);break;case 3:var I=u.updateQueue;if(I!==null){if(m=null,u.child!==null)switch(u.child.tag){case 5:m=u.child.stateNode;break;case 1:m=u.child.stateNode}e_(u,I,m)}break;case 5:var J=u.stateNode;if(m===null&&u.flags&4){m=J;var ne=u.memoizedProps;switch(u.type){case"button":case"input":case"select":case"textarea":ne.autoFocus&&m.focus();break;case"img":ne.src&&(m.src=ne.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(u.memoizedState===null){var ve=u.alternate;if(ve!==null){var Oe=ve.memoizedState;if(Oe!==null){var Me=Oe.dehydrated;Me!==null&&bu(Me)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}yr||u.flags&512&&Bx(u)}catch(Ee){$n(u,u.return,Ee)}}if(u===l){Je=null;break}if(m=u.sibling,m!==null){m.return=u.return,Je=m;break}Je=u.return}}function eE(l){for(;Je!==null;){var u=Je;if(u===l){Je=null;break}var m=u.sibling;if(m!==null){m.return=u.return,Je=m;break}Je=u.return}}function tE(l){for(;Je!==null;){var u=Je;try{switch(u.tag){case 0:case 11:case 15:var m=u.return;try{Ep(4,u)}catch(ne){$n(u,m,ne)}break;case 1:var w=u.stateNode;if(typeof w.componentDidMount=="function"){var A=u.return;try{w.componentDidMount()}catch(ne){$n(u,A,ne)}}var k=u.return;try{Bx(u)}catch(ne){$n(u,k,ne)}break;case 5:var I=u.return;try{Bx(u)}catch(ne){$n(u,I,ne)}}}catch(ne){$n(u,u.return,ne)}if(u===l){Je=null;break}var J=u.sibling;if(J!==null){J.return=u.return,Je=J;break}Je=u.return}}var mU=Math.ceil,Pp=E.ReactCurrentDispatcher,qx=E.ReactCurrentOwner,ma=E.ReactCurrentBatchConfig,Yt=0,sr=null,Wn=null,fr=0,Qr=0,Ml=wi(0),Yn=0,qu=null,po=0,kp=0,Wx=0,Wu=null,Mr=null,Vx=0,$l=1/0,Bs=null,Op=!1,Hx=null,_i=null,Rp=!1,Ei=null,Tp=0,Vu=0,Kx=null,Ip=-1,Mp=0;function Sr(){return(Yt&6)!==0?wn():Ip!==-1?Ip:Ip=wn()}function Pi(l){return(l.mode&1)===0?1:(Yt&2)!==0&&fr!==0?fr&-fr:J6.transition!==null?(Mp===0&&(Mp=pt()),Mp):(l=Xt,l!==0||(l=window.event,l=l===void 0?16:rA(l.type)),l)}function Da(l,u,m,w){if(50<Vu)throw Vu=0,Kx=null,Error(n(185));Kn(l,m,w),((Yt&2)===0||l!==sr)&&(l===sr&&((Yt&2)===0&&(kp|=m),Yn===4&&ki(l,fr)),$r(l,w),m===1&&Yt===0&&(u.mode&1)===0&&($l=wn()+500,cp&&Si()))}function $r(l,u){var m=l.callbackNode;$e(l,u);var w=ye(l,l===sr?fr:0);if(w===0)m!==null&&en(m),l.callbackNode=null,l.callbackPriority=0;else if(u=w&-w,l.callbackPriority!==u){if(m!=null&&en(m),u===1)l.tag===0?Q6(rE.bind(null,l)):UA(rE.bind(null,l)),K6(function(){(Yt&6)===0&&Si()}),m=null;else{switch(Wf(w)){case 1:m=fl;break;case 4:m=zf;break;case 16:m=pi;break;case 536870912:m=mu;break;default:m=pi}m=dE(m,nE.bind(null,l))}l.callbackPriority=u,l.callbackNode=m}}function nE(l,u){if(Ip=-1,Mp=0,(Yt&6)!==0)throw Error(n(327));var m=l.callbackNode;if(Dl()&&l.callbackNode!==m)return null;var w=ye(l,l===sr?fr:0);if(w===0)return null;if((w&30)!==0||(w&l.expiredLanes)!==0||u)u=$p(l,w);else{u=w;var A=Yt;Yt|=2;var k=sE();(sr!==l||fr!==u)&&(Bs=null,$l=wn()+500,mo(l,u));do try{xU();break}catch(J){aE(l,J)}while(!0);dx(),Pp.current=k,Yt=A,Wn!==null?u=0:(sr=null,fr=0,u=Yn)}if(u!==0){if(u===2&&(A=Mt(l),A!==0&&(w=A,u=Gx(l,A))),u===1)throw m=qu,mo(l,0),ki(l,w),$r(l,wn()),m;if(u===6)ki(l,w);else{if(A=l.current.alternate,(w&30)===0&&!vU(A)&&(u=$p(l,w),u===2&&(k=Mt(l),k!==0&&(w=k,u=Gx(l,k))),u===1))throw m=qu,mo(l,0),ki(l,w),$r(l,wn()),m;switch(l.finishedWork=A,l.finishedLanes=w,u){case 0:case 1:throw Error(n(345));case 2:vo(l,Mr,Bs);break;case 3:if(ki(l,w),(w&130023424)===w&&(u=Vx+500-wn(),10<u)){if(ye(l,0)!==0)break;if(A=l.suspendedLanes,(A&w)!==w){Sr(),l.pingedLanes|=l.suspendedLanes&A;break}l.timeoutHandle=ex(vo.bind(null,l,Mr,Bs),u);break}vo(l,Mr,Bs);break;case 4:if(ki(l,w),(w&4194240)===w)break;for(u=l.eventTimes,A=-1;0<w;){var I=31-Kr(w);k=1<<I,I=u[I],I>A&&(A=I),w&=~k}if(w=A,w=wn()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*mU(w/1960))-w,10<w){l.timeoutHandle=ex(vo.bind(null,l,Mr,Bs),w);break}vo(l,Mr,Bs);break;case 5:vo(l,Mr,Bs);break;default:throw Error(n(329))}}}return $r(l,wn()),l.callbackNode===m?nE.bind(null,l):null}function Gx(l,u){var m=Wu;return l.current.memoizedState.isDehydrated&&(mo(l,u).flags|=256),l=$p(l,u),l!==2&&(u=Mr,Mr=m,u!==null&&Yx(u)),l}function Yx(l){Mr===null?Mr=l:Mr.push.apply(Mr,l)}function vU(l){for(var u=l;;){if(u.flags&16384){var m=u.updateQueue;if(m!==null&&(m=m.stores,m!==null))for(var w=0;w<m.length;w++){var A=m[w],k=A.getSnapshot;A=A.value;try{if(!Ra(k(),A))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 ki(l,u){for(u&=~Wx,u&=~kp,l.suspendedLanes|=u,l.pingedLanes&=~u,l=l.expirationTimes;0<u;){var m=31-Kr(u),w=1<<m;l[m]=-1,u&=~w}}function rE(l){if((Yt&6)!==0)throw Error(n(327));Dl();var u=ye(l,0);if((u&1)===0)return $r(l,wn()),null;var m=$p(l,u);if(l.tag!==0&&m===2){var w=Mt(l);w!==0&&(u=w,m=Gx(l,w))}if(m===1)throw m=qu,mo(l,0),ki(l,u),$r(l,wn()),m;if(m===6)throw Error(n(345));return l.finishedWork=l.current.alternate,l.finishedLanes=u,vo(l,Mr,Bs),$r(l,wn()),null}function Xx(l,u){var m=Yt;Yt|=1;try{return l(u)}finally{Yt=m,Yt===0&&($l=wn()+500,cp&&Si())}}function ho(l){Ei!==null&&Ei.tag===0&&(Yt&6)===0&&Dl();var u=Yt;Yt|=1;var m=ma.transition,w=Xt;try{if(ma.transition=null,Xt=1,l)return l()}finally{Xt=w,ma.transition=m,Yt=u,(Yt&6)===0&&Si()}}function Qx(){Qr=Ml.current,Sn(Ml)}function mo(l,u){l.finishedWork=null,l.finishedLanes=0;var m=l.timeoutHandle;if(m!==-1&&(l.timeoutHandle=-1,H6(m)),Wn!==null)for(m=Wn.return;m!==null;){var w=m;switch(ix(w),w.tag){case 1:w=w.type.childContextTypes,w!=null&&op();break;case 3:Rl(),Sn(Rr),Sn(vr),yx();break;case 5:gx(w);break;case 4:Rl();break;case 13:Sn(Tn);break;case 19:Sn(Tn);break;case 10:fx(w.type._context);break;case 22:case 23:Qx()}m=m.return}if(sr=l,Wn=l=Oi(l.current,null),fr=Qr=u,Yn=0,qu=null,Wx=kp=po=0,Mr=Wu=null,co!==null){for(u=0;u<co.length;u++)if(m=co[u],w=m.interleaved,w!==null){m.interleaved=null;var A=w.next,k=m.pending;if(k!==null){var I=k.next;k.next=A,w.next=I}m.pending=w}co=null}return l}function aE(l,u){do{var m=Wn;try{if(dx(),yp.current=Sp,bp){for(var w=In.memoizedState;w!==null;){var A=w.queue;A!==null&&(A.pending=null),w=w.next}bp=!1}if(fo=0,ar=Gn=In=null,Du=!1,Lu=0,qx.current=null,m===null||m.return===null){Yn=1,qu=u,Wn=null;break}e:{var k=l,I=m.return,J=m,ne=u;if(u=fr,J.flags|=32768,ne!==null&&typeof ne=="object"&&typeof ne.then=="function"){var ve=ne,Oe=J,Me=Oe.tag;if((Oe.mode&1)===0&&(Me===0||Me===11||Me===15)){var Ee=Oe.alternate;Ee?(Oe.updateQueue=Ee.updateQueue,Oe.memoizedState=Ee.memoizedState,Oe.lanes=Ee.lanes):(Oe.updateQueue=null,Oe.memoizedState=null)}var Xe=P_(I);if(Xe!==null){Xe.flags&=-257,k_(Xe,I,J,k,u),Xe.mode&1&&E_(k,ve,u),u=Xe,ne=ve;var nt=u.updateQueue;if(nt===null){var at=new Set;at.add(ne),u.updateQueue=at}else nt.add(ne);break e}else{if((u&1)===0){E_(k,ve,u),Jx();break e}ne=Error(n(426))}}else if(En&&J.mode&1){var zn=P_(I);if(zn!==null){(zn.flags&65536)===0&&(zn.flags|=256),k_(zn,I,J,k,u),cx(Tl(ne,J));break e}}k=ne=Tl(ne,J),Yn!==4&&(Yn=2),Wu===null?Wu=[k]:Wu.push(k),k=I;do{switch(k.tag){case 3:k.flags|=65536,u&=-u,k.lanes|=u;var pe=A_(k,ne,u);ZA(k,pe);break e;case 1:J=ne;var ie=k.type,he=k.stateNode;if((k.flags&128)===0&&(typeof ie.getDerivedStateFromError=="function"||he!==null&&typeof he.componentDidCatch=="function"&&(_i===null||!_i.has(he)))){k.flags|=65536,u&=-u,k.lanes|=u;var Le=__(k,J,u);ZA(k,Le);break e}}k=k.return}while(k!==null)}oE(m)}catch(lt){u=lt,Wn===m&&m!==null&&(Wn=m=m.return);continue}break}while(!0)}function sE(){var l=Pp.current;return Pp.current=Sp,l===null?Sp:l}function Jx(){(Yn===0||Yn===3||Yn===2)&&(Yn=4),sr===null||(po&268435455)===0&&(kp&268435455)===0||ki(sr,fr)}function $p(l,u){var m=Yt;Yt|=2;var w=sE();(sr!==l||fr!==u)&&(Bs=null,mo(l,u));do try{gU();break}catch(A){aE(l,A)}while(!0);if(dx(),Yt=m,Pp.current=w,Wn!==null)throw Error(n(261));return sr=null,fr=0,Yn}function gU(){for(;Wn!==null;)iE(Wn)}function xU(){for(;Wn!==null&&!Gt();)iE(Wn)}function iE(l){var u=uE(l.alternate,l,Qr);l.memoizedProps=l.pendingProps,u===null?oE(l):Wn=u,qx.current=null}function oE(l){var u=l;do{var m=u.alternate;if(l=u.return,(u.flags&32768)===0){if(m=uU(m,u,Qr),m!==null){Wn=m;return}}else{if(m=dU(m,u),m!==null){m.flags&=32767,Wn=m;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{Yn=6,Wn=null;return}}if(u=u.sibling,u!==null){Wn=u;return}Wn=u=l}while(u!==null);Yn===0&&(Yn=5)}function vo(l,u,m){var w=Xt,A=ma.transition;try{ma.transition=null,Xt=1,yU(l,u,m,w)}finally{ma.transition=A,Xt=w}return null}function yU(l,u,m,w){do Dl();while(Ei!==null);if((Yt&6)!==0)throw Error(n(327));m=l.finishedWork;var A=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 k=m.lanes|m.childLanes;if(sn(l,k),l===sr&&(Wn=sr=null,fr=0),(m.subtreeFlags&2064)===0&&(m.flags&2064)===0||Rp||(Rp=!0,dE(pi,function(){return Dl(),null})),k=(m.flags&15990)!==0,(m.subtreeFlags&15990)!==0||k){k=ma.transition,ma.transition=null;var I=Xt;Xt=1;var J=Yt;Yt|=4,qx.current=null,pU(l,m),Q_(m,l),F6(Jg),Kf=!!Qg,Jg=Qg=null,l.current=m,hU(m),Bn(),Yt=J,Xt=I,ma.transition=k}else l.current=m;if(Rp&&(Rp=!1,Ei=l,Tp=A),k=l.pendingLanes,k===0&&(_i=null),_g(m.stateNode),$r(l,wn()),u!==null)for(w=l.onRecoverableError,m=0;m<u.length;m++)A=u[m],w(A.value,{componentStack:A.stack,digest:A.digest});if(Op)throw Op=!1,l=Hx,Hx=null,l;return(Tp&1)!==0&&l.tag!==0&&Dl(),k=l.pendingLanes,(k&1)!==0?l===Kx?Vu++:(Vu=0,Kx=l):Vu=0,Si(),null}function Dl(){if(Ei!==null){var l=Wf(Tp),u=ma.transition,m=Xt;try{if(ma.transition=null,Xt=16>l?16:l,Ei===null)var w=!1;else{if(l=Ei,Ei=null,Tp=0,(Yt&6)!==0)throw Error(n(331));var A=Yt;for(Yt|=4,Je=l.current;Je!==null;){var k=Je,I=k.child;if((Je.flags&16)!==0){var J=k.deletions;if(J!==null){for(var ne=0;ne<J.length;ne++){var ve=J[ne];for(Je=ve;Je!==null;){var Oe=Je;switch(Oe.tag){case 0:case 11:case 15:Uu(8,Oe,k)}var Me=Oe.child;if(Me!==null)Me.return=Oe,Je=Me;else for(;Je!==null;){Oe=Je;var Ee=Oe.sibling,Xe=Oe.return;if(H_(Oe),Oe===ve){Je=null;break}if(Ee!==null){Ee.return=Xe,Je=Ee;break}Je=Xe}}}var nt=k.alternate;if(nt!==null){var at=nt.child;if(at!==null){nt.child=null;do{var zn=at.sibling;at.sibling=null,at=zn}while(at!==null)}}Je=k}}if((k.subtreeFlags&2064)!==0&&I!==null)I.return=k,Je=I;else e:for(;Je!==null;){if(k=Je,(k.flags&2048)!==0)switch(k.tag){case 0:case 11:case 15:Uu(9,k,k.return)}var pe=k.sibling;if(pe!==null){pe.return=k.return,Je=pe;break e}Je=k.return}}var ie=l.current;for(Je=ie;Je!==null;){I=Je;var he=I.child;if((I.subtreeFlags&2064)!==0&&he!==null)he.return=I,Je=he;else e:for(I=ie;Je!==null;){if(J=Je,(J.flags&2048)!==0)try{switch(J.tag){case 0:case 11:case 15:Ep(9,J)}}catch(lt){$n(J,J.return,lt)}if(J===I){Je=null;break e}var Le=J.sibling;if(Le!==null){Le.return=J.return,Je=Le;break e}Je=J.return}}if(Yt=A,Si(),ca&&typeof ca.onPostCommitFiberRoot=="function")try{ca.onPostCommitFiberRoot(Rs,l)}catch{}w=!0}return w}finally{Xt=m,ma.transition=u}}return!1}function lE(l,u,m){u=Tl(m,u),u=A_(l,u,1),l=Ci(l,u,1),u=Sr(),l!==null&&(Kn(l,1,u),$r(l,u))}function $n(l,u,m){if(l.tag===3)lE(l,l,m);else for(;u!==null;){if(u.tag===3){lE(u,l,m);break}else if(u.tag===1){var w=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof w.componentDidCatch=="function"&&(_i===null||!_i.has(w))){l=Tl(m,l),l=__(u,l,1),u=Ci(u,l,1),l=Sr(),u!==null&&(Kn(u,1,l),$r(u,l));break}}u=u.return}}function bU(l,u,m){var w=l.pingCache;w!==null&&w.delete(u),u=Sr(),l.pingedLanes|=l.suspendedLanes&m,sr===l&&(fr&m)===m&&(Yn===4||Yn===3&&(fr&130023424)===fr&&500>wn()-Vx?mo(l,0):Wx|=m),$r(l,u)}function cE(l,u){u===0&&((l.mode&1)===0?u=1:(u=hl,hl<<=1,(hl&130023424)===0&&(hl=4194304)));var m=Sr();l=Ds(l,u),l!==null&&(Kn(l,u,m),$r(l,m))}function wU(l){var u=l.memoizedState,m=0;u!==null&&(m=u.retryLane),cE(l,m)}function jU(l,u){var m=0;switch(l.tag){case 13:var w=l.stateNode,A=l.memoizedState;A!==null&&(m=A.retryLane);break;case 19:w=l.stateNode;break;default:throw Error(n(314))}w!==null&&w.delete(u),cE(l,m)}var uE;uE=function(l,u,m){if(l!==null)if(l.memoizedProps!==u.pendingProps||Rr.current)Ir=!0;else{if((l.lanes&m)===0&&(u.flags&128)===0)return Ir=!1,cU(l,u,m);Ir=(l.flags&131072)!==0}else Ir=!1,En&&(u.flags&1048576)!==0&&qA(u,dp,u.index);switch(u.lanes=0,u.tag){case 2:var w=u.type;Ap(l,u),l=u.pendingProps;var A=Cl(u,vr.current);Ol(u,m),A=jx(null,u,w,l,A,m);var k=Sx();return u.flags|=1,typeof A=="object"&&A!==null&&typeof A.render=="function"&&A.$$typeof===void 0?(u.tag=1,u.memoizedState=null,u.updateQueue=null,Tr(w)?(k=!0,lp(u)):k=!1,u.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,mx(u),A.updater=Np,u.stateNode=A,A._reactInternals=u,Px(u,w,l,m),u=Tx(null,u,w,!0,k,m)):(u.tag=0,En&&k&&sx(u),jr(null,u,A,m),u=u.child),u;case 16:w=u.elementType;e:{switch(Ap(l,u),l=u.pendingProps,A=w._init,w=A(w._payload),u.type=w,A=u.tag=NU(w),l=Ia(w,l),A){case 0:u=Rx(null,u,w,l,m);break e;case 1:u=$_(null,u,w,l,m);break e;case 11:u=O_(null,u,w,l,m);break e;case 14:u=R_(null,u,w,Ia(w.type,l),m);break e}throw Error(n(306,w,""))}return u;case 0:return w=u.type,A=u.pendingProps,A=u.elementType===w?A:Ia(w,A),Rx(l,u,w,A,m);case 1:return w=u.type,A=u.pendingProps,A=u.elementType===w?A:Ia(w,A),$_(l,u,w,A,m);case 3:e:{if(D_(u),l===null)throw Error(n(387));w=u.pendingProps,k=u.memoizedState,A=k.element,JA(l,u),gp(u,w,null,m);var I=u.memoizedState;if(w=I.element,k.isDehydrated)if(k={element:w,isDehydrated:!1,cache:I.cache,pendingSuspenseBoundaries:I.pendingSuspenseBoundaries,transitions:I.transitions},u.updateQueue.baseState=k,u.memoizedState=k,u.flags&256){A=Tl(Error(n(423)),u),u=L_(l,u,w,m,A);break e}else if(w!==A){A=Tl(Error(n(424)),u),u=L_(l,u,w,m,A);break e}else for(Xr=bi(u.stateNode.containerInfo.firstChild),Yr=u,En=!0,Ta=null,m=XA(u,null,w,m),u.child=m;m;)m.flags=m.flags&-3|4096,m=m.sibling;else{if(El(),w===A){u=Fs(l,u,m);break e}jr(l,u,w,m)}u=u.child}return u;case 5:return t_(u),l===null&&lx(u),w=u.type,A=u.pendingProps,k=l!==null?l.memoizedProps:null,I=A.children,Zg(w,A)?I=null:k!==null&&Zg(w,k)&&(u.flags|=32),M_(l,u),jr(l,u,I,m),u.child;case 6:return l===null&&lx(u),null;case 13:return F_(l,u,m);case 4:return vx(u,u.stateNode.containerInfo),w=u.pendingProps,l===null?u.child=Pl(u,null,w,m):jr(l,u,w,m),u.child;case 11:return w=u.type,A=u.pendingProps,A=u.elementType===w?A:Ia(w,A),O_(l,u,w,A,m);case 7:return jr(l,u,u.pendingProps,m),u.child;case 8:return jr(l,u,u.pendingProps.children,m),u.child;case 12:return jr(l,u,u.pendingProps.children,m),u.child;case 10:e:{if(w=u.type._context,A=u.pendingProps,k=u.memoizedProps,I=A.value,mn(hp,w._currentValue),w._currentValue=I,k!==null)if(Ra(k.value,I)){if(k.children===A.children&&!Rr.current){u=Fs(l,u,m);break e}}else for(k=u.child,k!==null&&(k.return=u);k!==null;){var J=k.dependencies;if(J!==null){I=k.child;for(var ne=J.firstContext;ne!==null;){if(ne.context===w){if(k.tag===1){ne=Ls(-1,m&-m),ne.tag=2;var ve=k.updateQueue;if(ve!==null){ve=ve.shared;var Oe=ve.pending;Oe===null?ne.next=ne:(ne.next=Oe.next,Oe.next=ne),ve.pending=ne}}k.lanes|=m,ne=k.alternate,ne!==null&&(ne.lanes|=m),px(k.return,m,u),J.lanes|=m;break}ne=ne.next}}else if(k.tag===10)I=k.type===u.type?null:k.child;else if(k.tag===18){if(I=k.return,I===null)throw Error(n(341));I.lanes|=m,J=I.alternate,J!==null&&(J.lanes|=m),px(I,m,u),I=k.sibling}else I=k.child;if(I!==null)I.return=k;else for(I=k;I!==null;){if(I===u){I=null;break}if(k=I.sibling,k!==null){k.return=I.return,I=k;break}I=I.return}k=I}jr(l,u,A.children,m),u=u.child}return u;case 9:return A=u.type,w=u.pendingProps.children,Ol(u,m),A=pa(A),w=w(A),u.flags|=1,jr(l,u,w,m),u.child;case 14:return w=u.type,A=Ia(w,u.pendingProps),A=Ia(w.type,A),R_(l,u,w,A,m);case 15:return T_(l,u,u.type,u.pendingProps,m);case 17:return w=u.type,A=u.pendingProps,A=u.elementType===w?A:Ia(w,A),Ap(l,u),u.tag=1,Tr(w)?(l=!0,lp(u)):l=!1,Ol(u,m),N_(u,w,A),Px(u,w,A,m),Tx(null,u,w,!0,l,m);case 19:return z_(l,u,m);case 22:return I_(l,u,m)}throw Error(n(156,u.tag))};function dE(l,u){return Ke(l,u)}function SU(l,u,m,w){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=w,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function va(l,u,m,w){return new SU(l,u,m,w)}function Zx(l){return l=l.prototype,!(!l||!l.isReactComponent)}function NU(l){if(typeof l=="function")return Zx(l)?1:0;if(l!=null){if(l=l.$$typeof,l===M)return 11;if(l===W)return 14}return 2}function Oi(l,u){var m=l.alternate;return m===null?(m=va(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 Dp(l,u,m,w,A,k){var I=2;if(w=l,typeof l=="function")Zx(l)&&(I=1);else if(typeof l=="string")I=5;else e:switch(l){case O:return go(m.children,A,k,u);case R:I=8,A|=8;break;case L:return l=va(12,m,u,A|2),l.elementType=L,l.lanes=k,l;case G:return l=va(13,m,u,A),l.elementType=G,l.lanes=k,l;case B:return l=va(19,m,u,A),l.elementType=B,l.lanes=k,l;case V:return Lp(m,A,k,u);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case T:I=10;break e;case D:I=9;break e;case M:I=11;break e;case W:I=14;break e;case q:I=16,w=null;break e}throw Error(n(130,l==null?l:typeof l,""))}return u=va(I,m,u,A),u.elementType=l,u.type=w,u.lanes=k,u}function go(l,u,m,w){return l=va(7,l,w,u),l.lanes=m,l}function Lp(l,u,m,w){return l=va(22,l,w,u),l.elementType=V,l.lanes=m,l.stateNode={isHidden:!1},l}function ey(l,u,m){return l=va(6,l,null,u),l.lanes=m,l}function ty(l,u,m){return u=va(4,l.children!==null?l.children:[],l.key,u),u.lanes=m,u.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},u}function CU(l,u,m,w,A){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=tn(0),this.expirationTimes=tn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tn(0),this.identifierPrefix=w,this.onRecoverableError=A,this.mutableSourceEagerHydrationData=null}function ny(l,u,m,w,A,k,I,J,ne){return l=new CU(l,u,m,J,ne),u===1?(u=1,k===!0&&(u|=8)):u=0,k=va(3,null,null,u),l.current=k,k.stateNode=l,k.memoizedState={element:w,isDehydrated:m,cache:null,transitions:null,pendingSuspenseBoundaries:null},mx(k),l}function AU(l,u,m){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:P,key:w==null?null:""+w,children:l,containerInfo:u,implementation:m}}function fE(l){if(!l)return ji;l=l._reactInternals;e:{if(He(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(Tr(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(Tr(m))return BA(l,m,u)}return u}function pE(l,u,m,w,A,k,I,J,ne){return l=ny(m,w,!0,l,A,k,I,J,ne),l.context=fE(null),m=l.current,w=Sr(),A=Pi(m),k=Ls(w,A),k.callback=u??null,Ci(m,k,A),l.current.lanes=A,Kn(l,A,w),$r(l,w),l}function Fp(l,u,m,w){var A=u.current,k=Sr(),I=Pi(A);return m=fE(m),u.context===null?u.context=m:u.pendingContext=m,u=Ls(k,I),u.payload={element:l},w=w===void 0?null:w,w!==null&&(u.callback=w),l=Ci(A,u,I),l!==null&&(Da(l,A,I,k),vp(l,A,I)),I}function Bp(l){return l=l.current,l.child?(l.child.tag===5,l.child.stateNode):null}function hE(l,u){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var m=l.retryLane;l.retryLane=m!==0&&m<u?m:u}}function ry(l,u){hE(l,u),(l=l.alternate)&&hE(l,u)}function _U(){return null}var mE=typeof reportError=="function"?reportError:function(l){console.error(l)};function ay(l){this._internalRoot=l}zp.prototype.render=ay.prototype.render=function(l){var u=this._internalRoot;if(u===null)throw Error(n(409));Fp(l,u,null,null)},zp.prototype.unmount=ay.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var u=l.containerInfo;ho(function(){Fp(null,l,null,null)}),u[Ts]=null}};function zp(l){this._internalRoot=l}zp.prototype.unstable_scheduleHydration=function(l){if(l){var u=JC();l={blockedOn:null,target:l,priority:u};for(var m=0;m<gi.length&&u!==0&&u<gi[m].priority;m++);gi.splice(m,0,l),m===0&&tA(l)}};function sy(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function Up(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function vE(){}function EU(l,u,m,w,A){if(A){if(typeof w=="function"){var k=w;w=function(){var ve=Bp(I);k.call(ve)}}var I=pE(u,w,l,0,null,!1,!1,"",vE);return l._reactRootContainer=I,l[Ts]=I.current,Pu(l.nodeType===8?l.parentNode:l),ho(),I}for(;A=l.lastChild;)l.removeChild(A);if(typeof w=="function"){var J=w;w=function(){var ve=Bp(ne);J.call(ve)}}var ne=ny(l,0,!1,null,null,!1,!1,"",vE);return l._reactRootContainer=ne,l[Ts]=ne.current,Pu(l.nodeType===8?l.parentNode:l),ho(function(){Fp(u,ne,m,w)}),ne}function qp(l,u,m,w,A){var k=m._reactRootContainer;if(k){var I=k;if(typeof A=="function"){var J=A;A=function(){var ne=Bp(I);J.call(ne)}}Fp(u,I,l,A)}else I=EU(m,u,l,A,w);return Bp(I)}ml=function(l){switch(l.tag){case 3:var u=l.stateNode;if(u.current.memoizedState.isDehydrated){var m=K(u.pendingLanes);m!==0&&(ua(u,m|1),$r(u,wn()),(Yt&6)===0&&($l=wn()+500,Si()))}break;case 13:ho(function(){var w=Ds(l,1);if(w!==null){var A=Sr();Da(w,l,1,A)}}),ry(l,1)}},kg=function(l){if(l.tag===13){var u=Ds(l,134217728);if(u!==null){var m=Sr();Da(u,l,134217728,m)}ry(l,134217728)}},QC=function(l){if(l.tag===13){var u=Pi(l),m=Ds(l,u);if(m!==null){var w=Sr();Da(m,l,u,w)}ry(l,u)}},JC=function(){return Xt},ZC=function(l,u){var m=Xt;try{return Xt=l,u()}finally{Xt=m}},Ln=function(l,u,m){switch(u){case"input":if(_e(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 w=m[u];if(w!==l&&w.form===l.form){var A=ip(w);if(!A)throw Error(n(90));ae(w),_e(w,A)}}}break;case"textarea":Ft(l,m);break;case"select":u=m.value,u!=null&&De(l,!!m.multiple,u,!1)}},jt=Xx,Et=ho;var PU={usingClientEntryPoint:!1,Events:[Ru,Sl,ip,wr,ut,Xx]},Hu={findFiberByHostInstance:so,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},kU={bundleType:Hu.bundleType,version:Hu.version,rendererPackageName:Hu.rendererPackageName,rendererConfig:Hu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:E.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=Dt(l),l===null?null:l.stateNode},findFiberByHostInstance:Hu.findFiberByHostInstance||_U,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 Wp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wp.isDisabled&&Wp.supportsFiber)try{Rs=Wp.inject(kU),ca=Wp}catch{}}return Dr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=PU,Dr.createPortal=function(l,u){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!sy(u))throw Error(n(200));return AU(l,u,null,m)},Dr.createRoot=function(l,u){if(!sy(l))throw Error(n(299));var m=!1,w="",A=mE;return u!=null&&(u.unstable_strictMode===!0&&(m=!0),u.identifierPrefix!==void 0&&(w=u.identifierPrefix),u.onRecoverableError!==void 0&&(A=u.onRecoverableError)),u=ny(l,1,!1,null,null,m,!1,w,A),l[Ts]=u.current,Pu(l.nodeType===8?l.parentNode:l),new ay(u)},Dr.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=Dt(u),l=l===null?null:l.stateNode,l},Dr.flushSync=function(l){return ho(l)},Dr.hydrate=function(l,u,m){if(!Up(u))throw Error(n(200));return qp(null,l,u,!0,m)},Dr.hydrateRoot=function(l,u,m){if(!sy(l))throw Error(n(405));var w=m!=null&&m.hydratedSources||null,A=!1,k="",I=mE;if(m!=null&&(m.unstable_strictMode===!0&&(A=!0),m.identifierPrefix!==void 0&&(k=m.identifierPrefix),m.onRecoverableError!==void 0&&(I=m.onRecoverableError)),u=pE(u,null,l,1,m??null,A,!1,k,I),l[Ts]=u.current,Pu(l),w)for(l=0;l<w.length;l++)m=w[l],A=m._getVersion,A=A(m._source),u.mutableSourceEagerHydrationData==null?u.mutableSourceEagerHydrationData=[m,A]:u.mutableSourceEagerHydrationData.push(m,A);return new zp(u)},Dr.render=function(l,u,m){if(!Up(u))throw Error(n(200));return qp(null,l,u,!1,m)},Dr.unmountComponentAtNode=function(l){if(!Up(l))throw Error(n(40));return l._reactRootContainer?(ho(function(){qp(null,null,l,!1,function(){l._reactRootContainer=null,l[Ts]=null})}),!0):!1},Dr.unstable_batchedUpdates=Xx,Dr.unstable_renderSubtreeIntoContainer=function(l,u,m,w){if(!Up(m))throw Error(n(200));if(l==null||l._reactInternals===void 0)throw Error(n(38));return qp(l,u,m,!1,w)},Dr.version="18.3.1-next-f1338f8080-20240426",Dr}var NE;function t$(){if(NE)return ly.exports;NE=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(),ly.exports=LU(),ly.exports}var CE;function FU(){if(CE)return Hp;CE=1;var e=t$();return Hp.createRoot=e.createRoot,Hp.hydrateRoot=e.hydrateRoot,Hp}var BU=FU(),v=HS();const H=an(v),Hm=RU({__proto__:null,default:H},[v]),zU=1,UU=1e6;let dy=0;function qU(){return dy=(dy+1)%Number.MAX_SAFE_INTEGER,dy.toString()}const fy=new Map,AE=e=>{if(fy.has(e))return;const t=setTimeout(()=>{fy.delete(e),fd({type:"REMOVE_TOAST",toastId:e})},UU);fy.set(e,t)},WU=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,zU)};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?AE(n):e.toasts.forEach(r=>{AE(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)}}},xh=[];let yh={toasts:[]};function fd(e){yh=WU(yh,e),xh.forEach(t=>{t(yh)})}function Pe({...e}){const t=qU(),n=a=>fd({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>fd({type:"DISMISS_TOAST",toastId:t});return fd({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function VU(){const[e,t]=v.useState(yh);return v.useEffect(()=>(xh.push(t),()=>{const n=xh.indexOf(t);n>-1&&xh.splice(n,1)}),[e]),{...e,toast:Pe,dismiss:n=>fd({type:"DISMISS_TOAST",toastId:n})}}var Gc=t$();const n$=an(Gc);function Ie(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}function _E(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function kr(...e){return t=>{let n=!1;const r=e.map(a=>{const i=_E(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():_E(e[a],null)}}}}function xt(...e){return v.useCallback(kr(...e),e)}function HU(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 mr(e,t=[]){let n=[];function r(i,o){const c=v.createContext(o),d=n.length;n=[...n,o];const f=p=>{const{scope:x,children:g,...j}=p,b=x?.[e]?.[d]||c,y=v.useMemo(()=>j,Object.values(j));return s.jsx(b.Provider,{value:y,children:g})};f.displayName=i+"Provider";function h(p,x){const g=x?.[e]?.[d]||c,j=v.useContext(g);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,KU(a,...t)]}function KU(...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 EE(e){const t=GU(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(XU);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 GU(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=JU(a),c=QU(i,a.props);return a.type!==v.Fragment&&(c.ref=r?kr(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 YU=Symbol("radix.slottable");function XU(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===YU}function QU(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 JU(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 mf(e){const t=e+"CollectionProvider",[n,r]=mr(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=b=>{const{scope:y,children:S}=b,C=H.useRef(null),N=H.useRef(new Map).current;return s.jsx(a,{scope:y,itemMap:N,collectionRef:C,children:S})};o.displayName=t;const c=e+"CollectionSlot",d=EE(c),f=H.forwardRef((b,y)=>{const{scope:S,children:C}=b,N=i(c,S),E=xt(y,N.collectionRef);return s.jsx(d,{ref:E,children:C})});f.displayName=c;const h=e+"CollectionItemSlot",p="data-radix-collection-item",x=EE(h),g=H.forwardRef((b,y)=>{const{scope:S,children:C,...N}=b,E=H.useRef(null),_=xt(y,E),P=i(h,S);return H.useEffect(()=>(P.itemMap.set(E,{ref:E,...N}),()=>{P.itemMap.delete(E)})),s.jsx(x,{[p]:"",ref:_,children:C})});g.displayName=h;function j(b){const y=i(e+"CollectionConsumer",b);return H.useCallback(()=>{const C=y.collectionRef.current;if(!C)return[];const N=Array.from(C.querySelectorAll(`[${p}]`));return Array.from(y.itemMap.values()).sort((P,O)=>N.indexOf(P.ref.current)-N.indexOf(O.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:f,ItemSlot:g},j,r]}function ZU(e){const t=e7(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(n7);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 e7(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=a7(a),c=r7(i,a.props);return a.type!==v.Fragment&&(c.ref=r?kr(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 t7=Symbol("radix.slottable");function n7(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===t7}function r7(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 a7(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 s7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ge=s7.reduce((e,t)=>{const n=ZU(`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 KS(e,t){e&&Gc.flushSync(()=>e.dispatchEvent(t))}function Un(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function i7(e,t=globalThis?.document){const n=Un(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 o7="DismissableLayer",zj="dismissableLayer.update",l7="dismissableLayer.pointerDownOutside",c7="dismissableLayer.focusOutside",PE,r$=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Zo=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:c,...d}=e,f=v.useContext(r$),[h,p]=v.useState(null),x=h?.ownerDocument??globalThis?.document,[,g]=v.useState({}),j=xt(t,O=>p(O)),b=Array.from(f.layers),[y]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),S=b.indexOf(y),C=h?b.indexOf(h):-1,N=f.layersWithOutsidePointerEventsDisabled.size>0,E=C>=S,_=d7(O=>{const R=O.target,L=[...f.branches].some(T=>T.contains(R));!E||L||(a?.(O),o?.(O),O.defaultPrevented||c?.())},x),P=f7(O=>{const R=O.target;[...f.branches].some(T=>T.contains(R))||(i?.(O),o?.(O),O.defaultPrevented||c?.())},x);return i7(O=>{C===f.layers.size-1&&(r?.(O),!O.defaultPrevented&&c&&(O.preventDefault(),c()))},x),v.useEffect(()=>{if(h)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(PE=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(h)),f.layers.add(h),kE(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=PE)}},[h,x,n,f]),v.useEffect(()=>()=>{h&&(f.layers.delete(h),f.layersWithOutsidePointerEventsDisabled.delete(h),kE())},[h,f]),v.useEffect(()=>{const O=()=>g({});return document.addEventListener(zj,O),()=>document.removeEventListener(zj,O)},[]),s.jsx(Ge.div,{...d,ref:j,style:{pointerEvents:N?E?"auto":"none":void 0,...e.style},onFocusCapture:Ie(e.onFocusCapture,P.onFocusCapture),onBlurCapture:Ie(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Ie(e.onPointerDownCapture,_.onPointerDownCapture)})});Zo.displayName=o7;var u7="DismissableLayerBranch",a$=v.forwardRef((e,t)=>{const n=v.useContext(r$),r=v.useRef(null),a=xt(t,r);return v.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),s.jsx(Ge.div,{...e,ref:a})});a$.displayName=u7;function d7(e,t=globalThis?.document){const n=Un(e),r=v.useRef(!1),a=v.useRef(()=>{});return v.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let d=function(){s$(l7,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 f7(e,t=globalThis?.document){const n=Un(e),r=v.useRef(!1);return v.useEffect(()=>{const a=i=>{i.target&&!r.current&&s$(c7,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 kE(){const e=new CustomEvent(zj);document.dispatchEvent(e)}function s$(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?KS(a,i):a.dispatchEvent(i)}var p7=Zo,h7=a$,tr=globalThis?.document?v.useLayoutEffect:()=>{},m7="Portal",Yc=v.forwardRef((e,t)=>{const{container:n,...r}=e,[a,i]=v.useState(!1);tr(()=>i(!0),[]);const o=n||a&&globalThis?.document?.body;return o?n$.createPortal(s.jsx(Ge.div,{...r,ref:t}),o):null});Yc.displayName=m7;function v7(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var nr=e=>{const{present:t,children:n}=e,r=g7(t),a=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),i=xt(r.ref,x7(a));return typeof n=="function"||r.isPresent?v.cloneElement(a,{ref:i}):null};nr.displayName="Presence";function g7(e){const[t,n]=v.useState(),r=v.useRef(null),a=v.useRef(e),i=v.useRef("none"),o=e?"mounted":"unmounted",[c,d]=v7(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const f=Kp(r.current);i.current=c==="mounted"?f:"none"},[c]),tr(()=>{const f=r.current,h=a.current;if(h!==e){const x=i.current,g=Kp(f);e?d("MOUNT"):g==="none"||f?.display==="none"?d("UNMOUNT"):d(h&&x!==g?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),tr(()=>{if(t){let f;const h=t.ownerDocument.defaultView??window,p=g=>{const b=Kp(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&b&&(d("ANIMATION_END"),!a.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",f=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},x=g=>{g.target===t&&(i.current=Kp(r.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(f),t.removeEventListener("animationstart",x),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 Kp(e){return e?.animationName||"none"}function x7(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 y7=Hm[" useInsertionEffect ".trim().toString()]||tr;function la({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,o]=b7({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=w7(h)?h(e):h;p!==e&&o.current?.(p)}else i(h)},[c,e,i,o]);return[d,f]}function b7({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),a=v.useRef(n),i=v.useRef(t);return y7(()=>{i.current=t},[t]),v.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,r,i]}function w7(e){return typeof e=="function"}var i$=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"}),j7="VisuallyHidden",Km=v.forwardRef((e,t)=>s.jsx(Ge.span,{...e,ref:t,style:{...i$,...e.style}}));Km.displayName=j7;var S7=Km,GS="ToastProvider",[YS,N7,C7]=mf("Toast"),[o$]=mr("Toast",[C7]),[A7,Gm]=o$(GS),l$=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),x=v.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${GS}\`. Expected non-empty \`string\`.`),s.jsx(YS.Provider,{scope:t,children:s.jsx(A7,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:i,toastCount:f,viewport:c,onViewportChange:d,onToastAdd:v.useCallback(()=>h(g=>g+1),[]),onToastRemove:v.useCallback(()=>h(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:x,children:o})})};l$.displayName=GS;var c$="ToastViewport",_7=["F8"],Uj="toast.viewportPause",qj="toast.viewportResume",u$=v.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=_7,label:a="Notifications ({hotkey})",...i}=e,o=Gm(c$,n),c=N7(n),d=v.useRef(null),f=v.useRef(null),h=v.useRef(null),p=v.useRef(null),x=xt(t,p,o.onViewportChange),g=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=o.toastCount>0;v.useEffect(()=>{const y=S=>{r.length!==0&&r.every(N=>S[N]||S.code===N)&&p.current?.focus()};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),v.useEffect(()=>{const y=d.current,S=p.current;if(j&&y&&S){const C=()=>{if(!o.isClosePausedRef.current){const P=new CustomEvent(Uj);S.dispatchEvent(P),o.isClosePausedRef.current=!0}},N=()=>{if(o.isClosePausedRef.current){const P=new CustomEvent(qj);S.dispatchEvent(P),o.isClosePausedRef.current=!1}},E=P=>{!y.contains(P.relatedTarget)&&N()},_=()=>{y.contains(document.activeElement)||N()};return y.addEventListener("focusin",C),y.addEventListener("focusout",E),y.addEventListener("pointermove",C),y.addEventListener("pointerleave",_),window.addEventListener("blur",C),window.addEventListener("focus",N),()=>{y.removeEventListener("focusin",C),y.removeEventListener("focusout",E),y.removeEventListener("pointermove",C),y.removeEventListener("pointerleave",_),window.removeEventListener("blur",C),window.removeEventListener("focus",N)}}},[j,o.isClosePausedRef]);const b=v.useCallback(({tabbingDirection:y})=>{const C=c().map(N=>{const E=N.ref.current,_=[E,...B7(E)];return y==="forwards"?_:_.reverse()});return(y==="forwards"?C.reverse():C).flat()},[c]);return v.useEffect(()=>{const y=p.current;if(y){const S=C=>{const N=C.altKey||C.ctrlKey||C.metaKey;if(C.key==="Tab"&&!N){const _=document.activeElement,P=C.shiftKey;if(C.target===y&&P){f.current?.focus();return}const L=b({tabbingDirection:P?"backwards":"forwards"}),T=L.findIndex(D=>D===_);py(L.slice(T+1))?C.preventDefault():P?f.current?.focus():h.current?.focus()}};return y.addEventListener("keydown",S),()=>y.removeEventListener("keydown",S)}},[c,b]),s.jsxs(h7,{ref:d,role:"region","aria-label":a.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&s.jsx(Wj,{ref:f,onFocusFromOutsideViewport:()=>{const y=b({tabbingDirection:"forwards"});py(y)}}),s.jsx(YS.Slot,{scope:n,children:s.jsx(Ge.ol,{tabIndex:-1,...i,ref:x})}),j&&s.jsx(Wj,{ref:h,onFocusFromOutsideViewport:()=>{const y=b({tabbingDirection:"backwards"});py(y)}})]})});u$.displayName=c$;var d$="ToastFocusProxy",Wj=v.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,i=Gm(d$,n);return s.jsx(Km,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:o=>{const c=o.relatedTarget;!i.viewport?.contains(c)&&r()}})});Wj.displayName=d$;var vf="Toast",E7="toast.swipeStart",P7="toast.swipeMove",k7="toast.swipeCancel",O7="toast.swipeEnd",f$=v.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:i,...o}=e,[c,d]=la({prop:r,defaultProp:a??!0,onChange:i,caller:vf});return s.jsx(nr,{present:n||c,children:s.jsx(I7,{open:c,...o,ref:t,onClose:()=>d(!1),onPause:Un(e.onPause),onResume:Un(e.onResume),onSwipeStart:Ie(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ie(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:Ie(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:Ie(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)})})})});f$.displayName=vf;var[R7,T7]=o$(vf,{onClose(){}}),I7=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:x,onSwipeEnd:g,...j}=e,b=Gm(vf,n),[y,S]=v.useState(null),C=xt(t,B=>S(B)),N=v.useRef(null),E=v.useRef(null),_=a||b.duration,P=v.useRef(0),O=v.useRef(_),R=v.useRef(0),{onToastAdd:L,onToastRemove:T}=b,D=Un(()=>{y?.contains(document.activeElement)&&b.viewport?.focus(),o()}),M=v.useCallback(B=>{!B||B===1/0||(window.clearTimeout(R.current),P.current=new Date().getTime(),R.current=window.setTimeout(D,B))},[D]);v.useEffect(()=>{const B=b.viewport;if(B){const W=()=>{M(O.current),f?.()},q=()=>{const V=new Date().getTime()-P.current;O.current=O.current-V,window.clearTimeout(R.current),d?.()};return B.addEventListener(Uj,q),B.addEventListener(qj,W),()=>{B.removeEventListener(Uj,q),B.removeEventListener(qj,W)}}},[b.viewport,_,d,f,M]),v.useEffect(()=>{i&&!b.isClosePausedRef.current&&M(_)},[i,_,b.isClosePausedRef,M]),v.useEffect(()=>(L(),()=>T()),[L,T]);const G=v.useMemo(()=>y?y$(y):null,[y]);return b.viewport?s.jsxs(s.Fragment,{children:[G&&s.jsx(M7,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:G}),s.jsx(R7,{scope:n,onClose:D,children:Gc.createPortal(s.jsx(YS.ItemSlot,{scope:n,children:s.jsx(p7,{asChild:!0,onEscapeKeyDown:Ie(c,()=>{b.isFocusedToastEscapeKeyDownRef.current||D(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(Ge.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":b.swipeDirection,...j,ref:C,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Ie(e.onKeyDown,B=>{B.key==="Escape"&&(c?.(B.nativeEvent),B.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,D()))}),onPointerDown:Ie(e.onPointerDown,B=>{B.button===0&&(N.current={x:B.clientX,y:B.clientY})}),onPointerMove:Ie(e.onPointerMove,B=>{if(!N.current)return;const W=B.clientX-N.current.x,q=B.clientY-N.current.y,V=!!E.current,F=["left","right"].includes(b.swipeDirection),U=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,Z=F?U(0,W):0,z=F?0:U(0,q),$=B.pointerType==="touch"?10:2,te={x:Z,y:z},se={originalEvent:B,delta:te};V?(E.current=te,Gp(P7,p,se,{discrete:!1})):OE(te,b.swipeDirection,$)?(E.current=te,Gp(E7,h,se,{discrete:!1}),B.target.setPointerCapture(B.pointerId)):(Math.abs(W)>$||Math.abs(q)>$)&&(N.current=null)}),onPointerUp:Ie(e.onPointerUp,B=>{const W=E.current,q=B.target;if(q.hasPointerCapture(B.pointerId)&&q.releasePointerCapture(B.pointerId),E.current=null,N.current=null,W){const V=B.currentTarget,F={originalEvent:B,delta:W};OE(W,b.swipeDirection,b.swipeThreshold)?Gp(O7,g,F,{discrete:!0}):Gp(k7,x,F,{discrete:!0}),V.addEventListener("click",U=>U.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),M7=e=>{const{__scopeToast:t,children:n,...r}=e,a=Gm(vf,t),[i,o]=v.useState(!1),[c,d]=v.useState(!1);return L7(()=>o(!0)),v.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),c?null:s.jsx(Yc,{asChild:!0,children:s.jsx(Km,{...r,children:i&&s.jsxs(s.Fragment,{children:[a.label," ",n]})})})},$7="ToastTitle",p$=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(Ge.div,{...r,ref:t})});p$.displayName=$7;var D7="ToastDescription",h$=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(Ge.div,{...r,ref:t})});h$.displayName=D7;var m$="ToastAction",v$=v.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?s.jsx(x$,{altText:n,asChild:!0,children:s.jsx(XS,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${m$}\`. Expected non-empty \`string\`.`),null)});v$.displayName=m$;var g$="ToastClose",XS=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=T7(g$,n);return s.jsx(x$,{asChild:!0,children:s.jsx(Ge.button,{type:"button",...r,ref:t,onClick:Ie(e.onClick,a.onClose)})})});XS.displayName=g$;var x$=v.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return s.jsx(Ge.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function y$(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),F7(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(...y$(r))}}),t}function Gp(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?KS(a,i):a.dispatchEvent(i)}var OE=(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 L7(e=()=>{}){const t=Un(e);tr(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function F7(e){return e.nodeType===e.ELEMENT_NODE}function B7(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 py(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var z7=l$,b$=u$,w$=f$,j$=p$,S$=h$,N$=v$,C$=XS;function A$(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=A$(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Rt(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=A$(e))&&(r&&(r+=" "),r+=t);return r}const RE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,TE=Rt,el=(e,t)=>n=>{var r;if(t?.variants==null)return TE(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 x=RE(h)||RE(p);return a[f][x]}),c=n&&Object.entries(n).reduce((f,h)=>{let[p,x]=h;return x===void 0||(f[p]=x),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,h)=>{let{class:p,className:x,...g}=h;return Object.entries(g).every(j=>{let[b,y]=j;return Array.isArray(y)?y.includes({...i,...c}[b]):{...i,...c}[b]===y})?[...f,p,x]:f},[]);return TE(e,o,d,n?.class,n?.className)};const U7=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_$=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var q7={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 W7=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,...q7,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:_$("lucide",a),...c},[...o.map(([f,h])=>v.createElement(f,h)),...Array.isArray(i)?i:[i]]));const ct=(e,t)=>{const n=v.forwardRef(({className:r,...a},i)=>v.createElement(W7,{ref:i,iconNode:t,className:_$(`lucide-${U7(e)}`,r),...a}));return n.displayName=`${e}`,n};const E$=ct("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 V7=ct("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 Mo=ct("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const Sa=ct("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 jd=ct("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 mc=ct("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Wt=ct("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const P$=ct("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const hs=ct("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const rc=ct("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);const hy=ct("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 ac=ct("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const H7=ct("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 bh=ct("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 K7=ct("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const gf=ct("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const ys=ct("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 k$=ct("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 Va=ct("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 Ym=ct("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 _h=ct("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 G7=ct("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 O$=ct("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 IE=ct("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 R$=ct("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 QS=ct("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 Y7=ct("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 X7=ct("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);const Vj=ct("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 T$=ct("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 Q7=ct("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 hr=ct("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const I$=ct("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 J7=ct("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 M$=ct("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 Ql=ct("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 Z7=ct("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);const my=ct("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 vy=ct("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 Xm=ct("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 Oo=ct("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const bs=ct("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const $$=ct("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 Aa=ct("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 eq=ct("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 JS=ct("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const D$=ct("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 ZS=ct("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 tq=ct("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const ba=ct("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 wh=ct("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);const L$=ct("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 _a=ct("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 jh=ct("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 nq=ct("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 eN=ct("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$=ct("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 us=ct("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 ws=ct("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),tN="-",rq=e=>{const t=sq(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const c=o.split(tN);return c[0]===""&&c.length!==1&&c.shift(),B$(c,t)||aq(o)},getConflictingClassGroupIds:(o,c)=>{const d=n[o]||[];return c&&r[o]?[...d,...r[o]]:d}}},B$=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?B$(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(tN);return t.validators.find(({validator:o})=>o(i))?.classGroupId},ME=/^\[(.+)\]$/,aq=e=>{if(ME.test(e)){const t=ME.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},sq=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return oq(Object.entries(e.classGroups),n).forEach(([i,o])=>{Hj(o,r,i,t)}),r},Hj=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:$E(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(iq(a)){Hj(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,o])=>{Hj(o,$E(t,i),n,r)})})},$E=(e,t)=>{let n=e;return t.split(tN).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},iq=e=>e.isThemeGetter,oq=(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,lq=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)}}},z$="!",cq=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 y=0;y<c.length;y++){let S=c[y];if(f===0){if(S===a&&(r||c.slice(y,y+i)===t)){d.push(c.slice(h,y)),h=y+i;continue}if(S==="/"){p=y;continue}}S==="["?f++:S==="]"&&f--}const x=d.length===0?c:c.substring(h),g=x.startsWith(z$),j=g?x.substring(1):x,b=p&&p>h?p-h:void 0;return{modifiers:d,hasImportantModifier:g,baseClassName:j,maybePostfixModifierPosition:b}};return n?c=>n({className:c,parseClassName:o}):o},uq=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},dq=e=>({cache:lq(e.cacheSize),parseClassName:cq(e),...rq(e)}),fq=/\s+/,pq=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(fq);let c="";for(let d=o.length-1;d>=0;d-=1){const f=o[d],{modifiers:h,hasImportantModifier:p,baseClassName:x,maybePostfixModifierPosition:g}=n(f);let j=!!g,b=r(j?x.substring(0,g):x);if(!b){if(!j){c=f+(c.length>0?" "+c:c);continue}if(b=r(x),!b){c=f+(c.length>0?" "+c:c);continue}j=!1}const y=uq(h).join(":"),S=p?y+z$:y,C=S+b;if(i.includes(C))continue;i.push(C);const N=a(b,j);for(let E=0;E<N.length;++E){const _=N[E];i.push(S+_)}c=f+(c.length>0?" "+c:c)}return c};function hq(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=U$(t))&&(r&&(r+=" "),r+=n);return r}const U$=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=U$(e[r]))&&(n&&(n+=" "),n+=t);return n};function mq(e,...t){let n,r,a,i=o;function o(d){const f=t.reduce((h,p)=>p(h),e());return n=dq(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=pq(d,n);return a(d,h),h}return function(){return i(hq.apply(null,arguments))}}const Nn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},q$=/^\[(?:([a-z-]+):)?(.+)\]$/i,vq=/^\d+\/\d+$/,gq=new Set(["px","full","screen"]),xq=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,yq=/\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$/,bq=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,wq=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,zs=e=>sc(e)||gq.has(e)||vq.test(e),Ti=e=>Xc(e,"length",kq),sc=e=>!!e&&!Number.isNaN(Number(e)),gy=e=>Xc(e,"number",sc),Gu=e=>!!e&&Number.isInteger(Number(e)),Sq=e=>e.endsWith("%")&&sc(e.slice(0,-1)),It=e=>q$.test(e),Ii=e=>xq.test(e),Nq=new Set(["length","size","percentage"]),Cq=e=>Xc(e,Nq,W$),Aq=e=>Xc(e,"position",W$),_q=new Set(["image","url"]),Eq=e=>Xc(e,_q,Rq),Pq=e=>Xc(e,"",Oq),Yu=()=>!0,Xc=(e,t,n)=>{const r=q$.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},kq=e=>yq.test(e)&&!bq.test(e),W$=()=>!1,Oq=e=>wq.test(e),Rq=e=>jq.test(e),Tq=()=>{const e=Nn("colors"),t=Nn("spacing"),n=Nn("blur"),r=Nn("brightness"),a=Nn("borderColor"),i=Nn("borderRadius"),o=Nn("borderSpacing"),c=Nn("borderWidth"),d=Nn("contrast"),f=Nn("grayscale"),h=Nn("hueRotate"),p=Nn("invert"),x=Nn("gap"),g=Nn("gradientColorStops"),j=Nn("gradientColorStopPositions"),b=Nn("inset"),y=Nn("margin"),S=Nn("opacity"),C=Nn("padding"),N=Nn("saturate"),E=Nn("scale"),_=Nn("sepia"),P=Nn("skew"),O=Nn("space"),R=Nn("translate"),L=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",It,t],M=()=>[It,t],G=()=>["",zs,Ti],B=()=>["auto",sc,It],W=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],q=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],F=()=>["start","end","center","between","around","evenly","stretch"],U=()=>["","0",It],Z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[sc,It];return{cacheSize:500,separator:":",theme:{colors:[Yu],spacing:[zs,Ti],blur:["none","",Ii,It],brightness:z(),borderColor:[e],borderRadius:["none","","full",Ii,It],borderSpacing:M(),borderWidth:G(),contrast:z(),grayscale:U(),hueRotate:z(),invert:U(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[Sq,Ti],inset:D(),margin:D(),opacity:z(),padding:M(),saturate:z(),scale:z(),sepia:U(),skew:z(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",It]}],container:["container"],columns:[{columns:[Ii]}],"break-after":[{"break-after":Z()}],"break-before":[{"break-before":Z()}],"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:[...W(),It]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Gu,It]}],basis:[{basis:D()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",It]}],grow:[{grow:U()}],shrink:[{shrink:U()}],order:[{order:["first","last","none",Gu,It]}],"grid-cols":[{"grid-cols":[Yu]}],"col-start-end":[{col:["auto",{span:["full",Gu,It]},It]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[Yu]}],"row-start-end":[{row:["auto",{span:[Gu,It]},It]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",It]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",It]}],gap:[{gap:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"justify-content":[{justify:["normal",...F()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...F(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...F(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[C]}],px:[{px:[C]}],py:[{py:[C]}],ps:[{ps:[C]}],pe:[{pe:[C]}],pt:[{pt:[C]}],pr:[{pr:[C]}],pb:[{pb:[C]}],pl:[{pl:[C]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",It,t]}],"min-w":[{"min-w":[It,t,"min","max","fit"]}],"max-w":[{"max-w":[It,t,"none","full","min","max","fit","prose",{screen:[Ii]},Ii]}],h:[{h:[It,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[It,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[It,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[It,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ii,Ti]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",gy]}],"font-family":[{font:[Yu]}],"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",It]}],"line-clamp":[{"line-clamp":["none",sc,gy]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",zs,It]}],"list-image":[{"list-image":["none",It]}],"list-style-type":[{list:["none","disc","decimal",It]}],"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:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",zs,Ti]}],"underline-offset":[{"underline-offset":["auto",zs,It]}],"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:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",It]}],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",It]}],"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:[...W(),Aq]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Cq]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Eq]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[j]}],"gradient-via-pos":[{via:[j]}],"gradient-to-pos":[{to:[j]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],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:[...q(),"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:q()}],"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:["",...q()]}],"outline-offset":[{"outline-offset":[zs,It]}],"outline-w":[{outline:[zs,Ti]}],"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":[zs,Ti]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ii,Pq]}],"shadow-color":[{shadow:[Yu]}],opacity:[{opacity:[S]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",Ii,It]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[p]}],saturate:[{saturate:[N]}],sepia:[{sepia:[_]}],"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":[N]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"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",It]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",It]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",It]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Gu,It]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",It]}],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",It]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",It]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[zs,Ti,gy]}],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"]}}},Iq=mq(Tq);function je(...e){return Iq(Rt(e))}const Mq=z7,V$=v.forwardRef(({className:e,...t},n)=>s.jsx(b$,{ref:n,className:je("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}));V$.displayName=b$.displayName;const $q=el("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"}}),H$=v.forwardRef(({className:e,variant:t,...n},r)=>s.jsx(w$,{ref:r,className:je($q({variant:t}),e),...n}));H$.displayName=w$.displayName;const Dq=v.forwardRef(({className:e,...t},n)=>s.jsx(N$,{ref:n,className:je("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}));Dq.displayName=N$.displayName;const K$=v.forwardRef(({className:e,...t},n)=>s.jsx(C$,{ref:n,className:je("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(ws,{className:"h-4 w-4"})}));K$.displayName=C$.displayName;const G$=v.forwardRef(({className:e,...t},n)=>s.jsx(j$,{ref:n,className:je("text-sm font-semibold",e),...t}));G$.displayName=j$.displayName;const Y$=v.forwardRef(({className:e,...t},n)=>s.jsx(S$,{ref:n,className:je("text-sm opacity-90",e),...t}));Y$.displayName=S$.displayName;function Lq(){const{toasts:e}=VU();return s.jsxs(Mq,{children:[e.map(function({id:t,title:n,description:r,action:a,...i}){return s.jsxs(H$,{...i,children:[s.jsxs("div",{className:"grid gap-1",children:[n&&s.jsx(G$,{children:n}),r&&s.jsx(Y$,{children:r})]}),a,s.jsx(K$,{})]},t)}),s.jsx(V$,{})]})}var DE=["light","dark"],Fq="(prefers-color-scheme: dark)",Bq=v.createContext(void 0),zq={setTheme:e=>{},themes:[]},Uq=()=>{var e;return(e=v.useContext(Bq))!=null?e:zq};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?DE.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",x=(j,b=!1,y=!0)=>{let S=o?o[j]:j,C=b?j+"|| ''":`'${S}'`,N="";return a&&y&&!b&&DE.includes(j)&&(N+=`d.style.colorScheme = '${j}';`),n==="class"?b||S?N+=`c.add(${C})`:N+="null":S&&(N+=`d[s](n,${C})`),N},g=e?`!function(){${h}${x(e)}}()`:r?`!function(){try{${h}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${f})){var t='${Fq}',m=window.matchMedia(t);if(m.media!==t||m.matches){${x("dark")}}else{${x("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${x(o?"x[e]":"e",!0)}}${f?"":"else{"+x(i,!1,!1)+"}"}${p}}catch(e){}}()`:`!function(){try{${h}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${x(o?"x[e]":"e",!0)}}else{${x(i,!1,!1)};}${p}}catch(t){}}();`;return v.createElement("script",{nonce:d,dangerouslySetInnerHTML:{__html:g}})});var qq=e=>{switch(e){case"success":return Hq;case"info":return Gq;case"warning":return Kq;case"error":return Yq;default:return null}},Wq=Array(12).fill(0),Vq=({visible:e,className:t})=>H.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},H.createElement("div",{className:"sonner-spinner"},Wq.map((n,r)=>H.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Hq=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},H.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"})),Kq=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},H.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"})),Gq=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},H.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"})),Yq=H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},H.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"})),Xq=H.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"},H.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),H.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Qq=()=>{let[e,t]=H.useState(document.hidden);return H.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Kj=1,Jq=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:Kj++,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],H.isValidElement(d))a=!1,this.create({id:n,type:"default",message:d});else if(e9(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||Kj++;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}},Lr=new Jq,Zq=(e,t)=>{let n=t?.id||Kj++;return Lr.addToast({title:e,...t,id:n}),n},e9=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",t9=Zq,n9=()=>Lr.toasts,r9=()=>Lr.getActiveToasts();Object.assign(t9,{success:Lr.success,info:Lr.info,warning:Lr.warning,error:Lr.error,custom:Lr.custom,message:Lr.message,promise:Lr.promise,dismiss:Lr.dismiss,loading:Lr.loading},{getHistory:n9,getToasts:r9});function a9(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))}a9(`: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 Yp(e){return e.label!==void 0}var s9=3,i9="32px",o9="16px",LE=4e3,l9=356,c9=14,u9=20,d9=200;function La(...e){return e.filter(Boolean).join(" ")}function f9(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var p9=e=>{var t,n,r,a,i,o,c,d,f,h,p;let{invert:x,toast:g,unstyled:j,interacting:b,setHeights:y,visibleToasts:S,heights:C,index:N,toasts:E,expanded:_,removeToast:P,defaultRichColors:O,closeButton:R,style:L,cancelButtonStyle:T,actionButtonStyle:D,className:M="",descriptionClassName:G="",duration:B,position:W,gap:q,loadingIcon:V,expandByDefault:F,classNames:U,icons:Z,closeButtonAriaLabel:z="Close toast",pauseWhenPageIsHidden:$}=e,[te,se]=H.useState(null),[Q,ce]=H.useState(null),[le,me]=H.useState(!1),[oe,fe]=H.useState(!1),[Ce,ae]=H.useState(!1),[Re,Ae]=H.useState(!1),[Te,be]=H.useState(!1),[_e,X]=H.useState(0),[ge,ue]=H.useState(0),De=H.useRef(g.duration||B||LE),Ye=H.useRef(null),Ct=H.useRef(null),Ft=N===0,mt=N+1<=S,Nt=g.type,Vt=g.dismissible!==!1,pn=g.className||"",ln=g.descriptionClassName||"",ee=H.useMemo(()=>C.findIndex(ut=>ut.toastId===g.id)||0,[C,g.id]),Se=H.useMemo(()=>{var ut;return(ut=g.closeButton)!=null?ut:R},[g.closeButton,R]),Ne=H.useMemo(()=>g.duration||B||LE,[g.duration,B]),ze=H.useRef(0),ke=H.useRef(0),it=H.useRef(0),Ue=H.useRef(null),[Tt,Ot]=W.split("-"),zt=H.useMemo(()=>C.reduce((ut,jt,Et)=>Et>=ee?ut:ut+jt.height,0),[C,ee]),Ln=Qq(),yn=g.invert||x,Ht=Nt==="loading";ke.current=H.useMemo(()=>ee*q+zt,[ee,zt]),H.useEffect(()=>{De.current=Ne},[Ne]),H.useEffect(()=>{me(!0)},[]),H.useEffect(()=>{let ut=Ct.current;if(ut){let jt=ut.getBoundingClientRect().height;return ue(jt),y(Et=>[{toastId:g.id,height:jt,position:g.position},...Et]),()=>y(Et=>Et.filter(bn=>bn.toastId!==g.id))}},[y,g.id]),H.useLayoutEffect(()=>{if(!le)return;let ut=Ct.current,jt=ut.style.height;ut.style.height="auto";let Et=ut.getBoundingClientRect().height;ut.style.height=jt,ue(Et),y(bn=>bn.find(de=>de.toastId===g.id)?bn.map(de=>de.toastId===g.id?{...de,height:Et}:de):[{toastId:g.id,height:Et,position:g.position},...bn])},[le,g.title,g.description,y,g.id]);let hn=H.useCallback(()=>{fe(!0),X(ke.current),y(ut=>ut.filter(jt=>jt.toastId!==g.id)),setTimeout(()=>{P(g)},d9)},[g,P,y,ke]);H.useEffect(()=>{if(g.promise&&Nt==="loading"||g.duration===1/0||g.type==="loading")return;let ut;return _||b||$&&Ln?(()=>{if(it.current<ze.current){let jt=new Date().getTime()-ze.current;De.current=De.current-jt}it.current=new Date().getTime()})():De.current!==1/0&&(ze.current=new Date().getTime(),ut=setTimeout(()=>{var jt;(jt=g.onAutoClose)==null||jt.call(g,g),hn()},De.current)),()=>clearTimeout(ut)},[_,b,g,Nt,$,Ln,hn]),H.useEffect(()=>{g.delete&&hn()},[hn,g.delete]);function wr(){var ut,jt,Et;return Z!=null&&Z.loading?H.createElement("div",{className:La(U?.loader,(ut=g?.classNames)==null?void 0:ut.loader,"sonner-loader"),"data-visible":Nt==="loading"},Z.loading):V?H.createElement("div",{className:La(U?.loader,(jt=g?.classNames)==null?void 0:jt.loader,"sonner-loader"),"data-visible":Nt==="loading"},V):H.createElement(Vq,{className:La(U?.loader,(Et=g?.classNames)==null?void 0:Et.loader),visible:Nt==="loading"})}return H.createElement("li",{tabIndex:0,ref:Ct,className:La(M,pn,U?.toast,(t=g?.classNames)==null?void 0:t.toast,U?.default,U?.[Nt],(n=g?.classNames)==null?void 0:n[Nt]),"data-sonner-toast":"","data-rich-colors":(r=g.richColors)!=null?r:O,"data-styled":!(g.jsx||g.unstyled||j),"data-mounted":le,"data-promise":!!g.promise,"data-swiped":Te,"data-removed":oe,"data-visible":mt,"data-y-position":Tt,"data-x-position":Ot,"data-index":N,"data-front":Ft,"data-swiping":Ce,"data-dismissible":Vt,"data-type":Nt,"data-invert":yn,"data-swipe-out":Re,"data-swipe-direction":Q,"data-expanded":!!(_||F&&le),style:{"--index":N,"--toasts-before":N,"--z-index":E.length-N,"--offset":`${oe?_e:ke.current}px`,"--initial-height":F?"auto":`${ge}px`,...L,...g.style},onDragEnd:()=>{ae(!1),se(null),Ue.current=null},onPointerDown:ut=>{Ht||!Vt||(Ye.current=new Date,X(ke.current),ut.target.setPointerCapture(ut.pointerId),ut.target.tagName!=="BUTTON"&&(ae(!0),Ue.current={x:ut.clientX,y:ut.clientY}))},onPointerUp:()=>{var ut,jt,Et,bn;if(Re||!Vt)return;Ue.current=null;let de=Number(((ut=Ct.current)==null?void 0:ut.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ot=Number(((jt=Ct.current)==null?void 0:jt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Bt=new Date().getTime()-((Et=Ye.current)==null?void 0:Et.getTime()),Kt=te==="x"?de:ot,cn=Math.abs(Kt)/Bt;if(Math.abs(Kt)>=u9||cn>.11){X(ke.current),(bn=g.onDismiss)==null||bn.call(g,g),ce(te==="x"?de>0?"right":"left":ot>0?"down":"up"),hn(),Ae(!0),be(!1);return}ae(!1),se(null)},onPointerMove:ut=>{var jt,Et,bn,de;if(!Ue.current||!Vt||((jt=window.getSelection())==null?void 0:jt.toString().length)>0)return;let ot=ut.clientY-Ue.current.y,Bt=ut.clientX-Ue.current.x,Kt=(Et=e.swipeDirections)!=null?Et:f9(W);!te&&(Math.abs(Bt)>1||Math.abs(ot)>1)&&se(Math.abs(Bt)>Math.abs(ot)?"x":"y");let cn={x:0,y:0};te==="y"?(Kt.includes("top")||Kt.includes("bottom"))&&(Kt.includes("top")&&ot<0||Kt.includes("bottom")&&ot>0)&&(cn.y=ot):te==="x"&&(Kt.includes("left")||Kt.includes("right"))&&(Kt.includes("left")&&Bt<0||Kt.includes("right")&&Bt>0)&&(cn.x=Bt),(Math.abs(cn.x)>0||Math.abs(cn.y)>0)&&be(!0),(bn=Ct.current)==null||bn.style.setProperty("--swipe-amount-x",`${cn.x}px`),(de=Ct.current)==null||de.style.setProperty("--swipe-amount-y",`${cn.y}px`)}},Se&&!g.jsx?H.createElement("button",{"aria-label":z,"data-disabled":Ht,"data-close-button":!0,onClick:Ht||!Vt?()=>{}:()=>{var ut;hn(),(ut=g.onDismiss)==null||ut.call(g,g)},className:La(U?.closeButton,(a=g?.classNames)==null?void 0:a.closeButton)},(i=Z?.close)!=null?i:Xq):null,g.jsx||v.isValidElement(g.title)?g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title:H.createElement(H.Fragment,null,Nt||g.icon||g.promise?H.createElement("div",{"data-icon":"",className:La(U?.icon,(o=g?.classNames)==null?void 0:o.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||wr():null,g.type!=="loading"?g.icon||Z?.[Nt]||qq(Nt):null):null,H.createElement("div",{"data-content":"",className:La(U?.content,(c=g?.classNames)==null?void 0:c.content)},H.createElement("div",{"data-title":"",className:La(U?.title,(d=g?.classNames)==null?void 0:d.title)},typeof g.title=="function"?g.title():g.title),g.description?H.createElement("div",{"data-description":"",className:La(G,ln,U?.description,(f=g?.classNames)==null?void 0:f.description)},typeof g.description=="function"?g.description():g.description):null),v.isValidElement(g.cancel)?g.cancel:g.cancel&&Yp(g.cancel)?H.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||T,onClick:ut=>{var jt,Et;Yp(g.cancel)&&Vt&&((Et=(jt=g.cancel).onClick)==null||Et.call(jt,ut),hn())},className:La(U?.cancelButton,(h=g?.classNames)==null?void 0:h.cancelButton)},g.cancel.label):null,v.isValidElement(g.action)?g.action:g.action&&Yp(g.action)?H.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||D,onClick:ut=>{var jt,Et;Yp(g.action)&&((Et=(jt=g.action).onClick)==null||Et.call(jt,ut),!ut.defaultPrevented&&hn())},className:La(U?.actionButton,(p=g?.classNames)==null?void 0:p.actionButton)},g.action.label):null))};function FE(){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 h9(e,t){let n={};return[e,t].forEach((r,a)=>{let i=a===1,o=i?"--mobile-offset":"--offset",c=i?o9:i9;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 m9=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:x,style:g,visibleToasts:j=s9,toastOptions:b,dir:y=FE(),gap:S=c9,loadingIcon:C,icons:N,containerAriaLabel:E="Notifications",pauseWhenPageIsHidden:_}=e,[P,O]=H.useState([]),R=H.useMemo(()=>Array.from(new Set([r].concat(P.filter($=>$.position).map($=>$.position)))),[P,r]),[L,T]=H.useState([]),[D,M]=H.useState(!1),[G,B]=H.useState(!1),[W,q]=H.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=H.useRef(null),F=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),U=H.useRef(null),Z=H.useRef(!1),z=H.useCallback($=>{O(te=>{var se;return(se=te.find(Q=>Q.id===$.id))!=null&&se.delete||Lr.dismiss($.id),te.filter(({id:Q})=>Q!==$.id)})},[]);return H.useEffect(()=>Lr.subscribe($=>{if($.dismiss){O(te=>te.map(se=>se.id===$.id?{...se,delete:!0}:se));return}setTimeout(()=>{n$.flushSync(()=>{O(te=>{let se=te.findIndex(Q=>Q.id===$.id);return se!==-1?[...te.slice(0,se),{...te[se],...$},...te.slice(se+1)]:[$,...te]})})})}),[]),H.useEffect(()=>{if(h!=="system"){q(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;let $=window.matchMedia("(prefers-color-scheme: dark)");try{$.addEventListener("change",({matches:te})=>{q(te?"dark":"light")})}catch{$.addListener(({matches:se})=>{try{q(se?"dark":"light")}catch(Q){console.error(Q)}})}},[h]),H.useEffect(()=>{P.length<=1&&M(!1)},[P]),H.useEffect(()=>{let $=te=>{var se,Q;a.every(ce=>te[ce]||te.code===ce)&&(M(!0),(se=V.current)==null||se.focus()),te.code==="Escape"&&(document.activeElement===V.current||(Q=V.current)!=null&&Q.contains(document.activeElement))&&M(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[a]),H.useEffect(()=>{if(V.current)return()=>{U.current&&(U.current.focus({preventScroll:!0}),U.current=null,Z.current=!1)}},[V.current]),H.createElement("section",{ref:t,"aria-label":`${E} ${F}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map(($,te)=>{var se;let[Q,ce]=$.split("-");return P.length?H.createElement("ol",{key:$,dir:y==="auto"?FE():y,tabIndex:-1,ref:V,className:c,"data-sonner-toaster":!0,"data-theme":W,"data-y-position":Q,"data-lifted":D&&P.length>1&&!i,"data-x-position":ce,style:{"--front-toast-height":`${((se=L[0])==null?void 0:se.height)||0}px`,"--width":`${l9}px`,"--gap":`${S}px`,...g,...h9(d,f)},onBlur:le=>{Z.current&&!le.currentTarget.contains(le.relatedTarget)&&(Z.current=!1,U.current&&(U.current.focus({preventScroll:!0}),U.current=null))},onFocus:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||Z.current||(Z.current=!0,U.current=le.relatedTarget)},onMouseEnter:()=>M(!0),onMouseMove:()=>M(!0),onMouseLeave:()=>{G||M(!1)},onDragEnd:()=>M(!1),onPointerDown:le=>{le.target instanceof HTMLElement&&le.target.dataset.dismissible==="false"||B(!0)},onPointerUp:()=>B(!1)},P.filter(le=>!le.position&&te===0||le.position===$).map((le,me)=>{var oe,fe;return H.createElement(p9,{key:le.id,icons:N,index:me,toast:le,defaultRichColors:p,duration:(oe=b?.duration)!=null?oe:x,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:n,visibleToasts:j,closeButton:(fe=b?.closeButton)!=null?fe:o,interacting:G,position:$,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,removeToast:z,toasts:P.filter(Ce=>Ce.position==le.position),heights:L.filter(Ce=>Ce.position==le.position),setHeights:T,expandByDefault:i,gap:S,loadingIcon:C,expanded:D,pauseWhenPageIsHidden:_,swipeDirections:e.swipeDirections})})):null}))});const v9=({...e})=>{const{theme:t="system"}=Uq();return s.jsx(m9,{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 g9=Hm[" useId ".trim().toString()]||(()=>{}),x9=0;function er(e){const[t,n]=v.useState(g9());return tr(()=>{n(r=>r??String(x9++))},[e]),e||(t?`radix-${t}`:"")}const y9=["top","right","bottom","left"],Wi=Math.min,ta=Math.max,Eh=Math.round,Xp=Math.floor,ms=e=>({x:e,y:e}),b9={left:"right",right:"left",bottom:"top",top:"bottom"},w9={start:"end",end:"start"};function Gj(e,t,n){return ta(e,Wi(t,n))}function ei(e,t){return typeof e=="function"?e(t):e}function ti(e){return e.split("-")[0]}function Qc(e){return e.split("-")[1]}function nN(e){return e==="x"?"y":"x"}function rN(e){return e==="y"?"height":"width"}const j9=new Set(["top","bottom"]);function fs(e){return j9.has(ti(e))?"y":"x"}function aN(e){return nN(fs(e))}function S9(e,t,n){n===void 0&&(n=!1);const r=Qc(e),a=aN(e),i=rN(a);let o=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=Ph(o)),[o,Ph(o)]}function N9(e){const t=Ph(e);return[Yj(e),t,Yj(t)]}function Yj(e){return e.replace(/start|end/g,t=>w9[t])}const BE=["left","right"],zE=["right","left"],C9=["top","bottom"],A9=["bottom","top"];function _9(e,t,n){switch(e){case"top":case"bottom":return n?t?zE:BE:t?BE:zE;case"left":case"right":return t?C9:A9;default:return[]}}function E9(e,t,n,r){const a=Qc(e);let i=_9(ti(e),n==="start",r);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(Yj)))),i}function Ph(e){return e.replace(/left|right|bottom|top/g,t=>b9[t])}function P9(e){return{top:0,right:0,bottom:0,left:0,...e}}function X$(e){return typeof e!="number"?P9(e):{top:e,right:e,bottom:e,left:e}}function kh(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 UE(e,t,n){let{reference:r,floating:a}=e;const i=fs(t),o=aN(t),c=rN(o),d=ti(t),f=i==="y",h=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,x=r[c]/2-a[c]/2;let g;switch(d){case"top":g={x:h,y:r.y-a.height};break;case"bottom":g={x:h,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:p};break;case"left":g={x:r.x-a.width,y:p};break;default:g={x:r.x,y:r.y}}switch(Qc(t)){case"start":g[o]-=x*(n&&f?-1:1);break;case"end":g[o]+=x*(n&&f?-1:1);break}return g}async function k9(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:x=!1,padding:g=0}=ei(t,e),j=X$(g),y=c[x?p==="floating"?"reference":"floating":p],S=kh(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:f,rootBoundary:h,strategy:d})),C=p==="floating"?{x:r,y:a,width:o.floating.width,height:o.floating.height}:o.reference,N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),E=await(i.isElement==null?void 0:i.isElement(N))?await(i.getScale==null?void 0:i.getScale(N))||{x:1,y:1}:{x:1,y:1},_=kh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:C,offsetParent:N,strategy:d}):C);return{top:(S.top-_.top+j.top)/E.y,bottom:(_.bottom-S.bottom+j.bottom)/E.y,left:(S.left-_.left+j.left)/E.x,right:(_.right-S.right+j.right)/E.x}}const O9=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}=UE(f,r,d),x=r,g={},j=0;for(let y=0;y<c.length;y++){var b;const{name:S,fn:C}=c[y],{x:N,y:E,data:_,reset:P}=await C({x:h,y:p,initialPlacement:r,placement:x,strategy:a,middlewareData:g,rects:f,platform:{...o,detectOverflow:(b=o.detectOverflow)!=null?b:k9},elements:{reference:e,floating:t}});h=N??h,p=E??p,g={...g,[S]:{...g[S],..._}},P&&j<=50&&(j++,typeof P=="object"&&(P.placement&&(x=P.placement),P.rects&&(f=P.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):P.rects),{x:h,y:p}=UE(f,x,d)),y=-1)}return{x:h,y:p,placement:x,strategy:a,middlewareData:g}},R9=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}=ei(e,t)||{};if(f==null)return{};const p=X$(h),x={x:n,y:r},g=aN(a),j=rN(g),b=await o.getDimensions(f),y=g==="y",S=y?"top":"left",C=y?"bottom":"right",N=y?"clientHeight":"clientWidth",E=i.reference[j]+i.reference[g]-x[g]-i.floating[j],_=x[g]-i.reference[g],P=await(o.getOffsetParent==null?void 0:o.getOffsetParent(f));let O=P?P[N]:0;(!O||!await(o.isElement==null?void 0:o.isElement(P)))&&(O=c.floating[N]||i.floating[j]);const R=E/2-_/2,L=O/2-b[j]/2-1,T=Wi(p[S],L),D=Wi(p[C],L),M=T,G=O-b[j]-D,B=O/2-b[j]/2+R,W=Gj(M,B,G),q=!d.arrow&&Qc(a)!=null&&B!==W&&i.reference[j]/2-(B<M?T:D)-b[j]/2<0,V=q?B<M?B-M:B-G:0;return{[g]:x[g]+V,data:{[g]:W,centerOffset:B-W-V,...q&&{alignmentOffset:V}},reset:q}}}),T9=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:x,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:b=!0,...y}=ei(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const S=ti(a),C=fs(c),N=ti(c)===c,E=await(d.isRTL==null?void 0:d.isRTL(f.floating)),_=x||(N||!b?[Ph(c)]:N9(c)),P=j!=="none";!x&&P&&_.push(...E9(c,b,j,E));const O=[c,..._],R=await d.detectOverflow(t,y),L=[];let T=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&L.push(R[S]),p){const B=S9(a,o,E);L.push(R[B[0]],R[B[1]])}if(T=[...T,{placement:a,overflows:L}],!L.every(B=>B<=0)){var D,M;const B=(((D=i.flip)==null?void 0:D.index)||0)+1,W=O[B];if(W&&(!(p==="alignment"?C!==fs(W):!1)||T.every(F=>fs(F.placement)===C?F.overflows[0]>0:!0)))return{data:{index:B,overflows:T},reset:{placement:W}};let q=(M=T.filter(V=>V.overflows[0]<=0).sort((V,F)=>V.overflows[1]-F.overflows[1])[0])==null?void 0:M.placement;if(!q)switch(g){case"bestFit":{var G;const V=(G=T.filter(F=>{if(P){const U=fs(F.placement);return U===C||U==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(U=>U>0).reduce((U,Z)=>U+Z,0)]).sort((F,U)=>F[1]-U[1])[0])==null?void 0:G[0];V&&(q=V);break}case"initialPlacement":q=c;break}if(a!==q)return{reset:{placement:q}}}return{}}}};function qE(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function WE(e){return y9.some(t=>e[t]>=0)}const I9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...i}=ei(e,t);switch(a){case"referenceHidden":{const o=await r.detectOverflow(t,{...i,elementContext:"reference"}),c=qE(o,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:WE(c)}}}case"escaped":{const o=await r.detectOverflow(t,{...i,altBoundary:!0}),c=qE(o,n.floating);return{data:{escapedOffsets:c,escaped:WE(c)}}}default:return{}}}}},Q$=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=ti(n),c=Qc(n),d=fs(n)==="y",f=Q$.has(o)?-1:1,h=i&&d?-1:1,p=ei(t,e);let{mainAxis:x,crossAxis:g,alignmentAxis:j}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof j=="number"&&(g=c==="end"?j*-1:j),d?{x:g*h,y:x*f}:{x:x*f,y:g*h}}const $9=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}}}}},D9=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:C,y:N}=S;return{x:C,y:N}}},...f}=ei(e,t),h={x:n,y:r},p=await i.detectOverflow(t,f),x=fs(ti(a)),g=nN(x);let j=h[g],b=h[x];if(o){const S=g==="y"?"top":"left",C=g==="y"?"bottom":"right",N=j+p[S],E=j-p[C];j=Gj(N,j,E)}if(c){const S=x==="y"?"top":"left",C=x==="y"?"bottom":"right",N=b+p[S],E=b-p[C];b=Gj(N,b,E)}const y=d.fn({...t,[g]:j,[x]:b});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[g]:o,[x]:c}}}}}},L9=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}=ei(e,t),h={x:n,y:r},p=fs(a),x=nN(p);let g=h[x],j=h[p];const b=ei(c,t),y=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(d){const N=x==="y"?"height":"width",E=i.reference[x]-i.floating[N]+y.mainAxis,_=i.reference[x]+i.reference[N]-y.mainAxis;g<E?g=E:g>_&&(g=_)}if(f){var S,C;const N=x==="y"?"width":"height",E=Q$.has(ti(a)),_=i.reference[p]-i.floating[N]+(E&&((S=o.offset)==null?void 0:S[p])||0)+(E?0:y.crossAxis),P=i.reference[p]+i.reference[N]+(E?0:((C=o.offset)==null?void 0:C[p])||0)-(E?y.crossAxis:0);j<_?j=_:j>P&&(j=P)}return{[x]:g,[p]:j}}}},F9=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}=ei(e,t),h=await o.detectOverflow(t,f),p=ti(a),x=Qc(a),g=fs(a)==="y",{width:j,height:b}=i.floating;let y,S;p==="top"||p==="bottom"?(y=p,S=x===(await(o.isRTL==null?void 0:o.isRTL(c.floating))?"start":"end")?"left":"right"):(S=p,y=x==="end"?"top":"bottom");const C=b-h.top-h.bottom,N=j-h.left-h.right,E=Wi(b-h[y],C),_=Wi(j-h[S],N),P=!t.middlewareData.shift;let O=E,R=_;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=N),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=C),P&&!x){const T=ta(h.left,0),D=ta(h.right,0),M=ta(h.top,0),G=ta(h.bottom,0);g?R=j-2*(T!==0||D!==0?T+D:ta(h.left,h.right)):O=b-2*(M!==0||G!==0?M+G:ta(h.top,h.bottom))}await d({...t,availableWidth:R,availableHeight:O});const L=await o.getDimensions(c.floating);return j!==L.width||b!==L.height?{reset:{rects:!0}}:{}}}};function Qm(){return typeof window<"u"}function Jc(e){return J$(e)?(e.nodeName||"").toLowerCase():"#document"}function sa(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Cs(e){var t;return(t=(J$(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function J$(e){return Qm()?e instanceof Node||e instanceof sa(e).Node:!1}function Ka(e){return Qm()?e instanceof Element||e instanceof sa(e).Element:!1}function js(e){return Qm()?e instanceof HTMLElement||e instanceof sa(e).HTMLElement:!1}function VE(e){return!Qm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof sa(e).ShadowRoot}const B9=new Set(["inline","contents"]);function xf(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ga(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!B9.has(a)}const z9=new Set(["table","td","th"]);function U9(e){return z9.has(Jc(e))}const q9=[":popover-open",":modal"];function Jm(e){return q9.some(t=>{try{return e.matches(t)}catch{return!1}})}const W9=["transform","translate","scale","rotate","perspective"],V9=["transform","translate","scale","rotate","perspective","filter"],H9=["paint","layout","strict","content"];function sN(e){const t=iN(),n=Ka(e)?Ga(e):e;return W9.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)||V9.some(r=>(n.willChange||"").includes(r))||H9.some(r=>(n.contain||"").includes(r))}function K9(e){let t=Vi(e);for(;js(t)&&!vc(t);){if(sN(t))return t;if(Jm(t))return null;t=Vi(t)}return null}function iN(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const G9=new Set(["html","body","#document"]);function vc(e){return G9.has(Jc(e))}function Ga(e){return sa(e).getComputedStyle(e)}function Zm(e){return Ka(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Vi(e){if(Jc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||VE(e)&&e.host||Cs(e);return VE(t)?t.host:t}function Z$(e){const t=Vi(e);return vc(t)?e.ownerDocument?e.ownerDocument.body:e.body:js(t)&&xf(t)?t:Z$(t)}function Sd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=Z$(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),o=sa(a);if(i){const c=Xj(o);return t.concat(o,o.visualViewport||[],xf(a)?a:[],c&&n?Sd(c):[])}return t.concat(a,Sd(a,[],n))}function Xj(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function eD(e){const t=Ga(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=js(e),i=a?e.offsetWidth:n,o=a?e.offsetHeight:r,c=Eh(n)!==i||Eh(r)!==o;return c&&(n=i,r=o),{width:n,height:r,$:c}}function oN(e){return Ka(e)?e:e.contextElement}function ic(e){const t=oN(e);if(!js(t))return ms(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=eD(t);let o=(i?Eh(n.width):n.width)/r,c=(i?Eh(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!c||!Number.isFinite(c))&&(c=1),{x:o,y:c}}const Y9=ms(0);function tD(e){const t=sa(e);return!iN()||!t.visualViewport?Y9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function X9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==sa(e)?!1:t}function $o(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=oN(e);let o=ms(1);t&&(r?Ka(r)&&(o=ic(r)):o=ic(e));const c=X9(i,n,r)?tD(i):ms(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 x=sa(i),g=r&&Ka(r)?sa(r):r;let j=x,b=Xj(j);for(;b&&r&&g!==j;){const y=ic(b),S=b.getBoundingClientRect(),C=Ga(b),N=S.left+(b.clientLeft+parseFloat(C.paddingLeft))*y.x,E=S.top+(b.clientTop+parseFloat(C.paddingTop))*y.y;d*=y.x,f*=y.y,h*=y.x,p*=y.y,d+=N,f+=E,j=sa(b),b=Xj(j)}}return kh({width:h,height:p,x:d,y:f})}function ev(e,t){const n=Zm(e).scrollLeft;return t?t.left+n:$o(Cs(e)).left+n}function nD(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ev(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function Q9(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",o=Cs(r),c=t?Jm(t.floating):!1;if(r===o||c&&i)return n;let d={scrollLeft:0,scrollTop:0},f=ms(1);const h=ms(0),p=js(r);if((p||!p&&!i)&&((Jc(r)!=="body"||xf(o))&&(d=Zm(r)),js(r))){const g=$o(r);f=ic(r),h.x=g.x+r.clientLeft,h.y=g.y+r.clientTop}const x=o&&!p&&!i?nD(o,d):ms(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+h.x+x.x,y:n.y*f.y-d.scrollTop*f.y+h.y+x.y}}function J9(e){return Array.from(e.getClientRects())}function Z9(e){const t=Cs(e),n=Zm(e),r=e.ownerDocument.body,a=ta(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ta(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+ev(e);const c=-n.scrollTop;return Ga(r).direction==="rtl"&&(o+=ta(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:o,y:c}}const HE=25;function eW(e,t){const n=sa(e),r=Cs(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=iN();(!h||h&&t==="fixed")&&(c=a.offsetLeft,d=a.offsetTop)}const f=ev(r);if(f<=0){const h=r.ownerDocument,p=h.body,x=getComputedStyle(p),g=h.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,j=Math.abs(r.clientWidth-p.clientWidth-g);j<=HE&&(i-=j)}else f<=HE&&(i+=f);return{width:i,height:o,x:c,y:d}}const tW=new Set(["absolute","fixed"]);function nW(e,t){const n=$o(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=js(e)?ic(e):ms(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 KE(e,t,n){let r;if(t==="viewport")r=eW(e,n);else if(t==="document")r=Z9(Cs(e));else if(Ka(t))r=nW(t,n);else{const a=tD(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return kh(r)}function rD(e,t){const n=Vi(e);return n===t||!Ka(n)||vc(n)?!1:Ga(n).position==="fixed"||rD(n,t)}function rW(e,t){const n=t.get(e);if(n)return n;let r=Sd(e,[],!1).filter(c=>Ka(c)&&Jc(c)!=="body"),a=null;const i=Ga(e).position==="fixed";let o=i?Vi(e):e;for(;Ka(o)&&!vc(o);){const c=Ga(o),d=sN(o);!d&&c.position==="fixed"&&(a=null),(i?!d&&!a:!d&&c.position==="static"&&!!a&&tW.has(a.position)||xf(o)&&!d&&rD(e,o))?r=r.filter(h=>h!==o):a=c,o=Vi(o)}return t.set(e,r),r}function aW(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[...n==="clippingAncestors"?Jm(t)?[]:rW(t,this._c):[].concat(n),r],c=o[0],d=o.reduce((f,h)=>{const p=KE(t,h,a);return f.top=ta(p.top,f.top),f.right=Wi(p.right,f.right),f.bottom=Wi(p.bottom,f.bottom),f.left=ta(p.left,f.left),f},KE(t,c,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function sW(e){const{width:t,height:n}=eD(e);return{width:t,height:n}}function iW(e,t,n){const r=js(t),a=Cs(t),i=n==="fixed",o=$o(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const d=ms(0);function f(){d.x=ev(a)}if(r||!r&&!i)if((Jc(t)!=="body"||xf(a))&&(c=Zm(t)),r){const g=$o(t,!0,i,t);d.x=g.x+t.clientLeft,d.y=g.y+t.clientTop}else a&&f();i&&!r&&a&&f();const h=a&&!r&&!i?nD(a,c):ms(0),p=o.left+c.scrollLeft-d.x-h.x,x=o.top+c.scrollTop-d.y-h.y;return{x:p,y:x,width:o.width,height:o.height}}function xy(e){return Ga(e).position==="static"}function GE(e,t){if(!js(e)||Ga(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Cs(e)===n&&(n=n.ownerDocument.body),n}function aD(e,t){const n=sa(e);if(Jm(e))return n;if(!js(e)){let a=Vi(e);for(;a&&!vc(a);){if(Ka(a)&&!xy(a))return a;a=Vi(a)}return n}let r=GE(e,t);for(;r&&U9(r)&&xy(r);)r=GE(r,t);return r&&vc(r)&&xy(r)&&!sN(r)?n:r||K9(e)||n}const oW=async function(e){const t=this.getOffsetParent||aD,n=this.getDimensions,r=await n(e.floating);return{reference:iW(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function lW(e){return Ga(e).direction==="rtl"}const cW={convertOffsetParentRelativeRectToViewportRelativeRect:Q9,getDocumentElement:Cs,getClippingRect:aW,getOffsetParent:aD,getElementRects:oW,getClientRects:J9,getDimensions:sW,getScale:ic,isElement:Ka,isRTL:lW};function sD(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function uW(e,t){let n=null,r;const a=Cs(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:x,height:g}=f;if(c||t(),!x||!g)return;const j=Xp(p),b=Xp(a.clientWidth-(h+x)),y=Xp(a.clientHeight-(p+g)),S=Xp(h),N={rootMargin:-j+"px "+-b+"px "+-y+"px "+-S+"px",threshold:ta(0,Wi(1,d))||1};let E=!0;function _(P){const O=P[0].intersectionRatio;if(O!==d){if(!E)return o();O?o(!1,O):r=setTimeout(()=>{o(!1,1e-7)},1e3)}O===1&&!sD(f,e.getBoundingClientRect())&&o(),E=!1}try{n=new IntersectionObserver(_,{...N,root:a.ownerDocument})}catch{n=new IntersectionObserver(_,N)}n.observe(e)}return o(!0),i}function dW(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=oN(e),h=a||i?[...f?Sd(f):[],...Sd(t)]:[];h.forEach(S=>{a&&S.addEventListener("scroll",n,{passive:!0}),i&&S.addEventListener("resize",n)});const p=f&&c?uW(f,n):null;let x=-1,g=null;o&&(g=new ResizeObserver(S=>{let[C]=S;C&&C.target===f&&g&&(g.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var N;(N=g)==null||N.observe(t)})),n()}),f&&!d&&g.observe(f),g.observe(t));let j,b=d?$o(e):null;d&&y();function y(){const S=$o(e);b&&!sD(b,S)&&n(),b=S,j=requestAnimationFrame(y)}return n(),()=>{var S;h.forEach(C=>{a&&C.removeEventListener("scroll",n),i&&C.removeEventListener("resize",n)}),p?.(),(S=g)==null||S.disconnect(),g=null,d&&cancelAnimationFrame(j)}}const fW=$9,pW=D9,hW=T9,mW=F9,vW=I9,YE=R9,gW=L9,xW=(e,t,n)=>{const r=new Map,a={platform:cW,...n},i={...a.platform,_c:r};return O9(e,t,{...a,platform:i})};var yW=typeof document<"u",bW=function(){},Sh=yW?v.useLayoutEffect:bW;function Oh(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(!Oh(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)&&!Oh(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function iD(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function XE(e,t){const n=iD(e);return Math.round(t*n)/n}function yy(e){const t=v.useRef(e);return Sh(()=>{t.current=e}),t}function wW(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}),[x,g]=v.useState(r);Oh(x,r)||g(r);const[j,b]=v.useState(null),[y,S]=v.useState(null),C=v.useCallback(F=>{F!==P.current&&(P.current=F,b(F))},[]),N=v.useCallback(F=>{F!==O.current&&(O.current=F,S(F))},[]),E=i||j,_=o||y,P=v.useRef(null),O=v.useRef(null),R=v.useRef(h),L=d!=null,T=yy(d),D=yy(a),M=yy(f),G=v.useCallback(()=>{if(!P.current||!O.current)return;const F={placement:t,strategy:n,middleware:x};D.current&&(F.platform=D.current),xW(P.current,O.current,F).then(U=>{const Z={...U,isPositioned:M.current!==!1};B.current&&!Oh(R.current,Z)&&(R.current=Z,Gc.flushSync(()=>{p(Z)}))})},[x,t,n,D,M]);Sh(()=>{f===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p(F=>({...F,isPositioned:!1})))},[f]);const B=v.useRef(!1);Sh(()=>(B.current=!0,()=>{B.current=!1}),[]),Sh(()=>{if(E&&(P.current=E),_&&(O.current=_),E&&_){if(T.current)return T.current(E,_,G);G()}},[E,_,G,T,L]);const W=v.useMemo(()=>({reference:P,floating:O,setReference:C,setFloating:N}),[C,N]),q=v.useMemo(()=>({reference:E,floating:_}),[E,_]),V=v.useMemo(()=>{const F={position:n,left:0,top:0};if(!q.floating)return F;const U=XE(q.floating,h.x),Z=XE(q.floating,h.y);return c?{...F,transform:"translate("+U+"px, "+Z+"px)",...iD(q.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:Z}},[n,c,q.floating,h.x,h.y]);return v.useMemo(()=>({...h,update:G,refs:W,elements:q,floatingStyles:V}),[h,G,W,q,V])}const jW=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?YE({element:r.current,padding:a}).fn(n):{}:r?YE({element:r,padding:a}).fn(n):{}}}},SW=(e,t)=>({...fW(e),options:[e,t]}),NW=(e,t)=>({...pW(e),options:[e,t]}),CW=(e,t)=>({...gW(e),options:[e,t]}),AW=(e,t)=>({...hW(e),options:[e,t]}),_W=(e,t)=>({...mW(e),options:[e,t]}),EW=(e,t)=>({...vW(e),options:[e,t]}),PW=(e,t)=>({...jW(e),options:[e,t]});var kW="Arrow",oD=v.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return s.jsx(Ge.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"})})});oD.displayName=kW;var OW=oD;function tv(e){const[t,n]=v.useState(void 0);return tr(()=>{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 lN="Popper",[lD,Yi]=mr(lN),[RW,cD]=lD(lN),uD=e=>{const{__scopePopper:t,children:n}=e,[r,a]=v.useState(null);return s.jsx(RW,{scope:t,anchor:r,onAnchorChange:a,children:n})};uD.displayName=lN;var dD="PopperAnchor",fD=v.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=cD(dD,n),o=v.useRef(null),c=xt(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(Ge.div,{...a,ref:c})});fD.displayName=dD;var cN="PopperContent",[TW,IW]=lD(cN),pD=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:x=!1,updatePositionStrategy:g="optimized",onPlaced:j,...b}=e,y=cD(cN,n),[S,C]=v.useState(null),N=xt(t,le=>C(le)),[E,_]=v.useState(null),P=tv(E),O=P?.width??0,R=P?.height??0,L=r+(i!=="center"?"-"+i:""),T=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},D=Array.isArray(f)?f:[f],M=D.length>0,G={padding:T,boundary:D.filter($W),altBoundary:M},{refs:B,floatingStyles:W,placement:q,isPositioned:V,middlewareData:F}=wW({strategy:"fixed",placement:L,whileElementsMounted:(...le)=>dW(...le,{animationFrame:g==="always"}),elements:{reference:y.anchor},middleware:[SW({mainAxis:a+R,alignmentAxis:o}),d&&NW({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?CW():void 0,...G}),d&&AW({...G}),_W({...G,apply:({elements:le,rects:me,availableWidth:oe,availableHeight:fe})=>{const{width:Ce,height:ae}=me.reference,Re=le.floating.style;Re.setProperty("--radix-popper-available-width",`${oe}px`),Re.setProperty("--radix-popper-available-height",`${fe}px`),Re.setProperty("--radix-popper-anchor-width",`${Ce}px`),Re.setProperty("--radix-popper-anchor-height",`${ae}px`)}}),E&&PW({element:E,padding:c}),DW({arrowWidth:O,arrowHeight:R}),x&&EW({strategy:"referenceHidden",...G})]}),[U,Z]=vD(q),z=Un(j);tr(()=>{V&&z?.()},[V,z]);const $=F.arrow?.x,te=F.arrow?.y,se=F.arrow?.centerOffset!==0,[Q,ce]=v.useState();return tr(()=>{S&&ce(window.getComputedStyle(S).zIndex)},[S]),s.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:V?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(TW,{scope:n,placedSide:U,onArrowChange:_,arrowX:$,arrowY:te,shouldHideArrow:se,children:s.jsx(Ge.div,{"data-side":U,"data-align":Z,...b,ref:N,style:{...b.style,animation:V?void 0:"none"}})})})});pD.displayName=cN;var hD="PopperArrow",MW={top:"bottom",right:"left",bottom:"top",left:"right"},mD=v.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=IW(hD,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(OW,{...a,ref:n,style:{...a.style,display:"block"}})})});mD.displayName=hD;function $W(e){return e!==null}var DW=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]=vD(n),p={start:"0%",center:"50%",end:"100%"}[h],x=(a.arrow?.x??0)+c/2,g=(a.arrow?.y??0)+d/2;let j="",b="";return f==="bottom"?(j=o?p:`${x}px`,b=`${-d}px`):f==="top"?(j=o?p:`${x}px`,b=`${r.floating.height+d}px`):f==="right"?(j=`${-d}px`,b=o?p:`${g}px`):f==="left"&&(j=`${r.floating.width+d}px`,b=o?p:`${g}px`),{data:{x:j,y:b}}}});function vD(e){const[t,n="center"]=e.split("-");return[t,n]}var nv=uD,yf=fD,rv=pD,av=mD,LW=Symbol("radix.slottable");function FW(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=LW,t}var[sv]=mr("Tooltip",[Yi]),iv=Yi(),gD="TooltipProvider",BW=700,Qj="tooltip.open",[zW,uN]=sv(gD),xD=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(zW,{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})};xD.displayName=gD;var Nd="Tooltip",[UW,ov]=sv(Nd),yD=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:c}=e,d=uN(Nd,e.__scopeTooltip),f=iv(t),[h,p]=v.useState(null),x=er(),g=v.useRef(0),j=o??d.disableHoverableContent,b=c??d.delayDuration,y=v.useRef(!1),[S,C]=la({prop:r,defaultProp:a??!1,onChange:O=>{O?(d.onOpen(),document.dispatchEvent(new CustomEvent(Qj))):d.onClose(),i?.(O)},caller:Nd}),N=v.useMemo(()=>S?y.current?"delayed-open":"instant-open":"closed",[S]),E=v.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,C(!0)},[C]),_=v.useCallback(()=>{window.clearTimeout(g.current),g.current=0,C(!1)},[C]),P=v.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,C(!0),g.current=0},b)},[b,C]);return v.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),s.jsx(nv,{...f,children:s.jsx(UW,{scope:t,contentId:x,open:S,stateAttribute:N,trigger:h,onTriggerChange:p,onTriggerEnter:v.useCallback(()=>{d.isOpenDelayedRef.current?P():E()},[d.isOpenDelayedRef,P,E]),onTriggerLeave:v.useCallback(()=>{j?_():(window.clearTimeout(g.current),g.current=0)},[_,j]),onOpen:E,onClose:_,disableHoverableContent:j,children:n})})};yD.displayName=Nd;var Jj="TooltipTrigger",bD=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=ov(Jj,n),i=uN(Jj,n),o=iv(n),c=v.useRef(null),d=xt(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(yf,{asChild:!0,...o,children:s.jsx(Ge.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:d,onPointerMove:Ie(e.onPointerMove,x=>{x.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),h.current=!0)}),onPointerLeave:Ie(e.onPointerLeave,()=>{a.onTriggerLeave(),h.current=!1}),onPointerDown:Ie(e.onPointerDown,()=>{a.open&&a.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Ie(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:Ie(e.onBlur,a.onClose),onClick:Ie(e.onClick,a.onClose)})})});bD.displayName=Jj;var qW="TooltipPortal",[Gge,WW]=sv(qW,{forceMount:void 0}),gc="TooltipContent",wD=v.forwardRef((e,t)=>{const n=WW(gc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,o=ov(gc,e.__scopeTooltip);return s.jsx(nr,{present:r||o.open,children:o.disableHoverableContent?s.jsx(jD,{side:a,...i,ref:t}):s.jsx(VW,{side:a,...i,ref:t})})}),VW=v.forwardRef((e,t)=>{const n=ov(gc,e.__scopeTooltip),r=uN(gc,e.__scopeTooltip),a=v.useRef(null),i=xt(t,a),[o,c]=v.useState(null),{trigger:d,onClose:f}=n,h=a.current,{onPointerInTransitChange:p}=r,x=v.useCallback(()=>{c(null),p(!1)},[p]),g=v.useCallback((j,b)=>{const y=j.currentTarget,S={x:j.clientX,y:j.clientY},C=XW(S,y.getBoundingClientRect()),N=QW(S,C),E=JW(b.getBoundingClientRect()),_=eV([...N,...E]);c(_),p(!0)},[p]);return v.useEffect(()=>()=>x(),[x]),v.useEffect(()=>{if(d&&h){const j=y=>g(y,h),b=y=>g(y,d);return d.addEventListener("pointerleave",j),h.addEventListener("pointerleave",b),()=>{d.removeEventListener("pointerleave",j),h.removeEventListener("pointerleave",b)}}},[d,h,g,x]),v.useEffect(()=>{if(o){const j=b=>{const y=b.target,S={x:b.clientX,y:b.clientY},C=d?.contains(y)||h?.contains(y),N=!ZW(S,o);C?x():N&&(x(),f())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[d,h,o,f,x]),s.jsx(jD,{...e,ref:i})}),[HW,KW]=sv(Nd,{isInside:!1}),GW=FW("TooltipContent"),jD=v.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...c}=e,d=ov(gc,n),f=iv(n),{onClose:h}=d;return v.useEffect(()=>(document.addEventListener(Qj,h),()=>document.removeEventListener(Qj,h)),[h]),v.useEffect(()=>{if(d.trigger){const p=x=>{x.target?.contains(d.trigger)&&h()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,h]),s.jsx(Zo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:s.jsxs(rv,{"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(GW,{children:r}),s.jsx(HW,{scope:n,isInside:!0,children:s.jsx(S7,{id:d.contentId,role:"tooltip",children:a||r})})]})})});wD.displayName=gc;var SD="TooltipArrow",YW=v.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=iv(n);return KW(SD,n).isInside?null:s.jsx(av,{...a,...r,ref:t})});YW.displayName=SD;function XW(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 QW(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 JW(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 ZW(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,x=d.y;h>r!=x>r&&n<(p-f)*(r-h)/(x-h)+f&&(a=!a)}return a}function eV(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),tV(t)}function tV(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 nV=xD,rV=yD,aV=bD,ND=wD;const dN=nV,fN=rV,pN=aV,lv=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(ND,{ref:r,sideOffset:t,className:je("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}));lv.displayName=ND.displayName;var cv=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(){}},sV={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},iV=class{#e=sV;#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)}},Zj=new iV;function oV(e){setTimeout(e,0)}var uv=typeof window>"u"||"Deno"in globalThis;function za(){}function lV(e,t){return typeof e=="function"?e(t):e}function cV(e){return typeof e=="number"&&e>=0&&e!==1/0}function uV(e,t){return Math.max(e+(t||0)-Date.now(),0)}function e1(e,t){return typeof e=="function"?e(t):e}function dV(e,t){return typeof e=="function"?e(t):e}function QE(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:o,stale:c}=e;if(o){if(r){if(t.queryHash!==hN(o,t.options))return!1}else if(!Ad(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 JE(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Cd(t.options.mutationKey)!==Cd(i))return!1}else if(!Ad(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function hN(e,t){return(t?.queryKeyHashFn||Cd)(e)}function Cd(e){return JSON.stringify(e,(t,n)=>t1(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function Ad(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Ad(e[n],t[n])):!1}var fV=Object.prototype.hasOwnProperty;function CD(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=ZE(e)&&ZE(t);if(!r&&!(t1(e)&&t1(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],x=e[p],g=t[p];if(x===g){d[p]=x,(r?h<i:fV.call(e,p))&&f++;continue}if(x===null||g===null||typeof x!="object"||typeof g!="object"){d[p]=g;continue}const j=CD(x,g,n+1);d[p]=j,j===x&&f++}return i===c&&f===i?e:d}function ZE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function t1(e){if(!eP(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!eP(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function eP(e){return Object.prototype.toString.call(e)==="[object Object]"}function pV(e){return new Promise(t=>{Zj.setTimeout(t,e)})}function hV(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?CD(e,t):t}function mV(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function vV(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var mN=Symbol();function AD(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===mN?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function gV(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 xV=class extends cv{#e;#n;#t;constructor(){super(),this.#t=e=>{if(!uv&&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"}},_D=new xV;function yV(){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 bV=oV;function wV(){let e=[],t=0,n=c=>{c()},r=c=>{c()},a=bV;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 Cr=wV(),jV=class extends cv{#e=!0;#n;#t;constructor(){super(),this.#t=e=>{if(!uv&&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}},Rh=new jV;function SV(e){return Math.min(1e3*2**e,3e4)}function ED(e){return(e??"online")==="online"?Rh.isOnline():!0}var n1=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function PD(e){let t=!1,n=0,r;const a=yV(),i=()=>a.status!=="pending",o=b=>{if(!i()){const y=new n1(b);x(y),e.onCancel?.(y)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>_D.isFocused()&&(e.networkMode==="always"||Rh.isOnline())&&e.canRun(),h=()=>ED(e.networkMode)&&e.canRun(),p=b=>{i()||(r?.(),a.resolve(b))},x=b=>{i()||(r?.(),a.reject(b))},g=()=>new Promise(b=>{r=y=>{(i()||f())&&b(y)},e.onPause?.()}).then(()=>{r=void 0,i()||e.onContinue?.()}),j=()=>{if(i())return;let b;const y=n===0?e.initialPromise:void 0;try{b=y??e.fn()}catch(S){b=Promise.reject(S)}Promise.resolve(b).then(p).catch(S=>{if(i())return;const C=e.retry??(uv?0:3),N=e.retryDelay??SV,E=typeof N=="function"?N(n,S):N,_=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,S);if(t||!_){x(S);return}n++,e.onFail?.(n,S),pV(E).then(()=>f()?void 0:g()).then(()=>{t?x(S):j()})})};return{promise:a,status:()=>a.status,cancel:o,continue:()=>(r?.(),a),cancelRetry:c,continueRetry:d,canStart:h,start:()=>(h()?j():g().then(j),a)}}var kD=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),cV(this.gcTime)&&(this.#e=Zj.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(uv?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Zj.clearTimeout(this.#e),this.#e=void 0)}},NV=class extends kD{#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=nP(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=nP(this.options);t.data!==void 0&&(this.setState(tP(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#t.remove(this)}setData(e,t){const n=hV(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(za).catch(za):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>dV(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===mN||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:!uV(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=AD(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=PD({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:c=>{c instanceof n1&&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 n1){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,...CV(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...tP(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),Cr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#t.notify({query:this,type:"updated",action:e})})}};function CV(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ED(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function tP(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function nP(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 rP(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=>{gV(j,()=>t.signal,()=>h=!0)},x=AD(t.options,t.fetchOptions),g=async(j,b,y)=>{if(h)return Promise.reject();if(b==null&&j.pages.length)return Promise.resolve(j);const C=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:b,direction:y?"backward":"forward",meta:t.options.meta};return p(P),P})(),N=await x(C),{maxPages:E}=t.options,_=y?vV:mV;return{pages:_(j.pages,N,E),pageParams:_(j.pageParams,b,E)}};if(a&&i.length){const j=a==="backward",b=j?AV:aP,y={pages:i,pageParams:o},S=b(r,y);c=await g(y,S,j)}else{const j=e??i.length;do{const b=d===0?o[0]??r.initialPageParam:aP(r,c);if(d>0&&b==null)break;c=await g(c,b),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 aP(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 AV(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var _V=class extends kD{#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||EV(),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=PD({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),Cr.batch(()=>{this.#n.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function EV(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var PV=class extends cv{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 _V({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=Qp(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=Qp(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=Qp(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=Qp(e);return typeof t=="string"?this.#n.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Cr.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=>JE(t,n))}findAll(e={}){return this.getAll().filter(t=>JE(e,t))}notify(e){Cr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Cr.batch(()=>Promise.all(e.map(t=>t.continue().catch(za))))}};function Qp(e){return e.options.scope?.id}var kV=class extends cv{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,a=t.queryHash??hN(r,t);let i=this.get(a);return i||(i=new NV({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(){Cr.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=>QE(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>QE(e,n)):t}notify(e){Cr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Cr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Cr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},OV=class{#e;#n;#t;#a;#r;#i;#o;#s;constructor(e={}){this.#e=e.queryCache||new kV,this.#n=e.mutationCache||new PV,this.#t=e.defaultOptions||{},this.#a=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#o=_D.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Rh.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=lV(t,i);if(o!==void 0)return this.#e.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Cr.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;Cr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Cr.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Cr.batch(()=>this.#e.findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(za).catch(za)}invalidateQueries(e,t={}){return Cr.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=Cr.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(za)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(za)}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(za).catch(za)}fetchInfiniteQuery(e){return e.behavior=rP(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(za).catch(za)}ensureInfiniteQueryData(e){return e.behavior=rP(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Rh.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(Cd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(r=>{Ad(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Cd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Ad(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=hN(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===mN&&(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()}},RV=v.createContext(void 0),TV=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(RV.Provider,{value:e,children:t}));function _d(){return _d=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},_d.apply(this,arguments)}var Fi;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Fi||(Fi={}));const sP="popstate";function IV(e){e===void 0&&(e={});function t(r,a){let{pathname:i,search:o,hash:c}=r.location;return r1("",{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:Th(a)}return $V(t,n,null,e)}function Mn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function vN(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 iP(e,t){return{usr:e.state,key:e.key,idx:t}}function r1(e,t,n,r){return n===void 0&&(n=null),_d({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Zc(t):t,{state:n,key:t&&t.key||r||MV()})}function Th(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 Zc(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 $V(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:i=!1}=r,o=a.history,c=Fi.Pop,d=null,f=h();f==null&&(f=0,o.replaceState(_d({},o.state,{idx:f}),""));function h(){return(o.state||{idx:null}).idx}function p(){c=Fi.Pop;let y=h(),S=y==null?null:y-f;f=y,d&&d({action:c,location:b.location,delta:S})}function x(y,S){c=Fi.Push;let C=r1(b.location,y,S);f=h()+1;let N=iP(C,f),E=b.createHref(C);try{o.pushState(N,"",E)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;a.location.assign(E)}i&&d&&d({action:c,location:b.location,delta:1})}function g(y,S){c=Fi.Replace;let C=r1(b.location,y,S);f=h();let N=iP(C,f),E=b.createHref(C);o.replaceState(N,"",E),i&&d&&d({action:c,location:b.location,delta:0})}function j(y){let S=a.location.origin!=="null"?a.location.origin:a.location.href,C=typeof y=="string"?y:Th(y);return C=C.replace(/ $/,"%20"),Mn(S,"No window.location.(origin|href) available to create URL for href: "+C),new URL(C,S)}let b={get action(){return c},get location(){return e(a,o)},listen(y){if(d)throw new Error("A history only accepts one active listener");return a.addEventListener(sP,p),d=y,()=>{a.removeEventListener(sP,p),d=null}},createHref(y){return t(a,y)},createURL:j,encodeLocation(y){let S=j(y);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:x,replace:g,go(y){return o.go(y)}};return b}var oP;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(oP||(oP={}));function DV(e,t,n){return n===void 0&&(n="/"),LV(e,t,n)}function LV(e,t,n,r){let a=typeof t=="string"?Zc(t):t,i=xc(a.pathname||"/",n);if(i==null)return null;let o=OD(e);FV(o);let c=null;for(let d=0;c==null&&d<o.length;++d){let f=XV(i);c=GV(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("/")&&(Mn(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=zi([r,d.relativePath]),h=n.concat(d);i.children&&i.children.length>0&&(Mn(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:HV(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 RD(i.path))a(i,o,d)}),t}function RD(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=RD(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 FV(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:KV(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const BV=/^:[\w-]+$/,zV=3,UV=2,qV=1,WV=10,VV=-2,lP=e=>e==="*";function HV(e,t){let n=e.split("/"),r=n.length;return n.some(lP)&&(r+=VV),t&&(r+=UV),n.filter(a=>!lP(a)).reduce((a,i)=>a+(BV.test(i)?zV:i===""?qV:WV),r)}function KV(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 GV(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=dn({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},h),x=d.route;if(!p)return null;Object.assign(a,p.params),o.push({params:a,pathname:zi([i,p.pathname]),pathnameBase:tH(zi([i,p.pathnameBase])),route:x}),p.pathnameBase!=="/"&&(i=zi([i,p.pathnameBase]))}return o}function dn(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=YV(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:x,isOptional:g}=h;if(x==="*"){let b=c[p]||"";o=i.slice(0,i.length-b.length).replace(/(.)\/+$/,"$1")}const j=c[p];return g&&!j?f[x]=void 0:f[x]=(j||"").replace(/%2F/g,"/"),f},{}),pathname:i,pathnameBase:o,pattern:e}}function YV(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),vN(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 XV(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return vN(!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 xc(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 QV=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,JV=e=>QV.test(e);function ZV(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Zc(e):e,i;if(n)if(JV(n))i=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),vN(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=cP(n.substring(1),"/"):i=cP(n,t)}else i=t;return{pathname:i,search:nH(r),hash:rH(a)}}function cP(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 by(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 eH(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function gN(e,t){let n=eH(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function xN(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=Zc(e):(a=_d({},e),Mn(!a.pathname||!a.pathname.includes("?"),by("?","pathname","search",a)),Mn(!a.pathname||!a.pathname.includes("#"),by("#","pathname","hash",a)),Mn(!a.search||!a.search.includes("#"),by("#","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 x=o.split("/");for(;x[0]==="..";)x.shift(),p-=1;a.pathname=x.join("/")}c=p>=0?t[p]:"/"}let d=ZV(a,c),f=o&&o!=="/"&&o.endsWith("/"),h=(i||o===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||h)&&(d.pathname+="/"),d}const zi=e=>e.join("/").replace(/\/\/+/g,"/"),tH=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),nH=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,rH=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function aH(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const TD=["post","put","patch","delete"];new Set(TD);const sH=["get",...TD];new Set(sH);function Ed(){return Ed=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},Ed.apply(this,arguments)}const dv=v.createContext(null),ID=v.createContext(null),si=v.createContext(null),fv=v.createContext(null),As=v.createContext({outlet:null,matches:[],isDataRoute:!1}),MD=v.createContext(null);function iH(e,t){let{relative:n}=t===void 0?{}:t;eu()||Mn(!1);let{basename:r,navigator:a}=v.useContext(si),{hash:i,pathname:o,search:c}=pv(e,{relative:n}),d=o;return r!=="/"&&(d=o==="/"?r:zi([r,o])),a.createHref({pathname:d,search:c,hash:i})}function eu(){return v.useContext(fv)!=null}function _s(){return eu()||Mn(!1),v.useContext(fv).location}function $D(e){v.useContext(si).static||v.useLayoutEffect(e)}function Pa(){let{isDataRoute:e}=v.useContext(As);return e?wH():oH()}function oH(){eu()||Mn(!1);let e=v.useContext(dv),{basename:t,future:n,navigator:r}=v.useContext(si),{matches:a}=v.useContext(As),{pathname:i}=_s(),o=JSON.stringify(gN(a,n.v7_relativeSplatPath)),c=v.useRef(!1);return $D(()=>{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=xN(f,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:zi([t,p.pathname])),(h.replace?r.replace:r.push)(p,h.state,h)},[t,r,o,i,e])}const lH=v.createContext(null);function cH(e){let t=v.useContext(As).outlet;return t&&v.createElement(lH.Provider,{value:e},t)}function tl(){let{matches:e}=v.useContext(As),t=e[e.length-1];return t?t.params:{}}function pv(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=v.useContext(si),{matches:a}=v.useContext(As),{pathname:i}=_s(),o=JSON.stringify(gN(a,r.v7_relativeSplatPath));return v.useMemo(()=>xN(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function uH(e,t){return dH(e,t)}function dH(e,t,n,r){eu()||Mn(!1);let{navigator:a}=v.useContext(si),{matches:i}=v.useContext(As),o=i[i.length-1],c=o?o.params:{};o&&o.pathname;let d=o?o.pathnameBase:"/";o&&o.route;let f=_s(),h;if(t){var p;let y=typeof t=="string"?Zc(t):t;d==="/"||(p=y.pathname)!=null&&p.startsWith(d)||Mn(!1),h=y}else h=f;let x=h.pathname||"/",g=x;if(d!=="/"){let y=d.replace(/^\//,"").split("/");g="/"+x.replace(/^\//,"").split("/").slice(y.length).join("/")}let j=DV(e,{pathname:g}),b=vH(j&&j.map(y=>Object.assign({},y,{params:Object.assign({},c,y.params),pathname:zi([d,a.encodeLocation?a.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?d:zi([d,a.encodeLocation?a.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),i,n,r);return t&&b?v.createElement(fv.Provider,{value:{location:Ed({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Fi.Pop}},b):b}function fH(){let e=bH(),t=aH(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 pH=v.createElement(fH,null);class hH 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(As.Provider,{value:this.props.routeContext},v.createElement(MD.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function mH(e){let{routeContext:t,match:n,children:r}=e,a=v.useContext(dv);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(As.Provider,{value:t},r)}function vH(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||Mn(!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:x,errors:g}=n,j=p.route.loader&&x[p.route.id]===void 0&&(!g||g[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,x)=>{let g,j=!1,b=null,y=null;n&&(g=c&&p.route.id?c[p.route.id]:void 0,b=p.route.errorElement||pH,d&&(f<0&&x===0?(jH("route-fallback"),j=!0,y=null):f===x&&(j=!0,y=p.route.hydrateFallbackElement||null)));let S=t.concat(o.slice(0,x+1)),C=()=>{let N;return g?N=b:j?N=y:p.route.Component?N=v.createElement(p.route.Component,null):p.route.element?N=p.route.element:N=h,v.createElement(mH,{match:p,routeContext:{outlet:h,matches:S,isDataRoute:n!=null},children:N})};return n&&(p.route.ErrorBoundary||p.route.errorElement||x===0)?v.createElement(hH,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:C(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):C()},null)}var DD=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(DD||{}),LD=(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})(LD||{});function gH(e){let t=v.useContext(dv);return t||Mn(!1),t}function xH(e){let t=v.useContext(ID);return t||Mn(!1),t}function yH(e){let t=v.useContext(As);return t||Mn(!1),t}function FD(e){let t=yH(),n=t.matches[t.matches.length-1];return n.route.id||Mn(!1),n.route.id}function bH(){var e;let t=v.useContext(MD),n=xH(),r=FD();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function wH(){let{router:e}=gH(DD.UseNavigateStable),t=FD(LD.UseNavigateStable),n=v.useRef(!1);return $D(()=>{n.current=!0}),v.useCallback(function(a,i){i===void 0&&(i={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,Ed({fromRouteId:t},i)))},[e,t])}const uP={};function jH(e,t,n){uP[e]||(uP[e]=!0)}function SH(e,t){e?.v7_startTransition,e?.v7_relativeSplatPath}function BD(e){let{to:t,replace:n,state:r,relative:a}=e;eu()||Mn(!1);let{future:i,static:o}=v.useContext(si),{matches:c}=v.useContext(As),{pathname:d}=_s(),f=Pa(),h=xN(t,gN(c,i.v7_relativeSplatPath),d,a==="path"),p=JSON.stringify(h);return v.useEffect(()=>f(JSON.parse(p),{replace:n,state:r,relative:a}),[f,p,a,n,r]),null}function dP(e){return cH(e.context)}function un(e){Mn(!1)}function NH(e){let{basename:t="/",children:n=null,location:r,navigationType:a=Fi.Pop,navigator:i,static:o=!1,future:c}=e;eu()&&Mn(!1);let d=t.replace(/^\/*/,"/"),f=v.useMemo(()=>({basename:d,navigator:i,static:o,future:Ed({v7_relativeSplatPath:!1},c)}),[d,c,i,o]);typeof r=="string"&&(r=Zc(r));let{pathname:h="/",search:p="",hash:x="",state:g=null,key:j="default"}=r,b=v.useMemo(()=>{let y=xc(h,d);return y==null?null:{location:{pathname:y,search:p,hash:x,state:g,key:j},navigationType:a}},[d,h,p,x,g,j,a]);return b==null?null:v.createElement(si.Provider,{value:f},v.createElement(fv.Provider,{children:n,value:b}))}function CH(e){let{children:t,location:n}=e;return uH(a1(t),n)}new Promise(()=>{});function a1(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,a1(r.props.children,i));return}r.type!==un&&Mn(!1),!r.props.index||!r.props.children||Mn(!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=a1(r.props.children,i)),n.push(o)}),n}function Ih(){return Ih=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},Ih.apply(this,arguments)}function zD(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 AH(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function _H(e,t){return e.button===0&&(!t||t==="_self")&&!AH(e)}function s1(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 EH(e,t){let n=s1(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}const PH=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],kH=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],OH="6";try{window.__reactRouterVersion=OH}catch{}const RH=v.createContext({isTransitioning:!1}),TH="startTransition",fP=Hm[TH];function IH(e){let{basename:t,children:n,future:r,window:a}=e,i=v.useRef();i.current==null&&(i.current=IV({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&&fP?fP(()=>d(p)):d(p)},[d,f]);return v.useLayoutEffect(()=>o.listen(h),[o,h]),v.useEffect(()=>SH(r),[r]),v.createElement(NH,{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",$H=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wt=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,x=zD(t,PH),{basename:g}=v.useContext(si),j,b=!1;if(typeof f=="string"&&$H.test(f)&&(j=f,MH))try{let N=new URL(window.location.href),E=f.startsWith("//")?new URL(N.protocol+f):new URL(f),_=xc(E.pathname,g);E.origin===N.origin&&_!=null?f=_+E.search+E.hash:b=!0}catch{}let y=iH(f,{relative:a}),S=FH(f,{replace:o,state:c,target:d,preventScrollReset:h,relative:a,viewTransition:p});function C(N){r&&r(N),N.defaultPrevented||S(N)}return v.createElement("a",Ih({},x,{href:j||y,onClick:b||i?r:C,ref:n,target:d}))}),DH=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=zD(t,kH),x=pv(d,{relative:p.relative}),g=_s(),j=v.useContext(ID),{navigator:b,basename:y}=v.useContext(si),S=j!=null&&BH(x)&&f===!0,C=b.encodeLocation?b.encodeLocation(x).pathname:x.pathname,N=g.pathname,E=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;a||(N=N.toLowerCase(),E=E?E.toLowerCase():null,C=C.toLowerCase()),E&&y&&(E=xc(E,y)||E);const _=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let P=N===C||!o&&N.startsWith(C)&&N.charAt(_)==="/",O=E!=null&&(E===C||!o&&E.startsWith(C)&&E.charAt(C.length)==="/"),R={isActive:P,isPending:O,isTransitioning:S},L=P?r:void 0,T;typeof i=="function"?T=i(R):T=[i,P?"active":null,O?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let D=typeof c=="function"?c(R):c;return v.createElement(wt,Ih({},p,{"aria-current":L,className:T,ref:n,style:D,to:d,viewTransition:f}),typeof h=="function"?h(R):h)});var i1;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(i1||(i1={}));var pP;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(pP||(pP={}));function LH(e){let t=v.useContext(dv);return t||Mn(!1),t}function FH(e,t){let{target:n,replace:r,state:a,preventScrollReset:i,relative:o,viewTransition:c}=t===void 0?{}:t,d=Pa(),f=_s(),h=pv(e,{relative:o});return v.useCallback(p=>{if(_H(p,n)){p.preventDefault();let x=r!==void 0?r:Th(f)===Th(h);d(e,{replace:x,state:a,preventScrollReset:i,relative:o,viewTransition:c})}},[f,d,h,r,a,n,e,i,o,c])}function Xi(e){let t=v.useRef(s1(e)),n=v.useRef(!1),r=_s(),a=v.useMemo(()=>EH(r.search,n.current?null:t.current),[r.search]),i=Pa(),o=v.useCallback((c,d)=>{const f=s1(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(RH);n==null&&Mn(!1);let{basename:r}=LH(i1.useViewTransitionState),a=pv(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=xc(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=xc(n.nextLocation.pathname,r)||n.nextLocation.pathname;return dn(a.pathname,o)!=null||dn(a.pathname,i)!=null}var zH=Symbol.for("react.lazy"),Mh=Hm[" use ".trim().toString()];function UH(e){return typeof e=="object"&&e!==null&&"then"in e}function UD(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===zH&&"_payload"in e&&UH(e._payload)}function hv(e){const t=qH(e),n=v.forwardRef((r,a)=>{let{children:i,...o}=r;UD(i)&&typeof Mh=="function"&&(i=Mh(i._payload));const c=v.Children.toArray(i),d=c.find(VH);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 Qi=hv("Slot");function qH(e){const t=v.forwardRef((n,r)=>{let{children:a,...i}=n;if(UD(a)&&typeof Mh=="function"&&(a=Mh(a._payload)),v.isValidElement(a)){const o=KH(a),c=HH(i,a.props);return a.type!==v.Fragment&&(c.ref=r?kr(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 WH=Symbol("radix.slottable");function VH(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===WH}function HH(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 KH(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 wy=768;function GH(){const[e,t]=v.useState(void 0);return v.useEffect(()=>{const n=window.matchMedia(`(max-width: ${wy-1}px)`),r=()=>{t(window.innerWidth<wy)};return n.addEventListener("change",r),t(window.innerWidth<wy),()=>n.removeEventListener("change",r)},[]),!!e}const yN=el("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"}}),re=v.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const o=r?Qi:"button";return s.jsx(o,{className:je(yN({variant:t,size:n,className:e})),ref:i,...a})});re.displayName="Button";const ht=v.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{type:t,className:je("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}));ht.displayName="Input";var YH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],XH=YH.reduce((e,t)=>{const n=hv(`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}},{}),QH="Separator",hP="horizontal",JH=["horizontal","vertical"],qD=v.forwardRef((e,t)=>{const{decorative:n,orientation:r=hP,...a}=e,i=ZH(r)?r:hP,c=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return s.jsx(XH.div,{"data-orientation":i,...c,...a,ref:t})});qD.displayName=QH;function ZH(e){return JH.includes(e)}var WD=qD;const VD=v.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>s.jsx(WD,{ref:a,decorative:n,orientation:t,className:je("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));VD.displayName=WD.displayName;var jy="focusScope.autoFocusOnMount",Sy="focusScope.autoFocusOnUnmount",mP={bubbles:!1,cancelable:!0},eK="FocusScope",bf=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[c,d]=v.useState(null),f=Un(a),h=Un(i),p=v.useRef(null),x=xt(t,b=>d(b)),g=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let b=function(N){if(g.paused||!c)return;const E=N.target;c.contains(E)?p.current=E:Mi(p.current,{select:!0})},y=function(N){if(g.paused||!c)return;const E=N.relatedTarget;E!==null&&(c.contains(E)||Mi(p.current,{select:!0}))},S=function(N){if(document.activeElement===document.body)for(const _ of N)_.removedNodes.length>0&&Mi(c)};document.addEventListener("focusin",b),document.addEventListener("focusout",y);const C=new MutationObserver(S);return c&&C.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",y),C.disconnect()}}},[r,c,g.paused]),v.useEffect(()=>{if(c){gP.add(g);const b=document.activeElement;if(!c.contains(b)){const S=new CustomEvent(jy,mP);c.addEventListener(jy,f),c.dispatchEvent(S),S.defaultPrevented||(tK(iK(HD(c)),{select:!0}),document.activeElement===b&&Mi(c))}return()=>{c.removeEventListener(jy,f),setTimeout(()=>{const S=new CustomEvent(Sy,mP);c.addEventListener(Sy,h),c.dispatchEvent(S),S.defaultPrevented||Mi(b??document.body,{select:!0}),c.removeEventListener(Sy,h),gP.remove(g)},0)}}},[c,f,h,g]);const j=v.useCallback(b=>{if(!n&&!r||g.paused)return;const y=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,S=document.activeElement;if(y&&S){const C=b.currentTarget,[N,E]=nK(C);N&&E?!b.shiftKey&&S===E?(b.preventDefault(),n&&Mi(N,{select:!0})):b.shiftKey&&S===N&&(b.preventDefault(),n&&Mi(E,{select:!0})):S===C&&b.preventDefault()}},[n,r,g.paused]);return s.jsx(Ge.div,{tabIndex:-1,...o,ref:x,onKeyDown:j})});bf.displayName=eK;function tK(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Mi(r,{select:t}),document.activeElement!==n)return}function nK(e){const t=HD(e),n=vP(t,e),r=vP(t.reverse(),e);return[n,r]}function HD(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 vP(e,t){for(const n of e)if(!rK(n,{upTo:t}))return n}function rK(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 aK(e){return e instanceof HTMLInputElement&&"select"in e}function Mi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&aK(e)&&t&&e.select()}}var gP=sK();function sK(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=xP(e,t),e.unshift(t)},remove(t){e=xP(e,t),e[0]?.resume()}}}function xP(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function iK(e){return e.filter(t=>t.tagName!=="A")}var Ny=0;function mv(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??yP()),document.body.insertAdjacentElement("beforeend",e[1]??yP()),Ny++,()=>{Ny===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ny--}},[])}function yP(){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 ds=function(){return ds=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},ds.apply(this,arguments)};function KD(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 oK(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 Nh="right-scroll-bar-position",Ch="width-before-scroll-bar",lK="with-scroll-bars-hidden",cK="--removed-body-scroll-bar-size";function Cy(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function uK(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 dK=typeof window<"u"?v.useLayoutEffect:v.useEffect,bP=new WeakMap;function fK(e,t){var n=uK(null,function(r){return e.forEach(function(a){return Cy(a,r)})});return dK(function(){var r=bP.get(n);if(r){var a=new Set(r),i=new Set(e),o=n.current;a.forEach(function(c){i.has(c)||Cy(c,null)}),i.forEach(function(c){a.has(c)||Cy(c,o)})}bP.set(n,e)},[e]),n}function pK(e){return e}function hK(e,t){t===void 0&&(t=pK);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 mK(e){e===void 0&&(e={});var t=hK(null);return t.options=ds({async:!0,ssr:!1},e),t}var GD=function(e){var t=e.sideCar,n=KD(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,ds({},n))};GD.isSideCarExport=!0;function vK(e,t){return e.useMedium(t),GD}var YD=mK(),Ay=function(){},vv=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:Ay,onWheelCapture:Ay,onTouchMoveCapture:Ay}),a=r[0],i=r[1],o=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,h=e.enabled,p=e.shards,x=e.sideCar,g=e.noRelative,j=e.noIsolation,b=e.inert,y=e.allowPinchZoom,S=e.as,C=S===void 0?"div":S,N=e.gapMode,E=KD(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=x,P=fK([n,t]),O=ds(ds({},E),a);return v.createElement(v.Fragment,null,h&&v.createElement(_,{sideCar:YD,removeScrollBar:f,shards:p,noRelative:g,noIsolation:j,inert:b,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:N}),o?v.cloneElement(v.Children.only(c),ds(ds({},O),{ref:P})):v.createElement(C,ds({},O,{className:d,ref:P}),c))});vv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};vv.classNames={fullWidth:Ch,zeroRight:Nh};var gK=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function xK(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=gK();return t&&e.setAttribute("nonce",t),e}function yK(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function bK(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var wK=function(){var e=0,t=null;return{add:function(n){e==0&&(t=xK())&&(yK(t,n),bK(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},jK=function(){var e=wK();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},XD=function(){var e=jK(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},SK={left:0,top:0,right:0,gap:0},_y=function(e){return parseInt(e||"",10)||0},NK=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[_y(n),_y(r),_y(a)]},CK=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return SK;var t=NK(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])}},AK=XD(),oc="data-scroll-locked",_K=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(lK,` {
11
- overflow: hidden `).concat(r,`;
12
- padding-right: `).concat(c,"px ").concat(r,`;
13
- }
14
- body[`).concat(oc,`] {
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(Nh,` {
28
- right: `).concat(c,"px ").concat(r,`;
29
- }
30
-
31
- .`).concat(Ch,` {
32
- margin-right: `).concat(c,"px ").concat(r,`;
33
- }
34
-
35
- .`).concat(Nh," .").concat(Nh,` {
36
- right: 0 `).concat(r,`;
37
- }
38
-
39
- .`).concat(Ch," .").concat(Ch,` {
40
- margin-right: 0 `).concat(r,`;
41
- }
42
-
43
- body[`).concat(oc,`] {
44
- `).concat(cK,": ").concat(c,`px;
45
- }
46
- `)},wP=function(){var e=parseInt(document.body.getAttribute(oc)||"0",10);return isFinite(e)?e:0},EK=function(){v.useEffect(function(){return document.body.setAttribute(oc,(wP()+1).toString()),function(){var e=wP()-1;e<=0?document.body.removeAttribute(oc):document.body.setAttribute(oc,e.toString())}},[])},PK=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;EK();var i=v.useMemo(function(){return CK(a)},[a]);return v.createElement(AK,{styles:_K(i,!t,a,n?"":"!important")})},o1=!1;if(typeof window<"u")try{var Jp=Object.defineProperty({},"passive",{get:function(){return o1=!0,!0}});window.addEventListener("test",Jp,Jp),window.removeEventListener("test",Jp,Jp)}catch{o1=!1}var Ll=o1?{passive:!1}:!1,kK=function(e){return e.tagName==="TEXTAREA"},QD=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!kK(e)&&n[t]==="visible")},OK=function(e){return QD(e,"overflowY")},RK=function(e){return QD(e,"overflowX")},jP=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=JD(e,r);if(a){var i=ZD(e,r),o=i[1],c=i[2];if(o>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},TK=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},IK=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},JD=function(e,t){return e==="v"?OK(t):RK(t)},ZD=function(e,t){return e==="v"?TK(t):IK(t)},MK=function(e,t){return e==="h"&&t==="rtl"?-1:1},$K=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,x=0;do{if(!c)break;var g=ZD(e,c),j=g[0],b=g[1],y=g[2],S=b-y-i*j;(j||S)&&JD(e,c)&&(p+=S,x+=j);var C=c.parentNode;c=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(h&&Math.abs(p)<1||!h&&Math.abs(x)<1)&&(f=!0),f},Zp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},SP=function(e){return[e.deltaX,e.deltaY]},NP=function(e){return e&&"current"in e?e.current:e},DK=function(e,t){return e[0]===t[0]&&e[1]===t[1]},LK=function(e){return`
47
- .block-interactivity-`.concat(e,` {pointer-events: none;}
48
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
49
- `)},FK=0,Fl=[];function BK(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),a=v.useState(FK++)[0],i=v.useState(XD)[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 b=oK([e.lockRef.current],(e.shards||[]).map(NP),!0).filter(Boolean);return b.forEach(function(y){return y.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),b.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var c=v.useCallback(function(b,y){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!o.current.allowPinchZoom;var S=Zp(b),C=n.current,N="deltaX"in b?b.deltaX:C[0]-S[0],E="deltaY"in b?b.deltaY:C[1]-S[1],_,P=b.target,O=Math.abs(N)>Math.abs(E)?"h":"v";if("touches"in b&&O==="h"&&P.type==="range")return!1;var R=window.getSelection(),L=R&&R.anchorNode,T=L?L===P||L.contains(P):!1;if(T)return!1;var D=jP(O,P);if(!D)return!0;if(D?_=O:(_=O==="v"?"h":"v",D=jP(O,P)),!D)return!1;if(!r.current&&"changedTouches"in b&&(N||E)&&(r.current=_),!_)return!0;var M=r.current||_;return $K(M,y,b,M==="h"?N:E)},[]),d=v.useCallback(function(b){var y=b;if(!(!Fl.length||Fl[Fl.length-1]!==i)){var S="deltaY"in y?SP(y):Zp(y),C=t.current.filter(function(_){return _.name===y.type&&(_.target===y.target||y.target===_.shadowParent)&&DK(_.delta,S)})[0];if(C&&C.should){y.cancelable&&y.preventDefault();return}if(!C){var N=(o.current.shards||[]).map(NP).filter(Boolean).filter(function(_){return _.contains(y.target)}),E=N.length>0?c(y,N[0]):!o.current.noIsolation;E&&y.cancelable&&y.preventDefault()}}},[]),f=v.useCallback(function(b,y,S,C){var N={name:b,delta:y,target:S,should:C,shadowParent:zK(S)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(E){return E!==N})},1)},[]),h=v.useCallback(function(b){n.current=Zp(b),r.current=void 0},[]),p=v.useCallback(function(b){f(b.type,SP(b),b.target,c(b,e.lockRef.current))},[]),x=v.useCallback(function(b){f(b.type,Zp(b),b.target,c(b,e.lockRef.current))},[]);v.useEffect(function(){return Fl.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:x}),document.addEventListener("wheel",d,Ll),document.addEventListener("touchmove",d,Ll),document.addEventListener("touchstart",h,Ll),function(){Fl=Fl.filter(function(b){return b!==i}),document.removeEventListener("wheel",d,Ll),document.removeEventListener("touchmove",d,Ll),document.removeEventListener("touchstart",h,Ll)}},[]);var g=e.removeScrollBar,j=e.inert;return v.createElement(v.Fragment,null,j?v.createElement(i,{styles:LK(a)}):null,g?v.createElement(PK,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function zK(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const UK=vK(YD,BK);var wf=v.forwardRef(function(e,t){return v.createElement(vv,ds({},e,{ref:t,sideCar:UK}))});wf.classNames=vv.classNames;var qK=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Bl=new WeakMap,eh=new WeakMap,th={},Ey=0,e3=function(e){return e&&(e.host||e3(e.parentNode))},WK=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=e3(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})},VK=function(e,t,n,r){var a=WK(t,Array.isArray(e)?e:[e]);th[n]||(th[n]=new WeakMap);var i=th[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(x){if(c.has(x))h(x);else try{var g=x.getAttribute(r),j=g!==null&&g!=="false",b=(Bl.get(x)||0)+1,y=(i.get(x)||0)+1;Bl.set(x,b),i.set(x,y),o.push(x),b===1&&j&&eh.set(x,!0),y===1&&x.setAttribute(n,"true"),j||x.setAttribute(r,"true")}catch(S){console.error("aria-hidden: cannot operate on ",x,S)}})};return h(t),c.clear(),Ey++,function(){o.forEach(function(p){var x=Bl.get(p)-1,g=i.get(p)-1;Bl.set(p,x),i.set(p,g),x||(eh.has(p)||p.removeAttribute(r),eh.delete(p)),g||p.removeAttribute(n)}),Ey--,Ey||(Bl=new WeakMap,Bl=new WeakMap,eh=new WeakMap,th={})}},gv=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=qK(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),VK(r,a,n,"aria-hidden")):function(){return null}};function HK(e){const t=KK(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(YK);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 KK(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=QK(a),c=XK(i,a.props);return a.type!==v.Fragment&&(c.ref=r?kr(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 GK=Symbol("radix.slottable");function YK(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===GK}function XK(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 QK(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 xv="Dialog",[t3,n3]=mr(xv),[JK,Ya]=t3(xv),r3=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]=la({prop:r,defaultProp:a??!1,onChange:i,caller:xv});return s.jsx(JK,{scope:t,triggerRef:c,contentRef:d,contentId:er(),titleId:er(),descriptionId:er(),open:f,onOpenChange:h,onOpenToggle:v.useCallback(()=>h(p=>!p),[h]),modal:o,children:n})};r3.displayName=xv;var a3="DialogTrigger",s3=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ya(a3,n),i=xt(t,a.triggerRef);return s.jsx(Ge.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":jN(a.open),...r,ref:i,onClick:Ie(e.onClick,a.onOpenToggle)})});s3.displayName=a3;var bN="DialogPortal",[ZK,i3]=t3(bN,{forceMount:void 0}),o3=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=Ya(bN,t);return s.jsx(ZK,{scope:t,forceMount:n,children:v.Children.map(r,o=>s.jsx(nr,{present:n||i.open,children:s.jsx(Yc,{asChild:!0,container:a,children:o})}))})};o3.displayName=bN;var $h="DialogOverlay",l3=v.forwardRef((e,t)=>{const n=i3($h,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Ya($h,e.__scopeDialog);return i.modal?s.jsx(nr,{present:r||i.open,children:s.jsx(tG,{...a,ref:t})}):null});l3.displayName=$h;var eG=HK("DialogOverlay.RemoveScroll"),tG=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ya($h,n);return s.jsx(wf,{as:eG,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(Ge.div,{"data-state":jN(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Do="DialogContent",c3=v.forwardRef((e,t)=>{const n=i3(Do,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=Ya(Do,e.__scopeDialog);return s.jsx(nr,{present:r||i.open,children:i.modal?s.jsx(nG,{...a,ref:t}):s.jsx(rG,{...a,ref:t})})});c3.displayName=Do;var nG=v.forwardRef((e,t)=>{const n=Ya(Do,e.__scopeDialog),r=v.useRef(null),a=xt(t,n.contentRef,r);return v.useEffect(()=>{const i=r.current;if(i)return gv(i)},[]),s.jsx(u3,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ie(e.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Ie(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0;(o.button===2||c)&&i.preventDefault()}),onFocusOutside:Ie(e.onFocusOutside,i=>i.preventDefault())})}),rG=v.forwardRef((e,t)=>{const n=Ya(Do,e.__scopeDialog),r=v.useRef(!1),a=v.useRef(!1);return s.jsx(u3,{...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()}})}),u3=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,c=Ya(Do,n),d=v.useRef(null),f=xt(t,d);return mv(),s.jsxs(s.Fragment,{children:[s.jsx(bf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Zo,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":jN(c.open),...o,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(sG,{titleId:c.titleId}),s.jsx(oG,{contentRef:d,descriptionId:c.descriptionId})]})]})}),wN="DialogTitle",d3=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ya(wN,n);return s.jsx(Ge.h2,{id:a.titleId,...r,ref:t})});d3.displayName=wN;var f3="DialogDescription",p3=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ya(f3,n);return s.jsx(Ge.p,{id:a.descriptionId,...r,ref:t})});p3.displayName=f3;var h3="DialogClose",m3=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=Ya(h3,n);return s.jsx(Ge.button,{type:"button",...r,ref:t,onClick:Ie(e.onClick,()=>a.onOpenChange(!1))})});m3.displayName=h3;function jN(e){return e?"open":"closed"}var v3="DialogTitleWarning",[aG,g3]=HU(v3,{contentName:Do,titleName:wN,docsSlug:"dialog"}),sG=({titleId:e})=>{const t=g3(v3),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},iG="DialogDescriptionWarning",oG=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${g3(iG).contentName}}.`;return v.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},yv=r3,lG=s3,bv=o3,tu=l3,nu=c3,jf=d3,Sf=p3,wv=m3;const x3=yv,cG=bv,y3=v.forwardRef(({className:e,...t},n)=>s.jsx(tu,{className:je("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}));y3.displayName=tu.displayName;const uG=el("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"}}),SN=v.forwardRef(({side:e="right",className:t,children:n,...r},a)=>s.jsxs(cG,{children:[s.jsx(y3,{}),s.jsxs(nu,{ref:a,className:je(uG({side:e}),t),...r,children:[n,s.jsxs(wv,{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(ws,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));SN.displayName=nu.displayName;const b3=({className:e,...t})=>s.jsx("div",{className:je("flex flex-col space-y-2 text-center sm:text-left",e),...t});b3.displayName="SheetHeader";const w3=v.forwardRef(({className:e,...t},n)=>s.jsx(jf,{ref:n,className:je("text-lg font-semibold text-foreground",e),...t}));w3.displayName=jf.displayName;const dG=v.forwardRef(({className:e,...t},n)=>s.jsx(Sf,{ref:n,className:je("text-sm text-muted-foreground",e),...t}));dG.displayName=Sf.displayName;function CP({className:e,...t}){return s.jsx("div",{className:je("animate-pulse rounded-md bg-muted",e),...t})}const fG="sidebar:state",pG=3600*24*7,hG="16rem",mG="18rem",vG="3rem",gG="b",j3=v.createContext(null);function Nf(){const e=v.useContext(j3);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const S3=v.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:i,...o},c)=>{const d=GH(),[f,h]=v.useState(!1),[p,x]=v.useState(e),g=t??p,j=v.useCallback(C=>{const N=typeof C=="function"?C(g):C;n?n(N):x(N),document.cookie=`${fG}=${N}; path=/; max-age=${pG}`},[n,g]),b=v.useCallback(()=>d?h(C=>!C):j(C=>!C),[d,j,h]);v.useEffect(()=>{const C=N=>{N.key===gG&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),b())};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[b]);const y=g?"expanded":"collapsed",S=v.useMemo(()=>({state:y,open:g,setOpen:j,isMobile:d,openMobile:f,setOpenMobile:h,toggleSidebar:b}),[y,g,j,d,f,h,b]);return s.jsx(j3.Provider,{value:S,children:s.jsx(dN,{delayDuration:0,children:s.jsx("div",{style:{"--sidebar-width":hG,"--sidebar-width-icon":vG,...a},className:je("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:c,...o,children:i})})})});S3.displayName="SidebarProvider";const N3=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}=Nf();return n==="none"?s.jsx("div",{className:je("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:o,...i,children:a}):c?s.jsx(x3,{open:f,onOpenChange:h,...i,children:s.jsx(SN,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":mG},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:je("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:je("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})})]})});N3.displayName="Sidebar";const C3=v.forwardRef(({className:e,onClick:t,...n},r)=>{const{toggleSidebar:a}=Nf();return s.jsxs(re,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:je("h-7 w-7",e),onClick:i=>{t?.(i),a()},...n,children:[s.jsx(Z7,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});C3.displayName="SidebarTrigger";const xG=v.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=Nf();return s.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:je("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})});xG.displayName="SidebarRail";const yG=v.forwardRef(({className:e,...t},n)=>s.jsx("main",{ref:n,className:je("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}));yG.displayName="SidebarInset";const bG=v.forwardRef(({className:e,...t},n)=>s.jsx(ht,{ref:n,"data-sidebar":"input",className:je("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));bG.displayName="SidebarInput";const A3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"header",className:je("flex flex-col gap-2 p-2",e),...t}));A3.displayName="SidebarHeader";const _3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"footer",className:je("flex flex-col gap-2 p-2",e),...t}));_3.displayName="SidebarFooter";const l1=v.forwardRef(({className:e,...t},n)=>s.jsx(VD,{ref:n,"data-sidebar":"separator",className:je("mx-2 w-auto bg-sidebar-border",e),...t}));l1.displayName="SidebarSeparator";const E3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"content",className:je("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));E3.displayName="SidebarContent";const P3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group",className:je("relative flex w-full min-w-0 flex-col p-2",e),...t}));P3.displayName="SidebarGroup";const k3=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?Qi:"div";return s.jsx(a,{ref:r,"data-sidebar":"group-label",className:je("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})});k3.displayName="SidebarGroupLabel";const wG=v.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const a=t?Qi:"button";return s.jsx(a,{ref:r,"data-sidebar":"group-action",className:je("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})});wG.displayName="SidebarGroupAction";const O3=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"group-content",className:je("w-full text-sm",e),...t}));O3.displayName="SidebarGroupContent";const R3=v.forwardRef(({className:e,...t},n)=>s.jsx("ul",{ref:n,"data-sidebar":"menu",className:je("flex w-full min-w-0 flex-col gap-1",e),...t}));R3.displayName="SidebarMenu";const T3=v.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,"data-sidebar":"menu-item",className:je("group/menu-item relative",e),...t}));T3.displayName="SidebarMenuItem";const jG=el("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"}}),I3=v.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:a,className:i,...o},c)=>{const d=e?Qi:"button",{isMobile:f,state:h}=Nf(),p=s.jsx(d,{ref:c,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:je(jG({variant:n,size:r}),i),...o});return a?(typeof a=="string"&&(a={children:a}),s.jsxs(fN,{children:[s.jsx(pN,{asChild:!0,children:p}),s.jsx(lv,{side:"right",align:"center",hidden:h!=="collapsed"||f,...a})]})):p});I3.displayName="SidebarMenuButton";const SG=v.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},a)=>{const i=t?Qi:"button";return s.jsx(i,{ref:a,"data-sidebar":"menu-action",className:je("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})});SG.displayName="SidebarMenuAction";const NG=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:je("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}));NG.displayName="SidebarMenuBadge";const CG=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:je("flex h-8 items-center gap-2 rounded-md px-2",e),...n,children:[t&&s.jsx(CP,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),s.jsx(CP,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})});CG.displayName="SidebarMenuSkeleton";const AG=v.forwardRef(({className:e,...t},n)=>s.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:je("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}));AG.displayName="SidebarMenuSub";const _G=v.forwardRef(({...e},t)=>s.jsx("li",{ref:t,...e}));_G.displayName="SidebarMenuSubItem";const EG=v.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...a},i)=>{const o=e?Qi:"a";return s.jsx(o,{ref:i,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:je("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})});EG.displayName="SidebarMenuSubButton";const M3=v.forwardRef(({className:e,activeClassName:t,pendingClassName:n,to:r,...a},i)=>s.jsx(DH,{ref:i,to:r,className:({isActive:o,isPending:c})=>je(e,o&&t,c&&n),...a}));M3.displayName="NavLink";function PG({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 kG=[{title:"Home",items:[{title:"Dashboard",url:"/",icon:T$}]},{title:"Lab",items:[{title:"MCP Evaluations",url:"/mcp-evaluations",icon:R$},{title:"Analyze MCP",url:"/tool-analysis",icon:I$},{title:"OAuth Debugger",url:"/oauth-debugger",icon:tq}]},{title:"Libraries",items:[{title:"Test Cases",url:"/libraries/test-cases",icon:O$},{title:"Servers",url:"/libraries/servers",icon:k$},{title:"Agents",url:"/libraries/agents",icon:Sa}]},{title:"Execution",items:[{title:"Run Evaluation",url:"/run",icon:Oo},{title:"Evaluation Results",url:"/results",icon:jd},{title:"Compare Evaluations",url:"/compare",icon:QS},{title:"MCP Analysis Results",url:"/tool-analysis-results",icon:M$},{title:"Custom Reports",url:"/markdown-reports",icon:Ql}]},{title:"Workspace",items:[{title:"Settings",url:"/settings",icon:ZS}]}];function OG(e={version:null}){const t=e.version??null,{state:n}=Nf(),r=n==="collapsed",a=_s(),i=v.useMemo(()=>kG,[]);return s.jsxs(N3,{collapsible:"icon",children:[s.jsx(A3,{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(PG,{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(E3,{children:i.map((o,c)=>s.jsxs("div",{children:[c>0&&!r&&s.jsx(l1,{className:"my-1.5"}),s.jsxs(P3,{className:r?"px-2":"px-3 py-2",children:[!r&&s.jsx(k3,{className:"px-1 pb-1.5 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/90",children:o.title}),s.jsx(O3,{children:s.jsx(R3,{children:o.items.map(d=>s.jsx(T3,{children:s.jsx(I3,{asChild:!0,isActive:d.url==="/"?a.pathname==="/":a.pathname.startsWith(d.url),tooltip:d.title,children:s.jsxs(M3,{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(_3,{className:r?"px-2 py-2":"px-3 py-3",children:[s.jsx(l1,{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/mcplab",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(Y7,{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 $3=v.forwardRef(({...e},t)=>s.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));$3.displayName="Breadcrumb";const D3=v.forwardRef(({className:e,...t},n)=>s.jsx("ol",{ref:n,className:je("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));D3.displayName="BreadcrumbList";const L3=v.forwardRef(({className:e,...t},n)=>s.jsx("li",{ref:n,className:je("inline-flex items-center gap-1.5",e),...t}));L3.displayName="BreadcrumbItem";const F3=v.forwardRef(({asChild:e,className:t,...n},r)=>{const a=e?Qi:"a";return s.jsx(a,{ref:r,className:je("transition-colors hover:text-foreground",t),...n})});F3.displayName="BreadcrumbLink";const B3=v.forwardRef(({className:e,...t},n)=>s.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:je("font-normal text-foreground",e),...t}));B3.displayName="BreadcrumbPage";const z3=({children:e,className:t,...n})=>s.jsx("li",{role:"presentation","aria-hidden":"true",className:je("[&>svg]:size-3.5",t),...n,children:e??s.jsx(P$,{})});z3.displayName="BreadcrumbSeparator";function Vs(){return{input:0,output:0,total:0,hasInput:!1,hasOutput:!1,hasTotal:!1}}function Hl(e,t){t&&(typeof t.inputTokens=="number"&&(e.input+=t.inputTokens,e.hasInput=!0),typeof t.outputTokens=="number"&&(e.output+=t.outputTokens,e.hasOutput=!0),typeof t.totalTokens=="number"&&(e.total+=t.totalTokens,e.hasTotal=!0))}function Hs(e){return!e.hasInput&&!e.hasOutput&&!e.hasTotal?null:{inputTokens:e.hasInput?e.input:null,outputTokens:e.hasOutput?e.output:null,totalTokens:e.hasTotal?e.total:null}}function RG(e){const t=Vs();for(const n of e)Hl(t,n);return Hs(t)}function TG(e,t){return`${e}-${t+1}`}function Kl(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 y=String(p.ref||"").trim();if(!y)continue;a.set(y,y),o.push({kind:"referenced",ref:y});continue}const x=String(p.id||p.name||"").trim();if(!x)continue;const g=x;a.set(x,g);const j=p.auth?.type==="bearer"?"bearer":p.auth?.type==="api_key"||p.auth?.type==="oauth_client_credentials"?"api-key":p.auth?.type==="oauth_authorization_code"?"oauth2":"none",b={id:g,name:String(p.name||x),transport:"streamable-http",url:p.url,authType:j,authValue:p.auth?.type==="bearer"?p.auth.token??(p.auth.env?`\${${p.auth.env}}`:void 0):p.auth?.type==="api_key"?p.auth.value:void 0,apiKeyHeaderName:p.auth?.type==="api_key"?p.auth.header_name: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?.type==="oauth_client_credentials"?p.auth.scope:void 0,oauthMode:p.auth?.type==="oauth_authorization_code"?p.auth.mode:void 0,oauthAuthorizationUrl:p.auth?.type==="oauth_authorization_code"?p.auth.authorization_url:void 0,oauthTokenEndpoint:p.auth?.type==="oauth_authorization_code"?p.auth.token_url:void 0,oauthTokenUrl:p.auth?.type==="oauth_client_credentials"?p.auth.token_url:void 0,oauthClientIdEnv:p.auth?.type==="oauth_client_credentials"?p.auth.client_id_env:void 0,oauthClientSecretEnv:p.auth?.type==="oauth_client_credentials"?p.auth.client_secret_env:void 0,oauthAudience:p.auth?.type==="oauth_client_credentials"?p.auth.audience:void 0};i.push(b),o.push({kind:"inline",server:b})}const c=[],d=[];for(const p of r){if("ref"in p){const y=String(p.ref||"").trim();if(!y)continue;d.push({kind:"referenced",ref:y});continue}const x=String(p.id||p.name||"").trim();if(!x)continue;const g=x,j=p.provider==="azure_openai"?"azure":p.provider,b={id:g,name:String(p.name||x),provider:j,model:p.model,temperature:p.temperature??0,maxTokens:p.max_tokens??2048,maxTurns:p.max_turns,systemPrompt:p.system};c.push(b),d.push({kind:"inline",agent:b})}const f=[],h=[];return e.config.scenarios.forEach((p,x)=>{if("ref"in p){const b=String(p.ref||"").trim();if(!b)return;h.push({kind:"referenced",ref:b});return}const g=[];for(const b of p.eval?.tool_constraints?.required_tools??[])g.push({type:"required_tool",value:b});for(const b of p.eval?.tool_constraints?.forbidden_tools??[])g.push({type:"forbidden_tool",value:b});for(const b of p.eval?.response_assertions??[])b.type==="regex"?g.push({type:"response_contains",value:b.pattern}):g.push({type:"response_contains",value:`${b.path}${b.equals!==void 0?` == ${b.equals}`:""}`});const j={id:p.id||TG("scn",x),name:p.name||p.id||`Scenario ${x+1}`,serverIds:(()=>{if((p.servers??[]).length>0)return p.servers.map(y=>a.get(y)??y).filter(Boolean);const b=p.mcp_servers;return Array.isArray(b)?b.flatMap(y=>{if("ref"in y&&y.ref)return[String(y.ref)];if("id"in y&&y.id){const S=String(y.id);if(!a.has(S)){a.set(S,S);const C=y.auth,N=C?.type==="bearer"?"bearer":C?.type==="api_key"||C?.type==="oauth_client_credentials"?"api-key":C?.type==="oauth_authorization_code"?"oauth2":"none";i.push({id:S,name:String(y.name||S),transport:"streamable-http",url:String(y.url||""),authType:N,authValue:C?.type==="bearer"?String(C.token||"")||(C.env?`\${${C.env}}`:void 0):C?.type==="api_key"?String(C.value||""):void 0,apiKeyHeaderName:C?.type==="api_key"?String(C.header_name||""):void 0,oauthClientId:C?.type==="oauth_authorization_code"&&String(C.client_id||"")||void 0,oauthClientSecret:C?.type==="oauth_authorization_code"&&String(C.client_secret||"")||void 0,oauthRedirectUrl:C?.type==="oauth_authorization_code"&&String(C.redirect_url||"")||void 0,oauthScope:(C?.type==="oauth_authorization_code"||C?.type==="oauth_client_credentials")&&String(C.scope||"")||void 0,oauthMode:C?.type==="oauth_authorization_code"?C.mode:void 0,oauthAuthorizationUrl:C?.type==="oauth_authorization_code"&&String(C.authorization_url||"")||void 0,oauthTokenEndpoint:C?.type==="oauth_authorization_code"&&String(C.token_url||"")||void 0,oauthTokenUrl:C?.type==="oauth_client_credentials"?String(C.token_url||""):void 0,oauthClientIdEnv:C?.type==="oauth_client_credentials"?String(C.client_id_env||""):void 0,oauthClientSecretEnv:C?.type==="oauth_client_credentials"?String(C.client_secret_env||""):void 0,oauthAudience:C?.type==="oauth_client_credentials"&&String(C.audience||"")||void 0}),o.push({kind:"inline",server:i[i.length-1]})}return[S]}return[]}):[]})(),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:g,extractRules:(p.extract??[]).map(b=>({name:b.name,pattern:b.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 IG(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,max_turns:a.max_turns,system:a.system})),scenarios:e.scenarios}},n=Kl(t);return{servers:n.servers,agents:n.agents,scenarios:n.scenarios}}function AP(e){const t=new Map,n=g=>{const j=g.id,b=g.authValue?.trim()??"",y=g.apiKeyHeaderName?.trim()??"",S=g.authType==="bearer"?(()=>{if(!b)throw new Error(`Server '${j}' is missing bearer token value`);return{type:"bearer",token:b}})():g.authType==="api-key"&&!g.oauthTokenUrl?{type:"api_key",...y?{header_name:y}:{},value:(()=>{if(!b)throw new Error(`Server '${j}' is missing API key value`);return b})()}:g.authType==="api-key"?{type:"oauth_client_credentials",token_url:g.oauthTokenUrl||"",client_id_env:g.oauthClientIdEnv||"",client_secret_env:g.oauthClientSecretEnv||"",...g.oauthScope?{scope:g.oauthScope}:{},...g.oauthAudience?{audience:g.oauthAudience}:{}}:g.authType==="oauth2"?{type:"oauth_authorization_code",...g.oauthMode==="dcr"?{mode:"dcr"}:{},...g.oauthMode!=="dcr"&&g.oauthClientId?{client_id:g.oauthClientId}:{},...g.oauthClientSecret?{client_secret:g.oauthClientSecret}:{},...g.oauthRedirectUrl?{redirect_url:g.oauthRedirectUrl}:{},...g.oauthScope?{scope:g.oauthScope}:{},...g.oauthAuthorizationUrl?{authorization_url:g.oauthAuthorizationUrl}:{},...g.oauthTokenEndpoint?{token_url:g.oauthTokenEndpoint}:{}}:void 0;return{id:j,...g.name&&g.name!==j?{name:g.name}:{},transport:"http",url:g.url||"http://localhost:3000/mcp",...S!==void 0?{auth:S}:{}}},r=e.serverEntries&&e.serverEntries.length>0?e.serverEntries:[...e.servers.map(g=>({kind:"inline",server:g}))],a=new Set,i=new Map,o=r.flatMap(g=>{if(g.kind==="referenced"){const b=String(g.ref||"").trim();return!b||a.has(b)?[]:(a.add(b),t.set(b,b),[{ref:b}])}const j=n(g.server);return t.set(g.server.id,j.id),i.set(j.id,j),[j]}),c=g=>{const j=g.id;return{id:j,...g.name&&g.name!==j?{name:g.name}:{},provider:g.provider==="azure"?"azure_openai":g.provider==="anthropic"?"anthropic":"openai",model:g.model,temperature:g.temperature,max_tokens:g.maxTokens,max_turns:g.maxTurns,system:g.systemPrompt}},d=e.agentEntries&&e.agentEntries.length>0?e.agentEntries:[...e.agents.map(g=>({kind:"inline",agent:g}))],f=new Set,h=d.flatMap(g=>{if(g.kind==="referenced"){const j=String(g.ref||"").trim();return!j||f.has(j)?[]:(f.add(j),[{ref:j}])}return[c(g.agent)]}),p=g=>{const j=g.evalRules.filter(S=>S.type==="required_tool").map(S=>S.value),b=g.evalRules.filter(S=>S.type==="forbidden_tool").map(S=>S.value),y=g.evalRules.filter(S=>S.type==="response_contains"||S.type==="response_not_contains").map(S=>({type:"regex",pattern:S.value}));return{id:g.id,name:g.name||void 0,mcp_servers:g.serverIds.length>0?g.serverIds.map(S=>{const C=t.get(S)??S;return i.get(C)??{ref:C}}):void 0,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:j,forbidden_tools:b},response_assertions:y},extract:g.extractRules.map(S=>({name:S.name,from:"final_text",regex:S.pattern}))}},x=e.scenarioEntries&&e.scenarioEntries.length>0?e.scenarioEntries.map(g=>g.kind==="referenced"?{ref:g.ref}:p(g.scenario)):[...e.scenarios.map(g=>p(g))];return{name:e.configName?.trim()||void 0,servers:o,agents:h,scenarios:x,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 MG(e){const t=Object.fromEntries((e.servers??[]).map(r=>[r.id,(()=>{const a=r.authValue?.trim()??"",i=r.apiKeyHeaderName?.trim()??"";return{...r.name&&r.name!==r.id?{name:r.name}:{},transport:"http",url:r.url||"http://localhost:3000/mcp",auth:r.authType==="bearer"?(()=>{if(!a)throw new Error(`Server '${r.id}' is missing bearer token value`);return{type:"bearer",token:a}})():r.authType==="api-key"&&!r.oauthTokenUrl?{type:"api_key",...i?{header_name:i}:{},value:(()=>{if(!a)throw new Error(`Server '${r.id}' is missing API key value`);return a})()}:r.authType==="api-key"?{type:"oauth_client_credentials",token_url:r.oauthTokenUrl||"",client_id_env:r.oauthClientIdEnv||"",client_secret_env:r.oauthClientSecretEnv||"",...r.oauthScope?{scope:r.oauthScope}:{},...r.oauthAudience?{audience:r.oauthAudience}:{}}:r.authType==="oauth2"?{type:"oauth_authorization_code",...r.oauthMode==="dcr"?{mode:"dcr"}:{},...r.oauthMode!=="dcr"&&r.oauthClientId?{client_id:r.oauthClientId}:{},...r.oauthClientSecret?{client_secret:r.oauthClientSecret}:{},...r.oauthRedirectUrl?{redirect_url:r.oauthRedirectUrl}:{},...r.oauthScope?{scope:r.oauthScope}:{},...r.oauthAuthorizationUrl?{authorization_url:r.oauthAuthorizationUrl}:{},...r.oauthTokenEndpoint?{token_url:r.oauthTokenEndpoint}:{}}: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,max_turns:r.maxTurns,system:r.systemPrompt}]));return{servers:t,agents:n,scenarios:e.scenarios.map(r=>({id:r.id,name:r.name||void 0,mcp_servers:r.serverIds.length>0?r.serverIds.map(a=>({ref:a})):void 0,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 $G(e,t){if(e)return`${e}::${t??""}`}function nh(e){return e.type==="text"}function DG(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 LG(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(nh);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 x of d.content)x.type==="tool_result"&&(x.tool_use_id?h.set(x.tool_use_id,x):p.push(x));for(const x of c){n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:_P(x.input??{}),toolName:x.name,timestamp:o.ts});const g=h.get(x.id);if(!g)continue;const j=g.content.filter(nh).map(b=>b.text).join(`
54
- `);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:j,toolName:g.name,ok:!g.is_error,durationMs:g.duration_ms,timestamp:g.ts_end??d.ts}),h.delete(x.id)}for(const x of[...h.values(),...p]){const g=x.content.filter(nh).map(j=>j.text).join(`
55
- `);n.push({id:`tool_result-${n.length}`,kind:"tool_result",text:g,toolName:x.name,ok:!x.is_error,durationMs:x.duration_ms,timestamp:x.ts_end??d.ts})}i+=1}else for(const h of c)n.push({id:`tool_call-${n.length}`,kind:"tool_call",text:_P(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(nh).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 _P(e){try{return JSON.stringify(e)}catch{return String(e)}}function EP(e,t){t&&(typeof t.input_tokens=="number"&&(e.input+=t.input_tokens,e.hasInput=!0),typeof t.output_tokens=="number"&&(e.output+=t.output_tokens,e.hasOutput=!0),typeof t.total_tokens=="number"&&(e.total+=t.total_tokens,e.hasTotal=!0))}function Py(e,t){if(typeof e!="number"||t<=0)return new Array(t).fill(void 0);const n=Math.floor(e/t),r=e%t;return Array.from({length:t},(a,i)=>n+(i<r?1:0))}function FG(e){const t=Vs(),n=Vs(),r=new Map;if(!e)return{assistant:null,tool:null,perTool:{}};for(const i of e.messages??[]){if(i.role!=="assistant")continue;EP(t,i.usage);const o=i.content.filter(h=>h.type==="tool_use");if(o.length===0)continue;EP(n,i.usage);const c=Py(i.usage?.input_tokens,o.length),d=Py(i.usage?.output_tokens,o.length),f=Py(i.usage?.total_tokens,o.length);for(let h=0;h<o.length;h+=1){const p=o[h].name,x=r.get(p)??Vs(),g=c[h],j=d[h],b=f[h];typeof g=="number"&&(x.input+=g,x.hasInput=!0),typeof j=="number"&&(x.output+=j,x.hasOutput=!0),typeof b=="number"&&(x.total+=b,x.hasTotal=!0),r.set(p,x)}}const a={};for(const[i,o]of Array.from(r.entries()).sort((c,d)=>c[0].localeCompare(d[0]))){const c=Hs(o);c&&(a[i]=c)}return{assistant:Hs(t),tool:Hs(n),perTool:a}}function PP(e,t=[]){const n=new Map;for(const o of t){const c=$G(o.scenario_id,o.agent);if(!c)continue;const d=n.get(c)??[];d.push(o),n.set(c,d)}const r=e.scenarios.map(o=>{const c=n.get(`${o.scenario_id}::${o.agent}`)??[],d=new Map;for(const y of c)d.set(y.run_index,y);const f=o.runs.map((y,S)=>{const C=d.get(y.run_index)??c[S],N=FG(C);return{runIndex:y.run_index,passed:y.pass,toolCalls:DG(y,C),assistantTokenUsage:N.assistant,toolTokenUsage:N.tool,toolTokenUsageByTool:N.perTool,finalAnswer:y.final_text,conversation:LG(C),duration:y.tool_durations_ms.reduce((E,_)=>E+_,0),extractedValues:Object.fromEntries(Object.entries(y.extracted).map(([E,_])=>[E,String(_??"")])),failureReasons:y.failures}}),h=Vs(),p=Vs(),x=new Map;for(const y of f){Hl(h,y.assistantTokenUsage),Hl(p,y.toolTokenUsage);for(const[S,C]of Object.entries(y.toolTokenUsageByTool??{})){const N=x.get(S)??Vs();Hl(N,C),x.set(S,N)}}const g={};for(const[y,S]of Array.from(x.entries()).sort((C,N)=>C[0].localeCompare(N[0]))){const C=Hs(S);C&&(g[y]=C)}const j=f.length===0?0:Math.round(f.reduce((y,S)=>y+S.duration,0)/f.length),b=f.length===0?0:f.reduce((y,S)=>y+S.toolCalls.length,0)/f.length;return{scenarioId:o.scenario_id,scenarioName:o.scenario_name||o.scenario_id,agentId:o.agent,agentName:o.agent,runs:f,passRate:o.pass_rate,avgToolCalls:b,avgDuration:j,assistantTokenUsage:Hs(h),toolTokenUsage:Hs(p),toolTokenUsageByTool:g}}),a=Vs(),i=Vs();for(const o of r)Hl(a,o.assistantTokenUsage),Hl(i,o.toolTokenUsage);return{id:e.metadata.run_id,configId:"",configHash:e.metadata.config_hash,timestamp:e.metadata.timestamp,runNote:e.metadata.run_note,mcpServerVersions:e.metadata.mcp_server_versions??{},scenarios:r,assistantTokenUsage:Hs(a),toolTokenUsage:Hs(i),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 BG(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}const pd=BG();async function st(e,t){const n=await fetch(`${pd}${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 zG(e,t){const n=await fetch(`${pd}${e}`,{...t,headers:{}});if(!n.ok){const r=await n.text();throw new Error(`Request failed (${n.status}): ${r}`)}return n.text()}const Ze={health:()=>st("/api/health"),getSettings:()=>st("/api/settings"),updateSettings:e=>st("/api/settings",{method:"PUT",body:JSON.stringify(e)}),listConfigs:()=>st("/api/evals"),createConfig:(e,t)=>st("/api/evals",{method:"POST",body:JSON.stringify({fileName:e,config:t})}),updateConfig:(e,t,n)=>st(`/api/evals/${e}`,{method:"PUT",body:JSON.stringify({config:t,fileName:n})}),deleteConfig:e=>st(`/api/evals/${e}`,{method:"DELETE"}),listRuns:()=>st("/api/runs"),listMarkdownReports:()=>st("/api/markdown-reports").then(e=>e.items),getMarkdownReport:e=>st(`/api/markdown-reports/content?path=${encodeURIComponent(e)}`),deleteMarkdownReport:e=>st(`/api/markdown-reports?path=${encodeURIComponent(e)}`,{method:"DELETE"}).then(()=>{}),getRun:e=>st(`/api/runs/${e}`),deleteRun:e=>st(`/api/runs/${e}`,{method:"DELETE"}),updateRunNote:(e,t)=>st(`/api/runs/${encodeURIComponent(e)}/note`,{method:"PATCH",body:JSON.stringify({runNote:t??""})}).then(()=>{}),getRunTrace:e=>st(`/api/runs/${e}/trace`),listSnapshots:()=>st("/api/snapshots"),createSnapshotFromRun:(e,t)=>st("/api/snapshots",{method:"POST",body:JSON.stringify({runId:e,name:t})}),getSnapshot:e=>st(`/api/snapshots/${e}`),compareSnapshot:(e,t)=>st(`/api/snapshots/${e}/compare`,{method:"POST",body:JSON.stringify({runId:t})}),askResultAssistant:(e,t)=>st(`/api/runs/${encodeURIComponent(e)}/assistant`,{method:"POST",body:JSON.stringify({messages:t})}),applyResultAssistantReport:e=>st(`/api/runs/${encodeURIComponent(e.runId)}/assistant/apply-report`,{method:"POST",body:JSON.stringify({markdown:e.markdown,outputPath:e.outputPath,overwrite:e.overwrite})}),createResultAssistantSession:e=>st("/api/result-assistant/sessions",{method:"POST",body:JSON.stringify({runId:e})}),getResultAssistantSession:e=>st(`/api/result-assistant/sessions/${e}`),sendResultAssistantMessage:(e,t)=>st(`/api/result-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t})}),approveResultAssistantToolCall:(e,t,n)=>st(`/api/result-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify(n===void 0?{}:{argumentsOverride:n})}),denyResultAssistantToolCall:(e,t)=>st(`/api/result-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),closeResultAssistantSession:e=>st(`/api/result-assistant/sessions/${e}`,{method:"DELETE"}).then(()=>{}),generateSnapshotEvalBaseline:(e,t,n)=>st("/api/snapshots/generate-eval",{method:"POST",body:JSON.stringify({runId:e,configId:t,name:n})}),updateSnapshotPolicy:(e,t)=>st(`/api/evals/${e}/snapshot-policy`,{method:"POST",body:JSON.stringify(t)}),getLibraries:()=>st("/api/libraries"),saveLibraries:e=>st("/api/libraries",{method:"PUT",body:JSON.stringify(e)}),startRun:e=>st("/api/runs",{method:"POST",body:JSON.stringify(e)}),listProviderModels:e=>st(`/api/providers/models?provider=${encodeURIComponent(e)}`),createScenarioAssistantSession:e=>st("/api/scenario-assistant/sessions",{method:"POST",body:JSON.stringify(e)}),getScenarioAssistantSession:e=>st(`/api/scenario-assistant/sessions/${e}`),sendScenarioAssistantMessage:(e,t)=>st(`/api/scenario-assistant/sessions/${e}/messages`,{method:"POST",body:JSON.stringify({message:t})}),approveScenarioAssistantToolCall:(e,t)=>st(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/approve`,{method:"POST",body:JSON.stringify({})}),denyScenarioAssistantToolCall:(e,t)=>st(`/api/scenario-assistant/sessions/${e}/tool-calls/${t}/deny`,{method:"POST",body:JSON.stringify({})}),approveAllScenarioAssistantToolCalls:e=>st(`/api/scenario-assistant/sessions/${e}/tool-calls/approve-all`,{method:"POST",body:JSON.stringify({})}),closeScenarioAssistantSession:e=>st(`/api/scenario-assistant/sessions/${e}`,{method:"DELETE"}),discoverToolsForAnalysis:e=>st("/api/tool-analysis/discover-tools",{method:"POST",body:JSON.stringify(e)}),startToolAnalysis:e=>st("/api/tool-analysis/jobs",{method:"POST",body:JSON.stringify(e)}),getToolAnalysisResult:e=>st(`/api/tool-analysis/jobs/${e}/result`),stopToolAnalysis:e=>st(`/api/tool-analysis/jobs/${e}/stop`,{method:"POST"}),subscribeToolAnalysisJob:(e,t)=>{const n=new EventSource(`${pd}/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:()=>st("/api/tool-analysis-results").then(e=>e.items),getToolAnalysisSavedResult:e=>st(`/api/tool-analysis-results/${e}`),deleteToolAnalysisSavedResult:e=>st(`/api/tool-analysis-results/${e}`,{method:"DELETE"}).then(()=>{}),createOAuthDebuggerSession:e=>st("/api/oauth-debugger/sessions",{method:"POST",body:JSON.stringify(e)}),getOAuthDebuggerSession:e=>st(`/api/oauth-debugger/sessions/${e}`),startOAuthDebuggerSession:e=>st(`/api/oauth-debugger/sessions/${e}/start`,{method:"POST",body:JSON.stringify({})}),subscribeOAuthDebuggerSession:(e,t)=>{const n=new EventSource(`${pd}/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)=>st(`/api/oauth-debugger/sessions/${e}/manual-callback`,{method:"POST",body:JSON.stringify(t)}),stopOAuthDebuggerSession:e=>st(`/api/oauth-debugger/sessions/${e}/stop`,{method:"POST",body:JSON.stringify({})}),exportOAuthDebuggerSession:(e,t)=>t==="json"?st(`/api/oauth-debugger/sessions/${e}/export?format=json`):zG(`/api/oauth-debugger/sessions/${e}/export?format=${t}`),createOAuthRuntimeSession:e=>st("/api/oauth-runtime/sessions",{method:"POST",body:JSON.stringify(e)}),getOAuthRuntimeSession:e=>st(`/api/oauth-runtime/sessions/${e}`),getOAuthRuntimeSessionToken:e=>st(`/api/oauth-runtime/sessions/${e}/token`),submitOAuthRuntimeCallback:(e,t)=>st(`/api/oauth-runtime/sessions/${e}/callback`,{method:"POST",body:JSON.stringify(t)}),cancelOAuthRuntimeSession:e=>st(`/api/oauth-runtime/sessions/${e}/cancel`,{method:"POST",body:JSON.stringify({})}),stopRun:e=>st(`/api/runs/jobs/${e}/stop`,{method:"POST"}),getRunQueue:()=>st("/api/runs/queue"),removeQueuedRun:e=>st(`/api/runs/queue/${e}`,{method:"DELETE"}).then(()=>{}),subscribeRunJob:(e,t)=>{const n=new EventSource(`${pd}/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("queued",i),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 UG(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 qG(e){return e||`config-${Date.now()}`}const WG={async listConfigs(){return(await Ze.listConfigs()).map(Kl)},async createConfig(e){const t=await Ze.createConfig(UG(e),AP(e));return Kl(t)},async updateConfig(e){const t=await Ze.updateConfig(e.id,AP(e),qG(e.name));return Kl(t)},async deleteConfig(e){await Ze.deleteConfig(e)},async listResults(){const t=(await Ze.listRuns()).map(async n=>{const[{results:r},a]=await Promise.all([Ze.getRun(n.runId),Ze.getRunTrace(n.runId)]);return PP(r,a.records)});return Promise.all(t)},async getResult(e){try{const[{results:t},n]=await Promise.all([Ze.getRun(e),Ze.getRunTrace(e)]);return PP(t,n.records)}catch{return}},async deleteResult(e){await Ze.deleteRun(e)},async updateRunNote(e,t){await Ze.updateRunNote(e,t)},async listMarkdownReports(){return Ze.listMarkdownReports()},async getMarkdownReport(e){return Ze.getMarkdownReport(e)},async deleteMarkdownReport(e){await Ze.deleteMarkdownReport(e)},async startRun(e){return Ze.startRun(e)},async stopRun(e){await Ze.stopRun(e)},async getRunQueue(){return Ze.getRunQueue()},async removeQueuedRun(e){await Ze.removeQueuedRun(e)},subscribeRunJob(e,t){return Ze.subscribeRunJob(e,t)},async listSnapshots(){return Ze.listSnapshots()},async createSnapshotFromRun(e,t){return Ze.createSnapshotFromRun(e,t)},async getSnapshot(e){try{return await Ze.getSnapshot(e)}catch{return}},async compareSnapshot(e,t){return Ze.compareSnapshot(e,t)},async askResultAssistant(e,t){return Ze.askResultAssistant(e,t)},async applyResultAssistantReport(e){return Ze.applyResultAssistantReport(e)},async createResultAssistantSession(e){return Ze.createResultAssistantSession(e)},async getResultAssistantSession(e){return Ze.getResultAssistantSession(e)},async sendResultAssistantMessage(e,t){return Ze.sendResultAssistantMessage(e,t)},async approveResultAssistantToolCall(e,t,n){return Ze.approveResultAssistantToolCall(e,t,n)},async denyResultAssistantToolCall(e,t){return Ze.denyResultAssistantToolCall(e,t)},async closeResultAssistantSession(e){await Ze.closeResultAssistantSession(e)},async generateSnapshotEvalBaseline(e,t,n){const r=await Ze.generateSnapshotEvalBaseline(e,t,n);return{snapshot:r.snapshot,config:Kl(r.config)}},async updateSnapshotPolicy(e,t){const n=await Ze.updateSnapshotPolicy(e,t);return Kl(n)},async getLibraries(){const e=await Ze.getLibraries();return IG(e)},async saveLibraries(e){await Ze.saveLibraries(MG(e))},async listProviderModels(e){return Ze.listProviderModels(e)},async getWorkspaceSettings(){return Ze.getSettings()},async updateWorkspaceSettings(e){return Ze.updateSettings(e)},async createScenarioAssistantSession(e){return Ze.createScenarioAssistantSession(e)},async getScenarioAssistantSession(e){return Ze.getScenarioAssistantSession(e)},async sendScenarioAssistantMessage(e,t){return Ze.sendScenarioAssistantMessage(e,t)},async approveScenarioAssistantToolCall(e,t){return Ze.approveScenarioAssistantToolCall(e,t)},async denyScenarioAssistantToolCall(e,t){return Ze.denyScenarioAssistantToolCall(e,t)},async approveAllScenarioAssistantToolCalls(e){return Ze.approveAllScenarioAssistantToolCalls(e)},async closeScenarioAssistantSession(e){await Ze.closeScenarioAssistantSession(e)},async discoverToolsForAnalysis(e){return Ze.discoverToolsForAnalysis(e)},async startToolAnalysis(e){return Ze.startToolAnalysis(e)},subscribeToolAnalysisJob(e,t){return Ze.subscribeToolAnalysisJob(e,t)},async getToolAnalysisResult(e){return Ze.getToolAnalysisResult(e)},async stopToolAnalysis(e){return Ze.stopToolAnalysis(e)},async listToolAnalysisResults(){return Ze.listToolAnalysisResults()},async getToolAnalysisSavedResult(e){return Ze.getToolAnalysisSavedResult(e)},async deleteToolAnalysisSavedResult(e){await Ze.deleteToolAnalysisSavedResult(e)},async createOAuthDebuggerSession(e){return Ze.createOAuthDebuggerSession(e)},async getOAuthDebuggerSession(e){return Ze.getOAuthDebuggerSession(e)},async startOAuthDebuggerSession(e){return Ze.startOAuthDebuggerSession(e)},subscribeOAuthDebuggerSession(e,t){return Ze.subscribeOAuthDebuggerSession(e,t)},async submitOAuthDebuggerManualCallback(e,t){return Ze.submitOAuthDebuggerManualCallback(e,t)},async stopOAuthDebuggerSession(e){return Ze.stopOAuthDebuggerSession(e)},async exportOAuthDebuggerSession(e,t){return Ze.exportOAuthDebuggerSession(e,t)},async createOAuthRuntimeSession(e){return Ze.createOAuthRuntimeSession(e)},async getOAuthRuntimeSession(e){return Ze.getOAuthRuntimeSession(e)},async getOAuthRuntimeSessionToken(e){return Ze.getOAuthRuntimeSessionToken(e)},async submitOAuthRuntimeCallback(e,t){return Ze.submitOAuthRuntimeCallback(e,t)},async cancelOAuthRuntimeSession(e){return Ze.cancelOAuthRuntimeSession(e)}},U3=v.createContext(null);function VG({children:e}){const t="workspace",[n,r]=v.useState("checking"),[a,i]=v.useState(null);v.useEffect(()=>{r("checking"),Ze.health().then(c=>{r("connected"),i(typeof c?.version=="string"?c.version:null)}).catch(()=>{r("disconnected"),i(null)})},[t]);const o=v.useMemo(()=>WG,[]);return s.jsx(U3.Provider,{value:{mode:t,connection:n,version:a,source:o},children:e})}function qn(){const e=v.useContext(U3);if(!e)throw new Error("useDataSource must be used within DataSourceProvider");return e}const HG=e=>{if(e==="/")return[{label:"Dashboard"}];const t=[{label:"Dashboard",to:"/"}];if(dn("/mcp-evaluations/:id",e))return t.push({label:"MCP Evaluations",to:"/mcp-evaluations"},{label:"MCP Evaluation"}),t;if(dn("/mcp-evaluations",e))return t.push({label:"MCP Evaluations"}),t;if(dn("/settings",e))return t.push({label:"Settings"}),t;if(dn("/tool-analysis",e))return t.push({label:"Analyze MCP Tools"}),t;if(dn("/tool-analysis-results/:id",e)){const n=dn("/tool-analysis-results/:id",e);return t.push({label:"Tool Analysis Results",to:"/tool-analysis-results"},{label:n?.params.id??"Report"}),t}if(dn("/tool-analysis-results",e))return t.push({label:"Tool Analysis Results"}),t;if(dn("/markdown-reports/view",e))return t.push({label:"Markdown Reports",to:"/markdown-reports"},{label:"View Report"}),t;if(dn("/markdown-reports",e))return t.push({label:"Markdown Reports"}),t;if(dn("/oauth-debugger",e))return t.push({label:"OAuth Debugger"}),t;if(dn("/results/:id",e))return t.push({label:"Evaluation Results",to:"/results"},{label:"Result"}),t;if(dn("/results",e))return t.push({label:"Evaluation Results"}),t;if(dn("/run",e))return t.push({label:"Run Evaluation"}),t;if(dn("/libraries/servers/:serverId",e)){const n=dn("/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(dn("/libraries/servers",e))return t.push({label:"Libraries",to:"/libraries/servers"},{label:"Servers"}),t;if(dn("/libraries/agents/:agentName",e)){const n=dn("/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(dn("/libraries/agents",e))return t.push({label:"Libraries",to:"/libraries/agents"},{label:"Agents"}),t;if(dn("/libraries/test-cases/:testCaseId",e)){const n=dn("/libraries/test-cases/:testCaseId",e),r=n?.params.testCaseId?decodeURIComponent(n.params.testCaseId):"Test Case";return t.push({label:"Libraries",to:"/libraries/test-cases"},{label:"Test Cases",to:"/libraries/test-cases"},{label:r}),t}return dn("/libraries/test-cases",e)?(t.push({label:"Libraries",to:"/libraries/test-cases"},{label:"Test Cases"}),t):dn("/compare",e)?(t.push({label:"Compare Evaluations"}),t):(dn("/compare/results",e)&&t.push({label:"Compare Evaluations",to:"/compare"},{label:"Full Result Compare"}),t)};function KG(){const e=_s(),t=new URLSearchParams(e.search).get("embed")==="1",n=HG(e.pathname),{connection:r,version:a}=qn();return t?s.jsx("main",{className:"min-h-screen overflow-auto bg-background p-4",children:s.jsx(dP,{})}):s.jsx(S3,{children:s.jsxs("div",{className:"flex min-h-screen w-full",children:[s.jsx(OG,{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(C3,{}),s.jsx($3,{children:s.jsx(D3,{children:n.map((i,o)=>{const c=o===n.length-1;return s.jsxs(v.Fragment,{children:[s.jsx(L3,{children:i.to&&!c?s.jsx(F3,{asChild:!0,children:s.jsx(wt,{to:i.to,children:i.label})}):s.jsx(B3,{children:i.label})}),!c&&s.jsx(z3,{})]},`${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(dP,{})})]})]})})}const q3=v.createContext(null);function GG({children:e}){const{source:t}=qn(),[n,r]=v.useState([]),[a,i]=v.useState(!0),o=v.useCallback(async()=>{i(!0);try{const x=await t.listConfigs();r(x)}finally{i(!1)}},[t]);v.useEffect(()=>{o()},[o]);const c=v.useCallback(x=>n.find(g=>g.id===x),[n]),d=v.useCallback(async x=>{const g=await t.createConfig(x);return r(j=>[...j,g]),g},[t]),f=v.useCallback(async(x,g)=>{const j=await t.updateConfig({...g,id:x});return r(b=>b.map(y=>y.id===x?j:y)),j},[t]),h=v.useCallback(async x=>{await t.deleteConfig(x),r(g=>g.filter(j=>j.id!==x))},[t]),p=v.useCallback(async x=>{const g=n.find(y=>y.id===x);if(!g)throw new Error("Config not found");const j={...structuredClone(g),id:`cfg-${Date.now()}`,name:`${g.name} (Copy)`,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},b=await t.createConfig(j);return r(y=>[...y,b]),b},[n,t]);return s.jsx(q3.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(q3);if(!e)throw new Error("useConfigs must be used within ConfigProvider");return e}const W3=v.createContext(null);function YG({children:e}){const{source:t}=qn(),[n,r]=v.useState({servers:[],agents:[],scenarios:[]}),[a,i]=v.useState(!0),o=v.useCallback(async()=>{i(!0);try{const f=await t.getLibraries();r(f)}finally{i(!1)}},[t]);v.useEffect(()=>{o()},[t]),v.useEffect(()=>{const f=()=>{o()};return window.addEventListener("focus",f),()=>{window.removeEventListener("focus",f)}},[t]);const c=v.useCallback(async f=>{r(f),await t.saveLibraries(f)},[t]),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,o,c]);return s.jsx(W3.Provider,{value:d,children:e})}function Xa(){const e=v.useContext(W3);if(!e)throw new Error("useLibraries must be used within LibraryProvider");return e}const qe=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:je("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));qe.displayName="Card";const At=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:je("flex flex-col space-y-1.5 p-6",e),...t}));At.displayName="CardHeader";const _t=v.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:je("text-2xl font-semibold leading-none tracking-tight",e),...t}));_t.displayName="CardTitle";const wa=v.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:je("text-sm text-muted-foreground",e),...t}));wa.displayName="CardDescription";const We=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:je("p-6 pt-0",e),...t}));We.displayName="CardContent";const XG=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:je("flex items-center p-6 pt-0",e),...t}));XG.displayName="CardFooter";const Br=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:n,className:je("w-full caption-bottom text-sm",e),...t})}));Br.displayName="Table";const zr=v.forwardRef(({className:e,...t},n)=>s.jsx("thead",{ref:n,className:je("[&_tr]:border-b",e),...t}));zr.displayName="TableHeader";const Ur=v.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:je("[&_tr:last-child]:border-0",e),...t}));Ur.displayName="TableBody";const QG=v.forwardRef(({className:e,...t},n)=>s.jsx("tfoot",{ref:n,className:je("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));QG.displayName="TableFooter";const qt=v.forwardRef(({className:e,...t},n)=>s.jsx("tr",{ref:n,className:je("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));qt.displayName="TableRow";const tt=v.forwardRef(({className:e,...t},n)=>s.jsx("th",{ref:n,className:je("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));tt.displayName="TableHead";const Be=v.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:je("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Be.displayName="TableCell";const JG=v.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:je("mt-4 text-sm text-muted-foreground",e),...t}));JG.displayName="TableCaption";function cs({title:e,value:t,subtitle:n,icon:r,trend:a}){return s.jsx(qe,{children:s.jsx(We,{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 ZG=el("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 Qe({className:e,variant:t,asChild:n,...r}){const a=n?Qi:"div";return s.jsx(a,{className:je(ZG({variant:t}),e),...r})}function Ks({rate:e,className:t}){const n=Math.round(e*100),r=n>=80?"default":n>=50?"secondary":"destructive";return s.jsxs(Qe,{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 ky,kP;function Vr(){if(kP)return ky;kP=1;var e=Array.isArray;return ky=e,ky}var Oy,OP;function V3(){if(OP)return Oy;OP=1;var e=typeof Vp=="object"&&Vp&&Vp.Object===Object&&Vp;return Oy=e,Oy}var Ry,RP;function Es(){if(RP)return Ry;RP=1;var e=V3(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Ry=n,Ry}var Ty,TP;function Af(){if(TP)return Ty;TP=1;var e=Es(),t=e.Symbol;return Ty=t,Ty}var Iy,IP;function eY(){if(IP)return Iy;IP=1;var e=Af(),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 Iy=i,Iy}var My,MP;function tY(){if(MP)return My;MP=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return My=n,My}var $y,$P;function ii(){if($P)return $y;$P=1;var e=Af(),t=eY(),n=tY(),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 $y=o,$y}var Dy,DP;function oi(){if(DP)return Dy;DP=1;function e(t){return t!=null&&typeof t=="object"}return Dy=e,Dy}var Ly,LP;function ru(){if(LP)return Ly;LP=1;var e=ii(),t=oi(),n="[object Symbol]";function r(a){return typeof a=="symbol"||t(a)&&e(a)==n}return Ly=r,Ly}var Fy,FP;function NN(){if(FP)return Fy;FP=1;var e=Vr(),t=ru(),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 Fy=a,Fy}var By,BP;function Ji(){if(BP)return By;BP=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return By=e,By}var zy,zP;function CN(){if(zP)return zy;zP=1;var e=ii(),t=Ji(),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 zy=o,zy}var Uy,UP;function nY(){if(UP)return Uy;UP=1;var e=Es(),t=e["__core-js_shared__"];return Uy=t,Uy}var qy,qP;function rY(){if(qP)return qy;qP=1;var e=nY(),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 qy=n,qy}var Wy,WP;function H3(){if(WP)return Wy;WP=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 Wy=n,Wy}var Vy,VP;function aY(){if(VP)return Vy;VP=1;var e=CN(),t=rY(),n=Ji(),r=H3(),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(x){if(!n(x)||t(x))return!1;var g=e(x)?h:i;return g.test(r(x))}return Vy=p,Vy}var Hy,HP;function sY(){if(HP)return Hy;HP=1;function e(t,n){return t?.[n]}return Hy=e,Hy}var Ky,KP;function nl(){if(KP)return Ky;KP=1;var e=aY(),t=sY();function n(r,a){var i=t(r,a);return e(i)?i:void 0}return Ky=n,Ky}var Gy,GP;function jv(){if(GP)return Gy;GP=1;var e=nl(),t=e(Object,"create");return Gy=t,Gy}var Yy,YP;function iY(){if(YP)return Yy;YP=1;var e=jv();function t(){this.__data__=e?e(null):{},this.size=0}return Yy=t,Yy}var Xy,XP;function oY(){if(XP)return Xy;XP=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Xy=e,Xy}var Qy,QP;function lY(){if(QP)return Qy;QP=1;var e=jv(),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 Qy=a,Qy}var Jy,JP;function cY(){if(JP)return Jy;JP=1;var e=jv(),t=Object.prototype,n=t.hasOwnProperty;function r(a){var i=this.__data__;return e?i[a]!==void 0:n.call(i,a)}return Jy=r,Jy}var Zy,ZP;function uY(){if(ZP)return Zy;ZP=1;var e=jv(),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 Zy=n,Zy}var eb,ek;function dY(){if(ek)return eb;ek=1;var e=iY(),t=oY(),n=lY(),r=cY(),a=uY();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,eb=i,eb}var tb,tk;function fY(){if(tk)return tb;tk=1;function e(){this.__data__=[],this.size=0}return tb=e,tb}var nb,nk;function AN(){if(nk)return nb;nk=1;function e(t,n){return t===n||t!==t&&n!==n}return nb=e,nb}var rb,rk;function Sv(){if(rk)return rb;rk=1;var e=AN();function t(n,r){for(var a=n.length;a--;)if(e(n[a][0],r))return a;return-1}return rb=t,rb}var ab,ak;function pY(){if(ak)return ab;ak=1;var e=Sv(),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 ab=r,ab}var sb,sk;function hY(){if(sk)return sb;sk=1;var e=Sv();function t(n){var r=this.__data__,a=e(r,n);return a<0?void 0:r[a][1]}return sb=t,sb}var ib,ik;function mY(){if(ik)return ib;ik=1;var e=Sv();function t(n){return e(this.__data__,n)>-1}return ib=t,ib}var ob,ok;function vY(){if(ok)return ob;ok=1;var e=Sv();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 ob=t,ob}var lb,lk;function Nv(){if(lk)return lb;lk=1;var e=fY(),t=pY(),n=hY(),r=mY(),a=vY();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,lb=i,lb}var cb,ck;function _N(){if(ck)return cb;ck=1;var e=nl(),t=Es(),n=e(t,"Map");return cb=n,cb}var ub,uk;function gY(){if(uk)return ub;uk=1;var e=dY(),t=Nv(),n=_N();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return ub=r,ub}var db,dk;function xY(){if(dk)return db;dk=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return db=e,db}var fb,fk;function Cv(){if(fk)return fb;fk=1;var e=xY();function t(n,r){var a=n.__data__;return e(r)?a[typeof r=="string"?"string":"hash"]:a.map}return fb=t,fb}var pb,pk;function yY(){if(pk)return pb;pk=1;var e=Cv();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return pb=t,pb}var hb,hk;function bY(){if(hk)return hb;hk=1;var e=Cv();function t(n){return e(this,n).get(n)}return hb=t,hb}var mb,mk;function wY(){if(mk)return mb;mk=1;var e=Cv();function t(n){return e(this,n).has(n)}return mb=t,mb}var vb,vk;function jY(){if(vk)return vb;vk=1;var e=Cv();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 vb=t,vb}var gb,gk;function EN(){if(gk)return gb;gk=1;var e=gY(),t=yY(),n=bY(),r=wY(),a=jY();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,gb=i,gb}var xb,xk;function K3(){if(xk)return xb;xk=1;var e=EN(),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,xb=n,xb}var yb,yk;function SY(){if(yk)return yb;yk=1;var e=K3(),t=500;function n(r){var a=e(r,function(o){return i.size===t&&i.clear(),o}),i=a.cache;return a}return yb=n,yb}var bb,bk;function NY(){if(bk)return bb;bk=1;var e=SY(),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 bb=r,bb}var wb,wk;function PN(){if(wk)return wb;wk=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 wb=e,wb}var jb,jk;function CY(){if(jk)return jb;jk=1;var e=Af(),t=PN(),n=Vr(),r=ru(),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 jb=o,jb}var Sb,Sk;function G3(){if(Sk)return Sb;Sk=1;var e=CY();function t(n){return n==null?"":e(n)}return Sb=t,Sb}var Nb,Nk;function Y3(){if(Nk)return Nb;Nk=1;var e=Vr(),t=NN(),n=NY(),r=G3();function a(i,o){return e(i)?i:t(i,o)?[i]:n(r(i))}return Nb=a,Nb}var Cb,Ck;function Av(){if(Ck)return Cb;Ck=1;var e=ru();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Cb=t,Cb}var Ab,Ak;function kN(){if(Ak)return Ab;Ak=1;var e=Y3(),t=Av();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 Ab=n,Ab}var _b,_k;function X3(){if(_k)return _b;_k=1;var e=kN();function t(n,r,a){var i=n==null?void 0:e(n,r);return i===void 0?a:i}return _b=t,_b}var AY=X3();const ia=an(AY);var Eb,Ek;function _Y(){if(Ek)return Eb;Ek=1;function e(t){return t==null}return Eb=e,Eb}var EY=_Y();const kt=an(EY);var Pb,Pk;function PY(){if(Pk)return Pb;Pk=1;var e=ii(),t=Vr(),n=oi(),r="[object String]";function a(i){return typeof i=="string"||!t(i)&&n(i)&&e(i)==r}return Pb=a,Pb}var kY=PY();const Lo=an(kY);var OY=CN();const Pt=an(OY);var RY=Ji();const au=an(RY);var kb={exports:{}},nn={};var kk;function TY(){if(kk)return nn;kk=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"),x=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),j;j=Symbol.for("react.module.reference");function b(y){if(typeof y=="object"&&y!==null){var S=y.$$typeof;switch(S){case e:switch(y=y.type,y){case n:case a:case r:case f:case h:return y;default:switch(y=y&&y.$$typeof,y){case c:case o:case d:case x:case p:case i:return y;default:return S}}case t:return S}}}return nn.ContextConsumer=o,nn.ContextProvider=i,nn.Element=e,nn.ForwardRef=d,nn.Fragment=n,nn.Lazy=x,nn.Memo=p,nn.Portal=t,nn.Profiler=a,nn.StrictMode=r,nn.Suspense=f,nn.SuspenseList=h,nn.isAsyncMode=function(){return!1},nn.isConcurrentMode=function(){return!1},nn.isContextConsumer=function(y){return b(y)===o},nn.isContextProvider=function(y){return b(y)===i},nn.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===e},nn.isForwardRef=function(y){return b(y)===d},nn.isFragment=function(y){return b(y)===n},nn.isLazy=function(y){return b(y)===x},nn.isMemo=function(y){return b(y)===p},nn.isPortal=function(y){return b(y)===t},nn.isProfiler=function(y){return b(y)===a},nn.isStrictMode=function(y){return b(y)===r},nn.isSuspense=function(y){return b(y)===f},nn.isSuspenseList=function(y){return b(y)===h},nn.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===n||y===a||y===r||y===f||y===h||y===g||typeof y=="object"&&y!==null&&(y.$$typeof===x||y.$$typeof===p||y.$$typeof===i||y.$$typeof===o||y.$$typeof===d||y.$$typeof===j||y.getModuleId!==void 0)},nn.typeOf=b,nn}var Ok;function IY(){return Ok||(Ok=1,kb.exports=TY()),kb.exports}var MY=IY(),Ob,Rk;function Q3(){if(Rk)return Ob;Rk=1;var e=ii(),t=oi(),n="[object Number]";function r(a){return typeof a=="number"||t(a)&&e(a)==n}return Ob=r,Ob}var Rb,Tk;function $Y(){if(Tk)return Rb;Tk=1;var e=Q3();function t(n){return e(n)&&n!=+n}return Rb=t,Rb}var DY=$Y();const _f=an(DY);var LY=Q3();const FY=an(LY);var Ar=function(t){return t===0?0:t>0?1:-1},_o=function(t){return Lo(t)&&t.indexOf("%")===t.length-1},Ve=function(t){return FY(t)&&!_f(t)},BY=function(t){return kt(t)},Zn=function(t){return Ve(t)||Lo(t)},zY=0,su=function(t){var n=++zY;return"".concat(t||"").concat(n)},_r=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(!Ve(t)&&!Lo(t))return r;var i;if(_o(t)){var o=t.indexOf("%");i=n*parseFloat(t.slice(0,o))/100}else i=+t;return _f(i)&&(i=r),a&&i>n&&(i=n),i},Gl=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},UY=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},na=function(t,n){return Ve(t)&&Ve(n)?function(r){return t+r*(n-t)}:function(){return n}};function Dh(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):ia(r,t))===n})}var qY=function(t,n){return Ve(t)&&Ve(n)?t-n:Lo(t)&&Lo(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function lc(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 c1(e){"@babel/helpers - typeof";return c1=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},c1(e)}var WY=["viewBox","children"],VY=["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"],Ik=["points","pathLength"],Tb={svg:WY,polygon:Ik,polyline:Ik},ON=["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"],Lh=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(v.isValidElement(t)&&(r=t.props),!au(r))return null;var a={};return Object.keys(r).forEach(function(i){ON.includes(i)&&(a[i]=n||function(o){return r[i](r,o)})}),a},HY=function(t,n,r){return function(a){return t(n,r,a),null}},Fo=function(t,n,r){if(!au(t)||c1(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(i){var o=t[i];ON.includes(i)&&typeof o=="function"&&(a||(a={}),a[i]=HY(o,n,r))}),a},KY=["children"],GY=["children"];function Mk(e,t){if(e==null)return{};var n=YY(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 YY(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 u1(e){"@babel/helpers - typeof";return u1=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},u1(e)}var $k={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"},Xs=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},Dk=null,Ib=null,RN=function e(t){if(t===Dk&&Array.isArray(Ib))return Ib;var n=[];return v.Children.forEach(t,function(r){kt(r)||(MY.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),Ib=n,Dk=t,n};function oa(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(a){return Xs(a)}):r=[Xs(t)],RN(e).forEach(function(a){var i=ia(a,"type.displayName")||ia(a,"type.name");r.indexOf(i)!==-1&&n.push(a)}),n}function ea(e,t){var n=oa(e,t);return n&&n[0]}var Lk=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,a=n.height;return!(!Ve(r)||r<=0||!Ve(a)||a<=0)},XY=["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"],QY=function(t){return t&&t.type&&Lo(t.type)&&XY.indexOf(t.type)>=0},JY=function(t){return t&&u1(t)==="object"&&"clipDot"in t},ZY=function(t,n,r,a){var i,o=(i=Tb?.[a])!==null&&i!==void 0?i:[];return n.startsWith("data-")||!Pt(t)&&(a&&o.includes(n)||VY.includes(n))||r&&ON.includes(n)},yt=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(v.isValidElement(t)&&(a=t.props),!au(a))return null;var i={};return Object.keys(a).forEach(function(o){var c;ZY((c=a)===null||c===void 0?void 0:c[o],o,n,r)&&(i[o]=a[o])}),i},d1=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 Fk(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(!Fk(i,o))return!1}return!0},Fk=function(t,n){if(kt(t)&&kt(n))return!0;if(!kt(t)&&!kt(n)){var r=t.props||{},a=r.children,i=Mk(r,KY),o=n.props||{},c=o.children,d=Mk(o,GY);return a&&c?lc(i,d)&&d1(a,c):!a&&!c?lc(i,d):!1}return!1},Bk=function(t,n){var r=[],a={};return RN(t).forEach(function(i,o){if(QY(i))r.push(i);else if(i){var c=Xs(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},eX=function(t){var n=t&&t.type;return n&&$k[n]?$k[n]:null},tX=function(t,n){return RN(n).indexOf(t)},nX=["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 rX(e,t){if(e==null)return{};var n=aX(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 aX(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 p1(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=rX(e,nX),h=a||{width:n,height:r,x:0,y:0},p=Rt("recharts-surface",i);return H.createElement("svg",f1({},yt(f,!0,"svg"),{className:p,width:n,height:r,style:o,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),H.createElement("title",null,c),H.createElement("desc",null,d),t)}var sX=["children","className"];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 iX(e,t){if(e==null)return{};var n=oX(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 oX(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 Jt=H.forwardRef(function(e,t){var n=e.children,r=e.className,a=iX(e,sX),i=Rt("recharts-layer",r);return H.createElement("g",h1({className:i},yt(a,!0),{ref:t}),n)}),Qs=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]},Mb,zk;function lX(){if(zk)return Mb;zk=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 Mb=e,Mb}var $b,Uk;function cX(){if(Uk)return $b;Uk=1;var e=lX();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 $b=t,$b}var Db,qk;function J3(){if(qk)return Db;qk=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 Lb,Wk;function uX(){if(Wk)return Lb;Wk=1;function e(t){return t.split("")}return Lb=e,Lb}var Fb,Vk;function dX(){if(Vk)return Fb;Vk=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}",x="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",j=f+"?",b="["+i+"]?",y="(?:"+g+"(?:"+[h,p,x].join("|")+")"+b+j+")*",S=b+j+y,C="(?:"+[h+c+"?",c,p,x,o].join("|")+")",N=RegExp(d+"(?="+d+")|"+C+S,"g");function E(_){return _.match(N)||[]}return Fb=E,Fb}var Bb,Hk;function fX(){if(Hk)return Bb;Hk=1;var e=uX(),t=J3(),n=dX();function r(a){return t(a)?n(a):e(a)}return Bb=r,Bb}var zb,Kk;function pX(){if(Kk)return zb;Kk=1;var e=cX(),t=J3(),n=fX(),r=G3();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 zb=a,zb}var Ub,Gk;function hX(){if(Gk)return Ub;Gk=1;var e=pX(),t=e("toUpperCase");return Ub=t,Ub}var mX=hX();const _v=an(mX);function gn(e){return function(){return e}}const Z3=Math.cos,Fh=Math.sin,Qa=Math.sqrt,Bh=Math.PI,Ev=2*Bh,m1=Math.PI,v1=2*m1,No=1e-6,vX=v1-No;function e5(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function gX(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return e5;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 xX{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?e5:gX(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,x=h*h+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(x>No)if(!(Math.abs(p*d-f*h)>No)||!i)this._append`L${this._x1=t},${this._y1=n}`;else{let g=r-o,j=a-c,b=d*d+f*f,y=g*g+j*j,S=Math.sqrt(b),C=Math.sqrt(x),N=i*Math.tan((m1-Math.acos((b+x-y)/(2*S*C)))/2),E=N/C,_=N/S;Math.abs(E-1)>No&&this._append`L${t+E*h},${n+E*p}`,this._append`A${i},${i},0,0,${+(p*g>h*j)},${this._x1=t+_*d},${this._y1=n+_*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,x=o?a-i:i-a;this._x1===null?this._append`M${f},${h}`:(Math.abs(this._x1-f)>No||Math.abs(this._y1-h)>No)&&this._append`L${f},${h}`,r&&(x<0&&(x=x%v1+v1),x>vX?this._append`A${r},${r},0,1,${p},${t-c},${n-d}A${r},${r},0,1,${p},${this._x1=f},${this._y1=h}`:x>No&&this._append`A${r},${r},0,${+(x>=m1)},${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 TN(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 xX(t)}function IN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function t5(e){this._context=e}t5.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 Pv(e){return new t5(e)}function n5(e){return e[0]}function r5(e){return e[1]}function a5(e,t){var n=gn(!0),r=null,a=Pv,i=null,o=TN(c);e=typeof e=="function"?e:e===void 0?n5:gn(e),t=typeof t=="function"?t:t===void 0?r5:gn(t);function c(d){var f,h=(d=IN(d)).length,p,x=!1,g;for(r==null&&(i=a(g=o())),f=0;f<=h;++f)!(f<h&&n(p=d[f],f,d))===x&&((x=!x)?i.lineStart():i.lineEnd()),x&&i.point(+e(p,f,d),+t(p,f,d));if(g)return i=null,g+""||null}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:gn(+d),c):e},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:gn(+d),c):t},c.defined=function(d){return arguments.length?(n=typeof d=="function"?d:gn(!!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 rh(e,t,n){var r=null,a=gn(!0),i=null,o=Pv,c=null,d=TN(f);e=typeof e=="function"?e:e===void 0?n5:gn(+e),t=typeof t=="function"?t:gn(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?r5:gn(+n);function f(p){var x,g,j,b=(p=IN(p)).length,y,S=!1,C,N=new Array(b),E=new Array(b);for(i==null&&(c=o(C=d())),x=0;x<=b;++x){if(!(x<b&&a(y=p[x],x,p))===S)if(S=!S)g=x,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),j=x-1;j>=g;--j)c.point(N[j],E[j]);c.lineEnd(),c.areaEnd()}S&&(N[x]=+e(y,x,p),E[x]=+t(y,x,p),c.point(r?+r(y,x,p):N[x],n?+n(y,x,p):E[x]))}if(C)return c=null,C+""||null}function h(){return a5().defined(a).curve(o).context(i)}return f.x=function(p){return arguments.length?(e=typeof p=="function"?p:gn(+p),r=null,f):e},f.x0=function(p){return arguments.length?(e=typeof p=="function"?p:gn(+p),f):e},f.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:gn(+p),f):r},f.y=function(p){return arguments.length?(t=typeof p=="function"?p:gn(+p),n=null,f):t},f.y0=function(p){return arguments.length?(t=typeof p=="function"?p:gn(+p),f):t},f.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:gn(+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:gn(!!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 s5{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 yX(e){return new s5(e,!0)}function bX(e){return new s5(e,!1)}const MN={draw(e,t){const n=Qa(t/Bh);e.moveTo(n,0),e.arc(0,0,n,0,Ev)}},wX={draw(e,t){const n=Qa(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()}},i5=Qa(1/3),jX=i5*2,SX={draw(e,t){const n=Qa(t/jX),r=n*i5;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},NX={draw(e,t){const n=Qa(t),r=-n/2;e.rect(r,r,n,n)}},CX=.8908130915292852,o5=Fh(Bh/10)/Fh(7*Bh/10),AX=Fh(Ev/10)*o5,_X=-Z3(Ev/10)*o5,EX={draw(e,t){const n=Qa(t*CX),r=AX*n,a=_X*n;e.moveTo(0,-n),e.lineTo(r,a);for(let i=1;i<5;++i){const o=Ev*i/5,c=Z3(o),d=Fh(o);e.lineTo(d*n,-c*n),e.lineTo(c*r-d*a,d*r+c*a)}e.closePath()}},qb=Qa(3),PX={draw(e,t){const n=-Qa(t/(qb*3));e.moveTo(0,n*2),e.lineTo(-qb*n,-n),e.lineTo(qb*n,-n),e.closePath()}},ga=-.5,xa=Qa(3)/2,g1=1/Qa(12),kX=(g1/2+1)*3,OX={draw(e,t){const n=Qa(t/kX),r=n/2,a=n*g1,i=r,o=n*g1+n,c=-i,d=o;e.moveTo(r,a),e.lineTo(i,o),e.lineTo(c,d),e.lineTo(ga*r-xa*a,xa*r+ga*a),e.lineTo(ga*i-xa*o,xa*i+ga*o),e.lineTo(ga*c-xa*d,xa*c+ga*d),e.lineTo(ga*r+xa*a,ga*a-xa*r),e.lineTo(ga*i+xa*o,ga*o-xa*i),e.lineTo(ga*c+xa*d,ga*d-xa*c),e.closePath()}};function RX(e,t){let n=null,r=TN(a);e=typeof e=="function"?e:gn(e||MN),t=typeof t=="function"?t:gn(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:gn(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:gn(+i),a):t},a.context=function(i){return arguments.length?(n=i??null,a):n},a}function zh(){}function Uh(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 l5(e){this._context=e}l5.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:Uh(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:Uh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function TX(e){return new l5(e)}function c5(e){this._context=e}c5.prototype={areaStart:zh,areaEnd:zh,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:Uh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function IX(e){return new c5(e)}function u5(e){this._context=e}u5.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:Uh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function MX(e){return new u5(e)}function d5(e){this._context=e}d5.prototype={areaStart:zh,areaEnd:zh,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 $X(e){return new d5(e)}function Yk(e){return e<0?-1:1}function Xk(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(Yk(i)+Yk(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(c))||0}function Qk(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Wb(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 qh(e){this._context=e}qh.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:Wb(this,this._t0,Qk(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,Wb(this,Qk(this,n=Xk(this,e,t)),n);break;default:Wb(this,this._t0,n=Xk(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function f5(e){this._context=new p5(e)}(f5.prototype=Object.create(qh.prototype)).point=function(e,t){qh.prototype.point.call(this,t,e)};function p5(e){this._context=e}p5.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 DX(e){return new qh(e)}function LX(e){return new f5(e)}function h5(e){this._context=e}h5.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=Jk(e),a=Jk(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 Jk(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 FX(e){return new h5(e)}function kv(e,t){this._context=e,this._t=t}kv.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 BX(e){return new kv(e,.5)}function zX(e){return new kv(e,0)}function UX(e){return new kv(e,1)}function yc(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 x1(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function qX(e,t){return e[t]}function WX(e){const t=[];return t.key=e,t}function VX(){var e=gn([]),t=x1,n=yc,r=qX;function a(i){var o=Array.from(e.apply(this,arguments),WX),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=IN(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:gn(Array.from(i)),a):e},a.value=function(i){return arguments.length?(r=typeof i=="function"?i:gn(+i),a):r},a.order=function(i){return arguments.length?(t=i==null?x1:typeof i=="function"?i:gn(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(n=i??yc,a):n},a}function HX(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}yc(e,t)}}function KX(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}yc(e,t)}}function GX(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,x=h[r-1][1]||0,g=(p-x)/2,j=0;j<c;++j){var b=e[t[j]],y=b[r][1]||0,S=b[r-1][1]||0;g+=y-S}d+=p,f+=g*p}a[r-1][1]+=a[r-1][0]=n,d&&(n-=f/d)}a[r-1][1]+=a[r-1][0]=n,yc(e,t)}}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)}var YX=["type","size","sizeType"];function y1(){return y1=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},y1.apply(this,arguments)}function Zk(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 eO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Zk(Object(n),!0).forEach(function(r){XX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function XX(e,t,n){return t=QX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QX(e){var t=JX(e,"string");return Pd(t)=="symbol"?t:t+""}function JX(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 ZX(e,t){if(e==null)return{};var n=eQ(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 eQ(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 m5={symbolCircle:MN,symbolCross:wX,symbolDiamond:SX,symbolSquare:NX,symbolStar:EX,symbolTriangle:PX,symbolWye:OX},tQ=Math.PI/180,nQ=function(t){var n="symbol".concat(_v(t));return m5[n]||MN},rQ=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*tQ;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}},aQ=function(t,n){m5["symbol".concat(_v(t))]=n},$N=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=ZX(t,YX),f=eO(eO({},d),{},{type:r,size:i,sizeType:c}),h=function(){var y=nQ(r),S=RX().type(y).size(rQ(i,c,r));return S()},p=f.className,x=f.cx,g=f.cy,j=yt(f,!0);return x===+x&&g===+g&&i===+i?H.createElement("path",y1({},j,{className:Rt("recharts-symbols",p),transform:"translate(".concat(x,", ").concat(g,")"),d:h()})):null};$N.registerSymbol=aQ;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 b1(){return b1=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},b1.apply(this,arguments)}function tO(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 sQ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tO(Object(n),!0).forEach(function(r){kd(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oQ(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 lQ(e,t,n){return t&&oQ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function cQ(e,t,n){return t=Wh(t),uQ(e,v5()?Reflect.construct(t,n||[],Wh(e).constructor):t.apply(e,n))}function uQ(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 dQ(e)}function dQ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(v5=function(){return!!e})()}function Wh(e){return Wh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Wh(e)}function fQ(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&w1(e,t)}function w1(e,t){return w1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},w1(e,t)}function kd(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=pQ(e,"string");return bc(t)=="symbol"?t:t+""}function pQ(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 ya=32,DN=(function(e){function t(){return iQ(this,t),cQ(this,t,arguments)}return fQ(t,e),lQ(t,[{key:"renderIcon",value:function(r){var a=this.props.inactiveColor,i=ya/2,o=ya/6,c=ya/3,d=r.inactive?a:r.color;if(r.type==="plainline")return H.createElement("line",{strokeWidth:4,fill:"none",stroke:d,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:i,x2:ya,y2:i,className:"recharts-legend-icon"});if(r.type==="line")return H.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(ya,"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 H.createElement("path",{stroke:"none",fill:d,d:"M0,".concat(ya/8,"h").concat(ya,"v").concat(ya*3/4,"h").concat(-ya,"z"),className:"recharts-legend-icon"});if(H.isValidElement(r.legendIcon)){var f=sQ({},r);return delete f.legendIcon,H.cloneElement(r.legendIcon,f)}return H.createElement($N,{fill:d,cx:i,cy:i,size:ya,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:ya,height:ya},p={display:c==="horizontal"?"inline-block":"block",marginRight:10},x={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(g,j){var b=g.formatter||d,y=Rt(kd(kd({"recharts-legend-item":!0},"legend-item-".concat(j),!0),"inactive",g.inactive));if(g.type==="none")return null;var S=Pt(g.value)?null:g.value;Qs(!Pt(g.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 C=g.inactive?f:g.color;return H.createElement("li",b1({className:y,style:p,key:"legend-item-".concat(j)},Fo(r.props,g,j)),H.createElement(p1,{width:o,height:o,viewBox:h,style:x},r.renderIcon(g)),H.createElement("span",{className:"recharts-legend-item-text",style:{color:C}},b?b(S,g,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 H.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(v.PureComponent);kd(DN,"displayName","Legend");kd(DN,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Vb,nO;function hQ(){if(nO)return Vb;nO=1;var e=Nv();function t(){this.__data__=new e,this.size=0}return Vb=t,Vb}var Hb,rO;function mQ(){if(rO)return Hb;rO=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return Hb=e,Hb}var Kb,aO;function vQ(){if(aO)return Kb;aO=1;function e(t){return this.__data__.get(t)}return Kb=e,Kb}var Gb,sO;function gQ(){if(sO)return Gb;sO=1;function e(t){return this.__data__.has(t)}return Gb=e,Gb}var Yb,iO;function xQ(){if(iO)return Yb;iO=1;var e=Nv(),t=_N(),n=EN(),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 Yb=a,Yb}var Xb,oO;function x5(){if(oO)return Xb;oO=1;var e=Nv(),t=hQ(),n=mQ(),r=vQ(),a=gQ(),i=xQ();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,Xb=o,Xb}var Qb,lO;function yQ(){if(lO)return Qb;lO=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return Qb=t,Qb}var Jb,cO;function bQ(){if(cO)return Jb;cO=1;function e(t){return this.__data__.has(t)}return Jb=e,Jb}var Zb,uO;function y5(){if(uO)return Zb;uO=1;var e=EN(),t=yQ(),n=bQ();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,Zb=r,Zb}var e0,dO;function b5(){if(dO)return e0;dO=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 e0=e,e0}var t0,fO;function w5(){if(fO)return t0;fO=1;function e(t,n){return t.has(n)}return t0=e,t0}var n0,pO;function j5(){if(pO)return n0;pO=1;var e=y5(),t=b5(),n=w5(),r=1,a=2;function i(o,c,d,f,h,p){var x=d&r,g=o.length,j=c.length;if(g!=j&&!(x&&j>g))return!1;var b=p.get(o),y=p.get(c);if(b&&y)return b==c&&y==o;var S=-1,C=!0,N=d&a?new e:void 0;for(p.set(o,c),p.set(c,o);++S<g;){var E=o[S],_=c[S];if(f)var P=x?f(_,E,S,c,o,p):f(E,_,S,o,c,p);if(P!==void 0){if(P)continue;C=!1;break}if(N){if(!t(c,function(O,R){if(!n(N,R)&&(E===O||h(E,O,d,f,p)))return N.push(R)})){C=!1;break}}else if(!(E===_||h(E,_,d,f,p))){C=!1;break}}return p.delete(o),p.delete(c),C}return n0=i,n0}var r0,hO;function wQ(){if(hO)return r0;hO=1;var e=Es(),t=e.Uint8Array;return r0=t,r0}var a0,mO;function jQ(){if(mO)return a0;mO=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a,i){r[++n]=[i,a]}),r}return a0=e,a0}var s0,vO;function LN(){if(vO)return s0;vO=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(a){r[++n]=a}),r}return s0=e,s0}var i0,gO;function SQ(){if(gO)return i0;gO=1;var e=Af(),t=wQ(),n=AN(),r=j5(),a=jQ(),i=LN(),o=1,c=2,d="[object Boolean]",f="[object Date]",h="[object Error]",p="[object Map]",x="[object Number]",g="[object RegExp]",j="[object Set]",b="[object String]",y="[object Symbol]",S="[object ArrayBuffer]",C="[object DataView]",N=e?e.prototype:void 0,E=N?N.valueOf:void 0;function _(P,O,R,L,T,D,M){switch(R){case C:if(P.byteLength!=O.byteLength||P.byteOffset!=O.byteOffset)return!1;P=P.buffer,O=O.buffer;case S:return!(P.byteLength!=O.byteLength||!D(new t(P),new t(O)));case d:case f:case x:return n(+P,+O);case h:return P.name==O.name&&P.message==O.message;case g:case b:return P==O+"";case p:var G=a;case j:var B=L&o;if(G||(G=i),P.size!=O.size&&!B)return!1;var W=M.get(P);if(W)return W==O;L|=c,M.set(P,O);var q=r(G(P),G(O),L,T,D,M);return M.delete(P),q;case y:if(E)return E.call(P)==E.call(O)}return!1}return i0=_,i0}var o0,xO;function S5(){if(xO)return o0;xO=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 o0=e,o0}var l0,yO;function NQ(){if(yO)return l0;yO=1;var e=S5(),t=Vr();function n(r,a,i){var o=a(r);return t(r)?o:e(o,i(r))}return l0=n,l0}var c0,bO;function CQ(){if(bO)return c0;bO=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 c0=e,c0}var u0,wO;function AQ(){if(wO)return u0;wO=1;function e(){return[]}return u0=e,u0}var d0,jO;function _Q(){if(jO)return d0;jO=1;var e=CQ(),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 d0=i,d0}var f0,SO;function EQ(){if(SO)return f0;SO=1;function e(t,n){for(var r=-1,a=Array(t);++r<t;)a[r]=n(r);return a}return f0=e,f0}var p0,NO;function PQ(){if(NO)return p0;NO=1;var e=ii(),t=oi(),n="[object Arguments]";function r(a){return t(a)&&e(a)==n}return p0=r,p0}var h0,CO;function FN(){if(CO)return h0;CO=1;var e=PQ(),t=oi(),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 h0=i,h0}var od={exports:{}},m0,AO;function kQ(){if(AO)return m0;AO=1;function e(){return!1}return m0=e,m0}od.exports;var _O;function N5(){return _O||(_O=1,(function(e,t){var n=Es(),r=kQ(),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})(od,od.exports)),od.exports}var v0,EO;function BN(){if(EO)return v0;EO=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 v0=n,v0}var g0,PO;function zN(){if(PO)return g0;PO=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return g0=t,g0}var x0,kO;function OQ(){if(kO)return x0;kO=1;var e=ii(),t=zN(),n=oi(),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]",x="[object RegExp]",g="[object Set]",j="[object String]",b="[object WeakMap]",y="[object ArrayBuffer]",S="[object DataView]",C="[object Float32Array]",N="[object Float64Array]",E="[object Int8Array]",_="[object Int16Array]",P="[object Int32Array]",O="[object Uint8Array]",R="[object Uint8ClampedArray]",L="[object Uint16Array]",T="[object Uint32Array]",D={};D[C]=D[N]=D[E]=D[_]=D[P]=D[O]=D[R]=D[L]=D[T]=!0,D[r]=D[a]=D[y]=D[i]=D[S]=D[o]=D[c]=D[d]=D[f]=D[h]=D[p]=D[x]=D[g]=D[j]=D[b]=!1;function M(G){return n(G)&&t(G.length)&&!!D[e(G)]}return x0=M,x0}var y0,OO;function C5(){if(OO)return y0;OO=1;function e(t){return function(n){return t(n)}}return y0=e,y0}var ld={exports:{}};ld.exports;var RO;function RQ(){return RO||(RO=1,(function(e,t){var n=V3(),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})(ld,ld.exports)),ld.exports}var b0,TO;function A5(){if(TO)return b0;TO=1;var e=OQ(),t=C5(),n=RQ(),r=n&&n.isTypedArray,a=r?t(r):e;return b0=a,b0}var w0,IO;function TQ(){if(IO)return w0;IO=1;var e=EQ(),t=FN(),n=Vr(),r=N5(),a=BN(),i=A5(),o=Object.prototype,c=o.hasOwnProperty;function d(f,h){var p=n(f),x=!p&&t(f),g=!p&&!x&&r(f),j=!p&&!x&&!g&&i(f),b=p||x||g||j,y=b?e(f.length,String):[],S=y.length;for(var C in f)(h||c.call(f,C))&&!(b&&(C=="length"||g&&(C=="offset"||C=="parent")||j&&(C=="buffer"||C=="byteLength"||C=="byteOffset")||a(C,S)))&&y.push(C);return y}return w0=d,w0}var j0,MO;function IQ(){if(MO)return j0;MO=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,a=typeof r=="function"&&r.prototype||e;return n===a}return j0=t,j0}var S0,$O;function _5(){if($O)return S0;$O=1;function e(t,n){return function(r){return t(n(r))}}return S0=e,S0}var N0,DO;function MQ(){if(DO)return N0;DO=1;var e=_5(),t=e(Object.keys,Object);return N0=t,N0}var C0,LO;function $Q(){if(LO)return C0;LO=1;var e=IQ(),t=MQ(),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 C0=a,C0}var A0,FO;function Ef(){if(FO)return A0;FO=1;var e=CN(),t=zN();function n(r){return r!=null&&t(r.length)&&!e(r)}return A0=n,A0}var _0,BO;function Ov(){if(BO)return _0;BO=1;var e=TQ(),t=$Q(),n=Ef();function r(a){return n(a)?e(a):t(a)}return _0=r,_0}var E0,zO;function DQ(){if(zO)return E0;zO=1;var e=NQ(),t=_Q(),n=Ov();function r(a){return e(a,n,t)}return E0=r,E0}var P0,UO;function LQ(){if(UO)return P0;UO=1;var e=DQ(),t=1,n=Object.prototype,r=n.hasOwnProperty;function a(i,o,c,d,f,h){var p=c&t,x=e(i),g=x.length,j=e(o),b=j.length;if(g!=b&&!p)return!1;for(var y=g;y--;){var S=x[y];if(!(p?S in o:r.call(o,S)))return!1}var C=h.get(i),N=h.get(o);if(C&&N)return C==o&&N==i;var E=!0;h.set(i,o),h.set(o,i);for(var _=p;++y<g;){S=x[y];var P=i[S],O=o[S];if(d)var R=p?d(O,P,S,o,i,h):d(P,O,S,i,o,h);if(!(R===void 0?P===O||f(P,O,c,d,h):R)){E=!1;break}_||(_=S=="constructor")}if(E&&!_){var L=i.constructor,T=o.constructor;L!=T&&"constructor"in i&&"constructor"in o&&!(typeof L=="function"&&L instanceof L&&typeof T=="function"&&T instanceof T)&&(E=!1)}return h.delete(i),h.delete(o),E}return P0=a,P0}var k0,qO;function FQ(){if(qO)return k0;qO=1;var e=nl(),t=Es(),n=e(t,"DataView");return k0=n,k0}var O0,WO;function BQ(){if(WO)return O0;WO=1;var e=nl(),t=Es(),n=e(t,"Promise");return O0=n,O0}var R0,VO;function E5(){if(VO)return R0;VO=1;var e=nl(),t=Es(),n=e(t,"Set");return R0=n,R0}var T0,HO;function zQ(){if(HO)return T0;HO=1;var e=nl(),t=Es(),n=e(t,"WeakMap");return T0=n,T0}var I0,KO;function UQ(){if(KO)return I0;KO=1;var e=FQ(),t=_N(),n=BQ(),r=E5(),a=zQ(),i=ii(),o=H3(),c="[object Map]",d="[object Object]",f="[object Promise]",h="[object Set]",p="[object WeakMap]",x="[object DataView]",g=o(e),j=o(t),b=o(n),y=o(r),S=o(a),C=i;return(e&&C(new e(new ArrayBuffer(1)))!=x||t&&C(new t)!=c||n&&C(n.resolve())!=f||r&&C(new r)!=h||a&&C(new a)!=p)&&(C=function(N){var E=i(N),_=E==d?N.constructor:void 0,P=_?o(_):"";if(P)switch(P){case g:return x;case j:return c;case b:return f;case y:return h;case S:return p}return E}),I0=C,I0}var M0,GO;function qQ(){if(GO)return M0;GO=1;var e=x5(),t=j5(),n=SQ(),r=LQ(),a=UQ(),i=Vr(),o=N5(),c=A5(),d=1,f="[object Arguments]",h="[object Array]",p="[object Object]",x=Object.prototype,g=x.hasOwnProperty;function j(b,y,S,C,N,E){var _=i(b),P=i(y),O=_?h:a(b),R=P?h:a(y);O=O==f?p:O,R=R==f?p:R;var L=O==p,T=R==p,D=O==R;if(D&&o(b)){if(!o(y))return!1;_=!0,L=!1}if(D&&!L)return E||(E=new e),_||c(b)?t(b,y,S,C,N,E):n(b,y,O,S,C,N,E);if(!(S&d)){var M=L&&g.call(b,"__wrapped__"),G=T&&g.call(y,"__wrapped__");if(M||G){var B=M?b.value():b,W=G?y.value():y;return E||(E=new e),N(B,W,S,C,E)}}return D?(E||(E=new e),r(b,y,S,C,N,E)):!1}return M0=j,M0}var $0,YO;function UN(){if(YO)return $0;YO=1;var e=qQ(),t=oi();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 $0=n,$0}var D0,XO;function WQ(){if(XO)return D0;XO=1;var e=x5(),t=UN(),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 x=c[f];if(p&&x[2]?x[1]!==i[x[0]]:!(x[0]in i))return!1}for(;++f<h;){x=c[f];var g=x[0],j=i[g],b=x[1];if(p&&x[2]){if(j===void 0&&!(g in i))return!1}else{var y=new e;if(d)var S=d(j,b,g,i,o,y);if(!(S===void 0?t(b,j,n|r,d,y):S))return!1}}return!0}return D0=a,D0}var L0,QO;function P5(){if(QO)return L0;QO=1;var e=Ji();function t(n){return n===n&&!e(n)}return L0=t,L0}var F0,JO;function VQ(){if(JO)return F0;JO=1;var e=P5(),t=Ov();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 F0=n,F0}var B0,ZO;function k5(){if(ZO)return B0;ZO=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return B0=e,B0}var z0,eR;function HQ(){if(eR)return z0;eR=1;var e=WQ(),t=VQ(),n=k5();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 z0=r,z0}var U0,tR;function KQ(){if(tR)return U0;tR=1;function e(t,n){return t!=null&&n in Object(t)}return U0=e,U0}var q0,nR;function GQ(){if(nR)return q0;nR=1;var e=Y3(),t=FN(),n=Vr(),r=BN(),a=zN(),i=Av();function o(c,d,f){d=e(d,c);for(var h=-1,p=d.length,x=!1;++h<p;){var g=i(d[h]);if(!(x=c!=null&&f(c,g)))break;c=c[g]}return x||++h!=p?x:(p=c==null?0:c.length,!!p&&a(p)&&r(g,p)&&(n(c)||t(c)))}return q0=o,q0}var W0,rR;function YQ(){if(rR)return W0;rR=1;var e=KQ(),t=GQ();function n(r,a){return r!=null&&t(r,a,e)}return W0=n,W0}var V0,aR;function XQ(){if(aR)return V0;aR=1;var e=UN(),t=X3(),n=YQ(),r=NN(),a=P5(),i=k5(),o=Av(),c=1,d=2;function f(h,p){return r(h)&&a(p)?i(o(h),p):function(x){var g=t(x,h);return g===void 0&&g===p?n(x,h):e(p,g,c|d)}}return V0=f,V0}var H0,sR;function iu(){if(sR)return H0;sR=1;function e(t){return t}return H0=e,H0}var K0,iR;function QQ(){if(iR)return K0;iR=1;function e(t){return function(n){return n?.[t]}}return K0=e,K0}var G0,oR;function JQ(){if(oR)return G0;oR=1;var e=kN();function t(n){return function(r){return e(r,n)}}return G0=t,G0}var Y0,lR;function ZQ(){if(lR)return Y0;lR=1;var e=QQ(),t=JQ(),n=NN(),r=Av();function a(i){return n(i)?e(r(i)):t(i)}return Y0=a,Y0}var X0,cR;function Ps(){if(cR)return X0;cR=1;var e=HQ(),t=XQ(),n=iu(),r=Vr(),a=ZQ();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 X0=i,X0}var Q0,uR;function O5(){if(uR)return Q0;uR=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 Q0=e,Q0}var J0,dR;function eJ(){if(dR)return J0;dR=1;function e(t){return t!==t}return J0=e,J0}var Z0,fR;function tJ(){if(fR)return Z0;fR=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 Z0=e,Z0}var ew,pR;function nJ(){if(pR)return ew;pR=1;var e=O5(),t=eJ(),n=tJ();function r(a,i,o){return i===i?n(a,i,o):e(a,t,o)}return ew=r,ew}var tw,hR;function rJ(){if(hR)return tw;hR=1;var e=nJ();function t(n,r){var a=n==null?0:n.length;return!!a&&e(n,r,0)>-1}return tw=t,tw}var nw,mR;function aJ(){if(mR)return nw;mR=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 nw=e,nw}var rw,vR;function sJ(){if(vR)return rw;vR=1;function e(){}return rw=e,rw}var aw,gR;function iJ(){if(gR)return aw;gR=1;var e=E5(),t=sJ(),n=LN(),r=1/0,a=e&&1/n(new e([,-0]))[1]==r?function(i){return new e(i)}:t;return aw=a,aw}var sw,xR;function oJ(){if(xR)return sw;xR=1;var e=y5(),t=rJ(),n=aJ(),r=w5(),a=iJ(),i=LN(),o=200;function c(d,f,h){var p=-1,x=t,g=d.length,j=!0,b=[],y=b;if(h)j=!1,x=n;else if(g>=o){var S=f?null:a(d);if(S)return i(S);j=!1,x=r,y=new e}else y=f?[]:b;e:for(;++p<g;){var C=d[p],N=f?f(C):C;if(C=h||C!==0?C:0,j&&N===N){for(var E=y.length;E--;)if(y[E]===N)continue e;f&&y.push(N),b.push(C)}else x(y,N,h)||(y!==b&&y.push(N),b.push(C))}return b}return sw=c,sw}var iw,yR;function lJ(){if(yR)return iw;yR=1;var e=Ps(),t=oJ();function n(r,a){return r&&r.length?t(r,e(a,2)):[]}return iw=n,iw}var cJ=lJ();const bR=an(cJ);function R5(e,t,n){return t===!0?bR(e,n):Pt(t)?bR(e,t):e}function wc(e){"@babel/helpers - typeof";return wc=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},wc(e)}var uJ=["ref"];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 Us(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){Rv(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 dJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jR(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,I5(r.key),r)}}function fJ(e,t,n){return t&&jR(e.prototype,t),n&&jR(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function pJ(e,t,n){return t=Vh(t),hJ(e,T5()?Reflect.construct(t,n||[],Vh(e).constructor):t.apply(e,n))}function hJ(e,t){if(t&&(wc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mJ(e)}function mJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function T5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(T5=function(){return!!e})()}function Vh(e){return Vh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Vh(e)}function vJ(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&&j1(e,t)}function j1(e,t){return j1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},j1(e,t)}function Rv(e,t,n){return t=I5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function I5(e){var t=gJ(e,"string");return wc(t)=="symbol"?t:t+""}function gJ(e,t){if(wc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(wc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function xJ(e,t){if(e==null)return{};var n=yJ(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 yJ(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 bJ(e){return e.value}function wJ(e,t){if(H.isValidElement(e))return H.cloneElement(e,t);if(typeof e=="function")return H.createElement(e,t);t.ref;var n=xJ(t,uJ);return H.createElement(DN,n)}var SR=1,Ro=(function(e){function t(){var n;dJ(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=pJ(this,t,[].concat(a)),Rv(n,"lastBoundingBox",{width:-1,height:-1}),n}return vJ(t,e),fJ(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)>SR||Math.abs(a.height-this.lastBoundingBox.height)>SR)&&(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?Us({},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,x;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&i==="vertical"){var g=this.getBBoxSnapshot();p={left:((f||0)-g.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();x={top:((h||0)-j.height)/2}}else x=c==="bottom"?{bottom:d&&d.bottom||0}:{top:d&&d.top||0};return Us(Us({},p),x)}},{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=Us(Us({position:"absolute",width:o||"auto",height:c||"auto"},this.getDefaultPosition(d)),d);return H.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(g){r.wrapperNode=g}},wJ(i,Us(Us({},this.props),{},{payload:R5(h,f,bJ)})))}}],[{key:"getWithHeight",value:function(r,a){var i=Us(Us({},this.defaultProps),r.props),o=i.layout;return o==="vertical"&&Ve(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||a}:null}}])})(v.PureComponent);Rv(Ro,"displayName","Legend");Rv(Ro,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var ow,NR;function jJ(){if(NR)return ow;NR=1;var e=Af(),t=FN(),n=Vr(),r=e?e.isConcatSpreadable:void 0;function a(i){return n(i)||t(i)||!!(r&&i&&i[r])}return ow=a,ow}var lw,CR;function M5(){if(CR)return lw;CR=1;var e=S5(),t=jJ();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 lw=n,lw}var cw,AR;function SJ(){if(AR)return cw;AR=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 cw=e,cw}var uw,_R;function NJ(){if(_R)return uw;_R=1;var e=SJ(),t=e();return uw=t,uw}var dw,ER;function $5(){if(ER)return dw;ER=1;var e=NJ(),t=Ov();function n(r,a){return r&&e(r,a,t)}return dw=n,dw}var fw,PR;function CJ(){if(PR)return fw;PR=1;var e=Ef();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 fw=t,fw}var pw,kR;function qN(){if(kR)return pw;kR=1;var e=$5(),t=CJ(),n=t(e);return pw=n,pw}var hw,OR;function D5(){if(OR)return hw;OR=1;var e=qN(),t=Ef();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 hw=n,hw}var mw,RR;function AJ(){if(RR)return mw;RR=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return mw=e,mw}var vw,TR;function _J(){if(TR)return vw;TR=1;var e=ru();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 vw=t,vw}var gw,IR;function EJ(){if(IR)return gw;IR=1;var e=_J();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 gw=t,gw}var xw,MR;function PJ(){if(MR)return xw;MR=1;var e=PN(),t=kN(),n=Ps(),r=D5(),a=AJ(),i=C5(),o=EJ(),c=iu(),d=Vr();function f(h,p,x){p.length?p=e(p,function(b){return d(b)?function(y){return t(y,b.length===1?b[0]:b)}:b}):p=[c];var g=-1;p=e(p,i(n));var j=r(h,function(b,y,S){var C=e(p,function(N){return N(b)});return{criteria:C,index:++g,value:b}});return a(j,function(b,y){return o(b,y,x)})}return xw=f,xw}var yw,$R;function kJ(){if($R)return yw;$R=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 yw=e,yw}var bw,DR;function OJ(){if(DR)return bw;DR=1;var e=kJ(),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 bw=n,bw}var ww,LR;function RJ(){if(LR)return ww;LR=1;function e(t){return function(){return t}}return ww=e,ww}var jw,FR;function L5(){if(FR)return jw;FR=1;var e=nl(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return jw=t,jw}var Sw,BR;function TJ(){if(BR)return Sw;BR=1;var e=RJ(),t=L5(),n=iu(),r=t?function(a,i){return t(a,"toString",{configurable:!0,enumerable:!1,value:e(i),writable:!0})}:n;return Sw=r,Sw}var Nw,zR;function IJ(){if(zR)return Nw;zR=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 Nw=r,Nw}var Cw,UR;function MJ(){if(UR)return Cw;UR=1;var e=TJ(),t=IJ(),n=t(e);return Cw=n,Cw}var Aw,qR;function $J(){if(qR)return Aw;qR=1;var e=iu(),t=OJ(),n=MJ();function r(a,i){return n(t(a,i,e),a+"")}return Aw=r,Aw}var _w,WR;function Tv(){if(WR)return _w;WR=1;var e=AN(),t=Ef(),n=BN(),r=Ji();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 _w=a,_w}var Ew,VR;function DJ(){if(VR)return Ew;VR=1;var e=M5(),t=PJ(),n=$J(),r=Tv(),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 Ew=a,Ew}var LJ=DJ();const WN=an(LJ);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 S1(){return S1=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},S1.apply(this,arguments)}function FJ(e,t){return qJ(e)||UJ(e,t)||zJ(e,t)||BJ()}function BJ(){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 zJ(e,t){if(e){if(typeof e=="string")return HR(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 HR(e,t)}}function HR(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 UJ(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 qJ(e){if(Array.isArray(e))return e}function KR(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 Pw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KR(Object(n),!0).forEach(function(r){WJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WJ(e,t,n){return t=VJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VJ(e){var t=HJ(e,"string");return Od(t)=="symbol"?t:t+""}function HJ(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 KJ(e){return Array.isArray(e)&&Zn(e[0])&&Zn(e[1])?e.join(" ~ "):e}var GJ=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,x=t.itemSorter,g=t.wrapperClassName,j=t.labelClassName,b=t.label,y=t.labelFormatter,S=t.accessibilityLayer,C=S===void 0?!1:S,N=function(){if(h&&h.length){var M={padding:0,margin:0},G=(x?WN(h,x):h).map(function(B,W){if(B.type==="none")return null;var q=Pw({display:"block",paddingTop:4,paddingBottom:4,color:B.color||"#000"},c),V=B.formatter||p||KJ,F=B.value,U=B.name,Z=F,z=U;if(V&&Z!=null&&z!=null){var $=V(F,U,B,W,h);if(Array.isArray($)){var te=FJ($,2);Z=te[0],z=te[1]}else Z=$}return H.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(W),style:q},Zn(z)?H.createElement("span",{className:"recharts-tooltip-item-name"},z):null,Zn(z)?H.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,H.createElement("span",{className:"recharts-tooltip-item-value"},Z),H.createElement("span",{className:"recharts-tooltip-item-unit"},B.unit||""))});return H.createElement("ul",{className:"recharts-tooltip-item-list",style:M},G)}return null},E=Pw({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),_=Pw({margin:0},f),P=!kt(b),O=P?b:"",R=Rt("recharts-default-tooltip",g),L=Rt("recharts-tooltip-label",j);P&&y&&h!==void 0&&h!==null&&(O=y(b,h));var T=C?{role:"status","aria-live":"assertive"}:{};return H.createElement("div",S1({className:R,style:E},T),H.createElement("p",{className:L,style:_},H.isValidElement(O)?O:"".concat(O)),N())};function Rd(e){"@babel/helpers - typeof";return Rd=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},Rd(e)}function ah(e,t,n){return t=YJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YJ(e){var t=XJ(e,"string");return Rd(t)=="symbol"?t:t+""}function XJ(e,t){if(Rd(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Rd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Xu="recharts-tooltip-wrapper",QJ={visibility:"hidden"};function JJ(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Rt(Xu,ah(ah(ah(ah({},"".concat(Xu,"-right"),Ve(n)&&t&&Ve(t.x)&&n>=t.x),"".concat(Xu,"-left"),Ve(n)&&t&&Ve(t.x)&&n<t.x),"".concat(Xu,"-bottom"),Ve(r)&&t&&Ve(t.y)&&r>=t.y),"".concat(Xu,"-top"),Ve(r)&&t&&Ve(t.y)&&r<t.y))}function GR(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&&Ve(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 x=h,g=d[r];return x<g?Math.max(p,d[r]):Math.max(h,d[r])}var j=p+c,b=d[r]+f;return j>b?Math.max(h,d[r]):Math.max(p,d[r])}function ZJ(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 eZ(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=GR({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:d,viewBoxDimension:d.width}),p=GR({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:d,viewBoxDimension:d.height}),f=ZJ({translateX:h,translateY:p,useTranslate3d:c})):f=QJ,{cssProperties:f,cssClasses:JJ({translateX:h,translateY:p,coordinate:n})}}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 YR(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 XR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YR(Object(n),!0).forEach(function(r){C1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nZ(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,B5(r.key),r)}}function rZ(e,t,n){return t&&nZ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function aZ(e,t,n){return t=Hh(t),sZ(e,F5()?Reflect.construct(t,n||[],Hh(e).constructor):t.apply(e,n))}function sZ(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 iZ(e)}function iZ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function F5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(F5=function(){return!!e})()}function Hh(e){return Hh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Hh(e)}function oZ(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&&N1(e,t)}function N1(e,t){return N1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},N1(e,t)}function C1(e,t,n){return t=B5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B5(e){var t=lZ(e,"string");return jc(t)=="symbol"?t:t+""}function lZ(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)}var QR=1,cZ=(function(e){function t(){var n;tZ(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=aZ(this,t,[].concat(a)),C1(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),C1(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 oZ(t,e),rZ(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>QR||Math.abs(r.height-this.state.lastBoundingBox.height)>QR)&&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,x=a.isAnimationActive,g=a.offset,j=a.position,b=a.reverseDirection,y=a.useTranslate3d,S=a.viewBox,C=a.wrapperStyle,N=eZ({allowEscapeViewBox:o,coordinate:h,offsetTopLeft:g,position:j,reverseDirection:b,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:S}),E=N.cssClasses,_=N.cssProperties,P=XR(XR({transition:x&&i?"transform ".concat(c,"ms ").concat(d):void 0},_),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&p?"visible":"hidden",position:"absolute",top:0,left:0},C);return H.createElement("div",{tabIndex:-1,className:E,style:P,ref:function(R){r.wrapperNode=R}},f)}}])})(v.PureComponent),uZ=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},rl={isSsr:uZ()};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 JR(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 ZR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JR(Object(n),!0).forEach(function(r){VN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fZ(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,U5(r.key),r)}}function pZ(e,t,n){return t&&fZ(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function hZ(e,t,n){return t=Kh(t),mZ(e,z5()?Reflect.construct(t,n||[],Kh(e).constructor):t.apply(e,n))}function mZ(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 vZ(e)}function vZ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function z5(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(z5=function(){return!!e})()}function Kh(e){return Kh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Kh(e)}function gZ(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&&A1(e,t)}function A1(e,t){return A1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},A1(e,t)}function VN(e,t,n){return t=U5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U5(e){var t=xZ(e,"string");return Sc(t)=="symbol"?t:t+""}function xZ(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 yZ(e){return e.dataKey}function bZ(e,t){return H.isValidElement(e)?H.cloneElement(e,t):typeof e=="function"?H.createElement(e,t):H.createElement(GJ,t)}var Fr=(function(e){function t(){return dZ(this,t),hZ(this,t,arguments)}return gZ(t,e),pZ(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,x=a.isAnimationActive,g=a.offset,j=a.payload,b=a.payloadUniqBy,y=a.position,S=a.reverseDirection,C=a.useTranslate3d,N=a.viewBox,E=a.wrapperStyle,_=j??[];p&&_.length&&(_=R5(j.filter(function(O){return O.value!=null&&(O.hide!==!0||r.props.includeHidden)}),b,yZ));var P=_.length>0;return H.createElement(cZ,{allowEscapeViewBox:o,animationDuration:c,animationEasing:d,isAnimationActive:x,active:i,coordinate:h,hasPayload:P,offset:g,position:y,reverseDirection:S,useTranslate3d:C,viewBox:N,wrapperStyle:E},bZ(f,ZR(ZR({},this.props),{},{payload:_})))}}])})(v.PureComponent);VN(Fr,"displayName","Tooltip");VN(Fr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!rl.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 kw,eT;function wZ(){if(eT)return kw;eT=1;var e=Es(),t=function(){return e.Date.now()};return kw=t,kw}var Ow,tT;function jZ(){if(tT)return Ow;tT=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return Ow=t,Ow}var Rw,nT;function SZ(){if(nT)return Rw;nT=1;var e=jZ(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return Rw=n,Rw}var Tw,rT;function q5(){if(rT)return Tw;rT=1;var e=SZ(),t=Ji(),n=ru(),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 Tw=d,Tw}var Iw,aT;function NZ(){if(aT)return Iw;aT=1;var e=Ji(),t=wZ(),n=q5(),r="Expected a function",a=Math.max,i=Math.min;function o(c,d,f){var h,p,x,g,j,b,y=0,S=!1,C=!1,N=!0;if(typeof c!="function")throw new TypeError(r);d=n(d)||0,e(f)&&(S=!!f.leading,C="maxWait"in f,x=C?a(n(f.maxWait)||0,d):x,N="trailing"in f?!!f.trailing:N);function E(G){var B=h,W=p;return h=p=void 0,y=G,g=c.apply(W,B),g}function _(G){return y=G,j=setTimeout(R,d),S?E(G):g}function P(G){var B=G-b,W=G-y,q=d-B;return C?i(q,x-W):q}function O(G){var B=G-b,W=G-y;return b===void 0||B>=d||B<0||C&&W>=x}function R(){var G=t();if(O(G))return L(G);j=setTimeout(R,P(G))}function L(G){return j=void 0,N&&h?E(G):(h=p=void 0,g)}function T(){j!==void 0&&clearTimeout(j),y=0,h=b=p=j=void 0}function D(){return j===void 0?g:L(t())}function M(){var G=t(),B=O(G);if(h=arguments,p=this,b=G,B){if(j===void 0)return _(b);if(C)return clearTimeout(j),j=setTimeout(R,d),E(b)}return j===void 0&&(j=setTimeout(R,d)),g}return M.cancel=T,M.flush=D,M}return Iw=o,Iw}var Mw,sT;function CZ(){if(sT)return Mw;sT=1;var e=NZ(),t=Ji(),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 Mw=r,Mw}var AZ=CZ();const W5=an(AZ);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)}function iT(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 sh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iT(Object(n),!0).forEach(function(r){_Z(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _Z(e,t,n){return t=EZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EZ(e){var t=PZ(e,"string");return Td(t)=="symbol"?t:t+""}function PZ(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 kZ(e,t){return IZ(e)||TZ(e,t)||RZ(e,t)||OZ()}function OZ(){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 RZ(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 TZ(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 IZ(e){if(Array.isArray(e))return e}var Gh=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,x=e.maxHeight,g=e.children,j=e.debounce,b=j===void 0?0:j,y=e.id,S=e.className,C=e.onResize,N=e.style,E=N===void 0?{}:N,_=v.useRef(null),P=v.useRef();P.current=C,v.useImperativeHandle(t,function(){return Object.defineProperty(_.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),_.current},configurable:!0})});var O=v.useState({containerWidth:a.width,containerHeight:a.height}),R=kZ(O,2),L=R[0],T=R[1],D=v.useCallback(function(G,B){T(function(W){var q=Math.round(G),V=Math.round(B);return W.containerWidth===q&&W.containerHeight===V?W:{containerWidth:q,containerHeight:V}})},[]);v.useEffect(function(){var G=function(U){var Z,z=U[0].contentRect,$=z.width,te=z.height;D($,te),(Z=P.current)===null||Z===void 0||Z.call(P,$,te)};b>0&&(G=W5(G,b,{trailing:!0,leading:!1}));var B=new ResizeObserver(G),W=_.current.getBoundingClientRect(),q=W.width,V=W.height;return D(q,V),B.observe(_.current),function(){B.disconnect()}},[D,b]);var M=v.useMemo(function(){var G=L.containerWidth,B=L.containerHeight;if(G<0||B<0)return null;Qs(_o(o)||_o(d),`The width(%s) and height(%s) are both fixed numbers,
62
- maybe you don't need to use a ResponsiveContainer.`,o,d),Qs(!n||n>0,"The aspect(%s) must be greater than zero.",n);var W=_o(o)?G:o,q=_o(d)?B:d;n&&n>0&&(W?q=W/n:q&&(W=q*n),x&&q>x&&(q=x)),Qs(W>0||q>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.`,W,q,o,d,h,p,n);var V=!Array.isArray(g)&&Xs(g.type).endsWith("Chart");return H.Children.map(g,function(F){return H.isValidElement(F)?v.cloneElement(F,sh({width:W,height:q},V?{style:sh({height:"100%",width:"100%",maxHeight:q,maxWidth:W},F.props.style)}:{})):F})},[n,g,d,x,p,h,L,o]);return H.createElement("div",{id:y?"".concat(y):void 0,className:Rt("recharts-responsive-container",S),style:sh(sh({},E),{},{width:o,height:d,minWidth:h,minHeight:p,maxHeight:x}),ref:_},M)}),Iv=function(t){return null};Iv.displayName="Cell";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 lT(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 _1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lT(Object(n),!0).forEach(function(r){MZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MZ(e,t,n){return t=$Z(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $Z(e){var t=DZ(e,"string");return Id(t)=="symbol"?t:t+""}function DZ(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 zl={widthCache:{},cacheCount:0},LZ=2e3,FZ={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},cT="recharts_measurement_span";function BZ(e){var t=_1({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var hd=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||rl.isSsr)return{width:0,height:0};var r=BZ(n),a=JSON.stringify({text:t,copyStyle:r});if(zl.widthCache[a])return zl.widthCache[a];try{var i=document.getElementById(cT);i||(i=document.createElement("span"),i.setAttribute("id",cT),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=_1(_1({},FZ),r);Object.assign(i.style,o),i.textContent="".concat(t);var c=i.getBoundingClientRect(),d={width:c.width,height:c.height};return zl.widthCache[a]=d,++zl.cacheCount>LZ&&(zl.cacheCount=0,zl.widthCache={}),d}catch{return{width:0,height:0}}},zZ=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};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 Yh(e,t){return VZ(e)||WZ(e,t)||qZ(e,t)||UZ()}function UZ(){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 qZ(e,t){if(e){if(typeof e=="string")return uT(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 uT(e,t)}}function uT(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 WZ(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 VZ(e){if(Array.isArray(e))return e}function HZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dT(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,GZ(r.key),r)}}function KZ(e,t,n){return t&&dT(e.prototype,t),n&&dT(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function GZ(e){var t=YZ(e,"string");return Md(t)=="symbol"?t:t+""}function YZ(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 String(e)}var fT=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,pT=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,XZ=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,QZ=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,V5={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},JZ=Object.keys(V5),Jl="NaN";function ZZ(e,t){return e*V5[t]}var ih=(function(){function e(t,n){HZ(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!XZ.test(n)&&(this.num=NaN,this.unit=""),JZ.includes(n)&&(this.num=ZZ(t,n),this.unit="px")}return KZ(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=QZ.exec(n))!==null&&r!==void 0?r:[],i=Yh(a,3),o=i[1],c=i[2];return new e(parseFloat(o),c??"")}}])})();function H5(e){if(e.includes(Jl))return Jl;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=fT.exec(t))!==null&&n!==void 0?n:[],a=Yh(r,4),i=a[1],o=a[2],c=a[3],d=ih.parse(i??""),f=ih.parse(c??""),h=o==="*"?d.multiply(f):d.divide(f);if(h.isNaN())return Jl;t=t.replace(fT,h.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,x=(p=pT.exec(t))!==null&&p!==void 0?p:[],g=Yh(x,4),j=g[1],b=g[2],y=g[3],S=ih.parse(j??""),C=ih.parse(y??""),N=b==="+"?S.add(C):S.subtract(C);if(N.isNaN())return Jl;t=t.replace(pT,N.toString())}return t}var hT=/\(([^()]*)\)/;function eee(e){for(var t=e;t.includes("(");){var n=hT.exec(t),r=Yh(n,2),a=r[1];t=t.replace(hT,H5(a))}return t}function tee(e){var t=e.replace(/\s+/g,"");return t=eee(t),t=H5(t),t}function nee(e){try{return tee(e)}catch{return Jl}}function $w(e){var t=nee(e.slice(5,-1));return t===Jl?"":t}var ree=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],aee=["dx","dy","angle","className","breakAll"];function E1(){return E1=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},E1.apply(this,arguments)}function mT(e,t){if(e==null)return{};var n=see(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 see(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 vT(e,t){return cee(e)||lee(e,t)||oee(e,t)||iee()}function iee(){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 oee(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 lee(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 cee(e){if(Array.isArray(e))return e}var K5=/[ \f\n\r\t\v\u2028\u2029]+/,G5=function(t){var n=t.children,r=t.breakAll,a=t.style;try{var i=[];kt(n)||(r?i=n.toString().split(""):i=n.toString().split(K5));var o=i.map(function(d){return{word:d,width:hd(d,a).width}}),c=r?0:hd(" ",a).width;return{wordsWithComputedWidth:o,spaceWidth:c}}catch{return null}},uee=function(t,n,r,a,i){var o=t.maxLines,c=t.children,d=t.style,f=t.breakAll,h=Ve(o),p=c,x=function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return W.reduce(function(q,V){var F=V.word,U=V.width,Z=q[q.length-1];if(Z&&(a==null||i||Z.width+U+r<Number(a)))Z.words.push(F),Z.width+=U+r;else{var z={words:[F],width:U};q.push(z)}return q},[])},g=x(n),j=function(W){return W.reduce(function(q,V){return q.width>V.width?q:V})};if(!h)return g;for(var b="…",y=function(W){var q=p.slice(0,W),V=G5({breakAll:f,style:d,children:q+b}).wordsWithComputedWidth,F=x(V),U=F.length>o||j(F).width>Number(a);return[U,F]},S=0,C=p.length-1,N=0,E;S<=C&&N<=p.length-1;){var _=Math.floor((S+C)/2),P=_-1,O=y(P),R=vT(O,2),L=R[0],T=R[1],D=y(_),M=vT(D,1),G=M[0];if(!L&&!G&&(S=_+1),L&&G&&(C=_-1),!L&&G){E=T;break}N++}return E||g},xT=function(t){var n=kt(t)?[]:t.toString().split(K5);return[{words:n}]},dee=function(t){var n=t.width,r=t.scaleToFit,a=t.children,i=t.style,o=t.breakAll,c=t.maxLines;if((n||r)&&!rl.isSsr){var d,f,h=G5({breakAll:o,children:a,style:i});if(h){var p=h.wordsWithComputedWidth,x=h.spaceWidth;d=p,f=x}else return xT(a);return uee({breakAll:o,children:a,maxLines:c,style:i},d,f,n,r)}return xT(a)},yT="#808080",Bo=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,x=t.textAnchor,g=x===void 0?"start":x,j=t.verticalAnchor,b=j===void 0?"end":j,y=t.fill,S=y===void 0?yT:y,C=mT(t,ree),N=v.useMemo(function(){return dee({breakAll:C.breakAll,children:C.children,maxLines:C.maxLines,scaleToFit:p,style:C.style,width:C.width})},[C.breakAll,C.children,C.maxLines,p,C.style,C.width]),E=C.dx,_=C.dy,P=C.angle,O=C.className,R=C.breakAll,L=mT(C,aee);if(!Zn(r)||!Zn(i))return null;var T=r+(Ve(E)?E:0),D=i+(Ve(_)?_:0),M;switch(b){case"start":M=$w("calc(".concat(f,")"));break;case"middle":M=$w("calc(".concat((N.length-1)/2," * -").concat(c," + (").concat(f," / 2))"));break;default:M=$w("calc(".concat(N.length-1," * -").concat(c,")"));break}var G=[];if(p){var B=N[0].width,W=C.width;G.push("scale(".concat((Ve(W)?W/B:1)/B,")"))}return P&&G.push("rotate(".concat(P,", ").concat(T,", ").concat(D,")")),G.length&&(L.transform=G.join(" ")),H.createElement("text",E1({},yt(L,!0),{x:T,y:D,className:Rt("recharts-text",O),textAnchor:g,fill:S.includes("url")?yT:S}),N.map(function(q,V){var F=q.words.join(R?"":" ");return H.createElement("tspan",{x:T,dy:V===0?M:c,key:"".concat(F,"-").concat(V)},F)}))};function Ui(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function fee(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function HN(e){let t,n,r;e.length!==2?(t=Ui,n=(c,d)=>Ui(e(c),d),r=(c,d)=>e(c)-d):(t=e===Ui||e===fee?e:pee,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 pee(){return 0}function Y5(e){return e===null?NaN:+e}function*hee(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const mee=HN(Ui),Pf=mee.right;HN(Y5).center;class bT extends Map{constructor(t,n=xee){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(wT(this,t))}has(t){return super.has(wT(this,t))}set(t,n){return super.set(vee(this,t),n)}delete(t){return super.delete(gee(this,t))}}function wT({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function vee({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function gee({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function xee(e){return e!==null&&typeof e=="object"?e.valueOf():e}function yee(e=Ui){if(e===Ui)return X5;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 X5(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const bee=Math.sqrt(50),wee=Math.sqrt(10),jee=Math.sqrt(2);function Xh(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>=bee?10:i>=wee?5:i>=jee?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?Xh(e,t,n*2):[c,d,f]}function P1(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?Xh(t,e,n):Xh(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 k1(e,t,n){return t=+t,e=+e,n=+n,Xh(e,t,n)[2]}function O1(e,t,n){t=+t,e=+e,n=+n;const r=t<e,a=r?k1(t,e,n):k1(e,t,n);return(r?-1:1)*(a<0?1/-a:a)}function jT(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function ST(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function Q5(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?X5:yee(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),x=.5*Math.sqrt(h*p*(d-p)/d)*(f-d/2<0?-1:1),g=Math.max(n,Math.floor(t-f*p/d+x)),j=Math.min(r,Math.floor(t+(d-f)*p/d+x));Q5(e,t,g,j,a)}const i=e[t];let o=n,c=r;for(Qu(e,n,t),a(e[r],i)>0&&Qu(e,n,r);o<c;){for(Qu(e,o,c),++o,--c;a(e[o],i)<0;)++o;for(;a(e[c],i)>0;)--c}a(e[n],i)===0?Qu(e,n,c):(++c,Qu(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function Qu(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function See(e,t,n){if(e=Float64Array.from(hee(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return ST(e);if(t>=1)return jT(e);var r,a=(r-1)*t,i=Math.floor(a),o=jT(Q5(e,i).subarray(0,i+1)),c=ST(e.subarray(i+1));return o+(c-o)*(a-i)}}function Nee(e,t,n=Y5){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 Cee(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 ka(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function li(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 R1=Symbol("implicit");function KN(){var e=new bT,t=[],n=[],r=R1;function a(i){let o=e.get(i);if(o===void 0){if(r!==R1)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 bT;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 KN(t,n).unknown(r)},ka.apply(a,arguments),a}function $d(){var e=KN().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 x=t().length,g=a<r,j=g?a:r,b=g?r:a;i=(b-j)/Math.max(1,x-d+f*2),c&&(i=Math.floor(i)),j+=(b-j-i*(x-d))*h,o=i*(1-d),c&&(j=Math.round(j),o=Math.round(o));var y=Cee(x).map(function(S){return j+i*S});return n(g?y.reverse():y)}return e.domain=function(x){return arguments.length?(t(x),p()):t()},e.range=function(x){return arguments.length?([r,a]=x,r=+r,a=+a,p()):[r,a]},e.rangeRound=function(x){return[r,a]=x,r=+r,a=+a,c=!0,p()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(x){return arguments.length?(c=!!x,p()):c},e.padding=function(x){return arguments.length?(d=Math.min(1,f=+x),p()):d},e.paddingInner=function(x){return arguments.length?(d=Math.min(1,x),p()):d},e.paddingOuter=function(x){return arguments.length?(f=+x,p()):f},e.align=function(x){return arguments.length?(h=Math.max(0,Math.min(1,x)),p()):h},e.copy=function(){return $d(t(),[r,a]).round(c).paddingInner(d).paddingOuter(f).align(h)},ka.apply(p(),arguments)}function J5(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return J5(t())},e}function md(){return J5($d.apply(null,arguments).paddingInner(1))}function GN(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Z5(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function kf(){}var Dd=.7,Qh=1/Dd,cc="\\s*([+-]?\\d+)\\s*",Ld="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",vs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Aee=/^#([0-9a-f]{3,8})$/,_ee=new RegExp(`^rgb\\(${cc},${cc},${cc}\\)$`),Eee=new RegExp(`^rgb\\(${vs},${vs},${vs}\\)$`),Pee=new RegExp(`^rgba\\(${cc},${cc},${cc},${Ld}\\)$`),kee=new RegExp(`^rgba\\(${vs},${vs},${vs},${Ld}\\)$`),Oee=new RegExp(`^hsl\\(${Ld},${vs},${vs}\\)$`),Ree=new RegExp(`^hsla\\(${Ld},${vs},${vs},${Ld}\\)$`),NT={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};GN(kf,Fd,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:CT,formatHex:CT,formatHex8:Tee,formatHsl:Iee,formatRgb:AT,toString:AT});function CT(){return this.rgb().formatHex()}function Tee(){return this.rgb().formatHex8()}function Iee(){return eL(this).formatHsl()}function AT(){return this.rgb().formatRgb()}function Fd(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Aee.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?_T(t):n===3?new qr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?oh(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?oh(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=_ee.exec(e))?new qr(t[1],t[2],t[3],1):(t=Eee.exec(e))?new qr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Pee.exec(e))?oh(t[1],t[2],t[3],t[4]):(t=kee.exec(e))?oh(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Oee.exec(e))?kT(t[1],t[2]/100,t[3]/100,1):(t=Ree.exec(e))?kT(t[1],t[2]/100,t[3]/100,t[4]):NT.hasOwnProperty(e)?_T(NT[e]):e==="transparent"?new qr(NaN,NaN,NaN,0):null}function _T(e){return new qr(e>>16&255,e>>8&255,e&255,1)}function oh(e,t,n,r){return r<=0&&(e=t=n=NaN),new qr(e,t,n,r)}function Mee(e){return e instanceof kf||(e=Fd(e)),e?(e=e.rgb(),new qr(e.r,e.g,e.b,e.opacity)):new qr}function T1(e,t,n,r){return arguments.length===1?Mee(e):new qr(e,t,n,r??1)}function qr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}GN(qr,T1,Z5(kf,{brighter(e){return e=e==null?Qh:Math.pow(Qh,e),new qr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Dd:Math.pow(Dd,e),new qr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new qr(To(this.r),To(this.g),To(this.b),Jh(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:ET,formatHex:ET,formatHex8:$ee,formatRgb:PT,toString:PT}));function ET(){return`#${Eo(this.r)}${Eo(this.g)}${Eo(this.b)}`}function $ee(){return`#${Eo(this.r)}${Eo(this.g)}${Eo(this.b)}${Eo((isNaN(this.opacity)?1:this.opacity)*255)}`}function PT(){const e=Jh(this.opacity);return`${e===1?"rgb(":"rgba("}${To(this.r)}, ${To(this.g)}, ${To(this.b)}${e===1?")":`, ${e})`}`}function Jh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function To(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Eo(e){return e=To(e),(e<16?"0":"")+e.toString(16)}function kT(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Wa(e,t,n,r)}function eL(e){if(e instanceof Wa)return new Wa(e.h,e.s,e.l,e.opacity);if(e instanceof kf||(e=Fd(e)),!e)return new Wa;if(e instanceof Wa)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 Wa(o,c,d,e.opacity)}function Dee(e,t,n,r){return arguments.length===1?eL(e):new Wa(e,t,n,r??1)}function Wa(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}GN(Wa,Dee,Z5(kf,{brighter(e){return e=e==null?Qh:Math.pow(Qh,e),new Wa(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Dd:Math.pow(Dd,e),new Wa(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 qr(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 Wa(OT(this.h),lh(this.s),lh(this.l),Jh(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=Jh(this.opacity);return`${e===1?"hsl(":"hsla("}${OT(this.h)}, ${lh(this.s)*100}%, ${lh(this.l)*100}%${e===1?")":`, ${e})`}`}}));function OT(e){return e=(e||0)%360,e<0?e+360:e}function lh(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 YN=e=>()=>e;function Lee(e,t){return function(n){return e+n*t}}function Fee(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 Bee(e){return(e=+e)==1?tL:function(t,n){return n-t?Fee(t,n,e):YN(isNaN(t)?n:t)}}function tL(e,t){var n=t-e;return n?Lee(e,n):YN(isNaN(e)?t:e)}const RT=(function e(t){var n=Bee(t);function r(a,i){var o=n((a=T1(a)).r,(i=T1(i)).r),c=n(a.g,i.g),d=n(a.b,i.b),f=tL(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 zee(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 Uee(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function qee(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]=ou(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 Wee(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Zh(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Vee(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]=ou(e[a],t[a]):r[a]=t[a];return function(i){for(a in n)r[a]=n[a](i);return r}}var I1=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Lw=new RegExp(I1.source,"g");function Hee(e){return function(){return e}}function Kee(e){return function(t){return e(t)+""}}function Gee(e,t){var n=I1.lastIndex=Lw.lastIndex=0,r,a,i,o=-1,c=[],d=[];for(e=e+"",t=t+"";(r=I1.exec(e))&&(a=Lw.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:Zh(r,a)})),n=Lw.lastIndex;return n<t.length&&(i=t.slice(n),c[o]?c[o]+=i:c[++o]=i),c.length<2?d[0]?Kee(d[0].x):Hee(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 ou(e,t){var n=typeof t,r;return t==null||n==="boolean"?YN(t):(n==="number"?Zh:n==="string"?(r=Fd(t))?(t=r,RT):Gee:t instanceof Fd?RT:t instanceof Date?Wee:Uee(t)?zee:Array.isArray(t)?qee:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Vee:Zh)(e,t)}function XN(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Yee(e,t){t===void 0&&(t=e,e=ou);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 Xee(e){return function(){return e}}function em(e){return+e}var TT=[0,1];function Er(e){return e}function M1(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Xee(isNaN(t)?NaN:.5)}function Qee(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Jee(e,t,n){var r=e[0],a=e[1],i=t[0],o=t[1];return a<r?(r=M1(a,r),i=n(o,i)):(r=M1(r,a),i=n(i,o)),function(c){return i(r(c))}}function Zee(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]=M1(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 Of(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Mv(){var e=TT,t=TT,n=ou,r,a,i,o=Er,c,d,f;function h(){var x=Math.min(e.length,t.length);return o!==Er&&(o=Qee(e[0],e[x-1])),c=x>2?Zee:Jee,d=f=null,p}function p(x){return x==null||isNaN(x=+x)?i:(d||(d=c(e.map(r),t,n)))(r(o(x)))}return p.invert=function(x){return o(a((f||(f=c(t,e.map(r),Zh)))(x)))},p.domain=function(x){return arguments.length?(e=Array.from(x,em),h()):e.slice()},p.range=function(x){return arguments.length?(t=Array.from(x),h()):t.slice()},p.rangeRound=function(x){return t=Array.from(x),n=XN,h()},p.clamp=function(x){return arguments.length?(o=x?!0:Er,h()):o!==Er},p.interpolate=function(x){return arguments.length?(n=x,h()):n},p.unknown=function(x){return arguments.length?(i=x,p):i},function(x,g){return r=x,a=g,h()}}function QN(){return Mv()(Er,Er)}function ete(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function tm(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 Nc(e){return e=tm(Math.abs(e)),e?e[1]:NaN}function tte(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 nte(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var rte=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Bd(e){if(!(t=rte.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]})}Bd.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 ate(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 nm;function ste(e,t){var n=tm(e,t);if(!n)return nm=void 0,e.toPrecision(t);var r=n[0],a=n[1],i=a-(nm=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")+tm(e,Math.max(0,t+i-1))[0]}function IT(e,t){var n=tm(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 MT={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:ete,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)=>IT(e*100,t),r:IT,s:ste,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function $T(e){return e}var DT=Array.prototype.map,LT=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ite(e){var t=e.grouping===void 0||e.thousands===void 0?$T:tte(DT.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?$T:nte(DT.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,x){p=Bd(p);var g=p.fill,j=p.align,b=p.sign,y=p.symbol,S=p.zero,C=p.width,N=p.comma,E=p.precision,_=p.trim,P=p.type;P==="n"?(N=!0,P="g"):MT[P]||(E===void 0&&(E=12),_=!0,P="g"),(S||g==="0"&&j==="=")&&(S=!0,g="0",j="=");var O=(x&&x.prefix!==void 0?x.prefix:"")+(y==="$"?n:y==="#"&&/[boxX]/.test(P)?"0"+P.toLowerCase():""),R=(y==="$"?r:/[%p]/.test(P)?o:"")+(x&&x.suffix!==void 0?x.suffix:""),L=MT[P],T=/[defgprs%]/.test(P);E=E===void 0?6:/[gprs]/.test(P)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function D(M){var G=O,B=R,W,q,V;if(P==="c")B=L(M)+B,M="";else{M=+M;var F=M<0||1/M<0;if(M=isNaN(M)?d:L(Math.abs(M),E),_&&(M=ate(M)),F&&+M==0&&b!=="+"&&(F=!1),G=(F?b==="("?b:c:b==="-"||b==="("?"":b)+G,B=(P==="s"&&!isNaN(M)&&nm!==void 0?LT[8+nm/3]:"")+B+(F&&b==="("?")":""),T){for(W=-1,q=M.length;++W<q;)if(V=M.charCodeAt(W),48>V||V>57){B=(V===46?a+M.slice(W+1):M.slice(W))+B,M=M.slice(0,W);break}}}N&&!S&&(M=t(M,1/0));var U=G.length+M.length+B.length,Z=U<C?new Array(C-U+1).join(g):"";switch(N&&S&&(M=t(Z+M,Z.length?C-B.length:1/0),Z=""),j){case"<":M=G+M+B+Z;break;case"=":M=G+Z+M+B;break;case"^":M=Z.slice(0,U=Z.length>>1)+G+M+B+Z.slice(U);break;default:M=Z+G+M+B;break}return i(M)}return D.toString=function(){return p+""},D}function h(p,x){var g=Math.max(-8,Math.min(8,Math.floor(Nc(x)/3)))*3,j=Math.pow(10,-g),b=f((p=Bd(p),p.type="f",p),{suffix:LT[8+g/3]});return function(y){return b(j*y)}}return{format:f,formatPrefix:h}}var ch,ZN,nL;ote({thousands:",",grouping:[3],currency:["$",""]});function ote(e){return ch=ite(e),ZN=ch.format,nL=ch.formatPrefix,ch}function lte(e){return Math.max(0,-Nc(Math.abs(e)))}function cte(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Nc(t)/3)))*3-Nc(Math.abs(e)))}function ute(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Nc(t)-Nc(e))+1}function rL(e,t,n,r){var a=O1(e,t,n),i;switch(r=Bd(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=cte(a,o))&&(r.precision=i),nL(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=ute(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=lte(a))&&(r.precision=i-(r.type==="%")*2);break}}return ZN(r)}function Zi(e){var t=e.domain;return e.ticks=function(n){var r=t();return P1(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return rL(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=k1(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 rm(){var e=QN();return e.copy=function(){return Of(e,rm())},ka.apply(e,arguments),Zi(e)}function aL(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,em),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return aL(e).unknown(t)},e=arguments.length?Array.from(e,em):[0,1],Zi(n)}function sL(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 FT(e){return Math.log(e)}function BT(e){return Math.exp(e)}function dte(e){return-Math.log(-e)}function fte(e){return-Math.exp(-e)}function pte(e){return isFinite(e)?+("1e"+e):e<0?0:e}function hte(e){return e===10?pte:e===Math.E?Math.exp:t=>Math.pow(e,t)}function mte(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 zT(e){return(t,n)=>-e(-t,n)}function eC(e){const t=e(FT,BT),n=t.domain;let r=10,a,i;function o(){return a=mte(r),i=hte(r),n()[0]<0?(a=zT(a),i=zT(i),e(dte,fte)):e(FT,BT),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 x=a(f),g=a(h),j,b;const y=c==null?10:+c;let S=[];if(!(r%1)&&g-x<y){if(x=Math.floor(x),g=Math.ceil(g),f>0){for(;x<=g;++x)for(j=1;j<r;++j)if(b=x<0?j/i(-x):j*i(x),!(b<f)){if(b>h)break;S.push(b)}}else for(;x<=g;++x)for(j=r-1;j>=1;--j)if(b=x>0?j/i(-x):j*i(x),!(b<f)){if(b>h)break;S.push(b)}S.length*2<y&&(S=P1(f,h,y))}else S=P1(x,g,Math.min(g-x,y)).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=Bd(d)).precision==null&&(d.trim=!0),d=ZN(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(sL(n(),{floor:c=>i(Math.floor(a(c))),ceil:c=>i(Math.ceil(a(c)))})),t}function iL(){const e=eC(Mv()).domain([1,10]);return e.copy=()=>Of(e,iL()).base(e.base()),ka.apply(e,arguments),e}function UT(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function qT(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function tC(e){var t=1,n=e(UT(t),qT(t));return n.constant=function(r){return arguments.length?e(UT(t=+r),qT(t)):t},Zi(n)}function oL(){var e=tC(Mv());return e.copy=function(){return Of(e,oL()).constant(e.constant())},ka.apply(e,arguments)}function WT(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function vte(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function gte(e){return e<0?-e*e:e*e}function nC(e){var t=e(Er,Er),n=1;function r(){return n===1?e(Er,Er):n===.5?e(vte,gte):e(WT(n),WT(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},Zi(t)}function rC(){var e=nC(Mv());return e.copy=function(){return Of(e,rC()).exponent(e.exponent())},ka.apply(e,arguments),e}function xte(){return rC.apply(null,arguments).exponent(.5)}function VT(e){return Math.sign(e)*e*e}function yte(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function lL(){var e=QN(),t=[0,1],n=!1,r;function a(i){var o=yte(e(i));return isNaN(o)?r:n?Math.round(o):o}return a.invert=function(i){return e.invert(VT(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,em)).map(VT)),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 lL(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},ka.apply(a,arguments),Zi(a)}function cL(){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(Ui),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 cL().domain(e).range(t).unknown(r)},ka.apply(i,arguments)}function uL(){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 uL().domain([e,t]).range(a).unknown(i)},ka.apply(Zi(o),arguments)}function dL(){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 dL().domain(e).range(t).unknown(n)},ka.apply(a,arguments)}const Fw=new Date,Bw=new Date;function rr(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=>rr(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)=>(Fw.setTime(+i),Bw.setTime(+o),e(Fw),e(Bw),Math.floor(n(Fw,Bw))),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 am=rr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);am.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?rr(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):am);am.range;const Gs=1e3,Na=Gs*60,Ys=Na*60,ni=Ys*24,aC=ni*7,HT=ni*30,zw=ni*365,Po=rr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Gs)},(e,t)=>(t-e)/Gs,e=>e.getUTCSeconds());Po.range;const sC=rr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Gs)},(e,t)=>{e.setTime(+e+t*Na)},(e,t)=>(t-e)/Na,e=>e.getMinutes());sC.range;const iC=rr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Na)},(e,t)=>(t-e)/Na,e=>e.getUTCMinutes());iC.range;const oC=rr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Gs-e.getMinutes()*Na)},(e,t)=>{e.setTime(+e+t*Ys)},(e,t)=>(t-e)/Ys,e=>e.getHours());oC.range;const lC=rr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ys)},(e,t)=>(t-e)/Ys,e=>e.getUTCHours());lC.range;const Rf=rr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Na)/ni,e=>e.getDate()-1);Rf.range;const $v=rr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ni,e=>e.getUTCDate()-1);$v.range;const fL=rr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ni,e=>Math.floor(e/ni));fL.range;function al(e){return rr(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())*Na)/aC)}const Dv=al(0),sm=al(1),bte=al(2),wte=al(3),Cc=al(4),jte=al(5),Ste=al(6);Dv.range;sm.range;bte.range;wte.range;Cc.range;jte.range;Ste.range;function sl(e){return rr(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)/aC)}const Lv=sl(0),im=sl(1),Nte=sl(2),Cte=sl(3),Ac=sl(4),Ate=sl(5),_te=sl(6);Lv.range;im.range;Nte.range;Cte.range;Ac.range;Ate.range;_te.range;const cC=rr(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());cC.range;const uC=rr(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());uC.range;const ri=rr(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());ri.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:rr(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)});ri.range;const ai=rr(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());ai.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:rr(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)});ai.range;function pL(e,t,n,r,a,i){const o=[[Po,1,Gs],[Po,5,5*Gs],[Po,15,15*Gs],[Po,30,30*Gs],[i,1,Na],[i,5,5*Na],[i,15,15*Na],[i,30,30*Na],[a,1,Ys],[a,3,3*Ys],[a,6,6*Ys],[a,12,12*Ys],[r,1,ni],[r,2,2*ni],[n,1,aC],[t,1,HT],[t,3,3*HT],[e,1,zw]];function c(f,h,p){const x=h<f;x&&([f,h]=[h,f]);const g=p&&typeof p.range=="function"?p:d(f,h,p),j=g?g.range(f,+h+1):[];return x?j.reverse():j}function d(f,h,p){const x=Math.abs(h-f)/p,g=HN(([,,y])=>y).right(o,x);if(g===o.length)return e.every(O1(f/zw,h/zw,p));if(g===0)return am.every(Math.max(O1(f,h,p),1));const[j,b]=o[x/o[g-1][2]<o[g][2]/x?g-1:g];return j.every(b)}return[c,d]}const[Ete,Pte]=pL(ai,uC,Lv,fL,lC,iC),[kte,Ote]=pL(ri,cC,Dv,Rf,oC,sC);function Uw(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 qw(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 Ju(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Rte(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=Zu(a),h=ed(a),p=Zu(i),x=ed(i),g=Zu(o),j=ed(o),b=Zu(c),y=ed(c),S=Zu(d),C=ed(d),N={a:V,A:F,b:U,B:Z,c:null,d:JT,e:JT,f:tne,g:dne,G:pne,H:Jte,I:Zte,j:ene,L:hL,m:nne,M:rne,p:z,q:$,Q:t2,s:n2,S:ane,u:sne,U:ine,V:one,w:lne,W:cne,x:null,X:null,y:une,Y:fne,Z:hne,"%":e2},E={a:te,A:se,b:Q,B:ce,c:null,d:ZT,e:ZT,f:xne,g:Ene,G:kne,H:mne,I:vne,j:gne,L:vL,m:yne,M:bne,p:le,q:me,Q:t2,s:n2,S:wne,u:jne,U:Sne,V:Nne,w:Cne,W:Ane,x:null,X:null,y:_ne,Y:Pne,Z:One,"%":e2},_={a:T,A:D,b:M,B:G,c:B,d:XT,e:XT,f:Gte,g:YT,G:GT,H:QT,I:QT,j:Wte,L:Kte,m:qte,M:Vte,p:L,q:Ute,Q:Xte,s:Qte,S:Hte,u:Dte,U:Lte,V:Fte,w:$te,W:Bte,x:W,X:q,y:YT,Y:GT,Z:zte,"%":Yte};N.x=P(n,N),N.X=P(r,N),N.c=P(t,N),E.x=P(n,E),E.X=P(r,E),E.c=P(t,E);function P(oe,fe){return function(Ce){var ae=[],Re=-1,Ae=0,Te=oe.length,be,_e,X;for(Ce instanceof Date||(Ce=new Date(+Ce));++Re<Te;)oe.charCodeAt(Re)===37&&(ae.push(oe.slice(Ae,Re)),(_e=KT[be=oe.charAt(++Re)])!=null?be=oe.charAt(++Re):_e=be==="e"?" ":"0",(X=fe[be])&&(be=X(Ce,_e)),ae.push(be),Ae=Re+1);return ae.push(oe.slice(Ae,Re)),ae.join("")}}function O(oe,fe){return function(Ce){var ae=Ju(1900,void 0,1),Re=R(ae,oe,Ce+="",0),Ae,Te;if(Re!=Ce.length)return null;if("Q"in ae)return new Date(ae.Q);if("s"in ae)return new Date(ae.s*1e3+("L"in ae?ae.L:0));if(fe&&!("Z"in ae)&&(ae.Z=0),"p"in ae&&(ae.H=ae.H%12+ae.p*12),ae.m===void 0&&(ae.m="q"in ae?ae.q:0),"V"in ae){if(ae.V<1||ae.V>53)return null;"w"in ae||(ae.w=1),"Z"in ae?(Ae=qw(Ju(ae.y,0,1)),Te=Ae.getUTCDay(),Ae=Te>4||Te===0?im.ceil(Ae):im(Ae),Ae=$v.offset(Ae,(ae.V-1)*7),ae.y=Ae.getUTCFullYear(),ae.m=Ae.getUTCMonth(),ae.d=Ae.getUTCDate()+(ae.w+6)%7):(Ae=Uw(Ju(ae.y,0,1)),Te=Ae.getDay(),Ae=Te>4||Te===0?sm.ceil(Ae):sm(Ae),Ae=Rf.offset(Ae,(ae.V-1)*7),ae.y=Ae.getFullYear(),ae.m=Ae.getMonth(),ae.d=Ae.getDate()+(ae.w+6)%7)}else("W"in ae||"U"in ae)&&("w"in ae||(ae.w="u"in ae?ae.u%7:"W"in ae?1:0),Te="Z"in ae?qw(Ju(ae.y,0,1)).getUTCDay():Uw(Ju(ae.y,0,1)).getDay(),ae.m=0,ae.d="W"in ae?(ae.w+6)%7+ae.W*7-(Te+5)%7:ae.w+ae.U*7-(Te+6)%7);return"Z"in ae?(ae.H+=ae.Z/100|0,ae.M+=ae.Z%100,qw(ae)):Uw(ae)}}function R(oe,fe,Ce,ae){for(var Re=0,Ae=fe.length,Te=Ce.length,be,_e;Re<Ae;){if(ae>=Te)return-1;if(be=fe.charCodeAt(Re++),be===37){if(be=fe.charAt(Re++),_e=_[be in KT?fe.charAt(Re++):be],!_e||(ae=_e(oe,Ce,ae))<0)return-1}else if(be!=Ce.charCodeAt(ae++))return-1}return ae}function L(oe,fe,Ce){var ae=f.exec(fe.slice(Ce));return ae?(oe.p=h.get(ae[0].toLowerCase()),Ce+ae[0].length):-1}function T(oe,fe,Ce){var ae=g.exec(fe.slice(Ce));return ae?(oe.w=j.get(ae[0].toLowerCase()),Ce+ae[0].length):-1}function D(oe,fe,Ce){var ae=p.exec(fe.slice(Ce));return ae?(oe.w=x.get(ae[0].toLowerCase()),Ce+ae[0].length):-1}function M(oe,fe,Ce){var ae=S.exec(fe.slice(Ce));return ae?(oe.m=C.get(ae[0].toLowerCase()),Ce+ae[0].length):-1}function G(oe,fe,Ce){var ae=b.exec(fe.slice(Ce));return ae?(oe.m=y.get(ae[0].toLowerCase()),Ce+ae[0].length):-1}function B(oe,fe,Ce){return R(oe,t,fe,Ce)}function W(oe,fe,Ce){return R(oe,n,fe,Ce)}function q(oe,fe,Ce){return R(oe,r,fe,Ce)}function V(oe){return o[oe.getDay()]}function F(oe){return i[oe.getDay()]}function U(oe){return d[oe.getMonth()]}function Z(oe){return c[oe.getMonth()]}function z(oe){return a[+(oe.getHours()>=12)]}function $(oe){return 1+~~(oe.getMonth()/3)}function te(oe){return o[oe.getUTCDay()]}function se(oe){return i[oe.getUTCDay()]}function Q(oe){return d[oe.getUTCMonth()]}function ce(oe){return c[oe.getUTCMonth()]}function le(oe){return a[+(oe.getUTCHours()>=12)]}function me(oe){return 1+~~(oe.getUTCMonth()/3)}return{format:function(oe){var fe=P(oe+="",N);return fe.toString=function(){return oe},fe},parse:function(oe){var fe=O(oe+="",!1);return fe.toString=function(){return oe},fe},utcFormat:function(oe){var fe=P(oe+="",E);return fe.toString=function(){return oe},fe},utcParse:function(oe){var fe=O(oe+="",!0);return fe.toString=function(){return oe},fe}}}var KT={"-":"",_:" ",0:"0"},cr=/^\s*\d+/,Tte=/^%/,Ite=/[\\^$*+?|[\]().{}]/g;function Zt(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 Mte(e){return e.replace(Ite,"\\$&")}function Zu(e){return new RegExp("^(?:"+e.map(Mte).join("|")+")","i")}function ed(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function $te(e,t,n){var r=cr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Dte(e,t,n){var r=cr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Lte(e,t,n){var r=cr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Fte(e,t,n){var r=cr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Bte(e,t,n){var r=cr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function GT(e,t,n){var r=cr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function YT(e,t,n){var r=cr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function zte(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 Ute(e,t,n){var r=cr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function qte(e,t,n){var r=cr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function XT(e,t,n){var r=cr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Wte(e,t,n){var r=cr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function QT(e,t,n){var r=cr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Vte(e,t,n){var r=cr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Hte(e,t,n){var r=cr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Kte(e,t,n){var r=cr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Gte(e,t,n){var r=cr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Yte(e,t,n){var r=Tte.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Xte(e,t,n){var r=cr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Qte(e,t,n){var r=cr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function JT(e,t){return Zt(e.getDate(),t,2)}function Jte(e,t){return Zt(e.getHours(),t,2)}function Zte(e,t){return Zt(e.getHours()%12||12,t,2)}function ene(e,t){return Zt(1+Rf.count(ri(e),e),t,3)}function hL(e,t){return Zt(e.getMilliseconds(),t,3)}function tne(e,t){return hL(e,t)+"000"}function nne(e,t){return Zt(e.getMonth()+1,t,2)}function rne(e,t){return Zt(e.getMinutes(),t,2)}function ane(e,t){return Zt(e.getSeconds(),t,2)}function sne(e){var t=e.getDay();return t===0?7:t}function ine(e,t){return Zt(Dv.count(ri(e)-1,e),t,2)}function mL(e){var t=e.getDay();return t>=4||t===0?Cc(e):Cc.ceil(e)}function one(e,t){return e=mL(e),Zt(Cc.count(ri(e),e)+(ri(e).getDay()===4),t,2)}function lne(e){return e.getDay()}function cne(e,t){return Zt(sm.count(ri(e)-1,e),t,2)}function une(e,t){return Zt(e.getFullYear()%100,t,2)}function dne(e,t){return e=mL(e),Zt(e.getFullYear()%100,t,2)}function fne(e,t){return Zt(e.getFullYear()%1e4,t,4)}function pne(e,t){var n=e.getDay();return e=n>=4||n===0?Cc(e):Cc.ceil(e),Zt(e.getFullYear()%1e4,t,4)}function hne(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Zt(t/60|0,"0",2)+Zt(t%60,"0",2)}function ZT(e,t){return Zt(e.getUTCDate(),t,2)}function mne(e,t){return Zt(e.getUTCHours(),t,2)}function vne(e,t){return Zt(e.getUTCHours()%12||12,t,2)}function gne(e,t){return Zt(1+$v.count(ai(e),e),t,3)}function vL(e,t){return Zt(e.getUTCMilliseconds(),t,3)}function xne(e,t){return vL(e,t)+"000"}function yne(e,t){return Zt(e.getUTCMonth()+1,t,2)}function bne(e,t){return Zt(e.getUTCMinutes(),t,2)}function wne(e,t){return Zt(e.getUTCSeconds(),t,2)}function jne(e){var t=e.getUTCDay();return t===0?7:t}function Sne(e,t){return Zt(Lv.count(ai(e)-1,e),t,2)}function gL(e){var t=e.getUTCDay();return t>=4||t===0?Ac(e):Ac.ceil(e)}function Nne(e,t){return e=gL(e),Zt(Ac.count(ai(e),e)+(ai(e).getUTCDay()===4),t,2)}function Cne(e){return e.getUTCDay()}function Ane(e,t){return Zt(im.count(ai(e)-1,e),t,2)}function _ne(e,t){return Zt(e.getUTCFullYear()%100,t,2)}function Ene(e,t){return e=gL(e),Zt(e.getUTCFullYear()%100,t,2)}function Pne(e,t){return Zt(e.getUTCFullYear()%1e4,t,4)}function kne(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Ac(e):Ac.ceil(e),Zt(e.getUTCFullYear()%1e4,t,4)}function One(){return"+0000"}function e2(){return"%"}function t2(e){return+e}function n2(e){return Math.floor(+e/1e3)}var Ul,xL,yL;Rne({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 Rne(e){return Ul=Rte(e),xL=Ul.format,Ul.parse,yL=Ul.utcFormat,Ul.utcParse,Ul}function Tne(e){return new Date(e)}function Ine(e){return e instanceof Date?+e:+new Date(+e)}function dC(e,t,n,r,a,i,o,c,d,f){var h=QN(),p=h.invert,x=h.domain,g=f(".%L"),j=f(":%S"),b=f("%I:%M"),y=f("%I %p"),S=f("%a %d"),C=f("%b %d"),N=f("%B"),E=f("%Y");function _(P){return(d(P)<P?g:c(P)<P?j:o(P)<P?b:i(P)<P?y:r(P)<P?a(P)<P?S:C:n(P)<P?N:E)(P)}return h.invert=function(P){return new Date(p(P))},h.domain=function(P){return arguments.length?x(Array.from(P,Ine)):x().map(Tne)},h.ticks=function(P){var O=x();return e(O[0],O[O.length-1],P??10)},h.tickFormat=function(P,O){return O==null?_:f(O)},h.nice=function(P){var O=x();return(!P||typeof P.range!="function")&&(P=t(O[0],O[O.length-1],P??10)),P?x(sL(O,P)):h},h.copy=function(){return Of(h,dC(e,t,n,r,a,i,o,c,d,f))},h}function Mne(){return ka.apply(dC(kte,Ote,ri,cC,Dv,Rf,oC,sC,Po,xL).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function $ne(){return ka.apply(dC(Ete,Pte,ai,uC,Lv,$v,lC,iC,Po,yL).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Fv(){var e=0,t=1,n,r,a,i,o=Er,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(x){var g,j;return arguments.length?([g,j]=x,o=p(g,j),f):[o(0),o(1)]}}return f.range=h(ou),f.rangeRound=h(XN),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 eo(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function bL(){var e=Zi(Fv()(Er));return e.copy=function(){return eo(e,bL())},li.apply(e,arguments)}function wL(){var e=eC(Fv()).domain([1,10]);return e.copy=function(){return eo(e,wL()).base(e.base())},li.apply(e,arguments)}function jL(){var e=tC(Fv());return e.copy=function(){return eo(e,jL()).constant(e.constant())},li.apply(e,arguments)}function fC(){var e=nC(Fv());return e.copy=function(){return eo(e,fC()).exponent(e.exponent())},li.apply(e,arguments)}function Dne(){return fC.apply(null,arguments).exponent(.5)}function SL(){var e=[],t=Er;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(Ui),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)=>See(e,i/r))},n.copy=function(){return SL(t).domain(e)},li.apply(n,arguments)}function Bv(){var e=0,t=.5,n=1,r=1,a,i,o,c,d,f=Er,h,p=!1,x;function g(b){return isNaN(b=+b)?x:(b=.5+((b=+h(b))-i)*(r*b<r*i?c:d),f(p?Math.max(0,Math.min(1,b)):b))}g.domain=function(b){return arguments.length?([e,t,n]=b,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,g):[e,t,n]},g.clamp=function(b){return arguments.length?(p=!!b,g):p},g.interpolator=function(b){return arguments.length?(f=b,g):f};function j(b){return function(y){var S,C,N;return arguments.length?([S,C,N]=y,f=Yee(b,[S,C,N]),g):[f(0),f(.5),f(1)]}}return g.range=j(ou),g.rangeRound=j(XN),g.unknown=function(b){return arguments.length?(x=b,g):x},function(b){return h=b,a=b(e),i=b(t),o=b(n),c=a===i?0:.5/(i-a),d=i===o?0:.5/(o-i),r=i<a?-1:1,g}}function NL(){var e=Zi(Bv()(Er));return e.copy=function(){return eo(e,NL())},li.apply(e,arguments)}function CL(){var e=eC(Bv()).domain([.1,1,10]);return e.copy=function(){return eo(e,CL()).base(e.base())},li.apply(e,arguments)}function AL(){var e=tC(Bv());return e.copy=function(){return eo(e,AL()).constant(e.constant())},li.apply(e,arguments)}function pC(){var e=nC(Bv());return e.copy=function(){return eo(e,pC()).exponent(e.exponent())},li.apply(e,arguments)}function Lne(){return pC.apply(null,arguments).exponent(.5)}const r2=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:$d,scaleDiverging:NL,scaleDivergingLog:CL,scaleDivergingPow:pC,scaleDivergingSqrt:Lne,scaleDivergingSymlog:AL,scaleIdentity:aL,scaleImplicit:R1,scaleLinear:rm,scaleLog:iL,scaleOrdinal:KN,scalePoint:md,scalePow:rC,scaleQuantile:cL,scaleQuantize:uL,scaleRadial:lL,scaleSequential:bL,scaleSequentialLog:wL,scaleSequentialPow:fC,scaleSequentialQuantile:SL,scaleSequentialSqrt:Dne,scaleSequentialSymlog:jL,scaleSqrt:xte,scaleSymlog:oL,scaleThreshold:dL,scaleTime:Mne,scaleUtc:$ne,tickFormat:rL},Symbol.toStringTag,{value:"Module"}));var Ww,a2;function zv(){if(a2)return Ww;a2=1;var e=ru();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 Ww=t,Ww}var Vw,s2;function _L(){if(s2)return Vw;s2=1;function e(t,n){return t>n}return Vw=e,Vw}var Hw,i2;function Fne(){if(i2)return Hw;i2=1;var e=zv(),t=_L(),n=iu();function r(a){return a&&a.length?e(a,n,t):void 0}return Hw=r,Hw}var Bne=Fne();const Uv=an(Bne);var Kw,o2;function EL(){if(o2)return Kw;o2=1;function e(t,n){return t<n}return Kw=e,Kw}var Gw,l2;function zne(){if(l2)return Gw;l2=1;var e=zv(),t=EL(),n=iu();function r(a){return a&&a.length?e(a,n,t):void 0}return Gw=r,Gw}var Une=zne();const qv=an(Une);var Yw,c2;function qne(){if(c2)return Yw;c2=1;var e=PN(),t=Ps(),n=D5(),r=Vr();function a(i,o){var c=r(i)?e:n;return c(i,t(o,3))}return Yw=a,Yw}var Xw,u2;function Wne(){if(u2)return Xw;u2=1;var e=M5(),t=qne();function n(r,a){return e(t(r,a),1)}return Xw=n,Xw}var Vne=Wne();const Hne=an(Vne);var Qw,d2;function Kne(){if(d2)return Qw;d2=1;var e=UN();function t(n,r){return e(n,r)}return Qw=t,Qw}var Gne=Kne();const Tf=an(Gne);var lu=1e9,Yne={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},mC,On=!0,Ea="[DecimalError] ",Io=Ea+"Invalid argument: ",hC=Ea+"Exponent out of range: ",cu=Math.floor,Co=Math.pow,Xne=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ra,or=1e7,Cn=7,PL=9007199254740991,om=cu(PL/Cn),et={};et.absoluteValue=et.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};et.comparedTo=et.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};et.decimalPlaces=et.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Cn;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};et.dividedBy=et.div=function(e){return Js(this,new this.constructor(e))};et.dividedToIntegerBy=et.idiv=function(e){var t=this,n=t.constructor;return fn(Js(t,new n(e),0,1),n.precision)};et.equals=et.eq=function(e){return!this.cmp(e)};et.exponent=function(){return Hn(this)};et.greaterThan=et.gt=function(e){return this.cmp(e)>0};et.greaterThanOrEqualTo=et.gte=function(e){return this.cmp(e)>=0};et.isInteger=et.isint=function(){return this.e>this.d.length-2};et.isNegative=et.isneg=function(){return this.s<0};et.isPositive=et.ispos=function(){return this.s>0};et.isZero=function(){return this.s===0};et.lessThan=et.lt=function(e){return this.cmp(e)<0};et.lessThanOrEqualTo=et.lte=function(e){return this.cmp(e)<1};et.logarithm=et.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(ra))throw Error(Ea+"NaN");if(n.s<1)throw Error(Ea+(n.s?"NaN":"-Infinity"));return n.eq(ra)?new r(0):(On=!1,t=Js(zd(n,i),zd(e,i),i),On=!0,fn(t,a))};et.minus=et.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?RL(t,e):kL(t,(e.s=-e.s,e))};et.modulo=et.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(Ea+"NaN");return n.s?(On=!1,t=Js(n,e,0,1).times(e),On=!0,n.minus(t)):fn(new r(n),a)};et.naturalExponential=et.exp=function(){return OL(this)};et.naturalLogarithm=et.ln=function(){return zd(this)};et.negated=et.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};et.plus=et.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?kL(t,e):RL(t,(e.s=-e.s,e))};et.precision=et.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Io+e);if(t=Hn(a)+1,r=a.d.length-1,n=r*Cn+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};et.squareRoot=et.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(Ea+"NaN")}for(e=Hn(c),On=!1,a=Math.sqrt(+c),a==0||a==1/0?(t=ps(c.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=cu((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(Js(c,i,o+2)).times(.5),ps(i.d).slice(0,o)===(t=ps(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(fn(i,n+1,0),i.times(i).eq(c)){r=i;break}}else if(t!="9999")break;o+=4}return On=!0,fn(r,n)};et.times=et.mul=function(e){var t,n,r,a,i,o,c,d,f,h=this,p=h.constructor,x=h.d,g=(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=x.length,f=g.length,d<f&&(i=x,x=g,g=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]+g[r]*x[a-r-1]+t,i[a--]=c%or|0,t=c/or|0;i[a]=(i[a]+t)%or|0}for(;!i[--o];)i.pop();return t?++n:i.shift(),e.d=i,e.e=n,On?fn(e,p.precision):e};et.toDecimalPlaces=et.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Ss(e,0,lu),t===void 0?t=r.rounding:Ss(t,0,8),fn(n,e+Hn(n)+1,t))};et.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=zo(r,!0):(Ss(e,0,lu),t===void 0?t=a.rounding:Ss(t,0,8),r=fn(new a(r),e+1,t),n=zo(r,!0,e+1)),n};et.toFixed=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?zo(a):(Ss(e,0,lu),t===void 0?t=i.rounding:Ss(t,0,8),r=fn(new i(a),e+Hn(a)+1,t),n=zo(r.abs(),!1,e+Hn(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};et.toInteger=et.toint=function(){var e=this,t=e.constructor;return fn(new t(e),Hn(e)+1,t.rounding)};et.toNumber=function(){return+this};et.toPower=et.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(ra);if(c=new d(c),!c.s){if(e.s<1)throw Error(Ea+"Infinity");return c}if(c.eq(ra))return c;if(r=d.precision,e.eq(ra))return fn(c,r);if(t=e.e,n=e.d.length-1,o=t>=n,i=c.s,o){if((n=h<0?-h:h)<=PL){for(a=new d(ra),t=Math.ceil(r/Cn+4),On=!1;n%2&&(a=a.times(c),p2(a.d,t)),n=cu(n/2),n!==0;)c=c.times(c),p2(c.d,t);return On=!0,e.s<0?new d(ra).div(a):fn(a,r)}}else if(i<0)throw Error(Ea+"NaN");return i=i<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,On=!1,a=e.times(zd(c,r+f)),On=!0,a=OL(a),a.s=i,a};et.toPrecision=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?(n=Hn(a),r=zo(a,n<=i.toExpNeg||n>=i.toExpPos)):(Ss(e,1,lu),t===void 0?t=i.rounding:Ss(t,0,8),a=fn(new i(a),e,t),n=Hn(a),r=zo(a,e<=n||n<=i.toExpNeg,e)),r};et.toSignificantDigits=et.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Ss(e,1,lu),t===void 0?t=r.rounding:Ss(t,0,8)),fn(new r(n),e,t)};et.toString=et.valueOf=et.val=et.toJSON=et[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Hn(e),n=e.constructor;return zo(e,t<=n.toExpNeg||t>=n.toExpPos)};function kL(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)),On?fn(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/Cn),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)/or|0,d[i]%=or;for(n&&(d.unshift(n),++a),c=d.length;d[--c]==0;)d.pop();return t.d=d,t.e=a,On?fn(t,p):t}function Ss(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Io+e)}function ps(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=Cn-r.length,n&&(i+=$i(n)),i+=r;o=e[t],r=o+"",n=Cn-r.length,n&&(i+=$i(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var Js=(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%or|0,o=i/or|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*or+r[i]-a[i];for(;!r[0]&&r.length>1;)r.shift()}return function(r,a,i,o){var c,d,f,h,p,x,g,j,b,y,S,C,N,E,_,P,O,R,L=r.constructor,T=r.s==a.s?1:-1,D=r.d,M=a.d;if(!r.s)return new L(r);if(!a.s)throw Error(Ea+"Division by zero");for(d=r.e-a.e,O=M.length,_=D.length,g=new L(T),j=g.d=[],f=0;M[f]==(D[f]||0);)++f;if(M[f]>(D[f]||0)&&--d,i==null?C=i=L.precision:o?C=i+(Hn(r)-Hn(a))+1:C=i,C<0)return new L(0);if(C=C/Cn+2|0,f=0,O==1)for(h=0,M=M[0],C++;(f<_||h)&&C--;f++)N=h*or+(D[f]||0),j[f]=N/M|0,h=N%M|0;else{for(h=or/(M[0]+1)|0,h>1&&(M=e(M,h),D=e(D,h),O=M.length,_=D.length),E=O,b=D.slice(0,O),y=b.length;y<O;)b[y++]=0;R=M.slice(),R.unshift(0),P=M[0],M[1]>=or/2&&++P;do h=0,c=t(M,b,O,y),c<0?(S=b[0],O!=y&&(S=S*or+(b[1]||0)),h=S/P|0,h>1?(h>=or&&(h=or-1),p=e(M,h),x=p.length,y=b.length,c=t(p,b,x,y),c==1&&(h--,n(p,O<x?R:M,x))):(h==0&&(c=h=1),p=M.slice()),x=p.length,x<y&&p.unshift(0),n(b,p,y),c==-1&&(y=b.length,c=t(M,b,O,y),c<1&&(h++,n(b,O<y?R:M,y))),y=b.length):c===0&&(h++,b=[0]),j[f++]=h,c&&b[0]?b[y++]=D[E]||0:(b=[D[E]],y=1);while((E++<_||b[0]!==void 0)&&C--)}return j[0]||j.shift(),g.e=d,fn(g,o?i+Hn(g)+1:i)}})();function OL(e,t){var n,r,a,i,o,c,d=0,f=0,h=e.constructor,p=h.precision;if(Hn(e)>16)throw Error(hC+Hn(e));if(!e.s)return new h(ra);for(On=!1,c=p,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(r=Math.log(Co(2,f))/Math.LN10*2+5|0,c+=r,n=a=i=new h(ra),h.precision=c;;){if(a=fn(a.times(e),c),n=n.times(++d),o=i.plus(Js(a,n,c)),ps(o.d).slice(0,c)===ps(i.d).slice(0,c)){for(;f--;)i=fn(i.times(i),c);return h.precision=p,t==null?(On=!0,fn(i,p)):i}i=o}}function Hn(e){for(var t=e.e*Cn,n=e.d[0];n>=10;n/=10)t++;return t}function Jw(e,t,n){if(t>e.LN10.sd())throw On=!0,n&&(e.precision=n),Error(Ea+"LN10 precision limit exceeded");return fn(new e(e.LN10),t)}function $i(e){for(var t="";e--;)t+="0";return t}function zd(e,t){var n,r,a,i,o,c,d,f,h,p=1,x=10,g=e,j=g.d,b=g.constructor,y=b.precision;if(g.s<1)throw Error(Ea+(g.s?"NaN":"-Infinity"));if(g.eq(ra))return new b(0);if(t==null?(On=!1,f=y):f=t,g.eq(10))return t==null&&(On=!0),Jw(b,f);if(f+=x,b.precision=f,n=ps(j),r=n.charAt(0),i=Hn(g),Math.abs(i)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=ps(g.d),r=n.charAt(0),p++;i=Hn(g),r>1?(g=new b("0."+n),i++):g=new b(r+"."+n.slice(1))}else return d=Jw(b,f+2,y).times(i+""),g=zd(new b(r+"."+n.slice(1)),f-x).plus(d),b.precision=y,t==null?(On=!0,fn(g,y)):g;for(c=o=g=Js(g.minus(ra),g.plus(ra),f),h=fn(g.times(g),f),a=3;;){if(o=fn(o.times(h),f),d=c.plus(Js(o,new b(a),f)),ps(d.d).slice(0,f)===ps(c.d).slice(0,f))return c=c.times(2),i!==0&&(c=c.plus(Jw(b,f+2,y).times(i+""))),c=Js(c,new b(p),f),b.precision=y,t==null?(On=!0,fn(c,y)):c;c=d,a+=2}}function f2(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=cu(n/Cn),e.d=[],r=(n+1)%Cn,n<0&&(r+=Cn),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=Cn;r<a;)e.d.push(+t.slice(r,r+=Cn));t=t.slice(r),r=Cn-t.length}else r-=a;for(;r--;)t+="0";if(e.d.push(+t),On&&(e.e>om||e.e<-om))throw Error(hC+n)}else e.s=0,e.e=0,e.d=[0];return e}function fn(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+=Cn,a=t,f=p[h=0];else{if(h=Math.ceil((r+1)/Cn),i=p.length,h>=i)return e;for(f=i=p[h],o=1;i>=10;i/=10)o++;r%=Cn,a=r-Cn+o}if(n!==void 0&&(i=Co(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/Co(10,o-a):0:p[h-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return d?(i=Hn(e),p.length=1,t=t-i-1,p[0]=Co(10,(Cn-t%Cn)%Cn),e.e=cu(-t/Cn)||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=Co(10,Cn-r),p[h]=a>0?(f/Co(10,o-a)%Co(10,a)|0)*i:0),d)for(;;)if(h==0){(p[0]+=i)==or&&(p[0]=1,++e.e);break}else{if(p[h]+=i,p[h]!=or)break;p[h--]=0,i=1}for(r=p.length;p[--r]===0;)p.pop();if(On&&(e.e>om||e.e<-om))throw Error(hC+Hn(e));return e}function RL(e,t){var n,r,a,i,o,c,d,f,h,p,x=e.constructor,g=x.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new x(e),On?fn(t,g):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(g/Cn),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]=or-1;--d[i],d[a]+=or}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,On?fn(t,g):t):new x(0)}function zo(e,t,n){var r,a=Hn(e),i=ps(e.d),o=i.length;return t?(n&&(r=n-o)>0?i=i.charAt(0)+"."+i.slice(1)+$i(r):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+$i(-a-1)+i,n&&(r=n-o)>0&&(i+=$i(r))):a>=o?(i+=$i(a+1-o),n&&(r=n-a-1)>0&&(i=i+"."+$i(r))):((r=a+1)<o&&(i=i.slice(0,r)+"."+i.slice(r)),n&&(r=n-o)>0&&(a+1===o&&(i+="."),i+=$i(r))),e.s<0?"-"+i:i}function p2(e,t){if(e.length>t)return e.length=t,!0}function TL(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(Io+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 f2(o,i.toString())}else if(typeof i!="string")throw Error(Io+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,Xne.test(i))f2(o,i);else throw Error(Io+i)}if(a.prototype=et,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=TL,a.config=a.set=Qne,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 Qne(e){if(!e||typeof e!="object")throw Error(Ea+"Object expected");var t,n,r,a=["precision",1,lu,"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(cu(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(Io+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Io+n+": "+r);return this}var mC=TL(Yne);ra=new mC(1);const on=mC;function Jne(e){return nre(e)||tre(e)||ere(e)||Zne()}function Zne(){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 ere(e,t){if(e){if(typeof e=="string")return $1(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 $1(e,t)}}function tre(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function nre(e){if(Array.isArray(e))return $1(e)}function $1(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 rre=function(t){return t},IL={},ML=function(t){return t===IL},h2=function(t){return function n(){return arguments.length===0||arguments.length===1&&ML(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},are=function e(t,n){return t===1?n:h2(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!==IL}).length;return o>=t?n.apply(void 0,a):e(t-o,h2(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 ML(p)?d.shift():p});return n.apply(void 0,Jne(h).concat(d))}))})},Wv=function(t){return are(t.length,t)},D1=function(t,n){for(var r=[],a=t;a<n;++a)r[a-t]=a;return r},sre=Wv(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),ire=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return rre;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))}},L1=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},$L=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 ore(e){var t;return e===0?t=1:t=Math.floor(new on(e).abs().log(10).toNumber())+1,t}function lre(e,t,n){for(var r=new on(e),a=0,i=[];r.lt(t)&&a<1e5;)i.push(r.toNumber()),r=r.add(n),a++;return i}var cre=Wv(function(e,t,n){var r=+e,a=+t;return r+n*(a-r)}),ure=Wv(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),dre=Wv(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const Vv={rangeStep:lre,getDigitCount:ore,interpolateNumber:cre,uninterpolateNumber:ure,uninterpolateTruncation:dre};function F1(e){return hre(e)||pre(e)||DL(e)||fre()}function fre(){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 pre(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function hre(e){if(Array.isArray(e))return B1(e)}function Ud(e,t){return gre(e)||vre(e,t)||DL(e,t)||mre()}function mre(){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 DL(e,t){if(e){if(typeof e=="string")return B1(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 B1(e,t)}}function B1(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 vre(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 gre(e){if(Array.isArray(e))return e}function LL(e){var t=Ud(e,2),n=t[0],r=t[1],a=n,i=r;return n>r&&(a=r,i=n),[a,i]}function FL(e,t,n){if(e.lte(0))return new on(0);var r=Vv.getDigitCount(e.toNumber()),a=new on(10).pow(r),i=e.div(a),o=r!==1?.05:.1,c=new on(Math.ceil(i.div(o).toNumber())).add(n).mul(o),d=c.mul(a);return t?d:new on(Math.ceil(d))}function xre(e,t,n){var r=1,a=new on(e);if(!a.isint()&&n){var i=Math.abs(e);i<1?(r=new on(10).pow(Vv.getDigitCount(e)-1),a=new on(Math.floor(a.div(r).toNumber())).mul(r)):i>1&&(a=new on(Math.floor(e)))}else e===0?a=new on(Math.floor((t-1)/2)):n||(a=new on(Math.floor(e)));var o=Math.floor((t-1)/2),c=ire(sre(function(d){return a.add(new on(d-o).mul(r)).toNumber()}),D1);return c(0,t)}function BL(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 on(0),tickMin:new on(0),tickMax:new on(0)};var i=FL(new on(t).sub(e).div(n-1),r,a),o;e<=0&&t>=0?o=new on(0):(o=new on(e).add(t).div(2),o=o.sub(new on(o).mod(i)));var c=Math.ceil(o.sub(e).div(i).toNumber()),d=Math.ceil(new on(t).sub(o).div(i).toNumber()),f=c+d+1;return f>n?BL(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 on(c).mul(i)),tickMax:o.add(new on(d).mul(i))})}function yre(e){var t=Ud(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=LL([n,r]),d=Ud(c,2),f=d[0],h=d[1];if(f===-1/0||h===1/0){var p=h===1/0?[f].concat(F1(D1(0,a-1).map(function(){return 1/0}))):[].concat(F1(D1(0,a-1).map(function(){return-1/0})),[h]);return n>r?L1(p):p}if(f===h)return xre(f,a,i);var x=BL(f,h,o,i),g=x.step,j=x.tickMin,b=x.tickMax,y=Vv.rangeStep(j,b.add(new on(.1).mul(g)),g);return n>r?L1(y):y}function bre(e,t){var n=Ud(e,2),r=n[0],a=n[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=LL([r,a]),c=Ud(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=FL(new on(f).sub(d).div(h-1),i,0),x=[].concat(F1(Vv.rangeStep(new on(d),new on(f).sub(new on(.99).mul(p)),p)),[f]);return r>a?L1(x):x}var wre=$L(yre),jre=$L(bre),Sre="Invariant failed";function Uo(e,t){throw new Error(Sre)}var Nre=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function _c(e){"@babel/helpers - typeof";return _c=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},_c(e)}function lm(){return lm=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},lm.apply(this,arguments)}function Cre(e,t){return Pre(e)||Ere(e,t)||_re(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 _re(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 Ere(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 Pre(e){if(Array.isArray(e))return e}function kre(e,t){if(e==null)return{};var n=Ore(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 Ore(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 Rre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tre(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,qL(r.key),r)}}function Ire(e,t,n){return t&&Tre(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Mre(e,t,n){return t=cm(t),$re(e,zL()?Reflect.construct(t,n||[],cm(e).constructor):t.apply(e,n))}function $re(e,t){if(t&&(_c(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Dre(e)}function Dre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zL=function(){return!!e})()}function cm(e){return cm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},cm(e)}function Lre(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 UL(e,t,n){return t=qL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qL(e){var t=Fre(e,"string");return _c(t)=="symbol"?t:t+""}function Fre(e,t){if(_c(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(_c(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var If=(function(e){function t(){return Rre(this,t),Mre(this,t,arguments)}return Lre(t,e),Ire(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,x=kre(r,Nre),g=yt(x,!1);this.props.direction==="x"&&h.type!=="number"&&Uo();var j=d.map(function(b){var y=f(b,c),S=y.x,C=y.y,N=y.value,E=y.errorVal;if(!E)return null;var _=[],P,O;if(Array.isArray(E)){var R=Cre(E,2);P=R[0],O=R[1]}else P=O=E;if(i==="vertical"){var L=h.scale,T=C+a,D=T+o,M=T-o,G=L(N-P),B=L(N+O);_.push({x1:B,y1:D,x2:B,y2:M}),_.push({x1:G,y1:T,x2:B,y2:T}),_.push({x1:G,y1:D,x2:G,y2:M})}else if(i==="horizontal"){var W=p.scale,q=S+a,V=q-o,F=q+o,U=W(N-P),Z=W(N+O);_.push({x1:V,y1:Z,x2:F,y2:Z}),_.push({x1:q,y1:U,x2:q,y2:Z}),_.push({x1:V,y1:U,x2:F,y2:U})}return H.createElement(Jt,lm({className:"recharts-errorBar",key:"bar-".concat(_.map(function(z){return"".concat(z.x1,"-").concat(z.x2,"-").concat(z.y1,"-").concat(z.y2)}))},g),_.map(function(z){return H.createElement("line",lm({},z,{key:"line-".concat(z.x1,"-").concat(z.x2,"-").concat(z.y1,"-").concat(z.y2)}))}))});return H.createElement(Jt,{className:"recharts-errorBars"},j)}}])})(H.Component);UL(If,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});UL(If,"displayName","ErrorBar");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 v2(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 xo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v2(Object(n),!0).forEach(function(r){Bre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bre(e,t,n){return t=zre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zre(e){var t=Ure(e,"string");return qd(t)=="symbol"?t:t+""}function Ure(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 WL=function(t){var n=t.children,r=t.formattedGraphicalItems,a=t.legendWidth,i=t.legendContent,o=ea(n,Ro);if(!o)return null;var c=Ro.defaultProps,d=c!==void 0?xo(xo({},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 x=p.item,g=p.props,j=g.sectors||g.data||[];return h.concat(j.map(function(b){return{type:o.props.iconType||x.props.legendType,value:b.name,color:b.fill,payload:b}}))},[]):f=(r||[]).map(function(h){var p=h.item,x=p.type.defaultProps,g=x!==void 0?xo(xo({},x),p.props):{},j=g.dataKey,b=g.name,y=g.legendType,S=g.hide;return{inactive:S,dataKey:j,type:d.iconType||y||"square",color:vC(p),value:b||j,payload:g}}),xo(xo(xo({},d),Ro.getWithHeight(o,a)),{},{payload:f,item:o})};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 g2(e){return Hre(e)||Vre(e)||Wre(e)||qre()}function qre(){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 Wre(e,t){if(e){if(typeof e=="string")return U1(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 U1(e,t)}}function Vre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Hre(e){if(Array.isArray(e))return U1(e)}function U1(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 x2(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?x2(Object(n),!0).forEach(function(r){uc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uc(e,t,n){return t=Kre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kre(e){var t=Gre(e,"string");return Wd(t)=="symbol"?t:t+""}function Gre(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 Jn(e,t,n){return kt(e)||kt(t)?n:Zn(t)?ia(e,t,n):Pt(t)?t(e):n}function vd(e,t,n,r){var a=Hne(e,function(c){return Jn(c,t)});if(n==="number"){var i=a.filter(function(c){return Ve(c)||parseFloat(c)});return i.length?[qv(i),Uv(i)]:[1/0,-1/0]}var o=r?a.filter(function(c){return!kt(c)}):a;return o.map(function(c){return Zn(c)||c instanceof Date?c:""})}var Yre=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,x=f>=c-1?a[0].coordinate:a[f+1].coordinate,g=void 0;if(Ar(p-h)!==Ar(x-p)){var j=[];if(Ar(x-p)===Ar(d[1]-d[0])){g=x;var b=p+d[1]-d[0];j[0]=Math.min(b,(b+h)/2),j[1]=Math.max(b,(b+h)/2)}else{g=h;var y=x+d[1]-d[0];j[0]=Math.min(p,(y+p)/2),j[1]=Math.max(p,(y+p)/2)}var S=[Math.min(p,(g+p)/2),Math.max(p,(g+p)/2)];if(t>S[0]&&t<=S[1]||t>=j[0]&&t<=j[1]){o=a[f].index;break}}else{var C=Math.min(h,x),N=Math.max(h,x);if(t>(C+p)/2&&t<=(N+p)/2){o=a[f].index;break}}}else for(var E=0;E<c;E++)if(E===0&&t<=(r[E].coordinate+r[E+1].coordinate)/2||E>0&&E<c-1&&t>(r[E].coordinate+r[E-1].coordinate)/2&&t<=(r[E].coordinate+r[E+1].coordinate)/2||E===c-1&&t>(r[E].coordinate+r[E-1].coordinate)/2){o=r[E].index;break}return o},vC=function(t){var n,r=t,a=r.type.displayName,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Dn(Dn({},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},Xre=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),x=0,g=p.length;x<g;x++){var j=h[p[x]],b=j.items,y=j.cateAxisId,S=b.filter(function(O){return Xs(O.type).indexOf("Bar")>=0});if(S&&S.length){var C=S[0].type.defaultProps,N=C!==void 0?Dn(Dn({},C),S[0].props):S[0].props,E=N.barSize,_=N[y];o[_]||(o[_]=[]);var P=kt(E)?n:E;o[_].push({item:S[0],stackList:S.slice(1),barSize:kt(P)?void 0:_r(P,r,0)})}}return o},Qre=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=_r(n,a,0,!0),h,p=[];if(o[0].barSize===+o[0].barSize){var x=!1,g=a/d,j=o.reduce(function(E,_){return E+_.barSize||0},0);j+=(d-1)*f,j>=a&&(j-=(d-1)*f,f=0),j>=a&&g>0&&(x=!0,g*=.9,j=d*g);var b=(a-j)/2>>0,y={offset:b-f,size:0};h=o.reduce(function(E,_){var P={item:_.item,position:{offset:y.offset+y.size+f,size:x?g:_.barSize}},O=[].concat(g2(E),[P]);return y=O[O.length-1].position,_.stackList&&_.stackList.length&&_.stackList.forEach(function(R){O.push({item:R,position:y})}),O},p)}else{var S=_r(r,a,0,!0);a-2*S-(d-1)*f<=0&&(f=0);var C=(a-2*S-(d-1)*f)/d;C>1&&(C>>=0);var N=c===+c?Math.min(C,c):C;h=o.reduce(function(E,_,P){var O=[].concat(g2(E),[{item:_.item,position:{offset:S+(C+f)*P+(C-N)/2,size:N}}]);return _.stackList&&_.stackList.length&&_.stackList.forEach(function(R){O.push({item:R,position:O[O.length-1].position})}),O},p)}return h},Jre=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,x=h.height,g=f.align,j=f.verticalAlign,b=f.layout;if((b==="vertical"||b==="horizontal"&&j==="middle")&&g!=="center"&&Ve(t[g]))return Dn(Dn({},t),{},uc({},g,t[g]+(p||0)));if((b==="horizontal"||b==="vertical"&&g==="center")&&j!=="middle"&&Ve(t[j]))return Dn(Dn({},t),{},uc({},j,t[j]+(x||0)))}return t},Zre=function(t,n,r){return kt(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},VL=function(t,n,r,a,i){var o=n.props.children,c=oa(o,If).filter(function(f){return Zre(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=Jn(h,r);if(kt(p))return f;var x=Array.isArray(p)?[qv(p),Uv(p)]:[p,p],g=d.reduce(function(j,b){var y=Jn(h,b,0),S=x[0]-Math.abs(Array.isArray(y)?y[0]:y),C=x[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(S,j[0]),Math.max(C,j[1])]},[1/0,-1/0]);return[Math.min(g[0],f[0]),Math.max(g[1],f[1])]},[1/0,-1/0])}return null},eae=function(t,n,r,a,i){var o=n.map(function(c){return VL(t,c,r,i,a)}).filter(function(c){return!kt(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},HL=function(t,n,r,a,i){var o=n.map(function(d){var f=d.props.dataKey;return r==="number"&&f&&VL(t,d,f,a)||vd(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},[])},KL=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},ko=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?Ar(c[0]-c[1])*2*f:f,n&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(p){var x=i?i.indexOf(p):p;return{coordinate:a(x)+f,value:p,offset:f}});return h.filter(function(p){return!_f(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,x){return{coordinate:a(p)+f,value:p,index:x,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,x){return{coordinate:a(p)+f,value:i?i[p]:p,index:x,offset:f}})},Zw=new WeakMap,uh=function(t,n){if(typeof n!="function")return t;Zw.has(t)||Zw.set(t,new WeakMap);var r=Zw.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},GL=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:$d(),realScaleType:"band"}:o==="radial"&&c==="angleAxis"?{scale:rm(),realScaleType:"linear"}:i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:md(),realScaleType:"point"}:i==="category"?{scale:$d(),realScaleType:"band"}:{scale:rm(),realScaleType:"linear"};if(Lo(a)){var d="scale".concat(_v(a));return{scale:(r2[d]||md)(),realScaleType:r2[d]?d:"point"}}return Pt(a)?{scale:a}:{scale:md(),realScaleType:"point"}},y2=1e-4,YL=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])-y2,o=Math.max(a[0],a[1])+y2,c=t(n[0]),d=t(n[r-1]);(c<i||c>o||d<i||d>o)&&t.domain([n[0],n[r-1]])}},tae=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},nae=function(t,n){if(!n||n.length!==2||!Ve(n[0])||!Ve(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(!Ve(t[0])||t[0]<r)&&(i[0]=r),(!Ve(t[1])||t[1]>a)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]<r&&(i[1]=r),i},rae=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=_f(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])}},aae=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=_f(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)}},sae={sign:rae,expand:HX,none:yc,silhouette:KX,wiggle:GX,positive:aae},iae=function(t,n,r){var a=n.map(function(c){return c.props.dataKey}),i=sae[r],o=VX().keys(a).value(function(c,d){return+Jn(c,d,0)}).order(x1).offset(i);return o(t)},oae=function(t,n,r,a,i,o){if(!t)return null;var c=o?n.reverse():n,d={},f=c.reduce(function(p,x){var g,j=(g=x.type)!==null&&g!==void 0&&g.defaultProps?Dn(Dn({},x.type.defaultProps),x.props):x.props,b=j.stackId,y=j.hide;if(y)return p;var S=j[r],C=p[S]||{hasStack:!1,stackGroups:{}};if(Zn(b)){var N=C.stackGroups[b]||{numericAxisId:r,cateAxisId:a,items:[]};N.items.push(x),C.hasStack=!0,C.stackGroups[b]=N}else C.stackGroups[su("_stackId_")]={numericAxisId:r,cateAxisId:a,items:[x]};return Dn(Dn({},p),{},uc({},S,C))},d),h={};return Object.keys(f).reduce(function(p,x){var g=f[x];if(g.hasStack){var j={};g.stackGroups=Object.keys(g.stackGroups).reduce(function(b,y){var S=g.stackGroups[y];return Dn(Dn({},b),{},uc({},y,{numericAxisId:r,cateAxisId:a,items:S.items,stackedData:iae(t,S.items,i)}))},j)}return Dn(Dn({},p),{},uc({},x,g))},h)},XL=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=wre(f,i,c);return t.domain([qv(h),Uv(h)]),{niceTicks:h}}if(i&&a==="number"){var p=t.domain(),x=jre(p,i,c);return{niceTicks:x}}return null};function b2(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&&!kt(a[t.dataKey])){var c=Dh(n,"value",a[t.dataKey]);if(c)return c.coordinate+r/2}return n[i]?n[i].coordinate+r/2:null}var d=Jn(a,kt(o)?t.dataKey:o);return kt(d)?null:t.scale(d)}var w2=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=Jn(o,n.dataKey,n.domain[c]);return kt(d)?null:n.scale(d)-i/2+a},lae=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]},cae=function(t,n){var r,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Dn(Dn({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(Zn(i)){var o=n[i];if(o){var c=o.items.indexOf(t);return c>=0?o.stackedData[c]:null}}return null},uae=function(t){return t.reduce(function(n,r){return[qv(r.concat([n[0]]).filter(Ve)),Uv(r.concat([n[1]]).filter(Ve))]},[1/0,-1/0])},QL=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=uae(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})},j2=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,S2=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,q1=function(t,n,r){if(Pt(t))return t(n,r);if(!Array.isArray(t))return n;var a=[];if(Ve(t[0]))a[0]=r?t[0]:Math.min(t[0],n[0]);else if(j2.test(t[0])){var i=+j2.exec(t[0])[1];a[0]=n[0]-i}else Pt(t[0])?a[0]=t[0](n[0]):a[0]=n[0];if(Ve(t[1]))a[1]=r?t[1]:Math.max(t[1],n[1]);else if(S2.test(t[1])){var o=+S2.exec(t[1])[1];a[1]=n[1]+o}else Pt(t[1])?a[1]=t[1](n[1]):a[1]=n[1];return a},um=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=WN(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},N2=function(t,n,r){return!t||!t.length||Tf(t,ia(r,"type.defaultProps.domain"))?n:t},JL=function(t,n){var r=t.type.defaultProps?Dn(Dn({},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 Dn(Dn({},yt(t,!1)),{},{dataKey:a,unit:o,formatter:c,name:i||a,color:vC(t),value:Jn(n,a),type:d,payload:n,chartType:f,hide:h})};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 C2(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 qs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?C2(Object(n),!0).forEach(function(r){ZL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ZL(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 Vd(t)=="symbol"?t:t+""}function fae(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 pae(e,t){return gae(e)||vae(e,t)||mae(e,t)||hae()}function hae(){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 mae(e,t){if(e){if(typeof e=="string")return A2(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 A2(e,t)}}function A2(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 vae(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 gae(e){if(Array.isArray(e))return e}var dm=Math.PI/180,xae=function(t){return t*180/Math.PI},xn=function(t,n,r,a){return{x:t+Math.cos(-dm*a)*r,y:n+Math.sin(-dm*a)*r}},e4=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},yae=function(t,n,r,a,i){var o=t.width,c=t.height,d=t.startAngle,f=t.endAngle,h=_r(t.cx,o,o/2),p=_r(t.cy,c,c/2),x=e4(o,c,r),g=_r(t.innerRadius,x,0),j=_r(t.outerRadius,x,x*.8),b=Object.keys(n);return b.reduce(function(y,S){var C=n[S],N=C.domain,E=C.reversed,_;if(kt(C.range))a==="angleAxis"?_=[d,f]:a==="radiusAxis"&&(_=[g,j]),E&&(_=[_[1],_[0]]);else{_=C.range;var P=_,O=pae(P,2);d=O[0],f=O[1]}var R=GL(C,i),L=R.realScaleType,T=R.scale;T.domain(N).range(_),YL(T);var D=XL(T,qs(qs({},C),{},{realScaleType:L})),M=qs(qs(qs({},C),D),{},{range:_,radius:j,realScaleType:L,scale:T,cx:h,cy:p,innerRadius:g,outerRadius:j,startAngle:d,endAngle:f});return qs(qs({},y),{},ZL({},S,M))},{})},bae=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))},wae=function(t,n){var r=t.x,a=t.y,i=n.cx,o=n.cy,c=bae({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:xae(f),angleInRadian:f}},jae=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}},Sae=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},_2=function(t,n){var r=t.x,a=t.y,i=wae({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=jae(n),p=h.startAngle,x=h.endAngle,g=c,j;if(p<=x){for(;g>x;)g-=360;for(;g<p;)g+=360;j=g>=p&&g<=x}else{for(;g>p;)g-=360;for(;g<x;)g+=360;j=g>=x&&g<=p}return j?qs(qs({},n),{},{radius:o,angle:Sae(g,n)}):null},t4=function(t){return!v.isValidElement(t)&&!Pt(t)&&typeof t!="boolean"?t.className:""};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 Nae=["offset"];function Cae(e){return Pae(e)||Eae(e)||_ae(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 _ae(e,t){if(e){if(typeof e=="string")return W1(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 W1(e,t)}}function Eae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Pae(e){if(Array.isArray(e))return W1(e)}function W1(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 kae(e,t){if(e==null)return{};var n=Oae(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 Oae(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 E2(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 Qn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?E2(Object(n),!0).forEach(function(r){Rae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rae(e,t,n){return t=Tae(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tae(e){var t=Iae(e,"string");return Hd(t)=="symbol"?t:t+""}function Iae(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 Kd(){return Kd=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},Kd.apply(this,arguments)}var Mae=function(t){var n=t.value,r=t.formatter,a=kt(t.children)?n:t.children;return Pt(r)?r(a):a},$ae=function(t,n){var r=Ar(n-t),a=Math.min(Math.abs(n-t),360);return r*a},Dae=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,x=d.outerRadius,g=d.startAngle,j=d.endAngle,b=d.clockWise,y=(p+x)/2,S=$ae(g,j),C=S>=0?1:-1,N,E;a==="insideStart"?(N=g+C*o,E=b):a==="insideEnd"?(N=j-C*o,E=!b):a==="end"&&(N=j+C*o,E=b),E=S<=0?E:!E;var _=xn(f,h,y,N),P=xn(f,h,y,N+(E?1:-1)*359),O="M".concat(_.x,",").concat(_.y,`
75
- A`).concat(y,",").concat(y,",0,1,").concat(E?0:1,`,
76
- `).concat(P.x,",").concat(P.y),R=kt(t.id)?su("recharts-radial-line-"):t.id;return H.createElement("text",Kd({},r,{dominantBaseline:"central",className:Rt("recharts-radial-bar-label",c)}),H.createElement("defs",null,H.createElement("path",{id:R,d:O})),H.createElement("textPath",{xlinkHref:"#".concat(R)},n))},Lae=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,x=(h+p)/2;if(a==="outside"){var g=xn(o,c,f+r,x),j=g.x,b=g.y;return{x:j,y:b,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 y=(d+f)/2,S=xn(o,c,y,x),C=S.x,N=S.y;return{x:C,y:N,textAnchor:"middle",verticalAnchor:"middle"}},Fae=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,x=p*a,g=p>0?"end":"start",j=p>0?"start":"end",b=f>=0?1:-1,y=b*a,S=b>0?"end":"start",C=b>0?"start":"end";if(i==="top"){var N={x:c+f/2,y:d-p*a,textAnchor:"middle",verticalAnchor:g};return Qn(Qn({},N),r?{height:Math.max(d-r.y,0),width:f}:{})}if(i==="bottom"){var E={x:c+f/2,y:d+h+x,textAnchor:"middle",verticalAnchor:j};return Qn(Qn({},E),r?{height:Math.max(r.y+r.height-(d+h),0),width:f}:{})}if(i==="left"){var _={x:c-y,y:d+h/2,textAnchor:S,verticalAnchor:"middle"};return Qn(Qn({},_),r?{width:Math.max(_.x-r.x,0),height:h}:{})}if(i==="right"){var P={x:c+f+y,y:d+h/2,textAnchor:C,verticalAnchor:"middle"};return Qn(Qn({},P),r?{width:Math.max(r.x+r.width-P.x,0),height:h}:{})}var O=r?{width:f,height:h}:{};return i==="insideLeft"?Qn({x:c+y,y:d+h/2,textAnchor:C,verticalAnchor:"middle"},O):i==="insideRight"?Qn({x:c+f-y,y:d+h/2,textAnchor:S,verticalAnchor:"middle"},O):i==="insideTop"?Qn({x:c+f/2,y:d+x,textAnchor:"middle",verticalAnchor:j},O):i==="insideBottom"?Qn({x:c+f/2,y:d+h-x,textAnchor:"middle",verticalAnchor:g},O):i==="insideTopLeft"?Qn({x:c+y,y:d+x,textAnchor:C,verticalAnchor:j},O):i==="insideTopRight"?Qn({x:c+f-y,y:d+x,textAnchor:S,verticalAnchor:j},O):i==="insideBottomLeft"?Qn({x:c+y,y:d+h-x,textAnchor:C,verticalAnchor:g},O):i==="insideBottomRight"?Qn({x:c+f-y,y:d+h-x,textAnchor:S,verticalAnchor:g},O):au(i)&&(Ve(i.x)||_o(i.x))&&(Ve(i.y)||_o(i.y))?Qn({x:c+_r(i.x,f),y:d+_r(i.y,h),textAnchor:"end",verticalAnchor:"end"},O):Qn({x:c+f/2,y:d+h/2,textAnchor:"middle",verticalAnchor:"middle"},O)},Bae=function(t){return"cx"in t&&Ve(t.cx)};function lr(e){var t=e.offset,n=t===void 0?5:t,r=kae(e,Nae),a=Qn({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,x=a.textBreakAll;if(!i||kt(c)&&kt(d)&&!v.isValidElement(f)&&!Pt(f))return null;if(v.isValidElement(f))return v.cloneElement(f,a);var g;if(Pt(f)){if(g=v.createElement(f,a),v.isValidElement(g))return g}else g=Mae(a);var j=Bae(i),b=yt(a,!0);if(j&&(o==="insideStart"||o==="insideEnd"||o==="end"))return Dae(a,g,b);var y=j?Lae(a):Fae(a);return H.createElement(Bo,Kd({className:Rt("recharts-label",p)},b,y,{breakAll:x}),g)}lr.displayName="Label";var n4=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,x=t.y,g=t.top,j=t.left,b=t.width,y=t.height,S=t.clockWise,C=t.labelViewBox;if(C)return C;if(Ve(b)&&Ve(y)){if(Ve(p)&&Ve(x))return{x:p,y:x,width:b,height:y};if(Ve(g)&&Ve(j))return{x:g,y:j,width:b,height:y}}return Ve(p)&&Ve(x)?{x:p,y:x,width:0,height:0}:Ve(n)&&Ve(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:{}},zae=function(t,n){return t?t===!0?H.createElement(lr,{key:"label-implicit",viewBox:n}):Zn(t)?H.createElement(lr,{key:"label-implicit",viewBox:n,value:t}):v.isValidElement(t)?t.type===lr?v.cloneElement(t,{key:"label-implicit",viewBox:n}):H.createElement(lr,{key:"label-implicit",content:t,viewBox:n}):Pt(t)?H.createElement(lr,{key:"label-implicit",content:t,viewBox:n}):au(t)?H.createElement(lr,Kd({viewBox:n},t,{key:"label-implicit"})):null:null},Uae=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=n4(t),o=oa(a,lr).map(function(d,f){return v.cloneElement(d,{viewBox:n||i,key:"label-".concat(f)})});if(!r)return o;var c=zae(t.label,n||i);return[c].concat(Cae(o))};lr.parseViewBox=n4;lr.renderCallByParent=Uae;var ej,P2;function qae(){if(P2)return ej;P2=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return ej=e,ej}var Wae=qae();const Vae=an(Wae);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)}var Hae=["valueAccessor"],Kae=["data","dataKey","clockWise","id","textBreakAll"];function Gae(e){return Jae(e)||Qae(e)||Xae(e)||Yae()}function Yae(){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 Xae(e,t){if(e){if(typeof e=="string")return V1(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 V1(e,t)}}function Qae(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Jae(e){if(Array.isArray(e))return V1(e)}function V1(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 fm(){return fm=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},fm.apply(this,arguments)}function k2(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 O2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?k2(Object(n),!0).forEach(function(r){Zae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zae(e,t,n){return t=ese(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ese(e){var t=tse(e,"string");return Gd(t)=="symbol"?t:t+""}function tse(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 R2(e,t){if(e==null)return{};var n=nse(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 nse(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 rse=function(t){return Array.isArray(t.value)?Vae(t.value):t.value};function Zs(e){var t=e.valueAccessor,n=t===void 0?rse:t,r=R2(e,Hae),a=r.data,i=r.dataKey,o=r.clockWise,c=r.id,d=r.textBreakAll,f=R2(r,Kae);return!a||!a.length?null:H.createElement(Jt,{className:"recharts-label-list"},a.map(function(h,p){var x=kt(i)?n(h,p):Jn(h&&h.payload,i),g=kt(c)?{}:{id:"".concat(c,"-").concat(p)};return H.createElement(lr,fm({},yt(h,!0),f,g,{parentViewBox:h.parentViewBox,value:x,textBreakAll:d,viewBox:lr.parseViewBox(kt(o)?h:O2(O2({},h),{},{clockWise:o})),key:"label-".concat(p),index:p}))}))}Zs.displayName="LabelList";function ase(e,t){return e?e===!0?H.createElement(Zs,{key:"labelList-implicit",data:t}):H.isValidElement(e)||Pt(e)?H.createElement(Zs,{key:"labelList-implicit",data:t,content:e}):au(e)?H.createElement(Zs,fm({data:t},e,{key:"labelList-implicit"})):null:null}function sse(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=oa(r,Zs).map(function(o,c){return v.cloneElement(o,{data:t,key:"labelList-".concat(c)})});if(!n)return a;var i=ase(e.label,t);return[i].concat(Gae(a))}Zs.renderCallByParent=sse;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 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 T2(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 I2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?T2(Object(n),!0).forEach(function(r){ise(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ise(e,t,n){return t=ose(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ose(e){var t=lse(e,"string");return Yd(t)=="symbol"?t:t+""}function lse(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)}var cse=function(t,n){var r=Ar(n-t),a=Math.min(Math.abs(n-t),359.999);return r*a},dh=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)/dm,x=f?i:i+o*p,g=xn(n,r,h,x),j=xn(n,r,a,x),b=f?i-o*p:i,y=xn(n,r,h*Math.cos(p*dm),b);return{center:g,circleTangency:j,lineTangency:y,theta:p}},r4=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.startAngle,c=t.endAngle,d=cse(o,c),f=o+d,h=xn(n,r,i,o),p=xn(n,r,i,f),x="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 g=xn(n,r,a,o),j=xn(n,r,a,f);x+="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(g.x,",").concat(g.y," Z")}else x+="L ".concat(n,",").concat(r," Z");return x},use=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=Ar(h-f),x=dh({cx:n,cy:r,radius:i,angle:f,sign:p,cornerRadius:o,cornerIsExternal:d}),g=x.circleTangency,j=x.lineTangency,b=x.theta,y=dh({cx:n,cy:r,radius:i,angle:h,sign:-p,cornerRadius:o,cornerIsExternal:d}),S=y.circleTangency,C=y.lineTangency,N=y.theta,E=d?Math.abs(f-h):Math.abs(f-h)-b-N;if(E<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
- `):r4({cx:n,cy:r,innerRadius:a,outerRadius:i,startAngle:f,endAngle:h});var _="M ".concat(j.x,",").concat(j.y,`
88
- A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(g.x,",").concat(g.y,`
89
- A`).concat(i,",").concat(i,",0,").concat(+(E>180),",").concat(+(p<0),",").concat(S.x,",").concat(S.y,`
90
- A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(C.x,",").concat(C.y,`
91
- `);if(a>0){var P=dh({cx:n,cy:r,radius:a,angle:f,sign:p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),O=P.circleTangency,R=P.lineTangency,L=P.theta,T=dh({cx:n,cy:r,radius:a,angle:h,sign:-p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),D=T.circleTangency,M=T.lineTangency,G=T.theta,B=d?Math.abs(f-h):Math.abs(f-h)-L-G;if(B<0&&o===0)return"".concat(_,"L").concat(n,",").concat(r,"Z");_+="L".concat(M.x,",").concat(M.y,`
92
- A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(D.x,",").concat(D.y,`
93
- A`).concat(a,",").concat(a,",0,").concat(+(B>180),",").concat(+(p>0),",").concat(O.x,",").concat(O.y,`
94
- A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(R.x,",").concat(R.y,"Z")}else _+="L".concat(n,",").concat(r,"Z");return _},dse={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},a4=function(t){var n=I2(I2({},dse),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,x=n.className;if(o<i||h===p)return null;var g=Rt("recharts-sector",x),j=o-i,b=_r(c,j,0,!0),y;return b>0&&Math.abs(h-p)<360?y=use({cx:r,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(b,j/2),forceCornerRadius:d,cornerIsExternal:f,startAngle:h,endAngle:p}):y=r4({cx:r,cy:a,innerRadius:i,outerRadius:o,startAngle:h,endAngle:p}),H.createElement("path",H1({},yt(n,!0),{className:g,d:y,role:"img"}))};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 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 M2(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 $2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?M2(Object(n),!0).forEach(function(r){fse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fse(e,t,n){return t=pse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pse(e){var t=hse(e,"string");return Xd(t)=="symbol"?t:t+""}function hse(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 D2={curveBasisClosed:IX,curveBasisOpen:MX,curveBasis:TX,curveBumpX:yX,curveBumpY:bX,curveLinearClosed:$X,curveLinear:Pv,curveMonotoneX:DX,curveMonotoneY:LX,curveNatural:FX,curveStep:BX,curveStepAfter:UX,curveStepBefore:zX},fh=function(t){return t.x===+t.x&&t.y===+t.y},td=function(t){return t.x},nd=function(t){return t.y},mse=function(t,n){if(Pt(t))return t;var r="curve".concat(_v(t));return(r==="curveMonotone"||r==="curveBump")&&n?D2["".concat(r).concat(n==="vertical"?"Y":"X")]:D2[r]||Pv},vse=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=mse(r,c),p=f?i.filter(function(b){return fh(b)}):i,x;if(Array.isArray(o)){var g=f?o.filter(function(b){return fh(b)}):o,j=p.map(function(b,y){return $2($2({},b),{},{base:g[y]})});return c==="vertical"?x=rh().y(nd).x1(td).x0(function(b){return b.base.x}):x=rh().x(td).y1(nd).y0(function(b){return b.base.y}),x.defined(fh).curve(h),x(j)}return c==="vertical"&&Ve(o)?x=rh().y(nd).x1(td).x0(o):Ve(o)?x=rh().x(td).y1(nd).y0(o):x=a5().x(td).y(nd),x.defined(fh).curve(h),x(p)},pm=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?vse(t):a;return v.createElement("path",K1({},yt(t,!1),Lh(t),{className:Rt("recharts-curve",n),d:o,ref:i}))},tj={exports:{}},nj,L2;function gse(){if(L2)return nj;L2=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return nj=e,nj}var rj,F2;function xse(){if(F2)return rj;F2=1;var e=gse();function t(){}function n(){}return n.resetWarningCache=t,rj=function(){function r(o,c,d,f,h,p){if(p!==e){var x=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 x.name="Invariant Violation",x}}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},rj}var B2;function yse(){return B2||(B2=1,tj.exports=xse()()),tj.exports}var bse=yse();const rn=an(bse),{getOwnPropertyNames:wse,getOwnPropertySymbols:jse}=Object,{hasOwnProperty:Sse}=Object.prototype;function aj(e,t){return function(r,a,i){return e(r,a,i)&&t(r,a,i)}}function ph(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 z2(e){return wse(e).concat(jse(e))}const Cse=Object.hasOwn||((e,t)=>Sse.call(e,t));function il(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const Ase="__v",_se="__o",Ese="_owner",{getOwnPropertyDescriptor:U2,keys:q2}=Object;function Pse(e,t){return e.byteLength===t.byteLength&&hm(new Uint8Array(e),new Uint8Array(t))}function kse(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 Ose(e,t){return e.byteLength===t.byteLength&&hm(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Rse(e,t){return il(e.getTime(),t.getTime())}function Tse(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Ise(e,t){return e===t}function W2(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 x=o.value,g=c.value;if(n.equals(x[0],g[0],d,p,e,t,n)&&n.equals(x[1],g[1],x[0],g[0],e,t,n)){h=a[p]=!0;break}p++}if(!h)return!1;d++}return!0}const Mse=il;function $se(e,t,n){const r=q2(e);let a=r.length;if(q2(t).length!==a)return!1;for(;a-- >0;)if(!s4(e,t,n,r[a]))return!1;return!0}function rd(e,t,n){const r=z2(e);let a=r.length;if(z2(t).length!==a)return!1;let i,o,c;for(;a-- >0;)if(i=r[a],!s4(e,t,n,i)||(o=U2(e,i),c=U2(t,i),(o||c)&&(!o||!c||o.configurable!==c.configurable||o.enumerable!==c.enumerable||o.writable!==c.writable)))return!1;return!0}function Dse(e,t){return il(e.valueOf(),t.valueOf())}function Lse(e,t){return e.source===t.source&&e.flags===t.flags}function V2(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 hm(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 Fse(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 s4(e,t,n,r){return(r===Ese||r===_se||r===Ase)&&(e.$$typeof||t.$$typeof)?!0:Cse(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const Bse="[object ArrayBuffer]",zse="[object Arguments]",Use="[object Boolean]",qse="[object DataView]",Wse="[object Date]",Vse="[object Error]",Hse="[object Map]",Kse="[object Number]",Gse="[object Object]",Yse="[object RegExp]",Xse="[object Set]",Qse="[object String]",Jse={"[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},Zse="[object URL]",eie=Object.prototype.toString;function tie({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:x,areUrlsEqual:g,unknownTagComparators:j}){return function(y,S,C){if(y===S)return!0;if(y==null||S==null)return!1;const N=typeof y;if(N!==typeof S)return!1;if(N!=="object")return N==="number"?c(y,S,C):N==="function"?i(y,S,C):!1;const E=y.constructor;if(E!==S.constructor)return!1;if(E===Object)return d(y,S,C);if(Array.isArray(y))return t(y,S,C);if(E===Date)return r(y,S,C);if(E===RegExp)return h(y,S,C);if(E===Map)return o(y,S,C);if(E===Set)return p(y,S,C);const _=eie.call(y);if(_===Wse)return r(y,S,C);if(_===Yse)return h(y,S,C);if(_===Hse)return o(y,S,C);if(_===Xse)return p(y,S,C);if(_===Gse)return typeof y.then!="function"&&typeof S.then!="function"&&d(y,S,C);if(_===Zse)return g(y,S,C);if(_===Vse)return a(y,S,C);if(_===zse)return d(y,S,C);if(Jse[_])return x(y,S,C);if(_===Bse)return e(y,S,C);if(_===qse)return n(y,S,C);if(_===Use||_===Kse||_===Qse)return f(y,S,C);if(j){let P=j[_];if(!P){const O=Nse(y);O&&(P=j[O])}if(P)return P(y,S,C)}return!1}}function nie({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:Pse,areArraysEqual:n?rd:kse,areDataViewsEqual:Ose,areDatesEqual:Rse,areErrorsEqual:Tse,areFunctionsEqual:Ise,areMapsEqual:n?aj(W2,rd):W2,areNumbersEqual:Mse,areObjectsEqual:n?rd:$se,arePrimitiveWrappersEqual:Dse,areRegExpsEqual:Lse,areSetsEqual:n?aj(V2,rd):V2,areTypedArraysEqual:n?aj(hm,rd):hm,areUrlsEqual:Fse,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const a=ph(r.areArraysEqual),i=ph(r.areMapsEqual),o=ph(r.areObjectsEqual),c=ph(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:c})}return r}function rie(e){return function(t,n,r,a,i,o,c){return e(t,n,c)}}function aie({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 sie=to();to({strict:!0});to({circular:!0});to({circular:!0,strict:!0});to({createInternalComparator:()=>il});to({strict:!0,createInternalComparator:()=>il});to({circular:!0,createInternalComparator:()=>il});to({circular:!0,createInternalComparator:()=>il,strict:!0});function to(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:a=!1}=e,i=nie(e),o=tie(i),c=n?n(o):rie(o);return aie({circular:t,comparator:o,createState:r,equals:c,strict:a})}function iie(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function H2(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):iie(a)};requestAnimationFrame(r)}function G1(e){"@babel/helpers - typeof";return G1=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},G1(e)}function oie(e){return die(e)||uie(e)||cie(e)||lie()}function lie(){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 cie(e,t){if(e){if(typeof e=="string")return K2(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 K2(e,t)}}function K2(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 uie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function die(e){if(Array.isArray(e))return e}function fie(){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=oie(o),d=c[0],f=c.slice(1);if(typeof d=="number"){H2(a.bind(null,f),d);return}a(d),H2(a.bind(null,f));return}G1(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 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 G2(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 Y2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?G2(Object(n),!0).forEach(function(r){i4(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):G2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function i4(e,t,n){return t=pie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pie(e){var t=hie(e,"string");return Qd(t)==="symbol"?t:String(t)}function hie(e,t){if(Qd(e)!=="object"||e===null)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 mie=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,a){return r.filter(function(i){return a.includes(i)})})},vie=function(t){return t},gie=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},gd=function(t,n){return Object.keys(n).reduce(function(r,a){return Y2(Y2({},r),{},i4({},a,t(a,n[a])))},{})},X2=function(t,n,r){return t.map(function(a){return"".concat(gie(a)," ").concat(n,"ms ").concat(r)}).join(",")};function xie(e,t){return wie(e)||bie(e,t)||o4(e,t)||yie()}function yie(){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 bie(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 wie(e){if(Array.isArray(e))return e}function jie(e){return Cie(e)||Nie(e)||o4(e)||Sie()}function Sie(){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 o4(e,t){if(e){if(typeof e=="string")return Y1(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 Y1(e,t)}}function Nie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Cie(e){if(Array.isArray(e))return Y1(e)}function Y1(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 mm=1e-4,l4=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},c4=function(t,n){return t.map(function(r,a){return r*Math.pow(n,a)}).reduce(function(r,a){return r+a})},Q2=function(t,n){return function(r){var a=l4(t,n);return c4(a,r)}},Aie=function(t,n){return function(r){var a=l4(t,n),i=[].concat(jie(a.map(function(o,c){return o*c}).slice(1)),[0]);return c4(i,r)}},J2=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(y){return parseFloat(y)}),h=xie(f,4);a=h[0],i=h[1],o=h[2],c=h[3]}}}var p=Q2(a,o),x=Q2(i,c),g=Aie(a,o),j=function(S){return S>1?1:S<0?0:S},b=function(S){for(var C=S>1?1:S,N=C,E=0;E<8;++E){var _=p(N)-C,P=g(N);if(Math.abs(_-C)<mm||P<mm)return x(N);N=j(N-_/P)}return x(N)};return b.isStepper=!1,b},_ie=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,x){var g=-(h-p)*r,j=x*i,b=x+(g-j)*c/1e3,y=x*c/1e3+h;return Math.abs(y-p)<mm&&Math.abs(b)<mm?[p,0]:[y,b]};return d.isStepper=!0,d.dt=c,d},Eie=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 J2(a);case"spring":return _ie();default:if(a.split("(")[0]==="cubic-bezier")return J2(a)}return typeof a=="function"?a:null};function Jd(e){"@babel/helpers - typeof";return Jd=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},Jd(e)}function Z2(e){return Oie(e)||kie(e)||u4(e)||Pie()}function Pie(){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 kie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Oie(e){if(Array.isArray(e))return Q1(e)}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 pr(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){X1(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 X1(e,t,n){return t=Rie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rie(e){var t=Tie(e,"string");return Jd(t)==="symbol"?t:String(t)}function Tie(e,t){if(Jd(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Jd(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Iie(e,t){return Die(e)||$ie(e,t)||u4(e,t)||Mie()}function Mie(){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 u4(e,t){if(e){if(typeof e=="string")return Q1(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 Q1(e,t)}}function Q1(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 $ie(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 Die(e){if(Array.isArray(e))return e}var vm=function(t,n,r){return t+(n-t)*r},J1=function(t){var n=t.from,r=t.to;return n!==r},Lie=function e(t,n,r){var a=gd(function(i,o){if(J1(o)){var c=t(o.from,o.to,o.velocity),d=Iie(c,2),f=d[0],h=d[1];return pr(pr({},o),{},{from:f,velocity:h})}return o},n);return r<1?gd(function(i,o){return J1(o)?pr(pr({},o),{},{velocity:vm(o.velocity,a[i].velocity,r),from:vm(o.from,a[i].from,r)}):o},n):e(t,a,r-1)};const Fie=(function(e,t,n,r,a){var i=mie(e,t),o=i.reduce(function(y,S){return pr(pr({},y),{},X1({},S,[e[S],t[S]]))},{}),c=i.reduce(function(y,S){return pr(pr({},y),{},X1({},S,{from:e[S],velocity:0,to:t[S]}))},{}),d=-1,f,h,p=function(){return null},x=function(){return gd(function(S,C){return C.from},c)},g=function(){return!Object.values(c).filter(J1).length},j=function(S){f||(f=S);var C=S-f,N=C/n.dt;c=Lie(n,c,N),a(pr(pr(pr({},e),t),x())),f=S,g()||(d=requestAnimationFrame(p))},b=function(S){h||(h=S);var C=(S-h)/r,N=gd(function(_,P){return vm.apply(void 0,Z2(P).concat([n(C)]))},o);if(a(pr(pr(pr({},e),t),N)),C<1)d=requestAnimationFrame(p);else{var E=gd(function(_,P){return vm.apply(void 0,Z2(P).concat([n(1)]))},o);a(pr(pr(pr({},e),t),E))}};return p=n.isStepper?j:b,function(){return requestAnimationFrame(p),function(){cancelAnimationFrame(d)}}});function Ec(e){"@babel/helpers - typeof";return Ec=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},Ec(e)}var Bie=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function zie(e,t){if(e==null)return{};var n=Uie(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 Uie(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 sj(e){return Hie(e)||Vie(e)||Wie(e)||qie()}function qie(){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 Wie(e,t){if(e){if(typeof e=="string")return Z1(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 Z1(e,t)}}function Vie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Hie(e){if(Array.isArray(e))return Z1(e)}function Z1(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 tI(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 Fa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tI(Object(n),!0).forEach(function(r){cd(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cd(e,t,n){return t=d4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gie(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,d4(r.key),r)}}function Yie(e,t,n){return t&&Gie(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function d4(e){var t=Xie(e,"string");return Ec(t)==="symbol"?t:String(t)}function Xie(e,t){if(Ec(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ec(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qie(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&&eS(e,t)}function eS(e,t){return eS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},eS(e,t)}function Jie(e){var t=Zie();return function(){var r=gm(e),a;if(t){var i=gm(this).constructor;a=Reflect.construct(r,arguments,i)}else a=r.apply(this,arguments);return tS(this,a)}}function tS(e,t){if(t&&(Ec(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nS(e)}function nS(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zie(){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 gm(e){return gm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},gm(e)}var Ns=(function(e){Qie(n,e);var t=Jie(n);function n(r,a){var i;Kie(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,x=o.children,g=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(nS(i)),i.changeStyle=i.changeStyle.bind(nS(i)),!c||g<=0)return i.state={style:{}},typeof x=="function"&&(i.state={style:h}),tS(i);if(p&&p.length)i.state={style:p[0].style};else if(f){if(typeof x=="function")return i.state={style:f},tS(i);i.state={style:d?cd({},d,f):f}}else i.state={style:{}};return i}return Yie(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,x=this.state.style;if(c){if(!o){var g={style:d?cd({},d,h):h};this.state&&x&&(d&&x[d]!==h||!d&&x!==h)&&this.setState(g);return}if(!(sie(a.to,h)&&a.canBegin&&a.isActive)){var j=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var b=j||f?p:a.to;if(this.state&&x){var y={style:d?cd({},d,b):b};(d&&x[d]!==b||!d&&x!==b)&&this.setState(y)}this.runAnimation(Fa(Fa({},this.props),{},{from:b,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,x=a.onAnimationStart,g=Fie(o,c,Eie(f),d,this.changeStyle),j=function(){i.stopJSAnimation=g()};this.manager.start([x,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,x=p===void 0?0:p,g=function(b,y,S){if(S===0)return b;var C=y.duration,N=y.easing,E=N===void 0?"ease":N,_=y.style,P=y.properties,O=y.onAnimationEnd,R=S>0?o[S-1]:y,L=P||Object.keys(_);if(typeof E=="function"||E==="spring")return[].concat(sj(b),[i.runJSAnimation.bind(i,{from:R.style,to:_,duration:C,easing:E}),C]);var T=X2(L,C,E),D=Fa(Fa(Fa({},R.style),_),{},{transition:T});return[].concat(sj(b),[D,C,O]).filter(vie)};return this.manager.start([d].concat(sj(o.reduce(g,[h,Math.max(x,c)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=fie());var i=a.begin,o=a.duration,c=a.attributeName,d=a.to,f=a.easing,h=a.onAnimationStart,p=a.onAnimationEnd,x=a.steps,g=a.children,j=this.manager;if(this.unSubscribe=j.subscribe(this.handleStyleChange),typeof f=="function"||typeof g=="function"||f==="spring"){this.runJSAnimation(a);return}if(x.length>1){this.runStepAnimation(a);return}var b=c?cd({},c,d):d,y=X2(Object.keys(b),o,f);j.start([h,i,Fa(Fa({},b),{},{transition:y}),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=zie(a,Bie),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(g){var j=g.props,b=j.style,y=b===void 0?{}:b,S=j.className,C=v.cloneElement(g,Fa(Fa({},d),{},{style:Fa(Fa({},y),h),className:S}));return C};return f===1?p(v.Children.only(i)):H.createElement("div",null,v.Children.map(i,function(x){return p(x)}))}}]),n})(v.PureComponent);Ns.displayName="Animate";Ns.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Ns.propTypes={from:rn.oneOfType([rn.object,rn.string]),to:rn.oneOfType([rn.object,rn.string]),attributeName:rn.string,duration:rn.number,begin:rn.number,easing:rn.oneOfType([rn.string,rn.func]),steps:rn.arrayOf(rn.shape({duration:rn.number.isRequired,style:rn.object.isRequired,easing:rn.oneOfType([rn.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),rn.func]),properties:rn.arrayOf("string"),onAnimationEnd:rn.func})),children:rn.oneOfType([rn.node,rn.func]),isActive:rn.bool,canBegin:rn.bool,onAnimationEnd:rn.func,shouldReAnimate:rn.bool,onAnimationStart:rn.func,onAnimationReStart:rn.func};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 xm(){return xm=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},xm.apply(this,arguments)}function eoe(e,t){return aoe(e)||roe(e,t)||noe(e,t)||toe()}function toe(){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 noe(e,t){if(e){if(typeof e=="string")return nI(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 nI(e,t)}}function nI(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 roe(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 aoe(e){if(Array.isArray(e))return 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 aI(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){soe(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 soe(e,t,n){return t=ioe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ioe(e){var t=ooe(e,"string");return Zd(t)=="symbol"?t:t+""}function ooe(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)}var sI=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],x=0,g=4;x<g;x++)p[x]=i[x]>o?o:i[x];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},loe=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),x=Math.max(o,o+d);return r>=f&&r<=h&&a>=p&&a<=x}return!1},coe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},gC=function(t){var n=aI(aI({},coe),t),r=v.useRef(),a=v.useState(-1),i=eoe(a,2),o=i[0],c=i[1];v.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var E=r.current.getTotalLength();E&&c(E)}catch{}},[]);var d=n.x,f=n.y,h=n.width,p=n.height,x=n.radius,g=n.className,j=n.animationEasing,b=n.animationDuration,y=n.animationBegin,S=n.isAnimationActive,C=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||h===0||p===0)return null;var N=Rt("recharts-rectangle",g);return C?H.createElement(Ns,{canBegin:o>0,from:{width:h,height:p,x:d,y:f},to:{width:h,height:p,x:d,y:f},duration:b,animationEasing:j,isActive:C},function(E){var _=E.width,P=E.height,O=E.x,R=E.y;return H.createElement(Ns,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:b,isActive:S,easing:j},H.createElement("path",xm({},yt(n,!0),{className:N,d:sI(O,R,_,P,x),ref:r})))}):H.createElement("path",xm({},yt(n,!0),{className:N,d:sI(d,f,h,p,x)}))},uoe=["points","className","baseLinePoints","connectNulls"];function Zl(){return Zl=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},Zl.apply(this,arguments)}function doe(e,t){if(e==null)return{};var n=foe(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 foe(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 iI(e){return voe(e)||moe(e)||hoe(e)||poe()}function poe(){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 hoe(e,t){if(e){if(typeof e=="string")return rS(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 rS(e,t)}}function moe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function voe(e){if(Array.isArray(e))return rS(e)}function rS(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 oI=function(t){return t&&t.x===+t.x&&t.y===+t.y},goe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){oI(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),oI(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},xd=function(t,n){var r=goe(t);n&&(r=[r.reduce(function(i,o){return[].concat(iI(i),iI(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},xoe=function(t,n,r){var a=xd(t,r);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(xd(n.reverse(),r).slice(1))},yoe=function(t){var n=t.points,r=t.className,a=t.baseLinePoints,i=t.connectNulls,o=doe(t,uoe);if(!n||!n.length)return null;var c=Rt("recharts-polygon",r);if(a&&a.length){var d=o.stroke&&o.stroke!=="none",f=xoe(n,a,i);return H.createElement("g",{className:c},H.createElement("path",Zl({},yt(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:f})),d?H.createElement("path",Zl({},yt(o,!0),{fill:"none",d:xd(n,i)})):null,d?H.createElement("path",Zl({},yt(o,!0),{fill:"none",d:xd(a,i)})):null)}var h=xd(n,i);return H.createElement("path",Zl({},yt(o,!0),{fill:h.slice(-1)==="Z"?o.fill:"none",className:c,d:h}))};function aS(){return aS=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},aS.apply(this,arguments)}var Hv=function(t){var n=t.cx,r=t.cy,a=t.r,i=t.className,o=Rt("recharts-dot",i);return n===+n&&r===+r&&a===+a?v.createElement("circle",aS({},yt(t,!1),Lh(t),{className:o,cx:n,cy:r,r:a})):null};function ef(e){"@babel/helpers - typeof";return ef=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},ef(e)}var boe=["x","y","top","left","width","height","className"];function sS(){return sS=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},sS.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 woe(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){joe(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 joe(e,t,n){return t=Soe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Soe(e){var t=Noe(e,"string");return ef(t)=="symbol"?t:t+""}function Noe(e,t){if(ef(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ef(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Coe(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 _oe=function(t,n,r,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(n,"h").concat(r)},Eoe=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,x=t.height,g=x===void 0?0:x,j=t.className,b=Coe(t,boe),y=woe({x:r,y:i,top:c,left:f,width:p,height:g},b);return!Ve(r)||!Ve(i)||!Ve(p)||!Ve(g)||!Ve(c)||!Ve(f)?null:H.createElement("path",sS({},yt(y,!0),{className:Rt("recharts-cross",j),d:_oe(r,i,p,g,c,f)}))},ij,cI;function Poe(){if(cI)return ij;cI=1;var e=zv(),t=_L(),n=Ps();function r(a,i){return a&&a.length?e(a,n(i,2),t):void 0}return ij=r,ij}var koe=Poe();const Ooe=an(koe);var oj,uI;function Roe(){if(uI)return oj;uI=1;var e=zv(),t=Ps(),n=EL();function r(a,i){return a&&a.length?e(a,t(i,2),n):void 0}return oj=r,oj}var Toe=Roe();const Ioe=an(Toe);var Moe=["cx","cy","angle","ticks","axisLine"],$oe=["ticks","tick","angle","tickFormatter","stroke"];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 yd(){return yd=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},yd.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 yo(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){Kv(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 fI(e,t){if(e==null)return{};var n=Doe(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 Doe(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 Loe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pI(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,p4(r.key),r)}}function Foe(e,t,n){return t&&pI(e.prototype,t),n&&pI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Boe(e,t,n){return t=ym(t),zoe(e,f4()?Reflect.construct(t,n||[],ym(e).constructor):t.apply(e,n))}function zoe(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 Uoe(e)}function Uoe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(f4=function(){return!!e})()}function ym(e){return ym=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ym(e)}function qoe(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&&iS(e,t)}function iS(e,t){return iS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},iS(e,t)}function Kv(e,t,n){return t=p4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p4(e){var t=Woe(e,"string");return Pc(t)=="symbol"?t:t+""}function Woe(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(t==="string"?String:Number)(e)}var Gv=(function(e){function t(){return Loe(this,t),Boe(this,t,arguments)}return qoe(t,e),Foe(t,[{key:"getTickValueCoord",value:function(r){var a=r.coordinate,i=this.props,o=i.angle,c=i.cx,d=i.cy;return xn(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=Ooe(c,function(h){return h.coordinate||0}),f=Ioe(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=fI(r,Moe),h=c.reduce(function(j,b){return[Math.min(j[0],b.coordinate),Math.max(j[1],b.coordinate)]},[1/0,-1/0]),p=xn(a,i,h[0],o),x=xn(a,i,h[1],o),g=yo(yo(yo({},yt(f,!1)),{},{fill:"none"},yt(d,!1)),{},{x1:p.x,y1:p.y,x2:x.x,y2:x.y});return H.createElement("line",yd({className:"recharts-polar-radius-axis-line"},g))}},{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=fI(a,$oe),p=this.getTickTextAnchor(),x=yt(h,!1),g=yt(o,!1),j=i.map(function(b,y){var S=r.getTickValueCoord(b),C=yo(yo(yo(yo({textAnchor:p,transform:"rotate(".concat(90-c,", ").concat(S.x,", ").concat(S.y,")")},x),{},{stroke:"none",fill:f},g),{},{index:y},S),{},{payload:b});return H.createElement(Jt,yd({className:Rt("recharts-polar-radius-axis-tick",t4(o)),key:"tick-".concat(b.coordinate)},Fo(r.props,b,y)),t.renderTickItem(o,C,d?d(b.value,y):b.value))});return H.createElement(Jt,{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:H.createElement(Jt,{className:Rt("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),o&&this.renderTicks(),lr.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,a,i){var o;return H.isValidElement(r)?o=H.cloneElement(r,a):Pt(r)?o=r(a):o=H.createElement(Bo,yd({},a,{className:"recharts-polar-radius-axis-tick-value"}),i),o}}])})(v.PureComponent);Kv(Gv,"displayName","PolarRadiusAxis");Kv(Gv,"axisType","radiusAxis");Kv(Gv,"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 kc(e){"@babel/helpers - typeof";return kc=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},kc(e)}function Ao(){return Ao=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},Ao.apply(this,arguments)}function hI(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 bo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hI(Object(n),!0).forEach(function(r){Yv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Voe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mI(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,m4(r.key),r)}}function Hoe(e,t,n){return t&&mI(e.prototype,t),n&&mI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Koe(e,t,n){return t=bm(t),Goe(e,h4()?Reflect.construct(t,n||[],bm(e).constructor):t.apply(e,n))}function Goe(e,t){if(t&&(kc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Yoe(e)}function Yoe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(h4=function(){return!!e})()}function bm(e){return bm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},bm(e)}function Xoe(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&&oS(e,t)}function oS(e,t){return oS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},oS(e,t)}function Yv(e,t,n){return t=m4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m4(e){var t=Qoe(e,"string");return kc(t)=="symbol"?t:t+""}function Qoe(e,t){if(kc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(kc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Joe=Math.PI/180,vI=1e-5,Xv=(function(e){function t(){return Voe(this,t),Koe(this,t,arguments)}return Xoe(t,e),Hoe(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=xn(i,o,c,r.coordinate),x=xn(i,o,c+(d==="inner"?-1:1)*h,r.coordinate);return{x1:p.x,y1:p.y,x2:x.x,y2:x.y}}},{key:"getTickTextAnchor",value:function(r){var a=this.props.orientation,i=Math.cos(-r.coordinate*Joe),o;return i>vI?o=a==="outer"?"start":"end":i<-vI?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=bo(bo({},yt(this.props,!1)),{},{fill:"none"},yt(c,!1));if(d==="circle")return H.createElement(Hv,Ao({className:"recharts-polar-angle-axis-line"},f,{cx:a,cy:i,r:o}));var h=this.props.ticks,p=h.map(function(x){return xn(a,i,o,x.coordinate)});return H.createElement(yoe,Ao({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=yt(this.props,!1),p=yt(o,!1),x=bo(bo({},h),{},{fill:"none"},yt(c,!1)),g=i.map(function(j,b){var y=r.getTickLineCoord(j),S=r.getTickTextAnchor(j),C=bo(bo(bo({textAnchor:S},h),{},{stroke:"none",fill:f},p),{},{index:b,payload:j,x:y.x2,y:y.y2});return H.createElement(Jt,Ao({className:Rt("recharts-polar-angle-axis-tick",t4(o)),key:"tick-".concat(j.coordinate)},Fo(r.props,j,b)),c&&H.createElement("line",Ao({className:"recharts-polar-angle-axis-tick-line"},x,y)),o&&t.renderTickItem(o,C,d?d(j.value,b):j.value))});return H.createElement(Jt,{className:"recharts-polar-angle-axis-ticks"},g)}},{key:"render",value:function(){var r=this.props,a=r.ticks,i=r.radius,o=r.axisLine;return i<=0||!a||!a.length?null:H.createElement(Jt,{className:Rt("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,a,i){var o;return H.isValidElement(r)?o=H.cloneElement(r,a):Pt(r)?o=r(a):o=H.createElement(Bo,Ao({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])})(v.PureComponent);Yv(Xv,"displayName","PolarAngleAxis");Yv(Xv,"axisType","angleAxis");Yv(Xv,"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 lj,gI;function Zoe(){if(gI)return lj;gI=1;var e=_5(),t=e(Object.getPrototypeOf,Object);return lj=t,lj}var cj,xI;function ele(){if(xI)return cj;xI=1;var e=ii(),t=Zoe(),n=oi(),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 x=c.call(p,"constructor")&&p.constructor;return typeof x=="function"&&x instanceof x&&o.call(x)==d}return cj=f,cj}var tle=ele();const nle=an(tle);var uj,yI;function rle(){if(yI)return uj;yI=1;var e=ii(),t=oi(),n="[object Boolean]";function r(a){return a===!0||a===!1||t(a)&&e(a)==n}return uj=r,uj}var ale=rle();const sle=an(ale);function tf(e){"@babel/helpers - typeof";return tf=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},tf(e)}function wm(){return wm=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},wm.apply(this,arguments)}function ile(e,t){return ule(e)||cle(e,t)||lle(e,t)||ole()}function ole(){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 lle(e,t){if(e){if(typeof e=="string")return bI(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 bI(e,t)}}function bI(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 cle(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 ule(e){if(Array.isArray(e))return 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 jI(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){dle(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 dle(e,t,n){return t=fle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fle(e){var t=ple(e,"string");return tf(t)=="symbol"?t:t+""}function ple(e,t){if(tf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(tf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var SI=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},hle={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},mle=function(t){var n=jI(jI({},hle),t),r=v.useRef(),a=v.useState(-1),i=ile(a,2),o=i[0],c=i[1];v.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var N=r.current.getTotalLength();N&&c(N)}catch{}},[]);var d=n.x,f=n.y,h=n.upperWidth,p=n.lowerWidth,x=n.height,g=n.className,j=n.animationEasing,b=n.animationDuration,y=n.animationBegin,S=n.isUpdateAnimationActive;if(d!==+d||f!==+f||h!==+h||p!==+p||x!==+x||h===0&&p===0||x===0)return null;var C=Rt("recharts-trapezoid",g);return S?H.createElement(Ns,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:x,x:d,y:f},to:{upperWidth:h,lowerWidth:p,height:x,x:d,y:f},duration:b,animationEasing:j,isActive:S},function(N){var E=N.upperWidth,_=N.lowerWidth,P=N.height,O=N.x,R=N.y;return H.createElement(Ns,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:b,easing:j},H.createElement("path",wm({},yt(n,!0),{className:C,d:SI(O,R,E,_,P),ref:r})))}):H.createElement("g",null,H.createElement("path",wm({},yt(n,!0),{className:C,d:SI(d,f,h,p,x)})))},vle=["option","shapeType","propTransformer","activeClassName","isActive"];function nf(e){"@babel/helpers - typeof";return nf=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},nf(e)}function gle(e,t){if(e==null)return{};var n=xle(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 xle(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 NI(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 jm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NI(Object(n),!0).forEach(function(r){yle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yle(e,t,n){return t=ble(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ble(e){var t=wle(e,"string");return nf(t)=="symbol"?t:t+""}function wle(e,t){if(nf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jle(e,t){return jm(jm({},t),e)}function Sle(e,t){return e==="symbols"}function CI(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return H.createElement(gC,n);case"trapezoid":return H.createElement(mle,n);case"sector":return H.createElement(a4,n);case"symbols":if(Sle(t))return H.createElement($N,n);break;default:return null}}function Nle(e){return v.isValidElement(e)?e.props:e}function v4(e){var t=e.option,n=e.shapeType,r=e.propTransformer,a=r===void 0?jle:r,i=e.activeClassName,o=i===void 0?"recharts-active-shape":i,c=e.isActive,d=gle(e,vle),f;if(v.isValidElement(t))f=v.cloneElement(t,jm(jm({},d),Nle(t)));else if(Pt(t))f=t(d);else if(nle(t)&&!sle(t)){var h=a(t,d);f=H.createElement(CI,{shapeType:n,elementProps:h})}else{var p=d;f=H.createElement(CI,{shapeType:n,elementProps:p})}return c?H.createElement(Jt,{className:o},f):f}function Qv(e,t){return t!=null&&"trapezoids"in e.props}function Jv(e,t){return t!=null&&"sectors"in e.props}function rf(e,t){return t!=null&&"points"in e.props}function Cle(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 _le(e,t){var n=e.x===t.x,r=e.y===t.y,a=e.z===t.z;return n&&r&&a}function Ele(e,t){var n;return Qv(e,t)?n=Cle:Jv(e,t)?n=Ale:rf(e,t)&&(n=_le),n}function Ple(e,t){var n;return Qv(e,t)?n="trapezoids":Jv(e,t)?n="sectors":rf(e,t)&&(n="points"),n}function kle(e,t){if(Qv(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(Jv(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 rf(e,t)?t.payload:{}}function Ole(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,a=Ple(n,t),i=kle(n,t),o=r.filter(function(d,f){var h=Tf(i,d),p=n.props[a].filter(function(j){var b=Ele(n,t);return b(j,t)}),x=n.props[a].indexOf(p[p.length-1]),g=f===x;return h&&g}),c=r.indexOf(o[o.length-1]);return c}var Ah;function Oc(e){"@babel/helpers - typeof";return Oc=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},Oc(e)}function ec(){return ec=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},ec.apply(this,arguments)}function AI(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 vn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AI(Object(n),!0).forEach(function(r){ja(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _I(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,x4(r.key),r)}}function Tle(e,t,n){return t&&_I(e.prototype,t),n&&_I(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ile(e,t,n){return t=Sm(t),Mle(e,g4()?Reflect.construct(t,n||[],Sm(e).constructor):t.apply(e,n))}function Mle(e,t){if(t&&(Oc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $le(e)}function $le(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 Sm(e){return Sm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Sm(e)}function Dle(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&&lS(e,t)}function lS(e,t){return lS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},lS(e,t)}function ja(e,t,n){return t=x4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x4(e){var t=Lle(e,"string");return Oc(t)=="symbol"?t:t+""}function Lle(e,t){if(Oc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Oc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ci=(function(e){function t(n){var r;return Rle(this,t),r=Ile(this,t,[n]),ja(r,"pieRef",null),ja(r,"sectorRefs",[]),ja(r,"id",su("recharts-pie-")),ja(r,"handleAnimationEnd",function(){var a=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),Pt(a)&&a()}),ja(r,"handleAnimationStart",function(){var a=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),Pt(a)&&a()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return Dle(t,e),Tle(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=yt(this.props,!1),p=yt(o,!1),x=yt(c,!1),g=o&&o.offsetRadius||20,j=r.map(function(b,y){var S=(b.startAngle+b.endAngle)/2,C=xn(b.cx,b.cy,b.outerRadius+g,S),N=vn(vn(vn(vn({},h),b),{},{stroke:"none"},p),{},{index:y,textAnchor:t.getTextAnchor(C.x,b.cx)},C),E=vn(vn(vn(vn({},h),b),{},{fill:"none",stroke:b.fill},x),{},{index:y,points:[xn(b.cx,b.cy,b.outerRadius,S),C]}),_=d;return kt(d)&&kt(f)?_="value":kt(d)&&(_=f),H.createElement(Jt,{key:"label-".concat(b.startAngle,"-").concat(b.endAngle,"-").concat(b.midAngle,"-").concat(y)},c&&t.renderLabelLineItem(c,E,"line"),t.renderLabelItem(o,N,Jn(b,_)))});return H.createElement(Jt,{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),x=d&&a.hasActiveIndex()?d:null,g=p?o:x,j=vn(vn({},f),{},{stroke:c?f.fill:f.stroke,tabIndex:-1});return H.createElement(Jt,ec({ref:function(y){y&&!a.sectorRefs.includes(y)&&a.sectorRefs.push(y)},tabIndex:-1,className:"recharts-pie-sector"},Fo(a.props,f,h),{key:"sector-".concat(f?.startAngle,"-").concat(f?.endAngle,"-").concat(f.midAngle,"-").concat(h)}),H.createElement(v4,ec({option:g,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,x=p.prevSectors,g=p.prevIsAnimationActive;return H.createElement(Ns,{begin:c,duration:d,isActive:o,easing:f,from:{t:0},to:{t:1},key:"pie-".concat(h,"-").concat(g),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(j){var b=j.t,y=[],S=i&&i[0],C=S.startAngle;return i.forEach(function(N,E){var _=x&&x[E],P=E>0?ia(N,"paddingAngle",0):0;if(_){var O=na(_.endAngle-_.startAngle,N.endAngle-N.startAngle),R=vn(vn({},N),{},{startAngle:C+P,endAngle:C+O(b)+P});y.push(R),C=R.endAngle}else{var L=N.endAngle,T=N.startAngle,D=na(0,L-T),M=D(b),G=vn(vn({},N),{},{startAngle:C+P,endAngle:C+M+P});y.push(G),C=G.endAngle}}),H.createElement(Jt,null,r.renderSectorsStatically(y))})}},{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||!Tf(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,x=a.outerRadius,g=a.isAnimationActive,j=this.state.isAnimationFinished;if(i||!o||!o.length||!Ve(f)||!Ve(h)||!Ve(p)||!Ve(x))return null;var b=Rt("recharts-pie",c);return H.createElement(Jt,{tabIndex:this.props.rootTabIndex,className:b,ref:function(S){r.pieRef=S}},this.renderSectors(),d&&this.renderLabels(o),lr.renderCallByParent(this.props,null,!1),(!g||j)&&Zs.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(H.isValidElement(r))return H.cloneElement(r,a);if(Pt(r))return r(a);var o=Rt("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return H.createElement(pm,ec({},a,{key:i,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(r,a,i){if(H.isValidElement(r))return H.cloneElement(r,a);var o=i;if(Pt(r)&&(o=r(a),H.isValidElement(o)))return o;var c=Rt("recharts-pie-label-text",typeof r!="boolean"&&!Pt(r)?r.className:"");return H.createElement(Bo,ec({},a,{alignmentBaseline:"middle",className:c}),o)}}])})(v.PureComponent);Ah=ci;ja(ci,"displayName","Pie");ja(ci,"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:!rl.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});ja(ci,"parseDeltaAngle",function(e,t){var n=Ar(t-e),r=Math.min(Math.abs(t-e),360);return n*r});ja(ci,"getRealPieData",function(e){var t=e.data,n=e.children,r=yt(e,!1),a=oa(n,Iv);return t&&t.length?t.map(function(i,o){return vn(vn(vn({payload:i},r),i),a&&a[o]&&a[o].props)}):a&&a.length?a.map(function(i){return vn(vn({},r),i.props)}):[]});ja(ci,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,a=t.width,i=t.height,o=e4(a,i),c=r+_r(e.cx,a,a/2),d=n+_r(e.cy,i,i/2),f=_r(e.innerRadius,o,0),h=_r(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}});ja(ci,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?vn(vn({},t.type.defaultProps),t.props):t.props,a=Ah.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,x=r.tooltipType,g=Math.abs(r.minAngle),j=Ah.parseCoordinateOfPie(r,n),b=Ah.parseDeltaAngle(o,c),y=Math.abs(b),S=f;kt(f)&&kt(p)?(Qs(!1,`Use "dataKey" to specify the value of pie,
114
- the props "valueKey" will be deprecated in 1.1.0`),S="value"):kt(f)&&(Qs(!1,`Use "dataKey" to specify the value of pie,
115
- the props "valueKey" will be deprecated in 1.1.0`),S=p);var C=a.filter(function(R){return Jn(R,S,0)!==0}).length,N=(y>=360?C:C-1)*d,E=y-C*g-N,_=a.reduce(function(R,L){var T=Jn(L,S,0);return R+(Ve(T)?T:0)},0),P;if(_>0){var O;P=a.map(function(R,L){var T=Jn(R,S,0),D=Jn(R,h,L),M=(Ve(T)?T:0)/_,G;L?G=O.endAngle+Ar(b)*d*(T!==0?1:0):G=o;var B=G+Ar(b)*((T!==0?g:0)+M*E),W=(G+B)/2,q=(j.innerRadius+j.outerRadius)/2,V=[{name:D,value:T,payload:R,dataKey:S,type:x}],F=xn(j.cx,j.cy,q,W);return O=vn(vn(vn({percent:M,cornerRadius:i,name:D,tooltipPayload:V,midAngle:W,middleRadius:q,tooltipPosition:F},R),j),{},{value:Jn(R,S),startAngle:G,endAngle:B,payload:R,paddingAngle:Ar(b)*d}),O})}return vn(vn({},j),{},{sectors:P,data:a})});var dj,EI;function Fle(){if(EI)return dj;EI=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 dj=n,dj}var fj,PI;function y4(){if(PI)return fj;PI=1;var e=q5(),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 fj=r,fj}var pj,kI;function Ble(){if(kI)return pj;kI=1;var e=Fle(),t=Tv(),n=y4();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 pj=r,pj}var hj,OI;function zle(){if(OI)return hj;OI=1;var e=Ble(),t=e();return hj=t,hj}var Ule=zle();const Nm=an(Ule);function af(e){"@babel/helpers - typeof";return af=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},af(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){b4(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 b4(e,t,n){return t=qle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qle(e){var t=Wle(e,"string");return af(t)=="symbol"?t:t+""}function Wle(e,t){if(af(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(af(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Vle=["Webkit","Moz","O","ms"],Hle=function(t,n){var r=t.replace(/(\w)/,function(i){return i.toUpperCase()}),a=Vle.reduce(function(i,o){return TI(TI({},i),{},b4({},o+r,n))},{});return a[t]=n,a};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 Cm(){return Cm=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},Cm.apply(this,arguments)}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 mj(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){Zr(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 Kle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MI(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 Gle(e,t,n){return t&&MI(e.prototype,t),n&&MI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Yle(e,t,n){return t=Am(t),Xle(e,w4()?Reflect.construct(t,n||[],Am(e).constructor):t.apply(e,n))}function Xle(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 Qle(e)}function Qle(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 Am(e){return Am=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Am(e)}function Jle(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&&cS(e,t)}function cS(e,t){return cS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},cS(e,t)}function Zr(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=Zle(e,"string");return Rc(t)=="symbol"?t:t+""}function Zle(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 ece=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=md().domain(Nm(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}},$I=function(t){return t.changedTouches&&!!t.changedTouches.length},Tc=(function(e){function t(n){var r;return Kle(this,t),r=Yle(this,t,[n]),Zr(r,"handleDrag",function(a){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(a):r.state.isSlideMoving&&r.handleSlideDrag(a)}),Zr(r,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&r.handleDrag(a.changedTouches[0])}),Zr(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()}),Zr(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Zr(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Zr(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Zr(r,"handleSlideDragStart",function(a){var i=$I(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 Jle(t,e),Gle(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),x=Math.max(a,i),g=t.getIndexInRange(o,p),j=t.getIndexInRange(o,x);return{startIndex:g-g%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=Jn(i[r],c,r);return Pt(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,x=d.startIndex,g=d.endIndex,j=d.onChange,b=r.pageX-i;b>0?b=Math.min(b,f+h-p-c,f+h-p-o):b<0&&(b=Math.max(b,f-o,f-c));var y=this.getIndex({startX:o+b,endX:c+b});(y.startIndex!==x||y.endIndex!==g)&&j&&j(y),this.setState({startX:o+b,endX:c+b,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,a){var i=$I(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,x=h.width,g=h.travellerWidth,j=h.onChange,b=h.gap,y=h.data,S={startX:this.state.startX,endX:this.state.endX},C=r.pageX-i;C>0?C=Math.min(C,p+x-g-f):C<0&&(C=Math.max(C,p-f)),S[o]=f+C;var N=this.getIndex(S),E=N.startIndex,_=N.endIndex,P=function(){var R=y.length-1;return o==="startX"&&(c>d?E%b===0:_%b===0)||c<d&&_===R||o==="endX"&&(c>d?_%b===0:E%b===0)||c>d&&_===R};this.setState(Zr(Zr({},o,f+C),"brushMoveStartX",r.pageX),function(){j&&P()&&j(N)})}},{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 x=p+r;if(!(x===-1||x>=c.length)){var g=c[x];a==="startX"&&g>=f||a==="endX"&&g<=d||this.setState(Zr({},a,g),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 H.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?H.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,x=d.traveller,g=d.ariaLabel,j=d.data,b=d.startIndex,y=d.endIndex,S=Math.max(r,this.props.x),C=mj(mj({},yt(this.props,!1)),{},{x:S,y:f,width:h,height:p}),N=g||"Min value: ".concat((i=j[b])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=j[y])===null||o===void 0?void 0:o.name);return H.createElement(Jt,{tabIndex:0,role:"slider","aria-label":N,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(_){["ArrowLeft","ArrowRight"].includes(_.key)&&(_.preventDefault(),_.stopPropagation(),c.handleTravellerMoveKeyboard(_.key==="ArrowRight"?1:-1,a))},onFocus:function(){c.setState({isTravellerFocused:!0})},onBlur:function(){c.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(x,C))}},{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 H.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,x=h.endX,g=5,j={pointerEvents:"none",fill:f};return H.createElement(Jt,{className:"recharts-brush-texts"},H.createElement(Bo,Cm({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,x)-g,y:o+c/2},j),this.getTextOfTick(a)),H.createElement(Bo,Cm({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,x)+d+g,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,x=this.state,g=x.startX,j=x.endX,b=x.isTextActive,y=x.isSlideMoving,S=x.isTravellerMoving,C=x.isTravellerFocused;if(!a||!a.length||!Ve(c)||!Ve(d)||!Ve(f)||!Ve(h)||f<=0||h<=0)return null;var N=Rt("recharts-brush",i),E=H.Children.count(o)===1,_=Hle("userSelect","none");return H.createElement(Jt,{className:N,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:_},this.renderBackground(),E&&this.renderPanorama(),this.renderSlide(g,j),this.renderTravellerLayer(g,"startX"),this.renderTravellerLayer(j,"endX"),(b||y||S||C||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 H.createElement(H.Fragment,null,H.createElement("rect",{x:a,y:i,width:o,height:c,fill:d,stroke:"none"}),H.createElement("line",{x1:a+1,y1:f,x2:a+o-1,y2:f,fill:"none",stroke:"#fff"}),H.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 H.isValidElement(r)?i=H.cloneElement(r,a):Pt(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 mj({prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:o},i&&i.length?ece({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 x=a.scale.domain().map(function(g){return a.scale(g)});return{prevData:i,prevTravellerWidth:d,prevUpdateId:f,prevX:c,prevWidth:o,startX:a.scale(r.startIndex),endX:a.scale(r.endIndex),scaleValues:x}}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);Zr(Tc,"displayName","Brush");Zr(Tc,"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 vj,DI;function tce(){if(DI)return vj;DI=1;var e=qN();function t(n,r){var a;return e(n,function(i,o,c){return a=r(i,o,c),!a}),!!a}return vj=t,vj}var gj,LI;function nce(){if(LI)return gj;LI=1;var e=b5(),t=Ps(),n=tce(),r=Vr(),a=Tv();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 gj=i,gj}var rce=nce();const ace=an(rce);var gs=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},xj,FI;function sce(){if(FI)return xj;FI=1;var e=L5();function t(n,r,a){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}return xj=t,xj}var yj,BI;function ice(){if(BI)return yj;BI=1;var e=sce(),t=$5(),n=Ps();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 yj=r,yj}var oce=ice();const lce=an(oce);var bj,zI;function cce(){if(zI)return bj;zI=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 bj=e,bj}var wj,UI;function uce(){if(UI)return wj;UI=1;var e=qN();function t(n,r){var a=!0;return e(n,function(i,o,c){return a=!!r(i,o,c),a}),a}return wj=t,wj}var jj,qI;function dce(){if(qI)return jj;qI=1;var e=cce(),t=uce(),n=Ps(),r=Vr(),a=Tv();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 jj=i,jj}var fce=dce();const pce=an(fce);var hce=["x","y"];function sf(e){"@babel/helpers - typeof";return sf=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},sf(e)}function uS(){return uS=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},uS.apply(this,arguments)}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 ad(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){mce(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 mce(e,t,n){return t=vce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vce(e){var t=gce(e,"string");return sf(t)=="symbol"?t:t+""}function gce(e,t){if(sf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(sf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xce(e,t){if(e==null)return{};var n=yce(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 yce(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 bce(e,t){var n=e.x,r=e.y,a=xce(e,hce),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),x=parseInt(p,10);return ad(ad(ad(ad(ad({},t),a),o?{x:o}:{}),d?{y:d}:{}),{},{height:h,width:x,name:t.name,radius:t.radius})}function VI(e){return H.createElement(v4,uS({shapeType:"rectangle",propTransformer:bce,activeClassName:"recharts-active-bar"},e))}var wce=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=Ve(r)||BY(r);return i?t(r,a):(i||Uo(),n)}},jce=["value","background"],S4;function Ic(e){"@babel/helpers - typeof";return Ic=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},Ic(e)}function Sce(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 _m(){return _m=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},_m.apply(this,arguments)}function HI(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 Vn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HI(Object(n),!0).forEach(function(r){Bi(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KI(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 Ace(e,t,n){return t&&KI(e.prototype,t),n&&KI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _ce(e,t,n){return t=Em(t),Ece(e,N4()?Reflect.construct(t,n||[],Em(e).constructor):t.apply(e,n))}function Ece(e,t){if(t&&(Ic(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pce(e)}function Pce(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 Em(e){return Em=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Em(e)}function kce(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&&dS(e,t)}function dS(e,t){return dS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},dS(e,t)}function Bi(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=Oce(e,"string");return Ic(t)=="symbol"?t:t+""}function Oce(e,t){if(Ic(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ic(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ol=(function(e){function t(){var n;Cce(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=_ce(this,t,[].concat(a)),Bi(n,"state",{isAnimationFinished:!1}),Bi(n,"id",su("recharts-bar-")),Bi(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),Bi(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return kce(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=yt(this.props,!1);return r&&r.map(function(p,x){var g=x===d,j=g?f:o,b=Vn(Vn(Vn({},h),p),{},{isActive:g,option:j,index:x,dataKey:c,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return H.createElement(Jt,_m({className:"recharts-bar-rectangle"},Fo(a.props,p,x),{key:"rectangle-".concat(p?.x,"-").concat(p?.y,"-").concat(p?.value,"-").concat(x)}),H.createElement(VI,b))})}},{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,x=this.state.prevData;return H.createElement(Ns,{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(g){var j=g.t,b=i.map(function(y,S){var C=x&&x[S];if(C){var N=na(C.x,y.x),E=na(C.y,y.y),_=na(C.width,y.width),P=na(C.height,y.height);return Vn(Vn({},y),{},{x:N(j),y:E(j),width:_(j),height:P(j)})}if(o==="horizontal"){var O=na(0,y.height),R=O(j);return Vn(Vn({},y),{},{y:y.y+y.height-R,height:R})}var L=na(0,y.width),T=L(j);return Vn(Vn({},y),{},{width:T})});return H.createElement(Jt,null,r.renderRectanglesStatically(b))})}},{key:"renderRectangles",value:function(){var r=this.props,a=r.data,i=r.isAnimationActive,o=this.state.prevData;return i&&a&&a.length&&(!o||!Tf(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=yt(this.props.background,!1);return i.map(function(f,h){f.value;var p=f.background,x=Sce(f,jce);if(!p)return null;var g=Vn(Vn(Vn(Vn(Vn({},x),{},{fill:"#eee"},p),d),Fo(r.props,f,h)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:h,className:"recharts-bar-background-rectangle"});return H.createElement(VI,_m({key:"background-bar-".concat(h),option:r.props.background,isActive:h===c},g))})}},{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=oa(h,If);if(!p)return null;var x=f==="vertical"?o[0].height/2:o[0].width/2,g=function(y,S){var C=Array.isArray(y.value)?y.value[1]:y.value;return{x:y.x,y:y.y,value:C,errorVal:Jn(y,S)}},j={clipPath:r?"url(#clipPath-".concat(a,")"):null};return H.createElement(Jt,j,p.map(function(b){return H.cloneElement(b,{key:"error-bar-".concat(a,"-").concat(b.props.dataKey),data:o,xAxis:c,yAxis:d,layout:f,offset:x,dataPointFormatter:g})}))}},{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,x=r.height,g=r.isAnimationActive,j=r.background,b=r.id;if(a||!i||!i.length)return null;var y=this.state.isAnimationFinished,S=Rt("recharts-bar",o),C=c&&c.allowDataOverflow,N=d&&d.allowDataOverflow,E=C||N,_=kt(b)?this.id:b;return H.createElement(Jt,{className:S},C||N?H.createElement("defs",null,H.createElement("clipPath",{id:"clipPath-".concat(_)},H.createElement("rect",{x:C?f:f-p/2,y:N?h:h-x/2,width:C?p:p*2,height:N?x:x*2}))):null,H.createElement(Jt,{className:"recharts-bar-rectangles",clipPath:E?"url(#clipPath-".concat(_,")"):null},j?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(E,_),(!g||y)&&Zs.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);S4=ol;Bi(ol,"displayName","Bar");Bi(ol,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!rl.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Bi(ol,"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,x=e.offset,g=tae(r,n);if(!g)return null;var j=t.layout,b=n.type.defaultProps,y=b!==void 0?Vn(Vn({},b),n.props):n.props,S=y.dataKey,C=y.children,N=y.minPointSize,E=j==="horizontal"?o:i,_=f?E.scale.domain():null,P=lae({numericAxis:E}),O=oa(C,Iv),R=p.map(function(L,T){var D,M,G,B,W,q;f?D=nae(f[h+T],_):(D=Jn(L,S),Array.isArray(D)||(D=[P,D]));var V=wce(N,S4.defaultProps.minPointSize)(D[1],T);if(j==="horizontal"){var F,U=[o.scale(D[0]),o.scale(D[1])],Z=U[0],z=U[1];M=w2({axis:i,ticks:c,bandSize:a,offset:g.offset,entry:L,index:T}),G=(F=z??Z)!==null&&F!==void 0?F:void 0,B=g.size;var $=Z-z;if(W=Number.isNaN($)?0:$,q={x:M,y:o.y,width:B,height:o.height},Math.abs(V)>0&&Math.abs(W)<Math.abs(V)){var te=Ar(W||V)*(Math.abs(V)-Math.abs(W));G-=te,W+=te}}else{var se=[i.scale(D[0]),i.scale(D[1])],Q=se[0],ce=se[1];if(M=Q,G=w2({axis:o,ticks:d,bandSize:a,offset:g.offset,entry:L,index:T}),B=ce-Q,W=g.size,q={x:i.x,y:G,width:i.width,height:W},Math.abs(V)>0&&Math.abs(B)<Math.abs(V)){var le=Ar(B||V)*(Math.abs(V)-Math.abs(B));B+=le}}return Vn(Vn(Vn({},L),{},{x:M,y:G,width:B,height:W,value:f?D:D[1],payload:L,background:q},O&&O[T]&&O[T].props),{},{tooltipPayload:[JL(n,L)],tooltipPosition:{x:M+B/2,y:G+W/2}})});return Vn({data:R,layout:j},x)});function of(e){"@babel/helpers - typeof";return of=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},of(e)}function Rce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function GI(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,A4(r.key),r)}}function Tce(e,t,n){return t&&GI(e.prototype,t),n&&GI(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}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 Ua(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){Zv(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 Zv(e,t,n){return t=A4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A4(e){var t=Ice(e,"string");return of(t)=="symbol"?t:t+""}function Ice(e,t){if(of(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(of(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _4=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},x=!!ea(f,ol);return h.reduce(function(g,j){var b=n[j],y=b.orientation,S=b.domain,C=b.padding,N=C===void 0?{}:C,E=b.mirror,_=b.reversed,P="".concat(y).concat(E?"Mirror":""),O,R,L,T,D;if(b.type==="number"&&(b.padding==="gap"||b.padding==="no-gap")){var M=S[1]-S[0],G=1/0,B=b.categoricalDomain.sort(qY);if(B.forEach(function(se,Q){Q>0&&(G=Math.min((se||0)-(B[Q-1]||0),G))}),Number.isFinite(G)){var W=G/M,q=b.layout==="vertical"?r.height:r.width;if(b.padding==="gap"&&(O=W*q/2),b.padding==="no-gap"){var V=_r(t.barCategoryGap,W*q),F=W*q/2;O=F-V-(F-V)/q*V}}}a==="xAxis"?R=[r.left+(N.left||0)+(O||0),r.left+r.width-(N.right||0)-(O||0)]:a==="yAxis"?R=d==="horizontal"?[r.top+r.height-(N.bottom||0),r.top+(N.top||0)]:[r.top+(N.top||0)+(O||0),r.top+r.height-(N.bottom||0)-(O||0)]:R=b.range,_&&(R=[R[1],R[0]]);var U=GL(b,i,x),Z=U.scale,z=U.realScaleType;Z.domain(S).range(R),YL(Z);var $=XL(Z,Ua(Ua({},b),{},{realScaleType:z}));a==="xAxis"?(D=y==="top"&&!E||y==="bottom"&&E,L=r.left,T=p[P]-D*b.height):a==="yAxis"&&(D=y==="left"&&!E||y==="right"&&E,L=p[P]-D*b.width,T=r.top);var te=Ua(Ua(Ua({},b),$),{},{realScaleType:z,x:L,y:T,scale:Z,width:a==="xAxis"?r.width:b.width,height:a==="yAxis"?r.height:b.height});return te.bandSize=um(te,$),!b.hide&&a==="xAxis"?p[P]+=(D?-1:1)*te.height:b.hide||(p[P]+=(D?-1:1)*te.width),Ua(Ua({},g),{},Zv({},j,te))},{})},E4=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)}},Mce=function(t){var n=t.x1,r=t.y1,a=t.x2,i=t.y2;return E4({x:n,y:r},{x:a,y:i})},P4=(function(){function e(t){Rce(this,e),this.scale=t}return Tce(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)}}])})();Zv(P4,"EPS",1e-4);var xC=function(t){var n=Object.keys(t).reduce(function(r,a){return Ua(Ua({},r),{},Zv({},a,P4.create(t[a])))},{});return Ua(Ua({},n),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,c=i.position;return lce(a,function(d,f){return n[f].apply(d,{bandAware:o,position:c})})},isInRange:function(a){return pce(a,function(i,o){return n[o].isInRange(i)})}})};function $ce(e){return(e%180+180)%180}var Dce=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=$ce(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)},Sj,XI;function Lce(){if(XI)return Sj;XI=1;var e=Ps(),t=Ef(),n=Ov();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 Sj=r,Sj}var Nj,QI;function Fce(){if(QI)return Nj;QI=1;var e=y4();function t(n){var r=e(n),a=r%1;return r===r?a?r-a:r:0}return Nj=t,Nj}var Cj,JI;function Bce(){if(JI)return Cj;JI=1;var e=O5(),t=Ps(),n=Fce(),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 Cj=a,Cj}var Aj,ZI;function zce(){if(ZI)return Aj;ZI=1;var e=Lce(),t=Bce(),n=e(t);return Aj=n,Aj}zce();var Uce=K3();const qce=an(Uce);var Wce=qce(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("")}),k4=v.createContext(void 0),O4=v.createContext(void 0),R4=v.createContext(void 0),Vce=v.createContext({}),T4=v.createContext(void 0),I4=v.createContext(0),M4=v.createContext(0),eM=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=Wce(i);return H.createElement(k4.Provider,{value:r},H.createElement(O4.Provider,{value:a},H.createElement(Vce.Provider,{value:i},H.createElement(R4.Provider,{value:h},H.createElement(T4.Provider,{value:o},H.createElement(I4.Provider,{value:f},H.createElement(M4.Provider,{value:d},c)))))))},Hce=function(){return v.useContext(T4)},$4=function(t){var n=v.useContext(k4);n==null&&Uo();var r=n[t];return r==null&&Uo(),r},D4=function(t){var n=v.useContext(O4);n==null&&Uo();var r=n[t];return r==null&&Uo(),r},Kce=function(){var t=v.useContext(R4);return t},L4=function(){return v.useContext(M4)},F4=function(){return v.useContext(I4)};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 Gce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yce(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,z4(r.key),r)}}function Xce(e,t,n){return t&&Yce(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qce(e,t,n){return t=Pm(t),Jce(e,B4()?Reflect.construct(t,n||[],Pm(e).constructor):t.apply(e,n))}function Jce(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 Zce(e)}function Zce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function B4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(B4=function(){return!!e})()}function Pm(e){return Pm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Pm(e)}function eue(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&&fS(e,t)}function fS(e,t){return fS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},fS(e,t)}function tM(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?tM(Object(n),!0).forEach(function(r){yC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yC(e,t,n){return t=z4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z4(e){var t=tue(e,"string");return Mc(t)=="symbol"?t:t+""}function tue(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)}function nue(e,t){return iue(e)||sue(e,t)||aue(e,t)||rue()}function rue(){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 aue(e,t){if(e){if(typeof e=="string")return rM(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 rM(e,t)}}function rM(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 sue(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 iue(e){if(Array.isArray(e))return e}function pS(){return pS=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},pS.apply(this,arguments)}var oue=function(t,n){var r;return H.isValidElement(t)?r=H.cloneElement(t,n):Pt(t)?r=t(n):r=H.createElement("line",pS({},n,{className:"recharts-reference-line-line"})),r},lue=function(t,n,r,a,i,o,c,d,f){var h=i.x,p=i.y,x=i.width,g=i.height;if(r){var j=f.y,b=t.y.apply(j,{position:o});if(gs(f,"discard")&&!t.y.isInRange(b))return null;var y=[{x:h+x,y:b},{x:h,y:b}];return d==="left"?y.reverse():y}if(n){var S=f.x,C=t.x.apply(S,{position:o});if(gs(f,"discard")&&!t.x.isInRange(C))return null;var N=[{x:C,y:p+g},{x:C,y:p}];return c==="top"?N.reverse():N}if(a){var E=f.segment,_=E.map(function(P){return t.apply(P,{position:o})});return gs(f,"discard")&&ace(_,function(P){return!t.isInRange(P)})?null:_}return null};function cue(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=Hce(),h=$4(a),p=D4(i),x=Kce();if(!f||!x)return null;Qs(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var g=xC({x:h.scale,y:p.scale}),j=Zn(t),b=Zn(n),y=r&&r.length===2,S=lue(g,j,b,y,x,e.position,h.orientation,p.orientation,e);if(!S)return null;var C=nue(S,2),N=C[0],E=N.x,_=N.y,P=C[1],O=P.x,R=P.y,L=gs(e,"hidden")?"url(#".concat(f,")"):void 0,T=nM(nM({clipPath:L},yt(e,!0)),{},{x1:E,y1:_,x2:O,y2:R});return H.createElement(Jt,{className:Rt("recharts-reference-line",c)},oue(o,T),lr.renderCallByParent(e,Mce({x1:E,y1:_,x2:O,y2:R})))}var bC=(function(e){function t(){return Gce(this,t),Qce(this,t,arguments)}return eue(t,e),Xce(t,[{key:"render",value:function(){return H.createElement(cue,this.props)}}])})(H.Component);yC(bC,"displayName","ReferenceLine");yC(bC,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function hS(){return hS=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},hS.apply(this,arguments)}function $c(e){"@babel/helpers - typeof";return $c=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},$c(e)}function aM(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 sM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aM(Object(n),!0).forEach(function(r){eg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function due(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,q4(r.key),r)}}function fue(e,t,n){return t&&due(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pue(e,t,n){return t=km(t),hue(e,U4()?Reflect.construct(t,n||[],km(e).constructor):t.apply(e,n))}function hue(e,t){if(t&&($c(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mue(e)}function mue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function U4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(U4=function(){return!!e})()}function km(e){return km=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},km(e)}function vue(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&&mS(e,t)}function mS(e,t){return mS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},mS(e,t)}function eg(e,t,n){return t=q4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function q4(e){var t=gue(e,"string");return $c(t)=="symbol"?t:t+""}function gue(e,t){if($c(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if($c(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var xue=function(t){var n=t.x,r=t.y,a=t.xAxis,i=t.yAxis,o=xC({x:a.scale,y:i.scale}),c=o.apply({x:n,y:r},{bandAware:!0});return gs(t,"discard")&&!o.isInRange(c)?null:c},tg=(function(e){function t(){return uue(this,t),pue(this,t,arguments)}return vue(t,e),fue(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=Zn(a),h=Zn(i);if(Qs(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!f||!h)return null;var p=xue(this.props);if(!p)return null;var x=p.x,g=p.y,j=this.props,b=j.shape,y=j.className,S=gs(this.props,"hidden")?"url(#".concat(d,")"):void 0,C=sM(sM({clipPath:S},yt(this.props,!0)),{},{cx:x,cy:g});return H.createElement(Jt,{className:Rt("recharts-reference-dot",y)},t.renderDot(b,C),lr.renderCallByParent(this.props,{x:x-o,y:g-o,width:2*o,height:2*o}))}}])})(H.Component);eg(tg,"displayName","ReferenceDot");eg(tg,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});eg(tg,"renderDot",function(e,t){var n;return H.isValidElement(e)?n=H.cloneElement(e,t):Pt(e)?n=e(t):n=H.createElement(Hv,hS({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function vS(){return vS=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},vS.apply(this,arguments)}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 iM(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 oM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iM(Object(n),!0).forEach(function(r){ng(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bue(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,V4(r.key),r)}}function wue(e,t,n){return t&&bue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function jue(e,t,n){return t=Om(t),Sue(e,W4()?Reflect.construct(t,n||[],Om(e).constructor):t.apply(e,n))}function Sue(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 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 Om(e){return Om=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Om(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&&gS(e,t)}function gS(e,t){return gS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},gS(e,t)}function ng(e,t,n){return t=V4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V4(e){var t=Aue(e,"string");return Dc(t)=="symbol"?t:t+""}function Aue(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 String(e)}var _ue=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 x=xC({x:h.scale,y:p.scale}),g={x:t?x.x.apply(o,{position:"start"}):x.x.rangeMin,y:r?x.y.apply(d,{position:"start"}):x.y.rangeMin},j={x:n?x.x.apply(c,{position:"end"}):x.x.rangeMax,y:a?x.y.apply(f,{position:"end"}):x.y.rangeMax};return gs(i,"discard")&&(!x.isInRange(g)||!x.isInRange(j))?null:E4(g,j)},rg=(function(e){function t(){return yue(this,t),jue(this,t,arguments)}return Cue(t,e),wue(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;Qs(f===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=Zn(a),x=Zn(i),g=Zn(o),j=Zn(c),b=this.props.shape;if(!p&&!x&&!g&&!j&&!b)return null;var y=_ue(p,x,g,j,this.props);if(!y&&!b)return null;var S=gs(this.props,"hidden")?"url(#".concat(h,")"):void 0;return H.createElement(Jt,{className:Rt("recharts-reference-area",d)},t.renderRect(b,oM(oM({clipPath:S},yt(this.props,!0)),y)),lr.renderCallByParent(this.props,y))}}])})(H.Component);ng(rg,"displayName","ReferenceArea");ng(rg,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});ng(rg,"renderRect",function(e,t){var n;return H.isValidElement(e)?n=H.cloneElement(e,t):Pt(e)?n=e(t):n=H.createElement(gC,vS({},t,{className:"recharts-reference-area-rect"})),n});function H4(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 Eue(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Dce(r,n)}function Pue(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 Rm(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 kue(e,t){return H4(e,t+1)}function Oue(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:H4(r,f)};var b=d,y,S=function(){return y===void 0&&(y=n(j,b)),y},C=j.coordinate,N=d===0||Rm(e,C,S,h,c);N||(d=0,h=o,f+=1),N&&(h=C+e*(S()/2+a),d+=f)},x;f<=i.length;)if(x=p(),x)return x.v;return[]}function lf(e){"@babel/helpers - typeof";return lf=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},lf(e)}function lM(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 br(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lM(Object(n),!0).forEach(function(r){Rue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rue(e,t,n){return t=Tue(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tue(e){var t=Iue(e,"string");return lf(t)=="symbol"?t:t+""}function Iue(e,t){if(lf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(lf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Mue(e,t,n,r,a){for(var i=(r||[]).slice(),o=i.length,c=t.start,d=t.end,f=function(x){var g=i[x],j,b=function(){return j===void 0&&(j=n(g,x)),j};if(x===o-1){var y=e*(g.coordinate+e*b()/2-d);i[x]=g=br(br({},g),{},{tickCoord:y>0?g.coordinate-y*e:g.coordinate})}else i[x]=g=br(br({},g),{},{tickCoord:g.coordinate});var S=Rm(e,g.tickCoord,b,c,d);S&&(d=g.tickCoord-e*(b()/2+a),i[x]=br(br({},g),{},{isShow:!0}))},h=o-1;h>=0;h--)f(h);return i}function $ue(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),x=e*(h.coordinate+e*p/2-f);o[c-1]=h=br(br({},h),{},{tickCoord:x>0?h.coordinate-x*e:h.coordinate});var g=Rm(e,h.tickCoord,function(){return p},d,f);g&&(f=h.tickCoord-e*(p/2+a),o[c-1]=br(br({},h),{},{isShow:!0}))}for(var j=i?c-1:c,b=function(C){var N=o[C],E,_=function(){return E===void 0&&(E=n(N,C)),E};if(C===0){var P=e*(N.coordinate-e*_()/2-d);o[C]=N=br(br({},N),{},{tickCoord:P<0?N.coordinate-P*e:N.coordinate})}else o[C]=N=br(br({},N),{},{tickCoord:N.coordinate});var O=Rm(e,N.tickCoord,_,d,f);O&&(d=N.tickCoord+e*(_()/2+a),o[C]=br(br({},N),{},{isShow:!0}))},y=0;y<j;y++)b(y);return o}function Due(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(Ve(d)||rl.isSsr)return kue(a,typeof d=="number"&&Ve(d)?d:0);var x=[],g=c==="top"||c==="bottom"?"width":"height",j=h&&g==="width"?hd(h,{fontSize:t,letterSpacing:n}):{width:0,height:0},b=function(N,E){var _=Pt(f)?f(N.value,E):N.value;return g==="width"?Eue(hd(_,{fontSize:t,letterSpacing:n}),j,p):hd(_,{fontSize:t,letterSpacing:n})[g]},y=a.length>=2?Ar(a[1].coordinate-a[0].coordinate):1,S=Pue(i,y,g);return d==="equidistantPreserveStart"?Oue(y,S,b,a,o):(d==="preserveStart"||d==="preserveStartEnd"?x=$ue(y,S,b,a,o,d==="preserveStartEnd"):x=Mue(y,S,b,a,o),x.filter(function(C){return C.isShow}))}var Lue=["viewBox"],Fue=["viewBox"],Bue=["ticks"];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 tc(){return tc=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},tc.apply(this,arguments)}function cM(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 Xn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cM(Object(n),!0).forEach(function(r){wC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _j(e,t){if(e==null)return{};var n=zue(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 zue(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 Uue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uM(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,G4(r.key),r)}}function que(e,t,n){return t&&uM(e.prototype,t),n&&uM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Wue(e,t,n){return t=Tm(t),Vue(e,K4()?Reflect.construct(t,n||[],Tm(e).constructor):t.apply(e,n))}function Vue(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 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 K4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(K4=function(){return!!e})()}function Tm(e){return Tm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Tm(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&&xS(e,t)}function xS(e,t){return xS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},xS(e,t)}function wC(e,t,n){return t=G4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function G4(e){var t=Gue(e,"string");return Lc(t)=="symbol"?t:t+""}function Gue(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 ag=(function(e){function t(n){var r;return Uue(this,t),r=Wue(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return Kue(t,e),que(t,[{key:"shouldComponentUpdate",value:function(r,a){var i=r.viewBox,o=_j(r,Lue),c=this.props,d=c.viewBox,f=_j(c,Fue);return!lc(i,d)||!lc(o,f)||!lc(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,x=a.tickMargin,g,j,b,y,S,C,N=p?-1:1,E=r.tickSize||h,_=Ve(r.tickCoord)?r.tickCoord:r.coordinate;switch(f){case"top":g=j=r.coordinate,y=o+ +!p*d,b=y-N*E,C=b-N*x,S=_;break;case"left":b=y=r.coordinate,j=i+ +!p*c,g=j-N*E,S=g-N*x,C=_;break;case"right":b=y=r.coordinate,j=i+ +p*c,g=j+N*E,S=g+N*x,C=_;break;default:g=j=r.coordinate,y=o+ +p*d,b=y+N*E,C=b+N*x,S=_;break}return{line:{x1:g,y1:b,x2:j,y2:y},tick:{x:S,y:C}}}},{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=Xn(Xn(Xn({},yt(this.props,!1)),yt(h,!1)),{},{fill:"none"});if(d==="top"||d==="bottom"){var x=+(d==="top"&&!f||d==="bottom"&&f);p=Xn(Xn({},p),{},{x1:a,y1:i+x*c,x2:a+o,y2:i+x*c})}else{var g=+(d==="left"&&!f||d==="right"&&f);p=Xn(Xn({},p),{},{x1:a+g*o,y1:i,x2:a+g*o,y2:i+c})}return H.createElement("line",tc({},p,{className:Rt("recharts-cartesian-axis-line",ia(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,x=c.unit,g=Due(Xn(Xn({},this.props),{},{ticks:r}),a,i),j=this.getTickTextAnchor(),b=this.getTickVerticalAnchor(),y=yt(this.props,!1),S=yt(h,!1),C=Xn(Xn({},y),{},{fill:"none"},yt(d,!1)),N=g.map(function(E,_){var P=o.getTickLineCoord(E),O=P.line,R=P.tick,L=Xn(Xn(Xn(Xn({textAnchor:j,verticalAnchor:b},y),{},{stroke:"none",fill:f},S),R),{},{index:_,payload:E,visibleTicksCount:g.length,tickFormatter:p});return H.createElement(Jt,tc({className:"recharts-cartesian-axis-tick",key:"tick-".concat(E.value,"-").concat(E.coordinate,"-").concat(E.tickCoord)},Fo(o.props,E,_)),d&&H.createElement("line",tc({},C,O,{className:Rt("recharts-cartesian-axis-tick-line",ia(d,"className"))})),h&&t.renderTickItem(h,L,"".concat(Pt(p)?p(E.value,_):E.value).concat(x||"")))});return H.createElement("g",{className:"recharts-cartesian-axis-ticks"},N)}},{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,x=p.ticks,g=_j(p,Bue),j=x;return Pt(d)&&(j=x&&x.length>0?d(this.props):d(g)),o<=0||c<=0||!j||!j.length?null:H.createElement(Jt,{className:Rt("recharts-cartesian-axis",f),ref:function(y){r.layerReference=y}},i&&this.renderAxisLine(),this.renderTicks(j,this.state.fontSize,this.state.letterSpacing),lr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,a,i){var o,c=Rt(a.className,"recharts-cartesian-axis-tick-value");return H.isValidElement(r)?o=H.cloneElement(r,Xn(Xn({},a),{},{className:c})):Pt(r)?o=r(Xn(Xn({},a),{},{className:c})):o=H.createElement(Bo,tc({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])})(v.Component);wC(ag,"displayName","CartesianAxis");wC(ag,"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 Yue=["type","layout","connectNulls","ref"],Xue=["key"];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 dM(e,t){if(e==null)return{};var n=Que(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 Que(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 bd(){return bd=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},bd.apply(this,arguments)}function fM(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 Jr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fM(Object(n),!0).forEach(function(r){qa(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ql(e){return tde(e)||ede(e)||Zue(e)||Jue()}function Jue(){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 Zue(e,t){if(e){if(typeof e=="string")return yS(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 yS(e,t)}}function ede(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function tde(e){if(Array.isArray(e))return yS(e)}function yS(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 nde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pM(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,X4(r.key),r)}}function rde(e,t,n){return t&&pM(e.prototype,t),n&&pM(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ade(e,t,n){return t=Im(t),sde(e,Y4()?Reflect.construct(t,n||[],Im(e).constructor):t.apply(e,n))}function sde(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 ide(e)}function ide(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Y4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Y4=function(){return!!e})()}function Im(e){return Im=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Im(e)}function ode(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&&bS(e,t)}function bS(e,t){return bS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},bS(e,t)}function qa(e,t,n){return t=X4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function X4(e){var t=lde(e,"string");return Fc(t)=="symbol"?t:t+""}function lde(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 qo=(function(e){function t(){var n;nde(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=ade(this,t,[].concat(a)),qa(n,"state",{isAnimationFinished:!0,totalLength:0}),qa(n,"generateSimpleStrokeDasharray",function(o,c){return"".concat(c,"px ").concat(o-c,"px")}),qa(n,"getStrokeDasharray",function(o,c,d){var f=d.reduce(function(S,C){return S+C});if(!f)return n.generateSimpleStrokeDasharray(c,o);for(var h=Math.floor(o/f),p=o%f,x=c-o,g=[],j=0,b=0;j<d.length;b+=d[j],++j)if(b+d[j]>p){g=[].concat(ql(d.slice(0,j)),[p-b]);break}var y=g.length%2===0?[0,x]:[x];return[].concat(ql(t.repeat(d,h)),ql(g),y).map(function(S){return"".concat(S,"px")}).join(", ")}),qa(n,"id",su("recharts-line-")),qa(n,"pathRef",function(o){n.mainCurve=o}),qa(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),qa(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return ode(t,e),rde(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=oa(h,If);if(!p)return null;var x=function(b,y){return{x:b.x,y:b.y,value:b.value,errorVal:Jn(b.payload,y)}},g={clipPath:r?"url(#clipPath-".concat(a,")"):null};return H.createElement(Jt,g,p.map(function(j){return H.cloneElement(j,{key:"bar-".concat(j.props.dataKey),data:o,xAxis:c,yAxis:d,layout:f,dataPointFormatter:x})}))}},{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=yt(this.props,!1),x=yt(d,!0),g=f.map(function(b,y){var S=Jr(Jr(Jr({key:"dot-".concat(y),r:3},p),x),{},{index:y,cx:b.x,cy:b.y,value:b.value,dataKey:h,payload:b.payload,points:f});return t.renderDotItem(d,S)}),j={clipPath:r?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return H.createElement(Jt,bd({className:"recharts-line-dots",key:"dots"},j),g)}},{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=dM(c,Yue),x=Jr(Jr(Jr({},yt(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 H.createElement(pm,bd({},x,{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,x=o.animationEasing,g=o.animationId,j=o.animateNewValues,b=o.width,y=o.height,S=this.state,C=S.prevPoints,N=S.totalLength;return H.createElement(Ns,{begin:h,duration:p,isActive:f,easing:x,from:{t:0},to:{t:1},key:"line-".concat(g),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(E){var _=E.t;if(C){var P=C.length/c.length,O=c.map(function(M,G){var B=Math.floor(G*P);if(C[B]){var W=C[B],q=na(W.x,M.x),V=na(W.y,M.y);return Jr(Jr({},M),{},{x:q(_),y:V(_)})}if(j){var F=na(b*2,M.x),U=na(y/2,M.y);return Jr(Jr({},M),{},{x:F(_),y:U(_)})}return Jr(Jr({},M),{},{x:M.x,y:M.y})});return i.renderCurveStatically(O,r,a)}var R=na(0,N),L=R(_),T;if(d){var D="".concat(d).split(/[,\s]+/gim).map(function(M){return parseFloat(M)});T=i.getStrokeDasharray(L,N,D)}else T=i.generateSimpleStrokeDasharray(N,L);return i.renderCurveStatically(c,r,a,{strokeDasharray:T})})}},{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||!Tf(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,x=a.left,g=a.width,j=a.height,b=a.isAnimationActive,y=a.id;if(i||!c||!c.length)return null;var S=this.state.isAnimationFinished,C=c.length===1,N=Rt("recharts-line",d),E=f&&f.allowDataOverflow,_=h&&h.allowDataOverflow,P=E||_,O=kt(y)?this.id:y,R=(r=yt(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},L=R.r,T=L===void 0?3:L,D=R.strokeWidth,M=D===void 0?2:D,G=JY(o)?o:{},B=G.clipDot,W=B===void 0?!0:B,q=T*2+M;return H.createElement(Jt,{className:N},E||_?H.createElement("defs",null,H.createElement("clipPath",{id:"clipPath-".concat(O)},H.createElement("rect",{x:E?x:x-g/2,y:_?p:p-j/2,width:E?g:g*2,height:_?j:j*2})),!W&&H.createElement("clipPath",{id:"clipPath-dots-".concat(O)},H.createElement("rect",{x:x-q/2,y:p-q/2,width:g+q,height:j+q}))):null,!C&&this.renderCurve(P,O),this.renderErrorBar(P,O),(C||o)&&this.renderDots(P,W,O),(!b||S)&&Zs.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(ql(r),[0]):r,o=[],c=0;c<a;++c)o=[].concat(ql(o),ql(i));return o}},{key:"renderDotItem",value:function(r,a){var i;if(H.isValidElement(r))i=H.cloneElement(r,a);else if(Pt(r))i=r(a);else{var o=a.key,c=dM(a,Xue),d=Rt("recharts-line-dot",typeof r!="boolean"?r.className:"");i=H.createElement(Hv,bd({key:o},c,{className:d}))}return i}}])})(v.PureComponent);qa(qo,"displayName","Line");qa(qo,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!rl.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});qa(qo,"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(x,g){var j=Jn(x,o);return h==="horizontal"?{x:b2({axis:n,ticks:a,bandSize:c,entry:x,index:g}),y:kt(j)?null:r.scale(j),value:j,payload:x}:{x:kt(j)?null:n.scale(j),y:b2({axis:r,ticks:i,bandSize:c,entry:x,index:g}),value:j,payload:x}});return Jr({points:p,layout:h},f)});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 cde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ude(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,Z4(r.key),r)}}function dde(e,t,n){return t&&ude(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function fde(e,t,n){return t=Mm(t),pde(e,Q4()?Reflect.construct(t,n||[],Mm(e).constructor):t.apply(e,n))}function pde(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 hde(e)}function hde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Q4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Q4=function(){return!!e})()}function Mm(e){return Mm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Mm(e)}function mde(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&&wS(e,t)}function wS(e,t){return wS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},wS(e,t)}function J4(e,t,n){return t=Z4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z4(e){var t=vde(e,"string");return Bc(t)=="symbol"?t:t+""}function vde(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)}function jS(){return jS=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},jS.apply(this,arguments)}function gde(e){var t=e.xAxisId,n=L4(),r=F4(),a=$4(t);return a==null?null:v.createElement(ag,jS({},a,{className:Rt("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return ko(o,!0)}}))}var Hi=(function(e){function t(){return cde(this,t),fde(this,t,arguments)}return mde(t,e),dde(t,[{key:"render",value:function(){return v.createElement(gde,this.props)}}])})(v.Component);J4(Hi,"displayName","XAxis");J4(Hi,"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 zc(e){"@babel/helpers - typeof";return zc=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},zc(e)}function xde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yde(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,nF(r.key),r)}}function bde(e,t,n){return t&&yde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function wde(e,t,n){return t=$m(t),jde(e,eF()?Reflect.construct(t,n||[],$m(e).constructor):t.apply(e,n))}function jde(e,t){if(t&&(zc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Sde(e)}function Sde(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(eF=function(){return!!e})()}function $m(e){return $m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},$m(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&&SS(e,t)}function SS(e,t){return SS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},SS(e,t)}function tF(e,t,n){return t=nF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nF(e){var t=Cde(e,"string");return zc(t)=="symbol"?t:t+""}function Cde(e,t){if(zc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(zc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function NS(){return NS=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},NS.apply(this,arguments)}var Ade=function(t){var n=t.yAxisId,r=L4(),a=F4(),i=D4(n);return i==null?null:v.createElement(ag,NS({},i,{className:Rt("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:a},ticksGenerator:function(c){return ko(c,!0)}}))},Ki=(function(e){function t(){return xde(this,t),wde(this,t,arguments)}return Nde(t,e),bde(t,[{key:"render",value:function(){return v.createElement(Ade,this.props)}}])})(v.Component);tF(Ki,"displayName","YAxis");tF(Ki,"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 hM(e){return kde(e)||Pde(e)||Ede(e)||_de()}function _de(){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 Ede(e,t){if(e){if(typeof e=="string")return CS(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 CS(e,t)}}function Pde(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kde(e){if(Array.isArray(e))return CS(e)}function CS(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 AS=function(t,n,r,a,i){var o=oa(t,bC),c=oa(t,tg),d=[].concat(hM(o),hM(c)),f=oa(t,rg),h="".concat(a,"Id"),p=a[0],x=n;if(d.length&&(x=d.reduce(function(b,y){if(y.props[h]===r&&gs(y.props,"extendDomain")&&Ve(y.props[p])){var S=y.props[p];return[Math.min(b[0],S),Math.max(b[1],S)]}return b},x)),f.length){var g="".concat(p,"1"),j="".concat(p,"2");x=f.reduce(function(b,y){if(y.props[h]===r&&gs(y.props,"extendDomain")&&Ve(y.props[g])&&Ve(y.props[j])){var S=y.props[g],C=y.props[j];return[Math.min(b[0],S,C),Math.max(b[1],S,C)]}return b},x)}return i&&i.length&&(x=i.reduce(function(b,y){return Ve(y)?[Math.min(b[0],y),Math.max(b[1],y)]:b},x)),x},Ej={exports:{}},mM;function Ode(){return mM||(mM=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,x){if(typeof h!="function")throw new TypeError("The listener must be a function");var g=new a(h,p||d,x),j=n?n+f:f;return d._events[j]?d._events[j].fn?d._events[j]=[d._events[j],g]:d._events[j].push(g):(d._events[j]=g,d._eventsCount++),d}function 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 x=0,g=p.length,j=new Array(g);x<g;x++)j[x]=p[x].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,x,g,j){var b=n?n+f:f;if(!this._events[b])return!1;var y=this._events[b],S=arguments.length,C,N;if(y.fn){switch(y.once&&this.removeListener(f,y.fn,void 0,!0),S){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,h),!0;case 3:return y.fn.call(y.context,h,p),!0;case 4:return y.fn.call(y.context,h,p,x),!0;case 5:return y.fn.call(y.context,h,p,x,g),!0;case 6:return y.fn.call(y.context,h,p,x,g,j),!0}for(N=1,C=new Array(S-1);N<S;N++)C[N-1]=arguments[N];y.fn.apply(y.context,C)}else{var E=y.length,_;for(N=0;N<E;N++)switch(y[N].once&&this.removeListener(f,y[N].fn,void 0,!0),S){case 1:y[N].fn.call(y[N].context);break;case 2:y[N].fn.call(y[N].context,h);break;case 3:y[N].fn.call(y[N].context,h,p);break;case 4:y[N].fn.call(y[N].context,h,p,x);break;default:if(!C)for(_=1,C=new Array(S-1);_<S;_++)C[_-1]=arguments[_];y[N].fn.apply(y[N].context,C)}}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,x){var g=n?n+f:f;if(!this._events[g])return this;if(!h)return o(this,g),this;var j=this._events[g];if(j.fn)j.fn===h&&(!x||j.once)&&(!p||j.context===p)&&o(this,g);else{for(var b=0,y=[],S=j.length;b<S;b++)(j[b].fn!==h||x&&!j[b].once||p&&j[b].context!==p)&&y.push(j[b]);y.length?this._events[g]=y.length===1?y[0]:y:o(this,g)}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})(Ej)),Ej.exports}var Rde=Ode();const Tde=an(Rde);var Pj=new Tde,kj="recharts.syncMouseEvents";function cf(e){"@babel/helpers - typeof";return cf=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},cf(e)}function Ide(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mde(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,rF(r.key),r)}}function $de(e,t,n){return t&&Mde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Oj(e,t,n){return t=rF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rF(e){var t=Dde(e,"string");return cf(t)=="symbol"?t:t+""}function Dde(e,t){if(cf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(cf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Lde=(function(){function e(){Ide(this,e),Oj(this,"activeIndex",0),Oj(this,"coordinateList",[]),Oj(this,"layout","horizontal")}return $de(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,x=n.mouseHandlerCallback,g=x===void 0?null:x;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=g??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,x=o+this.offset.top+c/2+h;this.mouseHandlerCallback({pageX:p,pageY:x})}}}])})();function Fde(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e?.[0],a=e?.[1];if(r&&a&&Ve(r)&&Ve(a))return!0}return!1}function Bde(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 aF(e){var t=e.cx,n=e.cy,r=e.radius,a=e.startAngle,i=e.endAngle,o=xn(t,n,r,a),c=xn(t,n,r,i);return{points:[o,c],cx:t,cy:n,radius:r,startAngle:a,endAngle:i}}function zde(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,x=xn(c,d,f,p),g=xn(c,d,h,p);r=x.x,a=x.y,i=g.x,o=g.y}else return aF(t);return[{x:r,y:a},{x:i,y:o}]}function uf(e){"@babel/helpers - typeof";return uf=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},uf(e)}function vM(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 hh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vM(Object(n),!0).forEach(function(r){Ude(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ude(e,t,n){return t=qde(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qde(e){var t=Wde(e,"string");return uf(t)=="symbol"?t:t+""}function Wde(e,t){if(uf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(uf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vde(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,x=e.chartName,g=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!g||!i||!o||x!=="ScatterChart"&&a!=="axis")return null;var j,b=pm;if(x==="ScatterChart")j=o,b=Eoe;else if(x==="BarChart")j=Bde(p,o,d,h),b=gC;else if(p==="radial"){var y=aF(o),S=y.cx,C=y.cy,N=y.radius,E=y.startAngle,_=y.endAngle;j={cx:S,cy:C,startAngle:E,endAngle:_,innerRadius:N,outerRadius:N},b=a4}else j={points:zde(p,o,d)},b=pm;var P=hh(hh(hh(hh({stroke:"#ccc",pointerEvents:"none"},d),j),yt(g,!1)),{},{payload:c,payloadIndex:f,className:Rt("recharts-tooltip-cursor",g.className)});return v.isValidElement(g)?v.cloneElement(g,P):v.createElement(b,P)}var Hde=["item"],Kde=["children","className","width","height","style","compact","title","desc"];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 nc(){return nc=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},nc.apply(this,arguments)}function gM(e,t){return Xde(e)||Yde(e,t)||iF(e,t)||Gde()}function Gde(){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 Yde(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 Xde(e){if(Array.isArray(e))return e}function xM(e,t){if(e==null)return{};var n=Qde(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 Qde(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 Jde(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zde(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,oF(r.key),r)}}function efe(e,t,n){return t&&Zde(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function tfe(e,t,n){return t=Dm(t),nfe(e,sF()?Reflect.construct(t,n||[],Dm(e).constructor):t.apply(e,n))}function nfe(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 rfe(e)}function rfe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(sF=function(){return!!e})()}function Dm(e){return Dm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Dm(e)}function afe(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&&_S(e,t)}function _S(e,t){return _S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},_S(e,t)}function qc(e){return ofe(e)||ife(e)||iF(e)||sfe()}function sfe(){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 iF(e,t){if(e){if(typeof e=="string")return ES(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 ES(e,t)}}function ife(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ofe(e){if(Array.isArray(e))return ES(e)}function ES(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 yM(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?yM(Object(n),!0).forEach(function(r){bt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bt(e,t,n){return t=oF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oF(e){var t=lfe(e,"string");return Uc(t)=="symbol"?t:t+""}function lfe(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 cfe={xAxis:["bottom","top"],yAxis:["left","right"]},ufe={width:"100%",height:"100%"},lF={x:0,y:0};function mh(e){return e}var dfe=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},ffe=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),xn(a.cx,a.cy,c,o)),{},{angle:o,radius:c})}var d=i.coordinate,f=a.angle;return we(we(we({},a),xn(a.cx,a.cy,d,f)),{},{angle:f,radius:d})}return lF},sg=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(qc(c),qc(f)):c},[]);return o.length>0?o:t&&t.length&&Ve(a)&&Ve(i)?t.slice(a,i+1):[]};function cF(e){return e==="number"?[0,"auto"]:void 0}var PS=function(t,n,r,a){var i=t.graphicalItems,o=t.tooltipAxis,c=sg(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 x;if(o.dataKey&&!o.allowDuplicatedCategory){var g=p===void 0?c:p;x=Dh(g,o.dataKey,a)}else x=p&&p[r]||c[r];return x?[].concat(qc(d),[JL(f,x)]):d},[])},bM=function(t,n,r,a){var i=a||{x:t.chartX,y:t.chartY},o=dfe(i,r),c=t.orderedTooltipTicks,d=t.tooltipAxis,f=t.tooltipTicks,h=Yre(o,c,f,d);if(h>=0&&f){var p=f[h]&&f[h].value,x=PS(t,n,h,p),g=ffe(r,c,h,i);return{activeTooltipIndex:h,activeLabel:p,activePayload:x,activeCoordinate:g}}return null},pfe=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,x=t.stackOffset,g=KL(h,i);return r.reduce(function(j,b){var y,S=b.type.defaultProps!==void 0?we(we({},b.type.defaultProps),b.props):b.props,C=S.type,N=S.dataKey,E=S.allowDataOverflow,_=S.allowDuplicatedCategory,P=S.scale,O=S.ticks,R=S.includeHidden,L=S[o];if(j[L])return j;var T=sg(t.data,{graphicalItems:a.filter(function($){var te,se=o in $.props?$.props[o]:(te=$.type.defaultProps)===null||te===void 0?void 0:te[o];return se===L}),dataStartIndex:d,dataEndIndex:f}),D=T.length,M,G,B;Fde(S.domain,E,C)&&(M=q1(S.domain,null,E),g&&(C==="number"||P!=="auto")&&(B=vd(T,N,"category")));var W=cF(C);if(!M||M.length===0){var q,V=(q=S.domain)!==null&&q!==void 0?q:W;if(N){if(M=vd(T,N,C),C==="category"&&g){var F=UY(M);_&&F?(G=M,M=Nm(0,D)):_||(M=N2(V,M,b).reduce(function($,te){return $.indexOf(te)>=0?$:[].concat(qc($),[te])},[]))}else if(C==="category")_?M=M.filter(function($){return $!==""&&!kt($)}):M=N2(V,M,b).reduce(function($,te){return $.indexOf(te)>=0||te===""||kt(te)?$:[].concat(qc($),[te])},[]);else if(C==="number"){var U=eae(T,a.filter(function($){var te,se,Q=o in $.props?$.props[o]:(te=$.type.defaultProps)===null||te===void 0?void 0:te[o],ce="hide"in $.props?$.props.hide:(se=$.type.defaultProps)===null||se===void 0?void 0:se.hide;return Q===L&&(R||!ce)}),N,i,h);U&&(M=U)}g&&(C==="number"||P!=="auto")&&(B=vd(T,N,"category"))}else g?M=Nm(0,D):c&&c[L]&&c[L].hasStack&&C==="number"?M=x==="expand"?[0,1]:QL(c[L].stackGroups,d,f):M=HL(T,a.filter(function($){var te=o in $.props?$.props[o]:$.type.defaultProps[o],se="hide"in $.props?$.props.hide:$.type.defaultProps.hide;return te===L&&(R||!se)}),C,h,!0);if(C==="number")M=AS(p,M,L,i,O),V&&(M=q1(V,M,E));else if(C==="category"&&V){var Z=V,z=M.every(function($){return Z.indexOf($)>=0});z&&(M=Z)}}return we(we({},j),{},bt({},L,we(we({},S),{},{axisType:i,domain:M,categoricalDomain:B,duplicateDomain:G,originalDomain:(y=S.domain)!==null&&y!==void 0?y:W,isCategorical:g,layout:h})))},{})},hfe=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,x=sg(t.data,{graphicalItems:r,dataStartIndex:d,dataEndIndex:f}),g=x.length,j=KL(h,i),b=-1;return r.reduce(function(y,S){var C=S.type.defaultProps!==void 0?we(we({},S.type.defaultProps),S.props):S.props,N=C[o],E=cF("number");if(!y[N]){b++;var _;return j?_=Nm(0,g):c&&c[N]&&c[N].hasStack?(_=QL(c[N].stackGroups,d,f),_=AS(p,_,N,i)):(_=q1(E,HL(x,r.filter(function(P){var O,R,L=o in P.props?P.props[o]:(O=P.type.defaultProps)===null||O===void 0?void 0:O[o],T="hide"in P.props?P.props.hide:(R=P.type.defaultProps)===null||R===void 0?void 0:R.hide;return L===N&&!T}),"number",h),a.defaultProps.allowDataOverflow),_=AS(p,_,N,i)),we(we({},y),{},bt({},N,we(we({axisType:i},a.defaultProps),{},{hide:!0,orientation:ia(cfe,"".concat(i,".").concat(b%2),null),domain:_,originalDomain:E,isCategorical:j,layout:h})))}return y},{})},mfe=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"),x=oa(h,i),g={};return x&&x.length?g=pfe(t,{axes:x,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f}):o&&o.length&&(g=hfe(t,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:c,dataStartIndex:d,dataEndIndex:f})),g},vfe=function(t){var n=Gl(t),r=ko(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:WN(r,function(a){return a.coordinate}),tooltipAxis:n,tooltipAxisBandSize:um(n,r)}},wM=function(t){var n=t.children,r=t.defaultShowTooltip,a=ea(n,Tc),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}},gfe=function(t){return!t||!t.length?!1:t.some(function(n){var r=Xs(n&&n.type);return r&&r.indexOf("Bar")>=0})},jM=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"}},xfe=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,x=r.margin||{},g=ea(p,Tc),j=ea(p,Ro),b=Object.keys(d).reduce(function(_,P){var O=d[P],R=O.orientation;return!O.mirror&&!O.hide?we(we({},_),{},bt({},R,_[R]+O.width)):_},{left:x.left||0,right:x.right||0}),y=Object.keys(o).reduce(function(_,P){var O=o[P],R=O.orientation;return!O.mirror&&!O.hide?we(we({},_),{},bt({},R,ia(_,"".concat(R))+O.height)):_},{top:x.top||0,bottom:x.bottom||0}),S=we(we({},y),b),C=S.bottom;g&&(S.bottom+=g.props.height||Tc.defaultProps.height),j&&n&&(S=Jre(S,a,r,n));var N=f-S.left-S.right,E=h-S.top-S.bottom;return we(we({brushBottom:C},S),{},{width:Math.max(N,0),height:Math.max(E,0)})},yfe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},jC=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,x=function(S,C){var N=C.graphicalItems,E=C.stackGroups,_=C.offset,P=C.updateId,O=C.dataStartIndex,R=C.dataEndIndex,L=S.barSize,T=S.layout,D=S.barGap,M=S.barCategoryGap,G=S.maxBarSize,B=jM(T),W=B.numericAxisName,q=B.cateAxisName,V=gfe(N),F=[];return N.forEach(function(U,Z){var z=sg(S.data,{graphicalItems:[U],dataStartIndex:O,dataEndIndex:R}),$=U.type.defaultProps!==void 0?we(we({},U.type.defaultProps),U.props):U.props,te=$.dataKey,se=$.maxBarSize,Q=$["".concat(W,"Id")],ce=$["".concat(q,"Id")],le={},me=d.reduce(function(De,Ye){var Ct=C["".concat(Ye.axisType,"Map")],Ft=$["".concat(Ye.axisType,"Id")];Ct&&Ct[Ft]||Ye.axisType==="zAxis"||Uo();var mt=Ct[Ft];return we(we({},De),{},bt(bt({},Ye.axisType,mt),"".concat(Ye.axisType,"Ticks"),ko(mt)))},le),oe=me[q],fe=me["".concat(q,"Ticks")],Ce=E&&E[Q]&&E[Q].hasStack&&cae(U,E[Q].stackGroups),ae=Xs(U.type).indexOf("Bar")>=0,Re=um(oe,fe),Ae=[],Te=V&&Xre({barSize:L,stackGroups:E,totalSize:yfe(me,q)});if(ae){var be,_e,X=kt(se)?G:se,ge=(be=(_e=um(oe,fe,!0))!==null&&_e!==void 0?_e:X)!==null&&be!==void 0?be:0;Ae=Qre({barGap:D,barCategoryGap:M,bandSize:ge!==Re?ge:Re,sizeList:Te[ce],maxBarSize:X}),ge!==Re&&(Ae=Ae.map(function(De){return we(we({},De),{},{position:we(we({},De.position),{},{offset:De.position.offset-ge/2})})}))}var ue=U&&U.type&&U.type.getComposedData;ue&&F.push({props:we(we({},ue(we(we({},me),{},{displayedData:z,props:S,dataKey:te,item:U,bandSize:Re,barPosition:Ae,offset:_,stackedData:Ce,layout:T,dataStartIndex:O,dataEndIndex:R}))),{},bt(bt(bt({key:U.key||"item-".concat(Z)},W,me[W]),q,me[q]),"animationId",P)),childIndex:tX(U,S.children),item:U})}),F},g=function(S,C){var N=S.props,E=S.dataStartIndex,_=S.dataEndIndex,P=S.updateId;if(!Lk({props:N}))return null;var O=N.children,R=N.layout,L=N.stackOffset,T=N.data,D=N.reverseStackOrder,M=jM(R),G=M.numericAxisName,B=M.cateAxisName,W=oa(O,r),q=oae(T,W,"".concat(G,"Id"),"".concat(B,"Id"),L,D),V=d.reduce(function($,te){var se="".concat(te.axisType,"Map");return we(we({},$),{},bt({},se,mfe(N,we(we({},te),{},{graphicalItems:W,stackGroups:te.axisType===G&&q,dataStartIndex:E,dataEndIndex:_}))))},{}),F=xfe(we(we({},V),{},{props:N,graphicalItems:W}),C?.legendBBox);Object.keys(V).forEach(function($){V[$]=h(N,V[$],F,$.replace("Map",""),n)});var U=V["".concat(B,"Map")],Z=vfe(U),z=x(N,we(we({},V),{},{dataStartIndex:E,dataEndIndex:_,updateId:P,graphicalItems:W,stackGroups:q,offset:F}));return we(we({formattedGraphicalItems:z,graphicalItems:W,offset:F,stackGroups:q},Z),V)},j=(function(y){function S(C){var N,E,_;return Jde(this,S),_=tfe(this,S,[C]),bt(_,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),bt(_,"accessibilityManager",new Lde),bt(_,"handleLegendBBoxUpdate",function(P){if(P){var O=_.state,R=O.dataStartIndex,L=O.dataEndIndex,T=O.updateId;_.setState(we({legendBBox:P},g({props:_.props,dataStartIndex:R,dataEndIndex:L,updateId:T},we(we({},_.state),{},{legendBBox:P}))))}}),bt(_,"handleReceiveSyncEvent",function(P,O,R){if(_.props.syncId===P){if(R===_.eventEmitterSymbol&&typeof _.props.syncMethod!="function")return;_.applySyncEvent(O)}}),bt(_,"handleBrushChange",function(P){var O=P.startIndex,R=P.endIndex;if(O!==_.state.dataStartIndex||R!==_.state.dataEndIndex){var L=_.state.updateId;_.setState(function(){return we({dataStartIndex:O,dataEndIndex:R},g({props:_.props,dataStartIndex:O,dataEndIndex:R,updateId:L},_.state))}),_.triggerSyncEvent({dataStartIndex:O,dataEndIndex:R})}}),bt(_,"handleMouseEnter",function(P){var O=_.getMouseInfo(P);if(O){var R=we(we({},O),{},{isTooltipActive:!0});_.setState(R),_.triggerSyncEvent(R);var L=_.props.onMouseEnter;Pt(L)&&L(R,P)}}),bt(_,"triggeredAfterMouseMove",function(P){var O=_.getMouseInfo(P),R=O?we(we({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};_.setState(R),_.triggerSyncEvent(R);var L=_.props.onMouseMove;Pt(L)&&L(R,P)}),bt(_,"handleItemMouseEnter",function(P){_.setState(function(){return{isTooltipActive:!0,activeItem:P,activePayload:P.tooltipPayload,activeCoordinate:P.tooltipPosition||{x:P.cx,y:P.cy}}})}),bt(_,"handleItemMouseLeave",function(){_.setState(function(){return{isTooltipActive:!1}})}),bt(_,"handleMouseMove",function(P){P.persist(),_.throttleTriggeredAfterMouseMove(P)}),bt(_,"handleMouseLeave",function(P){_.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};_.setState(O),_.triggerSyncEvent(O);var R=_.props.onMouseLeave;Pt(R)&&R(O,P)}),bt(_,"handleOuterEvent",function(P){var O=eX(P),R=ia(_.props,"".concat(O));if(O&&Pt(R)){var L,T;/.*touch.*/i.test(O)?T=_.getMouseInfo(P.changedTouches[0]):T=_.getMouseInfo(P),R((L=T)!==null&&L!==void 0?L:{},P)}}),bt(_,"handleClick",function(P){var O=_.getMouseInfo(P);if(O){var R=we(we({},O),{},{isTooltipActive:!0});_.setState(R),_.triggerSyncEvent(R);var L=_.props.onClick;Pt(L)&&L(R,P)}}),bt(_,"handleMouseDown",function(P){var O=_.props.onMouseDown;if(Pt(O)){var R=_.getMouseInfo(P);O(R,P)}}),bt(_,"handleMouseUp",function(P){var O=_.props.onMouseUp;if(Pt(O)){var R=_.getMouseInfo(P);O(R,P)}}),bt(_,"handleTouchMove",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&_.throttleTriggeredAfterMouseMove(P.changedTouches[0])}),bt(_,"handleTouchStart",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&_.handleMouseDown(P.changedTouches[0])}),bt(_,"handleTouchEnd",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&_.handleMouseUp(P.changedTouches[0])}),bt(_,"handleDoubleClick",function(P){var O=_.props.onDoubleClick;if(Pt(O)){var R=_.getMouseInfo(P);O(R,P)}}),bt(_,"handleContextMenu",function(P){var O=_.props.onContextMenu;if(Pt(O)){var R=_.getMouseInfo(P);O(R,P)}}),bt(_,"triggerSyncEvent",function(P){_.props.syncId!==void 0&&Pj.emit(kj,_.props.syncId,P,_.eventEmitterSymbol)}),bt(_,"applySyncEvent",function(P){var O=_.props,R=O.layout,L=O.syncMethod,T=_.state.updateId,D=P.dataStartIndex,M=P.dataEndIndex;if(P.dataStartIndex!==void 0||P.dataEndIndex!==void 0)_.setState(we({dataStartIndex:D,dataEndIndex:M},g({props:_.props,dataStartIndex:D,dataEndIndex:M,updateId:T},_.state)));else if(P.activeTooltipIndex!==void 0){var G=P.chartX,B=P.chartY,W=P.activeTooltipIndex,q=_.state,V=q.offset,F=q.tooltipTicks;if(!V)return;if(typeof L=="function")W=L(F,P);else if(L==="value"){W=-1;for(var U=0;U<F.length;U++)if(F[U].value===P.activeLabel){W=U;break}}var Z=we(we({},V),{},{x:V.left,y:V.top}),z=Math.min(G,Z.x+Z.width),$=Math.min(B,Z.y+Z.height),te=F[W]&&F[W].value,se=PS(_.state,_.props.data,W),Q=F[W]?{x:R==="horizontal"?F[W].coordinate:z,y:R==="horizontal"?$:F[W].coordinate}:lF;_.setState(we(we({},P),{},{activeLabel:te,activeCoordinate:Q,activePayload:se,activeTooltipIndex:W}))}else _.setState(P)}),bt(_,"renderCursor",function(P){var O,R=_.state,L=R.isTooltipActive,T=R.activeCoordinate,D=R.activePayload,M=R.offset,G=R.activeTooltipIndex,B=R.tooltipAxisBandSize,W=_.getTooltipEventType(),q=(O=P.props.active)!==null&&O!==void 0?O:L,V=_.props.layout,F=P.key||"_recharts-cursor";return H.createElement(Vde,{key:F,activeCoordinate:T,activePayload:D,activeTooltipIndex:G,chartName:n,element:P,isActive:q,layout:V,offset:M,tooltipAxisBandSize:B,tooltipEventType:W})}),bt(_,"renderPolarAxis",function(P,O,R){var L=ia(P,"type.axisType"),T=ia(_.state,"".concat(L,"Map")),D=P.type.defaultProps,M=D!==void 0?we(we({},D),P.props):P.props,G=T&&T[M["".concat(L,"Id")]];return v.cloneElement(P,we(we({},G),{},{className:Rt(L,G.className),key:P.key||"".concat(O,"-").concat(R),ticks:ko(G,!0)}))}),bt(_,"renderPolarGrid",function(P){var O=P.props,R=O.radialLines,L=O.polarAngles,T=O.polarRadius,D=_.state,M=D.radiusAxisMap,G=D.angleAxisMap,B=Gl(M),W=Gl(G),q=W.cx,V=W.cy,F=W.innerRadius,U=W.outerRadius;return v.cloneElement(P,{polarAngles:Array.isArray(L)?L:ko(W,!0).map(function(Z){return Z.coordinate}),polarRadius:Array.isArray(T)?T:ko(B,!0).map(function(Z){return Z.coordinate}),cx:q,cy:V,innerRadius:F,outerRadius:U,key:P.key||"polar-grid",radialLines:R})}),bt(_,"renderLegend",function(){var P=_.state.formattedGraphicalItems,O=_.props,R=O.children,L=O.width,T=O.height,D=_.props.margin||{},M=L-(D.left||0)-(D.right||0),G=WL({children:R,formattedGraphicalItems:P,legendWidth:M,legendContent:f});if(!G)return null;var B=G.item,W=xM(G,Hde);return v.cloneElement(B,we(we({},W),{},{chartWidth:L,chartHeight:T,margin:D,onBBoxUpdate:_.handleLegendBBoxUpdate}))}),bt(_,"renderTooltip",function(){var P,O=_.props,R=O.children,L=O.accessibilityLayer,T=ea(R,Fr);if(!T)return null;var D=_.state,M=D.isTooltipActive,G=D.activeCoordinate,B=D.activePayload,W=D.activeLabel,q=D.offset,V=(P=T.props.active)!==null&&P!==void 0?P:M;return v.cloneElement(T,{viewBox:we(we({},q),{},{x:q.left,y:q.top}),active:V,label:W,payload:V?B:[],coordinate:G,accessibilityLayer:L})}),bt(_,"renderBrush",function(P){var O=_.props,R=O.margin,L=O.data,T=_.state,D=T.offset,M=T.dataStartIndex,G=T.dataEndIndex,B=T.updateId;return v.cloneElement(P,{key:P.key||"_recharts-brush",onChange:uh(_.handleBrushChange,P.props.onChange),data:L,x:Ve(P.props.x)?P.props.x:D.left,y:Ve(P.props.y)?P.props.y:D.top+D.height+D.brushBottom-(R.bottom||0),width:Ve(P.props.width)?P.props.width:D.width,startIndex:M,endIndex:G,updateId:"brush-".concat(B)})}),bt(_,"renderReferenceElement",function(P,O,R){if(!P)return null;var L=_,T=L.clipPathId,D=_.state,M=D.xAxisMap,G=D.yAxisMap,B=D.offset,W=P.type.defaultProps||{},q=P.props,V=q.xAxisId,F=V===void 0?W.xAxisId:V,U=q.yAxisId,Z=U===void 0?W.yAxisId:U;return v.cloneElement(P,{key:P.key||"".concat(O,"-").concat(R),xAxis:M[F],yAxis:G[Z],viewBox:{x:B.left,y:B.top,width:B.width,height:B.height},clipPathId:T})}),bt(_,"renderActivePoints",function(P){var O=P.item,R=P.activePoint,L=P.basePoint,T=P.childIndex,D=P.isRange,M=[],G=O.props.key,B=O.item.type.defaultProps!==void 0?we(we({},O.item.type.defaultProps),O.item.props):O.item.props,W=B.activeDot,q=B.dataKey,V=we(we({index:T,dataKey:q,cx:R.x,cy:R.y,r:4,fill:vC(O.item),strokeWidth:2,stroke:"#fff",payload:R.payload,value:R.value},yt(W,!1)),Lh(W));return M.push(S.renderActiveDot(W,V,"".concat(G,"-activePoint-").concat(T))),L?M.push(S.renderActiveDot(W,we(we({},V),{},{cx:L.x,cy:L.y}),"".concat(G,"-basePoint-").concat(T))):D&&M.push(null),M}),bt(_,"renderGraphicChild",function(P,O,R){var L=_.filterFormatItem(P,O,R);if(!L)return null;var T=_.getTooltipEventType(),D=_.state,M=D.isTooltipActive,G=D.tooltipAxis,B=D.activeTooltipIndex,W=D.activeLabel,q=_.props.children,V=ea(q,Fr),F=L.props,U=F.points,Z=F.isRange,z=F.baseLine,$=L.item.type.defaultProps!==void 0?we(we({},L.item.type.defaultProps),L.item.props):L.item.props,te=$.activeDot,se=$.hide,Q=$.activeBar,ce=$.activeShape,le=!!(!se&&M&&V&&(te||Q||ce)),me={};T!=="axis"&&V&&V.props.trigger==="click"?me={onClick:uh(_.handleItemMouseEnter,P.props.onClick)}:T!=="axis"&&(me={onMouseLeave:uh(_.handleItemMouseLeave,P.props.onMouseLeave),onMouseEnter:uh(_.handleItemMouseEnter,P.props.onMouseEnter)});var oe=v.cloneElement(P,we(we({},L.props),me));function fe(Ye){return typeof G.dataKey=="function"?G.dataKey(Ye.payload):null}if(le)if(B>=0){var Ce,ae;if(G.dataKey&&!G.allowDuplicatedCategory){var Re=typeof G.dataKey=="function"?fe:"payload.".concat(G.dataKey.toString());Ce=Dh(U,Re,W),ae=Z&&z&&Dh(z,Re,W)}else Ce=U?.[B],ae=Z&&z&&z[B];if(ce||Q){var Ae=P.props.activeIndex!==void 0?P.props.activeIndex:B;return[v.cloneElement(P,we(we(we({},L.props),me),{},{activeIndex:Ae})),null,null]}if(!kt(Ce))return[oe].concat(qc(_.renderActivePoints({item:L,activePoint:Ce,basePoint:ae,childIndex:B,isRange:Z})))}else{var Te,be=(Te=_.getItemByXY(_.state.activeCoordinate))!==null&&Te!==void 0?Te:{graphicalItem:oe},_e=be.graphicalItem,X=_e.item,ge=X===void 0?P:X,ue=_e.childIndex,De=we(we(we({},L.props),me),{},{activeIndex:ue});return[v.cloneElement(ge,De),null,null]}return Z?[oe,null,null]:[oe,null]}),bt(_,"renderCustomized",function(P,O,R){return v.cloneElement(P,we(we({key:"recharts-customized-".concat(R)},_.props),_.state))}),bt(_,"renderMap",{CartesianGrid:{handler:mh,once:!0},ReferenceArea:{handler:_.renderReferenceElement},ReferenceLine:{handler:mh},ReferenceDot:{handler:_.renderReferenceElement},XAxis:{handler:mh},YAxis:{handler:mh},Brush:{handler:_.renderBrush,once:!0},Bar:{handler:_.renderGraphicChild},Line:{handler:_.renderGraphicChild},Area:{handler:_.renderGraphicChild},Radar:{handler:_.renderGraphicChild},RadialBar:{handler:_.renderGraphicChild},Scatter:{handler:_.renderGraphicChild},Pie:{handler:_.renderGraphicChild},Funnel:{handler:_.renderGraphicChild},Tooltip:{handler:_.renderCursor,once:!0},PolarGrid:{handler:_.renderPolarGrid,once:!0},PolarAngleAxis:{handler:_.renderPolarAxis},PolarRadiusAxis:{handler:_.renderPolarAxis},Customized:{handler:_.renderCustomized}}),_.clipPathId="".concat((N=C.id)!==null&&N!==void 0?N:su("recharts"),"-clip"),_.throttleTriggeredAfterMouseMove=W5(_.triggeredAfterMouseMove,(E=C.throttleDelay)!==null&&E!==void 0?E:1e3/60),_.state={},_}return afe(S,y),efe(S,[{key:"componentDidMount",value:function(){var N,E;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(N=this.props.margin.left)!==null&&N!==void 0?N:0,top:(E=this.props.margin.top)!==null&&E!==void 0?E:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var N=this.props,E=N.children,_=N.data,P=N.height,O=N.layout,R=ea(E,Fr);if(R){var L=R.props.defaultIndex;if(!(typeof L!="number"||L<0||L>this.state.tooltipTicks.length-1)){var T=this.state.tooltipTicks[L]&&this.state.tooltipTicks[L].value,D=PS(this.state,_,L,T),M=this.state.tooltipTicks[L].coordinate,G=(this.state.offset.top+P)/2,B=O==="horizontal",W=B?{x:M,y:G}:{y:M,x:G},q=this.state.formattedGraphicalItems.find(function(F){var U=F.item;return U.type.name==="Scatter"});q&&(W=we(we({},W),q.props.points[L].tooltipPosition),D=q.props.points[L].tooltipPayload);var V={activeTooltipIndex:L,isTooltipActive:!0,activeLabel:T,activePayload:D,activeCoordinate:W};this.setState(V),this.renderCursor(R),this.accessibilityManager.setIndex(L)}}}},{key:"getSnapshotBeforeUpdate",value:function(N,E){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==E.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==N.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==N.margin){var _,P;this.accessibilityManager.setDetails({offset:{left:(_=this.props.margin.left)!==null&&_!==void 0?_:0,top:(P=this.props.margin.top)!==null&&P!==void 0?P:0}})}return null}},{key:"componentDidUpdate",value:function(N){d1([ea(N.children,Fr)],[ea(this.props.children,Fr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var N=ea(this.props.children,Fr);if(N&&typeof N.props.shared=="boolean"){var E=N.props.shared?"axis":"item";return c.indexOf(E)>=0?E:i}return i}},{key:"getMouseInfo",value:function(N){if(!this.container)return null;var E=this.container,_=E.getBoundingClientRect(),P=zZ(_),O={chartX:Math.round(N.pageX-P.left),chartY:Math.round(N.pageY-P.top)},R=_.width/E.offsetWidth||1,L=this.inRange(O.chartX,O.chartY,R);if(!L)return null;var T=this.state,D=T.xAxisMap,M=T.yAxisMap,G=this.getTooltipEventType(),B=bM(this.state,this.props.data,this.props.layout,L);if(G!=="axis"&&D&&M){var W=Gl(D).scale,q=Gl(M).scale,V=W&&W.invert?W.invert(O.chartX):null,F=q&&q.invert?q.invert(O.chartY):null;return we(we({},O),{},{xValue:V,yValue:F},B)}return B?we(we({},O),B):null}},{key:"inRange",value:function(N,E){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,P=this.props.layout,O=N/_,R=E/_;if(P==="horizontal"||P==="vertical"){var L=this.state.offset,T=O>=L.left&&O<=L.left+L.width&&R>=L.top&&R<=L.top+L.height;return T?{x:O,y:R}:null}var D=this.state,M=D.angleAxisMap,G=D.radiusAxisMap;if(M&&G){var B=Gl(M);return _2({x:O,y:R},B)}return null}},{key:"parseEventsOfWrapper",value:function(){var N=this.props.children,E=this.getTooltipEventType(),_=ea(N,Fr),P={};_&&E==="axis"&&(_.props.trigger==="click"?P={onClick:this.handleClick}:P={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 O=Lh(this.props,this.handleOuterEvent);return we(we({},O),P)}},{key:"addListener",value:function(){Pj.on(kj,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Pj.removeListener(kj,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(N,E,_){for(var P=this.state.formattedGraphicalItems,O=0,R=P.length;O<R;O++){var L=P[O];if(L.item===N||L.props.key===N.key||E===Xs(L.item.type)&&_===L.childIndex)return L}return null}},{key:"renderClipPath",value:function(){var N=this.clipPathId,E=this.state.offset,_=E.left,P=E.top,O=E.height,R=E.width;return H.createElement("defs",null,H.createElement("clipPath",{id:N},H.createElement("rect",{x:_,y:P,height:O,width:R})))}},{key:"getXScales",value:function(){var N=this.state.xAxisMap;return N?Object.entries(N).reduce(function(E,_){var P=gM(_,2),O=P[0],R=P[1];return we(we({},E),{},bt({},O,R.scale))},{}):null}},{key:"getYScales",value:function(){var N=this.state.yAxisMap;return N?Object.entries(N).reduce(function(E,_){var P=gM(_,2),O=P[0],R=P[1];return we(we({},E),{},bt({},O,R.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(N){var E;return(E=this.state.xAxisMap)===null||E===void 0||(E=E[N])===null||E===void 0?void 0:E.scale}},{key:"getYScaleByAxisId",value:function(N){var E;return(E=this.state.yAxisMap)===null||E===void 0||(E=E[N])===null||E===void 0?void 0:E.scale}},{key:"getItemByXY",value:function(N){var E=this.state,_=E.formattedGraphicalItems,P=E.activeItem;if(_&&_.length)for(var O=0,R=_.length;O<R;O++){var L=_[O],T=L.props,D=L.item,M=D.type.defaultProps!==void 0?we(we({},D.type.defaultProps),D.props):D.props,G=Xs(D.type);if(G==="Bar"){var B=(T.data||[]).find(function(F){return loe(N,F)});if(B)return{graphicalItem:L,payload:B}}else if(G==="RadialBar"){var W=(T.data||[]).find(function(F){return _2(N,F)});if(W)return{graphicalItem:L,payload:W}}else if(Qv(L,P)||Jv(L,P)||rf(L,P)){var q=Ole({graphicalItem:L,activeTooltipItem:P,itemData:M.data}),V=M.activeIndex===void 0?q:M.activeIndex;return{graphicalItem:we(we({},L),{},{childIndex:V}),payload:rf(L,P)?M.data[q]:L.props.data[q]}}}return null}},{key:"render",value:function(){var N=this;if(!Lk(this))return null;var E=this.props,_=E.children,P=E.className,O=E.width,R=E.height,L=E.style,T=E.compact,D=E.title,M=E.desc,G=xM(E,Kde),B=yt(G,!1);if(T)return H.createElement(eM,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},H.createElement(p1,nc({},B,{width:O,height:R,title:D,desc:M}),this.renderClipPath(),Bk(_,this.renderMap)));if(this.props.accessibilityLayer){var W,q;B.tabIndex=(W=this.props.tabIndex)!==null&&W!==void 0?W:0,B.role=(q=this.props.role)!==null&&q!==void 0?q:"application",B.onKeyDown=function(F){N.accessibilityManager.keyboardEvent(F)},B.onFocus=function(){N.accessibilityManager.focus()}}var V=this.parseEventsOfWrapper();return H.createElement(eM,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},H.createElement("div",nc({className:Rt("recharts-wrapper",P),style:we({position:"relative",cursor:"default",width:O,height:R},L)},V,{ref:function(U){N.container=U}}),H.createElement(p1,nc({},B,{width:O,height:R,title:D,desc:M,style:ufe}),this.renderClipPath(),Bk(_,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(v.Component);bt(j,"displayName",n),bt(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)),bt(j,"getDerivedStateFromProps",function(y,S){var C=y.dataKey,N=y.data,E=y.children,_=y.width,P=y.height,O=y.layout,R=y.stackOffset,L=y.margin,T=S.dataStartIndex,D=S.dataEndIndex;if(S.updateId===void 0){var M=wM(y);return we(we(we({},M),{},{updateId:0},g(we(we({props:y},M),{},{updateId:0}),S)),{},{prevDataKey:C,prevData:N,prevWidth:_,prevHeight:P,prevLayout:O,prevStackOffset:R,prevMargin:L,prevChildren:E})}if(C!==S.prevDataKey||N!==S.prevData||_!==S.prevWidth||P!==S.prevHeight||O!==S.prevLayout||R!==S.prevStackOffset||!lc(L,S.prevMargin)){var G=wM(y),B={chartX:S.chartX,chartY:S.chartY,isTooltipActive:S.isTooltipActive},W=we(we({},bM(S,N,O)),{},{updateId:S.updateId+1}),q=we(we(we({},G),B),W);return we(we(we({},q),g(we({props:y},q),S)),{},{prevDataKey:C,prevData:N,prevWidth:_,prevHeight:P,prevLayout:O,prevStackOffset:R,prevMargin:L,prevChildren:E})}if(!d1(E,S.prevChildren)){var V,F,U,Z,z=ea(E,Tc),$=z&&(V=(F=z.props)===null||F===void 0?void 0:F.startIndex)!==null&&V!==void 0?V:T,te=z&&(U=(Z=z.props)===null||Z===void 0?void 0:Z.endIndex)!==null&&U!==void 0?U:D,se=$!==T||te!==D,Q=!kt(N),ce=Q&&!se?S.updateId:S.updateId+1;return we(we({updateId:ce},g(we(we({props:y},S),{},{updateId:ce,dataStartIndex:$,dataEndIndex:te}),S)),{},{prevChildren:E,dataStartIndex:$,dataEndIndex:te})}return null}),bt(j,"renderActiveDot",function(y,S,C){var N;return v.isValidElement(y)?N=v.cloneElement(y,S):Pt(y)?N=y(S):N=H.createElement(Hv,S),H.createElement(Jt,{className:"recharts-active-dot",key:C},N)});var b=v.forwardRef(function(S,C){return H.createElement(j,nc({},S,{ref:C}))});return b.displayName=j.displayName,b},kS=jC({chartName:"LineChart",GraphicalChild:qo,axisComponents:[{axisType:"xAxis",AxisComp:Hi},{axisType:"yAxis",AxisComp:Ki}],formatAxisMap:_4}),bfe=jC({chartName:"BarChart",GraphicalChild:ol,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Hi},{axisType:"yAxis",AxisComp:Ki}],formatAxisMap:_4}),wfe=jC({chartName:"PieChart",GraphicalChild:ci,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Xv},{axisType:"radiusAxis",AxisComp:Gv}],formatAxisMap:yae,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const jfe=()=>{const{configs:e}=Cf(),{source:t}=qn(),[n,r]=v.useState([]),[a,i]=v.useState("timestamp"),[o,c]=v.useState("desc"),d=y=>{if(a===y){c(S=>S==="asc"?"desc":"asc");return}i(y),c("desc")};v.useEffect(()=>{let y=!0;return t.listResults().then(S=>{y&&r(S)}),()=>{y=!1}},[t]);const f=e.length,h=n.length,p=h===0?0:n.reduce((y,S)=>y+S.overallPassRate,0)/h,x=h===0?0:Math.round(n.reduce((y,S)=>y+S.avgLatency,0)/h),g=v.useMemo(()=>[...n].sort((S,C)=>{let N=0;return a==="timestamp"&&(N=new Date(S.timestamp).getTime()-new Date(C.timestamp).getTime()),a==="passRate"&&(N=S.overallPassRate-C.overallPassRate),a==="latency"&&(N=S.avgLatency-C.avgLatency),a==="scenarios"&&(N=S.totalScenarios-C.totalScenarios),o==="asc"?N:-N}),[n,a,o]),j=[...g].reverse().map(y=>({date:new Date(y.timestamp).toLocaleDateString("en-US",{month:"short",day:"numeric"}),passRate:Math.round(y.overallPassRate*100),latency:y.avgLatency})),b=y=>{const S=Array.from(new Set(y.scenarios.map(_=>_.scenarioId).filter(Boolean))),C=Array.from(new Set(y.scenarios.map(_=>_.agentName).filter(Boolean))),N=S.slice(0,2).join(", "),E=S.length>2?` +${S.length-2}`:"";return{scenarioCount:S.length,agentCount:C.length,scenarioPreview:N?`${N}${E}`:"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(T$,{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(re,{asChild:!0,children:s.jsxs(wt,{to:"/mcp-evaluations/new",children:[s.jsx(ZS,{className:"mr-2 h-4 w-4"}),"New MCP Evaluation"]})}),s.jsx(re,{variant:"outline",asChild:!0,children:s.jsxs(wt,{to:"/run",children:[s.jsx(Oo,{className:"mr-2 h-4 w-4"}),"Run Evaluation"]})}),s.jsx(re,{variant:"outline",asChild:!0,children:s.jsxs(wt,{to:"/results",children:[s.jsx(jd,{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(cs,{title:"MCP Evaluations",value:f,icon:Vj,subtitle:`${f} active`}),s.jsx(cs,{title:"Total Runs",value:h,icon:E$,subtitle:"Last 30 days"}),s.jsx(cs,{title:"Pass Rate",value:`${Math.round(p*100)}%`,icon:jd,subtitle:"+5% from last week",trend:"up"}),s.jsx(cs,{title:"Avg Latency",value:`${x}ms`,icon:L$,subtitle:"-120ms from last week",trend:"up"})]}),s.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[s.jsxs(qe,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(_t,{className:"text-base",children:"Pass Rate Trend"})}),s.jsx(We,{children:s.jsx(Gh,{width:"100%",height:200,children:s.jsxs(kS,{data:j,children:[s.jsx(Hi,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Ki,{domain:[0,100],tick:{fontSize:11},tickLine:!1,axisLine:!1,tickFormatter:y=>`${y}%`}),s.jsx(Fr,{formatter:y=>[`${y}%`,"Pass Rate"]}),s.jsx(qo,{type:"monotone",dataKey:"passRate",stroke:"hsl(38, 92%, 50%)",strokeWidth:2,dot:{r:3,fill:"hsl(38, 92%, 50%)"}})]})})})]}),s.jsxs(qe,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(_t,{className:"text-base",children:"Recent Tool Latency (ms)"})}),s.jsx(We,{children:s.jsx(Gh,{width:"100%",height:200,children:s.jsxs(kS,{data:j,children:[s.jsx(Hi,{dataKey:"date",tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Ki,{tick:{fontSize:11},tickLine:!1,axisLine:!1}),s.jsx(Fr,{formatter:y=>[`${y}ms`,"Latency"]}),s.jsx(qo,{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(qe,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(_t,{className:"text-base",children:"Recent Runs"})}),s.jsx(We,{className:"p-0",children:s.jsxs(Br,{children:[s.jsx(zr,{children:s.jsxs(qt,{children:[s.jsx(tt,{children:"Run ID"}),s.jsx(tt,{children:"Evaluated"}),s.jsx(tt,{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(hs,{className:"h-3.5 w-3.5"}):s.jsx(Wt,{className:"h-3.5 w-3.5"}):s.jsx(rc,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),s.jsx(tt,{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(hs,{className:"h-3.5 w-3.5"}):s.jsx(Wt,{className:"h-3.5 w-3.5"}):s.jsx(rc,{className:"h-3.5 w-3.5 text-muted-foreground"})]})}),s.jsx(tt,{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(hs,{className:"h-3.5 w-3.5"}):s.jsx(Wt,{className:"h-3.5 w-3.5"}):s.jsx(rc,{className:"h-3.5 w-3.5 text-muted-foreground"})]})})]})}),s.jsx(Ur,{children:g.map(y=>s.jsxs(qt,{className:"cursor-pointer",children:[s.jsx(Be,{children:s.jsx(wt,{to:`/results/${y.id}`,className:"font-mono text-xs text-primary hover:underline",children:y.id})}),s.jsx(Be,{className:"text-[11px] text-muted-foreground",children:(()=>{const S=b(y);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(Be,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(gf,{className:"h-3 w-3"}),new Date(y.timestamp).toLocaleString()]})}),s.jsx(Be,{children:s.jsx(Ks,{rate:y.overallPassRate})}),s.jsx(Be,{className:"text-right font-mono text-sm",children:y.totalScenarios})]},y.id))})]})})]})})]})};function SC({value:e,onValueChange:t,placeholder:n="Search...",className:r,inputClassName:a,clearAriaLabel:i="Clear search"}){return s.jsxs("div",{className:je("relative",r),children:[s.jsx(ht,{value:e,onChange:o=>t(o.target.value),placeholder:n,className:je("h-9 w-[240px] pr-8",a)}),e&&s.jsx(re,{type:"button",variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2 border border-border/60",onClick:()=>t(""),"aria-label":i,children:s.jsx(ws,{className:"h-4 w-4"})})]})}var Sfe=v.createContext(void 0);function uu(e){const t=v.useContext(Sfe);return e||t||"ltr"}var Rj="rovingFocusGroup.onEntryFocus",Nfe={bubbles:!1,cancelable:!0},Mf="RovingFocusGroup",[OS,uF,Cfe]=mf(Mf),[Afe,ig]=mr(Mf,[Cfe]),[_fe,Efe]=Afe(Mf),dF=v.forwardRef((e,t)=>s.jsx(OS.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(OS.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Pfe,{...e,ref:t})})}));dF.displayName=Mf;var Pfe=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,x=v.useRef(null),g=xt(t,x),j=uu(i),[b,y]=la({prop:o,defaultProp:c??null,onChange:d,caller:Mf}),[S,C]=v.useState(!1),N=Un(f),E=uF(n),_=v.useRef(!1),[P,O]=v.useState(0);return v.useEffect(()=>{const R=x.current;if(R)return R.addEventListener(Rj,N),()=>R.removeEventListener(Rj,N)},[N]),s.jsx(_fe,{scope:n,orientation:r,dir:j,loop:a,currentTabStopId:b,onItemFocus:v.useCallback(R=>y(R),[y]),onItemShiftTab:v.useCallback(()=>C(!0),[]),onFocusableItemAdd:v.useCallback(()=>O(R=>R+1),[]),onFocusableItemRemove:v.useCallback(()=>O(R=>R-1),[]),children:s.jsx(Ge.div,{tabIndex:S||P===0?-1:0,"data-orientation":r,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:Ie(e.onMouseDown,()=>{_.current=!0}),onFocus:Ie(e.onFocus,R=>{const L=!_.current;if(R.target===R.currentTarget&&L&&!S){const T=new CustomEvent(Rj,Nfe);if(R.currentTarget.dispatchEvent(T),!T.defaultPrevented){const D=E().filter(q=>q.focusable),M=D.find(q=>q.active),G=D.find(q=>q.id===b),W=[M,G,...D].filter(Boolean).map(q=>q.ref.current);hF(W,h)}}_.current=!1}),onBlur:Ie(e.onBlur,()=>C(!1))})})}),fF="RovingFocusGroupItem",pF=v.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,children:o,...c}=e,d=er(),f=i||d,h=Efe(fF,n),p=h.currentTabStopId===f,x=uF(n),{onFocusableItemAdd:g,onFocusableItemRemove:j,currentTabStopId:b}=h;return v.useEffect(()=>{if(r)return g(),()=>j()},[r,g,j]),s.jsx(OS.ItemSlot,{scope:n,id:f,focusable:r,active:a,children:s.jsx(Ge.span,{tabIndex:p?0:-1,"data-orientation":h.orientation,...c,ref:t,onMouseDown:Ie(e.onMouseDown,y=>{r?h.onItemFocus(f):y.preventDefault()}),onFocus:Ie(e.onFocus,()=>h.onItemFocus(f)),onKeyDown:Ie(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){h.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const S=Rfe(y,h.orientation,h.dir);if(S!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let N=x().filter(E=>E.focusable).map(E=>E.ref.current);if(S==="last")N.reverse();else if(S==="prev"||S==="next"){S==="prev"&&N.reverse();const E=N.indexOf(y.currentTarget);N=h.loop?Tfe(N,E+1):N.slice(E+1)}setTimeout(()=>hF(N))}}),children:typeof o=="function"?o({isCurrentTabStop:p,hasTabStop:b!=null}):o})})});pF.displayName=fF;var kfe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ofe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Rfe(e,t,n){const r=Ofe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return kfe[r]}function hF(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Tfe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var mF=dF,vF=pF;function Ife(e){const t=Mfe(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(Dfe);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 Mfe(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=Ffe(a),c=Lfe(i,a.props);return a.type!==v.Fragment&&(c.ref=r?kr(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 $fe=Symbol("radix.slottable");function Dfe(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$fe}function Lfe(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 Ffe(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 RS=["Enter"," "],Bfe=["ArrowDown","PageUp","Home"],gF=["ArrowUp","PageDown","End"],zfe=[...Bfe,...gF],Ufe={ltr:[...RS,"ArrowRight"],rtl:[...RS,"ArrowLeft"]},qfe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},$f="Menu",[df,Wfe,Vfe]=mf($f),[ll,xF]=mr($f,[Vfe,Yi,ig]),og=Yi(),yF=ig(),[Hfe,cl]=ll($f),[Kfe,Df]=ll($f),bF=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:i,modal:o=!0}=e,c=og(t),[d,f]=v.useState(null),h=v.useRef(!1),p=Un(i),x=uu(a);return v.useEffect(()=>{const g=()=>{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",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),s.jsx(nv,{...c,children:s.jsx(Hfe,{scope:t,open:n,onOpenChange:p,content:d,onContentChange:f,children:s.jsx(Kfe,{scope:t,onClose:v.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:h,dir:x,modal:o,children:r})})})};bF.displayName=$f;var Gfe="MenuAnchor",NC=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=og(n);return s.jsx(yf,{...a,...r,ref:t})});NC.displayName=Gfe;var CC="MenuPortal",[Yfe,wF]=ll(CC,{forceMount:void 0}),jF=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,i=cl(CC,t);return s.jsx(Yfe,{scope:t,forceMount:n,children:s.jsx(nr,{present:n||i.open,children:s.jsx(Yc,{asChild:!0,container:a,children:r})})})};jF.displayName=CC;var Ca="MenuContent",[Xfe,AC]=ll(Ca),SF=v.forwardRef((e,t)=>{const n=wF(Ca,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=cl(Ca,e.__scopeMenu),o=Df(Ca,e.__scopeMenu);return s.jsx(df.Provider,{scope:e.__scopeMenu,children:s.jsx(nr,{present:r||i.open,children:s.jsx(df.Slot,{scope:e.__scopeMenu,children:o.modal?s.jsx(Qfe,{...a,ref:t}):s.jsx(Jfe,{...a,ref:t})})})})}),Qfe=v.forwardRef((e,t)=>{const n=cl(Ca,e.__scopeMenu),r=v.useRef(null),a=xt(t,r);return v.useEffect(()=>{const i=r.current;if(i)return gv(i)},[]),s.jsx(_C,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ie(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Jfe=v.forwardRef((e,t)=>{const n=cl(Ca,e.__scopeMenu);return s.jsx(_C,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Zfe=Ife("MenuContent.ScrollLock"),_C=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:x,onDismiss:g,disableOutsideScroll:j,...b}=e,y=cl(Ca,n),S=Df(Ca,n),C=og(n),N=yF(n),E=Wfe(n),[_,P]=v.useState(null),O=v.useRef(null),R=xt(t,O,y.onContentChange),L=v.useRef(0),T=v.useRef(""),D=v.useRef(0),M=v.useRef(null),G=v.useRef("right"),B=v.useRef(0),W=j?wf:v.Fragment,q=j?{as:Zfe,allowPinchZoom:!0}:void 0,V=U=>{const Z=T.current+U,z=E().filter(le=>!le.disabled),$=document.activeElement,te=z.find(le=>le.ref.current===$)?.textValue,se=z.map(le=>le.textValue),Q=dpe(se,Z,te),ce=z.find(le=>le.textValue===Q)?.ref.current;(function le(me){T.current=me,window.clearTimeout(L.current),me!==""&&(L.current=window.setTimeout(()=>le(""),1e3))})(Z),ce&&setTimeout(()=>ce.focus())};v.useEffect(()=>()=>window.clearTimeout(L.current),[]),mv();const F=v.useCallback(U=>G.current===M.current?.side&&ppe(U,M.current?.area),[]);return s.jsx(Xfe,{scope:n,searchRef:T,onItemEnter:v.useCallback(U=>{F(U)&&U.preventDefault()},[F]),onItemLeave:v.useCallback(U=>{F(U)||(O.current?.focus(),P(null))},[F]),onTriggerLeave:v.useCallback(U=>{F(U)&&U.preventDefault()},[F]),pointerGraceTimerRef:D,onPointerGraceIntentChange:v.useCallback(U=>{M.current=U},[]),children:s.jsx(W,{...q,children:s.jsx(bf,{asChild:!0,trapped:a,onMountAutoFocus:Ie(i,U=>{U.preventDefault(),O.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:s.jsx(Zo,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:x,onDismiss:g,children:s.jsx(mF,{asChild:!0,...N,dir:S.dir,orientation:"vertical",loop:r,currentTabStopId:_,onCurrentTabStopIdChange:P,onEntryFocus:Ie(d,U=>{S.isUsingKeyboardRef.current||U.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(rv,{role:"menu","aria-orientation":"vertical","data-state":FF(y.open),"data-radix-menu-content":"",dir:S.dir,...C,...b,ref:R,style:{outline:"none",...b.style},onKeyDown:Ie(b.onKeyDown,U=>{const z=U.target.closest("[data-radix-menu-content]")===U.currentTarget,$=U.ctrlKey||U.altKey||U.metaKey,te=U.key.length===1;z&&(U.key==="Tab"&&U.preventDefault(),!$&&te&&V(U.key));const se=O.current;if(U.target!==se||!zfe.includes(U.key))return;U.preventDefault();const ce=E().filter(le=>!le.disabled).map(le=>le.ref.current);gF.includes(U.key)&&ce.reverse(),cpe(ce)}),onBlur:Ie(e.onBlur,U=>{U.currentTarget.contains(U.target)||(window.clearTimeout(L.current),T.current="")}),onPointerMove:Ie(e.onPointerMove,ff(U=>{const Z=U.target,z=B.current!==U.clientX;if(U.currentTarget.contains(Z)&&z){const $=U.clientX>B.current?"right":"left";G.current=$,B.current=U.clientX}}))})})})})})})});SF.displayName=Ca;var epe="MenuGroup",EC=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Ge.div,{role:"group",...r,ref:t})});EC.displayName=epe;var tpe="MenuLabel",NF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Ge.div,{...r,ref:t})});NF.displayName=tpe;var Lm="MenuItem",SM="menu.itemSelect",lg=v.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,i=v.useRef(null),o=Df(Lm,e.__scopeMenu),c=AC(Lm,e.__scopeMenu),d=xt(t,i),f=v.useRef(!1),h=()=>{const p=i.current;if(!n&&p){const x=new CustomEvent(SM,{bubbles:!0,cancelable:!0});p.addEventListener(SM,g=>r?.(g),{once:!0}),KS(p,x),x.defaultPrevented?f.current=!1:o.onClose()}};return s.jsx(CF,{...a,ref:d,disabled:n,onClick:Ie(e.onClick,h),onPointerDown:p=>{e.onPointerDown?.(p),f.current=!0},onPointerUp:Ie(e.onPointerUp,p=>{f.current||p.currentTarget?.click()}),onKeyDown:Ie(e.onKeyDown,p=>{const x=c.searchRef.current!=="";n||x&&p.key===" "||RS.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});lg.displayName=Lm;var CF=v.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...i}=e,o=AC(Lm,n),c=yF(n),d=v.useRef(null),f=xt(t,d),[h,p]=v.useState(!1),[x,g]=v.useState("");return v.useEffect(()=>{const j=d.current;j&&g((j.textContent??"").trim())},[i.children]),s.jsx(df.ItemSlot,{scope:n,disabled:r,textValue:a??x,children:s.jsx(vF,{asChild:!0,...c,focusable:!r,children:s.jsx(Ge.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:f,onPointerMove:Ie(e.onPointerMove,ff(j=>{r?o.onItemLeave(j):(o.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ie(e.onPointerLeave,ff(j=>o.onItemLeave(j))),onFocus:Ie(e.onFocus,()=>p(!0)),onBlur:Ie(e.onBlur,()=>p(!1))})})})}),npe="MenuCheckboxItem",AF=v.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return s.jsx(OF,{scope:e.__scopeMenu,checked:n,children:s.jsx(lg,{role:"menuitemcheckbox","aria-checked":Fm(n)?"mixed":n,...a,ref:t,"data-state":kC(n),onSelect:Ie(a.onSelect,()=>r?.(Fm(n)?!0:!n),{checkForDefaultPrevented:!1})})})});AF.displayName=npe;var _F="MenuRadioGroup",[rpe,ape]=ll(_F,{value:void 0,onValueChange:()=>{}}),EF=v.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,i=Un(r);return s.jsx(rpe,{scope:e.__scopeMenu,value:n,onValueChange:i,children:s.jsx(EC,{...a,ref:t})})});EF.displayName=_F;var PF="MenuRadioItem",kF=v.forwardRef((e,t)=>{const{value:n,...r}=e,a=ape(PF,e.__scopeMenu),i=n===a.value;return s.jsx(OF,{scope:e.__scopeMenu,checked:i,children:s.jsx(lg,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":kC(i),onSelect:Ie(r.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});kF.displayName=PF;var PC="MenuItemIndicator",[OF,spe]=ll(PC,{checked:!1}),RF=v.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,i=spe(PC,n);return s.jsx(nr,{present:r||Fm(i.checked)||i.checked===!0,children:s.jsx(Ge.span,{...a,ref:t,"data-state":kC(i.checked)})})});RF.displayName=PC;var ipe="MenuSeparator",TF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Ge.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});TF.displayName=ipe;var ope="MenuArrow",IF=v.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=og(n);return s.jsx(av,{...a,...r,ref:t})});IF.displayName=ope;var lpe="MenuSub",[Yge,MF]=ll(lpe),ud="MenuSubTrigger",$F=v.forwardRef((e,t)=>{const n=cl(ud,e.__scopeMenu),r=Df(ud,e.__scopeMenu),a=MF(ud,e.__scopeMenu),i=AC(ud,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(NC,{asChild:!0,...f,children:s.jsx(CF,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":FF(n.open),...e,ref:kr(t,a.onTriggerChange),onClick:p=>{e.onClick?.(p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ie(e.onPointerMove,ff(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:Ie(e.onPointerLeave,ff(p=>{h();const x=n.content?.getBoundingClientRect();if(x){const g=n.content?.dataset.side,j=g==="right",b=j?-5:5,y=x[j?"left":"right"],S=x[j?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+b,y:p.clientY},{x:y,y:x.top},{x:S,y:x.top},{x:S,y:x.bottom},{x:y,y:x.bottom}],side:g}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(p),p.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Ie(e.onKeyDown,p=>{const x=i.searchRef.current!=="";e.disabled||x&&p.key===" "||Ufe[r.dir].includes(p.key)&&(n.onOpenChange(!0),n.content?.focus(),p.preventDefault())})})})});$F.displayName=ud;var DF="MenuSubContent",LF=v.forwardRef((e,t)=>{const n=wF(Ca,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=cl(Ca,e.__scopeMenu),o=Df(Ca,e.__scopeMenu),c=MF(DF,e.__scopeMenu),d=v.useRef(null),f=xt(t,d);return s.jsx(df.Provider,{scope:e.__scopeMenu,children:s.jsx(nr,{present:r||i.open,children:s.jsx(df.Slot,{scope:e.__scopeMenu,children:s.jsx(_C,{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:Ie(e.onFocusOutside,h=>{h.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Ie(e.onEscapeKeyDown,h=>{o.onClose(),h.preventDefault()}),onKeyDown:Ie(e.onKeyDown,h=>{const p=h.currentTarget.contains(h.target),x=qfe[o.dir].includes(h.key);p&&x&&(i.onOpenChange(!1),c.trigger?.focus(),h.preventDefault())})})})})})});LF.displayName=DF;function FF(e){return e?"open":"closed"}function Fm(e){return e==="indeterminate"}function kC(e){return Fm(e)?"indeterminate":e?"checked":"unchecked"}function cpe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function upe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function dpe(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=upe(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 fpe(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,x=d.y;h>r!=x>r&&n<(p-f)*(r-h)/(x-h)+f&&(a=!a)}return a}function ppe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return fpe(n,t)}function ff(e){return t=>t.pointerType==="mouse"?e(t):void 0}var hpe=bF,mpe=NC,vpe=jF,gpe=SF,xpe=EC,ype=NF,bpe=lg,wpe=AF,jpe=EF,Spe=kF,Npe=RF,Cpe=TF,Ape=IF,_pe=$F,Epe=LF,cg="DropdownMenu",[Ppe]=mr(cg,[xF]),Or=xF(),[kpe,BF]=Ppe(cg),zF=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:i,onOpenChange:o,modal:c=!0}=e,d=Or(t),f=v.useRef(null),[h,p]=la({prop:a,defaultProp:i??!1,onChange:o,caller:cg});return s.jsx(kpe,{scope:t,triggerId:er(),triggerRef:f,contentId:er(),open:h,onOpenChange:p,onOpenToggle:v.useCallback(()=>p(x=>!x),[p]),modal:c,children:s.jsx(hpe,{...d,open:h,onOpenChange:p,dir:r,modal:c,children:n})})};zF.displayName=cg;var UF="DropdownMenuTrigger",qF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...a}=e,i=BF(UF,n),o=Or(n);return s.jsx(mpe,{asChild:!0,...o,children:s.jsx(Ge.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:kr(t,i.triggerRef),onPointerDown:Ie(e.onPointerDown,c=>{!r&&c.button===0&&c.ctrlKey===!1&&(i.onOpenToggle(),i.open||c.preventDefault())}),onKeyDown:Ie(e.onKeyDown,c=>{r||(["Enter"," "].includes(c.key)&&i.onOpenToggle(),c.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(c.key)&&c.preventDefault())})})})});qF.displayName=UF;var Ope="DropdownMenuPortal",WF=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Or(t);return s.jsx(vpe,{...r,...n})};WF.displayName=Ope;var VF="DropdownMenuContent",HF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=BF(VF,n),i=Or(n),o=v.useRef(!1);return s.jsx(gpe,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...r,ref:t,onCloseAutoFocus:Ie(e.onCloseAutoFocus,c=>{o.current||a.triggerRef.current?.focus(),o.current=!1,c.preventDefault()}),onInteractOutside:Ie(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)"}})});HF.displayName=VF;var Rpe="DropdownMenuGroup",Tpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Or(n);return s.jsx(xpe,{...a,...r,ref:t})});Tpe.displayName=Rpe;var Ipe="DropdownMenuLabel",KF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Or(n);return s.jsx(ype,{...a,...r,ref:t})});KF.displayName=Ipe;var Mpe="DropdownMenuItem",GF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Or(n);return s.jsx(bpe,{...a,...r,ref:t})});GF.displayName=Mpe;var $pe="DropdownMenuCheckboxItem",YF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Or(n);return s.jsx(wpe,{...a,...r,ref:t})});YF.displayName=$pe;var Dpe="DropdownMenuRadioGroup",Lpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Or(n);return s.jsx(jpe,{...a,...r,ref:t})});Lpe.displayName=Dpe;var Fpe="DropdownMenuRadioItem",XF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Or(n);return s.jsx(Spe,{...a,...r,ref:t})});XF.displayName=Fpe;var Bpe="DropdownMenuItemIndicator",QF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Or(n);return s.jsx(Npe,{...a,...r,ref:t})});QF.displayName=Bpe;var zpe="DropdownMenuSeparator",JF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Or(n);return s.jsx(Cpe,{...a,...r,ref:t})});JF.displayName=zpe;var Upe="DropdownMenuArrow",qpe=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Or(n);return s.jsx(Ape,{...a,...r,ref:t})});qpe.displayName=Upe;var Wpe="DropdownMenuSubTrigger",ZF=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Or(n);return s.jsx(_pe,{...a,...r,ref:t})});ZF.displayName=Wpe;var Vpe="DropdownMenuSubContent",eB=v.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=Or(n);return s.jsx(Epe,{...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)"}})});eB.displayName=Vpe;var Hpe=zF,Kpe=qF,Gpe=WF,tB=HF,nB=KF,rB=GF,aB=YF,sB=XF,iB=QF,oB=JF,lB=ZF,cB=eB;const du=Hpe,fu=Kpe,Ype=v.forwardRef(({className:e,inset:t,children:n,...r},a)=>s.jsxs(lB,{ref:a,className:je("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(P$,{className:"ml-auto h-4 w-4"})]}));Ype.displayName=lB.displayName;const Xpe=v.forwardRef(({className:e,...t},n)=>s.jsx(cB,{ref:n,className:je("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}));Xpe.displayName=cB.displayName;const ul=v.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(Gpe,{children:s.jsx(tB,{ref:r,sideOffset:t,className:je("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})}));ul.displayName=tB.displayName;const Pr=v.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(rB,{ref:r,className:je("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}));Pr.displayName=rB.displayName;const Qpe=v.forwardRef(({className:e,children:t,checked:n,...r},a)=>s.jsxs(aB,{ref:a,className:je("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(iB,{children:s.jsx(mc,{className:"h-4 w-4"})})}),t]}));Qpe.displayName=aB.displayName;const Jpe=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(sB,{ref:r,className:je("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(iB,{children:s.jsx(K7,{className:"h-2 w-2 fill-current"})})}),t]}));Jpe.displayName=sB.displayName;const OC=v.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(nB,{ref:r,className:je("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));OC.displayName=nB.displayName;const RC=v.forwardRef(({className:e,...t},n)=>s.jsx(oB,{ref:n,className:je("-mx-1 my-1 h-px bg-muted",e),...t}));RC.displayName=oB.displayName;const Wl=e=>e.configName?.trim()||e.name,Zpe=()=>{const{configs:e,deleteConfig:t,cloneConfig:n,loading:r,reload:a}=Cf(),i=Pa(),[o,c]=v.useState("name"),[d,f]=v.useState("asc"),[h,p]=v.useState(""),x=h.trim().toLowerCase(),g=_=>{if(o===_){f(P=>P==="asc"?"desc":"asc");return}c(_),f(_==="updatedAt"?"desc":"asc")};v.useEffect(()=>{a();const _=()=>{a()};return window.addEventListener("focus",_),()=>{window.removeEventListener("focus",_)}},[a]);const j=async(_,P)=>{await t(_),Pe({title:"Deleted",description:`"${P}" has been removed.`})},b=async _=>{const P=await n(_);Pe({title:"Cloned",description:`Created "${Wl(P)}".`}),i(`/mcp-evaluations/${P.id}`)},y=_=>_.agentEntries?.length??_.agents?.length??0,S=_=>_.scenarioEntries?.length??_.scenarios?.length??0,C=v.useMemo(()=>x.length===0?e:e.filter(_=>[Wl(_),_.id,_.description??"",_.loadError??""].join(" ").toLowerCase().includes(x)),[e,x]),N=v.useMemo(()=>[...C].sort((P,O)=>{let R=0;return o==="name"&&(R=Wl(P).localeCompare(Wl(O))),o==="scenarios"&&(R=S(P)-S(O)),o==="agents"&&(R=y(P)-y(O)),o==="updatedAt"&&(R=new Date(P.updatedAt).getTime()-new Date(O.updatedAt).getTime()),d==="asc"?R:-R}),[C,o,d]),E=_=>o!==_?s.jsx(rc,{className:"h-3.5 w-3.5 text-muted-foreground"}):d==="asc"?s.jsx(hs,{className:"h-3.5 w-3.5"}):s.jsx(Wt,{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(R$,{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.jsx(SC,{value:h,onValueChange:p,placeholder:"Search evaluations..."}),s.jsxs(re,{variant:"outline",size:"sm",onClick:()=>{a()},children:[s.jsx(Aa,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(re,{variant:"outline",size:"sm",children:[s.jsx(nq,{className:"mr-2 h-4 w-4"}),"Import YAML"]}),s.jsx(re,{size:"sm",asChild:!0,children:s.jsxs(wt,{to:"/mcp-evaluations/new",children:[s.jsx(bs,{className:"mr-2 h-4 w-4"}),"Create New"]})})]})]}),s.jsx(qe,{children:s.jsx(We,{className:"p-0",children:s.jsxs(Br,{children:[s.jsx(zr,{children:s.jsxs(qt,{children:[s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>g("name"),children:["Name",E("name")]})}),s.jsx(tt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>g("scenarios"),children:["Scenarios",E("scenarios")]})}),s.jsx(tt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>g("agents"),children:["Agents",E("agents")]})}),s.jsx(tt,{className:"text-right",children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>g("updatedAt"),children:["Last Updated",E("updatedAt")]})}),s.jsx(tt,{className:"w-10"})]})}),s.jsxs(Ur,{children:[N.map(_=>s.jsxs(qt,{children:[s.jsx(Be,{children:s.jsxs("div",{children:[s.jsx(wt,{to:`/mcp-evaluations/${_.id}`,className:"font-medium text-sm hover:text-primary",children:Wl(_)}),_.loadError&&s.jsxs(Qe,{variant:"destructive",className:"ml-2 align-middle text-[10px]",children:[s.jsx(jh,{className:"mr-1 h-3 w-3"}),"Broken"]}),_.description&&s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:_.description}),_.loadError&&s.jsx("p",{className:"text-xs text-destructive mt-0.5 break-all",children:_.loadError})]})}),s.jsx(Be,{className:"text-right font-mono text-sm",children:S(_)}),s.jsx(Be,{className:"text-right font-mono text-sm",children:y(_)}),s.jsx(Be,{className:"text-right text-xs text-muted-foreground",children:new Date(_.updatedAt).toLocaleDateString()}),s.jsx(Be,{children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx(re,{size:"sm",variant:"outline",asChild:!0,children:s.jsxs(wt,{to:`/run?configId=${encodeURIComponent(_.id)}`,children:[s.jsx(Oo,{className:"h-3.5 w-3.5"}),"Run"]})}),s.jsxs(du,{children:[s.jsx(fu,{asChild:!0,children:s.jsx(re,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Ym,{className:"h-4 w-4"})})}),s.jsxs(ul,{align:"end",children:[s.jsxs(Pr,{onClick:()=>i(`/mcp-evaluations/${_.id}`),children:[s.jsx(Xm,{className:"mr-2 h-3.5 w-3.5"}),"Edit"]}),s.jsxs(Pr,{onClick:()=>{b(_.id)},children:[s.jsx(ys,{className:"mr-2 h-3.5 w-3.5"}),"Clone"]}),s.jsxs(Pr,{className:"text-destructive",onClick:()=>{j(_.id,Wl(_))},children:[s.jsx(_a,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})]})})]},_.id)),!r&&e.length===0&&s.jsx(qt,{children:s.jsx(Be,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"No MCP evaluations yet. Create your first one to get started."})}),!r&&e.length>0&&N.length===0&&s.jsx(qt,{children:s.jsx(Be,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"No MCP evaluations match this filter."})}),r&&s.jsx(qt,{children:s.jsx(Be,{colSpan:5,className:"text-center py-12 text-muted-foreground",children:"Loading MCP evaluations..."})})]})]})})})]})};var ehe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],the=ehe.reduce((e,t)=>{const n=hv(`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}},{}),nhe="Label",uB=v.forwardRef((e,t)=>s.jsx(the.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));uB.displayName=nhe;var dB=uB;const rhe=el("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Fe=v.forwardRef(({className:e,...t},n)=>s.jsx(dB,{ref:n,className:je(rhe(),e),...t}));Fe.displayName=dB.displayName;const Ha=v.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:je("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}));Ha.displayName="Textarea";function ug(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 dg="Switch",[ahe]=mr(dg),[she,ihe]=ahe(dg),fB=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,[x,g]=v.useState(null),j=xt(t,N=>g(N)),b=v.useRef(!1),y=x?h||!!x.closest("form"):!0,[S,C]=la({prop:a,defaultProp:i??!1,onChange:f,caller:dg});return s.jsxs(she,{scope:n,checked:S,disabled:c,children:[s.jsx(Ge.button,{type:"button",role:"switch","aria-checked":S,"aria-required":o,"data-state":vB(S),"data-disabled":c?"":void 0,disabled:c,value:d,...p,ref:j,onClick:Ie(e.onClick,N=>{C(E=>!E),y&&(b.current=N.isPropagationStopped(),b.current||N.stopPropagation())})}),y&&s.jsx(mB,{control:x,bubbles:!b.current,name:r,value:d,checked:S,required:o,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})});fB.displayName=dg;var pB="SwitchThumb",hB=v.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=ihe(pB,n);return s.jsx(Ge.span,{"data-state":vB(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});hB.displayName=pB;var ohe="SwitchBubbleInput",mB=v.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},i)=>{const o=v.useRef(null),c=xt(o,i),d=ug(n),f=tv(t);return v.useEffect(()=>{const h=o.current;if(!h)return;const p=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==n&&g){const j=new Event("click",{bubbles:r});g.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}})});mB.displayName=ohe;function vB(e){return e?"checked":"unchecked"}var gB=fB,lhe=hB;const Bm=v.forwardRef(({className:e,...t},n)=>s.jsx(gB,{className:je("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(lhe,{className:je("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=gB.displayName;var fg="Tabs",[che]=mr(fg,[ig]),xB=ig(),[uhe,TC]=che(fg),yB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:c,activationMode:d="automatic",...f}=e,h=uu(c),[p,x]=la({prop:r,onChange:a,defaultProp:i??"",caller:fg});return s.jsx(uhe,{scope:n,baseId:er(),value:p,onValueChange:x,orientation:o,dir:h,activationMode:d,children:s.jsx(Ge.div,{dir:h,"data-orientation":o,...f,ref:t})})});yB.displayName=fg;var bB="TabsList",wB=v.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=TC(bB,n),o=xB(n);return s.jsx(mF,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:s.jsx(Ge.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});wB.displayName=bB;var jB="TabsTrigger",SB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,o=TC(jB,n),c=xB(n),d=AB(o.baseId,r),f=_B(o.baseId,r),h=r===o.value;return s.jsx(vF,{asChild:!0,...c,focusable:!a,active:h,children:s.jsx(Ge.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:Ie(e.onMouseDown,p=>{!a&&p.button===0&&p.ctrlKey===!1?o.onValueChange(r):p.preventDefault()}),onKeyDown:Ie(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&o.onValueChange(r)}),onFocus:Ie(e.onFocus,()=>{const p=o.activationMode!=="manual";!h&&!a&&p&&o.onValueChange(r)})})})});SB.displayName=jB;var NB="TabsContent",CB=v.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...o}=e,c=TC(NB,n),d=AB(c.baseId,r),f=_B(c.baseId,r),h=r===c.value,p=v.useRef(h);return v.useEffect(()=>{const x=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(x)},[]),s.jsx(nr,{present:a||h,children:({present:x})=>s.jsx(Ge.div,{"data-state":h?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!x,id:f,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:x&&i})})});CB.displayName=NB;function AB(e,t){return`${e}-trigger-${t}`}function _B(e,t){return`${e}-content-${t}`}var dhe=yB,EB=wB,PB=SB,kB=CB;const pg=dhe,Lf=v.forwardRef(({className:e,...t},n)=>s.jsx(EB,{ref:n,className:je("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Lf.displayName=EB.displayName;const xs=v.forwardRef(({className:e,...t},n)=>s.jsx(PB,{ref:n,className:je("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}));xs.displayName=PB.displayName;const pf=v.forwardRef(({className:e,...t},n)=>s.jsx(kB,{ref:n,className:je("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));pf.displayName=kB.displayName;const NM={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 OB({provider:e}){return s.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${NM[e]??NM.custom}`,children:e})}function hf(e,[t,n]){return Math.min(n,Math.max(t,e))}function fhe(e){const t=phe(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(mhe);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 phe(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=ghe(a),c=vhe(i,a.props);return a.type!==v.Fragment&&(c.ref=r?kr(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 hhe=Symbol("radix.slottable");function mhe(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hhe}function vhe(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 ghe(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 xhe=[" ","Enter","ArrowUp","ArrowDown"],yhe=[" ","Enter"],Wo="Select",[hg,mg,bhe]=mf(Wo),[pu]=mr(Wo,[bhe,Yi]),vg=Yi(),[whe,no]=pu(Wo),[jhe,She]=pu(Wo),RB=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:x,required:g,form:j}=e,b=vg(t),[y,S]=v.useState(null),[C,N]=v.useState(null),[E,_]=v.useState(!1),P=uu(f),[O,R]=la({prop:r,defaultProp:a??!1,onChange:i,caller:Wo}),[L,T]=la({prop:o,defaultProp:c,onChange:d,caller:Wo}),D=v.useRef(null),M=y?j||!!y.closest("form"):!0,[G,B]=v.useState(new Set),W=Array.from(G).map(q=>q.props.value).join(";");return s.jsx(nv,{...b,children:s.jsxs(whe,{required:g,scope:t,trigger:y,onTriggerChange:S,valueNode:C,onValueNodeChange:N,valueNodeHasChildren:E,onValueNodeHasChildrenChange:_,contentId:er(),value:L,onValueChange:T,open:O,onOpenChange:R,dir:P,triggerPointerDownPosRef:D,disabled:x,children:[s.jsx(hg.Provider,{scope:t,children:s.jsx(jhe,{scope:e.__scopeSelect,onNativeOptionAdd:v.useCallback(q=>{B(V=>new Set(V).add(q))},[]),onNativeOptionRemove:v.useCallback(q=>{B(V=>{const F=new Set(V);return F.delete(q),F})},[]),children:n})}),M?s.jsxs(nz,{"aria-hidden":!0,required:g,tabIndex:-1,name:h,autoComplete:p,value:L,onChange:q=>T(q.target.value),disabled:x,form:j,children:[L===void 0?s.jsx("option",{value:""}):null,Array.from(G)]},W):null]})})};RB.displayName=Wo;var TB="SelectTrigger",IB=v.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=vg(n),o=no(TB,n),c=o.disabled||r,d=xt(t,o.onTriggerChange),f=mg(n),h=v.useRef("touch"),[p,x,g]=az(b=>{const y=f().filter(N=>!N.disabled),S=y.find(N=>N.value===o.value),C=sz(y,b,S);C!==void 0&&o.onValueChange(C.value)}),j=b=>{c||(o.onOpenChange(!0),g()),b&&(o.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return s.jsx(yf,{asChild:!0,...i,children:s.jsx(Ge.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":rz(o.value)?"":void 0,...a,ref:d,onClick:Ie(a.onClick,b=>{b.currentTarget.focus(),h.current!=="mouse"&&j(b)}),onPointerDown:Ie(a.onPointerDown,b=>{h.current=b.pointerType;const y=b.target;y.hasPointerCapture(b.pointerId)&&y.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(j(b),b.preventDefault())}),onKeyDown:Ie(a.onKeyDown,b=>{const y=p.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&x(b.key),!(y&&b.key===" ")&&xhe.includes(b.key)&&(j(),b.preventDefault())})})})});IB.displayName=TB;var MB="SelectValue",$B=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:o="",...c}=e,d=no(MB,n),{onValueNodeHasChildrenChange:f}=d,h=i!==void 0,p=xt(t,d.onValueNodeChange);return tr(()=>{f(h)},[f,h]),s.jsx(Ge.span,{...c,ref:p,style:{pointerEvents:"none"},children:rz(d.value)?s.jsx(s.Fragment,{children:o}):i})});$B.displayName=MB;var Nhe="SelectIcon",DB=v.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return s.jsx(Ge.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});DB.displayName=Nhe;var Che="SelectPortal",LB=e=>s.jsx(Yc,{asChild:!0,...e});LB.displayName=Che;var Vo="SelectContent",FB=v.forwardRef((e,t)=>{const n=no(Vo,e.__scopeSelect),[r,a]=v.useState();if(tr(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?Gc.createPortal(s.jsx(BB,{scope:e.__scopeSelect,children:s.jsx(hg.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),i):null}return s.jsx(zB,{...e,ref:t})});FB.displayName=Vo;var Ba=10,[BB,ro]=pu(Vo),Ahe="SelectContentImpl",_he=fhe("SelectContent.RemoveScroll"),zB=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:x,collisionPadding:g,sticky:j,hideWhenDetached:b,avoidCollisions:y,...S}=e,C=no(Vo,n),[N,E]=v.useState(null),[_,P]=v.useState(null),O=xt(t,le=>E(le)),[R,L]=v.useState(null),[T,D]=v.useState(null),M=mg(n),[G,B]=v.useState(!1),W=v.useRef(!1);v.useEffect(()=>{if(N)return gv(N)},[N]),mv();const q=v.useCallback(le=>{const[me,...oe]=M().map(ae=>ae.ref.current),[fe]=oe.slice(-1),Ce=document.activeElement;for(const ae of le)if(ae===Ce||(ae?.scrollIntoView({block:"nearest"}),ae===me&&_&&(_.scrollTop=0),ae===fe&&_&&(_.scrollTop=_.scrollHeight),ae?.focus(),document.activeElement!==Ce))return},[M,_]),V=v.useCallback(()=>q([R,N]),[q,R,N]);v.useEffect(()=>{G&&V()},[G,V]);const{onOpenChange:F,triggerPointerDownPosRef:U}=C;v.useEffect(()=>{if(N){let le={x:0,y:0};const me=fe=>{le={x:Math.abs(Math.round(fe.pageX)-(U.current?.x??0)),y:Math.abs(Math.round(fe.pageY)-(U.current?.y??0))}},oe=fe=>{le.x<=10&&le.y<=10?fe.preventDefault():N.contains(fe.target)||F(!1),document.removeEventListener("pointermove",me),U.current=null};return U.current!==null&&(document.addEventListener("pointermove",me),document.addEventListener("pointerup",oe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",me),document.removeEventListener("pointerup",oe,{capture:!0})}}},[N,F,U]),v.useEffect(()=>{const le=()=>F(!1);return window.addEventListener("blur",le),window.addEventListener("resize",le),()=>{window.removeEventListener("blur",le),window.removeEventListener("resize",le)}},[F]);const[Z,z]=az(le=>{const me=M().filter(Ce=>!Ce.disabled),oe=me.find(Ce=>Ce.ref.current===document.activeElement),fe=sz(me,le,oe);fe&&setTimeout(()=>fe.ref.current.focus())}),$=v.useCallback((le,me,oe)=>{const fe=!W.current&&!oe;(C.value!==void 0&&C.value===me||fe)&&(L(le),fe&&(W.current=!0))},[C.value]),te=v.useCallback(()=>N?.focus(),[N]),se=v.useCallback((le,me,oe)=>{const fe=!W.current&&!oe;(C.value!==void 0&&C.value===me||fe)&&D(le)},[C.value]),Q=r==="popper"?TS:UB,ce=Q===TS?{side:c,sideOffset:d,align:f,alignOffset:h,arrowPadding:p,collisionBoundary:x,collisionPadding:g,sticky:j,hideWhenDetached:b,avoidCollisions:y}:{};return s.jsx(BB,{scope:n,content:N,viewport:_,onViewportChange:P,itemRefCallback:$,selectedItem:R,onItemLeave:te,itemTextRefCallback:se,focusSelectedItem:V,selectedItemText:T,position:r,isPositioned:G,searchRef:Z,children:s.jsx(wf,{as:_he,allowPinchZoom:!0,children:s.jsx(bf,{asChild:!0,trapped:C.open,onMountAutoFocus:le=>{le.preventDefault()},onUnmountAutoFocus:Ie(a,le=>{C.trigger?.focus({preventScroll:!0}),le.preventDefault()}),children:s.jsx(Zo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:le=>le.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:s.jsx(Q,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:le=>le.preventDefault(),...S,...ce,onPlaced:()=>B(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:Ie(S.onKeyDown,le=>{const me=le.ctrlKey||le.altKey||le.metaKey;if(le.key==="Tab"&&le.preventDefault(),!me&&le.key.length===1&&z(le.key),["ArrowUp","ArrowDown","Home","End"].includes(le.key)){let fe=M().filter(Ce=>!Ce.disabled).map(Ce=>Ce.ref.current);if(["ArrowUp","End"].includes(le.key)&&(fe=fe.slice().reverse()),["ArrowUp","ArrowDown"].includes(le.key)){const Ce=le.target,ae=fe.indexOf(Ce);fe=fe.slice(ae+1)}setTimeout(()=>q(fe)),le.preventDefault()}})})})})})})});zB.displayName=Ahe;var Ehe="SelectItemAlignedPosition",UB=v.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=no(Vo,n),o=ro(Vo,n),[c,d]=v.useState(null),[f,h]=v.useState(null),p=xt(t,O=>h(O)),x=mg(n),g=v.useRef(!1),j=v.useRef(!0),{viewport:b,selectedItem:y,selectedItemText:S,focusSelectedItem:C}=o,N=v.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&f&&b&&y&&S){const O=i.trigger.getBoundingClientRect(),R=f.getBoundingClientRect(),L=i.valueNode.getBoundingClientRect(),T=S.getBoundingClientRect();if(i.dir!=="rtl"){const Ce=T.left-R.left,ae=L.left-Ce,Re=O.left-ae,Ae=O.width+Re,Te=Math.max(Ae,R.width),be=window.innerWidth-Ba,_e=hf(ae,[Ba,Math.max(Ba,be-Te)]);c.style.minWidth=Ae+"px",c.style.left=_e+"px"}else{const Ce=R.right-T.right,ae=window.innerWidth-L.right-Ce,Re=window.innerWidth-O.right-ae,Ae=O.width+Re,Te=Math.max(Ae,R.width),be=window.innerWidth-Ba,_e=hf(ae,[Ba,Math.max(Ba,be-Te)]);c.style.minWidth=Ae+"px",c.style.right=_e+"px"}const D=x(),M=window.innerHeight-Ba*2,G=b.scrollHeight,B=window.getComputedStyle(f),W=parseInt(B.borderTopWidth,10),q=parseInt(B.paddingTop,10),V=parseInt(B.borderBottomWidth,10),F=parseInt(B.paddingBottom,10),U=W+q+G+F+V,Z=Math.min(y.offsetHeight*5,U),z=window.getComputedStyle(b),$=parseInt(z.paddingTop,10),te=parseInt(z.paddingBottom,10),se=O.top+O.height/2-Ba,Q=M-se,ce=y.offsetHeight/2,le=y.offsetTop+ce,me=W+q+le,oe=U-me;if(me<=se){const Ce=D.length>0&&y===D[D.length-1].ref.current;c.style.bottom="0px";const ae=f.clientHeight-b.offsetTop-b.offsetHeight,Re=Math.max(Q,ce+(Ce?te:0)+ae+V),Ae=me+Re;c.style.height=Ae+"px"}else{const Ce=D.length>0&&y===D[0].ref.current;c.style.top="0px";const Re=Math.max(se,W+b.offsetTop+(Ce?$:0)+ce)+oe;c.style.height=Re+"px",b.scrollTop=me-se+b.offsetTop}c.style.margin=`${Ba}px 0`,c.style.minHeight=Z+"px",c.style.maxHeight=M+"px",r?.(),requestAnimationFrame(()=>g.current=!0)}},[x,i.trigger,i.valueNode,c,f,b,y,S,i.dir,r]);tr(()=>N(),[N]);const[E,_]=v.useState();tr(()=>{f&&_(window.getComputedStyle(f).zIndex)},[f]);const P=v.useCallback(O=>{O&&j.current===!0&&(N(),C?.(),j.current=!1)},[N,C]);return s.jsx(khe,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:g,onScrollButtonChange:P,children:s.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:s.jsx(Ge.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});UB.displayName=Ehe;var Phe="SelectPopperPosition",TS=v.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=Ba,...i}=e,o=vg(n);return s.jsx(rv,{...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)"}})});TS.displayName=Phe;var[khe,IC]=pu(Vo,{}),IS="SelectViewport",qB=v.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=ro(IS,n),o=IC(IS,n),c=xt(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(hg.Slot,{scope:n,children:s.jsx(Ge.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Ie(a.onScroll,f=>{const h=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:x}=o;if(x?.current&&p){const g=Math.abs(d.current-h.scrollTop);if(g>0){const j=window.innerHeight-Ba*2,b=parseFloat(p.style.minHeight),y=parseFloat(p.style.height),S=Math.max(b,y);if(S<j){const C=S+g,N=Math.min(j,C),E=C-N;p.style.height=N+"px",p.style.bottom==="0px"&&(h.scrollTop=E>0?E:0,p.style.justifyContent="flex-end")}}}d.current=h.scrollTop})})})]})});qB.displayName=IS;var WB="SelectGroup",[Ohe,Rhe]=pu(WB),The=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=er();return s.jsx(Ohe,{scope:n,id:a,children:s.jsx(Ge.div,{role:"group","aria-labelledby":a,...r,ref:t})})});The.displayName=WB;var VB="SelectLabel",HB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Rhe(VB,n);return s.jsx(Ge.div,{id:a.id,...r,ref:t})});HB.displayName=VB;var zm="SelectItem",[Ihe,KB]=pu(zm),GB=v.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...o}=e,c=no(zm,n),d=ro(zm,n),f=c.value===r,[h,p]=v.useState(i??""),[x,g]=v.useState(!1),j=xt(t,C=>d.itemRefCallback?.(C,r,a)),b=er(),y=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(Ihe,{scope:n,value:r,disabled:a,textId:b,isSelected:f,onItemTextChange:v.useCallback(C=>{p(N=>N||(C?.textContent??"").trim())},[]),children:s.jsx(hg.ItemSlot,{scope:n,value:r,disabled:a,textValue:h,children:s.jsx(Ge.div,{role:"option","aria-labelledby":b,"data-highlighted":x?"":void 0,"aria-selected":f&&x,"data-state":f?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...o,ref:j,onFocus:Ie(o.onFocus,()=>g(!0)),onBlur:Ie(o.onBlur,()=>g(!1)),onClick:Ie(o.onClick,()=>{y.current!=="mouse"&&S()}),onPointerUp:Ie(o.onPointerUp,()=>{y.current==="mouse"&&S()}),onPointerDown:Ie(o.onPointerDown,C=>{y.current=C.pointerType}),onPointerMove:Ie(o.onPointerMove,C=>{y.current=C.pointerType,a?d.onItemLeave?.():y.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ie(o.onPointerLeave,C=>{C.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Ie(o.onKeyDown,C=>{d.searchRef?.current!==""&&C.key===" "||(yhe.includes(C.key)&&S(),C.key===" "&&C.preventDefault())})})})})});GB.displayName=zm;var dd="SelectItemText",YB=v.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,o=no(dd,n),c=ro(dd,n),d=KB(dd,n),f=She(dd,n),[h,p]=v.useState(null),x=xt(t,S=>p(S),d.onItemTextChange,S=>c.itemTextRefCallback?.(S,d.value,d.disabled)),g=h?.textContent,j=v.useMemo(()=>s.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:b,onNativeOptionRemove:y}=f;return tr(()=>(b(j),()=>y(j)),[b,y,j]),s.jsxs(s.Fragment,{children:[s.jsx(Ge.span,{id:d.textId,...i,ref:x}),d.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Gc.createPortal(i.children,o.valueNode):null]})});YB.displayName=dd;var XB="SelectItemIndicator",QB=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return KB(XB,n).isSelected?s.jsx(Ge.span,{"aria-hidden":!0,...r,ref:t}):null});QB.displayName=XB;var MS="SelectScrollUpButton",JB=v.forwardRef((e,t)=>{const n=ro(MS,e.__scopeSelect),r=IC(MS,e.__scopeSelect),[a,i]=v.useState(!1),o=xt(t,r.onScrollButtonChange);return tr(()=>{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(ez,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop-d.offsetHeight)}}):null});JB.displayName=MS;var $S="SelectScrollDownButton",ZB=v.forwardRef((e,t)=>{const n=ro($S,e.__scopeSelect),r=IC($S,e.__scopeSelect),[a,i]=v.useState(!1),o=xt(t,r.onScrollButtonChange);return tr(()=>{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(ez,{...e,ref:o,onAutoScroll:()=>{const{viewport:c,selectedItem:d}=n;c&&d&&(c.scrollTop=c.scrollTop+d.offsetHeight)}}):null});ZB.displayName=$S;var ez=v.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=ro("SelectScrollButton",n),o=v.useRef(null),c=mg(n),d=v.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return v.useEffect(()=>()=>d(),[d]),tr(()=>{c().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),s.jsx(Ge.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Ie(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Ie(a.onPointerMove,()=>{i.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Ie(a.onPointerLeave,()=>{d()})})}),Mhe="SelectSeparator",tz=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(Ge.div,{"aria-hidden":!0,...r,ref:t})});tz.displayName=Mhe;var DS="SelectArrow",$he=v.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=vg(n),i=no(DS,n),o=ro(DS,n);return i.open&&o.position==="popper"?s.jsx(av,{...a,...r,ref:t}):null});$he.displayName=DS;var Dhe="SelectBubbleInput",nz=v.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=v.useRef(null),i=xt(r,a),o=ug(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(Ge.select,{...n,style:{...i$,...n.style},ref:i,defaultValue:t})});nz.displayName=Dhe;function rz(e){return e===""||e===void 0}function az(e){const t=Un(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 sz(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=Lhe(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 Lhe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Fhe=RB,iz=IB,Bhe=$B,zhe=DB,Uhe=LB,oz=FB,qhe=qB,lz=HB,cz=GB,Whe=YB,Vhe=QB,uz=JB,dz=ZB,fz=tz;const Pn=Fhe,kn=Bhe,An=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(iz,{ref:r,className:je("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(zhe,{asChild:!0,children:s.jsx(Wt,{className:"h-4 w-4 opacity-50"})})]}));An.displayName=iz.displayName;const pz=v.forwardRef(({className:e,...t},n)=>s.jsx(uz,{ref:n,className:je("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(hs,{className:"h-4 w-4"})}));pz.displayName=uz.displayName;const hz=v.forwardRef(({className:e,...t},n)=>s.jsx(dz,{ref:n,className:je("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Wt,{className:"h-4 w-4"})}));hz.displayName=dz.displayName;const _n=v.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>s.jsx(Uhe,{children:s.jsxs(oz,{ref:a,className:je("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(pz,{}),s.jsx(qhe,{className:je("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(hz,{})]})}));_n.displayName=oz.displayName;const Hhe=v.forwardRef(({className:e,...t},n)=>s.jsx(lz,{ref:n,className:je("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Hhe.displayName=lz.displayName;const dt=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(cz,{ref:r,className:je("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(Vhe,{children:s.jsx(mc,{className:"h-4 w-4"})})}),s.jsx(Whe,{children:t})]}));dt.displayName=cz.displayName;const Khe=v.forwardRef(({className:e,...t},n)=>s.jsx(fz,{ref:n,className:je("-mx-1 my-1 h-px bg-muted",e),...t}));Khe.displayName=fz.displayName;var gg="Collapsible",[Ghe]=mr(gg),[Yhe,MC]=Ghe(gg),mz=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:i,onOpenChange:o,...c}=e,[d,f]=la({prop:r,defaultProp:a??!1,onChange:o,caller:gg});return s.jsx(Yhe,{scope:n,disabled:i,contentId:er(),open:d,onOpenToggle:v.useCallback(()=>f(h=>!h),[f]),children:s.jsx(Ge.div,{"data-state":DC(d),"data-disabled":i?"":void 0,...c,ref:t})})});mz.displayName=gg;var vz="CollapsibleTrigger",gz=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,a=MC(vz,n);return s.jsx(Ge.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":DC(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:t,onClick:Ie(e.onClick,a.onOpenToggle)})});gz.displayName=vz;var $C="CollapsibleContent",xz=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=MC($C,e.__scopeCollapsible);return s.jsx(nr,{present:n||a.open,children:({present:i})=>s.jsx(Xhe,{...r,ref:t,present:i})})});xz.displayName=$C;var Xhe=v.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:a,...i}=e,o=MC($C,n),[c,d]=v.useState(r),f=v.useRef(null),h=xt(t,f),p=v.useRef(0),x=p.current,g=v.useRef(0),j=g.current,b=o.open||c,y=v.useRef(b),S=v.useRef(void 0);return v.useEffect(()=>{const C=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(C)},[]),tr(()=>{const C=f.current;if(C){S.current=S.current||{transitionDuration:C.style.transitionDuration,animationName:C.style.animationName},C.style.transitionDuration="0s",C.style.animationName="none";const N=C.getBoundingClientRect();p.current=N.height,g.current=N.width,y.current||(C.style.transitionDuration=S.current.transitionDuration,C.style.animationName=S.current.animationName),d(r)}},[o.open,r]),s.jsx(Ge.div,{"data-state":DC(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!b,...i,ref:h,style:{"--radix-collapsible-content-height":x?`${x}px`:void 0,"--radix-collapsible-content-width":j?`${j}px`:void 0,...e.style},children:b&&a})});function DC(e){return e?"open":"closed"}var Qhe=mz;const Di=Qhe,Ws=gz,Li=xz,Jhe=yv,Zhe=bv,yz=v.forwardRef(({className:e,...t},n)=>s.jsx(tu,{ref:n,className:je("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}));yz.displayName=tu.displayName;const bz=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(Zhe,{children:[s.jsx(yz,{}),s.jsxs(nu,{ref:r,className:je("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(wv,{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(ws,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));bz.displayName=nu.displayName;const wz=({className:e,...t})=>s.jsx("div",{className:je("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});wz.displayName="DialogHeader";const jz=v.forwardRef(({className:e,...t},n)=>s.jsx(jf,{ref:n,className:je("text-lg font-semibold leading-none tracking-tight",e),...t}));jz.displayName=jf.displayName;const Sz=v.forwardRef(({className:e,...t},n)=>s.jsx(Sf,{ref:n,className:je("text-sm text-muted-foreground",e),...t}));Sz.displayName=Sf.displayName;function eme(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var LC="ScrollArea",[Nz]=mr(LC),[tme,Oa]=Nz(LC),Cz=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,x]=v.useState(null),[g,j]=v.useState(null),[b,y]=v.useState(null),[S,C]=v.useState(0),[N,E]=v.useState(0),[_,P]=v.useState(!1),[O,R]=v.useState(!1),L=xt(t,D=>d(D)),T=uu(a);return s.jsx(tme,{scope:n,type:r,dir:T,scrollHideDelay:i,scrollArea:c,viewport:f,onViewportChange:h,content:p,onContentChange:x,scrollbarX:g,onScrollbarXChange:j,scrollbarXEnabled:_,onScrollbarXEnabledChange:P,scrollbarY:b,onScrollbarYChange:y,scrollbarYEnabled:O,onScrollbarYEnabledChange:R,onCornerWidthChange:C,onCornerHeightChange:E,children:s.jsx(Ge.div,{dir:T,...o,ref:L,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":N+"px",...e.style}})})});Cz.displayName=LC;var Az="ScrollAreaViewport",_z=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...i}=e,o=Oa(Az,n),c=v.useRef(null),d=xt(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(Ge.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})})]})});_z.displayName=Az;var ks="ScrollAreaScrollbar",FC=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Oa(ks,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(nme,{...r,ref:t,forceMount:n}):a.type==="scroll"?s.jsx(rme,{...r,ref:t,forceMount:n}):a.type==="auto"?s.jsx(Ez,{...r,ref:t,forceMount:n}):a.type==="always"?s.jsx(BC,{...r,ref:t}):null});FC.displayName=ks;var nme=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Oa(ks,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(nr,{present:n||i,children:s.jsx(Ez,{"data-state":i?"visible":"hidden",...r,ref:t})})}),rme=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Oa(ks,e.__scopeScrollArea),i=e.orientation==="horizontal",o=yg(()=>d("SCROLL_END"),100),[c,d]=eme("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 x=()=>{const g=f[h];p!==g&&(d("SCROLL"),o()),p=g};return f.addEventListener("scroll",x),()=>f.removeEventListener("scroll",x)}},[a.viewport,i,d,o]),s.jsx(nr,{present:n||c!=="hidden",children:s.jsx(BC,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ie(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Ie(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),Ez=v.forwardRef((e,t)=>{const n=Oa(ks,e.__scopeScrollArea),{forceMount:r,...a}=e,[i,o]=v.useState(!1),c=e.orientation==="horizontal",d=yg(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;o(c?f:h)}},10);return Wc(n.viewport,d),Wc(n.content,d),s.jsx(nr,{present:r||i,children:s.jsx(BC,{"data-state":i?"visible":"hidden",...a,ref:t})})}),BC=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,a=Oa(ks,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=Tz(c.viewport,c.content),h={...r,sizes:c,onSizesChange:d,hasThumb:f>0&&f<1,onThumbChange:x=>i.current=x,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:x=>o.current=x};function p(x,g){return cme(x,o.current,c,g)}return n==="horizontal"?s.jsx(ame,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const x=a.viewport.scrollLeft,g=CM(x,c,a.dir);i.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:x=>{a.viewport&&(a.viewport.scrollLeft=x)},onDragScroll:x=>{a.viewport&&(a.viewport.scrollLeft=p(x,a.dir))}}):n==="vertical"?s.jsx(sme,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const x=a.viewport.scrollTop,g=CM(x,c);i.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:x=>{a.viewport&&(a.viewport.scrollTop=x)},onDragScroll:x=>{a.viewport&&(a.viewport.scrollTop=p(x))}}):null}),ame=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=Oa(ks,e.__scopeScrollArea),[o,c]=v.useState(),d=v.useRef(null),f=xt(t,d,i.onScrollbarXChange);return v.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),s.jsx(kz,{"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":xg(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,p)=>{if(i.viewport){const x=i.viewport.scrollLeft+h.deltaX;e.onWheelScroll(x),Mz(x,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:qm(o.paddingLeft),paddingEnd:qm(o.paddingRight)}})}})}),sme=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=Oa(ks,e.__scopeScrollArea),[o,c]=v.useState(),d=v.useRef(null),f=xt(t,d,i.onScrollbarYChange);return v.useEffect(()=>{d.current&&c(getComputedStyle(d.current))},[d]),s.jsx(kz,{"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":xg(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,p)=>{if(i.viewport){const x=i.viewport.scrollTop+h.deltaY;e.onWheelScroll(x),Mz(x,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:qm(o.paddingTop),paddingEnd:qm(o.paddingBottom)}})}})}),[ime,Pz]=Nz(ks),kz=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,...x}=e,g=Oa(ks,n),[j,b]=v.useState(null),y=xt(t,L=>b(L)),S=v.useRef(null),C=v.useRef(""),N=g.viewport,E=r.content-r.viewport,_=Un(h),P=Un(d),O=yg(p,10);function R(L){if(S.current){const T=L.clientX-S.current.left,D=L.clientY-S.current.top;f({x:T,y:D})}}return v.useEffect(()=>{const L=T=>{const D=T.target;j?.contains(D)&&_(T,E)};return document.addEventListener("wheel",L,{passive:!1}),()=>document.removeEventListener("wheel",L,{passive:!1})},[N,j,E,_]),v.useEffect(P,[r,P]),Wc(j,O),Wc(g.content,O),s.jsx(ime,{scope:n,scrollbar:j,hasThumb:a,onThumbChange:Un(i),onThumbPointerUp:Un(o),onThumbPositionChange:P,onThumbPointerDown:Un(c),children:s.jsx(Ge.div,{...x,ref:y,style:{position:"absolute",...x.style},onPointerDown:Ie(e.onPointerDown,L=>{L.button===0&&(L.target.setPointerCapture(L.pointerId),S.current=j.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),R(L))}),onPointerMove:Ie(e.onPointerMove,R),onPointerUp:Ie(e.onPointerUp,L=>{const T=L.target;T.hasPointerCapture(L.pointerId)&&T.releasePointerCapture(L.pointerId),document.body.style.webkitUserSelect=C.current,g.viewport&&(g.viewport.style.scrollBehavior=""),S.current=null})})})}),Um="ScrollAreaThumb",Oz=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Pz(Um,e.__scopeScrollArea);return s.jsx(nr,{present:n||a.hasThumb,children:s.jsx(ome,{ref:t,...r})})}),ome=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,i=Oa(Um,n),o=Pz(Um,n),{onThumbPositionChange:c}=o,d=xt(t,p=>o.onThumbChange(p)),f=v.useRef(void 0),h=yg(()=>{f.current&&(f.current(),f.current=void 0)},100);return v.useEffect(()=>{const p=i.viewport;if(p){const x=()=>{if(h(),!f.current){const g=ume(p,c);f.current=g,c()}};return c(),p.addEventListener("scroll",x),()=>p.removeEventListener("scroll",x)}},[i.viewport,h,c]),s.jsx(Ge.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:Ie(e.onPointerDownCapture,p=>{const g=p.target.getBoundingClientRect(),j=p.clientX-g.left,b=p.clientY-g.top;o.onThumbPointerDown({x:j,y:b})}),onPointerUp:Ie(e.onPointerUp,o.onThumbPointerUp)})});Oz.displayName=Um;var zC="ScrollAreaCorner",Rz=v.forwardRef((e,t)=>{const n=Oa(zC,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(lme,{...e,ref:t}):null});Rz.displayName=zC;var lme=v.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=Oa(zC,n),[i,o]=v.useState(0),[c,d]=v.useState(0),f=!!(i&&c);return Wc(a.scrollbarX,()=>{const h=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(h),d(h)}),Wc(a.scrollbarY,()=>{const h=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(h),o(h)}),f?s.jsx(Ge.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 qm(e){return e?parseInt(e,10):0}function Tz(e,t){const n=e/t;return isNaN(n)?0:n}function xg(e){const t=Tz(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function cme(e,t,n,r="ltr"){const a=xg(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 Iz([d,f],p)(e)}function CM(e,t,n="ltr"){const r=xg(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=hf(e,d);return Iz([0,o],[0,c])(f)}function Iz(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 Mz(e,t){return e>0&&e<t}var ume=(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 yg(e,t){const n=Un(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 Wc(e,t){const n=Un(t);tr(()=>{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 $z=Cz,dme=_z,fme=Rz;const Wm=v.forwardRef(({className:e,children:t,...n},r)=>s.jsxs($z,{ref:r,className:je("relative overflow-hidden",e),...n,children:[s.jsx(dme,{className:"h-full w-full rounded-[inherit]",children:t}),s.jsx(Dz,{}),s.jsx(fme,{})]}));Wm.displayName=$z.displayName;const Dz=v.forwardRef(({className:e,orientation:t="vertical",...n},r)=>s.jsx(FC,{ref:r,orientation:t,className:je("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(Oz,{className:"relative flex-1 rounded-full bg-border"})}));Dz.displayName=FC.displayName;const pme=[{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 hme({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}=qn(),[x,g]=v.useState(null),[j,b]=v.useState(null),[y,S]=v.useState(""),[C,N]=v.useState(!1),[E,_]=v.useState(new Set),P=v.useRef(null),O=v.useRef(null),R=v.useRef(null),[L,T]=v.useState(!1),D=v.useRef(!1),M=d||i[0]?.id||"";v.useEffect(()=>{if(!e||!M||x)return;let Q=!1;return N(!0),p.createScenarioAssistantSession({configId:n,configPath:r,scenarioId:a.id,selectedAssistantAgentName:M,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,evalRules:a.evalRules,extractRules:a.extractRules,snapshotEval:a.snapshotEval?{enabled:a.snapshotEval.enabled,baselineSnapshotId:a.snapshotEval.baselineSnapshotId}:void 0},availableServers:o.map(ce=>({name:ce.name||ce.id,url:ce.url})),availableAgents:i.map(ce=>({name:ce.name||ce.id,provider:ce.provider,model:ce.model}))}}).then(ce=>{Q||(g(ce.sessionId),b(ce.session))}).catch(ce=>{Q||Pe({title:"Could not start Scenario Assistant",description:ce instanceof Error?ce.message:String(ce),variant:"destructive"})}).finally(()=>{Q||N(!1)}),()=>{Q=!0}},[e,p,x,n,r,a,c,i,o,M]);const G=()=>{g(null),b(null),S(""),_(new Set),R.current=null},B=Q=>{G(),p.closeScenarioAssistantSession(Q).catch(()=>{})};v.useEffect(()=>{e||x&&(D.current||L||B(x))},[e,x,p,L]),v.useEffect(()=>()=>{x&&p.closeScenarioAssistantSession(x).catch(()=>{})},[x,p]),v.useEffect(()=>{if(!e)return;L&&T(!1),D.current&&(D.current=!1);const Q=window.setTimeout(()=>{P.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(Q)},[e,C,j?.messages.length,j?.pendingToolCalls.length,j?.warnings.length]),v.useEffect(()=>{const Q=O.current;if(!Q)return;Q.style.height="0px";const ce=Math.min(Q.scrollHeight,160);Q.style.height=`${Math.max(40,ce)}px`},[y,e]);const W=i.length>0&&a.serverIds.length>0&&!!M,q=async Q=>{if(!x)return;const ce=Q.trim();if(!ce)return;const le=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,me={id:le,role:"user",text:ce,createdAt:new Date().toISOString()};b(oe=>oe&&{...oe,messages:[...oe.messages,me]}),S(""),N(!0);try{const oe=await p.sendScenarioAssistantMessage(x,ce);b(oe.session)}catch(oe){b(fe=>fe&&{...fe,messages:fe.messages.filter(Ce=>Ce.id!==le)}),S(fe=>fe.trim()?fe:ce),Pe({title:"Scenario Assistant error",description:oe instanceof Error?oe.message:String(oe),variant:"destructive"})}finally{N(!1)}},V=Q=>{S(Q),requestAnimationFrame(()=>O.current?.focus())};v.useEffect(()=>{if(!e||!x||!j||!W||C)return;const Q=String(f??"").trim();Q&&R.current!==Q&&(R.current=Q,q(Q))},[e,x,j,W,C,f]);const F=async Q=>{if(x){N(!0);try{const ce=await p.approveScenarioAssistantToolCall(x,Q);b(ce.session)}catch(ce){Pe({title:"Tool call failed",description:ce instanceof Error?ce.message:String(ce),variant:"destructive"})}finally{N(!1)}}},U=async Q=>{if(x){N(!0);try{const ce=await p.denyScenarioAssistantToolCall(x,Q);b(ce.session)}catch(ce){Pe({title:"Could not deny tool call",description:ce instanceof Error?ce.message:String(ce),variant:"destructive"})}finally{N(!1)}}},Z=async()=>{if(x){N(!0);try{const Q=await p.approveAllScenarioAssistantToolCalls(x);b(Q.session)}catch(Q){Pe({title:"Could not approve all tool calls",description:Q instanceof Error?Q.message:String(Q),variant:"destructive"})}finally{N(!1)}}},z=(Q,ce,le)=>{if(!ce)return;if(le==="prompt"&&ce.prompt&&h({prompt:ce.prompt.replacement}),le==="evalRules"&&ce.evalRules&&h({evalRules:ce.evalRules.replacement}),le==="extractRules"&&ce.extractRules&&h({extractRules:ce.extractRules.replacement}),le==="snapshotEval"&&ce.snapshotEval&&h({snapshotEval:{enabled:ce.snapshotEval.patch.enabled,baselineSnapshotId:ce.snapshotEval.patch.baselineSnapshotId}}),Q){const oe=`${Q}:${le}`;_(fe=>new Set([...fe,oe]))}Pe({title:"Applied suggestion",description:`Updated ${{prompt:"Prompt",evalRules:"Checks",extractRules:"Value Capture Rules",snapshotEval:"Snapshot Settings"}[le]}`})},$=Q=>{Q||(T(!1),D.current=!1),t(Q)},te=()=>{D.current=!0,T(!0),t(!1)},se=()=>{D.current=!1,T(!1),x&&B(x)};return s.jsxs(s.Fragment,{children:[!e&&x&&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(re,{type:"button",size:"sm",variant:"outline",onClick:()=>t(!0),children:[s.jsx(ba,{className:"mr-1.5 h-3.5 w-3.5"}),"Resume"]}),s.jsx(re,{type:"button",size:"sm",variant:"ghost",className:"h-8 px-2 text-muted-foreground",onClick:se,"aria-label":"Discard assistant session",title:"Discard assistant session",children:s.jsx(ws,{className:"h-4 w-4"})})]})]}),s.jsx(Jhe,{open:e,onOpenChange:$,children:s.jsxs(bz,{className:"max-w-6xl h-[85vh] flex flex-col",children:[x&&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:te,"aria-label":"Minimize assistant",title:"Minimize assistant",children:[s.jsx(J7,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Minimize"})]}),s.jsx(wz,{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(jz,{className:"flex items-center gap-2",children:[s.jsx(ba,{className:"h-4 w-4"}),"Scenario Assistant"]}),s.jsx(Sz,{children:"LLM-guided scenario authoring with MCP tool introspection and per-tool-call approval."})]})})}),W?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(Fe,{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(us,{className:"h-3.5 w-3.5"}),j?`Loaded ${j.toolsLoaded} tools`:"Preparing..."]})]})}),s.jsx(Wm,{className:"min-h-0 flex-1 rounded-md border p-3",children:s.jsxs("div",{className:"space-y-3",children:[j?.warnings?.map((Q,ce)=>s.jsx("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900",children:Q},`${Q}-${ce}`)),j?.messages.map(Q=>s.jsxs(v.Fragment,{children:[(()=>{const ce=Q.pendingToolCallIds??(Q.pendingToolCallId?[Q.pendingToolCallId]:[]),le=ce.map(ae=>(j?.pendingToolCalls??[]).find(Re=>Re.id===ae)).filter(ae=>!!ae),me=ce.map(ae=>j.pendingToolCalls.find(Re=>Re.id===ae)??j.pendingToolCalls.find(Re=>Re.id===ae)).filter(Boolean);if(!(Q.role==="assistant"&&ce.length>0))return s.jsx("div",{className:"space-y-2",children:s.jsx(mme,{message:Q})});const fe=le.length,Ce=me.length-fe;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(Sa,{className:"h-3 w-3"})}),s.jsxs("div",{className:"w-full max-w-[92%] space-y-2",children:[s.jsx("div",{className:"rounded-md border border-border/60 bg-background px-3 py-2",children:s.jsx(LS,{text:Q.text,variant:"assistant"})}),me.length>1&&fe>0&&s.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border border-amber-200 bg-amber-50/50 px-3 py-1.5",children:[s.jsxs("span",{className:"text-xs text-amber-900",children:[Ce," of ",me.length," tool calls resolved"]}),s.jsxs(re,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:C,onClick:()=>{Z()},children:["Approve All (",fe,")"]})]}),me.map(ae=>{const Re=ae.status==="pending",Ae=ae.tool??ae.publicToolName??"unknown_tool";return s.jsxs("details",{open:Re,className:"group overflow-hidden 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 flex-1",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(us,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:`Tool call ${Ae}`}),s.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${Re?"bg-amber-100 text-amber-900":ae.status==="error"?"bg-red-100 text-red-900":ae.status==="denied"?"bg-gray-100 text-gray-700":"bg-muted text-muted-foreground"}`,children:Re?"Needs approval":ae.status==="error"?"Error":ae.status==="denied"?"Denied":"Approved"})]})}),s.jsx(Wt,{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("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(ae.arguments??{},null,2)})}),Re&&s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:C,onClick:()=>{U(ae.id)},children:"Deny"}),s.jsx(re,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:C,onClick:()=>{F(ae.id)},children:"Approve"})]})]})]},ae.id)})]})]})})(),Q.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(ba,{className:"h-3.5 w-3.5"}),"Structured Suggestions"]}),Q.suggestions.prompt&&s.jsx(vh,{title:"Prompt",rationale:Q.suggestions.prompt.rationale,preview:Q.suggestions.prompt.replacement,applied:E.has(`${Q.id}:prompt`),onApply:()=>z(Q.id,Q.suggestions,"prompt")}),Q.suggestions.evalRules&&s.jsx(vh,{title:"Checks",rationale:Q.suggestions.evalRules.rationale,preview:JSON.stringify(Q.suggestions.evalRules.replacement,null,2),applied:E.has(`${Q.id}:evalRules`),onApply:()=>z(Q.id,Q.suggestions,"evalRules")}),Q.suggestions.extractRules&&s.jsx(vh,{title:"Value Capture Rules",rationale:Q.suggestions.extractRules.rationale,preview:JSON.stringify(Q.suggestions.extractRules.replacement,null,2),applied:E.has(`${Q.id}:extractRules`),onApply:()=>z(Q.id,Q.suggestions,"extractRules")}),Q.suggestions.snapshotEval&&s.jsx(vh,{title:"Snapshot Settings",rationale:Q.suggestions.snapshotEval.rationale,preview:JSON.stringify(Q.suggestions.snapshotEval.patch,null,2),applied:E.has(`${Q.id}:snapshotEval`),onApply:()=>z(Q.id,Q.suggestions,"snapshotEval")}),(()=>{const ce=Q.suggestions?.notes,le=Array.isArray(ce)?ce:typeof ce=="string"?[ce]:[];return le.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:le.map((me,oe)=>s.jsx("li",{children:me},`${Q.id}-note-${oe}`))})]})})()]})]},Q.id)),(j?.pendingToolCalls??[]).filter(Q=>!(j?.messages??[]).some(ce=>ce.pendingToolCallId===Q.id||ce.pendingToolCallIds?.includes(Q.id))).map(Q=>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(us,{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:Q.publicToolName||Q.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(Wt,{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(Q.arguments??{},null,2)})}),s.jsxs("div",{className:"mt-2 flex justify-end gap-2",children:[s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:C,onClick:()=>{U(Q.id)},children:"Deny"}),s.jsx(re,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:C,onClick:()=>{F(Q.id)},children:"Approve"})]})]})]},Q.id)),!j&&C&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(hr,{className:"h-4 w-4 animate-spin"}),"Starting assistant session..."]}),j&&C&&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(Sa,{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(hr,{className:"h-4 w-4 animate-spin"}),"Thinking..."]})]}),s.jsx("div",{ref:P})]})}),s.jsxs("div",{className:"rounded-xl border bg-background p-2 shadow-sm",children:[s.jsx(Ha,{ref:O,value:y,onChange:Q=>S(Q.target.value),placeholder:"Get assistance with creating or refining this scenario ...",disabled:!x||C,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:Q=>{Q.key==="Enter"&&!Q.shiftKey&&(Q.preventDefault(),q(y))}}),s.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[s.jsxs(du,{children:[s.jsx(fu,{asChild:!0,children:s.jsxs(re,{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:!x||C,children:[s.jsx(bs,{className:"h-3 w-3"}),"Snippets",s.jsx(Wt,{className:"h-3 w-3"})]})}),s.jsxs(ul,{align:"start",className:"w-[320px]",children:[s.jsx(OC,{children:"Scenario Assistant Snippets"}),s.jsx(RC,{}),pme.map(Q=>s.jsx(Pr,{className:"items-start whitespace-normal px-2 py-2",onSelect:()=>V(Q.prompt),children:s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("div",{className:"text-xs font-medium leading-tight",children:Q.label}),s.jsx("div",{className:"text-[11px] leading-snug text-muted-foreground",children:Q.description})]})},Q.label))]})]}),s.jsx(re,{type:"button",size:"icon",className:"h-8 w-8 rounded-full",onClick:()=>{q(y)},disabled:!x||C||!y.trim(),"aria-label":"Send message",title:"Send message",children:C?s.jsx(hr,{className:"h-4 w-4 animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(D$,{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 vh({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(re,{type:"button",size:"sm",variant:r?"secondary":"outline",onClick:a,disabled:r,children:r?s.jsxs(s.Fragment,{children:[s.jsx(ac,{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 mme({message:e}){const t=async o=>{try{await navigator.clipboard.writeText(o),Pe({title:"Copied"})}catch(c){Pe({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(us,{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($$,{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(LS,{text:e.text,variant:"assistant"})})]});const r=n==="user",a=r?eN:Sa,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(LS,{text:e.text,variant:"assistant"})]}),i&&s.jsx(re,{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(ys,{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 LS({text:e,variant:t="assistant"}){const n=vme(e);return s.jsx("div",{className:je("space-y-2",t==="system"&&"text-xs"),children:n.map((r,a)=>s.jsx(v.Fragment,{children:gme(r,a,t)},`md-${a}`))})}function vme(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 x=c.replace(/^```/,"").trim()||void 0;r+=1;const g=[];for(;r<t.length&&!i(t[r]);)g.push(t[r]),r+=1;r<t.length&&i(t[r])&&(r+=1),n.push({type:"code",lang:x,code:g.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(AM(t,r)){const x=_M(t[r]);r+=2;const g=[];for(;r<t.length&&t[r].includes("|")&&!a(t[r]);)g.push(_M(t[r])),r+=1;n.push({type:"table",headers:x,rows:g});continue}const f=c.match(/^\d+\.\s+/),h=c.match(/^[-*+]\s+/);if(f||h){const x=!!f,g=[];for(;r<t.length;){const j=t[r].trim();if(x?/^\d+\.\s+/.test(j):/^[-*+]\s+/.test(j)){g.push(j.replace(x?/^\d+\.\s+/:/^[-*+]\s+/,"")),r+=1;continue}a(t[r])&&(r+=1);break}n.push({type:"list",ordered:x,items:g});continue}const p=[o];for(r+=1;r<t.length;){const x=t[r],g=x.trim();if(a(x)||i(x)||/^---+$/.test(g)||/^#{1,4}\s+/.test(g)||AM(t,r)||/^\d+\.\s+/.test(g)||/^[-*+]\s+/.test(g))break;p.push(x),r+=1}n.push({type:"paragraph",text:p.join(`
124
- `)})}return n}function AM(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 _M(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}function gme(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:sd(e.text,`${t}-h`)})}if(e.type==="paragraph")return s.jsx("p",{className:je("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:sd(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:je("space-y-1 pl-5",e.ordered?"list-decimal":"list-disc"),children:e.items.map((a,i)=>s.jsx("li",{className:"leading-relaxed",children:sd(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:sd(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:sd(i,`${t}-tdc-${a}-${o}`)},`${t}-td-${a}-${o}`))},`${t}-row-${a}`))})]})}):null}function sd(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 xme="mcplab.feature.";function bg(e,t=!1){if(typeof window>"u")return t;try{const n=window.localStorage.getItem(`${xme}${e}`);return n==null?t:n==="1"||n==="true"}catch{return t}}const yme=()=>({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:x=!p,allowStructureEdits:g=!p}){const j=(C,N)=>{const E=e.map((_,P)=>P===C?{..._,...N}:_);h(E)},b=C=>h(e.filter((N,E)=>E!==C)),y=()=>h([...e,yme()]),S=(C,N)=>{const E=C+N;if(E<0||E>=e.length)return;const _=[...e],[P]=_.splice(C,1);_.splice(E,0,P),h(_)};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"}),x&&g&&s.jsxs(re,{type:"button",variant:"outline",size:"sm",onClick:y,children:[s.jsx(bs,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Scenario"]})]}),e.map((C,N)=>s.jsx(bme,{scenario:C,scenarioOrigin:t?.[N],index:N,total:e.length,agents:n,servers:r,configId:a,configPath:i,defaultAssistantAgentName:o,assistantInitialPrompt:c?.[C.id],assistantAutoOpenNonce:d?.[C.id],snapshotEval:f,onUpdate:E=>j(N,E),onMoveUp:()=>S(N,-1),onMoveDown:()=>S(N,1),onRemove:()=>b(N),readOnly:p,allowStructureEdits:g},C.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 bme({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:x,onMoveUp:g,onMoveDown:j,onRemove:b,readOnly:y,allowStructureEdits:S}){const{source:C}=qn(),N=bg("snapshots",!1),[E,_]=v.useState("required_tool"),[P,O]=v.useState(""),[R,L]=v.useState(""),[T,D]=v.useState(null),[M,G]=v.useState(!1),[B,W]=v.useState(null),[q,V]=v.useState(""),[F,U]=v.useState(""),[Z,z]=v.useState(!1),[$,te]=v.useState(!y),se=()=>{P.trim()&&(x({evalRules:[...e.evalRules,{type:E,value:P.trim()}]}),O(""),L(""))},Q=ue=>{x({evalRules:e.evalRules.filter((De,Ye)=>Ye!==ue)})},ce=()=>{!q.trim()||!F.trim()||(x({extractRules:[...e.extractRules,{name:q.trim(),pattern:F.trim()}]}),V(""),U(""))},le=ue=>{x({extractRules:e.extractRules.filter((De,Ye)=>Ye!==ue)})},me=ue=>{const De=e.serverIds.includes(ue)?e.serverIds.filter(Ye=>Ye!==ue):[...e.serverIds,ue];x({serverIds:De})},oe={required_tool:"Required",forbidden_tool:"Forbidden",response_contains:"Contains",response_not_contains:"Not Contains"},fe={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"},Ce=E==="required_tool"||E==="forbidden_tool",ae=e.serverIds.filter(ue=>i.some(De=>De.id===ue)),Re=ae.length>0,Ae=e.snapshotEval?.baselineSnapshotId!==void 0,[Te,be]=v.useState(""),[_e,X]=v.useState(0);v.useEffect(()=>{const ue=(f??"").trim();ue&&Te!==ue&&(z(!0),be(ue))},[f,Te]),v.useEffect(()=>{h&&h!==_e&&(z(!0),X(h))},[h,_e]),v.useEffect(()=>{D(null),W(null),L("")},[e.serverIds.join("|")]),v.useEffect(()=>{L("")},[E]);const ge=async()=>{if(!(!Re||y)){G(!0),W(null);try{const ue=new Set;for(const De of ae){const Ye=await C.discoverToolsForAnalysis({serverNames:[De]});for(const Ct of Ye.servers)for(const Ft of Ct.tools)ue.add(Ft.name)}D(Array.from(ue).sort((De,Ye)=>De.localeCompare(Ye)))}catch(ue){W(ue instanceof Error?ue.message:"Failed to load tools")}finally{G(!1)}}};return s.jsx(Di,{open:$,onOpenChange:te,children:s.jsxs(qe,{className:y?"rounded-md border shadow-none":"border-dashed",children:[s.jsxs(At,{className:y?"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:[!y&&s.jsx(Ws,{asChild:!0,children:s.jsx(re,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",children:s.jsx(Wt,{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(_t,{className:"truncate text-sm font-medium",children:e.name||`Scenario ${n+1}`})]}),y?s.jsxs("div",{className:"flex items-center gap-2",children:[t&&s.jsx(Qe,{variant:t==="inline"?"secondary":"outline",children:t==="referenced"?"Referenced":"Inline"}),s.jsx(Ws,{asChild:!0,children:s.jsx(re,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8","aria-label":$?"Collapse scenario details":"Expand scenario details",children:s.jsx(Wt,{className:`h-4 w-4 transition-transform ${$?"rotate-180":""}`})})})]}):S&&s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>z(!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(ba,{className:"h-3.5 w-3.5"}),"Ask Assistant"]}),s.jsx(re,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:g,disabled:n===0,"aria-label":"Move scenario up",children:s.jsx(hs,{className:"h-3.5 w-3.5"})}),s.jsx(re,{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(Wt,{className:"h-3.5 w-3.5"})}),s.jsx(re,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:b,children:s.jsx(_a,{className:"h-3.5 w-3.5 text-destructive"})})]})]}),s.jsx(Li,{children:s.jsxs(We,{className:"space-y-3",children:[s.jsx(hme,{open:Z,onOpenChange:z,configId:o,configPath:c,scenario:e,agents:a,servers:i,snapshotEval:p,defaultAssistantAgentName:d,initialUserMessage:f,onApplyPatch:ue=>x({...ue.prompt!==void 0?{prompt:ue.prompt}:{},...ue.evalRules!==void 0?{evalRules:ue.evalRules}:{},...ue.extractRules!==void 0?{extractRules:ue.extractRules}:{},...ue.snapshotEval!==void 0?{snapshotEval:{...e.snapshotEval??{},...ue.snapshotEval}}:{}})}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Name"}),s.jsx(ht,{value:e.name,onChange:ue=>x({name:ue.target.value}),disabled:y,placeholder:"e.g. List directory"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Servers"}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[i.map(ue=>s.jsx(Qe,{variant:e.serverIds.includes(ue.id)?"default":"outline",className:`cursor-pointer text-xs ${e.serverIds.includes(ue.id)?"":"opacity-50"}`,onClick:()=>!y&&me(ue.id),children:ue.name||ue.id},ue.id)),i.length===0&&s.jsx("span",{className:"text-xs text-muted-foreground",children:"Add servers above first"})]})]}),s.jsxs(qe,{className:"border bg-card",children:[s.jsxs(At,{className:"pb-2",children:[s.jsx(_t,{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(We,{className:"pt-0",children:s.jsx(Ha,{value:e.prompt,onChange:ue=>x({prompt:ue.target.value}),disabled:y,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(qe,{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(_t,{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."})]}),!y&&s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>z(!0),title:"Ask for help improving checks",children:[s.jsx(ba,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]})}),s.jsx(We,{className:"space-y-2",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(Fe,{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((ue,De)=>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 ${fe[ue.type]}`,children:oe[ue.type]}),s.jsx("span",{className:"font-mono break-all",children:ue.value})]})}),!y&&s.jsx(re,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>Q(De),"aria-label":`Remove check ${De+1}`,children:s.jsx(ws,{className:"h-3.5 w-3.5"})})]},De))}),!y&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex gap-2 items-end",children:[s.jsxs(Pn,{value:E,onValueChange:ue=>_(ue),children:[s.jsx(An,{className:"h-8 w-[14.5rem] shrink-0 text-xs",children:s.jsx(kn,{})}),s.jsxs(_n,{children:[s.jsx(dt,{value:"required_tool",children:"Required Tool"}),s.jsx(dt,{value:"forbidden_tool",children:"Forbidden Tool"}),s.jsx(dt,{value:"response_contains",children:"Text matches pattern"}),s.jsx(dt,{value:"response_not_contains",children:"Text must not match"})]})]}),s.jsx(ht,{value:P,onChange:ue=>O(ue.target.value),placeholder:"Value",className:"h-8 text-xs font-mono",onKeyDown:ue=>ue.key==="Enter"&&(ue.preventDefault(),se())}),s.jsx(re,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:se,children:"Add"})]}),Ce&&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(Fe,{className:"mb-1 block text-[11px] text-muted-foreground",children:"Pick from selected server tools (optional)"}),s.jsxs(Pn,{value:R,onValueChange:ue=>{L(ue),O(ue)},disabled:M||!T||T.length===0,children:[s.jsx(An,{className:"h-8 text-xs",children:s.jsx(kn,{placeholder:M?"Loading tools...":T&&T.length>0?"Select tool to insert in value field":"Load tools first"})}),s.jsx(_n,{children:(T??[]).map(ue=>s.jsx(dt,{value:ue,children:ue},ue))})]})]}),s.jsx(re,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:ge,disabled:!Re||M,children:M?"Loading...":T?"Refresh tools":"Load tools"})]}),!Re&&s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Select at least one server in this scenario to load tool names."}),B&&s.jsxs("p",{className:"text-[11px] text-destructive",children:["Could not load tools: ",B]})]})]})]})})]}),s.jsxs(qe,{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(_t,{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."})]}),!y&&s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>z(!0),title:"Ask for help improving value capture rules",children:[s.jsx(ba,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]})}),s.jsx(We,{className:"space-y-2",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(Fe,{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((ue,De)=>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:ue.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:ue.pattern})]})}),!y&&s.jsx(re,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>le(De),"aria-label":`Remove value capture rule ${De+1}`,children:s.jsx(ws,{className:"h-3.5 w-3.5"})})]},De))}),!y&&s.jsxs("div",{className:"flex gap-2 items-end",children:[s.jsx(ht,{value:q,onChange:ue=>V(ue.target.value),placeholder:"Field name",className:"h-8 text-xs w-36"}),s.jsx(ht,{value:F,onChange:ue=>U(ue.target.value),placeholder:"Regex pattern",className:"h-8 text-xs font-mono",onKeyDown:ue=>ue.key==="Enter"&&(ue.preventDefault(),ce())}),s.jsx(re,{type:"button",variant:"outline",size:"sm",className:"h-8 shrink-0",onClick:ce,children:"Add"})]})]})})]})]}),N&&s.jsxs(qe,{className:"border bg-amber-50/40",children:[s.jsxs(At,{className:"pb-2",children:[s.jsx(_t,{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(We,{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:y,onCheckedChange:ue=>x({snapshotEval:{...e.snapshotEval??{},enabled:ue}})})]}),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:!Ae,disabled:y,onCheckedChange:ue=>{if(ue){x({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:void 0}});return}x({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:e.snapshotEval?.baselineSnapshotId??""}})}})]}),Ae&&s.jsx(ht,{value:e.snapshotEval?.baselineSnapshotId??"",onChange:ue=>x({snapshotEval:{...e.snapshotEval??{},baselineSnapshotId:ue.target.value}}),disabled:y,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"})]})]})]})]})})]})})}function Lz(e){const t=e.name?.trim()||e.id||"Server",n=e.authValue?.trim()||"",r=e.oauthTokenUrl?.trim()||"";return e.authType==="bearer"&&n.length===0?`${t}: bearer token is required.`:e.authType==="api-key"&&r.length===0&&n.length===0?`${t}: API key value is required.`:null}const wme=()=>({id:`cfg-${Date.now()}`,name:"",configName:"",description:"",servers:[],serverEntries:[],agents:[],agentEntries:[],scenarios:[],scenarioEntries:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),EM=()=>{const{id:e,tab:t}=tl(),n=Pa(),[r,a]=Xi(),{getConfig:i,addConfig:o,updateConfig:c,loading:d}=Cf(),{source:f}=qn(),h=bg("snapshots",!1),{servers:p,agents:x,scenarios:g}=Xa(),j=e==="new",b=!j&&!!e,y=b?i(e):void 0,[S,C]=v.useState(j),[N,E]=v.useState(()=>y?structuredClone(y):wme()),[_,P]=v.useState([]),[O,R]=v.useState(""),[L,T]=v.useState(""),[D,M]=v.useState(""),[G,B]=v.useState(null),[W,q]=v.useState(!1),[V,F]=v.useState(!1),[U,Z]=v.useState(""),[z,$]=v.useState(""),[te,se]=v.useState({}),[Q,ce]=v.useState({}),[le,me]=v.useState({}),oe=v.useMemo(()=>{const Y=t||r.get("tab");return Y==="agents"||Y==="scenarios"?Y:"scenarios"},[t,r]);v.useEffect(()=>{y&&!S&&E(structuredClone(y))},[y,S]),v.useEffect(()=>{let Y=!0;return f.listSnapshots().then(xe=>{Y&&P(xe)}).catch(()=>{Y&&P([])}),()=>{Y=!1}},[f]),v.useEffect(()=>{if(!O.trim()){B(null);return}let Y=!0;return f.getResult(O.trim()).then(xe=>{if(!Y)return;if(!xe){B(!1);return}const He=xe.overallPassRate===1&&xe.scenarios.every(ft=>ft.runs.every($t=>$t.passed));B(He)}).catch(()=>{Y&&B(!1)}),()=>{Y=!1}},[O,f]);const fe=Y=>E(xe=>({...xe,...Y})),Ce=v.useMemo(()=>N.serverEntries&&N.serverEntries.length>0?N.serverEntries:(N.servers??[]).map(Y=>({kind:"inline",server:Y})),[N.serverEntries,N.servers]),ae=v.useMemo(()=>N.scenarioEntries&&N.scenarioEntries.length>0?N.scenarioEntries:N.scenarios.map(Y=>({kind:"inline",scenario:Y})),[N.scenarioEntries,N.scenarios]),Re=Y=>{fe({scenarioEntries:Y,scenarios:Y.filter(xe=>xe.kind==="inline").map(xe=>xe.scenario)})},Ae=v.useMemo(()=>N.agentEntries&&N.agentEntries.length>0?N.agentEntries:N.agents.map(Y=>({kind:"inline",agent:Y})),[N.agentEntries,N.agents]),Te=Y=>{fe({agentEntries:Y,agents:Y.filter(xe=>xe.kind==="inline").map(xe=>xe.agent)})},be=!S,_e=N.runDefaults?.selectedAgentNames??[],X=async Y=>{if(!N.id||be===!1){fe({snapshotEval:{enabled:Y.enabled,mode:Y.mode,baselineSnapshotId:Y.baselineSnapshotId,baselineSourceRunId:Y.baselineSourceRunId,lastUpdatedAt:new Date().toISOString()}});return}q(!0);try{const xe=await f.updateSnapshotPolicy(N.id,Y);E(xe),Pe({title:"Snapshot policy updated"})}catch(xe){Pe({title:"Could not update snapshot policy",description:xe instanceof Error?xe.message:String(xe),variant:"destructive"})}finally{q(!1)}},ge=async()=>{if(!(!N.id||!O.trim())){F(!0);try{const Y=await f.generateSnapshotEvalBaseline(O.trim(),N.id,L.trim()||void 0);E(Y.config),M(Y.snapshot.id),P(xe=>[Y.snapshot,...xe.filter(He=>He.id!==Y.snapshot.id)]),Pe({title:"Snapshot baseline generated",description:`${Y.snapshot.name} (${Y.snapshot.id})`})}catch(Y){Pe({title:"Could not generate baseline",description:Y instanceof Error?Y.message:String(Y),variant:"destructive"})}finally{F(!1)}}},ue=async()=>{if(!N.name.trim()){Pe({title:"Validation Error",description:"Config ID is required.",variant:"destructive"});return}const Y=Ce.map(Ke=>Ke.kind==="referenced"?{kind:"referenced",ref:p.find(Gt=>Gt.id===Ke.ref)?.id||Ke.ref}:Ke),xe=Ae.map(Ke=>Ke.kind==="referenced"?{kind:"referenced",ref:x.find(Gt=>Gt.id===Ke.ref)?.id||Ke.ref}:Ke),He=ae.map(Ke=>Ke.kind==="referenced"?{kind:"referenced",ref:g.find(Gt=>Gt.id===Ke.ref)?.id||Ke.ref}:Ke),ft=Y.filter(Ke=>Ke.kind==="inline").map(Ke=>({server:Ke.server,error:Lz(Ke.server)})).find(Ke=>!!Ke.error);if(ft?.error){Pe({title:"Validation Error",description:ft.error,variant:"destructive"});return}if(He.filter(Ke=>Ke.kind==="inline").some(Ke=>!Ke.scenario.name?.trim())){Pe({title:"Validation Error",description:"Inline scenarios must have a name before saving.",variant:"destructive"});return}const Ut=new Set(xe.map(Ke=>Ke.kind==="inline"?Ke.agent.id:Ke.ref)),Dt=(N.runDefaults?.selectedAgentNames??[]).filter(Ke=>Ut.has(Ke)),Fn={...N,serverEntries:Y,servers:Y.filter(Ke=>Ke.kind==="inline").map(Ke=>Ke.server),agentEntries:xe,agents:xe.filter(Ke=>Ke.kind==="inline").map(Ke=>Ke.agent),scenarioEntries:He,scenarios:He.filter(Ke=>Ke.kind==="inline").map(Ke=>Ke.scenario),runDefaults:Dt.length>0?{...N.runDefaults??{},selectedAgentNames:Dt}:void 0,updatedAt:new Date().toISOString()};if(j){const Ke=await o(Fn);E(Ke);const en=Ke.configName?.trim()||Ke.name;Pe({title:"MCP Evaluation Created",description:`"${en}" has been saved.`}),n(`/mcp-evaluations/${Ke.id}`)}else{const Ke=await c(N.id,Fn);E(Ke);const en=Ke.configName?.trim()||Ke.name;Pe({title:"MCP Evaluation Updated",description:`"${en}" has been updated.`}),C(!1),Ke.id!==e&&n(`/mcp-evaluations/${Ke.id}`,{replace:!0})}},De=N.configName?.trim()||N.name,Ye=j?"New MCP Evaluation":S?`Editing: ${De}`:De,Ct=j?"/mcp-evaluations/new":`/mcp-evaluations/${encodeURIComponent(N.id||e||"")}`,Ft=!!y?.loadError,mt=v.useMemo(()=>x.map(Y=>({id:Y.id,ref:Y.id,label:Y.name||Y.id,model:Y.model})).sort((Y,xe)=>Y.label.localeCompare(xe.label)),[x]),Nt=(Y,xe)=>{const He=xe?Array.from(new Set([..._e,Y])):_e.filter(ft=>ft!==Y);fe({runDefaults:{...N.runDefaults??{},selectedAgentNames:He}})},Vt=Y=>{const xe=new Set([...Ae.filter(Ut=>Ut.kind==="inline").map(Ut=>Ut.agent.name||Ut.agent.id),...x.map(Ut=>Ut.name||Ut.id)]),He=`${Y}-custom`;let ft=He,$t=2;for(;xe.has(ft);)ft=`${He}-${$t}`,$t+=1;return ft},pn=()=>{const xe={id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096};Te([{kind:"inline",agent:xe},...Ae]),se(He=>({...He,[xe.id]:!0}))},ln=()=>{const Y=x.find(ft=>ft.id===z);if(!Y)return;const xe=Y.id;new Set(Ae.filter(ft=>ft.kind==="referenced").map(ft=>ft.ref)).has(xe)||Te([...Ae,{kind:"referenced",ref:xe}]),$("")},ee=()=>{const Y=new Set(Ae.filter(He=>He.kind==="referenced").map(He=>He.ref)),xe=x.filter(He=>!Y.has(He.id)).map(He=>({kind:"referenced",ref:He.id}));xe.length>0&&Te([...Ae,...xe])},Se=()=>{const Y=x.find($t=>$t.id===z);if(!Y)return;const xe=Y.name||Y.id,He=Vt(xe),ft={...structuredClone(Y),id:`agt-${Date.now()}`,name:He};Te([...Ae,{kind:"inline",agent:ft}]),se($t=>({...$t,[ft.id]:!0})),$(""),Pe({title:"Imported agent as inline",description:He})},Ne=Y=>{const xe=Ae[Y];if(!xe)return;const He=xe.kind==="inline"?xe.agent.id:xe.ref,ft=_e.filter($t=>$t!==He);fe({runDefaults:{...N.runDefaults??{},selectedAgentNames:ft}}),xe.kind==="inline"&&se($t=>{const Ut={...$t};return delete Ut[xe.agent.id],Ut}),Te(Ae.filter(($t,Ut)=>Ut!==Y))},ze=(Y,xe)=>{const He=Y+xe;if(He<0||He>=Ae.length)return;const ft=[...Ae],[$t]=ft.splice(Y,1);ft.splice(He,0,$t),Te(ft)},ke=Y=>{const xe=Ae[Y];if(!xe||xe.kind!=="referenced")return;const He=Ht(xe.ref);if(!He){Pe({title:"Referenced agent not found",variant:"destructive"});return}const ft=He.name||He.id,$t=Vt(ft),Ut={...structuredClone(He),id:`agt-${Date.now()}`,name:$t},Dt=[...Ae];if(Dt[Y]={kind:"inline",agent:Ut},Te(Dt),_e.includes(xe.ref)){const Fn=_e.map(Ke=>Ke===xe.ref?Ut.id:Ke);fe({runDefaults:{...N.runDefaults??{},selectedAgentNames:Array.from(new Set(Fn))}})}se(Fn=>({...Fn,[Ut.id]:!0})),Pe({title:"Referenced agent converted to inline",description:$t})},it=()=>{const Y=g.find(He=>He.id===U);if(!Y)return;const xe={...structuredClone(Y),id:`scn-${Date.now()}`,serverIds:[...Y.serverIds]};Re([...ae,{kind:"inline",scenario:xe}]),me(He=>({...He,[xe.id]:!0})),Z("")},Ue=()=>{const xe={id:`scn-${Date.now()}`,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};Re([{kind:"inline",scenario:xe},...ae]),me(He=>({...He,[xe.id]:!0}))},Tt=()=>{const Y=g.find(ft=>ft.id===U);if(!Y)return;const xe=Y.id;new Set(ae.filter(ft=>ft.kind==="referenced").map(ft=>ft.ref)).has(xe)||Re([...ae,{kind:"referenced",ref:xe}]),Z("")},Ot=Y=>{const xe=ae[Y];xe?.kind==="inline"&&me(He=>{const ft={...He};return delete ft[xe.scenario.id],ft}),Re(ae.filter((He,ft)=>ft!==Y))},zt=(Y,xe)=>{const He=Y+xe;if(He<0||He>=ae.length)return;const ft=[...ae],[$t]=ft.splice(Y,1);ft.splice(He,0,$t),Re(ft)},Ln=Y=>{const xe=ae[Y];if(!xe||xe.kind!=="referenced")return;const He=hn(xe.ref);if(!He){Pe({title:"Referenced scenario not found",variant:"destructive"});return}const ft=new Set(ae.filter(Gt=>Gt.kind==="inline").map(Gt=>Gt.scenario.name?.trim().toLowerCase()).filter(Boolean)),$t=`${(He.name||He.id).trim()}-custom`;let Ut=$t,Dt=2;for(;ft.has(Ut.toLowerCase());)Ut=`${$t}-${Dt}`,Dt+=1;const Fn=Date.now(),Ke={...structuredClone(He),id:`scn-${Fn}`,name:Ut,serverIds:[...He.serverIds]},en=[...ae];en[Y]={kind:"inline",scenario:Ke},Re(en),me(Gt=>({...Gt,[Ke.id]:!0})),Pe({title:"Referenced scenario converted to inline",description:Ut})},yn=Y=>p.find(xe=>xe.id===Y),Ht=Y=>x.find(xe=>xe.id===Y),hn=Y=>g.find(xe=>xe.id===Y),wr=Ce.filter(Y=>Y.kind==="referenced").map(Y=>Y.ref),ut=wr.map(yn).filter(Y=>!!Y),jt=Ae.filter(Y=>Y.kind==="referenced").map(Y=>Y.ref),Et=jt.map(Ht).filter(Y=>!!Y);Ae.filter(Y=>Y.kind==="inline");const bn=Ae.flatMap(Y=>{if(Y.kind==="referenced"){const xe=Ht(Y.ref);return xe?[{agent:xe,origin:"referenced",ref:Y.ref}]:[]}return[{agent:Y.agent,origin:"inline",ref:void 0}]}),de=ae.filter(Y=>Y.kind==="referenced").map(Y=>Y.ref),ot=ae.flatMap(Y=>{if(Y.kind==="referenced"){const xe=hn(Y.ref);return xe?[{scenario:xe,origin:"referenced"}]:[]}return[{scenario:Y.scenario,origin:"inline"}]}),Bt=Array.from(new Map([...x,...N.agents,...Et].map(Y=>[Y.id,Y])).values()),Kt=Array.from(new Map([...p,...N.servers??[],...ut].map(Y=>[Y.id,Y])).values()),cn=wr.filter(Y=>!yn(Y)),Rn=jt.filter(Y=>!Ht(Y)),ur=de.filter(Y=>!hn(Y));new Set(cn);const di=new Set(ur),fi=Ae.length,dl=ae.length;return v.useEffect(()=>{if(!z)return;x.some(xe=>xe.id===z)||$("")},[x,z]),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(re,{variant:"ghost",size:"icon",asChild:!0,className:"h-8 w-8",children:s.jsx(wt,{to:"/mcp-evaluations",children:s.jsx(Mo,{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:Ye}),s.jsx("p",{className:"text-sm text-muted-foreground",children:j?"Create a new MCP evaluation":d?"Loading configuration...":y?y.loadError?"MCP evaluation could not be fully loaded":`Last updated ${new Date(N.updatedAt).toLocaleDateString()}`:"MCP evaluation not found"})]}),s.jsxs("div",{className:"flex gap-2 shrink-0",children:[b&&!S&&s.jsx(re,{size:"sm",onClick:()=>C(!0),children:"Edit"}),b&&!S&&y&&!Ft&&s.jsx(re,{size:"sm",variant:"outline",asChild:!0,children:s.jsxs(wt,{to:`/run?configId=${encodeURIComponent(y.id)}`,children:[s.jsx(Oo,{className:"mr-1.5 h-3.5 w-3.5"}),"Run MCP Evaluation"]})}),b&&!S&&Ft&&s.jsxs(Qe,{variant:"destructive",className:"py-1 px-3 text-xs",children:[s.jsx(jh,{className:"mr-1 h-3 w-3"}),"Broken config"]}),S&&s.jsxs(s.Fragment,{children:[!j&&s.jsx(re,{variant:"outline",size:"sm",onClick:()=>{E(structuredClone(y)),C(!1)},children:"Cancel"}),s.jsxs(re,{size:"sm",onClick:()=>{ue()},children:[s.jsx(eq,{className:"mr-1.5 h-3.5 w-3.5"}),"Save"]})]})]})]}),Ft&&!S&&s.jsx(qe,{className:"border-destructive/40",children:s.jsxs(We,{className:"pt-6 space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(jh,{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:y?.sourcePath||y?.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:y?.loadError})]}),(cn.length>0||Rn.length>0||ur.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"}),cn.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Servers: ",s.jsx("span",{className:"text-destructive",children:cn.join(", ")})]}),Rn.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Agents: ",s.jsx("span",{className:"text-destructive",children:Rn.join(", ")})]}),ur.length>0&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Scenarios: ",s.jsx("span",{className:"text-destructive",children:ur.join(", ")})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Valid items still render below. Only the missing references are marked as broken."})]})}),!Ft&&(N.loadWarnings?.length??0)>0&&s.jsx(qe,{className:"border-amber-500/30",children:s.jsxs(We,{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(jh,{className:"h-4 w-4"}),"Migration warnings"]}),N.loadWarnings?.map((Y,xe)=>s.jsx("p",{className:"text-xs text-muted-foreground",children:Y},`${Y}-${xe}`))]})}),s.jsxs("div",{className:"flex gap-4",children:[s.jsx(Qe,{variant:oe==="scenarios"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(wt,{to:`${Ct}/scenarios`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(IE,{className:"h-3 w-3"}),dl," scenario",dl!==1?"s":""]})}),s.jsx(Qe,{variant:oe==="agents"?"default":"outline",className:"py-1 px-3 text-xs",children:s.jsxs(wt,{to:`${Ct}/agents`,className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[s.jsx(Sa,{className:"h-3 w-3"}),fi," agent",fi!==1?"s":""]})})]}),s.jsx(qe,{children:s.jsx(We,{className:"pt-6 space-y-3",children:s.jsxs("div",{className:`grid gap-4 ${be||!j?"sm:grid-cols-2":"sm:grid-cols-3"}`,children:[!be&&j&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Config ID"}),s.jsx(ht,{value:N.name,onChange:Y=>fe({name:Y.target.value}),disabled:be,placeholder:"e.g. check-weather"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Name (optional)"}),s.jsx(ht,{value:N.configName||"",onChange:Y=>fe({configName:Y.target.value}),disabled:be,placeholder:"e.g. Weather checks baseline"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Description"}),s.jsx(ht,{value:N.description||"",onChange:Y=>fe({description:Y.target.value}),disabled:be,placeholder:"Brief description..."})]})]})})}),h&&s.jsx(qe,{children:s.jsxs(We,{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(Fe,{className:"text-xs",children:"Enable snapshot baseline"}),s.jsx(Bm,{checked:N.snapshotEval?.enabled??!1,disabled:W,onCheckedChange:Y=>{const xe=N.snapshotEval;X({enabled:Y,mode:xe?.mode??"warn",baselineSnapshotId:xe?.baselineSnapshotId,baselineSourceRunId:xe?.baselineSourceRunId})}})]})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Drift mode"}),s.jsxs(Pn,{value:N.snapshotEval?.mode??"warn",onValueChange:Y=>{const xe=N.snapshotEval;X({enabled:xe?.enabled??!1,mode:Y,baselineSnapshotId:xe?.baselineSnapshotId,baselineSourceRunId:xe?.baselineSourceRunId})},children:[s.jsx(An,{className:"h-8",children:s.jsx(kn,{})}),s.jsxs(_n,{children:[s.jsx(dt,{value:"warn",children:"Warn"}),s.jsx(dt,{value:"fail_on_drift",children:"Fail on drift"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{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:N.snapshotEval?.baselineSnapshotId??"No baseline linked"})]})]}),N.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(Fe,{className:"text-xs",children:"Generate baseline from passing run"}),s.jsx(ht,{value:O,onChange:Y=>R(Y.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(Fe,{className:"text-xs",children:"Snapshot name (optional)"}),s.jsx(ht,{value:L,onChange:Y=>T(Y.target.value),placeholder:"e.g. config-baseline-v1",className:"h-8 text-xs"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Switch baseline"}),s.jsxs(Pn,{value:D||N.snapshotEval?.baselineSnapshotId||"",onValueChange:Y=>{M(Y),X({enabled:N.snapshotEval?.enabled??!0,mode:N.snapshotEval?.mode??"warn",baselineSnapshotId:Y||void 0,baselineSourceRunId:N.snapshotEval?.baselineSourceRunId})},children:[s.jsx(An,{className:"h-8",children:s.jsx(kn,{placeholder:"Select snapshot"})}),s.jsx(_n,{children:_.map(Y=>s.jsx(dt,{value:Y.id,children:Y.name},Y.id))})]})]}),s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{ge()},disabled:V||!O.trim()||G!==!0,children:V?"Generating...":"Generate Baseline"}),s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:()=>{X({enabled:N.snapshotEval?.enabled??!1,mode:N.snapshotEval?.mode??"warn",baselineSnapshotId:void 0,baselineSourceRunId:void 0})},disabled:W,children:"Clear Baseline"})]})]})]})}),s.jsxs(pg,{value:oe,onValueChange:Y=>{if(Y!=="servers"&&Y!=="agents"&&Y!=="scenarios")return;const xe=new URLSearchParams(r);if(xe.delete("tab"),a(xe,{replace:!0}),e&&e!=="new"){n(`/mcp-evaluations/${encodeURIComponent(e)}/${Y}`,{replace:!0});return}n(`/mcp-evaluations/${e??"new"}/${Y}`,{replace:!0})},className:"space-y-4",children:[s.jsxs(Lf,{children:[s.jsxs(xs,{value:"scenarios",className:"gap-1.5",children:[s.jsx(IE,{className:"h-3.5 w-3.5"}),"Scenarios"]}),s.jsxs(xs,{value:"agents",className:"gap-1.5",children:[s.jsx(Sa,{className:"h-3.5 w-3.5"}),"Agents"]})]}),s.jsxs(pf,{value:"agents",children:[!be&&s.jsx(qe,{className:"mb-4",children:s.jsxs(We,{className:"pt-4 space-y-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[s.jsxs(Pn,{value:z,onValueChange:$,children:[s.jsx(An,{className:"h-8",children:s.jsx(kn,{placeholder:"Select agent from library"})}),s.jsx(_n,{children:mt.map(Y=>s.jsx(dt,{value:Y.id,children:Y.label},Y.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!z,onClick:ln,children:"Add Ref"}),s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!z,onClick:Se,children:"Import Inline"}),s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:x.length===0||x.every(Y=>Ae.some(xe=>xe.kind==="referenced"&&xe.ref===Y.id)),onClick:ee,children:"Add All Refs"}),s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:pn,children:"Add agent"})]})]}),s.jsxs("div",{className:"space-y-2",children:[Ae.map((Y,xe)=>{const He=Y.kind==="referenced"?Ht(Y.ref):null,ft=Y.kind==="inline"?Y.agent.name?.trim()||Y.agent.id:He?.name||Y.ref,$t=Y.kind==="inline"?Y.agent.model:He?.model||"unknown",Ut=Y.kind==="inline"?Y.agent.id:Y.ref,Dt=Y.kind==="referenced"&&!He,Fn=Y.kind==="inline"?Y.agent.id:Y.ref,Ke=_e.includes(Fn),en=Y.kind==="inline"&&!!te[Y.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(re,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>ze(xe,-1),disabled:xe===0,"aria-label":"Move agent up",children:s.jsx(hs,{className:"h-3 w-3"})}),s.jsx(re,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>ze(xe,1),disabled:xe===Ae.length-1,"aria-label":"Move agent down",children:s.jsx(Wt,{className:"h-3 w-3"})})]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[xe+1,"."]}),s.jsx("span",{className:"truncate font-medium",children:ft}),s.jsx(Qe,{variant:Y.kind==="inline"?"secondary":"outline",children:Y.kind==="inline"?"Inline":"Referenced"}),s.jsx(Qe,{variant:"outline",className:"font-mono text-[10px]",children:$t}),Ke&&s.jsx(Qe,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),Dt&&s.jsx(Qe,{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:Ke,onChange:Gt=>Nt(Fn,Gt.target.checked)}),s.jsx("span",{children:"Default"})]}),Y.kind==="inline"&&s.jsx(re,{type:"button",size:"sm",variant:"outline",onClick:()=>se(Gt=>({...Gt,[Y.agent.id]:!Gt[Y.agent.id]})),children:en?"Collapse":"Expand"}),Y.kind==="referenced"&&s.jsx(s.Fragment,{children:s.jsx(re,{type:"button",size:"sm",variant:"outline",onClick:()=>ke(xe),disabled:Dt,children:"Convert to inline"})}),s.jsx(re,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>Ne(xe),"aria-label":"Remove agent entry",children:s.jsx(_a,{className:"h-3.5 w-3.5"})})]})]}),Y.kind==="inline"&&en&&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(Fe,{className:"text-xs",children:"Name"}),s.jsx(ht,{value:Y.agent.name,onChange:Gt=>{const Bn=[...Ae];Bn[xe]={kind:"inline",agent:{...Y.agent,name:Gt.target.value}},Te(Bn)},placeholder:"e.g. GPT-5 Mini custom"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Provider"}),s.jsxs(Pn,{value:Y.agent.provider,onValueChange:Gt=>{const Bn=[...Ae];Bn[xe]={kind:"inline",agent:{...Y.agent,provider:Gt}},Te(Bn)},children:[s.jsx(An,{children:s.jsx(kn,{})}),s.jsxs(_n,{children:[s.jsx(dt,{value:"openai",children:"OpenAI"}),s.jsx(dt,{value:"anthropic",children:"Anthropic"}),s.jsx(dt,{value:"azure",children:"Azure OpenAI"}),s.jsx(dt,{value:"google",children:"Google"}),s.jsx(dt,{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(Fe,{className:"text-xs",children:"Model"}),s.jsx(ht,{value:Y.agent.model,onChange:Gt=>{const Bn=[...Ae];Bn[xe]={kind:"inline",agent:{...Y.agent,model:Gt.target.value}},Te(Bn)},className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Max Tokens"}),s.jsx(ht,{type:"number",min:1,max:128e3,value:Y.agent.maxTokens,onChange:Gt=>{const Bn=[...Ae];Bn[xe]={kind:"inline",agent:{...Y.agent,maxTokens:parseInt(Gt.target.value)||0}},Te(Bn)},className:"font-mono text-xs"})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Temperature"}),s.jsx(ht,{type:"number",min:0,max:2,step:.01,value:Y.agent.temperature,onChange:Gt=>{const Bn=[...Ae];Bn[xe]={kind:"inline",agent:{...Y.agent,temperature:Number(Gt.target.value)||0}},Te(Bn)},className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"System Prompt"}),s.jsx(Ha,{value:Y.agent.systemPrompt||"",onChange:Gt=>{const Bn=[...Ae];Bn[xe]={kind:"inline",agent:{...Y.agent,systemPrompt:Gt.target.value}},Te(Bn)},rows:3,className:"text-xs"})]})]})]},`agent-entry-${xe}-${Ut}`)}),Ae.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents configured yet. Add inline agents or references."})]}),Rn.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing agent refs: ",Rn.join(", ")]})]})}),be?s.jsx(qe,{children:s.jsx(We,{className:"pt-4",children:s.jsxs("div",{className:"space-y-2",children:[bn.map((Y,xe)=>{const He=Y.agent.name||Y.agent.id,ft=_e.includes(Y.origin==="inline"?Y.agent.id:Y.ref||Y.agent.id),$t=Y.ref??Y.agent.id,Ut=!!Q[$t];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:[xe+1,"."]}),s.jsx("div",{className:"truncate font-medium text-sm",children:He})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[ft&&s.jsx(Qe,{variant:"outline",className:"text-xs border-emerald-300 text-emerald-700 bg-emerald-50",children:"Default"}),s.jsx(Qe,{variant:Y.origin==="inline"?"secondary":"outline",children:Y.origin==="inline"?"Inline":"Referenced"}),s.jsx(re,{type:"button",size:"icon",variant:"outline",className:"h-8 w-8",onClick:()=>ce(Dt=>({...Dt,[$t]:!Dt[$t]})),"aria-label":Ut?"Collapse agent details":"Expand agent details",children:s.jsx(Wt,{className:`h-4 w-4 transition-transform ${Ut?"rotate-180":""}`})})]})]}),Ut&&s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 border-t pt-2",children:[s.jsx(OB,{provider:Y.agent.provider}),s.jsx(Qe,{variant:"outline",className:"text-xs font-mono",children:Y.agent.model}),s.jsxs(Qe,{variant:"outline",className:"text-xs font-mono",children:["max_tokens: ",Y.agent.maxTokens]}),s.jsxs(Qe,{variant:"outline",className:"text-xs font-mono",children:["temperature: ",Y.agent.temperature]})]})]},`agent-view-${xe}-${Y.ref??Y.agent.id}`)}),bn.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No agents configured."})]})})}):null]}),s.jsxs(pf,{value:"scenarios",children:[!be&&s.jsx(qe,{className:"mb-4",children:s.jsxs(We,{className:"pt-4 space-y-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",children:[s.jsxs(Pn,{value:U,onValueChange:Z,children:[s.jsx(An,{className:"h-8",children:s.jsx(kn,{placeholder:"Select scenario from library"})}),s.jsx(_n,{children:[...g].sort((Y,xe)=>(Y.name||Y.id).localeCompare(xe.name||xe.id)).map(Y=>s.jsx(dt,{value:Y.id,children:Y.name||Y.id},Y.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!U,onClick:Tt,children:"Add Ref"}),s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:!U,onClick:it,children:"Import Inline"}),s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"h-8",onClick:Ue,children:"Add scenario"})]})]}),s.jsxs("div",{className:"space-y-2",children:[ae.map((Y,xe)=>{const He=Y.kind==="referenced"?hn(Y.ref):null,ft=Y.kind==="inline"?Y.scenario.name?.trim()||Y.scenario.id:He?.name||Y.ref,$t=Y.kind==="inline"&&!Y.scenario.name?.trim(),Ut=Y.kind==="referenced"&&di.has(Y.ref),Dt=Y.kind==="inline"&&!!le[Y.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(re,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>zt(xe,-1),disabled:xe===0,"aria-label":"Move scenario up",children:s.jsx(hs,{className:"h-3 w-3"})}),s.jsx(re,{type:"button",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>zt(xe,1),disabled:xe===ae.length-1,"aria-label":"Move scenario down",children:s.jsx(Wt,{className:"h-3 w-3"})})]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[xe+1,"."]}),s.jsx("span",{className:"truncate font-medium",children:ft}),s.jsx(Qe,{variant:Y.kind==="inline"?"secondary":"outline",children:Y.kind==="inline"?"Inline":"Referenced"}),$t&&s.jsx(Qe,{variant:"destructive",children:"Name required"}),Ut&&s.jsx(Qe,{variant:"destructive",children:"Missing"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[Y.kind==="inline"&&s.jsx(re,{type:"button",size:"icon",variant:"outline",className:"h-7 w-7",onClick:()=>me(Fn=>({...Fn,[Y.scenario.id]:!Fn[Y.scenario.id]})),"aria-label":Dt?"Collapse scenario details":"Expand scenario details",children:s.jsx(Wt,{className:`h-3.5 w-3.5 transition-transform ${Dt?"rotate-180":""}`})}),Y.kind==="referenced"&&s.jsx(s.Fragment,{children:s.jsx(re,{type:"button",size:"sm",variant:"outline",onClick:()=>Ln(xe),disabled:Ut,children:"Convert to inline"})}),s.jsx(re,{type:"button",size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:()=>Ot(xe),"aria-label":"Remove scenario entry",children:s.jsx(_a,{className:"h-3.5 w-3.5"})})]})]}),Y.kind==="inline"&&Dt&&s.jsx("div",{className:"border-t px-3 py-3",children:s.jsx(FS,{scenarios:[Y.scenario],scenarioOrigins:["inline"],agents:[...N.agents,...Et],servers:[...N.servers??[],...ut],configId:N.id,configPath:N.sourcePath,defaultAssistantAgentName:N.runDefaults?.selectedAgentNames?.[0],snapshotEval:N.snapshotEval,onChange:Fn=>{const Ke=Fn[0];if(!Ke)return;const en=[...ae];en[xe]={kind:"inline",scenario:Ke},Re(en)},readOnly:!1,allowAdd:!1,allowStructureEdits:!1})})]},`scenario-entry-${xe}-${Y.kind==="inline"?Y.scenario.id:Y.ref}`)}),ae.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No scenarios configured yet. Add inline scenarios or references."})]}),ur.length>0&&s.jsxs("p",{className:"text-xs text-destructive",children:["Missing scenario refs: ",ur.join(", ")]})]})}),be?s.jsx(qe,{children:s.jsx(We,{className:"pt-4",children:s.jsx(FS,{scenarios:ot.map(Y=>Y.scenario),scenarioOrigins:ot.map(Y=>Y.origin),agents:Bt,servers:Kt,configId:N.id,configPath:N.sourcePath,defaultAssistantAgentName:N.runDefaults?.selectedAgentNames?.[0],snapshotEval:N.snapshotEval,onChange:()=>{},readOnly:!0})})}):null]})]})]})};var jme=Symbol("radix.slottable");function Sme(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=jme,t}var Fz="AlertDialog",[Nme]=mr(Fz,[n3]),ui=n3(),Bz=e=>{const{__scopeAlertDialog:t,...n}=e,r=ui(t);return s.jsx(yv,{...r,...n,modal:!0})};Bz.displayName=Fz;var Cme="AlertDialogTrigger",Ame=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ui(n);return s.jsx(lG,{...a,...r,ref:t})});Ame.displayName=Cme;var _me="AlertDialogPortal",zz=e=>{const{__scopeAlertDialog:t,...n}=e,r=ui(t);return s.jsx(bv,{...r,...n})};zz.displayName=_me;var Eme="AlertDialogOverlay",Uz=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ui(n);return s.jsx(tu,{...a,...r,ref:t})});Uz.displayName=Eme;var dc="AlertDialogContent",[Pme,kme]=Nme(dc),Ome=Sme("AlertDialogContent"),qz=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,i=ui(n),o=v.useRef(null),c=xt(t,o),d=v.useRef(null);return s.jsx(aG,{contentName:dc,titleName:Wz,docsSlug:"alert-dialog",children:s.jsx(Pme,{scope:n,cancelRef:d,children:s.jsxs(nu,{role:"alertdialog",...i,...a,ref:c,onOpenAutoFocus:Ie(a.onOpenAutoFocus,f=>{f.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[s.jsx(Ome,{children:r}),s.jsx(Tme,{contentRef:o})]})})})});qz.displayName=dc;var Wz="AlertDialogTitle",Vz=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ui(n);return s.jsx(jf,{...a,...r,ref:t})});Vz.displayName=Wz;var Hz="AlertDialogDescription",Kz=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ui(n);return s.jsx(Sf,{...a,...r,ref:t})});Kz.displayName=Hz;var Rme="AlertDialogAction",Gz=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ui(n);return s.jsx(wv,{...a,...r,ref:t})});Gz.displayName=Rme;var Yz="AlertDialogCancel",Xz=v.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=kme(Yz,n),i=ui(n),o=xt(t,a);return s.jsx(wv,{...i,...r,ref:o})});Xz.displayName=Yz;var Tme=({contentRef:e})=>{const t=`\`${dc}\` requires a description for the component to be accessible for screen reader users.
125
-
126
- You can add a description to the \`${dc}\` by passing a \`${Hz}\` 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 \`${dc}\`. 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},Ime=Bz,Mme=zz,Qz=Uz,Jz=qz,Zz=Gz,e8=Xz,t8=Vz,n8=Kz;const Os=Ime,$me=Mme,r8=v.forwardRef(({className:e,...t},n)=>s.jsx(Qz,{className:je("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}));r8.displayName=Qz.displayName;const Ja=v.forwardRef(({className:e,...t},n)=>s.jsxs($me,{children:[s.jsx(r8,{}),s.jsx(Jz,{ref:n,className:je("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})]}));Ja.displayName=Jz.displayName;const Za=({className:e,...t})=>s.jsx("div",{className:je("flex flex-col space-y-2 text-center sm:text-left",e),...t});Za.displayName="AlertDialogHeader";const es=({className:e,...t})=>s.jsx("div",{className:je("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});es.displayName="AlertDialogFooter";const ts=v.forwardRef(({className:e,...t},n)=>s.jsx(t8,{ref:n,className:je("text-lg font-semibold",e),...t}));ts.displayName=t8.displayName;const ns=v.forwardRef(({className:e,...t},n)=>s.jsx(n8,{ref:n,className:je("text-sm text-muted-foreground",e),...t}));ns.displayName=n8.displayName;const rs=v.forwardRef(({className:e,...t},n)=>s.jsx(Zz,{ref:n,className:je(yN(),e),...t}));rs.displayName=Zz.displayName;const as=v.forwardRef(({className:e,...t},n)=>s.jsx(e8,{ref:n,className:je(yN({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));as.displayName=e8.displayName;const Dme=()=>{const{servers:e,setServers:t,reload:n,loading:r}=Xa(),a=Pa(),[i,o]=v.useState(null),[c,d]=v.useState(""),f=c.trim().toLowerCase(),h=b=>b.name?.trim()||b.id,p=async b=>{const y=`${h(b)}-copy`;let S=y,C=1;for(;e.some(E=>(E.name?.trim()||E.id)===S);)S=`${y}-${C}`,C+=1;const N={...structuredClone(b),id:`srv-${Date.now()}`,name:S};await t([...e,N]),Pe({title:"Server duplicated",description:`Created ${S}.`})},x=async b=>{await t(e.filter(y=>y.id!==b.id)),Pe({title:"Server deleted",description:`${h(b)} was removed.`}),o(null)},g=b=>b.transport==="stdio"?[b.command,...b.args||[]].filter(Boolean).join(" "):b.url||"",j=v.useMemo(()=>f.length===0?e:e.filter(b=>[h(b),b.id,b.transport,g(b),b.authType??""].join(" ").toLowerCase().includes(f)),[e,f]);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(k$,{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.jsx(SC,{value:c,onValueChange:d,placeholder:"Search servers..."}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[s.jsx(Aa,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(re,{type:"button",size:"sm",onClick:()=>a("/libraries/servers/new"),children:[s.jsx(bs,{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(re,{type:"button",size:"sm",className:"mt-4",onClick:()=>a("/libraries/servers/new"),children:[s.jsx(bs,{className:"mr-2 h-4 w-4"}),"Add Server"]})]}):j.length===0?s.jsx("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed py-12 text-center",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"No servers match this filter."})}):s.jsx(qe,{children:s.jsx(We,{className:"p-0",children:s.jsxs(Br,{children:[s.jsx(zr,{children:s.jsxs(qt,{children:[s.jsx(tt,{children:"Name"}),s.jsx(tt,{children:"Transport"}),s.jsx(tt,{children:"Endpoint"}),s.jsx(tt,{children:"Auth"}),s.jsx(tt,{className:"text-right",children:"Actions"})]})}),s.jsx(Ur,{children:j.map(b=>s.jsxs(qt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>a(`/libraries/servers/${encodeURIComponent(b.id)}`),children:[s.jsx(Be,{className:"font-medium",children:h(b)}),s.jsx(Be,{children:s.jsx(Qe,{variant:"secondary",className:"font-mono text-xs",children:b.transport})}),s.jsx(Be,{children:s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:g(b)})}),s.jsx(Be,{children:!b.authType||b.authType==="none"?s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"}):s.jsx(Qe,{variant:"outline",className:"text-xs",children:b.authType})}),s.jsx(Be,{className:"text-right",onClick:y=>y.stopPropagation(),children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsxs(re,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(b),children:[s.jsx(_a,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{p(b)},children:[s.jsx(ys,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>a(`/libraries/servers/${encodeURIComponent(b.id)}`),children:[s.jsx(Xm,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},b.id))})]})})}),s.jsx(Os,{open:!!i,onOpenChange:b=>!b&&o(null),children:s.jsxs(Ja,{children:[s.jsxs(Za,{children:[s.jsx(ts,{children:"Delete server?"}),s.jsxs(ns,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-mono",children:i?h(i):""})," from the library. This action cannot be undone."]})]}),s.jsxs(es,{children:[s.jsx(as,{children:"Cancel"}),s.jsx(rs,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&x(i)},children:"Delete Server"})]})]})})]})};async function UC(e){const{sessionId:t,source:n,serverName:r,onLaunchUrl:a,timeoutMs:i=5*6e4}=e,o=Date.now()+i;let c=!1;for(;Date.now()<o;){const{session:d}=await n.getOAuthRuntimeSession(t),f=d.authorizeLaunchUrl||d.authorizationUrl||"";if(f&&a&&a(f),d.status==="completed"&&d.hasAccessToken){c=!0;break}if(d.status==="error"||d.status==="stopped")throw new Error(`OAuth login failed for '${r}' (${d.status}). ${d.lastError||""}`.trim());await new Promise(h=>setTimeout(h,1500))}if(!c)throw new Error(`OAuth login timed out for '${r}'. Authorization was not completed within 5 minutes.`)}const PM={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"},Lme=()=>({id:`srv-${Date.now()}`,name:"",transport:"stdio",authType:"none"}),Fme=()=>{const{serverId:e}=tl(),t=Pa(),{servers:n,setServers:r}=Xa(),{source:a}=qn(),i=e==="new",o=e?decodeURIComponent(e):"",c=i?null:n.find(q=>q.id===o||q.name===o),d=q=>q.name?.trim()||q.id,[f,h]=v.useState(()=>c??Lme()),[p,x]=v.useState(!1),[g,j]=v.useState(!1),[b,y]=v.useState({status:"idle"}),[S,C]=v.useState(!1),[N,E]=v.useState({}),[_,P]=v.useState(void 0),[O,R]=v.useState(!1),[L,T]=v.useState(!1);v.useEffect(()=>{c&&(h(c),T(!1))},[c]);const D=q=>{T(!1),h(V=>({...V,authType:q,...q!=="bearer"&&q!=="api-key"?{authValue:void 0}:{},...q!=="api-key"?{apiKeyHeaderName:void 0}:{apiKeyHeaderName:V.apiKeyHeaderName||"X-API-Key"},...q!=="oauth2"?{oauthClientId:void 0,oauthClientSecret:void 0,oauthRedirectUrl:void 0,oauthScope:void 0,oauthMode:void 0,oauthAuthorizationUrl:void 0,oauthTokenEndpoint:void 0}:{oauthRedirectUrl:V.oauthRedirectUrl||void 0}}))},M=async()=>{C(!0),y({status:"loading"});let q;if(f.authType==="oauth2"){const V=async F=>{const U=(()=>{let $=!1;return te=>{if($||!te)return;$=!0;const se=te.startsWith("http")?te:`${window.location.origin}${te}`;window.open(se,"_blank","noopener,noreferrer")}})();let Z=N[F];if(Z)try{const{session:$}=await a.getOAuthRuntimeSession(Z);if($.status==="completed"&&$.hasAccessToken)return Z}catch{Z=void 0}const z=await a.createOAuthRuntimeSession({serverName:F});Z=z.session.id,E($=>({...$,[F]:Z})),U(z.session.authorizeLaunchUrl||z.session.authorizationUrl||""),await UC({sessionId:Z,source:a,serverName:F,onLaunchUrl:U});try{const{accessToken:$}=await a.getOAuthRuntimeSessionToken(Z);$&&P($)}catch{}return Z};try{R(!0);const F=await V(f.id);q={[f.id]:F}}catch(F){y({status:"error",message:`OAuth login failed: ${F instanceof Error?F.message:String(F)}`,testedAt:new Date().toISOString()}),R(!1);return}finally{R(!1)}}try{const F=(await a.discoverToolsForAnalysis({serverNames:[f.id],oauthRuntimeSessions:q})).servers[0];F&&F.warnings.length===0?y({status:"success",toolNames:F.tools.map(U=>U.name),toolCount:F.tools.length,testedAt:new Date().toISOString()}):y({status:"error",message:F?.warnings[0]??"Connection failed",testedAt:new Date().toISOString()})}catch(V){y({status:"error",message:V instanceof Error?V.message:String(V),testedAt:new Date().toISOString()})}},G=async()=>{if(!f.name.trim()){Pe({title:"Name is required",variant:"destructive"});return}const q=Lz(f);if(q){Pe({title:"Validation Error",description:q,variant:"destructive"});return}const V={...f,authValue:f.authValue?.trim(),apiKeyHeaderName:f.apiKeyHeaderName?.trim()||void 0};j(!0);try{if(i)await r([...n,V]),Pe({title:"Server created"}),t(`/libraries/servers/${encodeURIComponent(V.id)}`);else{const F=n.map(U=>U.id===c?.id?V:U);await r(F),Pe({title:"Server saved"}),V.id!==o&&t(`/libraries/servers/${encodeURIComponent(V.id)}`,{replace:!0})}}finally{j(!1)}},B=async()=>{const q=n.filter(V=>V.id!==c?.id);await r(q),Pe({title:"Server deleted"}),t("/libraries/servers")},W=()=>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(wt,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(Mo,{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(wt,{to:"/libraries/servers",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(Mo,{className:"h-4 w-4"})," Servers"]}),s.jsx("h1",{className:"text-2xl font-bold",children:i?"New Server":d(f)})]}),!i&&s.jsxs(re,{type:"button",onClick:()=>{M()},disabled:b.status==="loading"||O,children:[s.jsx(F$,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),S&&s.jsxs(qe,{children:[s.jsxs(At,{className:"flex-row items-center justify-between space-y-0",children:[s.jsx(_t,{className:"text-base",children:"Connection Test"}),s.jsx("button",{type:"button",onClick:()=>C(!1),className:"rounded-sm opacity-70 hover:opacity-100",children:s.jsx(ws,{className:"h-4 w-4"})})]}),s.jsxs(We,{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}),W()&&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:W()})]})]}),b.status==="loading"&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(hr,{className:"h-4 w-4 animate-spin"}),O?"Waiting for OAuth login in browser…":"Connecting to MCP server…"]}),b.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(mc,{className:"h-4 w-4 shrink-0"}),"Connected — discovered ",b.toolCount," tool",b.toolCount!==1?"s":""]}),b.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:b.toolNames.slice(0,5).map(q=>s.jsx("li",{className:"font-mono text-xs",children:q},q))})]}),_&&s.jsxs("div",{className:"rounded-md border bg-muted/40 p-3 space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"OAuth access token"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("code",{className:"flex-1 truncate text-xs font-mono text-muted-foreground",children:[_.slice(0,32),"…"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",className:"shrink-0 h-7 px-2 text-xs",onClick:()=>{navigator.clipboard.writeText(_)},children:[s.jsx(ys,{className:"mr-1 h-3 w-3"}),"Copy token"]})]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(b.testedAt).toLocaleString()]})]}),b.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"})," — ",b.message]}),PM[f.transport]&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",PM[f.transport]]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Tested at ",new Date(b.testedAt).toLocaleString()]})]})]})]}),s.jsxs(qe,{children:[s.jsx(At,{children:s.jsx(_t,{className:"text-base",children:"Configuration"})}),s.jsxs(We,{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(Fe,{children:"Name"}),s.jsx(ht,{value:f.name,onChange:q=>h(V=>({...V,name:q.target.value})),placeholder:"e.g. Filesystem MCP"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Transport"}),s.jsxs(Pn,{value:f.transport,onValueChange:q=>h(V=>({...V,transport:q})),children:[s.jsx(An,{children:s.jsx(kn,{})}),s.jsxs(_n,{children:[s.jsx(dt,{value:"stdio",children:"stdio"}),s.jsx(dt,{value:"sse",children:"SSE"}),s.jsx(dt,{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(Fe,{children:"Command"}),s.jsx(ht,{value:f.command||"",onChange:q=>h(V=>({...V,command:q.target.value})),placeholder:"npx",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Args (comma-separated)"}),s.jsx(ht,{value:(f.args||[]).join(", "),onChange:q=>h(V=>({...V,args:q.target.value.split(",").map(F=>F.trim()).filter(Boolean)})),placeholder:"-y, @mcp/server",className:"font-mono text-xs"})]})]}):s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"URL"}),s.jsx(ht,{value:f.url||"",onChange:q=>h(V=>({...V,url:q.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(Fe,{children:"Auth Type"}),s.jsxs(Pn,{value:f.authType||"none",onValueChange:q=>D(q),children:[s.jsx(An,{children:s.jsx(kn,{})}),s.jsxs(_n,{children:[s.jsx(dt,{value:"none",children:"None"}),s.jsx(dt,{value:"bearer",children:"Bearer Token"}),s.jsx(dt,{value:"api-key",children:"API Key"}),s.jsx(dt,{value:"oauth2",children:"OAuth 2.0"})]})]})]}),f.authType==="bearer"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Token"}),s.jsx(ht,{value:f.authValue||"",onChange:q=>h(V=>({...V,authValue:q.target.value})),placeholder:"${DATABRICKS_TOKEN}",className:"font-mono text-xs"})]})]}),f.authType==="bearer"&&s.jsxs("p",{className:"text-xs text-muted-foreground -mt-1",children:["Use ",s.jsx("code",{className:"rounded bg-muted px-1",children:"${VAR_NAME}"})," to reference an environment variable, or enter a token directly."]}),f.authType==="api-key"&&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:"API Key"}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Header Name"}),s.jsx(ht,{value:f.apiKeyHeaderName||"X-API-Key",onChange:q=>h(V=>({...V,apiKeyHeaderName:q.target.value})),placeholder:"X-API-Key",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Value"}),s.jsx(ht,{value:f.authValue||"",onChange:q=>h(V=>({...V,authValue:q.target.value})),placeholder:"${MY_API_KEY}",className:"font-mono text-xs"})]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Use ",s.jsx("code",{className:"rounded bg-muted px-1",children:"${VAR_NAME}"})," to reference an environment variable, or enter a value directly."]})]}),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:"flex gap-2",children:[s.jsx(re,{type:"button",variant:!f.oauthMode||f.oauthMode==="pre_registered"?"default":"outline",size:"sm",onClick:()=>h(q=>({...q,oauthMode:"pre_registered"})),children:"Pre-registered"}),s.jsx(re,{type:"button",variant:f.oauthMode==="dcr"?"default":"outline",size:"sm",onClick:()=>h(q=>({...q,oauthMode:"dcr",oauthClientId:void 0,oauthClientSecret:void 0})),children:"DCR (Dynamic)"})]}),(!f.oauthMode||f.oauthMode==="pre_registered")&&s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Client ID"}),s.jsx(ht,{value:f.oauthClientId||"",onChange:q=>h(V=>({...V,oauthClientId:q.target.value})),placeholder:"your-client-id",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Client Secret (optional)"}),s.jsx(ht,{type:"password",value:f.oauthClientSecret||"",onChange:q=>h(V=>({...V,oauthClientSecret:q.target.value})),placeholder:"••••••••",className:"font-mono text-xs"})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Scope (optional, space-separated)"}),s.jsx(ht,{value:f.oauthScope||"",onChange:q=>h(V=>({...V,oauthScope:q.target.value})),placeholder:"openid profile mcp",className:"font-mono text-xs"})]}),s.jsxs("div",{children:[s.jsxs("button",{type:"button",className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",onClick:()=>T(q=>!q),children:[s.jsx("span",{children:L?"▾":"▸"}),"Advanced — manual endpoint overrides"]}),L&&s.jsxs("div",{className:"mt-2 grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Authorization URL"}),s.jsx(ht,{value:f.oauthAuthorizationUrl||"",onChange:q=>h(V=>({...V,oauthAuthorizationUrl:q.target.value||void 0})),placeholder:"leave blank to use .well-known discovery",className:"font-mono text-xs"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Token URL"}),s.jsx(ht,{value:f.oauthTokenEndpoint||"",onChange:q=>h(V=>({...V,oauthTokenEndpoint:q.target.value||void 0})),placeholder:"leave blank to use .well-known discovery",className:"font-mono text-xs"})]})]})]})]}),s.jsxs("div",{className:"flex items-center justify-between pt-2",children:[s.jsx("div",{children:!i&&s.jsx(re,{type:"button",variant:"destructive",size:"sm",onClick:()=>x(!0),children:"Delete"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(re,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/servers"),children:"Cancel"}),s.jsxs(re,{type:"button",size:"sm",onClick:()=>{G()},disabled:g,children:[g&&s.jsx(hr,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Server":"Save"]})]})]})]})]}),s.jsx(Os,{open:p,onOpenChange:x,children:s.jsxs(Ja,{children:[s.jsxs(Za,{children:[s.jsx(ts,{children:"Delete server?"}),s.jsxs(ns,{children:["This will permanently remove the server"," ",s.jsx("span",{className:"font-mono",children:f.name}),". This action cannot be undone."]})]}),s.jsxs(es,{children:[s.jsx(as,{children:"Cancel"}),s.jsx(rs,{onClick:()=>{B()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},Bme=()=>{const{agents:e,setAgents:t,reload:n,loading:r}=Xa(),a=Pa(),[i,o]=v.useState(null),[c,d]=v.useState(""),f=c.trim().toLowerCase(),h=v.useMemo(()=>f.length===0?e:e.filter(g=>{const j=g.name.toLowerCase(),b=g.model.toLowerCase();return j.includes(f)||b.includes(f)}),[e,f]),p=async g=>{const j=`${g.name}-copy`;let b=j,y=1;for(;e.some(C=>C.name===b);)b=`${j}-${y}`,y+=1;const S={...structuredClone(g),id:`agt-${Date.now()}`,name:b};await t([...e,S]),Pe({title:"Agent duplicated",description:`Created ${b}.`})},x=async g=>{await t(e.filter(j=>j.id!==g.id)),Pe({title:"Agent deleted",description:`${g.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(Sa,{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.jsx(SC,{value:c,onValueChange:d,placeholder:"Search agents..."}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{n()},disabled:r,children:[s.jsx(Aa,{className:"mr-2 h-4 w-4"}),"Refresh"]}),s.jsxs(re,{type:"button",size:"sm",onClick:()=>a("/libraries/agents/new"),children:[s.jsx(bs,{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(re,{type:"button",size:"sm",className:"mt-4",onClick:()=>a("/libraries/agents/new"),children:[s.jsx(bs,{className:"mr-2 h-4 w-4"}),"Add Agent"]})]}):h.length===0?s.jsx("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed py-12 text-center",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents match this filter."})}):s.jsx(qe,{children:s.jsx(We,{className:"p-0",children:s.jsxs(Br,{children:[s.jsx(zr,{children:s.jsxs(qt,{children:[s.jsx(tt,{children:"Name"}),s.jsx(tt,{children:"Provider"}),s.jsx(tt,{children:"Model"}),s.jsx(tt,{children:"Max Tokens"}),s.jsx(tt,{children:"Temperature"}),s.jsx(tt,{className:"text-right",children:"Actions"})]})}),s.jsx(Ur,{children:h.map(g=>s.jsxs(qt,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>a(`/libraries/agents/${encodeURIComponent(g.id)}`),children:[s.jsx(Be,{className:"font-medium",children:g.name}),s.jsx(Be,{children:s.jsx(OB,{provider:g.provider})}),s.jsx(Be,{children:s.jsx("span",{className:"font-mono text-xs",children:g.model})}),s.jsx(Be,{className:"font-mono text-xs",children:g.maxTokens}),s.jsx(Be,{className:"font-mono text-xs",children:g.temperature.toFixed(2)}),s.jsx(Be,{className:"text-right",onClick:j=>j.stopPropagation(),children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsxs(re,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(g),children:[s.jsx(_a,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{p(g)},children:[s.jsx(ys,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>a(`/libraries/agents/${encodeURIComponent(g.id)}`),children:[s.jsx(Xm,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})]})})]},g.id))})]})})}),s.jsx(Os,{open:!!i,onOpenChange:g=>!g&&o(null),children:s.jsxs(Ja,{children:[s.jsxs(Za,{children:[s.jsx(ts,{children:"Delete agent?"}),s.jsxs(ns,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-mono",children:i?.name})," from the library. This action cannot be undone."]})]}),s.jsxs(es,{children:[s.jsx(as,{children:"Cancel"}),s.jsx(rs,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{i&&x(i)},children:"Delete Agent"})]})]})})]})};var a8=["PageUp","PageDown"],s8=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],i8={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},hu="Slider",[BS,zme,Ume]=mf(hu),[o8]=mr(hu,[Ume]),[qme,wg]=o8(hu),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:x=()=>{},inverted:g=!1,form:j,...b}=e,y=v.useRef(new Set),S=v.useRef(0),N=o==="horizontal"?Wme:Vme,[E=[],_]=la({prop:h,defaultProp:f,onChange:D=>{[...y.current][S.current]?.focus(),p(D)}}),P=v.useRef(E);function O(D){const M=Xme(E,D);T(D,M)}function R(D){T(D,S.current)}function L(){const D=P.current[S.current];E[S.current]!==D&&x(E)}function T(D,M,{commit:G}={commit:!1}){const B=eve(i),W=tve(Math.round((D-r)/i)*i+r,B),q=hf(W,[r,a]);_((V=[])=>{const F=Gme(V,q,M);if(Zme(F,d*i)){S.current=F.indexOf(q);const U=String(F)!==String(V);return U&&G&&x(F),U?F:V}else return V})}return s.jsx(qme,{scope:e.__scopeSlider,name:n,disabled:c,min:r,max:a,valueIndexToChangeRef:S,thumbs:y.current,values:E,orientation:o,form:j,children:s.jsx(BS.Provider,{scope:e.__scopeSlider,children:s.jsx(BS.Slot,{scope:e.__scopeSlider,children:s.jsx(N,{"aria-disabled":c,"data-disabled":c?"":void 0,...b,ref:t,onPointerDown:Ie(b.onPointerDown,()=>{c||(P.current=E)}),min:r,max:a,inverted:g,onSlideStart:c?void 0:O,onSlideMove:c?void 0:R,onSlideEnd:c?void 0:L,onHomeKeyDown:()=>!c&&T(r,0,{commit:!0}),onEndKeyDown:()=>!c&&T(a,E.length-1,{commit:!0}),onStepKeyDown:({event:D,direction:M})=>{if(!c){const W=a8.includes(D.key)||D.shiftKey&&s8.includes(D.key)?10:1,q=S.current,V=E[q],F=i*W*M;T(V+F,q,{commit:!0})}}})})})})});l8.displayName=hu;var[c8,u8]=o8(hu,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Wme=v.forwardRef((e,t)=>{const{min:n,max:r,dir:a,inverted:i,onSlideStart:o,onSlideMove:c,onSlideEnd:d,onStepKeyDown:f,...h}=e,[p,x]=v.useState(null),g=xt(t,N=>x(N)),j=v.useRef(void 0),b=uu(a),y=b==="ltr",S=y&&!i||!y&&i;function C(N){const E=j.current||p.getBoundingClientRect(),_=[0,E.width],O=qC(_,S?[n,r]:[r,n]);return j.current=E,O(N-E.left)}return s.jsx(c8,{scope:e.__scopeSlider,startEdge:S?"left":"right",endEdge:S?"right":"left",direction:S?1:-1,size:"width",children:s.jsx(d8,{dir:b,"data-orientation":"horizontal",...h,ref:g,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:N=>{const E=C(N.clientX);o?.(E)},onSlideMove:N=>{const E=C(N.clientX);c?.(E)},onSlideEnd:()=>{j.current=void 0,d?.()},onStepKeyDown:N=>{const _=i8[S?"from-left":"from-right"].includes(N.key);f?.({event:N,direction:_?-1:1})}})})}),Vme=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=xt(t,h),x=v.useRef(void 0),g=!a;function j(b){const y=x.current||h.current.getBoundingClientRect(),S=[0,y.height],N=qC(S,g?[r,n]:[n,r]);return x.current=y,N(b-y.top)}return s.jsx(c8,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:s.jsx(d8,{"data-orientation":"vertical",...f,ref:p,style:{...f.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const y=j(b.clientY);i?.(y)},onSlideMove:b=>{const y=j(b.clientY);o?.(y)},onSlideEnd:()=>{x.current=void 0,c?.()},onStepKeyDown:b=>{const S=i8[g?"from-bottom":"from-top"].includes(b.key);d?.({event:b,direction:S?-1:1})}})})}),d8=v.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:a,onSlideEnd:i,onHomeKeyDown:o,onEndKeyDown:c,onStepKeyDown:d,...f}=e,h=wg(hu,n);return s.jsx(Ge.span,{...f,ref:t,onKeyDown:Ie(e.onKeyDown,p=>{p.key==="Home"?(o(p),p.preventDefault()):p.key==="End"?(c(p),p.preventDefault()):a8.concat(s8).includes(p.key)&&(d(p),p.preventDefault())}),onPointerDown:Ie(e.onPointerDown,p=>{const x=p.target;x.setPointerCapture(p.pointerId),p.preventDefault(),h.thumbs.has(x)?x.focus():r(p)}),onPointerMove:Ie(e.onPointerMove,p=>{p.target.hasPointerCapture(p.pointerId)&&a(p)}),onPointerUp:Ie(e.onPointerUp,p=>{const x=p.target;x.hasPointerCapture(p.pointerId)&&(x.releasePointerCapture(p.pointerId),i(p))})})}),f8="SliderTrack",p8=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=wg(f8,n);return s.jsx(Ge.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...r,ref:t})});p8.displayName=f8;var zS="SliderRange",h8=v.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=wg(zS,n),i=u8(zS,n),o=v.useRef(null),c=xt(t,o),d=a.values.length,f=a.values.map(x=>g8(x,a.min,a.max)),h=d>1?Math.min(...f):0,p=100-Math.max(...f);return s.jsx(Ge.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...r,ref:c,style:{...e.style,[i.startEdge]:h+"%",[i.endEdge]:p+"%"}})});h8.displayName=zS;var US="SliderThumb",m8=v.forwardRef((e,t)=>{const n=zme(e.__scopeSlider),[r,a]=v.useState(null),i=xt(t,c=>a(c)),o=v.useMemo(()=>r?n().findIndex(c=>c.ref.current===r):-1,[n,r]);return s.jsx(Hme,{...e,ref:i,index:o})}),Hme=v.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:a,...i}=e,o=wg(US,n),c=u8(US,n),[d,f]=v.useState(null),h=xt(t,C=>f(C)),p=d?o.form||!!d.closest("form"):!0,x=tv(d),g=o.values[r],j=g===void 0?0:g8(g,o.min,o.max),b=Yme(r,o.values.length),y=x?.[c.size],S=y?Qme(y,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(BS.ItemSlot,{scope:e.__scopeSlider,children:s.jsx(Ge.span,{role:"slider","aria-label":e["aria-label"]||b,"aria-valuemin":o.min,"aria-valuenow":g,"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:g===void 0?{display:"none"}:e.style,onFocus:Ie(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),p&&s.jsx(v8,{name:a??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:g},r)]})});m8.displayName=US;var Kme="RadioBubbleInput",v8=v.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const a=v.useRef(null),i=xt(a,r),o=ug(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(Ge.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});v8.displayName=Kme;function Gme(e=[],t,n){const r=[...e];return r[n]=t,r.sort((a,i)=>a-i)}function g8(e,t,n){const i=100/(n-t)*(e-t);return hf(i,[0,100])}function Yme(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Xme(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 Qme(e,t,n){const r=e/2,i=qC([0,50],[0,r]);return(r-i(t)*n)*n}function Jme(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Zme(e,t){if(t>0){const n=Jme(e);return Math.min(...n)>=t}return!0}function qC(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 eve(e){return(String(e).split(".")[1]||"").length}function tve(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var x8=l8,nve=p8,rve=h8,ave=m8;const y8=v.forwardRef(({className:e,...t},n)=>s.jsxs(x8,{ref:n,className:je("relative flex w-full touch-none select-none items-center",e),...t,children:[s.jsx(nve,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:s.jsx(rve,{className:"absolute h-full bg-primary"})}),s.jsx(ave,{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=x8.displayName;function sve(e){const t=ive(e),n=v.forwardRef((r,a)=>{const{children:i,...o}=r,c=v.Children.toArray(i),d=c.find(lve);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 ive(e){const t=v.forwardRef((n,r)=>{const{children:a,...i}=n;if(v.isValidElement(a)){const o=uve(a),c=cve(i,a.props);return a.type!==v.Fragment&&(c.ref=r?kr(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 ove=Symbol("radix.slottable");function lve(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ove}function cve(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 uve(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 jg="Popover",[b8]=mr(jg,[Yi]),Ff=Yi(),[dve,ao]=b8(jg),w8=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,c=Ff(t),d=v.useRef(null),[f,h]=v.useState(!1),[p,x]=la({prop:r,defaultProp:a??!1,onChange:i,caller:jg});return s.jsx(nv,{...c,children:s.jsx(dve,{scope:t,contentId:er(),triggerRef:d,open:p,onOpenChange:x,onOpenToggle:v.useCallback(()=>x(g=>!g),[x]),hasCustomAnchor:f,onCustomAnchorAdd:v.useCallback(()=>h(!0),[]),onCustomAnchorRemove:v.useCallback(()=>h(!1),[]),modal:o,children:n})})};w8.displayName=jg;var j8="PopoverAnchor",fve=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ao(j8,n),i=Ff(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:c}=a;return v.useEffect(()=>(o(),()=>c()),[o,c]),s.jsx(yf,{...i,...r,ref:t})});fve.displayName=j8;var S8="PopoverTrigger",N8=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ao(S8,n),i=Ff(n),o=xt(t,a.triggerRef),c=s.jsx(Ge.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":P8(a.open),...r,ref:o,onClick:Ie(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?c:s.jsx(yf,{asChild:!0,...i,children:c})});N8.displayName=S8;var WC="PopoverPortal",[pve,hve]=b8(WC,{forceMount:void 0}),C8=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=ao(WC,t);return s.jsx(pve,{scope:t,forceMount:n,children:s.jsx(nr,{present:n||i.open,children:s.jsx(Yc,{asChild:!0,container:a,children:r})})})};C8.displayName=WC;var Vc="PopoverContent",A8=v.forwardRef((e,t)=>{const n=hve(Vc,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=ao(Vc,e.__scopePopover);return s.jsx(nr,{present:r||i.open,children:i.modal?s.jsx(vve,{...a,ref:t}):s.jsx(gve,{...a,ref:t})})});A8.displayName=Vc;var mve=sve("PopoverContent.RemoveScroll"),vve=v.forwardRef((e,t)=>{const n=ao(Vc,e.__scopePopover),r=v.useRef(null),a=xt(t,r),i=v.useRef(!1);return v.useEffect(()=>{const o=r.current;if(o)return gv(o)},[]),s.jsx(wf,{as:mve,allowPinchZoom:!0,children:s.jsx(_8,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ie(e.onCloseAutoFocus,o=>{o.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Ie(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:Ie(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),gve=v.forwardRef((e,t)=>{const n=ao(Vc,e.__scopePopover),r=v.useRef(!1),a=v.useRef(!1);return s.jsx(_8,{...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()}})}),_8=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,x=ao(Vc,n),g=Ff(n);return mv(),s.jsx(bf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Zo,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>x.onOpenChange(!1),children:s.jsx(rv,{"data-state":P8(x.open),role:"dialog",id:x.contentId,...g,...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)"}})})})}),E8="PopoverClose",xve=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=ao(E8,n);return s.jsx(Ge.button,{type:"button",...r,ref:t,onClick:Ie(e.onClick,()=>a.onOpenChange(!1))})});xve.displayName=E8;var yve="PopoverArrow",bve=v.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Ff(n);return s.jsx(av,{...a,...r,ref:t})});bve.displayName=yve;function P8(e){return e?"open":"closed"}var wve=w8,jve=N8,Sve=C8,k8=A8;const Hc=wve,Kc=jve,Ho=v.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>s.jsx(Sve,{children:s.jsx(k8,{ref:a,align:t,sideOffset:n,className:je("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})}));Ho.displayName=k8.displayName;var kM=1,Nve=.9,Cve=.8,Ave=.17,Tj=.1,Ij=.999,_ve=.9999,Eve=.99,Pve=/[\\\/_+.#"@\[\(\{&]/,kve=/[\\\/_+.#"@\[\(\{&]/g,Ove=/[\s-]/,O8=/[\s-]/g;function qS(e,t,n,r,a,i,o){if(i===t.length)return a===e.length?kM:Eve;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,x,g,j;f>=0;)p=qS(e,t,n,r,f+1,i+1,o),p>h&&(f===a?p*=kM:Pve.test(e.charAt(f-1))?(p*=Cve,g=e.slice(a,f-1).match(kve),g&&a>0&&(p*=Math.pow(Ij,g.length))):Ove.test(e.charAt(f-1))?(p*=Nve,j=e.slice(a,f-1).match(O8),j&&a>0&&(p*=Math.pow(Ij,j.length))):(p*=Ave,a>0&&(p*=Math.pow(Ij,f-a))),e.charAt(f)!==t.charAt(i)&&(p*=_ve)),(p<Tj&&n.charAt(f-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(f-1)!==r.charAt(i))&&(x=qS(e,t,n,r,f+1,i+2,o),x*Tj>p&&(p=x*Tj)),p>h&&(h=p),f=n.indexOf(d,f+1);return o[c]=h,h}function OM(e){return e.toLowerCase().replace(O8," ")}function Rve(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,qS(e,t,OM(e),OM(t),0,0,{})}var id='[cmdk-group=""]',Mj='[cmdk-group-items=""]',Tve='[cmdk-group-heading=""]',R8='[cmdk-item=""]',RM=`${R8}:not([aria-disabled="true"])`,WS="cmdk-item-select",Yl="data-value",Ive=(e,t,n)=>Rve(e,t,n),T8=v.createContext(void 0),Bf=()=>v.useContext(T8),I8=v.createContext(void 0),VC=()=>v.useContext(I8),M8=v.createContext(void 0),$8=v.forwardRef((e,t)=>{let n=Xl(()=>{var $,te;return{search:"",value:(te=($=e.value)!=null?$:e.defaultValue)!=null?te:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Xl(()=>new Set),a=Xl(()=>new Map),i=Xl(()=>new Map),o=Xl(()=>new Set),c=D8(e),{label:d,children:f,value:h,onValueChange:p,filter:x,shouldFilter:g,loop:j,disablePointerSelection:b=!1,vimBindings:y=!0,...S}=e,C=er(),N=er(),E=er(),_=v.useRef(null),P=Vve();Ko(()=>{if(h!==void 0){let $=h.trim();n.current.value=$,O.emit()}},[h]),Ko(()=>{P(6,G)},[]);let O=v.useMemo(()=>({subscribe:$=>(o.current.add($),()=>o.current.delete($)),snapshot:()=>n.current,setState:($,te,se)=>{var Q,ce,le,me;if(!Object.is(n.current[$],te)){if(n.current[$]=te,$==="search")M(),T(),P(1,D);else if($==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let oe=document.getElementById(E);oe?oe.focus():(Q=document.getElementById(C))==null||Q.focus()}if(P(7,()=>{var oe;n.current.selectedItemId=(oe=B())==null?void 0:oe.id,O.emit()}),se||P(5,G),((ce=c.current)==null?void 0:ce.value)!==void 0){let oe=te??"";(me=(le=c.current).onValueChange)==null||me.call(le,oe);return}}O.emit()}},emit:()=>{o.current.forEach($=>$())}}),[]),R=v.useMemo(()=>({value:($,te,se)=>{var Q;te!==((Q=i.current.get($))==null?void 0:Q.value)&&(i.current.set($,{value:te,keywords:se}),n.current.filtered.items.set($,L(te,se)),P(2,()=>{T(),O.emit()}))},item:($,te)=>(r.current.add($),te&&(a.current.has(te)?a.current.get(te).add($):a.current.set(te,new Set([$]))),P(3,()=>{M(),T(),n.current.value||D(),O.emit()}),()=>{i.current.delete($),r.current.delete($),n.current.filtered.items.delete($);let se=B();P(4,()=>{M(),se?.getAttribute("id")===$&&D(),O.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:C,inputId:E,labelId:N,listInnerRef:_}),[]);function L($,te){var se,Q;let ce=(Q=(se=c.current)==null?void 0:se.filter)!=null?Q:Ive;return $?ce($,n.current.search,te):0}function T(){if(!n.current.search||c.current.shouldFilter===!1)return;let $=n.current.filtered.items,te=[];n.current.filtered.groups.forEach(Q=>{let ce=a.current.get(Q),le=0;ce.forEach(me=>{let oe=$.get(me);le=Math.max(oe,le)}),te.push([Q,le])});let se=_.current;W().sort((Q,ce)=>{var le,me;let oe=Q.getAttribute("id"),fe=ce.getAttribute("id");return((le=$.get(fe))!=null?le:0)-((me=$.get(oe))!=null?me:0)}).forEach(Q=>{let ce=Q.closest(Mj);ce?ce.appendChild(Q.parentElement===ce?Q:Q.closest(`${Mj} > *`)):se.appendChild(Q.parentElement===se?Q:Q.closest(`${Mj} > *`))}),te.sort((Q,ce)=>ce[1]-Q[1]).forEach(Q=>{var ce;let le=(ce=_.current)==null?void 0:ce.querySelector(`${id}[${Yl}="${encodeURIComponent(Q[0])}"]`);le?.parentElement.appendChild(le)})}function D(){let $=W().find(se=>se.getAttribute("aria-disabled")!=="true"),te=$?.getAttribute(Yl);O.setState("value",te||void 0)}function M(){var $,te,se,Q;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ce=0;for(let le of r.current){let me=(te=($=i.current.get(le))==null?void 0:$.value)!=null?te:"",oe=(Q=(se=i.current.get(le))==null?void 0:se.keywords)!=null?Q:[],fe=L(me,oe);n.current.filtered.items.set(le,fe),fe>0&&ce++}for(let[le,me]of a.current)for(let oe of me)if(n.current.filtered.items.get(oe)>0){n.current.filtered.groups.add(le);break}n.current.filtered.count=ce}function G(){var $,te,se;let Q=B();Q&&((($=Q.parentElement)==null?void 0:$.firstChild)===Q&&((se=(te=Q.closest(id))==null?void 0:te.querySelector(Tve))==null||se.scrollIntoView({block:"nearest"})),Q.scrollIntoView({block:"nearest"}))}function B(){var $;return($=_.current)==null?void 0:$.querySelector(`${R8}[aria-selected="true"]`)}function W(){var $;return Array.from((($=_.current)==null?void 0:$.querySelectorAll(RM))||[])}function q($){let te=W()[$];te&&O.setState("value",te.getAttribute(Yl))}function V($){var te;let se=B(),Q=W(),ce=Q.findIndex(me=>me===se),le=Q[ce+$];(te=c.current)!=null&&te.loop&&(le=ce+$<0?Q[Q.length-1]:ce+$===Q.length?Q[0]:Q[ce+$]),le&&O.setState("value",le.getAttribute(Yl))}function F($){let te=B(),se=te?.closest(id),Q;for(;se&&!Q;)se=$>0?qve(se,id):Wve(se,id),Q=se?.querySelector(RM);Q?O.setState("value",Q.getAttribute(Yl)):V($)}let U=()=>q(W().length-1),Z=$=>{$.preventDefault(),$.metaKey?U():$.altKey?F(1):V(1)},z=$=>{$.preventDefault(),$.metaKey?q(0):$.altKey?F(-1):V(-1)};return v.createElement(Ge.div,{ref:t,tabIndex:-1,...S,"cmdk-root":"",onKeyDown:$=>{var te;(te=S.onKeyDown)==null||te.call(S,$);let se=$.nativeEvent.isComposing||$.keyCode===229;if(!($.defaultPrevented||se))switch($.key){case"n":case"j":{y&&$.ctrlKey&&Z($);break}case"ArrowDown":{Z($);break}case"p":case"k":{y&&$.ctrlKey&&z($);break}case"ArrowUp":{z($);break}case"Home":{$.preventDefault(),q(0);break}case"End":{$.preventDefault(),U();break}case"Enter":{$.preventDefault();let Q=B();if(Q){let ce=new Event(WS);Q.dispatchEvent(ce)}}}}},v.createElement("label",{"cmdk-label":"",htmlFor:R.inputId,id:R.labelId,style:Kve},d),Sg(e,$=>v.createElement(I8.Provider,{value:O},v.createElement(T8.Provider,{value:R},$))))}),Mve=v.forwardRef((e,t)=>{var n,r;let a=er(),i=v.useRef(null),o=v.useContext(M8),c=Bf(),d=D8(e),f=(r=(n=d.current)==null?void 0:n.forceMount)!=null?r:o?.forceMount;Ko(()=>{if(!f)return c.item(a,o?.id)},[f]);let h=L8(a,i,[e.value,e.children,i],e.keywords),p=VC(),x=Gi(P=>P.value&&P.value===h.current),g=Gi(P=>f||c.filter()===!1?!0:P.search?P.filtered.items.get(a)>0:!0);v.useEffect(()=>{let P=i.current;if(!(!P||e.disabled))return P.addEventListener(WS,j),()=>P.removeEventListener(WS,j)},[g,e.onSelect,e.disabled]);function j(){var P,O;b(),(O=(P=d.current).onSelect)==null||O.call(P,h.current)}function b(){p.setState("value",h.current,!0)}if(!g)return null;let{disabled:y,value:S,onSelect:C,forceMount:N,keywords:E,..._}=e;return v.createElement(Ge.div,{ref:kr(i,t),..._,id:a,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!x,"data-disabled":!!y,"data-selected":!!x,onPointerMove:y||c.getDisablePointerSelection()?void 0:b,onClick:y?void 0:j},e.children)}),$ve=v.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...i}=e,o=er(),c=v.useRef(null),d=v.useRef(null),f=er(),h=Bf(),p=Gi(g=>a||h.filter()===!1?!0:g.search?g.filtered.groups.has(o):!0);Ko(()=>h.group(o),[]),L8(o,c,[e.value,e.heading,d]);let x=v.useMemo(()=>({id:o,forceMount:a}),[a]);return v.createElement(Ge.div,{ref:kr(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),Sg(e,g=>v.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},v.createElement(M8.Provider,{value:x},g))))}),Dve=v.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=v.useRef(null),i=Gi(o=>!o.search);return!n&&!i?null:v.createElement(Ge.div,{ref:kr(a,t),...r,"cmdk-separator":"",role:"separator"})}),Lve=v.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,i=VC(),o=Gi(f=>f.search),c=Gi(f=>f.selectedItemId),d=Bf();return v.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),v.createElement(Ge.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)}})}),Fve=v.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,i=v.useRef(null),o=v.useRef(null),c=Gi(f=>f.selectedItemId),d=Bf();return v.useEffect(()=>{if(o.current&&i.current){let f=o.current,h=i.current,p,x=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let g=f.offsetHeight;h.style.setProperty("--cmdk-list-height",g.toFixed(1)+"px")})});return x.observe(f),()=>{cancelAnimationFrame(p),x.unobserve(f)}}},[]),v.createElement(Ge.div,{ref:kr(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:d.listId},Sg(e,f=>v.createElement("div",{ref:kr(o,d.listInnerRef),"cmdk-list-sizer":""},f)))}),Bve=v.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:i,container:o,...c}=e;return v.createElement(yv,{open:n,onOpenChange:r},v.createElement(bv,{container:o},v.createElement(tu,{"cmdk-overlay":"",className:a}),v.createElement(nu,{"aria-label":e.label,"cmdk-dialog":"",className:i},v.createElement($8,{ref:t,...c}))))}),zve=v.forwardRef((e,t)=>Gi(n=>n.filtered.count===0)?v.createElement(Ge.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Uve=v.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...i}=e;return v.createElement(Ge.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Sg(e,o=>v.createElement("div",{"aria-hidden":!0},o)))}),Hr=Object.assign($8,{List:Fve,Item:Mve,Input:Lve,Group:$ve,Separator:Dve,Dialog:Bve,Empty:zve,Loading:Uve});function qve(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Wve(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function D8(e){let t=v.useRef(e);return Ko(()=>{t.current=e}),t}var Ko=typeof window>"u"?v.useEffect:v.useLayoutEffect;function Xl(e){let t=v.useRef();return t.current===void 0&&(t.current=e()),t}function Gi(e){let t=VC(),n=()=>e(t.snapshot());return v.useSyncExternalStore(t.subscribe,n,n)}function L8(e,t,n,r=[]){let a=v.useRef(),i=Bf();return Ko(()=>{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(Yl,c),a.current=c}),a}var Vve=()=>{let[e,t]=v.useState(),n=Xl(()=>new Map);return Ko(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function Hve(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Sg({asChild:e,children:t},n){return e&&v.isValidElement(t)?v.cloneElement(Hve(t),{ref:t.ref},n(t.props.children)):n(t)}var Kve={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Go=v.forwardRef(({className:e,...t},n)=>s.jsx(Hr,{ref:n,className:je("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Go.displayName=Hr.displayName;const Yo=v.forwardRef(({className:e,...t},n)=>s.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[s.jsx(JS,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),s.jsx(Hr.Input,{ref:n,className:je("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})]}));Yo.displayName=Hr.Input.displayName;const Xo=v.forwardRef(({className:e,...t},n)=>s.jsx(Hr.List,{ref:n,className:je("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));Xo.displayName=Hr.List.displayName;const Qo=v.forwardRef((e,t)=>s.jsx(Hr.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Qo.displayName=Hr.Empty.displayName;const Jo=v.forwardRef(({className:e,...t},n)=>s.jsx(Hr.Group,{ref:n,className:je("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}));Jo.displayName=Hr.Group.displayName;const Gve=v.forwardRef(({className:e,...t},n)=>s.jsx(Hr.Separator,{ref:n,className:je("-mx-1 h-px bg-border",e),...t}));Gve.displayName=Hr.Separator.displayName;const aa=v.forwardRef(({className:e,...t},n)=>s.jsx(Hr.Item,{ref:n,className:je("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}));aa.displayName=Hr.Item.displayName;const TM={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:[]},IM={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"},Yve=()=>({id:`agt-${Date.now()}`,name:"",provider:"openai",model:"gpt-4o",temperature:0,maxTokens:4096}),Xve=()=>{const{agentName:e}=tl(),t=Pa(),{agents:n,setAgents:r}=Xa(),{source:a}=qn(),i=e==="new",o=e?decodeURIComponent(e):"",c=i?null:n.find(F=>F.id===o)??n.find(F=>F.name===o),[d,f]=v.useState(()=>c??Yve()),[h,p]=v.useState(!1),[x,g]=v.useState(!1),[j,b]=v.useState({status:"idle"}),[y,S]=v.useState(!1),[C,N]=v.useState([]),[E,_]=v.useState(!1),[P,O]=v.useState(!1),[R,L]=v.useState(!1);v.useEffect(()=>{c&&f(c)},[c]);const T=d.provider==="anthropic"||d.provider==="openai"||d.provider==="azure",D=Array.from(new Set([...TM[d.provider]||[],...C])),M=D.includes(d.model),G=R||!!d.model&&!M,B=async()=>{if(S(!0),d.provider==="google"||d.provider==="custom"){b({status:"unsupported"});return}b({status:"loading"});try{const F=await a.listProviderModels(d.provider);b({status:"success",items:F.items,source:F.source,kind:F.kind,testedAt:new Date().toISOString()})}catch(F){b({status:"error",message:F instanceof Error?F.message:String(F),testedAt:new Date().toISOString()})}},W=async()=>{if(!T){Pe({title:"Provider discovery not supported",description:"Model discovery is available for Anthropic, OpenAI, and Azure OpenAI."});return}_(!0);try{const F=await a.listProviderModels(d.provider);N(F.items),Pe({title:F.kind==="deployments"?"Deployments loaded":"Models loaded",description:`${F.items.length} ${F.kind} from ${F.source}`})}catch(F){Pe({title:"Could not load provider models",description:String(F instanceof Error?F.message:F),variant:"destructive"})}finally{_(!1)}},q=async()=>{if(!d.name.trim()){Pe({title:"Name is required",variant:"destructive"});return}g(!0);try{if(i)await r([...n,d]),Pe({title:"Agent created"}),t(`/libraries/agents/${encodeURIComponent(d.id)}`);else{const F=n.map(U=>U.id===c?.id?d:U);await r(F),Pe({title:"Agent saved"}),d.id!==o&&t(`/libraries/agents/${encodeURIComponent(d.id)}`,{replace:!0})}}finally{g(!1)}},V=async()=>{const F=n.filter(U=>U.id!==c?.id);await r(F),Pe({title:"Agent deleted"}),t("/libraries/agents")};return!i&&!c?s.jsxs("div",{className:"space-y-4",children:[s.jsxs(wt,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(Mo,{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(wt,{to:"/libraries/agents",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[s.jsx(Mo,{className:"h-4 w-4"})," Agents"]}),s.jsx("h1",{className:"text-2xl font-bold",children:i?"New Agent":d.name})]}),!i&&s.jsxs(re,{type:"button",onClick:()=>{B()},children:[s.jsx(F$,{className:"mr-2 h-4 w-4"}),"Test Connection"]})]}),y&&s.jsxs(qe,{children:[s.jsxs(At,{className:"flex-row items-center justify-between space-y-0",children:[s.jsx(_t,{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(ws,{className:"h-4 w-4"})})]}),s.jsxs(We,{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(hr,{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(mc,{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(F=>s.jsx("li",{className:"font-mono text-xs",children:F},F))})]}),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]}),IM[d.provider]&&s.jsxs("p",{className:"rounded-md bg-muted px-3 py-2 text-xs text-muted-foreground",children:["Hint: ",IM[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(qe,{children:[s.jsx(At,{children:s.jsx(_t,{className:"text-base",children:"Configuration"})}),s.jsxs(We,{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(Fe,{children:"Name"}),s.jsx(ht,{value:d.name,onChange:F=>f(U=>({...U,name:F.target.value})),placeholder:"e.g. GPT-4o"})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Provider"}),s.jsxs(Pn,{value:d.provider,onValueChange:F=>f(U=>({...U,provider:F,model:TM[F]?.[0]||""})),children:[s.jsx(An,{children:s.jsx(kn,{})}),s.jsxs(_n,{children:[s.jsx(dt,{value:"openai",children:"OpenAI"}),s.jsx(dt,{value:"anthropic",children:"Anthropic"}),s.jsx(dt,{value:"azure",children:"Azure OpenAI"}),s.jsx(dt,{value:"google",children:"Google"}),s.jsx(dt,{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(Fe,{children:d.provider==="azure"?"Deployment":"Model"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(Hc,{open:P,onOpenChange:O,children:[s.jsx(Kc,{asChild:!0,children:s.jsxs(re,{type:"button",variant:"outline",role:"combobox","aria-expanded":P,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(Wt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(Ho,{className:"w-[420px] p-0",align:"start",children:s.jsxs(Go,{children:[s.jsx(Yo,{placeholder:`Search ${d.provider==="azure"?"deployments":"models"}...`}),s.jsxs(Xo,{children:[s.jsxs(Qo,{children:["No ",d.provider==="azure"?"deployments":"models"," found."]}),s.jsxs(Jo,{heading:d.provider==="azure"?"Deployments":"Models",children:[D.map(F=>s.jsxs(aa,{value:F,onSelect:U=>{f(Z=>({...Z,model:U})),L(!1),O(!1)},children:[s.jsx(mc,{className:je("mr-2 h-4 w-4",d.model===F?"opacity-100":"opacity-0")}),s.jsx("span",{className:"font-mono text-xs",children:F})]},F)),s.jsx(aa,{value:"__custom_model_id__",onSelect:()=>{L(!0),O(!1)},children:s.jsx("span",{className:"font-medium",children:d.provider==="azure"?"Custom deployment ID...":"Custom model ID..."})})]})]})]})})]}),T&&s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"h-9 shrink-0 text-xs",onClick:()=>{W()},disabled:E,title:d.provider==="azure"?"Fetch Azure OpenAI deployments":`Fetch ${d.provider} models`,children:[E?s.jsx(hr,{className:"mr-1 h-3 w-3 animate-spin"}):s.jsx(Aa,{className:"mr-1 h-3 w-3"}),d.provider==="azure"?"Fetch Deployments":"Fetch Models"]})]}),G&&s.jsx(ht,{value:d.model,onChange:F=>f(U=>({...U,model:F.target.value})),placeholder:d.provider==="azure"?"Type deployment name manually":"Type model name manually",className:"font-mono text-xs"}),C.length>0&&s.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Loaded ",C.length," ",d.provider==="azure"?"deployment names":"models"," from provider discovery."]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Max Tokens"}),s.jsx(ht,{type:"number",min:1,max:128e3,value:d.maxTokens,onChange:F=>f(U=>({...U,maxTokens:parseInt(F.target.value)||0})),className:"font-mono text-xs"})]})]}),s.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"Max Turns"}),s.jsx(ht,{type:"number",min:1,max:50,value:d.maxTurns??"",onChange:F=>{const U=F.target.value.trim();f(Z=>({...Z,maxTurns:U&&parseInt(U)||void 0}))},placeholder:"30 (default)",className:"font-mono text-xs"}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Maximum number of LLM round-trips (tool calls + final answer) per eval run."})]})}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Fe,{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:([F])=>f(U=>({...U,temperature:F})),min:0,max:2,step:.01})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{children:"System Prompt"}),s.jsx(Ha,{value:d.systemPrompt||"",onChange:F=>f(U=>({...U,systemPrompt:F.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(re,{type:"button",variant:"destructive",size:"sm",onClick:()=>p(!0),children:"Delete"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(re,{type:"button",variant:"outline",size:"sm",onClick:()=>t("/libraries/agents"),children:"Cancel"}),s.jsxs(re,{type:"button",size:"sm",onClick:()=>{q()},disabled:x,children:[x&&s.jsx(hr,{className:"mr-2 h-4 w-4 animate-spin"}),i?"Create Agent":"Save"]})]})]})]})]}),s.jsx(Os,{open:h,onOpenChange:p,children:s.jsxs(Ja,{children:[s.jsxs(Za,{children:[s.jsx(ts,{children:"Delete agent?"}),s.jsxs(ns,{children:["This will permanently remove the agent"," ",s.jsx("span",{className:"font-mono",children:d.name}),". This action cannot be undone."]})]}),s.jsxs(es,{children:[s.jsx(as,{children:"Cancel"}),s.jsx(rs,{onClick:()=>{V()},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})},MM="mcplab.resultAssistantScenarioHandoff",$M=()=>{const{testCaseId:e}=tl(),[t,n]=Xi(),r=Pa(),{source:a}=qn(),{scenarios:i,setScenarios:o,agents:c,servers:d,reload:f,loading:h}=Xa(),[p,x]=v.useState(""),[g,j]=v.useState("all"),[b,y]=v.useState("name"),[S,C]=v.useState("asc"),[N,E]=v.useState(""),[_,P]=v.useState(null),[O,R]=v.useState("idle"),[L,T]=v.useState(""),[D,M]=v.useState(""),[G,B]=v.useState(0),[W,q]=v.useState(null),V=v.useRef(null),F=v.useRef(!1),U=v.useRef(!1),Z=v.useRef(null),z=v.useRef(0),$=e?decodeURIComponent(e):void 0,te=$?i.findIndex(be=>be.id===$):-1,se=te>=0?i[te]:void 0,Q=async be=>{if(!se||te<0||!be)return;const _e=[...i];_e[te]=be,await o(_e)},ce=async()=>{const be=Z.current;if(!be||!se)return;if(F.current){U.current=!0;return}F.current=!0,U.current=!1;const _e=++z.current;R("saving"),T("");try{await Q(be),_e===z.current&&R("saved")}catch(X){const ge=X instanceof Error?X.message:String(X);_e===z.current&&(R("error"),T(ge)),Pe({title:"Could not save scenario",description:ge,variant:"destructive"})}finally{F.current=!1,U.current&&(U.current=!1,ce())}},le=be=>{Z.current=be,R("dirty"),T(""),V.current&&window.clearTimeout(V.current),V.current=window.setTimeout(()=>{V.current=null,ce()},700)},me=async()=>{const be=`scn-${Date.now()}`;let _e=be,X=1;for(;i.some(ue=>ue.id===_e);)_e=`${be}-${X}`,X+=1;const ge={id:_e,name:"",serverIds:[],prompt:"",evalRules:[],extractRules:[]};await o([...i,ge]),r(`/libraries/test-cases/${encodeURIComponent(_e)}`),Pe({title:"Test case created",description:`Opened ${_e} for editing.`})},oe=be=>{const _e=(be||`scn-${Date.now()}`).trim().replace(/\s+/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||`scn-${Date.now()}`;let X=_e,ge=1;for(;i.some(ue=>ue.id===X);)X=`${_e}-${ge}`,ge+=1;return X},fe=async(be,_e=!1)=>{const X=oe(`${be.id}-copy`),ge={...structuredClone(be),id:X,name:be.name?`${be.name} (Copy)`:""};await o([...i,ge]),Pe({title:"Test case duplicated",description:`Created ${ge.id}.`}),_e&&r(`/libraries/test-cases/${encodeURIComponent(ge.id)}`)},Ce=async be=>{V.current&&(window.clearTimeout(V.current),V.current=null);const _e=i.filter(X=>X.id!==be.id);await o(_e),Pe({title:"Test case deleted",description:`${be.id} was removed.`}),se?.id===be.id&&(P(null),Z.current=null,R("idle"),T(""),r("/libraries/test-cases"))},ae=be=>be.map(_e=>d.find(X=>X.id===_e)).filter(Boolean).map(_e=>_e?.name||_e?.id).filter(Boolean),Re=v.useMemo(()=>{const be=new Set;for(const _e of i)for(const X of ae(_e.serverIds))be.add(X);return Array.from(be).sort((_e,X)=>_e.localeCompare(X))},[i,d]),Ae=v.useMemo(()=>{const be=p.trim().toLowerCase(),_e=i.filter(X=>{const ge=(X.name||"").toLowerCase(),ue=X.id.toLowerCase(),De=(X.prompt||"").toLowerCase(),Ye=ae(X.serverIds);return g!=="all"&&!Ye.includes(g)?!1:be?ge.includes(be)||ue.includes(be)||De.includes(be)||Ye.some(Ct=>Ct.toLowerCase().includes(be)):!0});return _e.sort((X,ge)=>{const ue=ae(X.serverIds),De=ae(ge.serverIds);let Ye=0;switch(b){case"id":Ye=X.id.localeCompare(ge.id);break;case"servers":Ye=ue.length-De.length;break;case"evalRules":Ye=X.evalRules.length-ge.evalRules.length;break;case"extractRules":Ye=X.extractRules.length-ge.extractRules.length;break;default:Ye=(X.name||X.id).localeCompare(ge.name||ge.id);break}return Ye===0&&(Ye=X.id.localeCompare(ge.id)),S==="asc"?Ye:-Ye}),_e},[i,p,g,b,S,d]);v.useEffect(()=>{let be=!0;return a.getWorkspaceSettings().then(_e=>{!be||!_e||E(_e.scenarioAssistantAgentName??"")}).catch(()=>{be&&E("")}),()=>{be=!1}},[a]),v.useEffect(()=>{if($&&t.get("assistantHandoff")==="1")try{const be=window.sessionStorage.getItem(MM);if(!be)return;const _e=JSON.parse(be);if(!_e||_e.scenarioId!==$||!_e.prompt)return;M(String(_e.prompt)),B(Date.now()),window.sessionStorage.removeItem(MM);const X=new URLSearchParams(t);X.delete("assistantHandoff"),n(X,{replace:!0}),Pe({title:"Suggestion sent to Scenario Assistant",description:"Review the suggestion and apply changes in the scenario editor."})}catch{}},[$,t,n]),v.useEffect(()=>{se?(P(structuredClone(se)),Z.current=structuredClone(se),R("idle"),T("")):(P(null),Z.current=null,R("idle"),T("")),V.current&&(window.clearTimeout(V.current),V.current=null),F.current=!1,U.current=!1},[se]),v.useEffect(()=>()=>{V.current&&window.clearTimeout(V.current)},[]);const Te=N||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(O$,{className:"h-6 w-6"}),"Manage Test Cases"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Reusable test case templates shared across configurations."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[se&&s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>r("/libraries/test-cases"),children:[s.jsx(Mo,{className:"mr-2 h-4 w-4"}),"Back to Overview"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{f()},disabled:h,children:[s.jsx(Aa,{className:"mr-2 h-4 w-4"}),"Refresh"]}),!se&&s.jsxs(re,{type:"button",size:"sm",onClick:()=>{me()},children:[s.jsx(bs,{className:"mr-1.5 h-3.5 w-3.5"}),"Add Test Case"]})]})]}),!se&&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(Fe,{className:"text-xs",children:"Search"}),s.jsxs("div",{className:"relative",children:[s.jsx(JS,{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(ht,{value:p,onChange:be=>x(be.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(Fe,{className:"text-xs",children:"Server Filter"}),s.jsxs(Pn,{value:g,onValueChange:j,children:[s.jsx(An,{className:"h-8 text-xs",children:s.jsx(kn,{})}),s.jsxs(_n,{children:[s.jsx(dt,{value:"all",children:"All servers"}),Re.map(be=>s.jsx(dt,{value:be,children:be},be))]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Sort By"}),s.jsxs(Pn,{value:b,onValueChange:be=>y(be),children:[s.jsx(An,{className:"h-8 text-xs",children:s.jsx(kn,{})}),s.jsxs(_n,{children:[s.jsx(dt,{value:"name",children:"Name"}),s.jsx(dt,{value:"id",children:"ID"}),s.jsx(dt,{value:"servers",children:"# Servers"}),s.jsx(dt,{value:"evalRules",children:"# Eval Rules"}),s.jsx(dt,{value:"extractRules",children:"# Extract Rules"})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(Fe,{className:"text-xs",children:"Direction"}),s.jsxs(Pn,{value:S,onValueChange:be=>C(be),children:[s.jsx(An,{className:"h-8 w-28 text-xs",children:s.jsx(kn,{})}),s.jsxs(_n,{children:[s.jsx(dt,{value:"asc",children:"Ascending"}),s.jsx(dt,{value:"desc",children:"Descending"})]})]})]})]}),s.jsx(qe,{children:s.jsxs(We,{className:"space-y-3 pt-6",children:[s.jsxs("div",{className:"text-xs text-muted-foreground",children:["Showing ",Ae.length," of ",i.length," test case",i.length!==1?"s":"","."]}),$&&!se&&s.jsxs("div",{className:"rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900",children:["Test case ",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 test cases yet."}):Ae.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No test cases match the current filters."}):s.jsx("div",{className:"grid gap-3",children:Ae.map(be=>{const _e=$===be.id,X=`/libraries/test-cases/${encodeURIComponent(be.id)}`,ge=ae(be.serverIds);return s.jsx("div",{className:`rounded-lg border p-3 ${_e?"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(wt,{to:X,className:"font-medium truncate hover:underline",children:be.name||be.id}),s.jsx(Qe,{variant:"outline",className:"font-mono text-[10px]",children:be.id}),_e&&s.jsx(Qe,{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:[ge.length," server",ge.length!==1?"s":""]}),s.jsxs("span",{children:[be.evalRules.length," eval rule",be.evalRules.length!==1?"s":""]}),s.jsxs("span",{children:[be.extractRules.length," extract rule",be.extractRules.length!==1?"s":""]})]}),ge.length>0&&s.jsx("div",{className:"flex flex-wrap gap-1",children:ge.map(ue=>s.jsx(Qe,{variant:"secondary",className:"text-[10px]",children:ue},`${be.id}-${ue}`))})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(re,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>q(be),children:[s.jsx(_a,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{fe(be)},children:[s.jsx(ys,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsx(re,{type:"button",size:"sm",variant:_e?"default":"outline",asChild:!0,children:s.jsxs(wt,{to:X,children:[s.jsx(Xm,{className:"mr-1.5 h-3.5 w-3.5"}),"Edit"]})})]})]})},be.id)})})]})})]}),se&&_?s.jsxs(qe,{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(_t,{className:"text-base",children:"Edit Test Case"})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{fe(_,!0)},children:[s.jsx(ys,{className:"mr-1.5 h-3.5 w-3.5"}),"Duplicate"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>q(_),children:[s.jsx(_a,{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:se.id}),"."]}),s.jsx(Qe,{variant:"outline",className:`text-[10px] ${O==="saving"?"border-amber-300 text-amber-700":O==="saved"?"border-emerald-300 text-emerald-700":O==="error"?"border-destructive/40 text-destructive":O==="dirty"?"border-sky-300 text-sky-700":""}`,children:O==="saving"?"Saving...":O==="saved"?"Saved":O==="error"?"Save failed":O==="dirty"?"Unsaved changes":"Ready"}),O==="error"&&L&&s.jsx("span",{className:"text-[11px] text-destructive",children:L})]})})]}),s.jsx(We,{className:"pt-3",children:s.jsx(FS,{scenarios:[_],agents:c,servers:d,defaultAssistantAgentName:Te,assistantInitialPromptByScenarioId:D&&_?.id?{[_.id]:D}:void 0,assistantAutoOpenNonceByScenarioId:_?.id&&G?{[_.id]:G}:void 0,onChange:be=>{const _e=be[0];_e&&(P(_e),le(_e))},allowAdd:!1})})]}):null,s.jsx(Os,{open:!!W,onOpenChange:be=>!be&&q(null),children:s.jsxs(Ja,{children:[s.jsxs(Za,{children:[s.jsx(ts,{children:"Delete test case?"}),s.jsxs(ns,{children:["This will permanently remove"," ",s.jsx("span",{className:"font-medium",children:W?.name||W?.id})," ","from the library. This action cannot be undone."]})]}),s.jsxs(es,{children:[s.jsx(as,{children:"Cancel"}),s.jsx(rs,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{W&&(Ce(W),q(null))},children:"Delete Test Case"})]})]})})]})},Qve=()=>{const{source:e}=qn(),{agents:t,reload:n,loading:r}=Xa(),[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(""),Pe({title:"Could not load settings",description:j instanceof Error?j.message:String(j),variant:"destructive"})}finally{i(!1)}};v.useEffect(()=>{p()},[e]);const x=async j=>{f(j),c(!0);try{await e.updateWorkspaceSettings({scenarioAssistantAgentName:j||void 0}),Pe({title:"Settings updated",description:j?`Scenario Assistant Agent set to ${j}.`:"Scenario Assistant Agent cleared (will use first available agent by default)."})}catch(b){Pe({title:"Could not save settings",description:b instanceof Error?b.message:String(b),variant:"destructive"})}finally{c(!1)}},g=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(ZS,{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(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{g()},disabled:r||a,children:[s.jsx(Aa,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),s.jsxs(qe,{children:[s.jsxs(At,{className:"pb-3",children:[s.jsx(_t,{className:"text-base",children:"Scenario Assistant"}),s.jsx(wa,{children:"Default assistant model used on library test case pages. If unset, MCP Lab uses the first available agent automatically."})]}),s.jsxs(We,{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(Fe,{className:"text-xs",children:"Assistant Agent"}),s.jsxs(Pn,{value:h||"__none__",onValueChange:j=>{x(j==="__none__"?"":j)},disabled:o,children:[s.jsx(An,{className:"h-9 text-sm",children:s.jsx(kn,{placeholder:"Select assistant agent"})}),s.jsxs(_n,{children:[s.jsx(dt,{value:"__none__",children:"None (use first agent)"}),t.map(j=>s.jsxs(dt,{value:j.id,children:[j.name||j.id," · ",j.model]},j.id))]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Applies to `/libraries/test-cases/:testCaseId`. 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 Ng="Checkbox",[Jve]=mr(Ng),[Zve,HC]=Jve(Ng);function ege(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,[x,g]=la({prop:n,defaultProp:a??!1,onChange:d,caller:Ng}),[j,b]=v.useState(null),[y,S]=v.useState(null),C=v.useRef(!1),N=j?!!o||!!j.closest("form"):!0,E={checked:x,disabled:i,setChecked:g,control:j,setControl:b,name:c,form:o,value:h,hasConsumerStoppedPropagationRef:C,required:f,defaultChecked:qi(a)?!1:a,isFormControl:N,bubbleInput:y,setBubbleInput:S};return s.jsx(Zve,{scope:t,...E,children:tge(p)?p(E):r})}var F8="CheckboxTrigger",B8=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:x,isFormControl:g,bubbleInput:j}=HC(F8,e),b=xt(a,h),y=v.useRef(d);return v.useEffect(()=>{const S=i?.form;if(S){const C=()=>p(y.current);return S.addEventListener("reset",C),()=>S.removeEventListener("reset",C)}},[i,p]),s.jsx(Ge.button,{type:"button",role:"checkbox","aria-checked":qi(d)?"mixed":d,"aria-required":f,"data-state":V8(d),"data-disabled":c?"":void 0,disabled:c,value:o,...r,ref:b,onKeyDown:Ie(t,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Ie(n,S=>{p(C=>qi(C)?!0:!C),j&&g&&(x.current=S.isPropagationStopped(),x.current||S.stopPropagation())})})});B8.displayName=F8;var KC=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(ege,{__scopeCheckbox:n,checked:a,defaultChecked:i,disabled:c,required:o,onCheckedChange:f,name:r,form:h,value:d,internal_do_not_use_render:({isFormControl:x})=>s.jsxs(s.Fragment,{children:[s.jsx(B8,{...p,ref:t,__scopeCheckbox:n}),x&&s.jsx(W8,{__scopeCheckbox:n})]})})});KC.displayName=Ng;var z8="CheckboxIndicator",U8=v.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,i=HC(z8,n);return s.jsx(nr,{present:r||qi(i.checked)||i.checked===!0,children:s.jsx(Ge.span,{"data-state":V8(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});U8.displayName=z8;var q8="CheckboxBubbleInput",W8=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:x,setBubbleInput:g}=HC(q8,e),j=xt(n,g),b=ug(i),y=tv(r);v.useEffect(()=>{const C=x;if(!C)return;const N=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(N,"checked").set,P=!a.current;if(b!==i&&_){const O=new Event("click",{bubbles:P});C.indeterminate=qi(i),_.call(C,qi(i)?!1:i),C.dispatchEvent(O)}},[x,b,i,a]);const S=v.useRef(qi(i)?!1:i);return s.jsx(Ge.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,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});W8.displayName=q8;function tge(e){return typeof e=="function"}function qi(e){return e==="indeterminate"}function V8(e){return qi(e)?"indeterminate":e?"checked":"unchecked"}const Wr=v.forwardRef(({className:e,...t},n)=>s.jsx(KC,{ref:n,className:je("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(U8,{className:je("flex items-center justify-center text-current"),children:s.jsx(mc,{className:"h-4 w-4"})})}));Wr.displayName=KC.displayName;const nge=el("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"}}),fc=v.forwardRef(({className:e,variant:t,...n},r)=>s.jsx("div",{ref:r,role:"alert",className:je(nge({variant:t}),e),...n}));fc.displayName="Alert";const pc=v.forwardRef(({className:e,...t},n)=>s.jsx("h5",{ref:n,className:je("mb-1 font-medium leading-none tracking-tight",e),...t}));pc.displayName="AlertTitle";const hc=v.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:je("text-sm [&_p]:leading-relaxed",e),...t}));hc.displayName="AlertDescription";function rge(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:x,children:g,...j}=p,b=x?.[e]?.[d]||c,y=v.useMemo(()=>j,Object.values(j));return s.jsx(b.Provider,{value:y,children:g})};f.displayName=i+"Provider";function h(p,x){const g=x?.[e]?.[d]||c,j=v.useContext(g);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,age(a,...t)]}function age(...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 sge=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],H8=sge.reduce((e,t)=>{const n=hv(`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,[ige]=rge(GC),[oge,lge]=ige(GC),K8=v.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:a,getValueLabel:i=cge,...o}=e;(a||a===0)&&!DM(a)&&console.error(uge(`${a}`,"Progress"));const c=DM(a)?a:YC;r!==null&&!LM(r,c)&&console.error(dge(`${r}`,"Progress"));const d=LM(r,c)?r:null,f=Vm(d)?i(d,c):void 0;return s.jsx(oge,{scope:n,value:d,max:c,children:s.jsx(H8.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":Vm(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":X8(d,c),"data-value":d??void 0,"data-max":c,...o,ref:t})})});K8.displayName=GC;var G8="ProgressIndicator",Y8=v.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,a=lge(G8,n);return s.jsx(H8.div,{"data-state":X8(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...r,ref:t})});Y8.displayName=G8;function cge(e,t){return`${Math.round(e/t*100)}%`}function X8(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Vm(e){return typeof e=="number"}function DM(e){return Vm(e)&&!isNaN(e)&&e>0}function LM(e,t){return Vm(e)&&!isNaN(e)&&e<=t&&e>=0}function uge(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 dge(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 Q8=K8,fge=Y8;const Cg=v.forwardRef(({className:e,value:t,...n},r)=>s.jsx(Q8,{ref:r,className:je("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:s.jsx(fge,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Cg.displayName=Q8.displayName;function J8(e){const t=e.toLowerCase();return t.includes("side-effectful prefix")||t.includes("destructive behavior")||t.includes("destructivehint")}function FM(e){try{return JSON.stringify(e,null,2)}catch{return"[schema not serializable]"}}const wo=["critical","high","medium","low","info"];function gh(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 pge(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 BM(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"tool"}function $j({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(Q7,{className:"h-3.5 w-3.5"}),"Suggested improvement"]}),s.jsx("p",{children:e})]})}function XC(e){const t=[],n=(r,a)=>{t.push(`#### ${r}`),t.push("```json");try{t.push(JSON.stringify(a,null,2))}catch{t.push('"[schema not serializable]"')}t.push("```")};if(t.push("# MCP Tool Analysis Report",""),t.push(`- Created: ${e.createdAt}`),t.push(`- Assistant Agent: ${e.assistantAgentName}`),t.push(`- Assistant Model: ${e.assistantAgentModel}`),e.mcpServerVersions&&Object.keys(e.mcpServerVersions).length>0){const r=Object.entries(e.mcpServerVersions).map(([a,i])=>`${a}: ${i??"unknown"}`).join(", ");t.push(`- MCP Server Versions: ${r}`)}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 r of e.servers){t.push(`## Server: ${r.serverName}`),r.warnings.length>0&&t.push(...r.warnings.map(a=>`- Warning: ${a}`),"");for(const a of r.tools){if(t.push(`### ${a.publicToolName}`),a.title&&t.push(`- Title: ${a.title}`),t.push(`- Safety: ${a.safetyClassification} (${a.classificationReason})`),a.inputSchema!==void 0&&n("Input schema",a.inputSchema),a.outputSchema!==void 0&&n("Output schema",a.outputSchema),a.metadataReview?.issues.length){t.push("#### Metadata issues");for(const i of a.metadataReview.issues)t.push(` - [${i.severity}] ${i.title}: ${i.detail}`)}if(a.deeperAnalysis)if(!a.deeperAnalysis.attempted)t.push(`- Deeper analysis: skipped (${a.deeperAnalysis.skippedReason??"unknown"})`);else{t.push(`- Deeper analysis sample calls: ${a.deeperAnalysis.sampleCalls.length}`);for(const i of a.deeperAnalysis.sampleCalls){t.push(` - Call ${i.callIndex}: ${i.ok?"ok":"error"}${i.durationMs?` (${i.durationMs}ms)`:""}`),i.error&&t.push(` - Error: ${i.error}`);for(const o of i.observations)t.push(` - ${o}`)}}if(a.overallRecommendations.length>0){t.push("#### Recommendations");for(const i of a.overallRecommendations)t.push(` - ${i}`)}if(a.metadataReview?.evalReadinessNotes.length){t.push("#### Agent/Eval readiness notes");for(const i of a.metadataReview.evalReadinessNotes)t.push(` - ${i}`)}t.push("")}}return`${t.join(`
136
- `)}
137
- `}function Z8({report:e}){const[t,n]=Xi(),[r,a]=v.useState([...wo]),[i,o]=v.useState(new Set),[c,d]=v.useState(""),[f,h]=v.useState(!1),p=t.get("groupBy")==="severity"?"severity":"tool",x=v.useRef(null),g=c.trim().toLowerCase(),j=v.useMemo(()=>new Set(r),[r]),b=R=>{a(L=>{const T=L.includes(R)?L.filter(D=>D!==R):[...L,R];return T.length===0?[...wo]:T})},y=R=>{const L=new URLSearchParams(t);R==="severity"?L.set("groupBy","severity"):L.delete("groupBy"),n(L,{replace:!0})},S=v.useMemo(()=>{const R={critical:[],high:[],medium:[],low:[],info:[]};for(const L of e.servers)for(const T of L.tools){const D=`tool-${BM(`${L.serverName}-${T.publicToolName}`)}`,M=`${L.serverName}::${T.publicToolName}`,G=T.publicToolName.split("::").pop()??T.publicToolName;for(const B of T.metadataReview?.issues??[]){const W=B.severity;R[W].push({key:`${M}-metadata-${B.id}`,toolAnchorId:D,toolLabel:M,toolDisplayName:G,sourceLabel:"Metadata review",issue:{id:B.id,title:B.title,detail:B.detail,severity:W,suggestion:B.suggestion}})}for(const B of T.deeperAnalysis?.sampleCalls??[])for(const W of B.issues){const q=W.severity;R[q].push({key:`${M}-call-${B.callIndex}-${W.id}`,toolAnchorId:D,toolLabel:M,toolDisplayName:G,sourceLabel:`Sample call ${B.callIndex}`,issue:{id:W.id,title:W.title,detail:W.detail,severity:q,suggestion:W.suggestion}})}}return R},[e.servers]),C=v.useMemo(()=>Array.from(new Set(e.servers.flatMap(R=>R.tools.map(L=>L.publicToolName)).map(R=>R.split("::").pop()??R))).sort((R,L)=>R.localeCompare(L)),[e.servers]),N=R=>g.length===0?!0:(R.toLowerCase().split("::").pop()??R.toLowerCase()).includes(g),E=R=>{if(!x.current)return;x.current.querySelectorAll("details").forEach(T=>{T.open=R})},_=()=>o(new Set(wo)),P=()=>o(new Set),O=R=>{o(L=>{const T=new Set(L);return T.has(R)?T.delete(R):T.add(R),T})};return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[s.jsx(qe,{children:s.jsxs(We,{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(qe,{children:s.jsxs(We,{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(qe,{children:s.jsxs(We,{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(qe,{children:[s.jsxs(At,{className:"pb-3",children:[s.jsx(_t,{className:"text-base",children:"Analysis Overview"}),s.jsx(wa,{children:"Visual breakdown of findings by severity. Click badges to filter the report."})]}),s.jsx(We,{children:s.jsxs("div",{className:"flex flex-wrap gap-2",children:[wo.filter(R=>e.summary.issueCounts[R]>0).map(R=>{const L=j.has(R);return s.jsx("button",{type:"button",onClick:()=>b(R),className:"rounded-full","aria-pressed":L,children:s.jsxs(Qe,{variant:"outline",className:`capitalize font-normal ${L?gh(R):pge(R)} ${L?"ring-1 ring-current":"opacity-70"}`,children:[R,": ",e.summary.issueCounts[R]]})},R)}),s.jsx(re,{type:"button",size:"sm",variant:"ghost",onClick:()=>a([...wo]),className:"h-7 px-2 text-xs",children:"Reset"})]})})]}),s.jsxs("div",{className:"space-y-0",children:[s.jsx(pg,{value:p,onValueChange:R=>{(R==="tool"||R==="severity")&&y(R)},className:"min-w-0 px-3 pt-1",children:s.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-2 border-b",children:[s.jsxs(Lf,{className:"h-auto justify-start rounded-none bg-transparent p-0",children:[s.jsx(xs,{value:"tool",className:"-mb-px h-10 rounded-none rounded-t border border-border border-b-border bg-muted/20 px-6 text-sm font-semibold 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:"Report by Tool"}),s.jsx(xs,{value:"severity",className:"-mb-px h-10 rounded-none rounded-t border border-border border-b-border bg-muted/20 px-6 text-sm font-semibold 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:"By Severity"})]}),s.jsxs("div",{className:"mb-2 flex min-w-0 items-center gap-2",children:[s.jsx("span",{className:"whitespace-nowrap text-xs text-muted-foreground",children:"Filter tools"}),s.jsxs(Hc,{open:f,onOpenChange:h,children:[s.jsx(Kc,{asChild:!0,children:s.jsxs(re,{type:"button",variant:"outline",role:"combobox","aria-expanded":f,className:"h-8 w-[320px] max-w-full justify-between text-xs font-normal",children:[s.jsx("span",{className:"truncate text-left",children:c||"All tools"}),s.jsx(Wt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(Ho,{className:"w-[320px] p-0",align:"end",children:s.jsxs(Go,{children:[s.jsx(Yo,{placeholder:"Search tools..."}),s.jsxs(Xo,{children:[s.jsx(Qo,{children:"No tools found."}),s.jsxs(Jo,{children:[s.jsx(aa,{value:"all tools",onSelect:()=>{d(""),h(!1)},children:"All tools"}),C.map(R=>s.jsx(aa,{value:R,onSelect:()=>{d(R),h(!1)},children:R},R))]})]})]})})]}),p==="severity"&&s.jsxs(s.Fragment,{children:[s.jsx(re,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:P,children:"Expand all"}),s.jsx(re,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:_,children:"Collapse all"})]}),p==="tool"&&s.jsxs(s.Fragment,{children:[s.jsx(re,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>E(!0),children:"Expand all"}),s.jsx(re,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>E(!1),children:"Collapse all"})]})]})]})}),p==="severity"?s.jsx("div",{className:"space-y-4",children:wo.filter(R=>j.has(R)).map(R=>{const L=S[R].filter(D=>N(D.toolLabel));if(L.length===0)return null;const T=i.has(R);return s.jsxs(qe,{children:[s.jsx(At,{className:"pb-3",children:s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx(_t,{className:"text-base capitalize",children:R}),s.jsxs(wa,{children:[L.length," finding(s)"]})]}),s.jsx("div",{className:"flex gap-2",children:s.jsx(re,{type:"button",variant:"outline",size:"sm",className:"h-8 text-xs",onClick:()=>O(R),children:T?"Expand":"Collapse"})})]})}),!T&&s.jsx(We,{className:"space-y-2",children:L.map((D,M)=>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:M+1}),s.jsx("span",{className:"min-w-0 font-bold leading-tight",children:D.issue.title})]}),s.jsx(Qe,{variant:"outline",className:`shrink-0 text-[10px] ${gh(D.issue.severity)}`,children:D.issue.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",D.issue.detail]}),s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-[11px]",children:[s.jsx(Qe,{variant:"secondary",className:"font-normal",children:D.sourceLabel}),s.jsx(re,{type:"button",variant:"ghost",size:"sm",className:"h-6 px-2 font-mono text-[11px]",title:D.toolLabel,onClick:()=>{y("tool"),requestAnimationFrame(()=>{document.getElementById(D.toolAnchorId)?.scrollIntoView({behavior:"smooth",block:"start"})})},children:D.toolDisplayName})]}),D.issue.suggestion&&s.jsx($j,{text:D.issue.suggestion})]},D.key))})]},R)})}):s.jsx("div",{ref:x,className:"space-y-4",children:e.servers.map(R=>{const L=R.tools.filter(T=>{const D=`${R.serverName}::${T.publicToolName}`;if(!N(D))return!1;const M=[...T.metadataReview?.issues??[],...T.deeperAnalysis?.sampleCalls.flatMap(G=>G.issues)??[]];return M.length===0?r.length===wo.length:M.some(G=>j.has(G.severity))});return L.length===0?null:s.jsxs(qe,{children:[s.jsxs(At,{className:"pb-3",children:[s.jsx(_t,{className:"text-base",children:R.serverName}),s.jsxs(wa,{children:["Discovered ",R.toolCountDiscovered," · Showing ",L.length," of ",R.toolCountAnalyzed," analyzed · Skipped ",R.toolCountSkipped]})]}),s.jsxs(We,{className:"space-y-3",children:[R.warnings.length>0&&s.jsxs(fc,{children:[s.jsx(pc,{children:"Warnings"}),s.jsx(hc,{children:s.jsx("ul",{className:"ml-4 list-disc space-y-1",children:R.warnings.map(T=>s.jsx("li",{children:T},`${R.serverName}-${T}`))})})]}),L.map(T=>{const D=T.publicToolName.split("::").pop()??T.publicToolName,M=J8(T.classificationReason),G=T.safetyClassification==="read_like"?"read-like":M?"write/delete":"unsafe/unknown";return s.jsxs("details",{id:`tool-${BM(`${R.serverName}-${T.publicToolName}`)}`,className:"group rounded-md border p-3",children:[s.jsx("summary",{className:"cursor-pointer list-none",children:s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx("div",{className:"min-w-0 truncate font-mono text-sm",title:T.publicToolName,children:D}),s.jsx(Qe,{variant:"outline",className:`shrink-0 whitespace-nowrap ${T.safetyClassification==="read_like"?"border-emerald-200 bg-emerald-50 text-emerald-700":M?"border-amber-300 bg-amber-50 text-amber-800":"border-slate-300 bg-slate-100 text-slate-700"}`,children:G})]}),s.jsx(Wt,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform group-open:rotate-180"})]}),T.title&&s.jsx("p",{className:"text-sm text-foreground/85",children:T.title}),T.description&&s.jsx("p",{className:"text-xs text-muted-foreground",children:T.description})]})}),s.jsxs("div",{className:"mt-3 space-y-2",children:[(T.inputSchema!==void 0||T.outputSchema!==void 0)&&s.jsxs("details",{className:"group/schema rounded border bg-muted/10 p-2",children:[s.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-2 text-xs font-medium",children:[s.jsx("span",{children:"Schemas"}),s.jsx(Wt,{className:"h-4 w-4 text-muted-foreground transition-transform group-open/schema:rotate-180"})]}),s.jsxs("div",{className:"mt-2 space-y-2",children:[T.inputSchema!==void 0&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-[11px] font-medium text-muted-foreground",children:"Input schema"}),s.jsx("pre",{className:"max-h-52 overflow-auto rounded border bg-muted/20 p-2 text-[11px]",children:FM(T.inputSchema)})]}),T.outputSchema!==void 0&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-[11px] font-medium text-muted-foreground",children:"Output schema"}),s.jsx("pre",{className:"max-h-52 overflow-auto rounded border bg-muted/20 p-2 text-[11px]",children:FM(T.outputSchema)})]})]})]}),T.metadataReview&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Metadata review"}),T.metadataReview.issues.filter(B=>j.has(B.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:T.metadataReview.issues.filter(B=>j.has(B.severity)).map((B,W)=>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:W+1}),s.jsx("span",{className:"min-w-0 font-bold leading-tight",children:B.title})]}),s.jsx(Qe,{variant:"outline",className:`shrink-0 text-[10px] ${gh(B.severity)}`,children:B.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",B.detail]}),B.suggestion&&s.jsx($j,{text:B.suggestion})]},B.id))})]}),T.deeperAnalysis&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-xs font-medium",children:"Deeper analysis"}),T.deeperAnalysis.attempted?s.jsx("div",{className:"space-y-2",children:T.deeperAnalysis.sampleCalls.map(B=>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(Qe,{variant:B.ok?"secondary":"destructive",className:"text-[10px]",children:B.ok?"ok":"error"}),s.jsxs("span",{children:["Call ",B.callIndex]}),B.durationMs!==void 0&&s.jsxs("span",{className:"text-muted-foreground",children:[B.durationMs,"ms"]})]}),B.error&&s.jsx("p",{className:"text-destructive",children:B.error}),B.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:B.observations.map((W,q)=>s.jsx("li",{children:W},`${T.publicToolName}-obs-${B.callIndex}-${q}`))})]}),B.issues.filter(W=>j.has(W.severity)).length>0&&s.jsx("div",{className:"mt-2 space-y-1",children:B.issues.filter(W=>j.has(W.severity)).map((W,q)=>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:q+1}),s.jsx("span",{className:"min-w-0 font-bold leading-tight",children:W.title})]}),s.jsx(Qe,{variant:"outline",className:`shrink-0 text-[10px] ${gh(W.severity)}`,children:W.severity})]}),s.jsxs("p",{children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",W.detail]}),W.suggestion&&s.jsx($j,{text:W.suggestion})]},`${B.callIndex}-${W.id}`))})]},`${T.publicToolName}-call-${B.callIndex}`))}):s.jsx("p",{className:"text-xs text-muted-foreground",children:T.deeperAnalysis.skippedReason??"Skipped"})]})]})]},T.publicToolName)})]})]},R.serverName)})})]})]})}function hge(e){let t=0;const n=new Set,r=new Set;for(const i of e){const o=typeof i.payload?.message=="string"?i.payload.message:"";if(!o)continue;const c=o.match(/\((\d+)\s+selected\s+of\s+\d+\s+discovered\)/i);c&&(t=Math.max(t,Number(c[1])||0));const d=o.match(/^Started\s+(.+)$/);d&&n.add(d[1]);const f=o.match(/^Finished\s+(.+)$/);f&&r.add(f[1])}const a=t>0?Math.max(0,Math.min(100,Math.round(r.size/t*100))):0;return{totalTools:t,startedTools:n.size,finishedTools:r.size,percent:a}}const Dj="mcplab.toolAnalysis.activeJobId";function zM(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 UM({text:e}){return s.jsxs(fN,{children:[s.jsx(pN,{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(H7,{className:"h-3.5 w-3.5"})})}),s.jsx(lv,{className:"max-w-xs text-xs",children:s.jsx("p",{children:e})})]})}function mge(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 vge=()=>{const{source:e}=qn(),{servers:t,agents:n,loading:r,reload:a}=Xa(),[i,o]=v.useState(""),[c,d]=v.useState([]),[f,h]=v.useState(!1),[p,x]=v.useState([]),[g,j]=v.useState({}),[b,y]=v.useState(""),[S,C]=v.useState(!0),[N,E]=v.useState(!1),[_,P]=v.useState(2),[O,R]=v.useState(1),[L,T]=v.useState(1e4),[D,M]=v.useState(null),[G,B]=v.useState([]),[W,q]=v.useState(null),[V,F]=v.useState(null),[U,Z]=v.useState(!1),[z,$]=v.useState("configure"),[te,se]=v.useState("idle"),[Q,ce]=v.useState({}),[le,me]=v.useState(!1),oe=v.useRef(null),fe=v.useRef(null),Ce=i||n[0]?.name||"",ae=v.useMemo(()=>hge(G),[G]);v.useEffect(()=>{let ee=!0;return e.getWorkspaceSettings().then(Se=>{!ee||!Se||o(Se.scenarioAssistantAgentName??"")}).catch(()=>{ee&&o("")}),()=>{ee=!1}},[e]),v.useEffect(()=>()=>{oe.current?.()},[]),v.useEffect(()=>{const ee=fe.current;ee&&requestAnimationFrame(()=>{ee.scrollTop=ee.scrollHeight})},[G.length]);const Re=()=>{try{sessionStorage.removeItem(Dj)}catch{}},Ae=ee=>{try{sessionStorage.setItem(Dj,ee)}catch{}},Te=ee=>{oe.current?.(),oe.current=e.subscribeToolAnalysisJob(ee,Se=>{if(B(Ne=>[...Ne,Se]),Se.type==="completed")e.getToolAnalysisResult(ee).then(Ne=>{q(Ne.report),F(Ne.savedReportId??null)}).catch(Ne=>Pe({title:"Could not load analysis report",description:Ne instanceof Error?Ne.message:String(Ne),variant:"destructive"})).finally(()=>{Re(),M(null),Z(!1),se("idle"),$("run")});else if(Se.type==="error"){const Ne=String(Se.payload?.message??"");Re(),se(Ne.toLowerCase().includes("abort")?"stopped":"error"),M(null),Z(!1)}})};v.useEffect(()=>{if(D||W)return;let ee="";try{ee=sessionStorage.getItem(Dj)??""}catch{ee=""}if(ee)return $("run"),se("running"),Z(!0),M(ee),B([]),Te(ee),()=>{}},[e,D,W]);const be=async()=>{if(c.length===0){x([]),j({});return}const ee=async ke=>{const it=(()=>{let Ot=!1;return zt=>{if(Ot||!zt)return;Ot=!0;const Ln=zt.startsWith("http")?zt:`${window.location.origin}${zt}`;window.open(Ln,"_blank","noopener,noreferrer"),Pe({title:`OAuth login required for ${ke}`,description:"Complete login in the opened browser tab. Discovery will continue automatically."})}})();let Ue=Q[ke];if(Ue)try{const{session:Ot}=await e.getOAuthRuntimeSession(Ue);if(Ot.status==="completed"&&Ot.hasAccessToken)return Ue}catch{Ue=void 0}const Tt=await e.createOAuthRuntimeSession({serverName:ke});return Ue=Tt.session.id,ce(Ot=>({...Ot,[ke]:Ue})),it(Tt.session.authorizeLaunchUrl||Tt.session.authorizationUrl||""),await UC({sessionId:Ue,source:e,serverName:ke,onLaunchUrl:it}),Ue};let Se;const Ne=c[0],ze=t.find(ke=>ke.id===Ne);try{if(ze?.authType==="oauth2"){me(!0);const ke=await ee(Ne);Se={[Ne]:ke}}}catch(ke){Pe({title:"OAuth login failed",description:ke instanceof Error?ke.message:String(ke),variant:"destructive"}),me(!1);return}finally{me(!1)}h(!0);try{const ke=await e.discoverToolsForAnalysis({serverNames:c,oauthRuntimeSessions:Se});x(ke.servers),j(it=>{const Ue={};for(const Tt of ke.servers){const Ot=it[Tt.serverName]??[],zt=Tt.tools.map(yn=>yn.name),Ln=Ot.filter(yn=>zt.includes(yn));Ue[Tt.serverName]=Ln.length>0?Ln:zt}return Ue})}catch(ke){Pe({title:"Could not discover MCP tools",description:ke instanceof Error?ke.message:String(ke),variant:"destructive"})}finally{h(!1)}};v.useEffect(()=>{be()},[c.join("|")]);const _e=v.useMemo(()=>{const ee=b.trim().toLowerCase();return ee?p.map(Se=>({...Se,tools:Se.tools.filter(Ne=>Ne.name.toLowerCase().includes(ee)||(Ne.description||"").toLowerCase().includes(ee))})).filter(Se=>Se.tools.length>0):p},[p,b]),X=v.useMemo(()=>Object.values(g).reduce((ee,Se)=>ee+Se.length,0),[g]),ge=c[0]??"",ue=async()=>{if(!S&&!N){Pe({title:"Select at least one mode",variant:"destructive"});return}if(c.length!==1){Pe({title:"Select exactly one server",variant:"destructive"});return}if(X===0){Pe({title:"Select at least one tool",variant:"destructive"});return}Z(!0),B([]),q(null),F(null),$("run"),se("running");try{let ee;const Se=c[0];if(t.find(ke=>ke.id===Se)?.authType==="oauth2"){me(!0);const ke=Q[Se];if(!ke)throw new Error(`OAuth login for '${Se}' is required. Click Discover Tools first to authenticate.`);ee={[Se]:ke}}const{jobId:ze}=await e.startToolAnalysis({serverNames:c,oauthRuntimeSessions:ee,selectedToolsByServer:g,maxParallelTools:_,modes:{metadataReview:S,deeperAnalysis:N},deeperAnalysisOptions:{autoRunPolicy:"read_only_allowlist",sampleCallsPerTool:O,toolCallTimeoutMs:L}});M(ze),Ae(ze),Te(ze)}catch(ee){Z(!1),se("error"),$("run"),Pe({title:"Could not start tool analysis",description:ee instanceof Error?ee.message:String(ee),variant:"destructive"})}finally{me(!1)}},De=async()=>{if(!D)return;const ee=D;try{const Se=await e.stopToolAnalysis(ee);if(Se.status==="completed"){oe.current?.(),oe.current=null;const Ne=await e.getToolAnalysisResult(ee);q(Ne.report),F(Ne.savedReportId??null),Re(),M(null),Z(!1),se("idle"),$("run"),Pe({title:"Analysis already finished",description:"Showing the result overview."});return}if(Se.status==="stopped"){oe.current?.(),oe.current=null,Re(),M(null),Z(!1),se("stopped"),Pe({title:"Analysis stopped"});return}if(Se.status==="error"){oe.current?.(),oe.current=null,Re(),M(null),Z(!1),se("error"),Pe({title:"Analysis already ended with an error",description:"Review the progress log and return to Configure Analysis."});return}Pe({title:"Stopping analysis..."})}catch(Se){Pe({title:"Could not stop analysis",description:Se instanceof Error?Se.message:String(Se),variant:"destructive"})}},Ye=()=>{$("configure"),se("idle"),M(null)},Ct=(ee,Se)=>{d(Ne=>Se?[ee]:Ne.filter(ze=>ze!==ee))},Ft=(ee,Se,Ne)=>{j(ze=>{const ke=new Set(ze[ee]??[]);return Ne?ke.add(Se):ke.delete(Se),{...ze,[ee]:Array.from(ke)}})},mt=(ee,Se)=>{j(Ne=>({...Ne,[ee]:Se}))},Nt=!0,Vt=D!==null||G.length>0||te==="stopped"||te==="error",pn=!!W,ln=ee=>{if(ee==="configure"&&Nt){$("configure");return}if(ee==="run"&&Vt){$("run");return}ee==="report"&&pn&&$("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(I$,{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:()=>ln("configure"),className:"rounded-full","aria-label":"Open Configure Analysis",children:s.jsx(Qe,{variant:z==="configure"?"default":"outline",className:"cursor-pointer",children:"Configure Analysis"})}),s.jsx("button",{type:"button",onClick:()=>ln("run"),disabled:!Vt,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Run Analysis",children:s.jsx(Qe,{variant:z==="run"?"default":"outline",className:Vt?"cursor-pointer":"cursor-not-allowed",children:"Run Analysis"})}),s.jsx("button",{type:"button",onClick:()=>ln("report"),disabled:!pn,className:"rounded-full disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Open Report",children:s.jsx(Qe,{variant:z==="report"?"default":"outline",className:pn?"cursor-pointer":"cursor-not-allowed",children:"Report"})})]})]}),z==="configure"&&s.jsxs(qe,{children:[s.jsxs(At,{children:[s.jsx(_t,{className:"text-base",children:"Run MCP analysis"}),s.jsx(wa,{children:"Select servers and tools, choose metadata review and/or deeper sample-call analysis, then run the report."})]}),s.jsxs(We,{className:"space-y-5",children:[!Ce&&s.jsxs(fc,{children:[s.jsx(pc,{children:"No assistant agent available"}),s.jsxs(hc,{children:["Add a library agent in"," ",s.jsx(wt,{to:"/libraries/agents",className:"underline",children:"Agents"})," ","and optionally set the default Scenario Assistant Agent in"," ",s.jsx(wt,{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(Fe,{className:"text-xs",children:"Servers"}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{a()},disabled:r||le,children:[s.jsx(Aa,{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(ee=>{const Se=c.includes(ee.id);return s.jsxs("label",{className:"flex items-start gap-2 rounded-md border p-2 text-sm",children:[s.jsx(Wr,{checked:Se,onCheckedChange:Ne=>Ct(ee.id,!!Ne)}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-medium",children:ee.name||ee.id}),ee.url&&s.jsx("div",{className:"truncate text-xs text-muted-foreground",children:ee.url})]})]},ee.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(Fe,{className:"text-xs",children:"Filter visible tools"}),s.jsxs("div",{className:"relative",children:[s.jsx(JS,{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(ht,{className:"h-9 pl-8",placeholder:"Filter tools by name or description...",value:b,onChange:ee=>y(ee.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(Fe,{className:"text-xs",children:ge?`Tools for ${ge}`:"Tools"}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{be()},disabled:f||le||c.length===0,children:[f&&s.jsx(hr,{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..."}):_e.length===0&&!f?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No discovered tools match the current filters."}):_e.map(ee=>{const Se=new Set(g[ee.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:ee.serverName}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(re,{type:"button",size:"sm",variant:"ghost",onClick:()=>mt(ee.serverName,ee.tools.map(Ne=>Ne.name)),children:"Select all"}),s.jsx(re,{type:"button",size:"sm",variant:"ghost",onClick:()=>mt(ee.serverName,[]),children:"Clear"})]})]}),ee.warnings.length>0&&s.jsx("div",{className:"mb-2 space-y-1",children:ee.warnings.map(Ne=>s.jsx("div",{className:"text-xs text-amber-700",children:mge(ee.serverName,Ne)},`${ee.serverName}-${Ne}`))}),s.jsx("div",{className:"grid gap-2",children:ee.tools.map(Ne=>{const ze=J8(Ne.classificationReason),ke=Ne.safetyClassification==="read_like"?"read-like":ze?"write/delete":"unsafe/unknown";return s.jsxs("label",{className:"flex items-start gap-2 rounded border p-2",children:[s.jsx(Wr,{checked:Se.has(Ne.name),onCheckedChange:it=>Ft(ee.serverName,Ne.name,!!it)}),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:Ne.name}),Ne.title&&s.jsx("span",{className:"text-xs text-muted-foreground",children:Ne.title}),s.jsx(Qe,{variant:"outline",className:`text-[10px] ${Ne.safetyClassification==="read_like"?"border-emerald-200 bg-emerald-50 text-emerald-700":ze?"border-amber-300 bg-amber-50 text-amber-800":"border-slate-300 bg-slate-100 text-slate-700"}`,children:ke}),Ne.inputSchema&&s.jsx(Qe,{variant:"outline",className:"border-border text-[10px] text-muted-foreground",children:"schema: input"}),Ne.outputSchema&&s.jsx(Qe,{variant:"outline",className:"border-border text-[10px] text-muted-foreground",children:"schema: output"})]}),Ne.description&&s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:Ne.description}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:Ne.classificationReason})]})]},`${ee.serverName}-${Ne.name}`)})})]},ee.serverName)})}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Selected tools: ",X]})]}),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(Wr,{checked:S,onCheckedChange:ee=>C(!!ee)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Metadata / schema review",s.jsx(UM,{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(Wr,{checked:N,onCheckedChange:ee=>E(!!ee)}),s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:["Deeper analysis",s.jsx(UM,{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(Fe,{className:"text-xs",children:"Max parallel tools"}),s.jsx(ht,{type:"number",min:1,max:8,value:_,onChange:ee=>P(Math.max(1,Math.min(8,Number(ee.target.value)||2))),className:"h-8"})]}),N?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{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(Fe,{className:"text-xs",children:"Sample calls per tool"}),s.jsx(ht,{type:"number",min:1,max:5,value:O,onChange:ee=>R(Math.max(1,Math.min(5,Number(ee.target.value)||1))),className:"h-8"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Tool call timeout (ms)"}),s.jsx(ht,{type:"number",min:1e3,max:6e4,step:500,value:L,onChange:ee=>T(Math.max(1e3,Math.min(6e4,Number(ee.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(re,{type:"button",onClick:()=>{ue()},disabled:U||le||!!D,children:[(U||!!D)&&s.jsx(hr,{className:"mr-2 h-4 w-4 animate-spin"}),"Analyze Tools"]})})]})]}),z==="run"&&s.jsxs(qe,{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(_t,{className:"flex items-center gap-2 text-base",children:s.jsx("span",{children:"Progress"})}),s.jsx(wa,{children:D?"Live tool-analysis job events:":W?"Analysis finished. Review the summary below or open the saved report details.":te==="stopped"?"Analysis was stopped. You can return to Configure Analysis.":te==="error"?"Analysis ended with an error. Review the log and go back to Configure Analysis.":"Analysis finished."})]}),D?s.jsx(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{De()},children:"Stop Analysis"}):s.jsx(re,{type:"button",size:"sm",variant:"outline",onClick:Ye,children:"Back to Configure Analysis"})]})}),s.jsxs(We,{className:"space-y-2",children:[D&&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(hr,{className:"h-3.5 w-3.5 animate-spin"}),"Analysis is still running..."]}),(ae.totalTools>0||D)&&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:ae.totalTools>0?`${ae.finishedTools}/${ae.totalTools} tools finished`:"Preparing analysis..."}),s.jsx("span",{children:ae.totalTools>0?`${ae.percent}%`:"0%"})]}),s.jsx(Cg,{value:ae.totalTools>0?ae.percent:0,className:"h-2"})]}),G.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:D?"Starting analysis...":"No progress events captured."}):s.jsx("div",{ref:fe,className:"max-h-64 space-y-1 overflow-auto rounded border bg-muted/20 p-2",children:G.map((ee,Se)=>s.jsxs("div",{className:"text-xs",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(ee.ts).toLocaleTimeString()}),s.jsx(Qe,{variant:"outline",className:"mr-2 text-[10px]",children:ee.type}),s.jsx("span",{className:"break-all",children:typeof ee.payload.message=="string"?ee.payload.message:JSON.stringify(ee.payload)})]},`${ee.ts}-${Se}`))}),!D&&W&&s.jsx(qe,{className:"mt-2 border-green-200 bg-green-50/40 dark:border-green-900/40 dark:bg-green-950/10",children:s.jsxs(We,{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:[W.summary.toolsAnalyzed," tools analyzed, ",W.summary.toolsSkipped," skipped, across"," ",W.summary.serversAnalyzed," server",W.summary.serversAnalyzed!==1?"s":"","."]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[V&&s.jsx(re,{asChild:!0,size:"sm",children:s.jsx(wt,{to:`/tool-analysis-results/${V}`,children:"Open result details"})}),s.jsx(re,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(wt,{to:"/tool-analysis-results",children:"View all results"})}),s.jsx(re,{type:"button",size:"sm",variant:"outline",onClick:()=>ln("report"),children:"View inline report"})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[W.summary.issueCounts.critical>0&&s.jsxs(Qe,{className:"bg-red-600 text-white hover:bg-red-600",children:["Critical: ",W.summary.issueCounts.critical]}),W.summary.issueCounts.high>0&&s.jsxs(Qe,{className:"bg-orange-500 text-white hover:bg-orange-500",children:["High: ",W.summary.issueCounts.high]}),W.summary.issueCounts.medium>0&&s.jsxs(Qe,{className:"bg-amber-500 text-white hover:bg-amber-500",children:["Medium: ",W.summary.issueCounts.medium]}),W.summary.issueCounts.low>0&&s.jsxs(Qe,{className:"bg-blue-500 text-white hover:bg-blue-500",children:["Low: ",W.summary.issueCounts.low]}),W.summary.issueCounts.info>0&&s.jsxs(Qe,{variant:"outline",children:["Info: ",W.summary.issueCounts.info]}),Object.values(W.summary.issueCounts).every(ee=>ee===0)&&s.jsx(Qe,{className:"bg-green-600 text-white hover:bg-green-600",children:"No findings"})]})]})})]})]}),z==="report"&&W&&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:[W.summary.toolsAnalyzed," tools analyzed across ",W.summary.serversAnalyzed," server",W.summary.serversAnalyzed!==1?"s":"","."]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(re,{type:"button",size:"sm",variant:"outline",onClick:Ye,children:"Back to Configure Analysis"}),V&&s.jsxs(s.Fragment,{children:[s.jsx(re,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx(wt,{to:`/tool-analysis-results/${V}`,children:"Open saved report"})}),s.jsx(re,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx(wt,{to:"/tool-analysis-results",children:"View all reports"})})]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>zM(`tool-analysis-${Date.now()}.json`,`${JSON.stringify(W,null,2)}
138
- `,"application/json"),children:[s.jsx(Va,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>zM(`tool-analysis-${Date.now()}.md`,XC(W),"text/markdown"),children:[s.jsx(Va,{className:"mr-2 h-4 w-4"}),"Export Markdown"]})]})]}),s.jsx(Z8,{report:W})]})]})};function qM(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 gge(){const{source:e}=qn(),[t,n]=v.useState([]),[r,a]=v.useState(!0),[i,o]=v.useState(null),[c,d]=v.useState(!1),[f,h]=v.useState("all"),[p,x]=v.useState(!1),g=async()=>{a(!0);try{n(await e.listToolAnalysisResults())}catch(N){Pe({title:"Could not load tool analysis results",description:N instanceof Error?N.message:String(N),variant:"destructive"})}finally{a(!1)}};v.useEffect(()=>{g()},[]);const j=v.useMemo(()=>Array.from(new Set(t.flatMap(N=>N.serverNames))).sort((N,E)=>N.localeCompare(E)),[t]),b=v.useMemo(()=>f==="all"?t:t.filter(N=>N.serverNames.includes(f)),[t,f]),y=v.useMemo(()=>t.find(N=>N.reportId===i)??null,[t,i]),S=async()=>{if(i){d(!0);try{await e.deleteToolAnalysisSavedResult(i),n(N=>N.filter(E=>E.reportId!==i)),Pe({title:"Tool analysis report deleted"}),o(null)}catch(N){Pe({title:"Could not delete report",description:N instanceof Error?N.message:String(N),variant:"destructive"})}finally{d(!1)}}},C=async(N,E)=>{try{const _=await e.getToolAnalysisSavedResult(N);E==="json"?qM(`${N}.json`,`${JSON.stringify(_,null,2)}
139
- `,"application/json"):qM(`${N}.md`,XC(_.report),"text/markdown")}catch(_){Pe({title:"Could not export saved report",description:_ instanceof Error?_.message:String(_),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(M$,{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.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"MCP server"}),s.jsxs(Hc,{open:p,onOpenChange:x,children:[s.jsx(Kc,{asChild:!0,children:s.jsxs(re,{type:"button",variant:"outline",role:"combobox","aria-expanded":p,className:"h-9 w-[240px] justify-between font-normal",children:[s.jsx("span",{className:"truncate text-left",children:f==="all"?"All servers":f}),s.jsx(Wt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(Ho,{className:"w-[240px] p-0",align:"start",children:s.jsxs(Go,{children:[s.jsx(Yo,{placeholder:"Search servers..."}),s.jsxs(Xo,{children:[s.jsx(Qo,{children:"No servers found."}),s.jsxs(Jo,{children:[s.jsx(aa,{value:"all servers",onSelect:()=>{h("all"),x(!1)},children:"All servers"}),j.map(N=>s.jsx(aa,{value:N,onSelect:()=>{h(N),x(!1)},children:N},N))]})]})]})})]})]}),s.jsx(re,{variant:"outline",onClick:()=>{g()},disabled:r,children:r?"Refreshing...":"Refresh"}),s.jsx(re,{asChild:!0,variant:"outline",children:s.jsx(wt,{to:"/tool-analysis",children:"Analyze MCP Tools"})})]})]}),s.jsx(qe,{children:s.jsx(We,{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(s.Fragment,{children:[s.jsx("div",{className:"border-b px-4 py-3",children:s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Showing ",s.jsx("span",{className:"font-medium text-foreground",children:b.length})," of"," ",s.jsx("span",{className:"font-medium text-foreground",children:t.length})," reports"]})}),b.length===0?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"No reports for the selected MCP server."}):s.jsxs(Br,{children:[s.jsx(zr,{children:s.jsxs(qt,{children:[s.jsx(tt,{children:"Report ID"}),s.jsx(tt,{children:"Evaluated"}),s.jsx(tt,{children:"Timestamp"}),s.jsx(tt,{children:"Issues"}),s.jsx(tt,{children:"Modes"}),s.jsx(tt,{className:"w-10"})]})}),s.jsx(Ur,{children:b.map(N=>s.jsxs(qt,{children:[s.jsx(Be,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(wt,{to:`/tool-analysis-results/${N.reportId}`,className:"font-mono text-xs text-primary hover:underline",children:N.reportId}),s.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[N.assistantAgentName," · ",N.assistantAgentModel]})]})}),s.jsx(Be,{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:N.serverNames.length})," · Tools:"," ",s.jsx("span",{className:"font-medium text-foreground",children:N.summary.toolsAnalyzed})," · ","Skipped: ",s.jsx("span",{className:"font-medium text-foreground",children:N.summary.toolsSkipped})]}),s.jsxs("div",{className:"font-mono text-xs text-foreground/80",children:[N.serverNames.slice(0,2).join(", "),N.serverNames.length>2?` +${N.serverNames.length-2}`:""]})]})}),s.jsx(Be,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(gf,{className:"h-3 w-3"}),new Date(N.createdAt).toLocaleString()]})}),s.jsx(Be,{children:s.jsxs("div",{className:"flex flex-wrap gap-1",children:[["critical","high","medium","low","info"].map(E=>N.summary.issueCounts[E]>0?s.jsxs(Qe,{variant:"outline",className:"capitalize",children:[E,": ",N.summary.issueCounts[E]]},`${N.reportId}-${E}`):null),Object.values(N.summary.issueCounts).every(E=>E===0)&&s.jsx(Qe,{variant:"outline",children:"No issues"})]})}),s.jsx(Be,{children:s.jsxs("div",{className:"flex flex-wrap gap-1",children:[N.modes.metadataReview&&s.jsx(Qe,{variant:"outline",children:"metadata"}),N.modes.deeperAnalysis&&s.jsx(Qe,{variant:"outline",children:"deeper"})]})}),s.jsx(Be,{children:s.jsxs(du,{children:[s.jsx(fu,{asChild:!0,children:s.jsx(re,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Ym,{className:"h-4 w-4"})})}),s.jsxs(ul,{align:"end",children:[s.jsx(Pr,{asChild:!0,children:s.jsx(wt,{to:`/tool-analysis-results/${N.reportId}`,children:"View"})}),s.jsxs(Pr,{onSelect:()=>{C(N.reportId,"json")},children:[s.jsx(Va,{className:"mr-2 h-3.5 w-3.5"})," Export JSON"]}),s.jsxs(Pr,{onSelect:()=>{C(N.reportId,"markdown")},children:[s.jsx(Va,{className:"mr-2 h-3.5 w-3.5"})," Export Markdown"]}),s.jsxs(Pr,{className:"text-destructive",onSelect:E=>{E.preventDefault(),o(N.reportId)},children:[s.jsx(_a,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},N.reportId))})]})]})})}),s.jsx(Os,{open:!!i,onOpenChange:N=>!N&&o(null),children:s.jsxs(Ja,{children:[s.jsxs(Za,{children:[s.jsx(ts,{children:"Delete tool analysis report?"}),s.jsx(ns,{children:y?`Delete saved report '${y.reportId}' from disk? This cannot be undone.`:"Delete this saved report from disk? This cannot be undone."})]}),s.jsxs(es,{children:[s.jsx(as,{disabled:c,children:"Cancel"}),s.jsx(rs,{onClick:N=>{N.preventDefault(),S()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function WM(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 xge(){const{id:e=""}=tl(),t=Pa(),{source:n}=qn(),[r,a]=v.useState(null),[i,o]=v.useState(!0),[c,d]=v.useState(!1),[f,h]=v.useState(!1),[p,x]=v.useState(!1);v.useEffect(()=>{let j=!0;return o(!0),d(!1),n.getToolAnalysisSavedResult(e).then(b=>{j&&a(b)}).catch(b=>{if(!j)return;const y=b instanceof Error?b.message:String(b);if(y.includes("(404)")){d(!0),a(null);return}Pe({title:"Could not load saved tool analysis report",description:y,variant:"destructive"})}).finally(()=>{j&&o(!1)}),()=>{j=!1}},[e,n]);const g=async()=>{x(!0);try{await n.deleteToolAnalysisSavedResult(e),Pe({title:"Tool analysis report deleted"}),t("/tool-analysis-results")}catch(j){Pe({title:"Could not delete report",description:j instanceof Error?j.message:String(j),variant:"destructive"})}finally{x(!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(re,{asChild:!0,variant:"outline",children:s.jsx(wt,{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:[r.report.mcpServerVersions&&Object.keys(r.report.mcpServerVersions).length>0&&s.jsxs("span",{className:"inline-flex items-center rounded-sm border border-border/60 bg-muted/30 px-1.5 py-1 text-[11px] text-muted-foreground",children:[s.jsx("span",{className:"font-medium",children:"MCP:"}),s.jsx("span",{className:"ml-1 font-mono",children:Object.entries(r.report.mcpServerVersions).map(([j,b])=>`${j}: ${b??"unknown"}`).join(", ")})]}),s.jsx(re,{asChild:!0,size:"sm",variant:"outline",children:s.jsx(wt,{to:"/tool-analysis-results",children:"Back to results"})}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>WM(`${r.reportId}.json`,`${JSON.stringify(r,null,2)}
140
- `,"application/json"),children:[s.jsx(Va,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>WM(`${r.reportId}.md`,XC(r.report),"text/markdown"),children:[s.jsx(Va,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>h(!0),children:[s.jsx(_a,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]}),s.jsx(Z8,{report:r.report}),s.jsx(Os,{open:f,onOpenChange:h,children:s.jsxs(Ja,{children:[s.jsxs(Za,{children:[s.jsx(ts,{children:"Delete tool analysis report?"}),s.jsxs(ns,{children:["Delete saved report '",r.reportId,"' from disk? This cannot be undone."]})]}),s.jsxs(es,{children:[s.jsx(as,{disabled:p,children:"Cancel"}),s.jsx(rs,{onClick:j=>{j.preventDefault(),g()},disabled:p,children:p?"Deleting...":"Delete"})]})]})})]})}const yge=[{id:"configure",label:"Configure Debug Session"},{id:"run",label:"Run / Inspect Flow"},{id:"report",label:"Report / Export"}];function Nr({text:e}){return s.jsx(dN,{delayDuration:200,children:s.jsxs(fN,{children:[s.jsx(pN,{type:"button",className:"inline-flex shrink-0 items-center",onClick:t=>t.preventDefault(),children:s.jsx(X7,{className:"h-3.5 w-3.5 text-muted-foreground/50 hover:text-muted-foreground"})}),s.jsx(lv,{className:"max-w-xs text-xs leading-relaxed",children:e})]})})}function VM(e){return navigator.clipboard.writeText(e)}function Lj(){return typeof window>"u"?"":window.location.port==="8685"?"http://127.0.0.1:8787":""}function bge(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 wge(){const{source:e}=qn(),{servers:t,reload:n,loading:r}=Xa(),[a,i]=v.useState("configure"),[o,c]=v.useState(""),[d,f]=v.useState("pre_registered"),[h,p]=v.useState("local_callback"),[x,g]=v.useState(!0),[j,b]=v.useState(!0),[y,S]=v.useState(!0),[C,N]=v.useState(""),[E,_]=v.useState(""),[P,O]=v.useState(""),[R,L]=v.useState(""),[T,D]=v.useState("__default__"),[M,G]=v.useState("{}"),[B,W]=v.useState(""),[q,V]=v.useState(""),[F,U]=v.useState(""),[Z,z]=v.useState(""),[$,te]=v.useState(""),[se,Q]=v.useState(""),[ce,le]=v.useState(""),[me,oe]=v.useState(""),[fe,Ce]=v.useState(null),[ae,Re]=v.useState(null),[Ae,Te]=v.useState([]),[be,_e]=v.useState(!1),[X,ge]=v.useState(!1),[ue,De]=v.useState(!1),[Ye,Ct]=v.useState("all"),[Ft,mt]=v.useState("all"),[Nt,Vt]=v.useState("inspector"),pn=v.useRef(null),ln=v.useRef(null),ee=v.useRef(!1),Se=v.useRef(j);v.useEffect(()=>{Se.current=j},[j]),v.useEffect(()=>()=>{pn.current?.(),pn.current=null},[]),v.useEffect(()=>{ln.current?.scrollIntoView({behavior:"smooth",block:"end"})},[Ae.length]);const Ne=v.useMemo(()=>t.filter(de=>de.authType==="oauth2"),[t]),ze=Ne.find(de=>de.id===o);v.useEffect(()=>{o&&(Ne.some(de=>de.id===o)||c(""))},[Ne,o]),v.useEffect(()=>{ze&&(ze.oauthMode==="dcr"?(f("dcr"),O(""),L("")):(f("pre_registered"),O(ze.oauthClientId??""),L(ze.oauthClientSecret??"")),N(ze.oauthScope??""),z(ze.oauthAuthorizationUrl??""),te(ze.oauthTokenEndpoint??""))},[ze?.id]);const ke=v.useMemo(()=>{const de=fe?.stepStates.length??0,ot=fe?.stepStates.filter(cn=>cn.status==="completed"||cn.status==="skipped").length??0,Bt=fe?.stepStates.filter(cn=>cn.status==="failed").length??0,Kt=de>0?Math.round((ot+Bt)/de*100):0;return{total:de,completed:ot,failed:Bt,percent:Kt}},[fe]),it=v.useMemo(()=>(fe?.network??[]).filter(ot=>!(Ye!=="all"&&ot.stepId!==Ye||Ft==="error"&&!(ot.phase==="response"&&(ot.status??0)>=400)||Ft==="ok"&&!(ot.phase==="response"&&(ot.status??0)<400))),[fe?.network,Ye,Ft]),Ue=!!ae,Tt=!!(fe&&(fe.status==="completed"||fe.status==="error"||fe.status==="stopped")),Ot=de=>{if(de==="configure"||de==="run"&&Ue||de==="report"&&Tt)return i(de)},zt=()=>{let de;if(d==="dcr"&&M.trim())try{de=JSON.parse(M)}catch{throw new Error("DCR metadata JSON is invalid")}if(!ze)throw new Error("Select an MCP server");return{profile:"latest",target:{serverName:ze.id,overrides:{authorizationServerMetadataUrl:F||void 0,authorizationEndpoint:Z||void 0,tokenEndpoint:$||void 0,registrationEndpoint:se||void 0,cimdUrl:B||void 0,resourceBaseUrl:ce||void 0}},registrationMethod:d,clientConfig:{preRegistered:d==="pre_registered"?{clientId:P.trim(),clientSecret:R.trim()||void 0,tokenEndpointAuthMethod:T==="__default__"?void 0:T||void 0}:void 0,dcr:d==="dcr"?{metadata:de,tokenEndpointAuthMethod:T==="__default__"?void 0:T||void 0}:void 0,cimd:d==="cimd"?{cimdUrl:B||void 0,expectedClientId:q||void 0}:void 0},runtime:{redirectMode:h,scopes:C.split(/[,\s]+/).map(ot=>ot.trim()).filter(Boolean),resource:E.trim()||void 0,usePkce:y,codeChallengeMethod:"S256"},display:{showSensitiveValues:x}}},Ln=de=>{pn.current?.(),pn.current=e.subscribeOAuthDebuggerSession(de,ot=>{Te(Kt=>[...Kt,ot]),(ot.type==="completed"||ot.type==="error"||ot.type==="stopped")&&_e(!1),e.getOAuthDebuggerSession(de).then(Kt=>{Ce(Kt.session),Kt.session.uiHints.authorizationUrl&&yn(`${Lj()}/api/oauth-debugger/sessions/${de}/authorize`),Kt.session.status==="completed"&&i("report")}).catch(()=>{})})},yn=de=>{!Se.current||ee.current||!de||(ee.current=!0,window.open(de,"_blank","noopener,noreferrer"))},Ht=async()=>{ge(!0),ee.current=!1;try{const de=zt(),ot=await e.createOAuthDebuggerSession(de);Re(ot.sessionId),Ce(ot.session),Te([]),i("run"),Ln(ot.sessionId);const Bt=await e.startOAuthDebuggerSession(ot.sessionId);Ce(Bt.session),_e(!0),(Bt.session.status==="waiting_for_user"||Bt.session.status==="waiting_for_browser_callback")&&(_e(!1),Bt.session.uiHints.authorizationUrl&&yn(`${Lj()}/api/oauth-debugger/sessions/${ot.sessionId}/authorize`))}catch(de){Pe({title:"Could not start OAuth Debugger session",description:de instanceof Error?de.message:String(de),variant:"destructive"})}finally{ge(!1)}},hn=async()=>{if(ae)try{ge(!0);const de=await e.submitOAuthDebuggerManualCallback(ae,{redirectUrl:me.trim()||void 0});Ce(de.session),oe(""),_e(!0)}catch(de){Pe({title:"Could not submit callback",description:de instanceof Error?de.message:String(de),variant:"destructive"})}finally{ge(!1)}},wr=async()=>{if(ae){De(!0);try{const de=await e.stopOAuthDebuggerSession(ae);if(_e(!1),de.status!=="running"){const ot=await e.getOAuthDebuggerSession(ae);Ce(ot.session),ot.session.status==="completed"?i("report"):i("run")}}catch(de){Pe({title:"Could not stop session",description:de instanceof Error?de.message:String(de),variant:"destructive"})}finally{De(!1)}}},ut=async()=>{pn.current?.(),pn.current=null,Ce(null),Re(null),Te([]),_e(!1),De(!1),ge(!1),oe(""),Ct("all"),mt("all"),Vt("inspector"),i("run"),await Ht()},jt=async de=>{if(!(!ae||!fe))try{const ot=await e.exportOAuthDebuggerSession(ae,de);let Bt="";const Kt=de==="json"?"json":de==="raw"?"txt":"md";typeof ot=="string"?Bt=ot:Bt=`${JSON.stringify(ot,null,2)}
143
- `;const cn=new Blob([Bt],{type:"text/plain;charset=utf-8"}),Rn=URL.createObjectURL(cn),ur=document.createElement("a");ur.href=Rn,ur.download=`oauth-debugger-${ae}.${Kt}`,ur.click(),URL.revokeObjectURL(Rn)}catch(ot){if(de==="markdown"){const Bt=bge(fe,Ae),Kt=new Blob([Bt],{type:"text/markdown;charset=utf-8"}),cn=URL.createObjectURL(Kt),Rn=document.createElement("a");Rn.href=cn,Rn.download=`oauth-debugger-${fe.id}.md`,Rn.click(),URL.revokeObjectURL(cn);return}Pe({title:"Export failed",description:ot instanceof Error?ot.message:String(ot),variant:"destructive"})}},Et=ae?`${Lj()}/api/oauth-debugger/sessions/${ae}/authorize`:void 0,bn=de=>de==="error"?"destructive":de==="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:yge.map(de=>{const ot=a===de.id,Bt=de.id==="configure"||de.id==="run"&&Ue||de.id==="report"&&Tt;return s.jsx("button",{type:"button",onClick:()=>Bt&&Ot(de.id),disabled:!Bt,className:"rounded-full",children:s.jsx(Qe,{variant:ot?"default":"outline",className:Bt?"":"opacity-50",children:de.label})},de.id)})})]}),a==="configure"&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs(qe,{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(_t,{className:"text-base",children:"Target MCP Server"}),s.jsx(wa,{children:"Select one MCP server from Libraries and optionally override endpoints."})]}),s.jsxs(re,{type:"button",variant:"outline",size:"sm",onClick:()=>{n()},disabled:r,children:[s.jsx(Aa,{className:`mr-2 h-4 w-4 ${r?"animate-spin":""}`}),"Refresh Servers"]})]})}),s.jsx(We,{className:"space-y-3",children:s.jsxs("div",{className:"max-w-xl space-y-2",children:[s.jsx(Fe,{children:"MCP Server"}),s.jsxs(Pn,{value:o,onValueChange:c,children:[s.jsx(An,{children:s.jsx(kn,{placeholder:"Select an MCP server"})}),s.jsx(_n,{children:Ne.map(de=>s.jsx(dt,{value:de.id,children:de.name||de.id},de.id))})]}),Ne.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"}),"."]}),ze&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[ze.transport," · ",ze.url||ze.command||"No URL/command"," · ",s.jsxs("span",{className:"text-primary",children:[ze.oauthMode==="dcr"?"DCR":"pre-registered"," fields pre-filled"]})]})]})})]}),s.jsxs(qe,{children:[s.jsxs(At,{className:"pb-3",children:[s.jsx(_t,{className:"text-base",children:"Client Registration Method"}),s.jsx(wa,{children:"How your OAuth client is identified with the authorization server."})]}),s.jsxs(We,{className:"space-y-3",children:[s.jsx("div",{className:"grid gap-2 md:grid-cols-3",children:[{id:"pre_registered",label:"Pre-registered client",hint:"You already have a client_id issued by the authorization server."},{id:"dcr",label:"Dynamic Client Registration",hint:"The server issues a client_id automatically at the start of the flow (RFC 7591)."},{id:"cimd",label:"Client ID Metadata Document",hint:"The client identifies itself via a hosted JSON metadata document at a public URL (RFC 9728)."}].map(de=>s.jsxs("button",{type:"button",onClick:()=>f(de.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 shrink-0 rounded-full ${d===de.id?"bg-primary":"bg-muted-foreground/30"}`}),s.jsx("span",{className:"text-sm font-medium",children:de.label})]}),s.jsx("p",{className:"mt-1 pl-5 text-xs text-muted-foreground",children:de.hint})]},de.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.jsxs(Fe,{className:"text-xs flex items-center gap-1",children:["Redirect mode",s.jsx(Nr,{text:"Local callback (recommended): MCP Lab automatically captures the redirect after you log in — no copy-pasting needed. Manual: you complete the browser login and then paste the final redirect URL back here."})]}),s.jsxs(Pn,{value:h,onValueChange:de=>p(de),children:[s.jsx(An,{children:s.jsx(kn,{})}),s.jsxs(_n,{children:[s.jsx(dt,{value:"local_callback",children:"Local callback (recommended)"}),s.jsx(dt,{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.jsxs(Fe,{className:"text-xs flex items-center gap-1",children:["client_id",s.jsx(Nr,{text:"The unique identifier for your application, issued by the authorization server when you registered the client."})]}),s.jsx(ht,{value:P,onChange:de=>O(de.target.value)})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs(Fe,{className:"text-xs flex items-center gap-1",children:["client_secret",s.jsx(Nr,{text:"Leave empty for public clients (e.g. SPAs or mobile apps). Required for confidential clients that authenticate with the token endpoint."})]}),s.jsx(ht,{value:R,onChange:de=>L(de.target.value),type:"password",placeholder:"optional"})]})]}),d==="cimd"&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs(Fe,{className:"text-xs flex items-center gap-1",children:["CIMD URL",s.jsx(Nr,{text:"A publicly reachable URL hosting a JSON document that describes this client. The authorization server fetches it to identify the client."})]}),s.jsx(ht,{value:B,onChange:de=>W(de.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),s.jsxs(qe,{children:[s.jsxs(At,{className:"pb-3",children:[s.jsx(_t,{className:"text-base",children:"Runtime OAuth Inputs"}),s.jsx(wa,{children:"Parameters sent in the authorization request."})]}),s.jsxs(We,{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Scopes"}),s.jsx(ht,{value:C,onChange:de=>N(de.target.value),placeholder:"openid profile email"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Space or comma separated. Leave empty to use scopes auto-discovered from the server metadata."})]}),s.jsxs("div",{className:"flex items-center gap-2 md:col-span-2",children:[s.jsx(Wr,{checked:y,onCheckedChange:de=>S(!!de)}),s.jsxs(Fe,{className:"flex items-center gap-1",children:["Use PKCE (S256)",s.jsx(Nr,{text:"Proof Key for Code Exchange — generates a one-time code verifier so the authorization code can't be hijacked. Recommended for all clients; required for public clients."})]})]}),s.jsxs("div",{className:"flex items-center gap-2 md:col-span-2",children:[s.jsx(Wr,{checked:j,onCheckedChange:de=>b(!!de)}),s.jsx(Fe,{children:"Auto-open browser when authorization URL is ready"})]})]})]}),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.jsxs(Fe,{className:"text-xs flex items-center gap-1",children:["Token endpoint auth method",s.jsx(Nr,{text:"How your client authenticates when exchanging the authorization code for a token. Choose 'none' for public clients (no secret). Leave as server default if unsure."})]}),s.jsxs(Pn,{value:T,onValueChange:D,children:[s.jsx(An,{children:s.jsx(kn,{placeholder:"Server default (recommended)"})}),s.jsxs(_n,{children:[s.jsx(dt,{value:"__default__",children:"Server default (let the server decide)"}),s.jsx(dt,{value:"client_secret_basic",children:"client_secret_basic — credentials in Authorization header"}),s.jsx(dt,{value:"client_secret_post",children:"client_secret_post — credentials in request body"}),s.jsx(dt,{value:"none",children:"none — public client, no secret"}),s.jsx(dt,{value:"private_key_jwt",children:"private_key_jwt — signed JWT assertion"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:'Use "server default" unless the server requires a specific method.'})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs(Fe,{className:"text-xs flex items-center gap-1",children:["Resource / audience",s.jsx(Nr,{text:"Some servers (RFC 8707) require the target API's URI in the token request to scope the token. Only set this if your server explicitly requires it."})]}),s.jsx(ht,{value:E,onChange:de=>_(de.target.value),placeholder:"https://api.example.com"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional. Only needed for servers that use resource indicators."})]})]}),d==="dcr"&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs(Fe,{className:"text-xs flex items-center gap-1",children:["DCR metadata JSON",s.jsx(Nr,{text:'Extra fields for the dynamic client registration request (RFC 7591), e.g. {"client_name": "My App"}. redirect_uris and grant_types are always added automatically.'})]}),s.jsx(Ha,{value:M,onChange:de=>G(de.target.value),className:"min-h-32 font-mono text-xs"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional extra fields for the registration request body."})]}),d==="cimd"&&s.jsxs("div",{className:"space-y-1",children:[s.jsxs(Fe,{className:"text-xs flex items-center gap-1",children:["Expected client_id",s.jsx(Nr,{text:"If you know what client_id the server should assign from the metadata document, enter it here for verification. Leave blank to accept whatever the server returns."})]}),s.jsx(ht,{value:q,onChange:de=>V(de.target.value),placeholder:"optional"})]}),s.jsxs("div",{className:"rounded-md border bg-background p-3",children:[s.jsx("div",{className:"mb-1 text-sm font-medium",children:"Endpoint overrides"}),s.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:"Override specific endpoints if auto-discovery fails or you want to test against a specific URL. Leave blank to use what the server advertises."}),s.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs(Fe,{className:"text-xs flex items-center gap-1",children:["Authorization server metadata URL",s.jsx(Nr,{text:"The /.well-known/oauth-authorization-server URL. Override if the server uses a non-standard path."})]}),s.jsx(ht,{value:F,onChange:de=>U(de.target.value),placeholder:"https://.../.well-known/oauth-authorization-server"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs(Fe,{className:"text-xs flex items-center gap-1",children:["Resource server base URL",s.jsx(Nr,{text:"The MCP server's base URL used to look up its /.well-known/oauth-protected-resource metadata. Override if the server uses a different base path."})]}),s.jsx(ht,{value:ce,onChange:de=>le(de.target.value),placeholder:"https://resource.example.com"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs(Fe,{className:"text-xs flex items-center gap-1",children:["Authorization endpoint",s.jsx(Nr,{text:"The URL where users are redirected to log in and grant consent. Normally discovered automatically from the server metadata."})]}),s.jsx(ht,{value:Z,onChange:de=>z(de.target.value),placeholder:"https://.../authorize"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs(Fe,{className:"text-xs flex items-center gap-1",children:["Token endpoint",s.jsx(Nr,{text:"The URL your app calls to exchange the authorization code for an access token. Normally discovered automatically."})]}),s.jsx(ht,{value:$,onChange:de=>te(de.target.value),placeholder:"https://.../token"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs(Fe,{className:"text-xs flex items-center gap-1",children:["Registration endpoint (DCR)",s.jsx(Nr,{text:"The URL used to dynamically register a new client (RFC 7591). Only relevant when using DCR. Override if the server doesn't advertise it in its metadata."})]}),s.jsx(ht,{value:se,onChange:de=>Q(de.target.value),placeholder:"https://.../register"})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs(Fe,{className:"text-xs flex items-center gap-1",children:["CIMD URL override",s.jsx(Nr,{text:"Override the Client ID Metadata Document URL. Use this if the server doesn't discover it automatically or you want to test with a specific metadata document."})]}),s.jsx(ht,{value:B,onChange:de=>W(de.target.value),placeholder:"https://.../client-metadata.json"})]})]})]}),s.jsxs(fc,{children:[s.jsx(hy,{className:"h-4 w-4"}),s.jsx(pc,{children:"Secrets display"}),s.jsxs(hc,{className:"space-y-2",children:[s.jsx("p",{children:"By default, full tokens and secrets are visible in the network inspector and exports — useful for debugging but not for sharing."}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Wr,{checked:!x,onCheckedChange:de=>g(de===!1)}),s.jsx(Fe,{children:"Hide sensitive values in inspector"})]})]})]})]})]}),s.jsx("div",{className:"flex justify-end",children:s.jsxs(re,{type:"button",onClick:()=>{Ht()},disabled:X,children:[X&&s.jsx(hr,{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(qe,{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(_t,{className:"text-base",children:"Progress"}),s.jsx(wa,{children:"Visual OAuth flow guide with live session events and next-step actions."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[fe?.uiHints.authorizationUrl&&Et&&s.jsx(re,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:Et,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(_h,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{ut()},disabled:X,children:[s.jsx(Aa,{className:"mr-2 h-4 w-4"}),"Restart"]}),ae&&s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{wr()},disabled:ue||!ae,children:[(ue||be)&&ue&&s.jsx(hr,{className:"mr-2 h-4 w-4 animate-spin"}),s.jsx(wh,{className:"mr-2 h-4 w-4"}),"Stop Debug Session"]})]})]})}),s.jsxs(We,{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:[ke.completed+ke.failed,"/",ke.total," steps"]}),s.jsxs("span",{children:[ke.percent,"%"]})]}),s.jsx(Cg,{value:ke.percent,className:"h-2"})]}),fe?.status==="waiting_for_user"&&s.jsx(qe,{children:s.jsxs(We,{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(Ha,{value:me,onChange:de=>oe(de.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(re,{type:"button",size:"sm",onClick:()=>{hn()},disabled:X||!me.trim(),children:[X&&s.jsx(hr,{className:"mr-2 h-4 w-4 animate-spin"}),"Continue"]}),fe.uiHints.authorizationUrl&&Et&&s.jsx(re,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsx("a",{href:Et,target:"_blank",rel:"noopener noreferrer",children:"Open Authorization URL"})})]})]})}),fe?.status==="waiting_for_browser_callback"&&s.jsxs(fc,{children:[s.jsx(hy,{className:"h-4 w-4"}),s.jsx(pc,{children:"Waiting for browser callback"}),s.jsxs(hc,{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:fe.uiHints.callbackUrl}),fe.uiHints.authorizationUrl&&Et&&s.jsx("div",{className:"pt-2",children:s.jsx(re,{asChild:!0,type:"button",size:"sm",variant:"outline",children:s.jsxs("a",{href:Et,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(_h,{className:"mr-2 h-4 w-4"}),"Open Authorization URL"]})})})]})]}),s.jsx("div",{className:"space-y-2",children:fe?.stepStates.map(de=>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:de.title}),s.jsx("div",{className:"text-xs text-muted-foreground",children:de.description})]}),s.jsx(Qe,{variant:de.status==="failed"?"destructive":de.status==="completed"?"outline":de.status==="active"?"secondary":"outline",className:de.status==="completed"?"border-emerald-300 bg-emerald-50 text-emerald-700":void 0,children:de.status})]}),de.outcomeSummary&&s.jsx("p",{className:"mt-2 text-xs text-muted-foreground break-all",children:de.outcomeSummary})]},de.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(qe,{children:[s.jsxs(At,{className:"pb-3",children:[s.jsx(_t,{className:"text-base",children:"Inspect"}),s.jsx(wa,{children:"Live events and network requests/responses for the OAuth flow."})]}),s.jsx(We,{className:"space-y-3",children:s.jsxs(pg,{value:Nt,onValueChange:de=>Vt(de),children:[s.jsxs(Lf,{className:"grid grid-cols-2",children:[s.jsx(xs,{value:"inspector",children:"Network Inspector"}),s.jsx(xs,{value:"events",children:"Live Debug"})]}),s.jsx(pf,{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:[Ae.length===0?s.jsx("p",{className:"text-muted-foreground",children:"No events yet."}):Ae.map((de,ot)=>s.jsxs("div",{className:"break-all",children:[s.jsx("span",{className:"mr-2 font-mono text-muted-foreground",children:new Date(de.ts).toLocaleTimeString()}),s.jsx(Qe,{variant:"outline",className:"mr-2 text-[10px]",children:de.type}),typeof de.payload.message=="string"?de.payload.message:JSON.stringify(de.payload)]},`${de.ts}-${ot}`)),s.jsx("div",{ref:ln})]})}),s.jsxs(pf,{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(Fe,{className:"text-xs",children:"Filter by step"}),s.jsxs(Pn,{value:Ye,onValueChange:Ct,children:[s.jsx(An,{className:"h-8",children:s.jsx(kn,{})}),s.jsxs(_n,{children:[s.jsx(dt,{value:"all",children:"All steps"}),(fe?.stepStates??[]).map(de=>s.jsx(dt,{value:de.id,children:de.title},de.id))]})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Filter by status"}),s.jsxs(Pn,{value:Ft,onValueChange:mt,children:[s.jsx(An,{className:"h-8",children:s.jsx(kn,{})}),s.jsxs(_n,{children:[s.jsx(dt,{value:"all",children:"All"}),s.jsx(dt,{value:"ok",children:"Successful responses"}),s.jsx(dt,{value:"error",children:"Error responses"})]})]})]})]}),s.jsx("div",{className:"max-h-[34rem] space-y-2 overflow-auto",children:it.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No network exchanges captured yet."}):it.map(de=>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:de.label}),s.jsxs("div",{className:"text-xs text-muted-foreground break-all",children:[de.method?`${de.method} `:"",de.url]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Qe,{variant:"outline",children:de.phase}),typeof de.status=="number"&&s.jsx(Qe,{variant:de.status>=400?"destructive":"secondary",children:de.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(de.headers,null,2)})]}),de.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:de.bodyText})]}),s.jsx("div",{className:"flex gap-2",children:s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{VM(JSON.stringify(de,null,2))},children:[s.jsx(ys,{className:"mr-2 h-4 w-4"}),"Copy JSON"]})})]})]},de.id))})]})]})})]})})]})}),a==="report"&&fe&&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(re,{type:"button",size:"sm",variant:"outline",onClick:()=>i("configure"),children:"Back to Configure"}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{jt("json")},children:[s.jsx(Va,{className:"mr-2 h-4 w-4"}),"Export JSON"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{jt("markdown")},children:[s.jsx(Va,{className:"mr-2 h-4 w-4"}),"Export Markdown"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",onClick:()=>{jt("raw")},children:[s.jsx(Va,{className:"mr-2 h-4 w-4"}),"Copy/Export Raw Trace"]})]})]}),s.jsxs(fc,{children:[s.jsx(hy,{className:"h-4 w-4"}),s.jsx(pc,{children:"Secrets display mode"}),s.jsx(hc,{children:x?"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(qe,{children:s.jsxs(We,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Status"}),s.jsx("div",{className:"text-lg font-semibold",children:fe.status})]})}),s.jsx(qe,{children:s.jsxs(We,{className:"pt-4",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Requests"}),s.jsx("div",{className:"text-lg font-semibold",children:fe.networkSummary.requestCount})]})}),s.jsx(qe,{children:s.jsxs(We,{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:fe.networkSummary.errorCount})]})}),s.jsx(qe,{children:s.jsxs(We,{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:fe.validations.length})]})})]}),s.jsxs(qe,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(_t,{className:"text-base",children:"Key values"})}),s.jsxs(We,{className:"grid gap-3 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(Fe,{className:"text-xs",children:"Issuer"}),s.jsx("p",{className:"text-sm break-all",children:fe.summary?.issuer||"-"})]}),s.jsxs("div",{children:[s.jsx(Fe,{className:"text-xs",children:"Client ID"}),s.jsx("p",{className:"text-sm break-all",children:fe.summary?.clientId||"-"})]}),s.jsxs("div",{children:[s.jsx(Fe,{className:"text-xs",children:"Redirect URI"}),s.jsx("p",{className:"text-sm break-all",children:fe.summary?.redirectUri||"-"})]}),s.jsxs("div",{children:[s.jsx(Fe,{className:"text-xs",children:"Token endpoint status"}),s.jsx("p",{className:"text-sm",children:fe.summary?.tokenEndpointStatus??"-"})]}),s.jsxs("div",{children:[s.jsx(Fe,{className:"text-xs",children:"Token type"}),s.jsx("p",{className:"text-sm",children:fe.summary?.tokenType||"-"})]}),s.jsxs("div",{children:[s.jsx(Fe,{className:"text-xs",children:"Scopes granted"}),s.jsx("p",{className:"text-sm break-all",children:(fe.summary?.grantedScopes??[]).join(", ")||"-"})]}),fe.summary?.accessToken&&s.jsxs("div",{className:"md:col-span-2 space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Access token"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("code",{className:"flex-1 truncate rounded bg-muted px-2 py-1 text-xs font-mono text-muted-foreground",children:[fe.summary.accessToken.slice(0,48),"…"]}),s.jsxs(re,{type:"button",size:"sm",variant:"outline",className:"shrink-0 h-7 px-2 text-xs",onClick:()=>{VM(fe.summary.accessToken)},children:[s.jsx(ys,{className:"mr-1 h-3 w-3"}),"Copy token"]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:['Visible because "Hide sensitive values" is off. Use this token with the CLI via ',s.jsx("code",{className:"font-mono",children:"--oauth-token"}),"."]})]})]})]}),s.jsxs(qe,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(_t,{className:"text-base",children:"Validation findings"})}),s.jsx(We,{className:"space-y-2",children:fe.validations.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No validation findings recorded."}):fe.validations.map((de,ot)=>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:ot+1}),s.jsx("span",{className:"font-bold",children:de.title})]}),s.jsx(Qe,{variant:bn(de.severity),children:de.severity})]}),s.jsxs("p",{className:"text-sm",children:[s.jsx("span",{className:"font-bold",children:"Finding:"})," ",de.detail]}),de.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:de.recommendation})]}),s.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Step: ",de.stepId,de.specReference&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("a",{href:de.specReference,target:"_blank",rel:"noreferrer",className:"text-primary underline",children:"Spec reference"})]})]})]},de.id))})]})]})]})}const Fj="mcplab.runEvaluation.activeJobId",jge=()=>{const[e]=Xi(),[t,n]=v.useState(""),[r,a]=v.useState("1"),[i,o]=v.useState(!1),[c,d]=v.useState(0),[f,h]=v.useState([]),[p,x]=v.useState(!1),[g,j]=v.useState(!1),[b,y]=v.useState(""),[S,C]=v.useState(null),[N,E]=v.useState([]),[_,P]=v.useState([]),[O,R]=v.useState(!0),[L,T]=v.useState(""),[D,M]=v.useState(""),[G,B]=v.useState(!1),[W,q]=v.useState([]),[V,F]=v.useState(null),[U,Z]=v.useState({}),[z,$]=v.useState(!1),te=v.useRef(null),se=v.useRef(null),{configs:Q,reload:ce}=Cf(),{source:le}=qn(),me=bg("snapshots",!1),{agents:oe,scenarios:fe,servers:Ce,reload:ae}=Xa(),Re=b.trim(),Ae=Re?`/results/${encodeURIComponent(Re)}${t?`?configId=${encodeURIComponent(t)}`:""}`:"/results",Te=Q.find(ee=>ee.id===t),be=e.get("configId"),_e=v.useMemo(()=>{if(!Te)return[];const ee=new Map,Se=Te.agentEntries&&Te.agentEntries.length>0?Te.agentEntries:Te.agents.map(Ne=>({kind:"inline",agent:Ne}));for(const Ne of Se){if(Ne.kind==="inline"){const ke=Ne.agent.id;ee.has(ke)||ee.set(ke,Ne.agent);continue}const ze=oe.find(ke=>ke.id===Ne.ref);ze&&!ee.has(ze.id)&&ee.set(ze.id,ze)}for(const Ne of oe)ee.has(Ne.id)||ee.set(Ne.id,Ne);return Array.from(ee.values())},[Te,oe]),X=v.useMemo(()=>{if(!Te)return[];const ee=new Map,Se=Te.scenarioEntries&&Te.scenarioEntries.length>0?Te.scenarioEntries:Te.scenarios.map(Ne=>({kind:"inline",scenario:Ne}));for(const Ne of Se){if(Ne.kind==="inline"){ee.has(Ne.scenario.id)||ee.set(Ne.scenario.id,Ne.scenario);continue}const ze=fe.find(ke=>ke.id===Ne.ref);ze&&!ee.has(ze.id)&&ee.set(ze.id,ze)}return Array.from(ee.values())},[Te,fe]);v.useEffect(()=>{be&&Q.some(ee=>ee.id===be)&&n(be)},[be,Q]);const ge=v.useRef("");v.useEffect(()=>{const ee=Te?`${Te.id}::${Te.sourcePath??""}`:"";if(ee===ge.current)return;if(ge.current=ee,!Te){E([]),P([]);return}const Se=_e.filter(Ne=>(Te.runDefaults?.selectedAgentNames??[]).includes(Ne.id)).map(Ne=>Ne.id);E(Se.length>0?Se:_e.map(Ne=>Ne.id)),P(X.map(Ne=>Ne.id)),R(!0)},[Te?.id,Te?.sourcePath,_e,X]);const ue=async()=>{if(!Te?.sourcePath){h(Ue=>[...Ue,`[${new Date().toLocaleTimeString()}] Missing source path for selected config.`]);return}const ee=_e.filter(Ue=>N.includes(Ue.id));if(ee.length===0){h(Ue=>[...Ue,`[${new Date().toLocaleTimeString()}] Select at least one agent.`]);return}const Se=X.filter(Ue=>_.includes(Ue.id));if(Se.length===0){h(Ue=>[...Ue,`[${new Date().toLocaleTimeString()}] Select at least one test.`]);return}const Ne=async Ue=>{const Tt={};for(const Ot of Ue){let zt=U[Ot];if(zt)try{const{session:Ht}=await le.getOAuthRuntimeSession(zt);if(Ht.status==="completed"&&Ht.hasAccessToken){Tt[Ot]=zt;continue}}catch{zt=void 0}const Ln=(()=>{let Ht=!1;return hn=>{if(Ht||!hn)return;Ht=!0;const wr=hn.startsWith("http")?hn:`${window.location.origin}${hn}`;window.open(wr,"_blank","noopener,noreferrer"),h(ut=>[...ut,`[${new Date().toLocaleTimeString()}] OAuth login required for '${Ot}'. Complete the browser sign-in flow...`])}})(),yn=await le.createOAuthRuntimeSession({serverName:Ot});zt=yn.session.id,Tt[Ot]=zt,Z(Ht=>({...Ht,[Ot]:zt})),Ln(yn.session.authorizeLaunchUrl||yn.session.authorizationUrl||""),await UC({sessionId:zt,source:le,serverName:Ot,onLaunchUrl:Ln}),h(Ht=>[...Ht,`[${new Date().toLocaleTimeString()}] OAuth login completed for '${Ot}'.`])}return Z(Ot=>({...Ot,...Tt})),Tt},ze=Array.from(new Set(Se.flatMap(Ue=>Ue.serverIds||[]).filter(Ue=>{const Tt=(Te.servers??[]).find(zt=>zt.id===Ue),Ot=Ce.find(zt=>zt.id===Ue);return(Tt||Ot)?.authType==="oauth2"})));let ke;try{ze.length>0&&($(!0),ke=await Ne(ze))}catch(Ue){const Tt=Ue instanceof Error?Ue.message:String(Ue);h(Ot=>[...Ot,`[${new Date().toLocaleTimeString()}] OAuth error: ${Tt}`]),$(!1);return}finally{$(!1)}o(!0),x(!1),j(!1),y("");const it=(Te.serverEntries??[]).some(Ue=>Ue.kind==="referenced")||(Te.agentEntries??[]).some(Ue=>Ue.kind==="referenced")||(Te.scenarioEntries??[]).some(Ue=>Ue.kind==="referenced")?"refs-composed":"single-file/inline";h([`[${new Date().toLocaleTimeString()}] Starting evaluation run...`,`[${new Date().toLocaleTimeString()}] Config=${Te.name} mode=${it} agents=${ee.map(Ue=>Ue.name||Ue.id).join(", ")} tests=${Se.map(Ue=>Ue.id).join(", ")} runs=${Number(r)} snapshotEval=${me&&O?"on":"off"}${L.trim()?` note=${L.trim()}`:""}`]),d(10);try{const{jobId:Ue}=await le.startRun({configPath:Te.sourcePath,runsPerScenario:Number(r),agents:ee.map(Tt=>Tt.id),scenarioIds:Se.map(Tt=>Tt.id),applySnapshotEval:me?O:!1,runNote:L.trim()?L.trim():void 0,oauthRuntimeSessions:ke});C(Ue),mt(Ue),ln(Ue),Nt()}catch(Ue){const Tt=Ue instanceof Error?Ue.message:String(Ue),Ot=Tt.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(zt=>[...zt,`[${new Date().toLocaleTimeString()}] Error: ${Tt}${Ot}`]),o(!1),d(0),C(null),$(!1)}},De=()=>{ue()},Ye=()=>{S&&le.stopRun(S),se.current?.(),se.current=null,Ft(),C(null),o(!1),x(!1),j(!0),h(ee=>[...ee,`[${new Date().toLocaleTimeString()}] Run aborted by user.`]),Nt()},Ct=async()=>{if(b){B(!0);try{const ee=await le.createSnapshotFromRun(b,D.trim()||void 0);Pe({title:"Snapshot saved",description:`Created ${ee.name} (${ee.id})`}),D.trim()||M(ee.name)}catch(ee){Pe({title:"Could not save snapshot",description:ee instanceof Error?ee.message:String(ee),variant:"destructive"})}finally{B(!1)}}};v.useEffect(()=>{te.current&&(te.current.scrollTop=te.current.scrollHeight)},[f]),v.useEffect(()=>()=>{se.current?.()},[]),v.useEffect(()=>{if(S||p)return;let ee="";try{ee=sessionStorage.getItem(Fj)??""}catch{ee=""}if(ee)return C(ee),o(!0),x(!1),j(!1),h(Se=>Se.length>0?Se:[`[${new Date().toLocaleTimeString()}] Reattached to in-progress evaluation run...`]),ln(ee),()=>{}},[S,p]);const Ft=()=>{try{sessionStorage.removeItem(Fj)}catch{}},mt=ee=>{try{sessionStorage.setItem(Fj,ee)}catch{}},Nt=async()=>{try{const ee=await le.getRunQueue();q(ee.queued),F(ee.active)}catch{}},Vt=()=>{ce(),ae()};v.useEffect(()=>{Vt(),Nt();const ee=()=>{Vt(),Nt()};return window.addEventListener("focus",ee),()=>{window.removeEventListener("focus",ee)}},[ce,ae]);const pn=async ee=>{try{await le.removeQueuedRun(ee),q(Se=>Se.filter(Ne=>Ne.jobId!==ee))}catch(Se){const Ne=Se instanceof Error?Se.message:String(Se);if(Ne.includes("Use the /stop endpoint"))try{await le.stopRun(ee)}catch{}else Pe({title:"Could not remove queued run",description:Ne,variant:"destructive"})}Nt()},ln=ee=>{se.current?.(),se.current=le.subscribeRunJob(ee,Se=>{const Ne=new Date(Se.ts).toLocaleTimeString();if(Se.type==="queued"){h(ze=>{const ke=Se.payload.position?` (position ${Se.payload.position})`:"",it=`[${Ne}] Run queued${ke}. Waiting for active run to finish...`;return ze.includes(it)?ze:[...ze,it]}),d(5);return}if(Se.type==="started"&&(h(ze=>{const ke=`[${Ne}] Run started.`;return ze.includes(ke)?ze:[...ze,ke]}),d(ze=>Math.max(ze,30)),j(!1)),Se.type==="log"){const ze=String(Se.payload.message??"").trim();ze&&(h(ke=>{const it=`[${Ne}] ${ze}`;return ke.includes(it)?ke:[...ke,it]}),d(ke=>{const it=ze.toLowerCase();if(it.startsWith("loading mcp evaluation config"))return Math.max(ke,15);if(it.startsWith("loaded config"))return Math.max(ke,20);if(it.startsWith("selected "))return Math.max(ke,30);if(it.startsWith("using requested agents")||it.startsWith("using resolved default agents"))return Math.max(ke,35);if(it.startsWith("expanded to "))return Math.max(ke,45);if(it.startsWith("running evaluation"))return Math.max(ke,50);const Ue=it.match(/^scenario (\d+)\/(\d+) finished:/);if(Ue){const Tt=Number(Ue[1]),Ot=Number(Ue[2]);return Math.max(ke,50+Math.round(Tt/Ot*25))}return it.startsWith("evaluation execution finished")?Math.max(ke,78):it.startsWith("applying snapshot evaluation policy")?Math.max(ke,82):it.includes("snapshot evaluation applied")||it.includes("snapshot evaluation enabled")?Math.max(ke,88):it.startsWith("writing results to ")?Math.max(ke,94):it.startsWith("run finished:")?Math.max(ke,98):ke}))}if(Se.type==="completed"){const ze=String(Se.payload.runId??"").trim();if(h(ke=>{const it=`[${Ne}] Run completed.`;return ke.includes(it)?ke:[...ke,it]}),Se.payload.snapshotEval&&typeof Se.payload.snapshotEval=="object"){const ke=Se.payload.snapshotEval;h(it=>{const Ue=`[${Ne}] Snapshot eval (${ke.mode??"warn"}) baseline=${ke.baseline_snapshot_id??"-"} score=${ke.overall_score??"-"} status=${ke.status??"-"}`;return it.includes(Ue)?it:[...it,Ue]})}d(100),o(!1),x(!0),j(!1),y(ze),Ft(),C(null),se.current?.(),se.current=null,Nt()}if(Se.type==="error"){const ze=String(Se.payload.message??"Unknown error"),ke=ze.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(it=>[...it,`[${Ne}] Error: ${ze}${ke}`]),o(!1),x(!1),j(!1),d(0),Ft(),C(null),se.current?.(),se.current=null,Nt()}})};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(Oo,{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(qe,{children:s.jsxs(We,{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(Fe,{children:"MCP Evaluation"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(Pn,{value:t,onValueChange:n,children:[s.jsx(An,{children:s.jsx(kn,{placeholder:"Select a config"})}),s.jsx(_n,{children:Q.map(ee=>s.jsx(dt,{value:ee.id,children:ee.name},ee.id))})]}),s.jsx(re,{type:"button",variant:"outline",size:"icon",className:"h-10 w-10 shrink-0",onClick:Vt,"aria-label":"Refresh configs",title:"Refresh configs",children:s.jsx(Aa,{className:"h-4 w-4"})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Fe,{children:"Variance Runs"}),s.jsx(ht,{type:"number",min:"1",max:"10",value:r,onChange:ee=>a(ee.target.value)})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Fe,{htmlFor:"run-note",children:"Run Note"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[L.length,"/500"]})]}),s.jsx(Ha,{id:"run-note",value:L,onChange:ee=>T(ee.target.value.slice(0,500)),placeholder:"Optional context for this run (for example: mcp-server v1.8.2 #staging)",rows:2})]}),Te&&s.jsxs("div",{className:"space-y-2",children:[me&&Te.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 (",Te.snapshotEval.mode,") · baseline:"," ",s.jsx("span",{className:"font-mono",children:Te.snapshotEval.baselineSnapshotId??"none"})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Fe,{children:"Agents"}),s.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[s.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>E(_e.map(ee=>ee.id)),children:"Select all"}),s.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>E([]),children:"Clear"})]})]}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:_e.map(ee=>{const Se=N.includes(ee.id);return s.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[s.jsx(Wr,{checked:Se,onCheckedChange:Ne=>{const ze=Ne===!0;E(ke=>ze?[...ke,ee.id]:ke.filter(it=>it!==ee.id))}}),s.jsx("span",{children:ee.name||ee.id})]},ee.id)})}),_e.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents available. Add agents to your workspace library, or define inline agents in this config."})]}),Te&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Fe,{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:()=>P(X.map(ee=>ee.id)),children:"Select all"}),s.jsx("button",{type:"button",className:"text-primary hover:underline",onClick:()=>P([]),children:"Clear"})]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[_.length," of ",X.length," selected"]}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:X.map(ee=>{const Se=_.includes(ee.id);return s.jsxs("label",{className:"flex items-start gap-2 text-sm rounded-md border p-2",children:[s.jsx(Wr,{checked:Se,onCheckedChange:Ne=>{const ze=Ne===!0;P(ke=>ze?[...ke,ee.id]:ke.filter(it=>it!==ee.id))}}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block font-medium",children:ee.name||ee.id}),s.jsx("span",{className:"block font-mono text-xs text-muted-foreground truncate",children:ee.id})]})]},ee.id)})})]}),me&&s.jsxs("label",{className:"flex items-center gap-2 text-sm rounded-md border p-2",children:[s.jsx(Wr,{checked:O,onCheckedChange:ee=>R(ee===!0)}),s.jsx("span",{children:"Apply snapshot evaluation policy (if configured)"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(re,{onClick:De,disabled:!t||z||_e.length>0&&N.length===0||X.length>0&&_.length===0,children:[s.jsx(Oo,{className:"mr-2 h-4 w-4"}),V?"Queue Run":"Run"]}),i&&s.jsxs(re,{variant:"destructive",onClick:Ye,children:[s.jsx(wh,{className:"mr-2 h-4 w-4"}),"Stop"]})]})]})}),(i||f.length>0)&&s.jsxs(qe,{children:[s.jsx(At,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(_t,{className:"text-base",children:"Progress"}),s.jsxs("span",{className:"text-xs text-muted-foreground font-mono",children:[Math.round(c),"%"]})]})}),s.jsxs(We,{className:"space-y-4",children:[s.jsx(Cg,{value:c,className:"h-2"}),s.jsx("div",{ref:te,className:"h-64 overflow-auto rounded-md border bg-muted/30 p-3 font-mono text-xs space-y-0.5",children:f.map((ee,Se)=>s.jsx("div",{className:ee.includes("✓")?"text-success":ee.includes("aborted")?"text-destructive":"text-foreground",children:ee},Se))})]})]}),s.jsxs(qe,{children:[s.jsx(At,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(_t,{className:"inline-flex items-center gap-2 text-base",children:[s.jsx(gf,{className:"h-4 w-4"}),"Run Queue"]}),s.jsx(re,{variant:"ghost",size:"sm",onClick:()=>{Nt()},children:s.jsx(Aa,{className:"h-3 w-3"})})]})}),s.jsx(We,{children:!V&&W.length===0?s.jsx("p",{className:"text-sm text-muted-foreground",children:"No active or queued runs. Start a run above."}):s.jsxs("div",{className:"space-y-2",children:[V&&s.jsxs("div",{className:`flex items-center justify-between rounded-md border border-primary/30 bg-primary/5 p-2 text-sm cursor-pointer hover:bg-primary/10 transition-colors ${S===V.jobId?"ring-2 ring-primary/40":""}`,onClick:()=>{S!==V.jobId&&(C(V.jobId),mt(V.jobId),o(!0),x(!1),j(!1),h([`[${new Date().toLocaleTimeString()}] Attached to running job ${V.jobId}...`]),d(10),ln(V.jobId))},title:"Click to view progress",children:[s.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[s.jsx("span",{className:"inline-flex items-center rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:"Running"}),s.jsx("span",{className:"font-mono text-xs",children:V.runParams.configPath.split("/").pop()??V.runParams.configPath}),V.runParams.agents&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["agents: ",V.runParams.agents.join(", ")]}),V.runParams.runNote&&s.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["note: ",V.runParams.runNote]})]}),s.jsxs(re,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-destructive hover:text-destructive hover:bg-destructive/10",onClick:ee=>{ee.stopPropagation(),V&&(le.stopRun(V.jobId),Nt())},title:"Stop running job",children:[s.jsx(wh,{className:"mr-1 h-3 w-3"}),"Stop"]})]}),W.map((ee,Se)=>{const Ne=ee.runParams.configPath.split("/").pop()??ee.runParams.configPath;return s.jsxs("div",{className:"flex items-center justify-between rounded-md border p-2 text-sm",children:[s.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[s.jsxs("span",{className:"inline-flex items-center rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:["#",Se+1," Queued"]}),s.jsx("span",{className:"font-mono text-xs",children:Ne}),ee.runParams.agents&&s.jsxs("span",{className:"text-xs text-muted-foreground",children:["agents: ",ee.runParams.agents.join(", ")]}),ee.runParams.runNote&&s.jsxs("span",{className:"text-xs text-muted-foreground truncate",children:["note: ",ee.runParams.runNote]})]}),s.jsx(re,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0 text-muted-foreground hover:text-destructive",onClick:()=>{pn(ee.jobId)},title:"Remove from queue",children:s.jsx(ws,{className:"h-4 w-4"})})]},ee.jobId)})]})})]}),g&&!i&&!p&&s.jsx(qe,{className:"border-amber-300/60 bg-amber-50/40",children:s.jsx(We,{className:"pt-6",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx(wh,{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(re,{type:"button",variant:"outline",onClick:()=>{h([]),d(0),j(!1)},children:"Clear Progress"}),s.jsxs(re,{type:"button",onClick:De,disabled:!t,children:[s.jsx(Oo,{className:"mr-2 h-4 w-4"}),"Run Again"]})]})]})})}),p&&s.jsx(qe,{className:"border-success/50",children:s.jsxs(We,{className:"pt-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(ac,{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(re,{asChild:!0,className:"ml-auto",children:s.jsx(wt,{to:Ae,children:Re?"View Results":"View Runs"})})]}),me&&Re&&s.jsxs("div",{className:"mt-4 flex flex-wrap items-end gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Fe,{className:"text-xs",children:"Snapshot name (optional)"}),s.jsx(ht,{value:D,onChange:ee=>M(ee.target.value),placeholder:"e.g. baseline-v1",className:"h-8 w-64"})]}),s.jsx(re,{type:"button",variant:"outline",size:"sm",onClick:()=>{Ct()},disabled:G,children:G?"Saving...":"Save Snapshot"})]})]})})]})};function Sge(e){const t=Array.from(new Map(e.scenarios.map(i=>{const o=String(i.scenarioId??"").trim(),c=String(i.scenarioName??"").trim();return!o&&!c?null:[o||c,c||o]}).filter(i=>!!i)).values()),n=Array.from(new Set(e.scenarios.map(i=>i.agentName).filter(Boolean))),r=t.slice(0,2).join(", "),a=t.length>2?` +${t.length-2}`:"";return{scenarioCount:t.length,agentCount:n.length,scenarioPreview:r?`${r}${a}`:"n/a"}}const Nge=()=>{const{source:e}=qn(),[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,x]=v.useState("desc"),[g,j]=v.useState("all"),[b,y]=v.useState(!1),S=T=>{if(f===T){x(D=>D==="asc"?"desc":"asc");return}h(T),x(T==="timestamp"?"desc":"asc")},C=async()=>{a(!0);try{n(await e.listResults())}catch(T){Pe({title:"Could not load results",description:T instanceof Error?T.message:String(T),variant:"destructive"})}finally{a(!1)}};v.useEffect(()=>{let T=!0;return a(!0),e.listResults().then(D=>{T&&n(D)}).catch(D=>{T&&Pe({title:"Could not load results",description:D instanceof Error?D.message:String(D),variant:"destructive"})}).finally(()=>{T&&a(!1)}),()=>{T=!1}},[e]);const N=v.useMemo(()=>{const T=new Set;return t.forEach(D=>{D.scenarios.forEach(M=>{const G=String(M.scenarioName??"").trim(),B=String(M.scenarioId??"").trim(),W=G||B;W&&T.add(W)})}),Array.from(T).sort((D,M)=>D.localeCompare(M))},[t]),E=v.useMemo(()=>g==="all"?t:t.filter(T=>T.scenarios.some(D=>{const M=String(D.scenarioName??"").trim(),G=String(D.scenarioId??"").trim();return(M||G)===g})),[t,g]),_=v.useMemo(()=>{const T=(M,G)=>M===null&&G===null?0:M===null?1:G===null?-1:p==="asc"?M-G:G-M;return[...E].sort((M,G)=>{if(f==="toolTokens")return T(M.toolTokenUsage?.totalTokens??null,G.toolTokenUsage?.totalTokens??null);let B=0;return f==="id"&&(B=M.id.localeCompare(G.id)),f==="timestamp"&&(B=new Date(M.timestamp).getTime()-new Date(G.timestamp).getTime()),f==="passRate"&&(B=M.overallPassRate-G.overallPassRate),f==="scenarios"&&(B=M.totalScenarios-G.totalScenarios),f==="avgToolCalls"&&(B=M.avgToolCalls-G.avgToolCalls),p==="asc"?B:-B})},[E,f,p]),P=T=>f!==T?s.jsx(rc,{className:"h-3.5 w-3.5 text-muted-foreground"}):p==="asc"?s.jsx(hs,{className:"h-3.5 w-3.5"}):s.jsx(Wt,{className:"h-3.5 w-3.5"}),O=T=>{const D=T.toolTokenUsage?.totalTokens;return typeof D=="number"?D.toLocaleString():"n/a"},R=v.useMemo(()=>{const T=new Map;for(const D of _)T.set(D.id,Sge(D));return T},[_]),L=async T=>{d(!0);try{await e.deleteResult(T),n(D=>D.filter(M=>M.id!==T)),Pe({title:"Run deleted",description:T}),o(null)}catch(D){Pe({title:"Could not delete run",description:D instanceof Error?D.message:String(D),variant:"destructive"})}finally{d(!1)}};return s.jsxs("div",{className:"space-y-6",children:[s.jsx(Os,{open:i!==null,onOpenChange:T=>{!T&&!c&&o(null)},children:s.jsxs(Ja,{children:[s.jsxs(Za,{children:[s.jsx(ts,{children:"Delete run?"}),s.jsxs(ns,{children:["This will permanently remove the run artifacts from disk for"," ",s.jsx("span",{className:"font-mono",children:i??""}),"."]})]}),s.jsxs(es,{children:[s.jsx(as,{disabled:c,children:"Cancel"}),s.jsx(rs,{disabled:c||!i,onClick:T=>{T.preventDefault(),i&&L(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(jd,{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(Hc,{open:b,onOpenChange:y,children:[s.jsx(Kc,{asChild:!0,children:s.jsxs(re,{type:"button",variant:"outline",role:"combobox","aria-expanded":b,className:"w-[260px] justify-between font-normal",children:[s.jsx("span",{className:"truncate text-left",children:g==="all"?"All scenarios":g}),s.jsx(Wt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(Ho,{className:"w-[260px] p-0",align:"start",children:s.jsxs(Go,{children:[s.jsx(Yo,{placeholder:"Search scenarios..."}),s.jsxs(Xo,{children:[s.jsx(Qo,{children:"No scenarios found."}),s.jsxs(Jo,{children:[s.jsx(aa,{value:"all scenarios",onSelect:()=>{j("all"),y(!1)},children:"All scenarios"}),N.map(T=>s.jsx(aa,{value:T,onSelect:()=>{j(T),y(!1)},children:T},T))]})]})]})})]}),s.jsx(re,{variant:"outline",onClick:()=>{C()},disabled:r,children:r?"Refreshing...":"Refresh"})]})]}),s.jsx(qe,{children:s.jsx(We,{className:"p-0",children:s.jsxs(Br,{children:[s.jsx(zr,{children:s.jsxs(qt,{children:[s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>S("id"),children:["Run ID",P("id")]})}),s.jsx(tt,{children:"Evaluated"}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>S("timestamp"),children:["Timestamp",P("timestamp")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>S("passRate"),children:["Pass Rate",P("passRate")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>S("scenarios"),children:["Scenarios",P("scenarios")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>S("avgToolCalls"),children:["Avg Tool Calls",P("avgToolCalls")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>S("toolTokens"),children:["Tool Tokens",P("toolTokens")]})}),s.jsx(tt,{className:"w-10"})]})}),s.jsx(Ur,{children:_.map(T=>s.jsxs(qt,{children:[s.jsx(Be,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(wt,{to:`/results/${T.id}`,className:"font-mono text-xs text-primary hover:underline",children:T.id}),T.configId?s.jsx("div",{className:"text-[11px] text-muted-foreground",children:T.configId}):null,T.runNote?s.jsxs("div",{className:"text-[11px] text-muted-foreground break-words",children:["Note: ",T.runNote]}):null]})}),s.jsx(Be,{className:"text-[11px] text-muted-foreground",children:(()=>{const D=R.get(T.id);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",D.scenarioCount," scenario",D.scenarioCount===1?"":"s"," · ",D.agentCount," agent",D.agentCount===1?"":"s"]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:D.scenarioPreview})]})})()}),s.jsx(Be,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(gf,{className:"h-3 w-3"}),new Date(T.timestamp).toLocaleString()]})}),s.jsx(Be,{children:s.jsx(Ks,{rate:T.overallPassRate})}),s.jsx(Be,{className:"font-mono text-sm",children:T.totalScenarios}),s.jsx(Be,{className:"font-mono text-sm",children:T.avgToolCalls.toFixed(0)}),s.jsx(Be,{className:"font-mono text-sm",children:O(T)}),s.jsx(Be,{children:s.jsxs(du,{children:[s.jsx(fu,{asChild:!0,children:s.jsx(re,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Ym,{className:"h-4 w-4"})})}),s.jsxs(ul,{align:"end",children:[s.jsx(Pr,{asChild:!0,children:s.jsxs(wt,{to:`/results/${T.id}`,children:[s.jsx(G7,{className:"mr-2 h-3.5 w-3.5"}),"View"]})}),s.jsxs(Pr,{children:[s.jsx(Va,{className:"mr-2 h-3.5 w-3.5"}),"Export JSON"]}),s.jsxs(Pr,{className:"text-destructive",onSelect:D=>{D.preventDefault(),o(T.id)},children:[s.jsx(_a,{className:"mr-2 h-3.5 w-3.5"}),"Delete"]})]})]})})]},T.id))})]})})})]})};function wd({text:e,variant:t="assistant",className:n}){const r=Cge(e);return s.jsx("div",{className:je("space-y-2",t==="system"&&"text-xs",n),children:r.map((a,i)=>s.jsx(v.Fragment,{children:Age(a,i,t)},`md-${i}`))})}function Cge(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 x=c.replace(/^```/,"").trim()||void 0;r+=1;const g=[];for(;r<t.length&&!i(t[r]);)g.push(t[r]),r+=1;r<t.length&&i(t[r])&&(r+=1),n.push({type:"code",lang:x,code:g.join(`
146
- `)});continue}if(/^---+$/.test(c)||/^\*\*\*+$/.test(c)){n.push({type:"hr"}),r+=1;continue}if(c.startsWith(">")){const x=[];for(;r<t.length&&t[r].trim().startsWith(">");)x.push(t[r].trim().replace(/^>\s?/,"")),r+=1;n.push({type:"blockquote",text:x.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(HM(t,r)){const x=KM(t[r]);r+=2;const g=[];for(;r<t.length&&t[r].includes("|")&&!a(t[r]);)g.push(KM(t[r])),r+=1;n.push({type:"table",headers:x,rows:g});continue}const f=c.match(/^\d+\.\s+/),h=c.match(/^[-*+]\s+/);if(f||h){const x=!!f,g=[];for(;r<t.length;){const j=t[r].trim();if(x?/^\d+\.\s+/.test(j):/^[-*+]\s+/.test(j)){g.push(j.replace(x?/^\d+\.\s+/:/^[-*+]\s+/,"")),r+=1;continue}a(t[r])&&(r+=1);break}n.push({type:"list",ordered:x,items:g});continue}const p=[o];for(r+=1;r<t.length;){const x=t[r],g=x.trim();if(a(x)||i(x)||/^---+$/.test(g)||/^#{1,4}\s+/.test(g)||g.startsWith(">")||HM(t,r)||/^\d+\.\s+/.test(g)||/^[-*+]\s+/.test(g))break;p.push(x),r+=1}n.push({type:"paragraph",text:p.join(`
148
- `)})}return n}function HM(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 KM(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}function Age(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:Vl(e.text,`${t}-h`)})}if(e.type==="paragraph")return s.jsx("p",{className:je("whitespace-pre-wrap leading-relaxed",n==="system"&&"leading-normal"),children:Vl(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:Vl(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:je("space-y-1 pl-5",e.ordered?"list-decimal":"list-disc"),children:e.items.map((a,i)=>s.jsx("li",{className:"leading-relaxed",children:Vl(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:Vl(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:Vl(i,`${t}-tdc-${a}-${o}`)},`${t}-td-${a}-${o}`))},`${t}-row-${a}`))})]})}):null}function Vl(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 _ge(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">${jo(c.scenarioName)}</span>
153
- <span class="scenario-agent">${jo(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">${jo(f.name)} <small>${f.duration}ms</small></span>`).join("")}
166
- </div>
167
- ${d.failureReasons.length?`<div class="failure-reasons">${d.failureReasons.map(f=>jo(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 — ${jo(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">${jo(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">${jo(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 jo(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}const Ege="mcplab.resultAssistantScenarioHandoff",Pge=[{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 GM(e){const t=new Date().toISOString().replace(/[:]/g,"-").replace(/\..+/,"");return`mcplab/reports/result-assistant/${e}-${t}.md`}function YM(e){const t=e.toFixed(1);return t.endsWith(".0")?t.slice(0,-2):t}function So(e){return typeof e=="number"?e.toLocaleString():"n/a"}const kge=()=>{const{id:e}=tl(),t=Pa(),[n]=Xi(),{source:r}=qn(),a=bg("snapshots",!1),{configs:i}=Cf(),{scenarios:o}=Xa(),[c,d]=v.useState(void 0),[f,h]=v.useState(!0),[p,x]=v.useState(!1),[g,j]=v.useState(""),[b,y]=v.useState(!1),[S,C]=v.useState(new Set),[N,E]=v.useState(new Set),[_,P]=v.useState([]),[O,R]=v.useState(""),[L,T]=v.useState(null),[D,M]=v.useState(!1),[G,B]=v.useState(""),[W,q]=v.useState(""),[V,F]=v.useState(!1),[U,Z]=v.useState(!1),[z,$]=v.useState(null),[te,se]=v.useState([]),[Q,ce]=v.useState([]),[le,me]=v.useState(""),[oe,fe]=v.useState(!1),[Ce,ae]=v.useState(!1),[Re,Ae]=v.useState("assistant"),[Te,be]=v.useState(null),[_e,X]=v.useState(null),[ge,ue]=v.useState(!1),[De,Ye]=v.useState(""),[Ct,Ft]=v.useState(""),[mt,Nt]=v.useState(!1),[Vt,pn]=v.useState(!1),[ln,ee]=v.useState(!1),[Se,Ne]=v.useState([]),[ze,ke]=v.useState(!1),[it,Ue]=v.useState(""),[Tt,Ot]=v.useState(null),[zt,Ln]=v.useState(!1),[yn,Ht]=v.useState(null),hn=v.useRef(null),wr=v.useRef(null),ut=v.useCallback(async(K,ye)=>{ke(!0);try{const $e=(await r.listMarkdownReports()).filter(Mt=>{const pt=String(Mt.relativePath??""),tn=String(Mt.name??"");return pt.includes(K)||tn.includes(K)});if(Ne($e),ye&&$e.length>0){const Mt=$e.find(pt=>pt.relativePath===ye||pt.path===ye||pt.relativePath.endsWith(ye)||pt.path.endsWith(ye));Mt&&Ue(Mt.relativePath)}return $e}catch{return Ne([]),[]}finally{ke(!1)}},[r]);v.useEffect(()=>{if(!e)return;let K=!0;const ye=z;return ye&&(r.closeResultAssistantSession(ye).catch(()=>{}),$(null),se([]),ce([]),X(null)),h(!0),r.getResult(e).then(rt=>{K&&(d(rt),j(rt?.runNote??""),x(!1),h(!1))}),()=>{K=!1}},[e,r]),v.useEffect(()=>{let K=!0;return r.listSnapshots().then(ye=>{K&&P(ye)}).catch(()=>{K&&P([])}),()=>{K=!1}},[r]),v.useEffect(()=>{if(!c?.id){Ne([]);return}let K=!0;return(async()=>{const ye=await ut(c.id)})(),()=>{K=!1}},[c?.id,ut]),v.useEffect(()=>{if(Se.length===0){Ue(""),Ot(null),Ht(null);return}(!it||!Se.some(K=>K.relativePath===it))&&Ue(Se[0].relativePath)},[Se,it]),v.useEffect(()=>{if(!U||Re!=="reports")return;if(!it){Ot(null),Ht(null);return}let K=!0;return Ln(!0),Ht(null),r.getMarkdownReport(it).then(ye=>{K&&Ot(ye)}).catch(ye=>{K&&(Ot(null),Ht(ye instanceof Error?ye.message:String(ye)))}).finally(()=>{K&&Ln(!1)}),()=>{K=!1}},[U,Re,it,r]);const jt=n.get("configId")??"",Et=(n.get("agent")??"").trim(),bn=v.useMemo(()=>{const K=jt?i.find(ye=>ye.id===jt):void 0;return K||(c?i.find(ye=>ye.id===c.configId):void 0)},[i,jt,c]),de=v.useMemo(()=>{const K=new Map;if(bn){for(const ye of bn.scenarios)K.set(ye.id,ye),ye.name&&!K.has(ye.name)&&K.set(ye.name,ye);for(const ye of bn.scenarioEntries??[]){if(ye.kind!=="referenced")continue;const rt=o.find($e=>$e.id===ye.ref);rt&&(K.set(rt.id,rt),rt.name&&K.set(rt.name,rt),K.has(ye.ref)||K.set(ye.ref,rt))}}for(const ye of o)K.has(ye.id)||K.set(ye.id,ye),ye.name&&!K.has(ye.name)&&K.set(ye.name,ye);return K},[bn,o]),ot=v.useMemo(()=>{if(!c?.snapshotEval?.baselineSnapshotId)return"";const K=i.filter(ye=>ye.snapshotEval?.baselineSnapshotId===c.snapshotEval?.baselineSnapshotId);return K.length===1?K[0].id:""},[i,c?.snapshotEval?.baselineSnapshotId]);v.useEffect(()=>{c?.snapshotEval?.baselineSnapshotId&&R(K=>K||c.snapshotEval.baselineSnapshotId)},[c?.snapshotEval?.baselineSnapshotId]),v.useEffect(()=>{if(jt&&i.some(K=>K.id===jt)){B(jt);return}ot&&B(K=>K||ot)},[jt,i,ot]),v.useEffect(()=>{if(!U)return;const K=window.setTimeout(()=>{hn.current?.scrollIntoView({behavior:"smooth",block:"end"})},0);return()=>window.clearTimeout(K)},[U,te.length,oe]),v.useEffect(()=>()=>{z&&r.closeResultAssistantSession(z).catch(()=>{})},[z,r]),v.useEffect(()=>{const K=wr.current;if(!K)return;K.style.height="0px";const ye=Math.min(K.scrollHeight,160);K.style.height=`${Math.max(40,ye)}px`},[le,U]);const{filteredScenarios:Bt,filteredTotalRuns:Kt,filteredPassCount:cn,displayPassRate:Rn,displayAvgToolCalls:ur,displayAvgLatency:di,displayToolTokenUsage:fi}=v.useMemo(()=>{if(!c)return{filteredScenarios:[],filteredTotalRuns:0,filteredPassCount:0,displayPassRate:0,displayAvgToolCalls:0,displayAvgLatency:0,displayToolTokenUsage:null};const K=Et?c.scenarios.filter(pt=>pt.agentId===Et||pt.agentName===Et):c.scenarios,ye=K.reduce((pt,tn)=>pt+tn.runs.length,0),rt=K.reduce((pt,tn)=>pt+tn.runs.filter(Kn=>Kn.passed).length,0),$e=K.reduce((pt,tn)=>pt+tn.runs.reduce((Kn,sn)=>Kn+sn.toolCalls.length,0),0),Mt=K.reduce((pt,tn)=>pt+tn.runs.reduce((Kn,sn)=>Kn+sn.duration,0),0);return{filteredScenarios:K,filteredTotalRuns:ye,filteredPassCount:rt,displayPassRate:ye===0?0:rt/ye,displayAvgToolCalls:ye===0?0:$e/ye,displayAvgLatency:ye===0?0:Math.round(Mt/ye),displayToolTokenUsage:RG(K.map(pt=>pt.toolTokenUsage))}},[c,Et]),dl=v.useMemo(()=>{const K={};return Bt.forEach(ye=>ye.runs.forEach(rt=>rt.toolCalls.forEach($e=>{K[$e.name]=(K[$e.name]||0)+1}))),Object.entries(K).map(([ye,rt])=>({name:ye,count:rt})).sort((ye,rt)=>rt.count-ye.count)},[Bt]);if(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 xe=Object.entries(c.mcpServerVersions??{}).map(([K,ye])=>`${K}: ${ye??"unknown"}`).join(", "),He=cn,ft=Math.max(0,Kt-He),$t=[{name:"Pass",value:He,color:"hsl(152, 69%, 40%)"},{name:"Fail",value:ft,color:"hsl(0, 72%, 51%)"}],Ut=K=>{C(ye=>{const rt=new Set(ye);return rt.has(K)?rt.delete(K):rt.add(K),rt})},Dt=(K,ye,rt,$e)=>`${K}:${ye}:${rt}:${$e}`,Fn=(K,ye)=>`${K}::${ye}`,Ke=K=>{E(ye=>{const rt=new Set(ye);return rt.has(K)?rt.delete(K):rt.add(K),rt})},en=K=>{const ye=!K.endsWith(":conversation");return N.has(K)?!ye:ye},Gt=new Map((L?.scenario_results??[]).map(K=>[K.scenario_id,K])),Bn=async()=>{if(!(!c||!O)){M(!0);try{const K=await r.compareSnapshot(O,c.id);T(K)}finally{M(!1)}}},wn=async K=>{const ye=K||c.snapshotEval?.baselineSnapshotId;if(ye){R(ye),M(!0);try{const rt=await r.compareSnapshot(ye,c.id);T(rt)}catch(rt){Pe({title:"Could not review drift",description:rt instanceof Error?rt.message:String(rt),variant:"destructive"})}finally{M(!1)}}},Ag=async()=>{if(!G){Pe({title:"Select a configuration",description:"Choose which config should receive the new baseline.",variant:"destructive"});return}F(!0);try{const K=await r.generateSnapshotEvalBaseline(c.id,G,W.trim()||void 0);P(ye=>[K.snapshot,...ye.filter(rt=>rt.id!==K.snapshot.id)]),R(K.snapshot.id),Pe({title:"Baseline updated",description:`${K.snapshot.name} is now linked to the selected config.`}),W.trim()||q(K.snapshot.name),c.snapshotEval?.applied&&wn(K.snapshot.id)}catch(K){Pe({title:"Could not accept new baseline",description:K instanceof Error?K.message:String(K),variant:"destructive"})}finally{F(!1)}},fl=async()=>{const K=le.trim();if(!K||!c)return;const ye=`msg-local-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,rt={id:ye,role:"user",text:K,createdAt:new Date().toISOString()};me(""),se($e=>[...$e,rt]),fe(!0);try{let $e=z;if(!$e){const pt=await r.createResultAssistantSession(c.id);$e=pt.sessionId,$(pt.session.id),ce(pt.session.pendingToolCalls),X({assistantAgentName:pt.session.selectedAssistantAgentName,provider:pt.session.provider,model:pt.session.model}),se(tn=>{const Kn=tn.some(ua=>ua.id===ye),sn=pt.session.messages;return Kn?[...sn,rt]:sn})}const Mt=await r.sendResultAssistantMessage($e,K);pi(Mt.session)}catch($e){se(Mt=>Mt.filter(pt=>pt.id!==ye)),Pe({title:"MCP Labs Assistant error",description:$e instanceof Error?$e.message:String($e),variant:"destructive"})}finally{fe(!1)}},zf=K=>{me(K),requestAnimationFrame(()=>wr.current?.focus())},pi=K=>{$(K.id),se(K.messages),ce(K.pendingToolCalls),X({assistantAgentName:K.selectedAssistantAgentName,provider:K.provider,model:K.model})},Uf=async K=>{if(z){fe(!0);try{const ye=await r.approveResultAssistantToolCall(z,K);pi(ye.session)}catch(ye){Pe({title:"Could not approve assistant action",description:ye instanceof Error?ye.message:String(ye),variant:"destructive"})}finally{fe(!1)}}},mu=async K=>{if(z){fe(!0);try{const ye=await r.denyResultAssistantToolCall(z,K);pi(ye.session)}catch(ye){Pe({title:"Could not deny assistant action",description:ye instanceof Error?ye.message:String(ye),variant:"destructive"})}finally{fe(!1)}}},Rs=(K,ye)=>{Ae("assistant"),Z(!0),be(ye?.scenarioId??null),te.length===0&&se([{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&&me(K)},ca=K=>{Ae("reports"),Z(!0)},_g=()=>{Ae("note"),Z(!0)},Kr=K=>{if(!c)return;if(!Te){Pe({title:"No scenario context",description:"Ask about a specific scenario or run first, then send the suggestion.",variant:"destructive"});return}const ye=o.find($e=>$e.id===Te)??o.find($e=>$e.name===Te);if(!ye){Pe({title:"Scenario not found in library",description:`Could not find library scenario '${Te}' to open in Scenario Assistant.`,variant:"destructive"});return}const rt=[`I am sending a suggestion from the Result Assistant for scenario '${Te}' 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(Ege,JSON.stringify({type:"result-assistant-handoff-v1",runId:c.id,configId:jt||c.configId||"",scenarioId:ye.id,prompt:rt,sourceReply:K})),t(`/libraries/test-cases/${encodeURIComponent(ye.id)}?assistantHandoff=1`)}catch($e){Pe({title:"Could not create handoff",description:$e instanceof Error?$e.message:String($e),variant:"destructive"})}},qf=K=>{c&&(ee(!1),Ye(K),Ft(GM(c.id)),Nt(!1),ue(!0))},Eg=()=>{c&&(ee(!0),Ye(""),Ft(GM(c.id)),Nt(!1),ue(!0))},Pg=async()=>{if(!c)return;if(!De.trim()){Pe({title:"No markdown to write",description:"The selected assistant response is empty.",variant:"destructive"});return}pn(!0);try{const ye=await r.applyResultAssistantReport({runId:c.id,markdown:De,outputPath:Ct.trim()||void 0,overwrite:mt});Pe({title:"Markdown report written",description:typeof ye.path=="string"&&ye.path?ye.path:ye.outputPath}),await ut(c.id,typeof ye.path=="string"&&ye.path||ye.outputPath||void 0),U&&Ae("reports"),ue(!1)}catch(ye){Pe({title:"Could not write markdown report",description:ye instanceof Error?ye.message:String(ye),variant:"destructive"})}finally{pn(!1)}},pl=async K=>{try{await navigator.clipboard.writeText(K),Pe({title:"Copied"})}catch(ye){Pe({title:"Could not copy",description:ye instanceof Error?ye.message:String(ye),variant:"destructive"})}},hl=async()=>{if(c){y(!0);try{const K=g.trim();await r.updateRunNote(c.id,K||void 0),d(ye=>ye&&{...ye,runNote:K||void 0}),j(K),x(!1),Pe({title:"Run note saved"})}catch(K){Pe({title:"Could not save run note",description:K instanceof Error?K.message:String(K),variant:"destructive"})}finally{y(!1)}}};return s.jsxs("div",{className:`${U?"xl:flex xl:h-[calc(100vh-2rem-48px)] xl:min-h-0 xl:flex-col xl:overflow-hidden":""}`,children:[s.jsx("div",{className:`${U?"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(re,{variant:"ghost",size:"icon",asChild:!0,children:s.jsx(wt,{to:"/results",children:s.jsx(Mo,{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(Ks,{rate:Rn}),a&&c.snapshotEval?.applied&&s.jsxs(Qe,{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()," ","·",Et?` Agent: ${Et} ·`:""," 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:[xe?s.jsxs("span",{className:"inline-flex items-center rounded-sm border border-border/60 bg-muted/30 px-1.5 py-1 text-[11px] text-muted-foreground",children:[s.jsx("span",{className:"font-medium",children:"MCP:"}),s.jsx("span",{className:"ml-1 font-mono",children:xe})]}):null,a&&c.snapshotEval?.applied&&s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>{wn()},disabled:D,children:[s.jsx(QS,{className:"h-3.5 w-3.5"}),D?"Reviewing drift...":"Review Drift"]}),s.jsxs(re,{variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>{const K=_ge(c),ye=new Blob([K],{type:"text/html"}),rt=URL.createObjectURL(ye),$e=document.createElement("a");$e.href=rt,$e.download=`mcplab-report-${c.id}.html`,$e.click(),URL.revokeObjectURL(rt)},children:[s.jsx(Va,{className:"h-3.5 w-3.5"}),"Download Report"]}),s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>ca(),disabled:ze,children:[s.jsx(Ql,{className:"h-3.5 w-3.5"}),ze?"Reference Reports...":`Reference Reports${Se.length?` (${Se.length})`:""}`]}),s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>_g(),children:[s.jsx(Ql,{className:"h-3.5 w-3.5"}),"Run Note"]}),s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:()=>Rs(),children:[s.jsx(ba,{className:"h-3.5 w-3.5"}),"MCP Labs Assistant"]})]})]})}),s.jsxs("div",{className:`grid gap-6 items-start ${U?Ce?"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 ${U?"xl:h-full xl:min-h-0 xl:overflow-y-auto xl:pr-2":""}`,children:[a&&c.snapshotEval?.applied&&s.jsxs(qe,{className:"border-amber-500/30",children:[s.jsx(At,{className:"pb-3",children:s.jsx(_t,{className:"text-base",children:"Snapshot Drift Review"})}),s.jsxs(We,{className:"space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[s.jsxs(Qe,{variant:"outline",children:["Mode: ",c.snapshotEval.mode]}),s.jsxs(Qe,{variant:"outline",children:["Status: ",c.snapshotEval.status]}),s.jsxs(Qe,{variant:"outline",children:["Overall score: ",c.snapshotEval.overallScore]}),s.jsxs(Qe,{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(Pn,{value:G,onValueChange:B,children:[s.jsx(An,{className:"h-8",children:s.jsx(kn,{placeholder:"Select config to update"})}),s.jsx(_n,{children:i.map(K=>s.jsx(dt,{value:K.id,children:K.name},K.id))})]}),!G&&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:W,onChange:K=>q(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(re,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5",onClick:()=>{wn()},disabled:D,children:[s.jsx(Aa,{className:`h-3.5 w-3.5 ${D?"animate-spin":""}`}),"Review Drift"]}),s.jsx(re,{type:"button",size:"sm",className:"h-8",onClick:()=>{Ag()},disabled:V||Rn!==1,children:V?"Accepting...":"Accept as New Baseline"})]})]}),Rn!==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-6",children:[s.jsx(cs,{title:"Scenarios",value:Bt.length,icon:Vj}),s.jsx(cs,{title:"Total Runs",value:Kt,icon:E$}),s.jsx(cs,{title:"Pass Rate",value:`${Math.round(Rn*100)}%`,icon:jd}),s.jsx(cs,{title:"Avg Tool Calls",value:YM(ur),icon:ac}),s.jsx(cs,{title:"Avg Latency",value:`${di}ms`,icon:L$}),s.jsx(cs,{title:"Tool Tokens",value:So(fi?.totalTokens),icon:us})]}),s.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[s.jsxs(qe,{children:[s.jsx(At,{className:"pb-2",children:s.jsx(_t,{className:"text-base",children:"Pass / Fail"})}),s.jsxs(We,{className:"flex items-center justify-center",children:[s.jsxs(wfe,{width:180,height:180,children:[s.jsx(ci,{data:$t,dataKey:"value",innerRadius:50,outerRadius:75,paddingAngle:3,children:$t.map((K,ye)=>s.jsx(Iv,{fill:K.color},ye))}),s.jsx(Fr,{})]}),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"}),He," 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"}),ft," failed"]})]})]})]}),s.jsxs(qe,{children:[s.jsx(At,{className:"pb-2",children:s.jsx(_t,{className:"text-base",children:"Tool Usage"})}),s.jsx(We,{children:s.jsx(Gh,{width:"100%",height:180,children:s.jsxs(bfe,{data:dl,layout:"vertical",children:[s.jsx(Hi,{type:"number",tick:{fontSize:11}}),s.jsx(Ki,{type:"category",dataKey:"name",tick:{fontSize:11},width:120}),s.jsx(Fr,{}),s.jsx(ol,{dataKey:"count",fill:"hsl(38, 92%, 50%)",radius:[0,4,4,0]})]})})})]})]}),s.jsxs(qe,{children:[s.jsx(At,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx(_t,{className:"text-base",children:"Scenarios"}),s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"h-8 gap-1.5 px-2 text-xs",onClick:()=>Rs("Summarize the scenario results in this run. Highlight failed scenarios/checks first, then mention notable tool usage and extracted values."),children:[s.jsx(ba,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]})}),s.jsxs(We,{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(Pn,{value:O,onValueChange:R,children:[s.jsx(An,{className:"h-8",children:s.jsx(kn,{placeholder:"Select snapshot"})}),s.jsx(_n,{children:_.map(K=>s.jsx(dt,{value:K.id,children:K.name},K.id))})]})]}),s.jsx(re,{type:"button",variant:"outline",size:"sm",disabled:!O||D,onClick:()=>{Bn()},children:D?"Comparing...":"Compare Snapshot"}),L&&s.jsxs(Qe,{variant:"outline",className:"h-8 px-2 py-0 text-xs",children:["Overall snapshot score: ",L.overall_score]})]}),s.jsxs(Br,{children:[s.jsx(zr,{children:s.jsxs(qt,{children:[s.jsx(tt,{className:"w-8"}),s.jsx(tt,{children:"Scenario"}),s.jsx(tt,{children:"Agent"}),s.jsx(tt,{children:"Runs"}),s.jsx(tt,{children:"Pass Rate"}),s.jsx(tt,{children:"Tool Calls"}),s.jsx(tt,{children:"Tool Tokens"}),s.jsx(tt,{children:"Snapshot"})]})}),s.jsx(Ur,{children:Bt.map(K=>{const ye=Fn(K.scenarioId,K.agentName),rt=K.scenarioName||K.scenarioId;return s.jsx(Di,{open:S.has(ye),onOpenChange:()=>Ut(ye),asChild:!0,children:s.jsxs(s.Fragment,{children:[s.jsx(Ws,{asChild:!0,children:s.jsxs(qt,{className:"cursor-pointer hover:bg-muted/50",children:[s.jsx(Be,{children:s.jsx(Wt,{className:`h-4 w-4 transition-transform ${S.has(ye)?"rotate-180":""}`})}),s.jsx(Be,{className:"font-medium text-sm",children:K.scenarioName}),s.jsx(Be,{className:"text-sm",children:K.agentName}),s.jsx(Be,{className:"font-mono text-sm",children:K.runs.length}),s.jsx(Be,{children:s.jsx(Ks,{rate:K.passRate})}),s.jsx(Be,{className:"font-mono text-sm",children:YM(K.avgToolCalls)}),s.jsx(Be,{className:"font-mono text-sm",children:So(K.toolTokenUsage?.totalTokens)}),s.jsx(Be,{children:(()=>{const $e=Gt.get(K.scenarioId);if(!$e)return s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"});const Mt=$e.status==="Match"?"bg-success/15 text-success":$e.status==="Warn"?"bg-amber-500/15 text-amber-600":"bg-destructive/15 text-destructive";return s.jsxs(Qe,{variant:"outline",className:`text-xs ${Mt}`,children:[$e.status," · ",$e.score]})})()})]})}),s.jsx(Li,{asChild:!0,children:s.jsx("tr",{children:s.jsx("td",{colSpan:8,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:[rt," · ",K.agentName," · ",Math.round(K.passRate*100),"% pass rate · ",So(K.toolTokenUsage?.totalTokens)," tool tokens"]})]}),s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs shrink-0",onClick:()=>Rs(`Explain why scenario '${rt}' failed (agent: ${K.agentName}). Summarize the likely cause from the result details and suggest what to inspect next.`,{scenarioId:K.scenarioId}),children:[s.jsx(ba,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})]}),(()=>{const $e=Gt.get(K.scenarioId);return!$e||$e.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: ",$e.baseline_agents.join(", ")||"—"," · observed agents: ",$e.observed_agents.join(", ")||"—"]}),s.jsx("ul",{className:"space-y-1 text-xs text-muted-foreground",children:$e.reasons.map((Mt,pt)=>s.jsxs("li",{children:["• ",Mt]},pt))})]})})(),K.runs.map($e=>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:$e.passed?s.jsx(ac,{className:"h-4 w-4 text-success"}):s.jsx(bh,{className:"h-4 w-4 text-destructive"})}),s.jsxs("div",{className:"flex-1 space-y-1",children:[(()=>{const Mt=de.get(K.scenarioId),pt=Mt?Tge(Mt.evalRules,$e.failureReasons):[],tn=pt.filter(sn=>sn.status==="failed"),Kn=pt.filter(sn=>sn.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 #",$e.runIndex+1]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[$e.duration,"ms"]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"·"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[So($e.toolTokenUsage?.totalTokens)," tool tokens"]}),!$e.passed&&s.jsx(Qe,{variant:"outline",className:"h-5 border-destructive/30 bg-destructive/10 text-destructive text-[10px]",children:"Failed"})]}),$e.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(bh,{className:"h-3.5 w-3.5"}),"Failure reasons"]}),s.jsx("ul",{className:"space-y-1 text-xs text-destructive",children:$e.failureReasons.map((sn,ua)=>s.jsxs("li",{children:["• ",JM(sn)]},ua))})]}),pt.length>0&&s.jsx(Di,{open:en(Dt(K.scenarioId,K.agentName,$e.runIndex,"checks")),onOpenChange:()=>Ke(Dt(K.scenarioId,K.agentName,$e.runIndex,"checks")),children:s.jsxs("div",{className:"rounded-md border bg-muted/20 p-2",children:[s.jsx(Ws,{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(Wt,{className:`h-3.5 w-3.5 transition-transform ${en(Dt(K.scenarioId,K.agentName,$e.runIndex,"checks"))?"rotate-180":""}`}),s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Checks"}),s.jsxs(Qe,{variant:"outline",className:"h-5 border-success/30 bg-success/10 text-success text-[10px]",children:[Kn.length," passed"]}),s.jsxs(Qe,{variant:"outline",className:`h-5 text-[10px] ${tn.length>0?"border-destructive/30 bg-destructive/10 text-destructive":""}`,children:[tn.length," failed"]})]})}),s.jsx(Li,{children:s.jsx("div",{className:"space-y-1",children:pt.map((sn,ua)=>s.jsxs("div",{className:`flex items-start justify-between gap-2 rounded-md border px-2 py-1.5 text-xs ${sn.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:[sn.status==="failed"?s.jsx(bh,{className:"h-3.5 w-3.5 shrink-0 text-destructive"}):s.jsx(ac,{className:"h-3.5 w-3.5 shrink-0 text-success"}),s.jsx("span",{className:"font-medium",children:Mge(sn.rule)})]}),sn.failureReason&&s.jsx("p",{className:"mt-1 pl-5 text-[11px] text-destructive",children:JM(sn.failureReason)})]}),s.jsx(Qe,{variant:"outline",className:`shrink-0 text-[10px] ${sn.status==="failed"?"border-destructive/30 text-destructive":"border-success/30 text-success"}`,children:sn.status})]},`${sn.rule.type}-${sn.rule.value}-${ua}`))})})]})})]})})(),s.jsx(Di,{open:en(Dt(K.scenarioId,K.agentName,$e.runIndex,"extracts")),onOpenChange:()=>Ke(Dt(K.scenarioId,K.agentName,$e.runIndex,"extracts")),children:s.jsxs("div",{className:"rounded-md border border-violet-500/20 bg-violet-500/5 p-2",children:[s.jsx(Ws,{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(Wt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${en(Dt(K.scenarioId,K.agentName,$e.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(Vj,{className:"h-3.5 w-3.5 text-violet-600"}),"Extracted values"]})]}),s.jsxs(Qe,{variant:"outline",className:"h-5 text-[10px]",children:[Object.keys($e.extractedValues??{}).length," total"]})]})}),s.jsx(Li,{children:Object.keys($e.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($e.extractedValues??{}).map(([Mt,pt])=>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:Mt}),s.jsx("div",{className:"font-mono break-all text-foreground",children:pt===null?"null":String(pt)})]},Mt))})})]})}),s.jsx(Di,{open:en(Dt(K.scenarioId,K.agentName,$e.runIndex,"tools")),onOpenChange:()=>Ke(Dt(K.scenarioId,K.agentName,$e.runIndex,"tools")),children:s.jsxs("div",{className:"rounded-md border border-sky-500/20 bg-sky-500/5 p-2",children:[s.jsx(Ws,{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(Wt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${en(Dt(K.scenarioId,K.agentName,$e.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(us,{className:"h-3.5 w-3.5 text-sky-600"}),"Tool call sequence"]})]}),s.jsxs(Qe,{variant:"outline",className:"h-5 text-[10px]",children:[$e.toolCalls.length," total"]})]})}),s.jsx(Li,{children:$e.toolCalls.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No tool calls captured for this run."}):s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"flex flex-wrap gap-1",children:$e.toolCalls.map((Mt,pt)=>s.jsxs(Qe,{variant:"outline",className:"font-mono text-xs bg-background",children:[s.jsxs("span",{className:"mr-1 text-muted-foreground",children:["#",pt+1]}),Mt.name,s.jsxs("span",{className:"ml-1 text-muted-foreground",children:[Mt.duration,"ms"]})]},pt))}),s.jsxs("div",{className:"rounded-md border bg-background p-2",children:[s.jsxs("div",{className:"mb-1.5 flex items-center justify-between gap-2",children:[s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Tool token estimate"}),s.jsx(Qe,{variant:"outline",className:"h-5 text-[10px]",children:"estimated"})]}),Object.keys($e.toolTokenUsageByTool??{}).length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"n/a"}):s.jsx("div",{className:"grid gap-1.5 sm:grid-cols-2",children:Object.entries($e.toolTokenUsageByTool??{}).map(([Mt,pt])=>s.jsxs("div",{className:"rounded border bg-muted/30 px-2 py-1.5 text-xs",children:[s.jsx("div",{className:"font-mono text-[11px]",children:Mt}),s.jsxs("div",{className:"text-muted-foreground",children:["total: ",So(pt.totalTokens)," · in: ",So(pt.inputTokens)," · out: ",So(pt.outputTokens)]})]},Mt))})]})]})})]})}),s.jsx(Di,{open:en(Dt(K.scenarioId,K.agentName,$e.runIndex,"final")),onOpenChange:()=>Ke(Dt(K.scenarioId,K.agentName,$e.runIndex,"final")),children:s.jsxs("div",{className:"rounded-md border border-muted-foreground/20 bg-card p-2",children:[s.jsx(Ws,{asChild:!0,children:s.jsxs("button",{type:"button",className:"mb-2 flex w-full items-center gap-2 text-left",children:[s.jsx(Wt,{className:`h-3.5 w-3.5 transition-transform ${en(Dt(K.scenarioId,K.agentName,$e.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(Sa,{className:"h-3.5 w-3.5"}),"Final answer"]})]})}),s.jsx(Li,{children:s.jsx(VS,{text:$e.finalAnswer||"No final answer captured.",maxLength:1200,className:"text-xs text-foreground"})})]})}),s.jsx(Di,{open:en(Dt(K.scenarioId,K.agentName,$e.runIndex,"conversation")),onOpenChange:()=>Ke(Dt(K.scenarioId,K.agentName,$e.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(Ws,{asChild:!0,children:s.jsxs("button",{type:"button",className:"flex min-w-0 items-center gap-2 text-left",children:[s.jsx(Wt,{className:`h-3.5 w-3.5 shrink-0 transition-transform ${en(Dt(K.scenarioId,K.agentName,$e.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(re,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Rs(`Explain Run #${$e.runIndex+1} for scenario '${rt}'. It ${$e.passed?"passed":"failed"} in ${$e.duration}ms. Focus on the tool sequence and ${$e.passed?"why it passed":"what caused the failure"}.`,{scenarioId:K.scenarioId}),children:[s.jsx(ba,{className:"h-3.5 w-3.5"}),"Ask Assistant"]})})]}),s.jsx(Li,{children:s.jsx("div",{className:"space-y-2 rounded-md border bg-muted/20 p-2",children:$e.conversation.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No conversation trace captured."}):$e.conversation.map(Mt=>s.jsx(Oge,{item:Mt,fallbackUserPrompt:de.get(K.scenarioId)?.prompt},Mt.id))})}),!en(Dt(K.scenarioId,K.agentName,$e.runIndex,"conversation"))&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"Expand to inspect user/assistant/tool messages for this run."})]})})]})]},$e.runIndex))]})})})})]})},ye)})})]})]})]})]}),U&&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(pg,{value:Re,onValueChange:K=>Ae(K),className:"min-w-0 -mb-px px-3 pt-1",children:s.jsxs(Lf,{className:"h-auto w-full justify-start rounded-none border-b bg-transparent p-0",children:[s.jsx(xs,{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(xs,{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"}),s.jsx(xs,{value:"note",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:"Note"})]})}),Re==="assistant"?s.jsxs(qe,{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(_t,{className:"flex items-center gap-2 text-base",children:[s.jsx(ba,{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(re,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>ae(K=>!K),children:[Ce?s.jsx(my,{className:"h-3.5 w-3.5"}):s.jsx(vy,{className:"h-3.5 w-3.5"}),Ce?"Compact":"Expand"]}),s.jsx(re,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>Z(!1),children:"Hide"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Ask questions about this run result, failures, tool usage, and snapshot drift."})]})}),s.jsxs(We,{className:"flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1",children:[s.jsx(Wm,{className:"min-h-0 flex-1 bg-muted/15 px-4 py-4",children:s.jsxs("div",{className:"space-y-3 pr-2",children:[te.map((K,ye)=>{const rt=K.role==="user",$e=K.role==="assistant",Mt=K.role==="system",pt=K.role==="tool",tn=K.pendingToolCallId?Q.find(ml=>ml.id===K.pendingToolCallId):void 0,Kn=$e&&!!K.pendingToolCallId;if(pt&&/^(Approved|Denied) tool call\b/i.test(String(K.text??"").trim()))return null;tn?.server??K.toolRequestServer;const sn=tn?.tool??K.toolRequestName,ua=tn?.publicToolName??K.toolRequestPublicName,Xt=$e&&!Kn&&Rge(K.text,!!Te);if(Kn){const ml=sn??ua??"unknown_tool";return sn&&sn.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(Sa,{className:"h-3 w-3"})}),s.jsxs("details",{open:!!tn,className:"group min-w-0 w-full max-w-[92%] overflow-hidden 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 flex-1",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(us,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"min-w-0 truncate text-sm font-medium",children:`Tool call ${ml}`}),s.jsx("span",{className:`shrink-0 whitespace-nowrap rounded px-1.5 py-0.5 text-[10px] font-semibold ${tn?"bg-amber-100 text-amber-900":"bg-muted text-muted-foreground"}`,children:tn?"Needs approval":"Completed"})]})}),s.jsx(Wt,{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(wd,{text:K.text,className:"text-sm"}),tn&&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(tn.arguments??{},null,2)})}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(re,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:oe,onClick:()=>{mu(tn.id)},children:"Deny"}),s.jsx(re,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:oe,onClick:()=>{Uf(tn.id)},children:"Approve"})]})]})]})]})]},`${K.id??`${K.role}-${ye}`}:${tn?"pending":"completed"}`)}const Wf=rt||$e&&!pt&&!Mt;return s.jsxs("div",{className:`flex items-start gap-2 ${rt?"justify-end":"justify-start"}`,children:[!rt&&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:Mt?s.jsx($$,{className:"h-3 w-3"}):s.jsx(Sa,{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 ${rt?"border-primary/20 bg-primary/10":Mt?"border-amber-400/30 bg-amber-50/70":pt?"border-blue-300/30 bg-blue-50/50":"border-border/80 bg-background shadow-sm"}`,children:[!(rt||Mt)&&s.jsx("p",{className:`mb-2 text-[11px] font-semibold text-muted-foreground ${rt?"text-right":""}`,children:pt?"Tool":"Assistant"}),s.jsx(wd,{text:K.text,className:"text-sm"}),Xt&&s.jsxs("div",{className:"mt-3 flex max-w-full flex-wrap justify-end gap-2 overflow-x-auto pb-1",children:[s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>Kr(K.text),children:[s.jsx(ba,{className:"h-3.5 w-3.5"}),"Send to Scenario Assistant"]}),s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>qf(K.text),children:[s.jsx(us,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})]}),!Xt&&$e&&!Kn&&s.jsx("div",{className:"mt-3 flex max-w-full justify-end overflow-x-auto pb-1",children:s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>qf(K.text),children:[s.jsx(us,{className:"h-3.5 w-3.5"}),"Apply: Write Markdown Report"]})})]}),Wf&&s.jsx(re,{type:"button",variant:"ghost",size:"icon",className:"absolute -right-8 bottom-1 h-6 w-6 text-muted-foreground",onClick:()=>{pl(K.text)},"aria-label":"Copy message",title:"Copy message",children:s.jsx(ys,{className:"h-3.5 w-3.5"})})]}),rt&&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(eN,{className:"h-3 w-3"})})]},K.id??`${K.role}-${ye}`)}),Q.filter(K=>!te.some(ye=>ye.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)"}),Q.filter(K=>!te.some(ye=>ye.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(Wt,{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(re,{type:"button",size:"sm",variant:"outline",className:"h-7 px-2 text-xs",disabled:oe,onClick:()=>{mu(K.id)},children:"Deny"}),s.jsx(re,{type:"button",size:"sm",className:"h-7 px-2 text-xs",disabled:oe,onClick:()=>{Uf(K.id)},children:"Approve"})]})]})]},K.id))]}),oe&&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(Sa,{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(hr,{className:"h-4 w-4 animate-spin"}),"Thinking..."]})]}),s.jsx("div",{ref:hn})]})}),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(Ha,{ref:wr,value:le,onChange:K=>me(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(),oe||fl())}}),s.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 px-1 pt-1",children:[s.jsxs(du,{children:[s.jsx(fu,{asChild:!0,children:s.jsxs(re,{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:oe,children:[s.jsx(bs,{className:"h-3 w-3"}),"Snippets",s.jsx(Wt,{className:"h-3 w-3"})]})}),s.jsxs(ul,{align:"start",className:"w-[360px]",children:[s.jsx(OC,{children:"Result Assistant Snippets"}),s.jsx(RC,{}),Pge.map(K=>s.jsx(Pr,{className:"items-start whitespace-normal px-2 py-2",onSelect:()=>zf(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(re,{type:"button",size:"icon",className:"h-8 w-8 shrink-0 rounded-full",onClick:()=>{fl()},disabled:oe||!le.trim(),"aria-label":"Send assistant message",title:"Send assistant message",children:oe?s.jsx(hr,{className:"h-4 w-4 animate-spin"}):s.jsxs(s.Fragment,{children:[s.jsx(D$,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Ask"})]})})]})]})})]})]}):Re==="reports"?s.jsxs(qe,{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(_t,{className:"flex items-center gap-2 text-base",children:[s.jsx(Ql,{className:"h-4 w-4 text-muted-foreground"}),"Reference Reports"]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>ae(K=>!K),children:[Ce?s.jsx(my,{className:"h-3.5 w-3.5"}):s.jsx(vy,{className:"h-3.5 w-3.5"}),Ce?"Compact":"Expand"]}),s.jsx(re,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>Z(!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(We,{className:"flex h-[70vh] min-h-[520px] flex-col p-0 xl:h-auto xl:min-h-0 xl:flex-1",children:[(ze||Se.length===0||Se.length>1)&&s.jsx("div",{className:"border-b px-4 py-3",children:ze?s.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading reference reports..."}):Se.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(re,{type:"button",size:"sm",variant:"outline",className:"shrink-0 gap-1.5",onClick:()=>Eg(),children:[s.jsx(bs,{className:"h-3.5 w-3.5"}),"New Report"]})]}):s.jsx("div",{className:"space-y-2",children:Se.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(Pn,{value:it,onValueChange:Ue,children:[s.jsx(An,{className:"h-8",children:s.jsx(kn,{placeholder:"Select a report"})}),s.jsx(_n,{children:Se.map(K=>s.jsx(dt,{value:K.relativePath,children:K.name},K.path))})]})]}):null})}),s.jsx(Wm,{className:"min-h-0 flex-1 bg-muted/15 px-4 py-4",children:Se.length===0?s.jsx("div",{className:"text-sm text-muted-foreground",children:"No report selected."}):zt?s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(hr,{className:"h-4 w-4 animate-spin"}),"Loading report..."]}):yn?s.jsxs("div",{className:"rounded-md border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive",children:["Could not load report: ",yn]}):Tt?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:Tt.name}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:Tt.relativePath}),s.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:new Date(Tt.mtime).toLocaleString()})]}),s.jsx("div",{className:"rounded-md border bg-background p-3",children:s.jsx(wd,{text:Tt.content,className:"text-sm"})})]}):s.jsx("div",{className:"text-sm text-muted-foreground",children:"Select a report to preview."})})]})]}):s.jsxs(qe,{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(_t,{className:"flex items-center gap-2 text-base",children:[s.jsx(Ql,{className:"h-4 w-4 text-muted-foreground"}),"Run Note"]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(re,{type:"button",variant:"outline",size:"sm",className:"h-7 gap-1 px-2 text-xs",onClick:()=>ae(K=>!K),children:[Ce?s.jsx(my,{className:"h-3.5 w-3.5"}):s.jsx(vy,{className:"h-3.5 w-3.5"}),Ce?"Compact":"Expand"]}),s.jsx(re,{type:"button",variant:"outline",size:"sm",className:"h-7 px-2 text-xs",onClick:()=>Z(!1),children:"Hide"})]})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Add context for this run, such as server version or environment details."})]})}),s.jsx(We,{className:"flex h-[70vh] min-h-[520px] flex-col p-4 xl:h-auto xl:min-h-0 xl:flex-1",children:p?s.jsxs("div",{className:"w-full max-w-xl space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("p",{className:"text-xs font-medium",children:"Run note"}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[g.length,"/500"]})]}),s.jsx(Ha,{value:g,onChange:K=>j(K.target.value.slice(0,500)),placeholder:"Optional context for this run",rows:3,className:"min-h-20 resize"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(re,{size:"sm",onClick:()=>{hl()},disabled:b,children:b?"Saving...":"Save note"}),s.jsx(re,{size:"sm",variant:"outline",onClick:()=>{j(c.runNote??""),x(!1)},disabled:b,children:"Cancel"})]})]}):s.jsxs("div",{className:"flex w-full max-w-3xl items-center gap-2 rounded-md border bg-muted/20 px-2 py-1 text-xs",children:[s.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"Run note:"}),s.jsx("span",{className:`break-words ${c.runNote?"text-foreground":"text-muted-foreground"}`,children:c.runNote||"none"})]}),s.jsx(re,{size:"sm",variant:"ghost",className:"ml-auto h-6 px-2 text-xs",onClick:()=>x(!0),children:c.runNote?"Edit":"Add note"})]})})]})]}),s.jsx(Os,{open:ge,onOpenChange:K=>!Vt&&ue(K),children:s.jsxs(Ja,{className:"max-w-2xl",children:[s.jsxs(Za,{children:[s.jsx(ts,{children:ln?"Create markdown report":"Approve MCP action: write markdown report"}),s.jsx(ns,{children:ln?"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:[!ln&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Output path"}),s.jsx(ht,{value:Ct,onChange:K=>Ft(K.target.value),placeholder:"mcplab/reports/result-assistant/my-report.md",disabled:Vt})]}),s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx(Wr,{checked:mt,onCheckedChange:K=>Nt(K===!0),disabled:Vt}),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:ln?"Markdown content":"Markdown preview (to be written)"}),s.jsx(Ha,{value:De,onChange:K=>Ye(K.target.value),rows:10,className:"font-mono text-xs",disabled:Vt})]})]}),s.jsxs(es,{children:[s.jsx(as,{disabled:Vt,children:"Cancel"}),s.jsx(rs,{onClick:K=>{K.preventDefault(),Pg()},disabled:Vt,children:Vt?"Writing...":ln?"Save Report":"Approve & Write"})]})]})})]})]})};function Oge({item:e,fallbackUserPrompt:t}){if(e.kind==="tool_call")return s.jsx(QM,{variant:"call",title:`Tool call · ${e.toolName||"unknown"}`,text:e.text});if(e.kind==="tool_result"){const d=e.ok?s.jsx(ac,{className:"h-3.5 w-3.5 text-emerald-700 dark:text-emerald-300"}):s.jsx(bh,{className:"h-3.5 w-3.5 text-rose-700 dark:text-rose-300"});return s.jsx(QM,{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=XM(e.text,e.kind),a=t?XM(t,"user_prompt"):"",i=n&&!r&&a?a:r,o=n?"User prompt":e.kind==="assistant_final"?"Agent final":"Agent",c=n?eN:Sa;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(VS,{text:i,maxLength:280,className:"text-xs"}):s.jsx(VS,{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 XM(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 Rge(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 QM({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(Di,{open:a,onOpenChange:i,children:s.jsxs("div",{className:`rounded-md border p-2 text-xs ${o[e]}`,children:[s.jsx(Ws,{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(us,{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(Li,{children:s.jsx("p",{className:"mt-2 font-mono whitespace-pre-wrap text-foreground",children:n})})]})})}function VS({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(wd,{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 Tge(e,t){return e.map(n=>{const r=Ige(n,t);return{rule:n,status:r?"failed":"passed",failureReason:r}})}function Ige(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 Mge(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 JM(e){const t=String(e??"").trim(),n=t.match(/^Regex assertion failed:\s*(.+)$/i);return n?`Text match failed: ${n[1]}`:t}const Bj=["hsl(38, 92%, 50%)","hsl(200, 80%, 50%)","hsl(152, 69%, 40%)","hsl(280, 60%, 50%)","hsl(0, 72%, 51%)"];function $ge(e){const t=Array.from(new Set(e.scenarios.map(i=>i.scenarioId).filter(Boolean))),n=Array.from(new Set(e.scenarios.map(i=>i.agentId).filter(Boolean))),r=t.slice(0,2).join(", "),a=t.length>2?` +${t.length-2}`:"";return{scenarioCount:t.length,agentCount:n.length,scenarioPreview:r?`${r}${a}`:"n/a"}}const Dge=()=>{const{source:e}=qn(),[t,n]=Xi(),[r,a]=v.useState([]),[i,o]=v.useState(!1),[c,d]=v.useState(new Set),[f,h]=v.useState("timestamp"),[p,x]=v.useState("desc"),[g,j]=v.useState("all"),[b,y]=v.useState(!1),C=t.get("mode")==="within-run"?"within-run":"runs",N=t.get("runId")??"",E=(t.get("agents")??"").split(",").map(X=>X.trim()).filter(Boolean),_=t.get("scenario")??"all",[P,O]=v.useState(C),[R,L]=v.useState(N),[T,D]=v.useState(E),[M,G]=v.useState(_),[B,W]=v.useState(!1),q=async()=>{o(!0);try{a(await e.listResults())}catch(X){Pe({title:"Could not load results",description:X instanceof Error?X.message:String(X),variant:"destructive"})}finally{o(!1)}};v.useEffect(()=>{let X=!0;return o(!0),e.listResults().then(ge=>{X&&a(ge)}).catch(ge=>{X&&Pe({title:"Could not load results",description:ge instanceof Error?ge.message:String(ge),variant:"destructive"})}).finally(()=>{X&&o(!1)}),()=>{X=!1}},[e]);const V=X=>{if(f===X){x(ge=>ge==="asc"?"desc":"asc");return}h(X),x(X==="timestamp"?"desc":"asc")},F=X=>{d(ge=>{const ue=new Set(ge);return ue.has(X)?ue.delete(X):ue.add(X),ue})},U=v.useMemo(()=>{const X=new Set;return r.forEach(ge=>{ge.scenarios.forEach(ue=>{const De=String(ue.scenarioName??"").trim(),Ye=String(ue.scenarioId??"").trim(),Ct=De||Ye;Ct&&X.add(Ct)})}),Array.from(X).sort((ge,ue)=>ge.localeCompare(ue))},[r]),Z=v.useMemo(()=>g==="all"?r:r.filter(X=>X.scenarios.some(ge=>{const ue=String(ge.scenarioName??"").trim(),De=String(ge.scenarioId??"").trim();return(ue||De)===g})),[r,g]),z=v.useMemo(()=>[...Z].sort((ge,ue)=>{let De=0;return f==="id"&&(De=ge.id.localeCompare(ue.id)),f==="timestamp"&&(De=new Date(ge.timestamp).getTime()-new Date(ue.timestamp).getTime()),f==="passRate"&&(De=ge.overallPassRate-ue.overallPassRate),f==="scenarios"&&(De=ge.totalScenarios-ue.totalScenarios),p==="asc"?De:-De}),[Z,f,p]),$=v.useMemo(()=>z.filter(X=>c.has(X.id)),[z,c]),te=X=>f!==X?s.jsx(rc,{className:"h-3.5 w-3.5 text-muted-foreground"}):p==="asc"?s.jsx(hs,{className:"h-3.5 w-3.5"}):s.jsx(Wt,{className:"h-3.5 w-3.5"}),se=v.useMemo(()=>{const X=new Map;for(const ge of z)X.set(ge.id,$ge(ge));return X},[z]),Q=X=>{const ge=Array.from(new Set(X.scenarios.map(ue=>ue.agentId).filter(Boolean)));return ge.slice(0,Math.min(2,ge.length))},ce=X=>{O("within-run"),L(X.id),D(Q(X)),G("all")},le=v.useMemo(()=>[...new Set($.flatMap(X=>X.scenarios.map(ge=>ge.scenarioId)))],[$]),me=v.useMemo(()=>r.find(X=>X.id===R),[r,R]),oe=v.useMemo(()=>{if(!me)return[];const X=new Map;for(const ge of me.scenarios)X.set(ge.agentId,ge.agentName||ge.agentId);return Array.from(X.entries()).map(([ge,ue])=>({id:ge,name:ue})).sort((ge,ue)=>ge.name.localeCompare(ue.name))},[me]),fe=v.useMemo(()=>{if(!me)return[];const X=new Set;for(const ge of me.scenarios){const ue=String(ge.scenarioName??"").trim(),De=String(ge.scenarioId??"").trim(),Ye=ue||De;Ye&&X.add(Ye)}return Array.from(X).sort((ge,ue)=>ge.localeCompare(ue))},[me]),Ce=v.useMemo(()=>T.join(","),[T]);v.useEffect(()=>{if(P!=="within-run"||r.length===0)return;let X=R;(!X||!r.some(mt=>mt.id===X))&&(X=r[0].id);const ge=r.find(mt=>mt.id===X),ue=(()=>{if(!ge)return[];const mt=new Map;for(const Nt of ge.scenarios)mt.set(Nt.agentId,Nt.agentName||Nt.agentId);return Array.from(mt.keys())})(),De=new Set(ue);let Ye=Ce.split(",").map(mt=>mt.trim()).filter(mt=>!!mt).filter(mt=>De.has(mt));Ye.length===0&&ue.length>0&&(Ye=ue.slice(0,Math.min(2,ue.length)));const Ct=(()=>{if(!ge)return[];const mt=new Set;for(const Nt of ge.scenarios){const Vt=String(Nt.scenarioName??"").trim(),pn=String(Nt.scenarioId??"").trim(),ln=Vt||pn;ln&&mt.add(ln)}return new Set(mt)})(),Ft=M!=="all"&&!Ct.has(M)?"all":M;X!==R&&L(X),Ye.join(",")!==Ce&&D(Ye),Ft!==M&&G(Ft)},[P,r,R,Ce,M]),v.useEffect(()=>{const X=new URLSearchParams(t);P==="within-run"?(X.set("mode","within-run"),R?X.set("runId",R):X.delete("runId"),T.length>0?X.set("agents",T.join(",")):X.delete("agents"),M!=="all"?X.set("scenario",M):X.delete("scenario")):(X.delete("mode"),X.delete("runId"),X.delete("agents"),X.delete("scenario"));const ge=t.toString(),ue=X.toString();ge!==ue&&n(X,{replace:!0})},[P,R,T,M,n]);const ae=v.useMemo(()=>{if(!me)return[];const X=new Map;for(const ue of me.scenarios){const De=String(ue.scenarioId??"").trim(),Ye=String(ue.scenarioName??"").trim(),Ct=Ye||De;if(!De&&!Ct)continue;const Ft=De||Ct,mt=X.get(Ft);if(mt){mt.byAgent[ue.agentId]=ue;continue}X.set(Ft,{scenarioId:De||Ct,scenarioName:Ye,displayLabel:Ct||De,byAgent:{[ue.agentId]:ue}})}const ge=Array.from(X.values()).sort((ue,De)=>{const Ye=(ue.displayLabel||ue.scenarioId).toLowerCase(),Ct=(De.displayLabel||De.scenarioId).toLowerCase();return Ye.localeCompare(Ct)});return M==="all"?ge:ge.filter(ue=>ue.displayLabel===M)},[me,M]),Re=v.useMemo(()=>{const X=new Map(oe.map(ge=>[ge.id,ge]));return T.map(ge=>X.get(ge)).filter(ge=>!!ge)},[T,oe]),Ae=v.useMemo(()=>{if(!me||Re.length!==2)return null;const[X,ge]=Re;return{left:X,right:ge,link:`/compare/results?left=${encodeURIComponent(me.id)}&right=${encodeURIComponent(me.id)}&leftConfig=${encodeURIComponent(me.configId)}&rightConfig=${encodeURIComponent(me.configId)}&leftAgent=${encodeURIComponent(X.id)}&rightAgent=${encodeURIComponent(ge.id)}`}},[me,Re]),Te=v.useMemo(()=>!me||Re.length===0?[]:Re.map(X=>{const ue=ae.map(mt=>mt.byAgent[X.id]).filter(mt=>!!mt).flatMap(mt=>mt.runs),De=ue.length,Ye=ue.filter(mt=>mt.passed).length,Ct=ue.reduce((mt,Nt)=>mt+Nt.toolCalls.length,0),Ft=ue.reduce((mt,Nt)=>mt+Nt.duration,0);return{agentId:X.id,agentName:X.name,passRate:De===0?0:Ye/De,totalRuns:De,avgToolCalls:De===0?0:Ct/De,avgLatency:De===0?0:Ft/De}}),[me,Re,ae]),be=X=>{D(ge=>ge.includes(X)?ge.filter(ue=>ue!==X):[...ge,X])},_e=X=>s.jsxs("div",{className:"rounded border bg-muted/20 px-2 py-1.5",children:[s.jsxs("div",{className:"text-xs",children:[s.jsxs("span",{className:"font-mono",children:["#",X.runIndex+1]})," ",s.jsx("span",{className:X.passed?"text-emerald-700":"text-destructive",children:X.passed?"PASS":"FAIL"})," ","· tools: ",X.toolCalls.length," · ",X.duration,"ms"]}),!X.passed&&X.failureReasons.length>0&&s.jsx("div",{className:"mt-1 text-[11px] text-muted-foreground",children:X.failureReasons.join("; ")})]},X.runIndex);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(QS,{className:"h-6 w-6"}),"Compare Runs"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:P==="runs"?"Select 2–5 runs to compare":"Compare agents side-by-side within one run"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[P==="runs"&&s.jsxs(Hc,{open:b,onOpenChange:y,children:[s.jsx(Kc,{asChild:!0,children:s.jsxs(re,{type:"button",variant:"outline",role:"combobox","aria-expanded":b,className:"w-[260px] justify-between font-normal",children:[s.jsx("span",{className:"truncate text-left",children:g==="all"?"All scenarios":g}),s.jsx(Wt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(Ho,{className:"w-[260px] p-0",align:"start",children:s.jsxs(Go,{children:[s.jsx(Yo,{placeholder:"Search scenarios..."}),s.jsxs(Xo,{children:[s.jsx(Qo,{children:"No scenarios found."}),s.jsxs(Jo,{children:[s.jsx(aa,{value:"all scenarios",onSelect:()=>{j("all"),y(!1)},children:"All scenarios"}),U.map(X=>s.jsx(aa,{value:X,onSelect:()=>{j(X),y(!1)},children:X},X))]})]})]})})]}),s.jsx(re,{variant:"outline",onClick:()=>{q()},disabled:i,children:i?"Refreshing...":"Refresh"})]})]}),s.jsx(qe,{children:s.jsx(We,{className:"pt-6",children:s.jsx("div",{className:"flex flex-wrap gap-2",children:s.jsx(re,{type:"button",variant:P==="runs"?"default":"outline",size:"sm",onClick:()=>O("runs"),children:"Run vs Run"})})})}),P==="within-run"&&s.jsxs(qe,{children:[s.jsx(At,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx(_t,{className:"text-base",children:"Within One Run Controls"}),s.jsx(re,{type:"button",variant:"outline",size:"sm",onClick:()=>O("runs"),children:"Back to run list"})]})}),s.jsxs(We,{className:"space-y-4",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(Pn,{value:R,onValueChange:L,children:[s.jsx(An,{children:s.jsx(kn,{placeholder:"Select run"})}),s.jsx(_n,{children:r.map(X=>s.jsx(dt,{value:X.id,children:X.id},X.id))})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Scenario filter"}),s.jsxs(Hc,{open:B,onOpenChange:W,children:[s.jsx(Kc,{asChild:!0,children:s.jsxs(re,{type:"button",variant:"outline",role:"combobox","aria-expanded":B,className:"w-full justify-between font-normal",children:[s.jsx("span",{className:"truncate text-left",children:M==="all"?"All scenarios":M}),s.jsx(Wt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(Ho,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:s.jsxs(Go,{children:[s.jsx(Yo,{placeholder:"Search scenarios..."}),s.jsxs(Xo,{children:[s.jsx(Qo,{children:"No scenarios found."}),s.jsxs(Jo,{children:[s.jsx(aa,{value:"all scenarios",onSelect:()=>{G("all"),W(!1)},children:"All scenarios"}),fe.map(X=>s.jsx(aa,{value:X,onSelect:()=>{G(X),W(!1)},children:X},X))]})]})]})})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Agents (select 2+)"}),s.jsxs("div",{className:"flex flex-wrap gap-3 rounded-md border p-3",children:[oe.length===0&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"No agents available for selected run."}),oe.map(X=>s.jsxs("label",{className:"inline-flex items-center gap-2 text-sm",children:[s.jsx(Wr,{checked:T.includes(X.id),onCheckedChange:()=>be(X.id)}),s.jsx("span",{children:X.name})]},X.id))]})]})]})]}),P==="runs"&&s.jsx(qe,{children:s.jsx(We,{className:"p-0",children:s.jsxs(Br,{children:[s.jsx(zr,{children:s.jsxs(qt,{children:[s.jsx(tt,{className:"w-10"}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>V("id"),children:["Run ID",te("id")]})}),s.jsx(tt,{children:"Evaluated"}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>V("timestamp"),children:["Timestamp",te("timestamp")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>V("passRate"),children:["Pass Rate",te("passRate")]})}),s.jsx(tt,{children:s.jsxs("button",{type:"button",className:"inline-flex items-center gap-1 hover:text-foreground",onClick:()=>V("scenarios"),children:["Scenarios",te("scenarios")]})}),s.jsx(tt,{children:"Agents"}),s.jsx(tt,{className:"w-[140px] text-right",children:"Action"})]})}),s.jsx(Ur,{children:z.map(X=>s.jsxs(qt,{children:[s.jsx(Be,{children:s.jsx(Wr,{checked:c.has(X.id),onCheckedChange:()=>F(X.id),disabled:!c.has(X.id)&&c.size>=5})}),s.jsx(Be,{className:"font-mono text-xs",children:X.id}),s.jsx(Be,{className:"text-[11px] text-muted-foreground",children:(()=>{const ge=se.get(X.id);return s.jsxs("div",{className:"space-y-0.5",children:[s.jsxs("div",{children:["Evaluated: ",ge.scenarioCount," scenario",ge.scenarioCount===1?"":"s"," · ",ge.agentCount," agent",ge.agentCount===1?"":"s"]}),s.jsx("div",{className:"font-mono text-xs text-foreground/80",children:ge.scenarioPreview})]})})()}),s.jsx(Be,{className:"text-xs text-muted-foreground",children:new Date(X.timestamp).toLocaleString()}),s.jsx(Be,{children:s.jsx(Ks,{rate:X.overallPassRate})}),s.jsx(Be,{className:"font-mono text-sm",children:X.totalScenarios}),s.jsx(Be,{className:"font-mono text-sm",children:se.get(X.id)?.agentCount??0}),s.jsx(Be,{className:"text-right",children:(se.get(X.id)?.agentCount??0)>1?s.jsx(re,{type:"button",size:"sm",variant:"outline",onClick:()=>ce(X),children:"Compare agents"}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})})]},X.id))})]})})}),P==="runs"&&$.length>=2&&s.jsxs(s.Fragment,{children:[$.length===2&&s.jsx(qe,{children:s.jsx(We,{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(re,{asChild:!0,size:"sm",children:s.jsx(wt,{to:`/compare/results?left=${encodeURIComponent($[0].id)}&right=${encodeURIComponent($[1].id)}&leftConfig=${encodeURIComponent($[0].configId)}&rightConfig=${encodeURIComponent($[1].configId)}`,children:"Compare full results"})})]})})}),s.jsxs(qe,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(_t,{className:"text-base",children:"Summary Comparison"})}),s.jsx(We,{className:"p-0",children:s.jsxs(Br,{children:[s.jsx(zr,{children:s.jsxs(qt,{children:[s.jsx(tt,{children:"Metric"}),$.map((X,ge)=>s.jsx(tt,{style:{color:Bj[ge]},className:"font-mono text-xs",children:X.id},X.id))]})}),s.jsxs(Ur,{children:[s.jsxs(qt,{children:[s.jsx(Be,{className:"font-medium",children:"Pass Rate"}),$.map(X=>s.jsx(Be,{children:s.jsx(Ks,{rate:X.overallPassRate})},X.id))]}),s.jsxs(qt,{children:[s.jsx(Be,{className:"font-medium",children:"Total Runs"}),$.map(X=>s.jsx(Be,{className:"font-mono",children:X.totalRuns},X.id))]}),s.jsxs(qt,{children:[s.jsx(Be,{className:"font-medium",children:"Tool Calls"}),$.map(X=>s.jsx(Be,{className:"font-mono",children:X.avgToolCalls.toFixed(1)},X.id))]}),s.jsxs(qt,{children:[s.jsx(Be,{className:"font-medium",children:"Avg Latency"}),$.map(X=>s.jsxs(Be,{className:"font-mono",children:[X.avgLatency,"ms"]},X.id))]})]})]})})]}),s.jsxs(qe,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(_t,{className:"text-base",children:"Scenario Breakdown"})}),s.jsx(We,{className:"p-0",children:s.jsxs(Br,{children:[s.jsx(zr,{children:s.jsxs(qt,{children:[s.jsx(tt,{children:"Scenario"}),$.map((X,ge)=>s.jsx(tt,{style:{color:Bj[ge]},className:"font-mono text-xs",children:X.id},X.id))]})}),s.jsx(Ur,{children:le.map(X=>s.jsxs(qt,{children:[s.jsx(Be,{className:"font-medium text-sm",children:X}),$.map(ge=>{const ue=ge.scenarios.find(De=>De.scenarioId===X);return s.jsx(Be,{children:ue?s.jsx(Ks,{rate:ue.passRate}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},ge.id)})]},X))})]})})]})]}),P==="runs"&&$.length>=2&&s.jsxs(qe,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(_t,{className:"text-base",children:"Pass Rate Trend"})}),s.jsx(We,{className:"h-72",children:s.jsx(Gh,{width:"100%",height:"100%",children:s.jsxs(kS,{data:$.map((X,ge)=>({idx:ge+1,runId:X.id,passRate:Number((X.overallPassRate*100).toFixed(1))})),children:[s.jsx(Hi,{dataKey:"idx",tickFormatter:X=>String(X)}),s.jsx(Ki,{unit:"%",domain:[0,100]}),s.jsx(Fr,{formatter:X=>[`${X}%`,"Pass Rate"],labelFormatter:X=>`Run ${X}`}),s.jsx(Ro,{}),s.jsx(qo,{type:"monotone",dataKey:"passRate",stroke:Bj[0],strokeWidth:2.5,dot:!0})]})})})]}),P==="within-run"&&me&&Re.length<2&&s.jsx(qe,{children:s.jsx(We,{className:"pt-6 text-sm text-muted-foreground",children:"Select at least 2 agents to compare side-by-side within this run."})}),P==="within-run"&&me&&Re.length>=2&&s.jsxs(s.Fragment,{children:[s.jsx(qe,{children:s.jsx(We,{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 full result details?"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:Ae?"Open a side-by-side full result view filtered by the selected agents.":"Open the complete run result page for all details and trace navigation."})]}),s.jsx(re,{asChild:!0,size:"sm",children:Ae?s.jsx(wt,{to:Ae.link,children:"Compare full results"}):s.jsx(wt,{to:`/results/${encodeURIComponent(me.id)}${me.configId?`?configId=${encodeURIComponent(me.configId)}`:""}`,children:"Open full result"})})]})})}),s.jsxs(qe,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(_t,{className:"text-base",children:"Agent Summary"})}),s.jsx(We,{className:"p-0",children:s.jsxs(Br,{children:[s.jsx(zr,{children:s.jsxs(qt,{children:[s.jsx(tt,{children:"Metric"}),Te.map(X=>s.jsx(tt,{className:"font-mono text-xs",children:X.agentName},X.agentId))]})}),s.jsxs(Ur,{children:[s.jsxs(qt,{children:[s.jsx(Be,{className:"font-medium",children:"Pass Rate"}),Te.map(X=>s.jsx(Be,{children:s.jsx(Ks,{rate:X.passRate})},X.agentId))]}),s.jsxs(qt,{children:[s.jsx(Be,{className:"font-medium",children:"Total Runs"}),Te.map(X=>s.jsx(Be,{className:"font-mono",children:X.totalRuns},X.agentId))]}),s.jsxs(qt,{children:[s.jsx(Be,{className:"font-medium",children:"Avg Tool Calls"}),Te.map(X=>s.jsx(Be,{className:"font-mono",children:X.avgToolCalls.toFixed(1)},X.agentId))]}),s.jsxs(qt,{children:[s.jsx(Be,{className:"font-medium",children:"Avg Latency"}),Te.map(X=>s.jsxs(Be,{className:"font-mono",children:[Math.round(X.avgLatency),"ms"]},X.agentId))]})]})]})})]}),s.jsxs(qe,{children:[s.jsx(At,{className:"pb-3",children:s.jsx(_t,{className:"text-base",children:"Scenario × Agent Matrix"})}),s.jsx(We,{className:"p-0",children:s.jsxs(Br,{children:[s.jsx(zr,{children:s.jsxs(qt,{children:[s.jsx(tt,{className:"w-[260px]",children:"Scenario"}),Re.map(X=>s.jsx(tt,{className:"font-mono text-xs",children:X.name},X.id))]})}),s.jsx(Ur,{children:ae.map(X=>s.jsxs(qt,{children:[s.jsx(Be,{className:"font-medium text-sm",children:X.displayLabel}),Re.map(ge=>{const ue=X.byAgent[ge.id];return ue?s.jsx(Be,{className:"align-top",children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"text-xs text-muted-foreground",children:[s.jsx(Ks,{rate:ue.passRate})," ",s.jsxs("span",{className:"ml-2",children:["runs: ",ue.runs.length]})," ","· calls: ",ue.avgToolCalls.toFixed(1)," · latency: ",Math.round(ue.avgDuration),"ms"]}),ue.runs.length>0?s.jsx("div",{className:"space-y-1.5",children:ue.runs.map(De=>_e(De))}):s.jsx("div",{className:"text-xs text-muted-foreground",children:"No runs captured."})]})},ge.id):s.jsx(Be,{children:s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})},ge.id)})]},X.scenarioId))})]})})]})]})]})},ZM=(e,t,n)=>{const r=new URLSearchParams;return t&&r.set("configId",t),n&&r.set("agent",n),r.set("embed","1"),`/results/${encodeURIComponent(e)}?${r.toString()}`},e$=(e,t,n)=>{const r=new URLSearchParams;t&&r.set("configId",t),n&&r.set("agent",n);const a=r.toString();return`/results/${encodeURIComponent(e)}${a?`?${a}`:""}`},Lge=()=>{const[e]=Xi(),t=e.get("left")??"",n=e.get("right")??"",r=e.get("leftConfig"),a=e.get("rightConfig"),i=e.get("leftAgent"),o=e.get("rightAgent"),c=i?`${t} · ${i}`:t,d=o?`${n} · ${o}`:n;return!t||!n?s.jsxs(qe,{children:[s.jsx(At,{children:s.jsx(_t,{className:"text-base",children:"Full Result Compare"})}),s.jsxs(We,{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(re,{asChild:!0,variant:"outline",children:s.jsx(wt,{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:i||o?"Side-by-side Result Detail views for deep inspection, filtered by selected agents.":"Side-by-side Result Detail views for deep inspection."})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(re,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs(wt,{to:"/compare",children:[s.jsx(V7,{className:"mr-1.5 h-4 w-4"}),"Back to Compare"]})}),s.jsx(re,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:e$(t,r,i),target:"_blank",rel:"noreferrer",children:["Open Left",s.jsx(_h,{className:"ml-1.5 h-3.5 w-3.5"})]})}),s.jsx(re,{variant:"outline",size:"sm",asChild:!0,children:s.jsxs("a",{href:e$(n,a,o),target:"_blank",rel:"noreferrer",children:["Open Right",s.jsx(_h,{className:"ml-1.5 h-3.5 w-3.5"})]})})]})]}),s.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[s.jsxs(qe,{className:"overflow-hidden",children:[s.jsx(At,{className:"py-3",children:s.jsx(_t,{className:"text-sm font-mono",children:c})}),s.jsx(We,{className:"p-0",children:s.jsx("iframe",{title:`Result ${c}`,src:ZM(t,r,i),className:"h-[calc(100vh-15rem)] w-full border-0"})})]}),s.jsxs(qe,{className:"overflow-hidden",children:[s.jsx(At,{className:"py-3",children:s.jsx(_t,{className:"text-sm font-mono",children:d})}),s.jsx(We,{className:"p-0",children:s.jsx("iframe",{title:`Result ${d}`,src:ZM(n,a,o),className:"h-[calc(100vh-15rem)] w-full border-0"})})]})]})]})};function Fge(e){return e.match(/(?:^|\/)(?:result-assistant|results?)\/([0-9]{8}-[0-9]{6})(?:-|\/)/i)?.[1]??null}function Bge(){const{source:e}=qn(),[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.listMarkdownReports())}catch(g){Pe({title:"Could not load markdown reports",description:g instanceof Error?g.message:String(g),variant:"destructive"})}finally{a(!1)}};v.useEffect(()=>{f()},[]);const h=v.useMemo(()=>t[0],[t]),p=v.useMemo(()=>t.find(g=>g.relativePath===i)??null,[t,i]),x=async()=>{if(i){d(!0);try{await e.deleteMarkdownReport(i),n(g=>g.filter(j=>j.relativePath!==i)),Pe({title:"Markdown report deleted"}),o(null)}catch(g){Pe({title:"Could not delete markdown report",description:g instanceof Error?g.message:String(g),variant:"destructive"})}finally{d(!1)}}};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(Ql,{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(re,{variant:"outline",onClick:()=>{f()},children:"Refresh"}),h?s.jsx(re,{asChild:!0,variant:"outline",children:s.jsx(wt,{to:`/markdown-reports/view?path=${encodeURIComponent(h.relativePath)}`,children:"Open latest"})}):null]})]}),s.jsx(qe,{children:s.jsx(We,{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(Br,{children:[s.jsx(zr,{children:s.jsxs(qt,{children:[s.jsx(tt,{children:"Report"}),s.jsx(tt,{children:"Result"}),s.jsx(tt,{children:"Folder"}),s.jsx(tt,{children:"Timestamp"}),s.jsx(tt,{className:"w-10"})]})}),s.jsx(Ur,{children:t.map(g=>s.jsxs(qt,{children:[s.jsx(Be,{children:s.jsxs("div",{className:"space-y-1",children:[s.jsx(wt,{to:`/markdown-reports/view?path=${encodeURIComponent(g.relativePath)}`,className:"font-mono text-xs text-primary hover:underline",children:g.name}),s.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:g.relativePath})]})}),s.jsx(Be,{className:"text-xs text-muted-foreground font-mono",children:(()=>{const j=Fge(g.relativePath);return j?s.jsx(wt,{to:`/results/${encodeURIComponent(j)}`,className:"text-primary hover:underline",children:j}):s.jsx("span",{className:"text-muted-foreground",children:"—"})})()}),s.jsx(Be,{className:"text-xs text-muted-foreground font-mono",children:g.relativePath.includes("/")?g.relativePath.slice(0,g.relativePath.lastIndexOf("/")):"."}),s.jsx(Be,{className:"text-xs text-muted-foreground",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(gf,{className:"h-3 w-3"}),new Date(g.mtime).toLocaleString()]})}),s.jsx(Be,{children:s.jsxs(du,{children:[s.jsx(fu,{asChild:!0,children:s.jsx(re,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Ym,{className:"h-4 w-4"})})}),s.jsxs(ul,{align:"end",children:[s.jsx(Pr,{asChild:!0,children:s.jsx(wt,{to:`/markdown-reports/view?path=${encodeURIComponent(g.relativePath)}`,children:"View"})}),s.jsxs(Pr,{className:"text-destructive",onSelect:j=>{j.preventDefault(),o(g.relativePath)},children:[s.jsx(_a,{className:"mr-2 h-3.5 w-3.5"})," Delete"]})]})]})})]},g.path))})]})})}),s.jsx(Os,{open:!!i,onOpenChange:g=>!g&&o(null),children:s.jsxs(Ja,{children:[s.jsxs(Za,{children:[s.jsx(ts,{children:"Delete markdown report?"}),s.jsx(ns,{children:p?`Delete '${p.name}' from disk? This cannot be undone.`:"Delete this report from disk? This cannot be undone."})]}),s.jsxs(es,{children:[s.jsx(as,{disabled:c,children:"Cancel"}),s.jsx(rs,{onClick:g=>{g.preventDefault(),x()},disabled:c,children:c?"Deleting...":"Delete"})]})]})})]})}function zge(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Uge(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 qge(){const{source:e}=qn(),[t]=Xi(),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 x=!0;if(a(null),d(!1),!n){o(!1);return}return o(!0),e.getMarkdownReport(n).then(g=>{x&&a(g)}).catch(g=>{if(!x)return;const j=g instanceof Error?g.message:String(g);if(j.includes("(404)")){d(!0);return}Pe({title:"Could not load markdown report",description:j,variant:"destructive"})}).finally(()=>{x&&o(!1)}),()=>{x=!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(re,{asChild:!0,variant:"outline",children:s.jsx(wt,{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(re,{asChild:!0,variant:"outline",children:s.jsx(wt,{to:"/markdown-reports",children:"Back to Markdown Reports"})})]});const p=Uge(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()," "," · "," ",zge(r.sizeBytes)]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[p?s.jsxs(s.Fragment,{children:[s.jsx(re,{variant:"outline",size:"sm",onClick:()=>h(!0),children:"Open Result Panel"}),s.jsx(re,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(wt,{to:`/results/${encodeURIComponent(p)}`,children:"Open Result"})})]}):null,s.jsx(re,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(wt,{to:"/markdown-reports",children:"Back to reports"})})]})]}),s.jsx(qe,{children:s.jsx(We,{className:"pt-6",children:s.jsx(wd,{text:r.content,variant:"assistant"})})}),p?s.jsx(x3,{open:f,onOpenChange:h,children:s.jsxs(SN,{side:"right",className:"w-[96vw] max-w-none p-0 sm:max-w-5xl",children:[s.jsx(b3,{className:"border-b px-4 py-3 pr-12",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(w3,{className:"text-base",children:["Result ",p]}),s.jsx(re,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(wt,{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 Wge=()=>{const e=_s();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"})]})})},Vge=new OV;function Hge(){const{scenarioId:e}=tl();return s.jsx(BD,{to:e?`/libraries/test-cases/${encodeURIComponent(e)}`:"/libraries/test-cases",replace:!0})}const Kge=()=>s.jsx(TV,{client:Vge,children:s.jsx(dN,{children:s.jsx(VG,{children:s.jsx(YG,{children:s.jsxs(GG,{children:[s.jsx(Lq,{}),s.jsx(v9,{}),s.jsx(IH,{children:s.jsxs(CH,{children:[s.jsxs(un,{element:s.jsx(KG,{}),children:[s.jsx(un,{path:"/",element:s.jsx(jfe,{})}),s.jsx(un,{path:"/mcp-evaluations",element:s.jsx(Zpe,{})}),s.jsx(un,{path:"/mcp-evaluations/:id",element:s.jsx(EM,{})}),s.jsx(un,{path:"/mcp-evaluations/:id/:tab",element:s.jsx(EM,{})}),s.jsx(un,{path:"/tool-analysis",element:s.jsx(vge,{})}),s.jsx(un,{path:"/tool-analysis-results",element:s.jsx(gge,{})}),s.jsx(un,{path:"/tool-analysis-results/:id",element:s.jsx(xge,{})}),s.jsx(un,{path:"/oauth-debugger",element:s.jsx(wge,{})}),s.jsx(un,{path:"/libraries/servers",element:s.jsx(Dme,{})}),s.jsx(un,{path:"/libraries/servers/:serverId",element:s.jsx(Fme,{})}),s.jsx(un,{path:"/libraries/agents",element:s.jsx(Bme,{})}),s.jsx(un,{path:"/libraries/agents/:agentName",element:s.jsx(Xve,{})}),s.jsx(un,{path:"/libraries/test-cases",element:s.jsx($M,{})}),s.jsx(un,{path:"/libraries/test-cases/:testCaseId",element:s.jsx($M,{})}),s.jsx(un,{path:"/libraries/scenarios",element:s.jsx(BD,{to:"/libraries/test-cases",replace:!0})}),s.jsx(un,{path:"/libraries/scenarios/:scenarioId",element:s.jsx(Hge,{})}),s.jsx(un,{path:"/settings",element:s.jsx(Qve,{})}),s.jsx(un,{path:"/run",element:s.jsx(jge,{})}),s.jsx(un,{path:"/results",element:s.jsx(Nge,{})}),s.jsx(un,{path:"/results/:id",element:s.jsx(kge,{})}),s.jsx(un,{path:"/markdown-reports",element:s.jsx(Bge,{})}),s.jsx(un,{path:"/markdown-reports/view",element:s.jsx(qge,{})}),s.jsx(un,{path:"/compare",element:s.jsx(Dge,{})}),s.jsx(un,{path:"/compare/results",element:s.jsx(Lge,{})})]}),s.jsx(un,{path:"*",element:s.jsx(Wge,{})})]})})]})})})})});BU.createRoot(document.getElementById("root")).render(s.jsx(Kge,{}));